Maverick Docs
  • Introducing Maverick
  • Getting Started
    • 🖥️The Maverick V2 UI
    • 👛Connect a Wallet
    • ⛓️Choose a Network
    • 🪙Approving Tokens
  • Guides
    • 🤝Traders
      • How to Make a Swap
    • 💰Liquidity Providers
      • Understanding Liquidity Provision
      • Understanding Modes
      • How to Add Liquidity
      • How to Deploy a New Pool
      • How to Check Position Balances
      • How to Manage Liquidity in a Pool
      • How to Migrate from V1 to V2
      • Understanding Permanent Loss
      • Liquidity Strategies
    • ⚡Incentives
      • Understanding Boosted Positions
      • Understanding Incentives
      • How to Join a Boosted Position
      • How to Create a Boosted Position
      • How to Manage a Boosted Position
      • How to Add Incentives
    • 🎡veFlywheel
      • veFlywheel Basics
      • Guide to veFlywheel Emissions
      • How to Vote to Direct Emissions
    • 👩‍🏫Advanced Tutorials
      • Single-Sided Incentives
  • Technical Reference
    • Contract Addresses
      • V1 Contract Addresses
      • V2 Contract Addresses
    • Maverick V1
      • V1 Whitepaper
      • V1 Contracts
        • Router
        • Pool
        • Factory
        • SlimRouter
    • Maverick V2
      • V2 Whitepaper
      • V2 Contracts
        • Maverick V2 Common Contracts
          • base
            • IMulticall
            • IPayableMulticall
            • Multicall
            • PayableMulticall
          • interfaces
            • IMaverickV2AddLiquidityCallback
            • IMaverickV2Factory
            • IMaverickV2FactoryAdmin
            • IMaverickV2FlashLoanCallback
            • IMaverickV2Pool
            • IMaverickV2PoolAdmin
            • IMaverickV2SwapCallback
          • libraries
            • ArrayOperations
            • Constants
            • Math
            • PoolLib
            • TickMath
            • TransferLib
        • Maverick V2 AMM Contracts
          • poollib
            • Bin
            • Delta
            • Deployer
            • DeployerPermissioned
            • SwapMath
            • Twa
          • MaverickV2Factory
          • MaverickV2Pool
          • MaverickV2PoolPermissioned
        • Maverick V2 Reward Contracts
          • interfaces
            • IMaverickV2IncentiveMatcher
            • IMaverickV2IncentiveMatcherFactory
            • IMaverickV2Reward
            • IMaverickV2RewardFactory
            • IMaverickV2RewardRouter
            • IMaverickV2RewardVault
            • IMaverickV2VotingEscrowBase
            • IMaverickV2VotingEscrow
            • IMaverickV2VotingEscrowFactory
            • IMaverickV2VotingEscrowLens
            • IMaverickV2VotingEscrowWSync
          • libraries
            • IncentiveMatcherDeployer
            • RewardDeployer
            • VotingEscrowDeployer
            • VotingEscrowWSyncDeployer
          • rewardbase
            • IRewardAccounting
            • RewardAccounting
          • votingescrowbase
            • HistoricalBalance
            • IHistoricalBalance
            • ILegacyVeMav
            • VotingEscrow
          • MaverickV2IncentiveMatcher
          • MaverickV2IncentiveMatcherFactory
          • MaverickV2Reward
          • MaverickV2RewardFactory
          • MaverickV2RewardRouter
          • MaverickV2RewardVault
          • MaverickV2VotingEscrow
          • MaverickV2VotingEscrowFactory
          • MaverickV2VotingEscrowLens
          • MaverickV2VotingEscrowWSync
        • Maverick V2 Supplemental Contracts
          • base
            • Checks
            • IChecks
            • IMigrateBins
            • MigrateBins
          • boostedpositionbase
            • BoostedPositionBase
            • IBoostedPositionBase
            • ImmutableArrayGetter
          • interfaces
            • IMaverickV2BoostedPosition
            • IMaverickV2BoostedPositionFactory
            • IMaverickV2LiquidityManager
            • IMaverickV2PoolLens
            • IMaverickV2Position
            • IMaverickV2Quoter
            • IMaverickV2Router
            • IPositionImage
          • libraries
            • BoostedPositionDeployerDynamic
            • BoostedPositionDeployerStatic
            • BytesLib
            • LiquidityUtilities
            • PackLib
            • Path
            • PoolInspection
          • liquiditybase
            • ArgPacker
            • IArgPacker
          • paymentbase
            • IERC20PermitAllowed
            • IPayment
            • ISelfPermit
            • IState
            • IWETH9
            • Payment
            • SelfPermit
            • State
          • positionbase
            • INft
            • Nft
          • routerbase
            • CallbackOperations
            • ExactOutputSlim
            • ICallbackOperations
            • IExactOutputSlim
            • IPushOperations
            • IRouterErrors
            • PushOperations
          • MaverickV2BoostedPositionDynamic
          • MaverickV2BoostedPositionFactory
          • MaverickV2BoostedPositionStatic
          • MaverickV2LiquidityManager
          • MaverickV2PoolLens
          • MaverickV2Position
          • MaverickV2Quoter
          • MaverickV2Router
          • PositionImage
      • V2 API Documentation
      • V2 Testnet Guide
        • Get Sepolia ETH & Test Tokens
        • How to Create a Boosted Position in V2
        • How to Add & Match Incentives
        • How to Create a veFlywheel
    • Development FAQ
    • Finding LP Balances
  • MAV token
    • MAV Token & Tokenomics
    • veMAV & MAV Staking
    • How to Stake MAV
    • Syncing V1 veMAV
    • Airdrop Information
      • Maverick Ecosystem Rewards Pre-Season Airdrop
      • Maverick Governance & S1 Airdrops
  • Further Information
    • Frequently Asked Questions
    • Glossary
    • Security
    • Maverick Wallets
    • Dune Analytics
    • Rebasing Tokens
    • Restricted Territories
    • Delphi Digital Report
Powered by GitBook
On this page
  • Functions
  • Events
  • Errors
  • Structs
  1. Technical Reference
  2. Maverick V2
  3. V2 Contracts
  4. Maverick V2 Supplemental Contracts
  5. interfaces

IMaverickV2Position

PreviousIMaverickV2PoolLensNextIMaverickV2Quoter

Last updated 1 year ago

Inherits: , , ,

Functions

mint

Mint NFT that holds liquidity in a Maverick V2 Pool. To mint liquidity to an NFT, add liquidity to bins in a pool where the add liquidity recipient is this contract and the subaccount is the tokenId. LiquidityManager can be used to simplify minting Position NFTs.

function mint(address recipient, IMaverickV2Pool pool, uint32[] memory binIds) external returns (uint256 tokenId);

unSafeBurn

Burns the specified token without removing liquidity. Once tokenId is burned, it will no longer be possible to remove liquidity.

function unSafeBurn(uint256 tokenId) external;

setTokenIdData

Overwrites tokenId pool/binId information for a given data index.

function setTokenIdData(uint256 tokenId, uint256 index, IMaverickV2Pool pool, uint32[] memory binIds) external;

setTokenIdData

Overwrites entire pool/binId data set for a given tokenId.

function setTokenIdData(uint256 tokenId, PositionPoolBinIds[] memory data) external;

appendTokenIdData

Append new pool/binIds data array to tokenId.

function appendTokenIdData(uint256 tokenId, IMaverickV2Pool pool, uint32[] memory binIds) external;

getTokenIdData

Get array pool/binIds data for a given tokenId.

function getTokenIdData(uint256 tokenId) external view returns (PositionPoolBinIds[] memory);

getTokenIdData

Get value from array of pool/binIds data for a given tokenId.

function getTokenIdData(uint256 tokenId, uint256 index) external view returns (PositionPoolBinIds memory);

tokenIdDataLength

Length of array of pool/binIds data for a given tokenId.

function tokenIdDataLength(uint256 tokenId) external view returns (uint256 length);

removeLiquidity

Remove liquidity from tokenId for a given pool. User can specify arbitrary bins to remove from for their subaccount in the pool even if those bins are not in the tokenIdData set.

function removeLiquidity(
    uint256 tokenId,
    address recipient,
    IMaverickV2Pool pool,
    IMaverickV2Pool.RemoveLiquidityParams memory params
) external returns (uint256 tokenAAmount, uint256 tokenBAmount);

removeLiquidityToSender

Remove liquidity from tokenId for a given pool to sender. User can specify arbitrary bins to remove from for their subaccount in the pool even if those bins are not in the tokenIdData set.

function removeLiquidityToSender(
    uint256 tokenId,
    IMaverickV2Pool pool,
    IMaverickV2Pool.RemoveLiquidityParams memory params
) external returns (uint256 tokenAAmount, uint256 tokenBAmount);

tokenIdPositionInformation

NFT asset information for a given range of pool/binIds indexes. This function only returns the liquidity in the pools/binIds stored as part of the tokenIdData, but it is possible that the NFT has additional liquidity in pools/binIds that have not been recorded.

function tokenIdPositionInformation(uint256 tokenId, uint256 startIndex, uint256 stopIndex)
    external
    view
    returns (PositionFullInformation[] memory output);

tokenIdPositionInformation

NFT asset information for a given pool/binIds index. This function only returns the liquidity in the pools/binIds stored as part of the tokenIdData, but it is possible that the NFT has additional liquidity in pools/binIds that have not been recorded.

function tokenIdPositionInformation(uint256 tokenId, uint256 index)
    external
    view
    returns (PositionFullInformation memory output);

getRemoveParams

Get remove paramters for removing a fractional part of the liquidity owned by a given tokenId. The fractional factor to remove is given by proporationD18 in 18-decimal scale.

function getRemoveParams(uint256 tokenId, uint256 index, uint256 proportionD18)
    external
    view
    returns (IMaverickV2Pool.RemoveLiquidityParams memory params);

Events

PositionClearData

event PositionClearData(uint256 indexed tokenId);

PositionSetData

event PositionSetData(uint256 indexed tokenId, uint256 index, PositionPoolBinIds newData);

Errors

PositionDuplicatePool

error PositionDuplicatePool(uint256 index, IMaverickV2Pool pool);

Structs

PositionPoolBinIds

struct PositionPoolBinIds {
    IMaverickV2Pool pool;
    uint32[] binIds;
}

PositionFullInformation

struct PositionFullInformation {
    PositionPoolBinIds poolBinIds;
    uint256 amountA;
    uint256 amountB;
    uint256[] binAAmounts;
    uint256[] binBAmounts;
    int32[] ticks;
    uint256[] liquidities;
}

INft
IMigrateBins
IPayableMulticall
IChecks