osmosis icon indicating copy to clipboard operation
osmosis copied to clipboard

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

Open ValarDragon opened this issue 1 year ago • 1 comments

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 avatar Apr 11 '24 12:04 ValarDragon

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!

ValarDragon avatar Apr 11 '24 14:04 ValarDragon