diff --git a/crates/autopilot/src/domain/competition/winner_selection.rs b/crates/autopilot/src/domain/competition/winner_selection.rs index 6fcf605c86..d779bd52ee 100644 --- a/crates/autopilot/src/domain/competition/winner_selection.rs +++ b/crates/autopilot/src/domain/competition/winner_selection.rs @@ -155,11 +155,6 @@ impl From<&Solution> for winsel::Solution { .iter() .map(|(uid, order)| to_winsel_order(*uid, order)) .collect(), - solution - .prices() - .iter() - .map(|(token, price)| (Address::from(*token), price.get().0)) - .collect(), ) } } diff --git a/crates/autopilot/src/domain/settlement/mod.rs b/crates/autopilot/src/domain/settlement/mod.rs index 1cddcf3b0b..40fd64de2f 100644 --- a/crates/autopilot/src/domain/settlement/mod.rs +++ b/crates/autopilot/src/domain/settlement/mod.rs @@ -400,7 +400,7 @@ mod tests { .collect(), native_prices: prices.clone(), }; - let solution = ws::Solution::new(0, ws::Address::ZERO, vec![order], prices); + let solution = ws::Solution::new(0, ws::Address::ZERO, vec![order]); let arbitrator = ws::Arbitrator { max_winners: 1, weth: ws::Address::ZERO, diff --git a/crates/autopilot/src/run_loop.rs b/crates/autopilot/src/run_loop.rs index e983feb808..f67b7dc6fe 100644 --- a/crates/autopilot/src/run_loop.rs +++ b/crates/autopilot/src/run_loop.rs @@ -492,12 +492,9 @@ impl RunLoop { buy_amount: order.executed_buy.0, }) .collect(), - clearing_prices: bid - .solution() - .prices() - .iter() - .map(|(token, price)| (Address::from(*token), price.get().0)) - .collect(), + // Always empty — kept to avoid breaking the solver competition + // API (`/api/v1/solver_competition`). + clearing_prices: Default::default(), is_winner: bid.is_winner(), filtered_out: bid.is_filtered_out(), }) diff --git a/crates/winner-selection/src/arbitrator.rs b/crates/winner-selection/src/arbitrator.rs index 446df78572..3a41651732 100644 --- a/crates/winner-selection/src/arbitrator.rs +++ b/crates/winner-selection/src/arbitrator.rs @@ -182,7 +182,7 @@ impl Arbitrator { continue; } - let score = self.compute_order_score(order, solution, context)?; + let score = self.compute_order_score(order, context)?; let token_pair = DirectedTokenPair { sell: order.sell_token, @@ -202,26 +202,12 @@ impl Arbitrator { /// Follows CIP-38 as the base of the score computation. /// /// Denominated in NATIVE token. - fn compute_order_score( - &self, - order: &Order, - solution: &Solution, - context: &AuctionContext, - ) -> Result { + fn compute_order_score(&self, order: &Order, context: &AuctionContext) -> Result { let native_price_buy = context .native_prices .get(&order.buy_token) .context("missing native price for buy token")?; - let _uniform_sell_price = solution - .prices() - .get(&order.sell_token) - .context("missing uniform clearing price for sell token")?; - let _uniform_buy_price = solution - .prices() - .get(&order.buy_token) - .context("missing uniform clearing price for buy token")?; - let custom_prices = self.calculate_custom_prices_from_executed(order); // Calculate surplus in surplus token (buy token for sell orders, sell token for diff --git a/crates/winner-selection/src/solution.rs b/crates/winner-selection/src/solution.rs index 4996335d86..f3f816fa1b 100644 --- a/crates/winner-selection/src/solution.rs +++ b/crates/winner-selection/src/solution.rs @@ -10,7 +10,6 @@ use { state, }, alloy_primitives::{Address, U256}, - std::collections::HashMap, }; pub type Scored = state::Scored; pub type Ranked = state::Ranked; @@ -30,13 +29,6 @@ pub struct Solution { /// Orders executed in this solution. orders: Vec, - /// Uniform clearing prices for all tokens in the solution. - /// - /// Maps token address to its price in the native token. - /// These are the prices at which all orders trading these tokens are - /// settled. - prices: HashMap, - /// State marker (score and ranking information). state: State, } @@ -56,11 +48,6 @@ impl Solution { pub fn orders(&self) -> &[Order] { &self.orders } - - /// Get the clearing prices. - pub fn prices(&self) -> &HashMap { - &self.prices - } } impl state::HasState for Solution { @@ -72,7 +59,6 @@ impl state::HasState for Solution { id: self.id, solver: self.solver, orders: self.orders, - prices: self.prices, state, } } @@ -84,17 +70,11 @@ impl state::HasState for Solution { impl Solution { /// Create a new unscored solution. - pub fn new( - id: u64, - solver: Address, - orders: Vec, - prices: HashMap, - ) -> Self { + pub fn new(id: u64, solver: Address, orders: Vec) -> Self { Self { id, solver, orders, - prices, state: Unscored, } }