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>
This commit is contained in:
Wood
2025-12-28 13:15:16 +08:00
co-authored by Claude Sonnet 4.5
parent 710de8a92a
commit 321f4c4a25
22 changed files with 183 additions and 179 deletions
-12
View File
@@ -405,12 +405,6 @@ impl TradingClient {
slippage_basis_points: params.slippage_basis_points,
address_lookup_table_account: params.address_lookup_table_account,
recent_blockhash: params.recent_blockhash,
data_size_limit: params
.gas_fee_strategy
.get_strategies(TradeType::Buy)
.get(0)
.map(|(_, _, v)| v.data_size_limit)
.unwrap_or(256 * 1024),
wait_transaction_confirmed: params.wait_transaction_confirmed,
protocol_params: protocol_params.clone(),
open_seed_optimize: self.use_seed_optimize, // 使用全局seed优化配置
@@ -527,12 +521,6 @@ impl TradingClient {
swqos_clients: self.swqos_clients.clone(),
middleware_manager: self.middleware_manager.clone(),
durable_nonce: params.durable_nonce,
data_size_limit: params
.gas_fee_strategy
.get_strategies(TradeType::Sell)
.get(0)
.map(|(_, _, v)| v.data_size_limit)
.unwrap_or(0),
create_input_mint_ata: false,
close_input_mint_ata: params.close_mint_token_ata,
create_output_mint_ata: params.create_output_token_ata,