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: prevent overflow when calculating tradable volume outside of sid… #11639

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

wwestgarth
Copy link
Contributor

This error came up on a market-sim run:

panic: order too large to register, will overflow

goroutine 33115 [running]:
go.uber.org/zap/zapcore.CheckWriteAction.OnWrite(0x2?, 0x2?, {0x0?, 0x0?, 0xc005959560?})

and is due to my re-write of TradableVolumeInRange() to be entirely position based. I missed the case where we query a range, the pool's current position exists outside of that range on the wrong side. For example, if we want the buy volume of an AMM between position [30, 10] but the AMM's current position is 50 then there is no buy volume, its already been traded.

@wwestgarth wwestgarth self-assigned this Sep 2, 2024
@wwestgarth wwestgarth requested a review from a team as a code owner September 2, 2024 16:07
@jeremyletang jeremyletang merged commit 0a157dc into develop Sep 3, 2024
15 of 16 checks passed
@jeremyletang jeremyletang deleted the fix-retrograde-amm-volume branch September 3, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants