Skip to content

Commit

Permalink
Router: increase base CU (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
farnyser authored Oct 8, 2024
1 parent e7029e8 commit ae2f5bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/autobahn-router/src/ix_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use solana_program::pubkey::Pubkey;
use std::str::FromStr;

const CU_PER_HOP_DEFAULT: u32 = 75_000;
const CU_BASE: u32 = 50_000;
const CU_BASE: u32 = 75_000;

pub trait SwapStepInstructionBuilder {
fn build_ix(
Expand Down Expand Up @@ -146,13 +146,13 @@ impl<T: SwapStepInstructionBuilder> SwapInstructionsBuilder for SwapInstructions
for step in &swap_instructions {
if auto_create_out || (step.out_mint == sol_mint && auto_wrap_sol) {
Self::create_ata(&wallet_pk, &mut setup_instructions, &step.out_mint);
cu_estimate += 5000;
cu_estimate += 10_000;
}

if step.out_mint == sol_mint && auto_wrap_sol {
let wsol_account = get_associated_token_address(wallet_pk, &sol_mint);
Self::close_wsol_ata(&wallet_pk, &mut cleanup_instructions, &wsol_account)?;
cu_estimate += 5000;
cu_estimate += 10_000;
}

cu_estimate += step.cu_estimate.unwrap_or(CU_PER_HOP_DEFAULT);
Expand Down

0 comments on commit ae2f5bf

Please sign in to comment.