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

feat: implement oracle log #27

Merged
merged 6 commits into from
Apr 5, 2023
Merged

feat: implement oracle log #27

merged 6 commits into from
Apr 5, 2023

Conversation

JhChoy
Copy link
Contributor

@JhChoy JhChoy commented Apr 4, 2023

Implementation of the trade log histories for the order book.

contracts/OrderBook.sol Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2023

Codecov Report

Patch coverage: 88.88% and project coverage change: -0.35 ⚠️

Comparison is base (e1a3e46) 99.23% compared to head (3813b69) 98.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #27      +/-   ##
==========================================
- Coverage   99.23%   98.88%   -0.35%     
==========================================
  Files           9        9              
  Lines         521      539      +18     
  Branches       93       98       +5     
==========================================
+ Hits          517      533      +16     
  Misses          3        3              
- Partials        1        3       +2     
Impacted Files Coverage Δ
contracts/OrderBook.sol 99.13% <88.88%> (-0.57%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Contributor Author

@JhChoy JhChoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have tests for cases where it circulates.

@graykode
Copy link
Contributor

graykode commented Apr 5, 2023

It would be good to have tests for cases where it circulates.

14ccf8a Done!

@github-actions

This comment has been minimized.

onemonster
onemonster previously approved these changes Apr 5, 2023
@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Apr 5, 2023

Test with 84bd445.

  • EHET : Empty heap with empty segment tree
  • EHDT : Empty heap with dirty segment tree
  • FHET : Filled heap with empty segment tree
  • FHFT : Filled heap with filled segment tree

Changes to gas cost

Generated at commit: 84bd44549d9e5745e7aba6fa1e4f224cece6cc4b, compared to commit: e1a3e4686e473012048de2893a258158af72144e

🧾 Summary (10% most significant diffs)

Contract Method Avg (+/-) %
GasReporter contract EHDT_FullyMarketAsk
EHDT_PartiallyMarketBid
EHET_PartiallyMarketAsk
FHET_PartiallyMarketAsk
FHFT_PartiallyMarketBid
marketAskOrder
+25,644 ❌
+25,624 ❌
+25,644 ❌
+25,644 ❌
+25,624 ❌
+25,644 ❌
+29.74%
+31.26%
+29.73%
+29.73%
+31.25%
+43.19%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
GasReporter contract 948,376 (0) EHDT_FullyCancelAsk
EHDT_FullyCancelBid
EHDT_FullyClaimAsk
EHDT_FullyClaimBid
EHDT_FullyMarketAsk
EHDT_FullyMarketBid
EHDT_LimitAsk
EHDT_LimitBid
EHDT_PartiallyCancelAsk
EHDT_PartiallyCancelBid
EHDT_PartiallyMarketAsk
EHDT_PartiallyMarketBid
EHET_FullyCancelAsk
EHET_FullyCancelBid
EHET_FullyClaimAsk
EHET_FullyClaimBid
EHET_FullyMarketAsk
EHET_FullyMarketBid
EHET_LimitAsk
EHET_LimitBid
EHET_PartiallyCancelAsk
EHET_PartiallyCancelBid
EHET_PartiallyMarketAsk
EHET_PartiallyMarketBid
FHET_FullyCancelAsk
FHET_FullyCancelBid
FHET_FullyMarketAsk
FHET_FullyMarketBid
FHET_LimitAsk
FHET_LimitBid
FHET_PartiallyCancelAsk
FHET_PartiallyCancelBid
FHET_PartiallyMarketAsk
FHET_PartiallyMarketBid
FHFT_FullyCancelAsk
FHFT_FullyCancelBid
FHFT_FullyMarketAsk
FHFT_FullyMarketBid
FHFT_LimitAsk
FHFT_LimitBid
FHFT_PartiallyCancelAsk
FHFT_PartiallyCancelBid
FHFT_PartiallyMarketAsk
FHFT_PartiallyMarketBid
cancelOrder
limitAskOrder
limitBidOrder
marketAskOrder
marketBidOrder
121,719 (+69)
120,818 (+69)
80,787 (+23)
80,714 (+23)
111,885 (+25,644)
115,019 (+25,623)
143,721 (-44)
156,772 (-44)
153,331 (+69)
152,466 (+69)
111,907 (+25,644)
107,606 (+25,624)
121,653 (+69)
137,919 (+69)
80,766 (+23)
80,713 (+23)
111,972 (+25,644)
100,336 (+20,499)
260,854 (-44)
239,634 (-44)
170,498 (+69)
169,587 (+69)
111,906 (+25,644)
90,567 (+20,499)
121,675 (+69)
137,876 (+69)
111,973 (+25,644)
100,369 (+20,498)
187,116 (-44)
166,216 (-44)
125,249 (+69)
141,473 (+69)
111,906 (+25,644)
90,567 (+20,499)
121,654 (+69)
120,751 (+69)
111,929 (+25,644)
115,041 (+25,623)
121,402 (-44)
117,451 (-44)
125,271 (+69)
124,416 (+69)
111,907 (+25,644)
107,628 (+25,624)
40,738 (+55)
46,914 (-35)
44,739 (-35)
84,018 (+25,644)
45,357 (+1,476)
+0.06%
+0.06%
+0.03%
+0.03%
+29.74%
+28.66%
-0.03%
-0.03%
+0.05%
+0.05%
+29.73%
+31.26%
+0.06%
+0.05%
+0.03%
+0.03%
+29.71%
+25.68%
-0.02%
-0.02%
+0.04%
+0.04%
+29.73%
+29.26%
+0.06%
+0.05%
+29.70%
+25.66%
-0.02%
-0.03%
+0.06%
+0.05%
+29.73%
+29.26%
+0.06%
+0.06%
+29.72%
+28.66%
-0.04%
-0.04%
+0.06%
+0.06%
+29.73%
+31.25%
+0.14%
-0.07%
-0.08%
+43.93%
+3.36%
121,719 (+69)
120,818 (+69)
80,787 (+23)
80,714 (+23)
111,885 (+25,644)
115,019 (+25,623)
143,721 (-44)
156,772 (-44)
153,331 (+69)
152,466 (+69)
111,907 (+25,644)
107,606 (+25,624)
121,653 (+69)
137,919 (+69)
80,766 (+23)
80,713 (+23)
111,972 (+25,644)
100,336 (+20,499)
260,854 (-44)
239,634 (-44)
170,498 (+69)
169,587 (+69)
111,906 (+25,644)
90,567 (+20,499)
121,675 (+69)
137,876 (+69)
111,973 (+25,644)
100,369 (+20,498)
187,116 (-44)
166,216 (-44)
125,249 (+69)
141,473 (+69)
111,906 (+25,644)
90,567 (+20,499)
121,654 (+69)
120,751 (+69)
111,929 (+25,644)
115,041 (+25,623)
121,402 (-44)
117,451 (-44)
125,271 (+69)
124,416 (+69)
111,907 (+25,644)
107,628 (+25,624)
41,779 (+55)
74,526 (-43)
84,445 (-42)
85,018 (+25,644)
50,026 (+1,660)
+0.06%
+0.06%
+0.03%
+0.03%
+29.74%
+28.66%
-0.03%
-0.03%
+0.05%
+0.05%
+29.73%
+31.26%
+0.06%
+0.05%
+0.03%
+0.03%
+29.71%
+25.68%
-0.02%
-0.02%
+0.04%
+0.04%
+29.73%
+29.26%
+0.06%
+0.05%
+29.70%
+25.66%
-0.02%
-0.03%
+0.06%
+0.05%
+29.73%
+29.26%
+0.06%
+0.06%
+29.72%
+28.66%
-0.04%
-0.04%
+0.06%
+0.06%
+29.73%
+31.25%
+0.13%
-0.06%
-0.05%
+43.19%
+3.43%
121,719 (+69)
120,818 (+69)
80,787 (+23)
80,714 (+23)
111,885 (+25,644)
115,019 (+25,623)
143,721 (-44)
156,772 (-44)
153,331 (+69)
152,466 (+69)
111,907 (+25,644)
107,606 (+25,624)
121,653 (+69)
137,919 (+69)
80,766 (+23)
80,713 (+23)
111,972 (+25,644)
100,336 (+20,499)
260,854 (-44)
239,634 (-44)
170,498 (+69)
169,587 (+69)
111,906 (+25,644)
90,567 (+20,499)
121,675 (+69)
137,876 (+69)
111,973 (+25,644)
100,369 (+20,498)
187,116 (-44)
166,216 (-44)
125,249 (+69)
141,473 (+69)
111,906 (+25,644)
90,567 (+20,499)
121,654 (+69)
120,751 (+69)
111,929 (+25,644)
115,041 (+25,623)
121,402 (-44)
117,451 (-44)
125,271 (+69)
124,416 (+69)
111,907 (+25,644)
107,628 (+25,624)
42,819 (+55)
79,674 (-44)
96,855 (-44)
85,018 (+25,644)
50,026 (+1,660)
+0.06%
+0.06%
+0.03%
+0.03%
+29.74%
+28.66%
-0.03%
-0.03%
+0.05%
+0.05%
+29.73%
+31.26%
+0.06%
+0.05%
+0.03%
+0.03%
+29.71%
+25.68%
-0.02%
-0.02%
+0.04%
+0.04%
+29.73%
+29.26%
+0.06%
+0.05%
+29.70%
+25.66%
-0.02%
-0.03%
+0.06%
+0.05%
+29.73%
+29.26%
+0.06%
+0.06%
+29.72%
+28.66%
-0.04%
-0.04%
+0.06%
+0.06%
+29.73%
+31.25%
+0.13%
-0.06%
-0.05%
+43.19%
+3.43%
121,719 (+69)
120,818 (+69)
80,787 (+23)
80,714 (+23)
111,885 (+25,644)
115,019 (+25,623)
143,721 (-44)
156,772 (-44)
153,331 (+69)
152,466 (+69)
111,907 (+25,644)
107,606 (+25,624)
121,653 (+69)
137,919 (+69)
80,766 (+23)
80,713 (+23)
111,972 (+25,644)
100,336 (+20,499)
260,854 (-44)
239,634 (-44)
170,498 (+69)
169,587 (+69)
111,906 (+25,644)
90,567 (+20,499)
121,675 (+69)
137,876 (+69)
111,973 (+25,644)
100,369 (+20,498)
187,116 (-44)
166,216 (-44)
125,249 (+69)
141,473 (+69)
111,906 (+25,644)
90,567 (+20,499)
121,654 (+69)
120,751 (+69)
111,929 (+25,644)
115,041 (+25,623)
121,402 (-44)
117,451 (-44)
125,271 (+69)
124,416 (+69)
111,907 (+25,644)
107,628 (+25,624)
61,939 (+55)
215,074 (-44)
234,265 (-44)
86,018 (+25,644)
54,696 (+1,845)
+0.06%
+0.06%
+0.03%
+0.03%
+29.74%
+28.66%
-0.03%
-0.03%
+0.05%
+0.05%
+29.73%
+31.26%
+0.06%
+0.05%
+0.03%
+0.03%
+29.71%
+25.68%
-0.02%
-0.02%
+0.04%
+0.04%
+29.73%
+29.26%
+0.06%
+0.05%
+29.70%
+25.66%
-0.02%
-0.03%
+0.06%
+0.05%
+29.73%
+29.26%
+0.06%
+0.06%
+29.72%
+28.66%
-0.04%
-0.04%
+0.06%
+0.06%
+29.73%
+31.25%
+0.09%
-0.02%
-0.02%
+42.48%
+3.49%
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
294,912 (0)
245,784 (0)
245,784 (0)
4 (0)
4 (0)

@graykode graykode merged commit 0ccec4c into main Apr 5, 2023
@graykode graykode deleted the feat/oracle branch April 5, 2023 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants