MaverickV2Position
Last updated
Last updated
Inherits: , , , ,
ERC-721 contract that stores user NFTs that contain Maverick V2 pool liquidity.
The Maverick V2 pool has a concept of storing liquidity according to an address and a "subaccount". When liquidity is minted to an NFT, it is stored in the pool to the address of this Position contract to the subaccount that corresponds to the NFT tokenId. The mechanism of liquidity management is that the tokenId owner is the only user who can remove pool liquidity in the subaccount corresponding to their tokenId.
Additionally, this position NFT has data about the pools and binIds that a given tokenId has liquidity in. But these binId/pool values are essentially self reported and can be updated by the token owner by calling setTokenIdData.
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.
Burns the specified token without removing liquidity. Once tokenId is burned, it will no longer be possible to remove liquidity.
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.
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.
Overwrites tokenId pool/binId information for a given data index.
Overwrites tokenId pool/binId information for a given data index.
Append new pool/binIds data array to tokenId.
Get array pool/binIds data for a given tokenId.
Get array pool/binIds data for a given tokenId.
Length of array of pool/binIds data for a given tokenId.
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.
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.
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.
Checks that binIds are unique.
Checks that token data does not contain duplicate pool.