Skip to content

Latest commit

 

History

History
48 lines (31 loc) · 1.32 KB

abstract.LiquidityManagement.md

File metadata and controls

48 lines (31 loc) · 1.32 KB

LiquidityManagement

Git Source

Inherits: IUniswapV3MintCallback, ILOPoolImmutableState

Internal functions for safely managing liquidity in Uniswap V3

Functions

uniswapV3MintCallback

Called to msg.sender after minting liquidity to a position from IUniswapV3Pool#mint.

liqiuidity is allways in range so we don't need to check if amount0 or amount1 is 0

function uniswapV3MintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes calldata data) external override;

Parameters

Name Type Description
amount0Owed uint256 The amount of token0 due to the pool for the minted liquidity
amount1Owed uint256 The amount of token1 due to the pool for the minted liquidity
data bytes Any data passed through by the caller via the IUniswapV3PoolActions#mint call

_addLiquidity

Add liquidity to an initialized pool

function _addLiquidity(AddLiquidityParams memory params) internal returns (uint256 amount0, uint256 amount1);

Structs

AddLiquidityParams

struct AddLiquidityParams {
    IUniswapV3Pool pool;
    uint128 liquidity;
}