Skip to content
Lattice

INonfungiblePositionManager

Git Source

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

NameTypeDescription
paramsMintParamsThe mint params (token pair, fee, tick range, amounts, slippage floors, recipient).

Returns

NameTypeDescription
tokenIduint256The id of the minted position NFT.
liquidityuint128The liquidity units added to the position.
amount0uint256The amount of token0 actually consumed.
amount1uint256The 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

NameTypeDescription
paramsIncreaseLiquidityParamsThe increase params (tokenId, amounts, slippage floors).

Returns

NameTypeDescription
liquidityuint128The new liquidity units added.
amount0uint256The amount of token0 actually consumed.
amount1uint256The 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

NameTypeDescription
paramsDecreaseLiquidityParamsThe decrease params (tokenId, liquidity to remove, slippage floors).

Returns

NameTypeDescription
amount0uint256The amount of token0 owed after the burn.
amount1uint256The 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

NameTypeDescription
paramsCollectParamsThe collect params (tokenId, recipient, max amounts).

Returns

NameTypeDescription
amount0uint256The amount of token0 collected.
amount1uint256The 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

NameTypeDescription
tokenIduint256The id of the position to query.

Returns

NameTypeDescription
nonceuint96The permit nonce (unused by the adapter).
operatoraddressThe approved operator (unused by the adapter).
token0addressThe position's token0.
token1addressThe position's token1.
feeuint24The position's fee tier.
tickLowerint24The position's lower tick.
tickUpperint24The position's upper tick.
liquidityuint128The position's current liquidity (the quantity the adapter values via TWAP).
feeGrowthInside0LastX128uint256Fee-growth checkpoint for token0 (unused by the adapter).
feeGrowthInside1LastX128uint256Fee-growth checkpoint for token1 (unused by the adapter).
tokensOwed0uint128Uncollected token0 owed to the position.
tokensOwed1uint128Uncollected 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

NameTypeDescription
token0addressThe address of token0 (sorted; must equal the pool's token0).
token1addressThe address of token1 (sorted; must equal the pool's token1).
feeuint24The pool fee tier (hundredths of a bip).
tickLowerint24The lower tick of the position (full-range: min usable tick).
tickUpperint24The upper tick of the position (full-range: max usable tick).
amount0Desireduint256The desired amount of token0 to add.
amount1Desireduint256The desired amount of token1 to add.
amount0Minuint256The minimum amount of token0 to add (slippage floor).
amount1Minuint256The minimum amount of token1 to add (slippage floor).
recipientaddressThe address that receives the minted position NFT.
deadlineuint256The 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

NameTypeDescription
tokenIduint256The id of the position to add to.
amount0Desireduint256The desired amount of token0 to add.
amount1Desireduint256The desired amount of token1 to add.
amount0Minuint256The minimum amount of token0 to add (slippage floor).
amount1Minuint256The minimum amount of token1 to add (slippage floor).
deadlineuint256The unix timestamp after which the call reverts.

DecreaseLiquidityParams

Params for decreaseLiquidity.

struct DecreaseLiquidityParams {
        uint256 tokenId;
        uint128 liquidity;
        uint256 amount0Min;
        uint256 amount1Min;
        uint256 deadline;
    }

Properties

NameTypeDescription
tokenIduint256The id of the position to remove from.
liquidityuint128The amount of liquidity to remove.
amount0Minuint256The minimum amount of token0 owed after the burn (slippage floor).
amount1Minuint256The minimum amount of token1 owed after the burn (slippage floor).
deadlineuint256The unix timestamp after which the call reverts.

CollectParams

Params for collect.

struct CollectParams {
        uint256 tokenId;
        address recipient;
        uint128 amount0Max;
        uint128 amount1Max;
    }

Properties

NameTypeDescription
tokenIduint256The id of the position to collect from.
recipientaddressThe address that receives the collected tokens.
amount0Maxuint128The maximum amount of token0 to collect.
amount1Maxuint128The maximum amount of token1 to collect.