330 Commits

Author SHA1 Message Date
VariantConst 23a45e611c Change Helius endpoints from HTTPS to HTTP
Change Helius endpoints from HTTPS to HTTP
2026-02-27 23:49:38 +08:00
Wood 0cd276d6cb feat: Helius Sender SWQOS support and global check_min_tip option
- Add Helius Sender client (helius.rs) with dual routing and swqos_only mode
- Helius min tip: 0.0002 SOL default, 0.000005 SOL when swqos_only=true
- Add TradeConfig.check_min_tip (default false) to skip min-tip validation for lower latency
- Thread check_min_tip through SwapParams and execute_parallel; only call min_tip_sol when enabled
- Add SWQOS_ENDPOINTS_HELIUS and HELIUS_TIP_ACCOUNTS in constants
- Extend SwqosConfig/SwqosType for Helius; add Helius to get_endpoint and get_swqos_client
- Update trading_client, shared_infrastructure and middleware_system examples

Made-with: Cursor
2026-02-27 15:00:13 +08:00
Wood 82438479d3 chore: fix all examples to compile and expand workspace
- Add pumpfun_copy_trading and pumpfun_sniper_trading to workspace members
- Add grpc_recv_us field to all TradeBuyParams/TradeSellParams in examples
- Switch address_lookup and nonce_cache to sol-parser-sdk, use event is_cashback_coin
- Remove invalid rustls call from pumpfun examples for successful build
- All 18 examples pass cargo check --workspace

Made-with: Cursor
2026-02-27 13:44:22 +08:00
Wood 3d062279d9 chore: release v3.5.4
- Bump version to 3.5.4; update README and README_CN
- Astralane: irisb binary API (no Base64), POST /irisb with query api-key&method; constants use /irisb endpoints; ping POST getHealth
- BlockRazor: Send Transaction v2 (plain Base64 body, Content-Type text/plain, auth in URI only); ping POST /v2/health; use default_http_client_builder
- SWQOS: all clients use default_http_client_builder (nextblock, temporal, zeroslot, astralane, lightspeed, jito, flashblock); remove unused Duration imports

Made-with: Cursor
2026-02-27 02:30:52 +08:00
Wood dd4f42324e feat: IDL updates, PumpFun/PumpSwap instruction and utils, fast_fn, release notes
- idl: pump.json and pump_amm.json updates
- instruction: pumpfun.rs, pumpswap.rs and utils (pumpfun, pumpswap)
- common: fast_fn.rs
- docs: release_notes_v3.5.0.md

Made-with: Cursor
2026-02-27 00:27:36 +08:00
vibes 1b7e3781c7 Fix confirmation polling to check all channel signatures
In v3.5.0, confirmation was split out of execute_parallel into
poll_transaction_confirmation, but it only polled sig[0]. When
multi-channel submit is used, each channel produces a different
signature and only one lands on-chain. If the landed sig is not
sig[0], the poll times out after 15s and reports failure despite
a successful on-chain transaction.

Add poll_any_transaction_confirmation() that passes all signatures
to get_signature_statuses in a single RPC call per poll, returning
the first one that confirms. The executor now uses this instead of
polling a single signature.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 09:16:50 +00:00
Wood 807b015fc3 Release v3.5.0: performance, constants, bilingual docs
- Bump version to 3.5.0
- Performance: hot-path timing only when log_enabled/simulate; execute_parallel takes &[Arc<SwqosClient>]; shared HTTP client constants for SWQoS
- Code quality: validate_protocol_params extracted for buy/sell; BYTES_PER_ACCOUNT, MAX_INSTRUCTIONS_WARN, HTTP timeout constants; prefetch/syscall bypass comments
- Documentation: bilingual (EN + 中文) doc comments in execution, executor, perf, swqos; README/README_CN version and What's new in 3.5.0
- Add release_notes_v3.5.0.md

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-25 01:25:42 +08:00
Wood 5e4977f6a6 perf(swqos): reduce submit latency and fix high latency after 5 min idle
- Make serialize_transaction_and_encode sync and route through buffer pool
  (serialization::serialize_transaction_sync) to cut allocs on hot path
