Merge branch 'main' into feat/support-usdc-quote

# Conflicts:
#	examples/pumpswap_trading/src/main.rs
#	examples/raydium_cpmm_trading/src/main.rs
#	src/trading/core/executor.rs
This commit is contained in:
tommggo
2025-10-12 15:39:43 +08:00
73 changed files with 7589 additions and 768 deletions
+8 -4
View File
@@ -107,8 +107,6 @@ async fn create_solana_trade_client() -> AnyResult<SolanaTrade> {
let swqos_configs: Vec<SwqosConfig> = vec![SwqosConfig::Default(rpc_url.clone())];
let trade_config = TradeConfig::new(rpc_url, swqos_configs, commitment);
let solana_trade = SolanaTrade::new(Arc::new(payer), trade_config).await;
// set global strategy
sol_trade_sdk::common::GasFeeStrategy::set_global_fee_strategy(150000, 500000, 0.001, 0.001);
println!("✅ SolanaTrade client initialized successfully!");
Ok(solana_trade)
}
@@ -140,6 +138,10 @@ async fn raydium_amm_v4_copy_trade_with_grpc(trade_info: RaydiumAmmV4SwapEvent)
coin_reserve,
pc_reserve,
);
let gas_fee_strategy = sol_trade_sdk::common::GasFeeStrategy::new();
gas_fee_strategy.set_global_fee_strategy(150000, 500000, 0.001, 0.001);
// Buy tokens
println!("Buying tokens from Raydium_amm_v4...");
let input_token_amount = 100_000;
@@ -153,7 +155,7 @@ async fn raydium_amm_v4_copy_trade_with_grpc(trade_info: RaydiumAmmV4SwapEvent)
slippage_basis_points: slippage_basis_points,
recent_blockhash: Some(recent_blockhash),
extension_params: Box::new(params),
lookup_table_key: None,
address_lookup_table_account: None,
wait_transaction_confirmed: true,
create_input_token_ata: is_wsol,
close_input_token_ata: is_wsol,
@@ -161,6 +163,7 @@ async fn raydium_amm_v4_copy_trade_with_grpc(trade_info: RaydiumAmmV4SwapEvent)
open_seed_optimize: false,
durable_nonce: None,
fixed_output_token_amount: None,
gas_fee_strategy: gas_fee_strategy.clone(),
};
client.buy(buy_params).await?;
@@ -185,13 +188,14 @@ async fn raydium_amm_v4_copy_trade_with_grpc(trade_info: RaydiumAmmV4SwapEvent)
recent_blockhash: Some(recent_blockhash),
with_tip: false,
extension_params: Box::new(params),
lookup_table_key: None,
address_lookup_table_account: None,
wait_transaction_confirmed: true,
create_output_token_ata: is_wsol,
close_output_token_ata: is_wsol,
open_seed_optimize: false,
durable_nonce: None,
fixed_output_token_amount: None,
gas_fee_strategy: gas_fee_strategy,
};
client.sell(sell_params).await?;