diff --git a/crates/autopilot/src/run_loop.rs b/crates/autopilot/src/run_loop.rs index 2ecb52a08c..e703c571ad 100644 --- a/crates/autopilot/src/run_loop.rs +++ b/crates/autopilot/src/run_loop.rs @@ -239,7 +239,7 @@ impl RunLoop { let mut settlement = SolverSettlement { solver: participant.driver.name.clone(), solver_address: participant.solution.account, - score: Score::Solver(participant.solution.score.get()), + score: Some(Score::Solver(participant.solution.score.get())), ranking: solutions.len() - index, orders: participant .solution diff --git a/crates/model/src/solver_competition.rs b/crates/model/src/solver_competition.rs index 1e7d2b4696..a59d4bdd5e 100644 --- a/crates/model/src/solver_competition.rs +++ b/crates/model/src/solver_competition.rs @@ -65,6 +65,7 @@ pub struct SolverCompetitionDB { #[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)] #[serde(rename_all = "camelCase")] pub struct SolverCompetitionAPI { + #[serde(default)] pub auction_id: AuctionId, pub transaction_hash: Option, #[serde(flatten)] @@ -88,7 +89,8 @@ pub struct SolverSettlement { #[serde(default)] pub solver_address: H160, #[serde(flatten)] - pub score: Score, + pub score: Option, + #[serde(default)] pub ranking: usize, #[serde_as(as = "BTreeMap<_, HexOrDecimalU256>")] pub clearing_prices: BTreeMap, @@ -249,7 +251,7 @@ mod tests { solutions: vec![SolverSettlement { solver: "2".to_string(), solver_address: H160([0x22; 20]), - score: Score::Solver(1.into()), + score: Some(Score::Solver(1.into())), ranking: 1, clearing_prices: btreemap! { H160([0x22; 20]) => 8.into(), @@ -276,4 +278,154 @@ mod tests { let deserialized: SolverCompetitionAPI = serde_json::from_value(correct).unwrap(); assert_eq!(orig, deserialized); } + + #[test] + fn deserialize_legacy() { + let competition = serde_json::json!({ + "auction": { + "orders": [ + "0x722d8dfe5c75970e1712cc16544904bf16d9d74e807e111affeb1615aa55fdf46880f5334158980ecfded17ae18b455efce1c0b562d6bc49", + "0xf41cb7759c73a1349d1e669c7faf9cbd8dab5e24093276662aeb34a5196d99e47d2ab9ca511ebd6f03971fb417d3492aa82513f062d820fd", + "0xd4362356665382f184d325456bd69dbb7e3634418f0c768a99b72c66c16845987d2ab9ca511ebd6f03971fb417d3492aa82513f062d781a7", + "0xa9f65667db90b8bc317de0bf605f0a27163c4872d2a7e61febf7f38c9639a4fa64440c76dd749ea2235834699d9d9dee11945df262d6d71c", + "0x85728e7ca689e27f0d21aa082950367d8a2d4566f05b7cb64a13b91337fedb32b00098ba6eedaed1d4ab31e7fa14cb969ccce65362d6bc50", + "0xdfa77d52102766568a1b96260e6de98f0f51085b6f79a723ea3879b1647bae5c3cbc3bed185b837d79ba18d36a3859ecbcfc3dc862d6bcdd", + "0x78fc867f6bb81e83d29037cc7fb723b857b463b12483b7763428095bab1491233cbc3bed185b837d79ba18d36a3859ecbcfc3dc862d6bcdd", + "0x16f5280dfe1298f4fb050760b56585886e795f62c4fb90c1f4c884e643f67cc938ec31504f48c7e944567904d519f4059be7338762d6bf03", + "0x63f49fb54ce4386cf967954e1a2b218192a954d111b22d350172251e9dd7eacf3cbc3bed185b837d79ba18d36a3859ecbcfc3dc862d6bcdd", + "0xf56a3bd1cd0a82a4c5cd1521b8380e202076a055e7abc20eca9ab5a77118816a3476c61df898328c0084e3ee6e999e10a3f99aed62d6bed3", + "0x129486c712882ae252b7b1b31bb90da5870e4e1a3bec84158ce68ee16703f041f4b0400eb76fb71e111322360cea2efdc6be0bfb62d6c0ab", + "0x6f34c0c0550e0346ebc655856298c4d6ff9983c784701dff1daf8bffae9b3a31129436d21ce486f18f4f008fb6993e2f9dbb604462d6bc65", + "0xe69b16bb2a58749e05bfb237fa0871a61bd81be3ec94411850d5d8aabdbcfac0b0a9d7d6db9d58fd1cf528353a746d4b126c8b1362d6bc60" + ], + "prices": { + "0x090185f2135308bad17527004364ebcc2d37e5f6": "663024329719", + "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599": "144090225841256374334541266944", + "0x2a54ba2964c8cd459dc568853f79813a60761b58": "643739098617831", + "0x5a98fcbea516cf06857215779fd812ca3bef1b32": "1081794275696931", + "0x6b175474e89094c44da98b954eedeac495271d0f": "648404116234422", + "0x853d955acef822db058eb8505911ed77f175b99e": "649931240528682", + "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "1078331371934876", + "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "650067321556881023128567808", + "0xae7ab96520de3a18e5e111b5eaab095312d7fe84": "977793681138140416", + "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": "1000000000000000000", + "0xc0c293ce456ff0ed870add98a0828dd4d2903dbf": "2141355733722144", + "0xdac17f958d2ee523a2206206994597c13d831ec7": "648937545822291268292575232" + } + }, + "gasPrice": 75250229788u128, + "solutions": [ + { + "orders": [ + { + "id": "0xa9f65667db90b8bc317de0bf605f0a27163c4872d2a7e61febf7f38c9639a4fa64440c76dd749ea2235834699d9d9dee11945df262d6d71c", + "executedAmount": "19827747502258423744093" + } + ], + "solver": "ParaSwap", + "callData": "0x13d79a0b000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009d409a0a012cfba9b15f6d4b36ac57a46966ab9a000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000079b1a0086000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000064440c76dd749ea2235834699d9d9dee11945df2000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000078c72ce760000000000000000000000000000000000000000000000000000000062d6d71c2b8694ed30082129598720860e8e972f07aa10d9b81cae16ca0e2cfb24743e24000000000000000000000000000000000000000000000002d4335c6bc9ba20000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000432dd45c5653c12465d0000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001464440c76dd749ea2235834699d9d9dee11945df2000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000aa0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000def171fe48cf0115b1d80b88dc8eab59176fee57000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000944a94e78ef00000000000000000000000000000000000000000000000000000000000000200000000000000000000000009d409a0a012cfba9b15f6d4b36ac57a46966ab9a000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000079542a0c8000000000000000000000000000000000000000000000000000000079b1a008600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000313073594a6e34715a70636244534c76686c364f010000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000062d7105f3ac35fedfe2f4337a5caba4f4fbc7ea5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000004a0000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bdd13a9dd364e5557e0710fc1d2ac145b5e8f3be0000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000006000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000000000000000000000000000000000000000232800000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000062d6ca0f000000000000000000000000000000000000000000000000000000000000002b9d409a0a012cfba9b15f6d4b36ac57a46966ab9a002710c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000f9234cb08edb93c0d4a4d4c70cc3ffd070e78e0700000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000004de49461173740d27311b176476fa27e94c681b1ea6b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000bdd13a9dd364e5557e0710fc1d2ac145b5e8f3be000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000006000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000062d6ca0f000000000000000000000000000000000000000000000000000000000000002bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc20001f4a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "objective": { + "gas": 583811, + "cost": 43931911902762060u128, + "fees": 56271811373847650u128, + "total": 177151378491683300u128, + "surplus": 159811479020597700u128 + }, + "clearingPrices": { + "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "32666943622", + "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "19827747502258423744093" + } + }, + { + "orders": [ + { + "id": "0xa9f65667db90b8bc317de0bf605f0a27163c4872d2a7e61febf7f38c9639a4fa64440c76dd749ea2235834699d9d9dee11945df262d6d71c", + "executedAmount": "19827747502258423744093" + } + ], + "solver": "0x", + "callData": "0x13d79a0b000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009d409a0a012cfba9b15f6d4b36ac57a46966ab9a000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000079a3d59cd000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000064440c76dd749ea2235834699d9d9dee11945df2000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000078c72ce760000000000000000000000000000000000000000000000000000000062d6d71c2b8694ed30082129598720860e8e972f07aa10d9b81cae16ca0e2cfb24743e24000000000000000000000000000000000000000000000002d4335c6bc9ba20000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000432dd45c5653c12465d0000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001464440c76dd749ea2235834699d9d9dee11945df20000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001486af479b20000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000079466a383000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000429d409a0a012cfba9b15f6d4b36ac57a46966ab9a002710c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20001f4a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000869584cd0000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab410000000000000000000000000000000000000000000000a35b75354962d6bc020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "objective": { + "gas": 299886, + "cost": 22566490410204170u128, + "fees": 56271811373847650u128, + "total": 189116435824068400u128, + "surplus": 150411114860424960u128 + }, + "clearingPrices": { + "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "32652483021", + "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "19827747502258423744093" + } + }, + { + "orders": [ + { + "id": "0xa9f65667db90b8bc317de0bf605f0a27163c4872d2a7e61febf7f38c9639a4fa64440c76dd749ea2235834699d9d9dee11945df262d6d71c", + "executedAmount": "19827747502258423744093" + } + ], + "solver": "Otex", + "callData": "0x13d79a0b000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009d409a0a012cfba9b15f6d4b36ac57a46966ab9a000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000d7ba10dce77720000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000064440c76dd749ea2235834699d9d9dee11945df2000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000078c72ce760000000000000000000000000000000000000000000000000000000062d6d71c2b8694ed30082129598720860e8e972f07aa10d9b81cae16ca0e2cfb24743e24000000000000000000000000000000000000000000000002d4335c6bc9ba20000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000432dd45c5653c12465d0000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001464440c76dd749ea2235834699d9d9dee11945df20000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001486af479b20000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000432dd45c5653c12465d0000000000000000000000000000000000000000000000000000000798aec2ca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000429d409a0a012cfba9b15f6d4b36ac57a46966ab9a002710c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20001f4a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000869584cd000000000000000000000000100000000000000000000000000000000000001100000000000000000000000000000000000000000000008c6a66656562d6bc010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "objective": { + "gas": 299620, + "cost": 22546473849080560u128, + "fees": 56271811373847650u128, + "total": 189783293422631800u128, + "surplus": 151057955897864700u128 + }, + "clearingPrices": { + "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "100000", + "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "60721701581190944" + } + }, + { + "orders": [ + { + "id": "0xa9f65667db90b8bc317de0bf605f0a27163c4872d2a7e61febf7f38c9639a4fa64440c76dd749ea2235834699d9d9dee11945df262d6d71c", + "executedAmount": "19827747502258423744093" + } + ], + "solver": "1Inch", + "callData": "0x13d79a0b000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009d409a0a012cfba9b15f6d4b36ac57a46966ab9a000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000079e9045eb000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000064440c76dd749ea2235834699d9d9dee11945df2000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000078c72ce760000000000000000000000000000000000000000000000000000000062d6d71c2b8694ed30082129598720860e8e972f07aa10d9b81cae16ca0e2cfb24743e24000000000000000000000000000000000000000000000002d4335c6bc9ba20000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000432dd45c5653c12465d0000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001464440c76dd749ea2235834699d9d9dee11945df20000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000011800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000001111111254fb6c44bac0bed2854e76f90643097d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000010287c025200000000000000000000000000f2f400c138f9fb900576263af0bc7fcde2b1b8a8000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000009d409a0a012cfba9b15f6d4b36ac57a46966ab9a000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000f2f400c138f9fb900576263af0bc7fcde2b1b8a80000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab41000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000079c9cedc80000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e80000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000009600000000000000000000000000000000000000000000000000000000000000c40800000000000000000000000e63a3d5d02247e11c3cf99450bdd997e36ce6b4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000104128acb08000000000000000000000000f2f400c138f9fb900576263af0bc7fcde2b1b8a80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000432dd45c5653c12465d00000000000000000000000000000000000000000000000000000001000276a400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000400000000000000000000000009d409a0a012cfba9b15f6d4b36ac57a46966ab9a000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006a4df92bd08000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000005a0000000000000000000000000f2f400c138f9fb900576263af0bc7fcde2b1b8a800000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000064eb5625d9000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000095e6f48254609a6ee006f7d493c8e5fb97094cef000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000800000000000000000000000080bf510fcbf18b91105470639e9561022937712000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000324b4be83d50000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000ae347930bd1e7b0f35588b92280f9e75000000000000000000000000f2f400c138f9fb900576263af0bc7fcde2b1b8a80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007a09bdf0c00000000000000000000000000000000000000000000000126aefb2da3e19000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000062d6bc560000000000000000000000000000000000000000000000000000000023b106d3000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000421bb3d49a410e30dfb0ea620a5509cea0060a1ebd165cfb2a040e0bd12f8c5e67f30fbad70ae9457e882bacc5c3f3d65d4f3e0c47bf3cec56f7ec9ef9580eedd61e04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000004480000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000064ec77bbdb000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000320000000000000000000000000000003200000000000000000000000000000000000000000000000126aefb2da3e190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000024432ce0a7c00000000000000000000000000000000000000000000000000000000000000808000000000000000000000000000000000000000000000000000000000000044000000000000000000000000f2f400c138f9fb900576263af0bc7fcde2b1b8a800000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a405971224000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000100000000000000000000000000000000000000000000000000000000004c417400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004470bdb947000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000079e9045eb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000016414284aab00000000000000000000000000000000000000000000000000000000000000808000000000000000000000000000000000000000000000000000000000000024000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000100000000000000000000000000000001000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000001111111254fb6c44bac0bed2854e76f90643097d00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d26cd1970000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "objective": { + "gas": 581683, + "cost": 43771779413773200u128, + "fees": 56271811373847650u128, + "total": 215069150845838460u128, + "surplus": 197569118885764030u128 + }, + "clearingPrices": { + "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "32725026283", + "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "19827747502258423744093" + } + }, + { + "orders": [ + { + "id": "0xa9f65667db90b8bc317de0bf605f0a27163c4872d2a7e61febf7f38c9639a4fa64440c76dd749ea2235834699d9d9dee11945df262d6d71c", + "executedAmount": "19827747502258423744093" + } + ], + "solver": "Atlas", + "callData": "0x13d79a0b000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000020000000000000000000000009d409a0a012cfba9b15f6d4b36ac57a46966ab9a000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000007a0389b76000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000064440c76dd749ea2235834699d9d9dee11945df2000000000000000000000000000000000000000000000432dd45c5653c12465d000000000000000000000000000000000000000000000000000000078c72ce760000000000000000000000000000000000000000000000000000000062d6d71c2b8694ed30082129598720860e8e972f07aa10d9b81cae16ca0e2cfb24743e24000000000000000000000000000000000000000000000002d4335c6bc9ba20000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000432dd45c5653c12465d0000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001464440c76dd749ea2235834699d9d9dee11945df20000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000011c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000001111111254fb6c44bac0bed2854e76f90643097d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000010687c025200000000000000000000000000288931fa76d7b0482f0fd0bca9a50bf0d22b9fef000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000009d409a0a012cfba9b15f6d4b36ac57a46966ab9a000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000288931fa76d7b0482f0fd0bca9a50bf0d22b9fef0000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab41000000000000000000000000000000000000000000000432dd45c5653c12465d00000000000000000000000000000000000000000000000000000007a006a1620000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ec0c22c548b1fbf6ad95fccf6a5eb831086b020196106a56183b08c40a389bf0692e62d5bb0b072369166c33bc1da3acc2f4ee55395697159d0badb8a9982ca11f2000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000009600000000000000000000000000000000000000000000000000000000000000c40800000000000000000000000e63a3d5d02247e11c3cf99450bdd997e36ce6b4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000104128acb08000000000000000000000000288931fa76d7b0482f0fd0bca9a50bf0d22b9fef0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000432dd45c5653c12465d00000000000000000000000000000000000000000000000000000001000276a400000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000400000000000000000000000009d409a0a012cfba9b15f6d4b36ac57a46966ab9a000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000006a4df92bd08000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000005a0000000000000000000000000288931fa76d7b0482f0fd0bca9a50bf0d22b9fef00000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001408000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000064eb5625d9000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000095e6f48254609a6ee006f7d493c8e5fb97094cef000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000800000000000000000000000080bf510fcbf18b91105470639e9561022937712000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000324b4be83d50000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000ae347930bd1e7b0f35588b92280f9e75000000000000000000000000288931fa76d7b0482f0fd0bca9a50bf0d22b9fef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007a084b7b000000000000000000000000000000000000000000000000126aefb2da3e19000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000062d6bc59000000000000000000000000000000000000000000000000000000001139a78d000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000024f47261b0000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000421cff6a1df0d3f9ceaf4a3eea4da7e19e4da9d0ffa07fd5972072d161b9ee5ab9f92be6fe705464b61370597f9d94c49f2212ca8a3dca989d6dbdf10226d481074a04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000004480000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000064ec77bbdb000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000320000000000000000000000000000003200000000000000000000000000000000000000000000000126aefb2da3e190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000024432ce0a7c00000000000000000000000000000000000000000000000000000000000000808000000000000000000000000000000000000000000000000000000000000044000000000000000000000000288931fa76d7b0482f0fd0bca9a50bf0d22b9fef00000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a405971224000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000010000000000000000000000000000000100000000000000000000000000000000000000000000000000000000004c3e6600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004470bdb947000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000007a0389b760000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000016414284aab00000000000000000000000000000000000000000000000000000000000000808000000000000000000000000000000000000000000000000000000000000024000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000100000000000000000000000000000001000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000001111111254fb6c44bac0bed2854e76f90643097d00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cfee7c080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "objective": { + "gas": 559130, + "cost": 42074660981364440u128, + "fees": 56271811373847650u128, + "total": 234844097384395900u128, + "surplus": 215646946991912700u128 + }, + "clearingPrices": { + "0x9d409a0a012cfba9b15f6d4b36ac57a46966ab9a": "32752835446", + "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "19827747502258423744093" + } + } + ], + "transactionHash": "0x044499c2a830890cb0a8ecf9aec6c5621e8310092a58d369cdef726254d3d108", + "auctionStartBlock": 15173535, + "liquidityCollectedBlock": 15173535, + "competitionSimulationBlock": 15173535 + }); + assert!(serde_json::from_value::(competition).is_ok()) + } } diff --git a/crates/solver/src/driver.rs b/crates/solver/src/driver.rs index da17bf67b2..3e8e4c6f3e 100644 --- a/crates/solver/src/driver.rs +++ b/crates/solver/src/driver.rs @@ -361,7 +361,7 @@ impl Driver { .map(|(solver, rated_settlement)| SolverSettlement { solver: solver.name().to_string(), solver_address: solver.account().address(), - score: rated_settlement.score, + score: Some(rated_settlement.score), ranking: rated_settlement.ranking, clearing_prices: rated_settlement .settlement