feat: Upgrade SDK version to 0.2.4 and optimize tip fee setting logic
- Upgrade SDK version from 0.2.3 to 0.2.4 - Update solana-streamer-sdk dependency to version 0.1.3 - Optimize buy_tip_fees setting logic using map function instead of hardcoded array - Update version numbers in README documentation
This commit is contained in:
+10
-12
@@ -204,12 +204,11 @@ impl SolanaTrade {
|
||||
let mut priority_fee = buy_params.priority_fee.clone();
|
||||
if custom_buy_tip_fee.is_some() {
|
||||
priority_fee.buy_tip_fee = custom_buy_tip_fee.unwrap();
|
||||
priority_fee.buy_tip_fees = vec![
|
||||
custom_buy_tip_fee.unwrap(),
|
||||
custom_buy_tip_fee.unwrap(),
|
||||
custom_buy_tip_fee.unwrap(),
|
||||
custom_buy_tip_fee.unwrap(),
|
||||
];
|
||||
priority_fee.buy_tip_fees = priority_fee
|
||||
.buy_tip_fees
|
||||
.iter()
|
||||
.map(|_| custom_buy_tip_fee.unwrap())
|
||||
.collect();
|
||||
}
|
||||
let buy_with_tip_params = buy_params.clone().with_tip(self.swqos_clients.clone());
|
||||
|
||||
@@ -328,12 +327,11 @@ impl SolanaTrade {
|
||||
let mut priority_fee = sell_params.priority_fee.clone();
|
||||
if custom_buy_tip_fee.is_some() {
|
||||
priority_fee.buy_tip_fee = custom_buy_tip_fee.unwrap();
|
||||
priority_fee.buy_tip_fees = vec![
|
||||
custom_buy_tip_fee.unwrap(),
|
||||
custom_buy_tip_fee.unwrap(),
|
||||
custom_buy_tip_fee.unwrap(),
|
||||
custom_buy_tip_fee.unwrap(),
|
||||
];
|
||||
priority_fee.buy_tip_fees = priority_fee
|
||||
.buy_tip_fees
|
||||
.iter()
|
||||
.map(|_| custom_buy_tip_fee.unwrap())
|
||||
.collect();
|
||||
}
|
||||
let sell_with_tip_params = sell_params.clone().with_tip(self.swqos_clients.clone());
|
||||
|
||||
|
||||
+1
-1
@@ -399,7 +399,7 @@ async fn test_grpc() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let protocols = vec![Protocol::PumpFun, Protocol::PumpSwap, Protocol::Bonk, Protocol::RaydiumCpmm];
|
||||
|
||||
println!("开始监听事件,按 Ctrl+C 停止...");
|
||||
grpc.subscribe_events(protocols, None, None, None, callback).await?;
|
||||
grpc.subscribe_events(protocols, None, None, None, None, None, callback).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user