INonfungiblePositionManager
Title: INonfungiblePositionManager
Author: Vendored minimal subset of Uniswap V3 Periphery
(https://github.com/Uniswap/v3-periphery/blob/main/contracts/interfaces/INonfungiblePositionManager.sol). Upstream license: GPL-2.0-or-later.
Minimal vendored subset of the Uniswap V3 NonfungiblePositionManager (NFPM): the ERC-721 that custodies concentrated-liquidity positions. The Lattice UniswapV3Adapter mints ONE full-range position NFT and manages it through this surface.
Vendored subset — do not add a uniswap-v3-periphery dependency. Only the selectors the adapter calls are declared. All mutating params are passed as structs to mirror the real ABI exactly (so the same calldata layout works against the canonical deployment).
Functions
mint
Creates a new position wrapped in an NFT.
The caller must have approved both tokens to this contract. Reverts if a corresponding pool does not exist or is uninitialized.
function mint(MintParams calldata params)
external
payable
returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);Parameters
| Name | Type | Description |
|---|---|---|
| params | MintParams | The mint params (token pair, fee, tick range, amounts, slippage floors, recipient). |
Returns
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The id of the minted position NFT. |
| liquidity | uint128 | The liquidity units added to the position. |
| amount0 | uint256 | The amount of token0 actually consumed. |
| amount1 | uint256 | The amount of token1 actually consumed. |
increaseLiquidity
Increases the liquidity in an existing position.
function increaseLiquidity(IncreaseLiquidityParams calldata params)
external
payable
returns (uint128 liquidity, uint256 amount0, uint256 amount1);Parameters
| Name | Type | Description |
|---|---|---|
| params | IncreaseLiquidityParams | The increase params (tokenId, amounts, slippage floors). |
Returns
| Name | Type | Description |
|---|---|---|
| liquidity | uint128 | The new liquidity units added. |
| amount0 | uint256 | The amount of token0 actually consumed. |
| amount1 | uint256 | The amount of token1 actually consumed. |
decreaseLiquidity
Decreases the liquidity in a position. The freed amounts become owed-tokens collectable
via collect (they are NOT transferred by this call).
function decreaseLiquidity(DecreaseLiquidityParams calldata params)
external
payable
returns (uint256 amount0, uint256 amount1);Parameters
| Name | Type | Description |
|---|---|---|
| params | DecreaseLiquidityParams | The decrease params (tokenId, liquidity to remove, slippage floors). |
Returns
| Name | Type | Description |
|---|---|---|
| amount0 | uint256 | The amount of token0 owed after the burn. |
| amount1 | uint256 | The amount of token1 owed after the burn. |
collect
Collects up to a maximum amount of owed tokens (freed liquidity + accrued fees) for a
position to recipient.
function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1);Parameters
| Name | Type | Description |
|---|---|---|
| params | CollectParams | The collect params (tokenId, recipient, max amounts). |
Returns
| Name | Type | Description |
|---|---|---|
| amount0 | uint256 | The amount of token0 collected. |
| amount1 | uint256 | The amount of token1 collected. |
positions
Returns the full state of a position by token id.
function positions(uint256 tokenId)
external
view
returns (
uint96 nonce,
address operator,
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The id of the position to query. |
Returns
| Name | Type | Description |
|---|---|---|
| nonce | uint96 | The permit nonce (unused by the adapter). |
| operator | address | The approved operator (unused by the adapter). |
| token0 | address | The position's token0. |
| token1 | address | The position's token1. |
| fee | uint24 | The position's fee tier. |
| tickLower | int24 | The position's lower tick. |
| tickUpper | int24 | The position's upper tick. |
| liquidity | uint128 | The position's current liquidity (the quantity the adapter values via TWAP). |
| feeGrowthInside0LastX128 | uint256 | Fee-growth checkpoint for token0 (unused by the adapter). |
| feeGrowthInside1LastX128 | uint256 | Fee-growth checkpoint for token1 (unused by the adapter). |
| tokensOwed0 | uint128 | Uncollected token0 owed to the position. |
| tokensOwed1 | uint128 | Uncollected token1 owed to the position. |
Structs
MintParams
Params for mint.
struct MintParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
uint256 deadline;
}Properties
| Name | Type | Description |
|---|---|---|
| token0 | address | The address of token0 (sorted; must equal the pool's token0). |
| token1 | address | The address of token1 (sorted; must equal the pool's token1). |
| fee | uint24 | The pool fee tier (hundredths of a bip). |
| tickLower | int24 | The lower tick of the position (full-range: min usable tick). |
| tickUpper | int24 | The upper tick of the position (full-range: max usable tick). |
| amount0Desired | uint256 | The desired amount of token0 to add. |
| amount1Desired | uint256 | The desired amount of token1 to add. |
| amount0Min | uint256 | The minimum amount of token0 to add (slippage floor). |
| amount1Min | uint256 | The minimum amount of token1 to add (slippage floor). |
| recipient | address | The address that receives the minted position NFT. |
| deadline | uint256 | The unix timestamp after which the mint reverts. |
IncreaseLiquidityParams
Params for increaseLiquidity.
struct IncreaseLiquidityParams {
uint256 tokenId;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}Properties
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The id of the position to add to. |
| amount0Desired | uint256 | The desired amount of token0 to add. |
| amount1Desired | uint256 | The desired amount of token1 to add. |
| amount0Min | uint256 | The minimum amount of token0 to add (slippage floor). |
| amount1Min | uint256 | The minimum amount of token1 to add (slippage floor). |
| deadline | uint256 | The unix timestamp after which the call reverts. |
DecreaseLiquidityParams
Params for decreaseLiquidity.
struct DecreaseLiquidityParams {
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}Properties
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The id of the position to remove from. |
| liquidity | uint128 | The amount of liquidity to remove. |
| amount0Min | uint256 | The minimum amount of token0 owed after the burn (slippage floor). |
| amount1Min | uint256 | The minimum amount of token1 owed after the burn (slippage floor). |
| deadline | uint256 | The unix timestamp after which the call reverts. |
CollectParams
Params for collect.
struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}Properties
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | The id of the position to collect from. |
| recipient | address | The address that receives the collected tokens. |
| amount0Max | uint128 | The maximum amount of token0 to collect. |
| amount1Max | uint128 | The maximum amount of token1 to collect. |