-
Notifications
You must be signed in to change notification settings - Fork 54
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
refactor: refactor x/exchange module #217
Conversation
- use sdk.Int for quantities - change MaxPrice to 10^24 - store price as tick index for OrderBookOrderIndex - apply ceiling/truncation per order, not per orderer
also add MaxOrderQty, MaxOrderQuote
also change MaxOrderQty, MaxOrderQuote to 10^30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for drafting this PR.
After reviewing the overall codebase, the followings are the highlights.
- Add test suites and simulations for order source orders and their matching
- This test for order source orders is very important since this is the part to interaction with other module for order like amm.
- Can we check the matched price and matched amount in
Batch_test
?- Currently, only last price is checked.
- Much more comments above the functions/variables to explain what they are (even though the explanation is short and brief.
- Please remove all
// TODO: ...
part.- Others cannot know if it is not completed parts or to be completed or to be discussed further.
- Please make the discussion in order to resolve all
TODO:
part ASAP.
- What if the max value of life span of limit order?
- Please complete spec.
- Need to explain in detail about mid-block processing since this is the new concept.
Events
,README
need to be completed
Other detailed comments are added as inline comments.
@kingcre In L47 of
But, due to the code in L20 as follow,
we might not have the case of |
Yes, as you said |
avoid store writes inside nested store iterations
also rename Output to Received and add FeePaid, FeeReceived to SwapRouteResult
…ctor-exchange Add test cases for batch and matching
Closing. See #223 |
Description
sdk.Int
for quantitiesmin_order_quantity
,min_order_quote
from x/ammPool
into x/exchangeMarket
and also addmax_order_quantity
,max_order_quote
Market
'sfee_collector
MaxPrice
to 10^24