feat: add examples and enhance MEV protection services

This commit adds comprehensive examples for various trading operations including:
- PumpFun copy and sniper trading
- Bonk copy and sniper trading
- PumpSwap trading
- Raydium CPMM and AMM V4 trading
- Middleware system demonstration
- Event subscription

Enhanced MEV protection services with FlashBlock and Node1 integration.
Updated instruction modules for bonk, pumpswap, and raydium_cpmm.
Improved SWQOS modules for better transaction handling.
This commit is contained in:
ysq
2025-08-25 00:21:15 +08:00
parent 90ea46ea3f
commit c10406915c
36 changed files with 2049 additions and 1562 deletions
+4 -1
View File
@@ -92,7 +92,10 @@ impl BloxrouteClient {
let start_time: Instant = Instant::now();
match poll_transaction_confirmation(&self.rpc_client, signature).await {
Ok(_) => (),
Err(_) => (),
Err(e) => {
println!(" bloxroute{}确认失败: {:?}", trade_type, start_time.elapsed());
return Err(e);
},
}
println!(" bloxroute{}确认: {:?}", trade_type, start_time.elapsed());
+4 -1
View File
@@ -92,7 +92,10 @@ impl FlashBlockClient {
let start_time: Instant = Instant::now();
match poll_transaction_confirmation(&self.rpc_client, signature).await {
Ok(_) => (),
Err(_) => (),
Err(e) => {
println!(" FlashBlock{}确认失败: {:?}", trade_type, start_time.elapsed());
return Err(e);
},
}
println!(" FlashBlock{}确认: {:?}", trade_type, start_time.elapsed());
+4 -1
View File
@@ -108,7 +108,10 @@ impl JitoClient {
let start_time: Instant = Instant::now();
match poll_transaction_confirmation(&self.rpc_client, signature).await {
Ok(_) => (),
Err(_) => (),
Err(e) => {
println!(" jito{}确认失败: {:?}", trade_type, start_time.elapsed());
return Err(e);
},
}
println!(" jito{}确认: {:?}", trade_type, start_time.elapsed());
+4 -1
View File
@@ -89,7 +89,10 @@ impl NextBlockClient {
let start_time: Instant = Instant::now();
match poll_transaction_confirmation(&self.rpc_client, signature).await {
Ok(_) => (),
Err(_) => (),
Err(e) => {
println!(" nextblock{}确认失败: {:?}", trade_type, start_time.elapsed());
return Err(e);
},
}
println!(" nextblock{}确认: {:?}", trade_type, start_time.elapsed());
+4 -1
View File
@@ -177,7 +177,10 @@ impl Node1Client {
let start_time: Instant = Instant::now();
match poll_transaction_confirmation(&self.rpc_client, signature).await {
Ok(_) => (),
Err(_) => (),
Err(e) => {
println!(" node1{}确认失败: {:?}", trade_type, start_time.elapsed());
return Err(e);
},
}
println!(" node1{}确认: {:?}", trade_type, start_time.elapsed());
+4 -1
View File
@@ -30,7 +30,10 @@ impl SwqosClientTrait for SolRpcClient {
let start_time = Instant::now();
match poll_transaction_confirmation(&self.rpc_client, signature).await {
Ok(_) => (),
Err(_) => (),
Err(e) => {
println!(" rpc{}确认失败: {:?}", trade_type, start_time.elapsed());
return Err(e);
},
}
println!(" signature: {:?}", signature);
println!(" rpc{}确认: {:?}", trade_type, start_time.elapsed());
+4 -1
View File
@@ -98,7 +98,10 @@ impl TemporalClient {
let start_time: Instant = Instant::now();
match poll_transaction_confirmation(&self.rpc_client, signature).await {
Ok(_) => (),
Err(_) => (),
Err(e) => {
println!(" nozomi{}确认失败: {:?}", trade_type, start_time.elapsed());
return Err(e);
},
}
println!(" nozomi{}确认: {:?}", trade_type, start_time.elapsed());
+4 -1
View File
@@ -99,7 +99,10 @@ impl ZeroSlotClient {
let start_time: Instant = Instant::now();
match poll_transaction_confirmation(&self.rpc_client, signature).await {
Ok(_) => (),
Err(_) => (),
Err(e) => {
println!(" 0slot{}确认失败: {:?}", trade_type, start_time.elapsed());
return Err(e);
},
}
println!(" 0slot{}确认: {:?}", trade_type, start_time.elapsed());