Bin
Functions
lpBalancesFromDeltaReserve
Calculate pro rata liquidity balances based on delta reserves.
Parameters
self
Bin.Instance
The Bin.Instance storage.
tickState
IMaverickV2Pool.TickState
The TickState storage.
deltaA
uint256
The change in A (token A) reserves.
deltaB
uint256
The change in B (token B) reserves.
Returns
proRataLiquidity
uint256
The pro rata liquidity balance.
addLiquidityByReserves
Add liquidity to the bin based on delta reserves.
Parameters
self
Bin.Instance
The Bin.Instance storage.
tickState
IMaverickV2Pool.TickState
The TickState storage.
deltaA
uint128
The change in A (token A) reserves.
deltaB
uint128
The change in B (token B) reserves.
deltaLpBalance
uint128
addLiquidity
Add liquidity to the bin. note: lp balance is not the same a "liquidity"; as fees accumulate in a bin, a unit of lp balance will diverge from a unit of liquidity.
Parameters
self
Bin.Instance
The Bin.Instance storage.
tickState
IMaverickV2Pool.TickState
The TickState storage.
recipient
address
The recipient address.
subaccount
uint256
The subaccount.
deltaLpBalance
uint128
The change in LP balance.
addLiquidityInfo
PoolLib.AddLiquidityInfo
The AddLiquidityInfo structure.
Migrate bins up the stack.
Parameters
self
Instance
The Instance storage.
bins
mapping(uint32 => Instance)
The bins mapping.
maxRecursion
uint32
The maximum recursion depth.
removeLiquidity
Remove liquidity from the bin.
Parameters
self
Instance
The Instance storage.
tickStates
mapping(int32 => IMaverickV2Pool.TickState)
The TickState mapping.
bins
mapping(uint32 => Instance)
The bins mapping.
user
address
The user address.
subaccount
uint256
The subaccount.
deltaLpAmount
uint256
The change in LP balance.
Returns
binDelta
IMaverickV2Pool.BinDelta
The BinDelta structure.
_updateBinState
Updates the state of a bin and tick in the MaverickV2Pool.
Parameters
self
Bin.Instance
The bin instance to be updated.
tickState
IMaverickV2Pool.TickState
The tick state of the pool.
user
address
The address of the user performing the action.
subaccount
uint256
The subaccount identifier for the user.
deltaA
uint128
The change in reserveA.
deltaB
uint128
The change in reserveB.
deltaLpBalance
uint128
The change in LP token balance.
deltaTickBalance
uint128
The change in tick balance.
Structs
Instance
Last updated