diff --git a/x/concentrated-liquidity/math/tick.go b/x/concentrated-liquidity/math/tick.go index 39e7a8b9b7b..ac30b3645d6 100644 --- a/x/concentrated-liquidity/math/tick.go +++ b/x/concentrated-liquidity/math/tick.go @@ -4,6 +4,8 @@ import ( "errors" "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/osmosis-labs/osmosis/osmomath" "github.com/osmosis-labs/osmosis/v19/x/concentrated-liquidity/types" ) @@ -166,10 +168,9 @@ func CalculatePriceToTick(price osmomath.BigDec) (tickIndex int64, err error) { // N.B. this exists to maintain backwards compatibility with // the old version of the function that operated on decimal with precision of 18. if price.GTE(types.MinSpotPriceBigDec) { - // TODO: implement efficient big decimal truncation. // It is acceptable to truncate price as the minimum we support is // 10**-12 which is above the smallest value of sdk.Dec. - price = osmomath.BigDecFromDec(price.Dec()) + price.ChopPrecisionMut(sdk.Precision) } // The approach here is to try determine which "geometric spacing" are we in.