14 Commits

Author SHA1 Message Date
0xfnzero b09902c527 feat: harden trading SDK examples 2026-07-12 14:35:58 +08:00
0xfnzero 971ef41fad feat: add global MEV protection and refactor TradeConfig to builder pattern
- Add `mev_protection: bool` to `TradeConfig` and `InfrastructureConfig` (default: false)
  - Astralane QUIC: switches to port 9000 (MEV-protected endpoint) when enabled
  - BlockRazor HTTP: uses `mode=sandwichMitigation` query param when enabled
  - BlockRazor gRPC: uses `mode=sandwichMitigation` when enabled
- Add `SWQOS_ENDPOINTS_ASTRALANE_QUIC_MEV` constants (port 9000) to `constants/swqos.rs`
- Fix `astralane_quic.rs` IP candidates to use the actual port from the address (supports both 7000 and 9000)
- Refactor `TradeConfig` to builder pattern via `TradeConfig::builder()`
  - Introduce `TradeConfigBuilder` with all optional fields and clear defaults
  - `TradeConfig::new()` kept as a shortcut (calls `builder().build()`) for backward compatibility
  - Remove old `with_wsol_ata_config` / `with_check_min_tip` / `with_swqos_cores_from_end` / `with_mev_protection` chain methods
- Update all 16 examples to use `TradeConfig::builder()` with commented-out options so users can discover all available settings at a glance
- Update README.md and README_CN.md code snippets to use builder pattern

🤖 Generated with [Qoder][https://qoder.com]
2026-04-08 02:13:37 +08:00
hookenful 2abcf3839e style: run rustfmt 2026-03-14 18:16:55 +02:00
ysq 6e5362fdd0 chore: bump version to 3.3.5 and update examples with optimized token address functions 2025-11-25 22:18:57 +08:00
ysq c0e026a88a feat: add wrap_wsol_to_sol function with seed account optimization 2025-11-20 11:21:27 +08:00
ysq 85154f6c01 refactor: Update GasFeeStrategy to instance-based API and update docs 2025-10-07 23:12:37 +08:00
ysq a7f673b43d feat: upgrade to v2.0.0 with major dependency updates
- Upgrade Solana dependencies from 2.3.x to 3.0.0 series
  - Upgrade solana-streamer-sdk from 0.4.13 to 0.5.0
  - Upgrade yellowstone-grpc from 8.0.0 to 9.0.0
  - Add new SPL token utility modules (spl_token.rs, spl_token_2022.rs,
  spl_associated_token_account.rs)
  - Remove deprecated gRPC protocol definitions (protos/ directory)
  - Remove event_subscription example and update all example dependencies
  - Update README documentation to reflect v2.0.0 changes
  - Refactor imports to use new dependency structure across examples

  BREAKING CHANGES:
  - Solana SDK upgraded to 3.0.0 with API changes
  - Removed gRPC protocol definitions
  - Updated import paths for SPL token operations
2025-09-27 14:24:41 +08:00
ysq d1c001df36 refactor: move set_global_gas_fee_strategy to GasFeeStrategy struct 2025-09-19 23:59:52 +08:00
ysq e4a6b49aab refactor(gas-fee): replace init_builtin_fee_strategies with set_global_strategy
- Add customizable cu_limit, cu_price, buy_tip, sell_tip parameters
- Update all examples and documentation
- Simplify strategy configuration API
2025-09-19 23:31:41 +08:00
ysq a53038855e feat: add gas fee strategy system with examples
- Add GasFeeStrategy module supporting normal and high-low fee strategies
- Initialize gas fee strategies in all examples
- Update documentation and README with gas fee strategy configuration
- Improve nonce cache documentation emphasizing latest nonce usage
- Adjust default gas fee configuration parameters
- Remove duplicate imports and unused constant references
2025-09-19 15:46:51 +08:00
ysq 006686e8a3 feat: major gas fee strategy and documentation overhaul
- feat(gas): add comprehensive gas fee strategy management system
  * Implement GasFeeStrategyType with Default/LowTipHighCuPrice/HighTipLowCuPrice strategies
  * Add dynamic gas fee configuration per SWQOS service and trade type
  * Integrate arc-swap for thread-safe strategy updates

- docs: restructure documentation with dedicated guides
  * Add ADDRESS_LOOKUP_TABLE.md/CN.md for lookup table configuration
  * Add NONCE_CACHE.md/CN.md for nonce management documentation
  * Add TRADING_PARAMETERS.md/CN.md for comprehensive parameter guides
  * Simplify main README.md with focused overview

- refactor: update all examples with new gas fee strategy integration
  * Modernize 14 trading examples with consistent parameter handling
  * Improve error handling and configuration management
  * Enhance parallel trading implementation
2025-09-19 00:49:45 +08:00
ysq fad343ffbf Rollback 2025-09-17 11:14:15 +08:00
ysq c5ff7c1cbb refactor: Refactor SDK core architecture and trading parameter system
- Refactor SolanaTrade main class structure with improved modular design
- Refactor trading parameter system: BuyParams/SellParams -> InternalBuyParams/InternalSellParams
- Remove deprecated PriorityFee and related utility functions
- Add SwqosSettings to replace legacy SwqosConfig
- Add comprehensive technical documentation:
  • Address Lookup Table usage guide (EN/CN)
  • Nonce Cache mechanism documentation (EN/CN)
  • Trading Parameters documentation (EN/CN)
- Refactor all example code to adapt to new API interfaces
- Optimize public API design and code comments
- Clean up redundant utility functions and type definitions

Impact: 43 files changed, 2013 insertions(+), 1735 deletions(-)
2025-09-17 00:10:33 +08:00
ysq 48a6c6283a refactor: optimize trading execution architecture and add wSOL management
- Simplify TradeExecutor interface by integrating middleware and swqos clients into params
- Refactor parallel execution module with dedicated buy/sell execute functions
- Add SOL wrapping/unwrapping functionality for wSOL management
- Remove redundant parameter passing in sell operations
- Delete example main.rs file
- Optimize transaction building with integrated parameter structures

BREAKING CHANGE: TradeExecutor interface simplified, middleware and swqos_clients now passed through params
2025-09-09 17:02:24 +08:00