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

allow grace period for market orders to be filled #168

Merged
merged 7 commits into from
Mar 7, 2024

Conversation

atvanguard
Copy link

@atvanguard atvanguard commented Mar 6, 2024

Why this should be merged

  • Allow some grace to market orders to be filled and accept post-only orders that might fill them. The post-only order will still be executed as a maker order. Think of it as a JIT liquidity concept.
  • run matching engine immediately if signed order is fill-able.

How this works

  • When determining the asks/bidsHeads, we ignore the market orders on the book.
  • Set shouldTriggerMatching=true is matcheable.

How this was tested

  • Unit test
  • Local testing by placing the signed order after the market order
t=2024-03-07T12:47:25.895932+0530 lvl=info msg=SignedOrder/OrderAccepted               order="Order: Id: 0xfd3c6a56573bcf1e9dd34a85ea9c92a9dfefefed5750b83a860e3ec5de9a0d9b, OrderType: signed, Market: 2, PositionType: long, UserAddress: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8, BaseAssetQuantity: 3, FilledBaseAssetQuantity: 0, Salt: 295357425583139074808357846432148822057, Price: 37, ReduceOnly: false, PostOnly: true, expireAt 2024-03-07 07:17:45 +0000 UTC, BlockNumber: 0" type=hubble caller=memory_database.go:422

t=2024-03-07T12:47:25.896000+0530 lvl=info msg="received new order, triggering matching pipeline" type=system caller=gossiper_orders.go:166

@atvanguard atvanguard requested a review from lumos42 March 6, 2024 14:34
@atvanguard atvanguard requested a review from debaghtk March 6, 2024 16:15
@atvanguard atvanguard merged commit 772ea72 into aylin Mar 7, 2024
3 checks passed
@atvanguard atvanguard deleted the market-order-grace branch March 7, 2024 09:43
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.

2 participants