feat: Fastlane SWQoS, PumpSwap pool lookup and init robustness

- swqos: add Fastlane client and endpoint/tip constants
- pumpswap: pool 244-byte DataSize, canonical PDA lookup, find_by_mint diagnostics
- lib: find_pool_by_mint generic entry; rent/SWQoS init timeouts and default rent fallback
- lib: create WSOL ATA only when SOL balance is sufficient
- utils: get_token_balance_with_options and get_payer_token_balance_with_program (seed ATA aligned)

Made-with: Cursor
This commit is contained in:
Wood
2026-03-05 23:45:42 +08:00
parent d2ce193e2c
commit 1142829394
9 changed files with 384 additions and 28 deletions
+9
View File
@@ -25,6 +25,15 @@ pub async fn update_rents(client: &SolanaRpcClient) -> Result<(), anyhow::Error>
Ok(())
}
/// 165 字节 Token 账户的典型租金(lamports),RPC 超时时用作回退
const DEFAULT_TOKEN_ACCOUNT_RENT: u64 = 2_039_280;
/// 当 RPC 超时或不可用时设置默认租金,避免客户端创建卡死
pub fn set_default_rents() {
SPL_TOKEN_RENT.store(DEFAULT_TOKEN_ACCOUNT_RENT, Ordering::Release);
SPL_TOKEN_2022_RENT.store(DEFAULT_TOKEN_ACCOUNT_RENT, Ordering::Release);
}
pub fn start_rent_updater(client: Arc<SolanaRpcClient>) {
tokio::spawn(async move {
loop {