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

Crispheaney/guard bad limit order fills #304

Merged
merged 7 commits into from
Dec 22, 2022

Conversation

0xbigz
Copy link
Member

@0xbigz 0xbigz commented Dec 22, 2022

No description provided.

// if the auction isn't complete, cant fill against vamm yet
// use the vamm price to guard against bad fill for taker
if taker.orders[taker_order_index].is_limit_order()
&& !taker.orders[taker_order_index].is_auction_complete(slot)?
Copy link
Member Author

Choose a reason for hiding this comment

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

should check vs min_perp_auction_duration instead of auction completeness

@@ -1047,6 +1052,33 @@ export class DLOB {
bidNode
);

// extra guard against bad fills for perp limit orders where auction is incomplete
if (
isVariant(takerNode.order.marketType, 'perp') &&
Copy link
Member

Choose a reason for hiding this comment

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

do we really want to enforce market type here? this seems like a nice check for spot as well?

Copy link
Member

Choose a reason for hiding this comment

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

it's a bit tricky to do it on the smart contract, but we always try to fill against serum first, so i think it's ok to remove the perp check here

@crispheaney crispheaney merged commit f98d539 into master Dec 22, 2022
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

3 participants