uniqueOrderedTicksCheck
Check to ensure that the ticks are in ascending order and amount array is same length as tick array.
function uniqueOrderedTicksCheck(int32[] memory ticks, uint256 amountsLength) internal pure;
Parameters
An array of int32 values representing ticks to be checked.
Compute bin reserves assuming the bin is not merged; not accurate reflection of reserves for merged bins.
function binReserves(IMaverickV2Pool.BinState storage bin, IMaverickV2Pool.TickState memory tick)
internal
view
returns (uint128 reserveA, uint128 reserveB);
Parameters
The storage reference to the state for this bin.
IMaverickV2Pool.TickState
The memory reference to the state for this tick.
Returns
The reserve amount for token A.
The reserve amount for token B.
Compute bin reserves assuming the bin is not merged; not accurate reflection of reserves for merged bins.
Parameters
Bin's balance in the tick.
Tick total supply of bin balances.
Reserves of a bin in a tick.
Parameters
Tick reserve amount in a given token.
Bin's balance in the tick.
Tick total supply of bin balances.
deltaTickBalanceFromDeltaLpBalance
Calculate delta A, delta B, and delta Tick Balance based on delta LP balance and the Tick/Bin state.
_setRequiredDeltaReservesForEmptyTick
Calculates deltaA = liquidity * (sqrt(upper) - sqrt(lower))
Calculates deltaB = liquidity / sqrt(lower) - liquidity / sqrt(upper),
i.e., liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower))
we set liquidity = deltaLpBalance / (1.0001^(tick * tickspacing) - 1)
which simplifies the A/B amounts to:
deltaA = deltaLpBalance * sqrt(lower)
deltaB = deltaLpBalance / sqrt(upper)
AddLiquidityInfo