-
Notifications
You must be signed in to change notification settings - Fork 649
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
Implement Limit Order Modification Feature #2743
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Define and implement the limit_order_update_operation. Still needs testing.
Some major facepalms in here... haha! but overall, it's looking good.
Add logic to match an updated limit order if the price is changed to be higher than the previous top-of-book price. I believe this completes #1604
Add dust check to limit order update logic, and test
Updating an order's expiration must make it expire later than before, not the same or sooner.
I pulled this out of a2192ec because I needed it separated from the rest of that commit.
Guard against the comittee setting fees for the operation which is not yet defined.
abitmore
changed the title
Limit Order Modification and Order-Sends-Order
Limit Order Modification and Simple Order-Sends-Order
Apr 28, 2023
Resolved conflicts: - libraries/chain/include/graphene/chain/market_evaluator.hpp - libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp - libraries/chain/include/graphene/chain/protocol/operations.hpp - libraries/chain/proposal_evaluator.cpp - libraries/protocol/include/graphene/protocol/market.hpp - tests/common/database_fixture.cpp
abitmore
commented
Apr 29, 2023
abitmore
changed the title
Limit Order Modification and Simple Order-Sends-Order
Implement Limit Order Modification Feature
Apr 30, 2023
17 tasks
abitmore
commented
May 8, 2023
- hard fork time - proposals - order existence - order owner - zero delta
Please retry analysis of this Pull-Request directly on SonarCloud. |
This was referenced May 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR for #1604.
Based on @nathanielhourt's work for #1604 (see nathanielhourt#1).
Changes:
limit_order_update_operation
, so that traders can update their limit orders directlyoperation_type
=77
0.375 BTS
(slightly lower than the current order creation fee on the BitShares Mainnet, and applicable to all refund mechanisms)NOTE 1:
The
base
amount in the new price is limited by an estimation of the order's maximum amount to sell. This is to mitigate against inappropriate price manipulation, although not completely avoid it.NOTE 2:
When updating a limit order with a non-zero deferred fee, we charge the owner a small fee equal to
order_cancel_fee * order_update_fee / order_create_fee
(not higher than the deferred fee), and refund the remainder in the deferred fee, the deferred fee is then refreshed with the new operation fee paid.The small fee is to mitigate potential transaction spam issues.
The deferred fee is used for all refund mechanisms.
Side effect:
Assuming that order update fee will be lower than order creation fee, traders can create an order and then update it immediately to reduce costs, both for making and taking.
NOTE 3:
Since the price can be modified,
sell_price.base.amount
is no longer always equal to the total amount allocated to the limit order. In the meanwhile, a new data fieldfilled_amount
is added tolimit_order_object
in PR #2776, this way users can still know the total amount.NOTE 4:
Please see #2749 for more info about automatic actions (Order-Sends-Order).