Positions
Overview
A Position is an account that stores information about a user’s deposited tokens, defining their active trading range within a FusionPool.
Deconstructing the Position
There are 3 main accounts used to represent a Position on Fusion AMM.
Postion Account - The actual account hosting the position's information. The PDA is derived from Whirlpool Program Id and Position Mint.
Position Mint Account - The spl-token mint of the NFT minted to represent this position.
Position Associated Token Account - The ATA of the mint-token that will house the minted token in the user's wallet.
The program will verify that a user owns a position by checking whether the wallet provided has the correct position token in it.
Creating a Position
Positions are created using the open_position_with_token_extensions instruction and it does the following:
The caller will provide a brand new token mint and the PDA of the Position account derived from the Whirlpool.
open_position
will initialize the mint, mint 1 token to theposition_token_account
and immediately burn the mint authority of this mint.The position account is initialized with the set tick range and is ready to receive new liquidity via the increase_liquidity instruction.
Position's Traits
The tick range is set to a fixed state and cannot be adjusted while the position holds any liquidity. To re-balance, users need to remove any liquidity in it and invoke set_position_range with the desired tick range.
NFT Metadata
FusionAMM utilizes the Token2022 program for position NFTs, leveraging the MetadataPointer and TokenMetadata extensions to make all rent refundable. Advanced users can also choose to exclude metadata entirely.
Last updated