diff --git a/bot/crates/strategy/src/bot/mod.rs b/bot/crates/strategy/src/bot/mod.rs index 78591af..5ec6c10 100644 --- a/bot/crates/strategy/src/bot/mod.rs +++ b/bot/crates/strategy/src/bot/mod.rs @@ -47,7 +47,6 @@ impl SandoBot { /// Main logic for the strategy /// Checks if the passed `RawIngredients` is sandwichable - #[allow(unused_mut)] pub async fn is_sandwichable( &self, ingredients: RawIngredients, @@ -67,13 +66,12 @@ impl SandoBot { Some((target_block.number - 1).into()), ); - let mut weth_inventory = self.sando_state_manager.get_weth_inventory(); - - #[cfg(feature = "debug")] - { - // Set a new value only when the debug feature is active - weth_inventory = (*crate::constants::WETH_FUND_AMT).into(); - } + let weth_inventory = if cfg!(feature = "debug") { + // spoof weth balance when the debug feature is active + (*crate::constants::WETH_FUND_AMT).into() + } else { + self.sando_state_manager.get_weth_inventory() + }; let optimal_input = find_optimal_input( &ingredients, @@ -138,6 +136,7 @@ impl SandoBot { } /// Process new txs as they come in + #[allow(unused_mut)] async fn process_new_tx(&mut self, victim_tx: Transaction) -> Option { // setup variables for processing tx let next_block = self.block_manager.get_next_block();