TradingPool

TradingPool is at the heart of the TRADE module. It defines a liquidity pool where NFTs and a designated token (e.g., SUI or another fungible token) interact.

Key Fields:

  • id: A unique identifier for the pool.

  • collection_id: Identifies which ART20 collection the NFTs belong to.

  • nft_reserve: The count of NFTs held in the pool.

  • token_reserve: A balance of the fungible tokens paired with the NFTs.

  • lp_supply: A supply object representing the total amount of LP tokens minted.

  • lp_shares: Balance of LP tokens representing liquidity provider shares.

  • fee_percent: The fee charged on trades, distributed among LPs and possibly the pool creator.

  • min_price / max_price: Bounds to ensure pricing remains within a certain range.

  • is_active: Indicates if the pool is currently operational.

  • accumulated_fees / contract_owner_accumulated_fees: Track accumulated and undistributed fees.

  • nft_holdings: A table storing the NFTs pooled within the TradingPool.

  • last_trade_price: The most recent trade’s price, aiding in historical data and price impact calculations.

Role:

  • Facilitates instant buy/sell actions.

  • Maintains a price curve based on reserve ratios.

  • Emitted events track every trade and liquidity change.

Last updated