Commit Graph

481 Commits

Author SHA1 Message Date
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>
v3.5.0
2026-02-25 01:25:42 +08:00
Wood 8f6cc6fb08 chore: release v3.4.1 - bump version and update README crates.io docs
Co-authored-by: Cursor <cursoragent@cursor.com>
v3.4.1
2026-02-20 21:42:09 +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 9a8e3ffb2d docs: README 中英文更新 - Cashback 章节与大纲、示例与表格同步
- 大纲增加 Cashback 支持(PumpFun/PumpSwap)入口
- 新增 Cashback 说明:交易侧无需改代码,事件解析可获返现字段
- 英文:Method 1 增加 with_wsol_ata_config 可选示例
- 中文:创建客户端拆为方式一/方式二,表格增加 shared_infrastructure,特性增加共享基础设施

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-19 01:01:21 +08:00
Wood 43d1369d4e Merge pull request #77 from 0xfnzero/feature/pump-cashback
feat: PumpFun & PumpSwap Cashback support
2026-02-19 00:44:47 +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
Wood 710a8d482f Create context7.json 2026-02-09 05:42:27 +08:00
ysq 9b0c97ec6b chore: bump version to 3.4.0 v3.4.0 2026-01-27 22:23:45 +08:00
Wood 3773889216 Merge pull request #74 from speedlanding/main
feat(swqos): Add Speedlanding
2026-01-17 14:58:52 +08:00
speedlanding f10d0309ed feat(swqos): Add Speedlanding 2026-01-17 10:48:19 +08:00
Wood bf6e5bf026 Merge pull request #72 from OpenMindTeh/patch-1
fix: cli_trading example missing {:?} format for Vec<Signature>
2026-01-08 20:48:19 +08:00
OpenMindTeh 7f396867e5 fix: cli_trading example missing {:?} format for Vec<Signature>
In `examples/cli_trading/src/main.rs` line 1093, the print statement uses `{}` but `signature` is now `Vec<Signature>` which doesn't implement `Display`.

Error:
error[E0277]: Vec<Signature> doesn't implement std::fmt::Display

  Fix: Change `{}` to `{:?}`

  // Before
  println!("    Transaction Signature: {}", signature);

  // After
  println!("    Transaction Signature: {:?}", signature);

This was likely missed when updating the sell return type from single Signature to Vec.
2026-01-08 13:45:25 +03:00
Wood f0ac470a7b Merge pull request #71 from HelvetiCrypt/fix/update-examples-infrastructure-rpc
Fix examples to use client.infrastructure.rpc
2026-01-08 16:04:43 +08:00
vibes d06431213a Fix examples to use client.infrastructure.rpc
Updates all examples to use client.infrastructure.rpc instead of
client.rpc following the shared infrastructure refactor in PR #66.

Fixes #70

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 07:59:50 +00:00
Wood 92a1e39bc3 Merge pull request #69 from HelvetiCrypt/fix/soyas-logging
Fix Soyas client to match other SWQOS clients
2026-01-07 23:12:38 +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
Wood 65cb64d08c Merge pull request #68 from HelvetiCrypt/feat/add-exact-buy-instructions
Add buy_exact_sol_in and buy_exact_quote_in instruction support
2026-01-06 22:35:40 +08: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
Wood e12c45cc4c Merge pull request #67 from HelvetiCrypt/feat/shared-infrastructure
Add shared_infrastructure example and update documentation
2026-01-06 15:01:55 +08:00
vibes d78856718e Add shared_infrastructure example and update docs
- Add new `shared_infrastructure` example demonstrating multi-wallet
  resource sharing pattern
- Update `trading_client` example to show both initialization methods
- Update README with:
  - New feature: "Shared Infrastructure" in features list
  - Both methods (simple and shared) in TradingClient creation section
  - New example in examples summary table
- Add `shared_infrastructure` to workspace members

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 21:26:21 +00:00
Wood ab74f05fe9 Merge pull request #66 from HelvetiCrypt/feat/shared-infrastructure
feat: add shared infrastructure support for multi-wallet trading
2026-01-06 05:11:09 +08: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 285a5b5a7b Update README_CN.md 2026-01-05 01:25:18 +08:00
Wood 518b4c706d Update README.md 2026-01-05 01:24:28 +08:00
Wood b17f1157b6 docs: update gas fee strategy examples to remove data_size_limit parameters
Remove obsolete data_size_limit parameters from all gas fee strategy function calls in documentation and examples, following the recent API changes.

Changes:
- Update README.md and README_CN.md gas fee strategy examples
- Update all example files using set_global_fee_strategy (from 8 params to 6 params)
- Update gas_fee_strategy example for set_normal_fee_strategy and set_high_low_fee_strategy
- Remove the last two parameters (256 * 1024, 0) from all calls

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 16:16:10 +08: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
Wood 710de8a92a Merge pull request #64 from matt-soyas/main
[feat: swqos] Add soyas tokyo endpoint
2025-12-26 01:45:06 +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
Wood e7fcee9fbb Merge pull request #62 from VariantConst/patch-4
Update Node1's endpoint in Tokyo.
2025-12-24 21:08:12 +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
Wood 1f5a8612cb Merge pull request #59 from matt-soyas/main
feat(swqos): Add Soyas
2025-12-20 13:02:57 +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
Wood 4a6f75e307 Merge pull request #58 from HelvetiCrypt/fix/bloxroute-global-endpoint
feat: use global BloxRoute endpoint as default
2025-12-19 17:19:08 +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
Wood 101c5ec07d Merge pull request #56 from IAliceBobI/main
fix: correct instruction index in calculate_size function
2025-12-11 13:48: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 aa0a452bb2 docs: update README to use TradingClient instead of SolanaTrade
- Replace SolanaTrade with TradingClient in both README.md and README_CN.md
- Update code examples to use TradingClient::new()
- Update usage examples summary table
2025-12-08 03:11:46 +08:00
Wood 5982f51a40 docs: Update README examples to use DexParamEnum API and add new TradeBuyParams fields 2025-12-08 02:12:46 +08:00