refactor: unify transaction building and execution architecture

- Remove redundant transaction builder functions and merge into single build_transaction()
- Simplify compute budget manager with unified add_compute_budget_instructions()
- Consolidate trade executor interface by removing separate buy/sell methods
- Unify BuyParams/SellParams usage, remove *WithTipParams structs
- Streamline parallel execution logic and remove TradeType parameter
- Delete obsolete files: address_lookup.rs, tip_cache.rs
- Clean up nonce manager by removing unused is_using_nonce() function

This refactoring reduces code duplication and provides a cleaner, more maintainable API
for transaction building and execution across all trading protocols.
This commit is contained in:
ysq
2025-09-07 17:22:58 +08:00
parent 6e04458659
commit 90fcd5ca01
15 changed files with 176 additions and 1069 deletions
+7 -5
View File
@@ -38,9 +38,10 @@ pub struct PriorityFee {
pub tip_unit_price: u64,
pub rpc_unit_limit: u32,
pub rpc_unit_price: u64,
pub buy_tip_fee: f64,
// 与 swqos 顺序一致 (Matches the order of swqos)
pub buy_tip_fees: Vec<f64>,
pub sell_tip_fee: f64,
// 与 swqos 顺序一致 (Matches the order of swqos)
pub sell_tip_fees: Vec<f64>,
}
impl Default for PriorityFee {
@@ -50,9 +51,10 @@ impl Default for PriorityFee {
tip_unit_price: DEFAULT_TIP_UNIT_PRICE,
rpc_unit_limit: DEFAULT_RPC_UNIT_LIMIT,
rpc_unit_price: DEFAULT_RPC_UNIT_PRICE,
buy_tip_fee: DEFAULT_BUY_TIP_FEE,
buy_tip_fees: vec![],
sell_tip_fee: DEFAULT_SELL_TIP_FEE,
// 与 swqos 顺序一致 (Matches the order of swqos)
buy_tip_fees: vec![DEFAULT_BUY_TIP_FEE],
// 与 swqos 顺序一致 (Matches the order of swqos)
sell_tip_fees: vec![DEFAULT_SELL_TIP_FEE],
}
}
}