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

fix: keep AMM ephemeral position throughout entire auction uncrossing #11615

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

wwestgarth
Copy link
Contributor

closes #11583

During auction uncrossing when trades are matched with an AMM, the AMM's actual position is only updated after we've left the matching engine and the trades are confirmed. This causes problems since as the uncrossing is happening and we are shooting orders from one side of the book at the other, the AMM's fair-price won't change as we go along and each incoming uncrossing order will just keep taking the same volume from the same region of the same AMM.

Code exists that handles this where the AMM engine keeps track of an AMM's not-quite-confirmed position, and then clears it when uncrossing has finished so we can return to reading its position from the position's engine.

The bug here is that we were actually clearing the AMM's "ephemeral position" too soon, and not at the end of uncrossing like we were supposed to.

@wwestgarth wwestgarth requested a review from a team as a code owner August 27, 2024 10:14
@wwestgarth wwestgarth merged commit 91605a9 into develop Aug 27, 2024
16 checks passed
@wwestgarth wwestgarth deleted the 11583-keep-eph-position-during-uncross branch August 27, 2024 11:44
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.

[Bug]: panic: re submit special order would cross
2 participants