refactor: optimize trading execution architecture and add wSOL management

- Simplify TradeExecutor interface by integrating middleware and swqos clients into params
- Refactor parallel execution module with dedicated buy/sell execute functions
- Add SOL wrapping/unwrapping functionality for wSOL management
- Remove redundant parameter passing in sell operations
- Delete example main.rs file
- Optimize transaction building with integrated parameter structures

BREAKING CHANGE: TradeExecutor interface simplified, middleware and swqos_clients now passed through params
This commit is contained in:
ysq
2025-09-09 17:02:24 +08:00
parent b9fa2f2f0f
commit 48a6c6283a
34 changed files with 586 additions and 853 deletions
+2 -4
View File
@@ -9,7 +9,7 @@ use crate::{
};
use serde::Deserialize;
use solana_client::rpc_client::RpcClient;
use solana_sdk::{commitment_config::CommitmentConfig, pubkey::Pubkey, signature::Keypair};
use solana_sdk::{commitment_config::CommitmentConfig, signature::Keypair};
#[derive(Debug, Clone)]
pub struct TradeConfig {
@@ -17,7 +17,6 @@ pub struct TradeConfig {
pub swqos_configs: Vec<SwqosConfig>,
pub priority_fee: PriorityFee,
pub commitment: CommitmentConfig,
pub lookup_table_key: Option<Pubkey>,
}
impl TradeConfig {
@@ -26,9 +25,8 @@ impl TradeConfig {
swqos_configs: Vec<SwqosConfig>,
priority_fee: PriorityFee,
commitment: CommitmentConfig,
lookup_table_key: Option<Pubkey>,
) -> Self {
Self { rpc_url, swqos_configs, priority_fee, commitment, lookup_table_key }
Self { rpc_url, swqos_configs, priority_fee, commitment }
}
}