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.

  1. Postion Account - The actual account hosting the position's information. The PDA is derived from Whirlpool Program Id and Position Mint.

  2. Position Mint Account - The spl-token mint of the NFT minted to represent this position.

  3. 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:

  1. The caller will provide a brand new token mint and the PDA of the Position account derived from the Whirlpool.

  2. open_position will initialize the mint, mint 1 token to the position_token_account and immediately burn the mint authority of this mint.

  3. 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