feat(swqos): add Stellium support and update minimum tip requirements

This commit is contained in:
ysq
2025-12-01 00:13:34 +08:00
parent 25fa295994
commit 353c814697
15 changed files with 421 additions and 57 deletions
+19 -3
View File
@@ -3,8 +3,10 @@ use std::sync::{
Arc,
};
use sol_trade_sdk::common::{spl_associated_token_account::get_associated_token_address, GasFeeStrategy};
use sol_trade_sdk::common::TradeConfig;
use sol_trade_sdk::common::{
fast_fn::get_associated_token_address_with_program_id_fast_use_seed, GasFeeStrategy,
};
use sol_trade_sdk::{
common::AnyResult,
swqos::SwqosConfig,
@@ -125,7 +127,16 @@ async fn bonk_copy_trade_with_grpc(trade_info: BonkTradeEvent) -> AnyResult<()>
let recent_blockhash = client.rpc.get_latest_blockhash().await?;
let gas_fee_strategy = GasFeeStrategy::new();
gas_fee_strategy.set_global_fee_strategy(150000,150000, 500000,500000, 0.001, 0.001, 256 * 1024, 0);
gas_fee_strategy.set_global_fee_strategy(
150000,
150000,
500000,
500000,
0.001,
0.001,
256 * 1024,
0,
);
// Buy tokens
println!("Buying tokens from Bonk...");
@@ -174,7 +185,12 @@ async fn bonk_copy_trade_with_grpc(trade_info: BonkTradeEvent) -> AnyResult<()>
let rpc = client.rpc.clone();
let payer = client.payer.pubkey();
let account = get_associated_token_address(&payer, &mint_pubkey);
let account = get_associated_token_address_with_program_id_fast_use_seed(
&payer,
&mint_pubkey,
&trade_info.base_token_program,
client.use_seed_optimize,
);
let balance = rpc.get_token_account_balance(&account).await?;
println!("Balance: {:?}", balance);
let amount_token = balance.amount.parse::<u64>().unwrap();