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

[Feature]: Make liquidity in CL math a normal Dec again, not BigDec #8016

Open
ValarDragon opened this issue Apr 11, 2024 · 1 comment
Open

Comments

@ValarDragon
Copy link
Member

Summary

Liquidity variable in CL math is used as a BigDec right now but every call casts it from Dec to BigDec and does operations on that. We should do these operations on the Dec representation directly to save computational load. This will be state machine compatible as well.

This has been started for a single function in #8014

Problem Definition

No response

Proposed Feature

Convert Liquidity variable in the clMath package to a Dec across the board.

The main work here is updating tests and checking correctness with the python code. The values are identical except on the test cases that use BigDec's extra precision for liquidity (even though thats impossible to achieve in state machine). So you have to regenerate those vectors with the Dec-casted liquidity's value.

@ValarDragon
Copy link
Member Author

ValarDragon commented Apr 11, 2024

In the above PR I've fixed a lot of it, but there is still a lot of legacy usages of bigDec for liquidity in the code / tests we should fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage 🔍
Development

No branches or pull requests

1 participant