- Build single-submit body with format! instead of json!+to_string() in bloxroute
- Add serialize_transactions_batch_sync; bloxroute batch uses it and format! for entries
- Fix first-submit cold start: immediate first ping, then 30s keepalive interval
- Fix high latency after ~5 min: pool_max_idle_per_host=4, pool_idle_timeout=300s
  (BlockRazor, Temporal, Node1, Astralane, Stellium) so submit reuses ping connection
- Ping: 1.5s timeout, consume response body so connection returns to pool
- poll_transaction_confirmation: avoid cloning status.value[0], use ref
- Translate all swqos comments to English

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-20 02:18:02 +08:00
Wood c27e479659 feat: pass is_cashback_coin from events; PumpFun examples use sol-parser-sdk only
- PumpFunParams/BondingCurve: from_trade/from_dev_trade take is_cashback_coin parameter
- pumpfun_copy_trading and pumpfun_sniper_trading use sol-parser-sdk for gRPC, pass e.is_cashback_coin
- address_lookup/nonce_cache call sites updated; README EN/CN Cashback and example notes

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 01:34:12 +08:00
Wood a048f3b6ad feat: PumpFun & PumpSwap Cashback support
- Sync IDL from pump-public-docs into idl/
- Add is_cashback_coin to BondingCurve and Pool
- Pump sell: append UserVolumeAccumulator as remaining account when cashback coin
- PumpSwap buy/sell: append cashback remaining accounts after fee_config/fee_program
- Add claim_cashback instructions and TradingClient.claim_cashback_pumpfun/pumpswap()
- Add docs/PUMP_CASHBACK_README.md

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-18 23:01:14 +08:00
Wood feaac5ddd2 fix: WSOL ATA creation in background with retry/timeout; silence unused and deprecated warnings
- lib: WSOL ATA creation moved to background to avoid blocking startup; ensure_wsol_ata adds 3 retries and 10s timeout
- lib: cfg(feature = "perf-trace") for DEFAULT_SLIPPAGE usage
- gas_fee_strategy, bloxroute, transaction_builder, async_executor, executor: prefix unused vars/params with underscore or allow
- pumpswap: add allow(deprecated) for get_program_accounts_with_config

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 23:38:59 +08:00
speedlanding f10d0309ed feat(swqos): Add Speedlanding 2026-01-17 10:48:19 +08:00
vibes 7b984231a2 Fix Soyas client to match other SWQOS clients
Previously Soyas returned early on successful send without:
- Any logging
- Polling for transaction confirmation

Now aligned with other SWQOS clients (zeroslot, lightspeed, etc.):
- Proper error handling with reconnect retry
- Always poll for transaction confirmation
- Log confirmation success/failure with elapsed time

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:52:07 +00:00
vibes c7f694e9a0 Make use_exact_sol_amount optional with true default for PumpFun/PumpSwap
- Change use_exact_sol_amount from bool to Option<bool>
- Default to true (via unwrap_or) for PumpFun and PumpSwap DEXes
- Option is ignored for other DEXes (Raydium, Bonk, Meteora)
- Update all examples to use None (which defaults to true for applicable DEXes)
- Update README documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 11:53:09 +00:00
vibes ea22d48919 Rename use_exact_in_instruction to use_exact_sol_amount
More intuitive name that better describes what the flag does.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 10:36:45 +00:00
vibes 18c769f7e3 Add use_exact_in_instruction to TradeBuyParams
Pass through the new field from TradeBuyParams to SwapParams so users
can opt-in to using buy_exact_sol_in and buy_exact_quote_in instructions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 10:36:05 +00:00
vibes 16996b24d4 Add buy_exact_sol_in and buy_exact_quote_in instruction support
- Add BUY_EXACT_SOL_IN_DISCRIMINATOR for PumpFun
- Add BUY_EXACT_QUOTE_IN_DISCRIMINATOR for PumpSwap
- Add use_exact_in_instruction field to SwapParams
- When enabled, uses exact input instructions that spend exactly the
  specified SOL/quote amount with slippage applied to output tokens
- Defaults to false for backwards compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 10:32:56 +00:00
vibes 3146d012c7 feat: add shared infrastructure support for multi-wallet trading
Introduce TradingInfrastructure to allow multiple wallets to share the same
RPC client and SWQOS clients, reducing initialization overhead and memory usage.

