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
6 changes: 4 additions & 2 deletions crates/shared/src/trade_finding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,13 @@ impl Trade {
OrderKind::Sell => order_amount
.mul(&sell_price)
.checked_div(&buy_price)
squadgazzz marked this conversation as resolved.
Show resolved Hide resolved
.context("div by zero: buy price")?,
.context("div by zero: buy price")?
.ceil(),
OrderKind::Buy => order_amount
.mul(&buy_price)
.checked_div(&sell_price)
.context("div by zero: sell price")?,
.context("div by zero: sell price")?
.ceil(),
squadgazzz marked this conversation as resolved.
Show resolved Hide resolved
};

big_rational_to_u256(&out_amount).context("out amount is not a valid U256")
Expand Down