update fee for custructor

This commit is contained in:
William
2025-02-21 23:02:15 +08:00
parent ecb2ffa747
commit 12ddfe4dc0
6 changed files with 50 additions and 44 deletions
+4 -4
View File
@@ -219,7 +219,7 @@ pub async fn build_sell_instructions(
.sum::<u64>() / fees.len() as u64
};
let unit_price = if average_fees == 0 { sol_to_lamports(priority_fee.price) } else { average_fees };
let unit_price = if average_fees == 0 { sol_to_lamports(priority_fee.unit_price) } else { average_fees };
instructions[0] = ComputeBudgetInstruction::set_compute_unit_limit(result_cu as u32);
instructions[1] = ComputeBudgetInstruction::set_compute_unit_price(unit_price);
@@ -253,8 +253,8 @@ pub async fn build_sell_instructions_with_jito(
);
let mut instructions = vec![
ComputeBudgetInstruction::set_compute_unit_price(sol_to_lamports(priority_fee.price)),
ComputeBudgetInstruction::set_compute_unit_limit(sol_to_lamports(priority_fee.limit) as u32),
ComputeBudgetInstruction::set_compute_unit_price(sol_to_lamports(priority_fee.unit_price)),
ComputeBudgetInstruction::set_compute_unit_limit(sol_to_lamports(priority_fee.unit_limit) as u32),
];
instructions.push(instruction::sell(
@@ -276,7 +276,7 @@ pub async fn build_sell_instructions_with_jito(
)?);
let tip_account = jito_client.get_tip_account().await.map_err(|e| anyhow!(e))?;
let jito_fee = priority_fee.jito_fee.unwrap_or(JITO_TIP_AMOUNT);
let jito_fee = priority_fee.sell_jito_fee;
instructions.push(
system_instruction::transfer(
&payer.pubkey(),