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
This commit is contained in:
Wood
2026-02-27 15:00:13 +08:00
parent 82438479d3
commit 0cd276d6cb
11 changed files with 351 additions and 43 deletions
+8
View File
@@ -157,6 +157,8 @@ pub struct TradingClient {
pub use_core_affinity: bool,
/// Whether to output all SDK logs (from TradeConfig.log_enabled).
pub log_enabled: bool,
/// Whether to check minimum tip per SWQOS (from TradeConfig.check_min_tip). Default false for lower latency.
pub check_min_tip: bool,
}
static INSTANCE: Mutex<Option<Arc<TradingClient>>> = Mutex::new(None);
@@ -173,6 +175,7 @@ impl Clone for TradingClient {
use_seed_optimize: self.use_seed_optimize,
use_core_affinity: self.use_core_affinity,
log_enabled: self.log_enabled,
check_min_tip: self.check_min_tip,
}
}
}
@@ -301,6 +304,7 @@ impl TradingClient {
use_seed_optimize,
use_core_affinity: true,
log_enabled: true,
check_min_tip: false,
}
}
@@ -340,6 +344,7 @@ impl TradingClient {
use_seed_optimize,
use_core_affinity: true,
log_enabled: true,
check_min_tip: false,
}
}
@@ -503,6 +508,7 @@ impl TradingClient {
use_seed_optimize: trade_config.use_seed_optimize,
use_core_affinity: trade_config.use_core_affinity,
log_enabled: trade_config.log_enabled,
check_min_tip: trade_config.check_min_tip,
};
let mut current = INSTANCE.lock();
@@ -636,6 +642,7 @@ impl TradingClient {
simulate: params.simulate,
log_enabled: self.log_enabled,
use_core_affinity: self.use_core_affinity,
check_min_tip: self.check_min_tip,
grpc_recv_us: params.grpc_recv_us,
use_exact_sol_amount: params.use_exact_sol_amount,
};
@@ -732,6 +739,7 @@ impl TradingClient {
simulate: params.simulate,
log_enabled: self.log_enabled,
use_core_affinity: self.use_core_affinity,
check_min_tip: self.check_min_tip,
grpc_recv_us: params.grpc_recv_us,
use_exact_sol_amount: None,
};