diff --git a/src/common/types.rs b/src/common/types.rs index 94daec8..6c02e37 100755 --- a/src/common/types.rs +++ b/src/common/types.rs @@ -79,6 +79,7 @@ pub struct PriorityFee { pub rpc_unit_price: u64, pub buy_tip_fee: f64, pub buy_tip_fees: Vec, + pub smart_buy_tip_fee: f64, pub sell_tip_fee: f64, } @@ -91,6 +92,7 @@ impl Default for PriorityFee { rpc_unit_price: DEFAULT_RPC_UNIT_PRICE, buy_tip_fee: DEFAULT_BUY_TIP_FEE, buy_tip_fees: vec![], + smart_buy_tip_fee: 0.0, sell_tip_fee: DEFAULT_SELL_TIP_FEE } } diff --git a/src/lib.rs b/src/lib.rs index c5d48c8..1dcb849 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -313,7 +313,13 @@ impl PumpFun { recent_blockhash: Hash, bonding_curve: Option>, trade_platform: String, + custom_buy_tip_fee: Option, ) -> 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,