diff --git a/crates/autopilot/src/run_loop.rs b/crates/autopilot/src/run_loop.rs index 3b65f3bc65..a2cbbf9a03 100644 --- a/crates/autopilot/src/run_loop.rs +++ b/crates/autopilot/src/run_loop.rs @@ -476,6 +476,7 @@ impl RunLoop { .iter() .map(|(token, price)| (token.0, price.get().into())) .collect(), + is_winner: participant.is_winner(), }) .collect(), }; diff --git a/crates/e2e/tests/e2e/solver_competition.rs b/crates/e2e/tests/e2e/solver_competition.rs index 785a4488e6..cb19265d1b 100644 --- a/crates/e2e/tests/e2e/solver_competition.rs +++ b/crates/e2e/tests/e2e/solver_competition.rs @@ -125,8 +125,10 @@ async fn solver_competition(web3: Web3) { // Non winning candidate assert!(competition.common.solutions[0].ranking == 2); + assert!(!competition.common.solutions[0].is_winner); // Winning candidate assert!(competition.common.solutions[1].ranking == 1); + assert!(competition.common.solutions[1].is_winner); } async fn fairness_check(web3: Web3) { diff --git a/crates/model/src/solver_competition.rs b/crates/model/src/solver_competition.rs index 58a00a732e..8de8d07596 100644 --- a/crates/model/src/solver_competition.rs +++ b/crates/model/src/solver_competition.rs @@ -54,6 +54,7 @@ pub struct SolverSettlement { #[serde_as(as = "BTreeMap<_, HexOrDecimalU256>")] pub clearing_prices: BTreeMap, pub orders: Vec, + pub is_winner: bool, } #[serde_as] @@ -167,6 +168,7 @@ mod tests { "executedAmount": "14", } ], + "isWinner": true, }, ], }); @@ -208,6 +210,7 @@ mod tests { executed_amount: 14.into(), }, ], + is_winner: true, }], }, }; @@ -273,7 +276,8 @@ mod tests { "clearingPrices": { "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "32666943622", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "19827747502258423744093" - } + }, + "isWinner": true, }, { "orders": [ @@ -294,7 +298,8 @@ mod tests { "clearingPrices": { "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "32652483021", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "19827747502258423744093" - } + }, + "isWinner": false, }, { "orders": [ @@ -315,7 +320,8 @@ mod tests { "clearingPrices": { "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "100000", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "60721701581190944" - } + }, + "isWinner": false, }, { "orders": [ @@ -336,7 +342,8 @@ mod tests { "clearingPrices": { "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "32725026283", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "19827747502258423744093" - } + }, + "isWinner": false, }, { "orders": [ @@ -357,7 +364,8 @@ mod tests { "clearingPrices": { "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "32752835446", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "19827747502258423744093" - } + }, + "isWinner": false, } ], "transactionHashes": ["0x044499c2a830890cb0a8ecf9aec6c5621e8310092a58d369cdef726254d3d108"], diff --git a/crates/orderbook/openapi.yml b/crates/orderbook/openapi.yml index 00639e36b0..98dff6be3d 100644 --- a/crates/orderbook/openapi.yml +++ b/crates/orderbook/openapi.yml @@ -1504,6 +1504,9 @@ components: description: Maps from solver name to object describing that solver's settlement. items: $ref: "#/components/schemas/SolverSettlement" + isWinner: + type: boolean + description: whether the solution is a winner or not SolverSettlement: type: object properties: