refactor: update API with DexParamEnum and simplify TradeConfig

- Introduce DexParamEnum to replace Dex enum for protocol parameters
- Simplify TradeConfig::new() to accept only 3 essential parameters
- Update all examples to use new DexParamEnum API
- Optimize executor and params modules
- Remove deprecated wsol_use_seed and mint_use_seed parameters
- Fix fast_fn module exports
This commit is contained in:
Wood
2025-12-08 01:35:40 +08:00
parent de8c55e599
commit 80ad2e052e
24 changed files with 240 additions and 226 deletions
+3 -3
View File
@@ -10,7 +10,7 @@ use sol_trade_sdk::TradeTokenType;
use sol_trade_sdk::{
common::AnyResult,
swqos::SwqosConfig,
trading::{core::params::PumpFunParams, factory::DexType},
trading::{core::params::{PumpFunParams, DexParamEnum}, factory::DexType},
SolanaTrade,
};
use solana_commitment_config::CommitmentConfig;
@@ -133,7 +133,7 @@ async fn pumpfun_copy_trade_with_grpc(trade_info: PumpFunTradeEvent) -> AnyResul
input_token_amount: buy_sol_amount,
slippage_basis_points: slippage_basis_points,
recent_blockhash: Some(recent_blockhash),
extension_params: Box::new(PumpFunParams::from_trade(
extension_params: DexParamEnum::PumpFun(PumpFunParams::from_trade(
trade_info.bonding_curve,
trade_info.associated_bonding_curve,
trade_info.mint,
@@ -178,7 +178,7 @@ async fn pumpfun_copy_trade_with_grpc(trade_info: PumpFunTradeEvent) -> AnyResul
slippage_basis_points: slippage_basis_points,
recent_blockhash: Some(recent_blockhash),
with_tip: false,
extension_params: Box::new(PumpFunParams::from_trade(
extension_params: DexParamEnum::PumpFun(PumpFunParams::from_trade(
trade_info.bonding_curve,
trade_info.associated_bonding_curve,
trade_info.mint,