refactor: Refactor SDK core architecture and trading parameter system

- Refactor SolanaTrade main class structure with improved modular design
- Refactor trading parameter system: BuyParams/SellParams -> InternalBuyParams/InternalSellParams
- Remove deprecated PriorityFee and related utility functions
- Add SwqosSettings to replace legacy SwqosConfig
- Add comprehensive technical documentation:
  • Address Lookup Table usage guide (EN/CN)
  • Nonce Cache mechanism documentation (EN/CN)
  • Trading Parameters documentation (EN/CN)
- Refactor all example code to adapt to new API interfaces
- Optimize public API design and code comments
- Clean up redundant utility functions and type definitions

Impact: 43 files changed, 2013 insertions(+), 1735 deletions(-)
This commit is contained in:
ysq
2025-09-17 00:10:33 +08:00
parent 943c2627f3
commit c5ff7c1cbb
43 changed files with 2010 additions and 1732 deletions
+3 -3
View File
@@ -5,7 +5,7 @@ use std::{sync::Arc, time::Instant};
use crate::trading::core::parallel::{buy_parallel_execute, sell_parallel_execute};
use super::{
params::{BuyParams, SellParams},
params::{InternalBuyParams, InternalSellParams},
traits::{InstructionBuilder, TradeExecutor},
};
@@ -26,7 +26,7 @@ impl GenericTradeExecutor {
#[async_trait::async_trait]
impl TradeExecutor for GenericTradeExecutor {
async fn buy_with_tip(&self, params: BuyParams) -> Result<Signature> {
async fn buy_with_tip(&self, params: InternalBuyParams) -> Result<Signature> {
let start = Instant::now();
// Build instructions directly from params to avoid unnecessary cloning
@@ -47,7 +47,7 @@ impl TradeExecutor for GenericTradeExecutor {
buy_parallel_execute(params, final_instructions, self.protocol_name).await
}
async fn sell_with_tip(&self, params: SellParams) -> Result<Signature> {
async fn sell_with_tip(&self, params: InternalSellParams) -> Result<Signature> {
let start = Instant::now();
// Build instructions directly from params to avoid unnecessary cloning