Skip to content

Commit

Permalink
refactor: breaking CL tick to sqrt price math min spot price relaxation
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn committed Sep 5, 2023
1 parent c2af17f commit ed299b2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
12 changes: 0 additions & 12 deletions x/concentrated-liquidity/math/tick.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,6 @@ func CalculateSqrtPriceToTick(sqrtPrice osmomath.BigDec) (tickIndex int64, err e
return 0, err
}

// TODO: remove this check. It is present to maintain backwards state-compatibility with
// v19.x and earlier major releases of Osmosis.
// Once https://github.com/osmosis-labs/osmosis/issues/5726 is fully complete,
// this should be removed.
//
// Backwards state-compatibility is maintained by having the swap and LP logic error
// here in case the price/tick falls below the origina minimum tick bounds that are
// consistent with v19.x and earlier release lines.
if tick < types.MinCurrentTick {
return 0, types.TickIndexMinimumError{MinTick: types.MinCurrentTick}
}

// We have a candidate bucket index `t`. We discern here if:
// * sqrtPrice in [TickToSqrtPrice(t - 1), TickToSqrtPrice(t))
// * sqrtPrice in [TickToSqrtPrice(t), TickToSqrtPrice(t + 1))
Expand Down
7 changes: 0 additions & 7 deletions x/concentrated-liquidity/math/tick_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,13 +833,6 @@ func TestCalculatePriceToTick(t *testing.T) {

// This test validates that conversions at the new initialized boundary are sound.
func TestSqrtPriceToTick_MinInitializedTickV2(t *testing.T) {

// TODO: remove this Skip(). It is present to maintain backwards state-compatibility with
// v19.x and earlier major releases of Osmosis.
// Once https://github.com/osmosis-labs/osmosis/issues/5726 is fully complete,
// this should be removed.
t.Skip()

minSqrtPrice, err := osmomath.MonotonicSqrtBigDec(types.MinSpotPriceV2)
require.NoError(t, err)

Expand Down

0 comments on commit ed299b2

Please sign in to comment.