Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support JIT orders in the trade verifier #3085

Merged
merged 44 commits into from
Dec 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a423e57
Quote with JIT orders API
squadgazzz Oct 24, 2024
0bf5393
Updated description
squadgazzz Oct 24, 2024
9cc9abe
Redundant defaults
squadgazzz Oct 25, 2024
898e5e7
Redundant amount
squadgazzz Oct 25, 2024
5e1d001
Support jit orders quote
squadgazzz Oct 25, 2024
0937d4e
Address rc
squadgazzz Oct 28, 2024
e759f42
Restore the custom quote deserializer
squadgazzz Oct 28, 2024
e7b756a
Address rc
squadgazzz Oct 28, 2024
f40fafb
Serde untagged
squadgazzz Oct 28, 2024
1dddcf5
Merge branch '3082/jit-orders-quote-api' into 3082/trade-verifier-jit…
squadgazzz Oct 28, 2024
18686fe
Fixes after merge
squadgazzz Oct 28, 2024
67af897
Address rc
squadgazzz Oct 28, 2024
8bcb18a
Merge branch 'main' into 3082/trade-verifier-jit-orders-support
squadgazzz Oct 28, 2024
1ee64ba
Compute expected amounts
squadgazzz Oct 28, 2024
f676a96
Compute jit orders net changes
squadgazzz Oct 30, 2024
941647c
Combine tests
squadgazzz Oct 30, 2024
9d522d2
Avoid redundant clone
squadgazzz Oct 30, 2024
81836ec
Use checked_ceil_div
squadgazzz Oct 30, 2024
bb83789
Merge branch 'main' into 3082/trade-verifier-jit-orders-support
squadgazzz Oct 30, 2024
a37b3ac
Redundant modulus
squadgazzz Oct 30, 2024
265e598
Comment
squadgazzz Oct 30, 2024
ac2dbd4
Avoid tokens and prices duplicates
squadgazzz Oct 30, 2024
8c7503a
Tests comment
squadgazzz Oct 30, 2024
e68e0df
Encode jit orders function
squadgazzz Oct 31, 2024
0afb473
Encode fake trade function
squadgazzz Oct 31, 2024
09e6330
BigRational::neg()
squadgazzz Oct 31, 2024
2e71436
Use BigDecimal in the config
squadgazzz Oct 31, 2024
a308910
Avoid calculation with empty jit orders
squadgazzz Nov 1, 2024
3067cd9
Address comments
squadgazzz Nov 5, 2024
4a0767c
Naming
squadgazzz Nov 5, 2024
e051528
Fetch the balances in the solver contract
squadgazzz Nov 7, 2024
2bcb3ac
Refactor the unit test
squadgazzz Nov 7, 2024
bea5183
Revert balance fetching changes
squadgazzz Nov 7, 2024
7b29d96
Avoid using IR optimizer
squadgazzz Nov 7, 2024
0be2814
Revert "Revert balance fetching changes"
squadgazzz Nov 18, 2024
277b4e3
Adjust balance fetching
squadgazzz Nov 18, 2024
f1e1806
Pr comments
squadgazzz Nov 28, 2024
8718d83
Ceil div
squadgazzz Nov 28, 2024
4ec514e
Merge branch 'main' into 3082/trade-verifier-jit-orders-support
squadgazzz Nov 28, 2024
8324c32
Redundant ceil
squadgazzz Nov 28, 2024
47d2642
Merge branch 'main' into 3082/trade-verifier-jit-orders-support
squadgazzz Dec 2, 2024
9b0e906
Redundant changes
squadgazzz Dec 2, 2024
fc0ad49
Comment
squadgazzz Dec 2, 2024
ca9109d
Merge branch 'main' into 3082/trade-verifier-jit-orders-support
squadgazzz Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tests comment
squadgazzz committed Oct 30, 2024
commit 8c7503acc4b57f02e2a02db7a744baec37e37bcf
24 changes: 12 additions & 12 deletions crates/shared/src/price_estimation/trade_verifier.rs
Original file line number Diff line number Diff line change
@@ -800,9 +800,9 @@ mod tests {

let jit_orders = [
dto::JitOrder {
sell_token: buy_token, // Solver sells Token B
buy_token: sell_token, // Solver buys Token A
executed_amount: U256::from(200u64),
sell_token: buy_token, // Solver sells Token B
buy_token: sell_token, // Solver buys Token A
executed_amount: U256::from(200u64), // Fills the query partially
side: dto::Side::Sell,
sell_amount: U256::from(200u64),
buy_amount: U256::from(400u64),
@@ -816,9 +816,9 @@ mod tests {
signing_scheme: SigningScheme::Eip1271,
},
dto::JitOrder {
sell_token: buy_token, // Solver sell Token B
buy_token: sell_token, // Solver buys Token A
executed_amount: U256::from(400u64),
sell_token: buy_token, // Solver sell Token B
buy_token: sell_token, // Solver buys Token A
executed_amount: U256::from(400u64), // Fills the query partially
side: dto::Side::Buy,
sell_amount: U256::from(200u64),
buy_amount: U256::from(400u64),
@@ -908,9 +908,9 @@ mod tests {

let jit_orders = [
dto::JitOrder {
sell_token: buy_token, // Solver sells Token B
buy_token: sell_token, // Solver buys Token A
executed_amount: U256::from(200u64),
sell_token: buy_token, // Solver sells Token B
buy_token: sell_token, // Solver buys Token A
executed_amount: U256::from(250u64), // Fully fills the query
side: dto::Side::Sell,
sell_amount: U256::from(250u64),
buy_amount: U256::from(500u64),
@@ -924,9 +924,9 @@ mod tests {
signing_scheme: SigningScheme::Eip1271,
},
dto::JitOrder {
sell_token: buy_token, // Solver sell Token B
buy_token: sell_token, // Solver buys Token A
executed_amount: U256::from(500u64),
sell_token: buy_token, // Solver sell Token B
buy_token: sell_token, // Solver buys Token A
executed_amount: U256::from(500u64), // Fully fills the query
side: dto::Side::Buy,
sell_amount: U256::from(250u64),
buy_amount: U256::from(500u64),