Bin
Functions
lpBalancesFromDeltaReserve
Calculate pro rata liquidity balances based on delta reserves.
Parameters
Name | Type | Description |
---|---|---|
|
| The Bin.Instance storage. |
|
| The TickState storage. |
|
| The change in A (token A) reserves. |
|
| The change in B (token B) reserves. |
Returns
Name | Type | Description |
---|---|---|
|
| The pro rata liquidity balance. |
addLiquidityByReserves
Add liquidity to the bin based on delta reserves.
Parameters
Name | Type | Description |
---|---|---|
|
| The Bin.Instance storage. |
|
| The TickState storage. |
|
| The change in A (token A) reserves. |
|
| The change in B (token B) reserves. |
|
|
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
Name | Type | Description |
---|---|---|
|
| The Bin.Instance storage. |
|
| The TickState storage. |
|
| The recipient address. |
|
| The subaccount. |
|
| The change in LP balance. |
|
| The AddLiquidityInfo structure. |
Migrate bins up the stack.
Parameters
Name | Type | Description |
---|---|---|
|
| The Instance storage. |
|
| The bins mapping. |
|
| The maximum recursion depth. |
removeLiquidity
Remove liquidity from the bin.
Parameters
Name | Type | Description |
---|---|---|
|
| The Instance storage. |
|
| The TickState mapping. |
|
| The bins mapping. |
|
| The user address. |
|
| The subaccount. |
|
| The change in LP balance. |
Returns
Name | Type | Description |
---|---|---|
|
| The BinDelta structure. |
_updateBinState
Updates the state of a bin and tick in the MaverickV2Pool.
Parameters
Name | Type | Description |
---|---|---|
|
| The bin instance to be updated. |
|
| The tick state of the pool. |
|
| The address of the user performing the action. |
|
| The subaccount identifier for the user. |
|
| The change in reserveA. |
|
| The change in reserveB. |
|
| The change in LP token balance. |
|
| The change in tick balance. |
Structs
Instance
Last updated