diff --git a/crates/autopilot/src/run_loop.rs b/crates/autopilot/src/run_loop.rs index 6228d81fcd..e86692ff4e 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 b2428ac1cd..8ed1936923 100644 --- a/crates/e2e/tests/e2e/solver_competition.rs +++ b/crates/e2e/tests/e2e/solver_competition.rs @@ -126,8 +126,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 6fba23d1ed..ddfdf0a941 100644 --- a/crates/model/src/solver_competition.rs +++ b/crates/model/src/solver_competition.rs @@ -52,6 +52,8 @@ pub struct SolverSettlement { #[serde_as(as = "BTreeMap<_, HexOrDecimalU256>")] pub clearing_prices: BTreeMap, pub orders: Vec, + #[serde(default)] + pub is_winner: bool, } #[serde_as] @@ -165,6 +167,7 @@ mod tests { "executedAmount": "14", } ], + "isWinner": true, }, ], }); @@ -206,6 +209,7 @@ mod tests { executed_amount: 14.into(), }, ], + is_winner: true, }], }, }; @@ -271,7 +275,8 @@ mod tests { "clearingPrices": { "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "32666943622", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "19827747502258423744093" - } + }, + "isWinner": true, }, { "orders": [ @@ -292,7 +297,8 @@ mod tests { "clearingPrices": { "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "32652483021", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "19827747502258423744093" - } + }, + "isWinner": false, }, { "orders": [ @@ -313,7 +319,8 @@ mod tests { "clearingPrices": { "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "100000", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "60721701581190944" - } + }, + "isWinner": false, }, { "orders": [ @@ -334,7 +341,8 @@ mod tests { "clearingPrices": { "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "32725026283", "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "19827747502258423744093" - } + }, + "isWinner": false, }, { "orders": [ @@ -355,7 +363,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 97a4f046a1..c26608a911 100644 --- a/crates/orderbook/openapi.yml +++ b/crates/orderbook/openapi.yml @@ -403,7 +403,7 @@ paths: "200": description: Version content: - text/plain: {} + text/plain: { } "/api/v1/app_data/{app_data_hash}": get: summary: Get the full `appData` from contract `appDataHash`. @@ -1661,6 +1661,9 @@ components: $ref: "#/components/schemas/UID" executedAmount: $ref: "#/components/schemas/BigUint" + isWinner: + type: boolean + description: whether the solution is a winner (received the right to get executed) or not NativePriceResponse: description: | The estimated native price for the token