Changes:
- Add InfrastructureConfig struct for wallet-independent configuration
- Add TradingInfrastructure struct to hold shared RPC/SWQOS clients
- Refactor TradingClient to use Arc<TradingInfrastructure>
- Add from_infrastructure() for fast client creation from shared infrastructure
- Add from_infrastructure_with_wsol_setup() for async WSOL ATA setup
- Maintain backwards compatibility with existing TradingClient::new() API

Benefits:
- First wallet: Full initialization (~200-500ms)
- Subsequent wallets (same config): Fast creation (~1-2ms)
- Memory: Single set of RPC/SWQOS clients shared across wallets
2026-01-05 19:40:53 +00:00
Wood 321f4c4a25 feat: optimize RPC polling and remove data size limit
Significantly reduce RPC pressure and fix MaxLoadedAccountsDataSizeExceeded errors.

Major improvements:
1. Add wait_confirmation parameter to all swqos clients
   - Skip polling entirely when wait_transaction_confirmed=false (100% RPC reduction)
   - Optimize getTransaction calls to only execute on errors or after 10s (50% reduction)
   - Update all 13 swqos client implementations

2. Remove LoadedAccountsDataSize instruction and data_size_limit parameter
   - Eliminate MaxLoadedAccountsDataSizeExceeded errors reported by users
   - Clean up gas_fee_strategy, params, and transaction builder
   - Simplify compute budget instruction generation

Results:
- Single channel: 30 RPC calls → 0-15 calls (50-100% reduction)
- Multi-channel (3x): 90 RPC calls → 0-45 calls (50-100% reduction)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 13:15:16 +08:00
matt-soyas 72be190f39 [feat: swqos] Add soyas tokyo endpoint 2025-12-26 01:25:22 +08:00
Wood 46512370ff Merge pull request #60 from matt-soyas/main
[feat: swqos] Add soyas london endpoint
2025-12-24 21:08:41 +08:00
VariantConst b57abc1a6c Update Node1's endpoint in Tokyo.
Update Node1's endpoint in Tokyo.
2025-12-24 17:58:48 +08:00
matt-soyas 8337be5a22 [feat: swqos] Add soyas london endpoint 2025-12-23 01:35:52 +08:00
Wood 2c3d617c6e feat(swqos): add SWQOS provider blacklist configuration
- Add SWQOS_BLACKLIST constant for disabling specific providers
- Add SwqosConfig::is_blacklisted() method to check blacklist status
- Skip blacklisted providers during client initialization with warning
- Remove NextBlock references from README, README_CN and examples
- NextBlock is blacklisted by default, can be enabled by removing from SWQOS_BLACKLIST
2025-12-20 16:45:29 +08:00
matt-soyas 413919340c feat(swqos): Add Soyas 2025-12-19 17:48:09 +08:00
Wood 2bd5f4f82c Merge pull request #57 from HelvetiCrypt/fix/early-exit-on-landed-failed-tx
fix: early exit when tx lands but fails on-chain
2025-12-19 17:29:47 +08:00
vibes 4da1a0e468 feat: use global BloxRoute endpoint as default
Change the default BloxRoute endpoint from germany.solana.dex.blxrbdn.com
to global.solana.dex.blxrbdn.com for better routing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 09:03:34 +00:00
vibes f1434a82c5 fix: early exit when tx lands but fails on-chain
When using multiple SWQOS channels with durable nonce, if one channel's
transaction lands on-chain but fails (e.g., ExceededSlippage), the nonce
is consumed and other channels cannot succeed.

Previously, the SDK would wait for all channels to timeout (~15s) before
returning, and would often return a generic "timeout" error instead of
the actual on-chain error.

This fix:
- Adds `landed_on_chain` field to TaskResult to track if tx landed
- Adds `is_landed_error()` to detect on-chain failures vs timeouts
- Adds `landed_failed_flag` to ResultCollector for early exit signaling
- Returns immediately with the actual error when a tx lands but fails

This makes behavior consistent with the success case - both return
immediately once the nonce is consumed.

Benefits:
1. Get the actual error (e.g., ExceededSlippage) instead of timeout
2. Return in ~1s instead of ~15s
3. Enable faster retry logic for callers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 08:48:54 +00:00
Wood 29842425e0 fix: 修复最低小费设置BUG 2025-12-18 16:47:59 +08:00
Wood ae2958995f fix: skip 8-byte discriminator when decoding PumpSwap pool data
Fixed a critical bug in find_by_base_mint and find_by_quote_mint functions
where pool data decoding failed because the 8-byte discriminator was not
being skipped. This caused all PumpSwapParams::from_mint_by_rpc calls to
fail with "No valid pool decoded" error.

Changes:
- Modified find_by_base_mint to skip discriminator: pool_decode(&acc.data[8..])
- Modified find_by_quote_mint to skip discriminator: pool_decode(&acc.data[8..])
- Added data length check to prevent out-of-bounds access
- Aligned with fetch_pool function which correctly uses &account.data[8..]

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 15:37:24 +08:00
abc 7c5a8b0f50 fix: correct instruction index in calculate_size function
- Fixed incorrect get() index from total_size + 1 to proper instruction index
- Use enumerate() to get correct instruction index for prefetch optimization
- Prevents array bounds errors and ensures correct next instruction prefetch

Bug: Using total_size (byte count) as array index for instruction lookup
Solution: Use enumerate() iterator index for proper instruction access
2025-12-09 23:58:26 +08:00
Wood b552973779 Merge remote changes with DexParamEnum API update 2025-12-08 01:42:54 +08:00
Wood 80ad2e052e refactor: update API with DexParamEnum and simplify TradeConfig
- Introduce DexParamEnum to replace Dex enum for protocol parameters
- Simplify TradeConfig::new() to accept only 3 essential parameters
- Update all examples to use new DexParamEnum API
- Optimize executor and params modules
- Remove deprecated wsol_use_seed and mint_use_seed parameters
- Fix fast_fn module exports
2025-12-08 01:35:40 +08:00
VariantConst 70d79ff993 Modify SWQoS endpoints
Updated SWQoS endpoints for 0slot and node1.
2025-12-05 19:37:45 +08:00
HelvetiCrypt 7d313dbfd0 feat(swqos): add Lightspeed (Solana Vibe Station) support
- Add LightspeedClient using standard JSON-RPC sendTransaction
- Add tip accounts (53PhM..., 9tYF5...)
- Add minimum tip constant (0.001 SOL)
- Endpoint format: https://<tier>.rpc.solanavibestation.com/lightspeed?api_key=<key>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 17:43:43 +00:00
ysq 1762b7739d Merge commit 'de8c55e599fa58e35e3f3dc68437f8ae4712d4ba' 2025-12-01 00:14:40 +08:00
ysq 353c814697 feat(swqos): add Stellium support and update minimum tip requirements 2025-12-01 00:13:34 +08:00
Wood de8c55e599 feat: add dynamic compute unit price update methods
添加动态优先费更新方法

## 新增方法
- update_buy_cu_price(): 动态更新买入优先费
- update_sell_cu_price(): 动态更新卖出优先费

## 功能
- 保持其他策略参数不变,仅更新 cu_price
- 使用 RCU 模式确保线程安全
- 支持所有 SwqosType 和 GasFeeStrategyType

## 应用场景
- 根据交易金额动态调整优先费
- 实时优化 gas 费用策略

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 00:11:38 +08:00
Wood 26311e9796 feat: return native Solana InstructionError code in TradeError
- Simplify error code handling by directly returning Solana's native InstructionError codes
- Custom errors return their embedded code directly
- Standard InstructionError variants map to fixed codes (1-10, 999)
- Remove nested match pattern for better code readability
- Error format: buy_failed|sig={signature}|code={error_code}|msg={message}

Benefits:
- More accurate error identification using native Solana error codes
- Simpler and cleaner code structure
- Easier to maintain and extend
- Consistent with Solana ecosystem standards
2025-11-28 06:40:05 +08:00
ysq 25fa295994 feat(swqos): enhance error message collection from transaction logs
Improve error message extraction in poll_transaction_confirmation to:
- Collect multiple error messages instead of stopping at the first one
- Add support for "Program log: Error: " format in addition to "Error Message: "
- Concatenate multiple errors with semicolon separator for comprehensive error reporting
2025-11-27 22:13:35 +08:00
ysq 0e491a8b80 Merge commit 'd0ae515af1c57db680794d65456d997844180a58' 2025-11-25 22:19:22 +08:00
yangdongcheng 9b9cb7e73a Merge branch '0xfnzero:main' into main 2025-11-25 09:28:28 +08:00
ysq 277c99a937 Merge commit '5358d9ea281fafde7fd526b62d9cc57dad0e0abd' 2025-11-24 22:59:47 +08:00
ysq c3630e4c99 feat: upgrade to v3.3.4 with improved error handling and transaction details
- Add TradeError struct with code, message, and instruction fields
- Enhance poll_transaction_confirmation to extract detailed error info from logs
- Change buy/sell return type from Option<anyhow::Error> to Option<TradeError>
- Add solana-transaction-status-client-types dependency
- Remove unused parallel.rs module
2025-11-24 22:52:56 +08:00
Wood 5358d9ea28 feat(swqos): add minimum tip constants and conditional transaction building
- Define minimum tip constants for each SWQOS provider (JITO, NextBlock, Node1, etc.)
- Add dynamic filtering in execute_parallel to skip transaction building when tip is below provider's minimum
- Add missing SWQOS_ENDPOINTS_ASTRALANE constant
- Ensure SWQOS clients are always initialized but transactions are conditionally built based on current tip amount
2025-11-24 06:03:31 +08:00
Wood 3132981f85 feat: add dynamic tip update methods to GasFeeStrategy
- Add update_buy_tip() method to dynamically update buy tip while keeping other parameters unchanged
- Add update_sell_tip() method to dynamically update sell tip while keeping other parameters unchanged
- Enable simple one-line tip updates for all configured SWQOS providers
- Support percentage-based dynamic tip calculation in trading bots
2025-11-23 21:02:55 +08:00
Wood 26cee93fb1 feat: optimize WSOL wrap/unwrap with seed account reuse check
- Add account existence check before creating seed account
- Implement wrap_wsol_to_sol_without_create for reusing existing seed accounts
- Prevent transaction failures when temporary seed account already exists
- Improve WSOL conversion efficiency by avoiding redundant account creation
2025-11-23 20:18:01 +08:00
Wood ce83b5ae68 Revert "refactor: split seed optimization config into wsol_use_seed and mint_use_seed"
This reverts commit eb8de36f50.
2025-11-22 01:41:06 +08:00
Wood eb8de36f50 refactor: split seed optimization config into wsol_use_seed and mint_use_seed
- Split use_seed_optimize parameter into two independent configs:
  * wsol_use_seed: controls seed optimization for WSOL ATA operations (default: false)
  * mint_use_seed: controls seed optimization for other mint ATA operations (default: true)

- Refactor TradeConfig to accept all parameters in new() constructor
- Remove deprecated builder methods (with_seed_config, with_wsol_ata_config)

- Add wsol_use_seed and mint_use_seed fields to SwapParams
- Remove open_seed_optimize field from SwapParams

- Update all instruction builders to use correct seed parameter:
  * Use params.wsol_use_seed for WSOL token operations
  * Use params.mint_use_seed for other token operations
  * Fix token type detection in bonk.rs, raydium_cpmm.rs, and raydium_amm_v4.rs
    to properly select wsol_use_seed when dealing with WSOL tokens

- Update wsol_manager functions to accept is_use_seed parameter:
  * handle_wsol()
  * close_wsol()
  * create_wsol_ata()
  * wrap_sol_only()
  * wrap_wsol_to_sol()

- Add wrap_wsol_to_sol() function with smart temporary account selection:
  * If source is seed-created, use normal ATA for temp account
  * If source is normal ATA, use seed ATA for temp account
  * Prevents address conflicts while optimizing performance

This provides fine-grained control over seed optimization strategies,
allowing different configurations for WSOL and other tokens.
2025-11-21 13:05:39 +08:00
home 042f7dcaad feat:优化判断买卖方向;直接用SwapParams里的参数 2025-11-20 21:21:28 +08:00