feat(swqos): align endpoint tables with SwqosRegion and document fallbacks

- Extend SWQOS regional constants to 10 entries (Dublin, Singapore, Default)
  so indices match SwqosRegion 0..9 everywhere
- Document geographic nearest-fill among published PoPs; call out Default and
  single-PoP provider constraints in comments
- Fix Node1 QUIC Default endpoint to match HTTP; tune ZeroSlot/Blox/Speedlanding
  regional mappings where a closer published PoP exists
- Add unit tests for table length and Astralane/Node1 cross-table consistency
- Update SwqosRegion rustdoc, README, and trading_client example accordingly

Made-with: Cursor
This commit is contained in:
0xfnzero
2026-04-14 02:13:42 +08:00
parent a391539000
commit 06ef2fed84
8 changed files with 333 additions and 174 deletions
+3 -3
View File
@@ -10,7 +10,7 @@
use sol_trade_sdk::{
common::{AnyResult, InfrastructureConfig, TradeConfig},
swqos::{SwqosConfig, SwqosRegion},
SwqosTransport, TradingClient, TradingInfrastructure,
AstralaneTransport, TradingClient, TradingInfrastructure,
};
use solana_commitment_config::CommitmentConfig;
use solana_sdk::signature::Keypair;
@@ -52,8 +52,8 @@ async fn create_trading_client_simple() -> AnyResult<TradingClient> {
"your_api_token".to_string(),
SwqosRegion::Frankfurt,
None,
Some(SwqosTransport::Quic),
), // QUIC; use None for HTTP
Some(AstralaneTransport::Quic),
), // QUICNone / Some(Binary) / Some(Plain) 为 HTTP
// Helius Sender: 4th param swqos_only Some(true) => min tip 0.000005 SOL; None => 0.0002 SOL
SwqosConfig::Helius("".to_string(), SwqosRegion::Default, None, Some(true)),
];