[Feature] Add smart tip fee functionality
1. Add smart_buy_tip_fee field to PriorityFee struct 2. Extend copy_buy_with_tip method with custom_buy_tip_fee parameter 3. Implement dynamic tip fee adjustment logic
This commit is contained in:
+8
-2
@@ -313,7 +313,13 @@ impl PumpFun {
|
||||
recent_blockhash: Hash,
|
||||
bonding_curve: Option<Arc<BondingCurveAccount>>,
|
||||
trade_platform: String,
|
||||
custom_buy_tip_fee: Option<f64>,
|
||||
) -> Result<(), anyhow::Error> {
|
||||
let mut priority_fee = self.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()];
|
||||
}
|
||||
if trade_platform == PUMPFUN {
|
||||
pumpfun::buy::buy_with_tip(
|
||||
self.fee_clients.clone(),
|
||||
@@ -324,7 +330,7 @@ impl PumpFun {
|
||||
dev_sol_cost,
|
||||
buy_sol_cost,
|
||||
slippage_basis_points,
|
||||
self.priority_fee.clone(),
|
||||
priority_fee.clone(),
|
||||
self.cluster.clone().lookup_table_key,
|
||||
recent_blockhash,
|
||||
bonding_curve,
|
||||
@@ -339,7 +345,7 @@ impl PumpFun {
|
||||
creator,
|
||||
buy_sol_cost,
|
||||
slippage_basis_points,
|
||||
self.priority_fee.clone(),
|
||||
priority_fee.clone(),
|
||||
self.cluster.clone().lookup_table_key,
|
||||
recent_blockhash,
|
||||
None,
|
||||
|
||||
Reference in New Issue
Block a user