set jito fee

This commit is contained in:
William
2025-01-25 19:45:18 +08:00
parent c0528b2007
commit 1f67c7d036
+5 -3
View File
@@ -40,7 +40,7 @@ use borsh::BorshDeserialize;
const DEFAULT_SLIPPAGE: u64 = 1000; // 10% const DEFAULT_SLIPPAGE: u64 = 1000; // 10%
const DEFAULT_COMPUTE_UNIT_LIMIT: u32 = 10_000_000; const DEFAULT_COMPUTE_UNIT_LIMIT: u32 = 10_000_000;
const DEFAULT_COMPUTE_UNIT_PRICE: u64 = 500_000; const DEFAULT_COMPUTE_UNIT_PRICE: u64 = 500_000;
const JITO_TIP_AMOUNT: u64 = 1255211; const JITO_TIP_AMOUNT: u64 = 4123210;
/// Priority fee configuration /// Priority fee configuration
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -252,6 +252,7 @@ impl PumpFun {
buy_token_amount: u64, buy_token_amount: u64,
max_sol_cost: u64, max_sol_cost: u64,
slippage_basis_points: Option<u64>, slippage_basis_points: Option<u64>,
jito_fee: Option<u64>,
) -> Result<String, ClientError> { ) -> Result<String, ClientError> {
let start_time = Instant::now(); let start_time = Instant::now();
@@ -284,11 +285,12 @@ impl PumpFun {
}, },
)); ));
let jito_fee = jito_fee.unwrap_or(JITO_TIP_AMOUNT);
instructions.push( instructions.push(
system_instruction::transfer( system_instruction::transfer(
&self.payer.pubkey(), &self.payer.pubkey(),
&tip_account, &tip_account,
JITO_TIP_AMOUNT, jito_fee,
), ),
); );
@@ -471,7 +473,7 @@ impl PumpFun {
system_instruction::transfer( system_instruction::transfer(
&self.payer.pubkey(), &self.payer.pubkey(),
&tip_account, &tip_account,
JITO_TIP_AMOUNT/10, JITO_TIP_AMOUNT/20,
), ),
); );