docs: update gas fee strategy examples to remove data_size_limit parameters

Remove obsolete data_size_limit parameters from all gas fee strategy function calls in documentation and examples, following the recent API changes.

Changes:
- Update README.md and README_CN.md gas fee strategy examples
- Update all example files using set_global_fee_strategy (from 8 params to 6 params)
- Update gas_fee_strategy example for set_normal_fee_strategy and set_high_low_fee_strategy
- Remove the last two parameters (256 * 1024, 0) from all calls

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Wood
2025-12-28 16:16:10 +08:00
co-authored by Claude Sonnet 4.5
parent 321f4c4a25
commit b17f1157b6
17 changed files with 22 additions and 35 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ async fn pumpfun_copy_trade_with_grpc(trade_info: PumpFunTradeEvent) -> AnyResul
fetch_address_lookup_table_account(&client.rpc, &lookup_table_key).await.ok();
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);
// Buy tokens
println!("Buying tokens from PumpFun...");
-2
View File
@@ -134,8 +134,6 @@ async fn bonk_copy_trade_with_grpc(trade_info: BonkTradeEvent) -> AnyResult<()>
500000,
0.001,
0.001,
256 * 1024,
0,
);
// Buy tokens
-2
View File
@@ -102,8 +102,6 @@ async fn bonk_sniper_trade_with_shreds(trade_info: BonkTradeEvent) -> AnyResult<
500000,
0.001,
0.001,
256 * 1024,
0,
);
let token_type = if trade_info.quote_token_mint == sol_trade_sdk::constants::USD1_TOKEN_ACCOUNT
+10 -10
View File
@@ -615,7 +615,7 @@ async fn handle_buy_pumpfun(
let sol_lamports = sol_str_to_lamports(sol_amount.to_string().as_str()).unwrap();
let gas_fee_strategy = sol_trade_sdk::common::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);
let buy_params = TradeBuyParams {
dex_type: DexType::PumpFun,
@@ -669,7 +669,7 @@ async fn handle_buy_pumpswap(
let sol_lamports = sol_str_to_lamports(sol_amount.to_string().as_str()).unwrap();
let gas_fee_strategy = sol_trade_sdk::common::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);
let buy_params = TradeBuyParams {
dex_type: DexType::PumpSwap,
@@ -722,7 +722,7 @@ async fn handle_buy_bonk(
let sol_lamports = sol_str_to_lamports(sol_amount.to_string().as_str()).unwrap();
let gas_fee_strategy = sol_trade_sdk::common::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);
let buy_params = TradeBuyParams {
dex_type: DexType::Bonk,
@@ -779,7 +779,7 @@ async fn handle_buy_raydium_v4(
let sol_lamports = sol_str_to_lamports(sol_amount.to_string().as_str()).unwrap();
let gas_fee_strategy = sol_trade_sdk::common::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);
let buy_params = TradeBuyParams {
dex_type: DexType::RaydiumAmmV4,
@@ -836,7 +836,7 @@ async fn handle_buy_raydium_cpmm(
let sol_lamports = sol_str_to_lamports(sol_amount.to_string().as_str()).unwrap();
let gas_fee_strategy = sol_trade_sdk::common::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);
let buy_params = TradeBuyParams {
dex_type: DexType::RaydiumCpmm,
@@ -1003,7 +1003,7 @@ async fn handle_sell_pumpfun(
let recent_blockhash = client.rpc.get_latest_blockhash().await?;
let gas_fee_strategy = sol_trade_sdk::common::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);
let sell_params = TradeSellParams {
dex_type: DexType::PumpFun,
@@ -1061,7 +1061,7 @@ async fn handle_sell_pumpswap(
let recent_blockhash = client.rpc.get_latest_blockhash().await?;
let gas_fee_strategy = sol_trade_sdk::common::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);
let sell_params = TradeSellParams {
dex_type: DexType::PumpSwap,
@@ -1118,7 +1118,7 @@ async fn handle_sell_bonk(
let recent_blockhash = client.rpc.get_latest_blockhash().await?;
let gas_fee_strategy = sol_trade_sdk::common::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);
let sell_params = TradeSellParams {
dex_type: DexType::Bonk,
@@ -1178,7 +1178,7 @@ async fn handle_sell_raydium_v4(
let recent_blockhash = client.rpc.get_latest_blockhash().await?;
let gas_fee_strategy = sol_trade_sdk::common::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);
let sell_params = TradeSellParams {
dex_type: DexType::RaydiumAmmV4,
@@ -1238,7 +1238,7 @@ async fn handle_sell_raydium_cpmm(
let recent_blockhash = client.rpc.get_latest_blockhash().await?;
let gas_fee_strategy = sol_trade_sdk::common::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);
let sell_params = TradeSellParams {
dex_type: DexType::RaydiumCpmm,
+1 -6
View File
@@ -12,7 +12,7 @@ async fn main() {
// Set global strategy
println!("1. Set global strategy");
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);
// Print all strategies
println!("\n2. Print all strategies");
@@ -30,8 +30,6 @@ async fn main() {
500000, // cu_price
0.0, // buy_tip
0.0, // sell_tip
256 * 1024,
0,
);
// Add high-low fee strategy for SwqosType::Jito on Buy
@@ -44,7 +42,6 @@ async fn main() {
10 * 1_000_000, // high cu_price
0.001, // low tip
0.1, // high tip
0,
);
// Print all strategies
@@ -59,8 +56,6 @@ async fn main() {
500000, // cu_price
0.0001, // buy_tip
0.0001, // sell_tip
256 * 1024,
0,
);
// Print all strategies
@@ -19,7 +19,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mint_pubkey = Pubkey::from_str("PRVT6TB7uss3FrUd2D9xs2zqDBsa3GbMJMwCQsgmeta").unwrap();
let gas_fee_strategy = sol_trade_sdk::common::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);
// Buy tokens
println!("Buying tokens from Metaora Damm V2...");
+1 -1
View File
@@ -81,7 +81,7 @@ async fn test_middleware() -> AnyResult<()> {
let pool_address = Pubkey::from_str("539m4mVWt6iduB6W8rDGPMarzNCMesuqY5eUTiiYHAgR")?;
let gas_fee_strategy = sol_trade_sdk::common::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);
let buy_params = sol_trade_sdk::TradeBuyParams {
dex_type: DexType::PumpSwap,
+1 -1
View File
@@ -125,7 +125,7 @@ async fn pumpfun_copy_trade_with_grpc(trade_info: PumpFunTradeEvent) -> AnyResul
let durable_nonce = fetch_nonce_info(&client.rpc, nonce_account_str).await;
let gas_fee_strategy = sol_trade_sdk::common::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);
// Buy tokens
println!("Buying tokens from PumpFun...");
@@ -128,8 +128,6 @@ async fn pumpfun_copy_trade_with_grpc(trade_info: PumpFunTradeEvent) -> AnyResul
500000,
0.001,
0.001,
256 * 1024,
0,
);
// Buy tokens
+1 -1
View File
@@ -89,7 +89,7 @@ async fn pumpfun_sniper_trade_with_shreds(trade_info: PumpFunTradeEvent) -> AnyR
let recent_blockhash = client.rpc.get_latest_blockhash().await?;
let gas_fee_strategy = sol_trade_sdk::common::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);
// Buy tokens
println!("Buying tokens from PumpFun...");
+1 -1
View File
@@ -19,7 +19,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mint_pubkey = Pubkey::from_str("pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn").unwrap();
let gas_fee_strategy = sol_trade_sdk::common::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);
// Buy tokens
println!("Buying tokens from PumpSwap...");
+1 -1
View File
@@ -195,7 +195,7 @@ async fn pumpswap_trade_with_grpc(mint_pubkey: Pubkey, params: PumpSwapParams) -
let recent_blockhash = client.rpc.get_latest_blockhash().await?;
let gas_fee_strategy = sol_trade_sdk::common::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);
let is_sol = params.base_mint == sol_trade_sdk::constants::WSOL_TOKEN_ACCOUNT
|| params.quote_mint == sol_trade_sdk::constants::WSOL_TOKEN_ACCOUNT;
@@ -149,8 +149,6 @@ async fn raydium_amm_v4_copy_trade_with_grpc(trade_info: RaydiumAmmV4SwapEvent)
500000,
0.001,
0.001,
256 * 1024,
0,
);
// Buy tokens
+1 -1
View File
@@ -130,7 +130,7 @@ async fn raydium_cpmm_copy_trade_with_grpc(trade_info: RaydiumCpmmSwapEvent) ->
let recent_blockhash = client.rpc.get_latest_blockhash().await?;
let gas_fee_strategy = sol_trade_sdk::common::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);
let buy_params =
RaydiumCpmmParams::from_pool_address_by_rpc(&client.rpc, &trade_info.pool_state).await?;
+1 -1
View File
@@ -22,7 +22,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mint_pubkey = Pubkey::from_str("2zMMhcVQEXDtdE6vsFS7S7D5oUodfJHE8vd1gnBouauv").unwrap();
let gas_fee_strategy = sol_trade_sdk::common::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);
// Buy tokens
println!("Buying tokens from PumpSwap...");