0xAdventure
  • Overview
  • Product
    • Floorswap
      • USER GUIDE
        • Trading Modes
        • How to Buy NFTs?
        • How to Sell NFTs?
        • How to Set Your Slippage Tolerance?
        • How to Add Liquidity?
        • How to Increase Liquidity?
        • How to Remove Liquidity?
        • How to Manage Liquidity Positions?
        • How to Deposit?
        • How to Withdraw?
        • Fees
      • RISKS
      • TECHNICAL REFERENCE
        • Swap Method
        • Bonding Curve
      • DEVELOPERS
        • APIs
          • FloorSwap API V1.0
            • API Overview
            • Pool List
            • Pool Detail
            • Swap Info
            • Position Info
            • Position List
            • Position History
        • SDKs
          • Foorswap SDK V1.0
            • Pool
            • Position
            • Swap
            • Account
    • Launchpad
    • GAME Swap
    • Cross-chain bridge
    • AI-specialized NFT
    • AI narrative engine
    • AI creative partners
  • Tokenomics
  • Media Kit
Powered by GitBook
On this page
  1. Product
  2. Floorswap
  3. TECHNICAL REFERENCE

Bonding Curve

Concentrated XYK Curve

The Concentrated XYK curve is used to adjust the price of assets in liquidity positions so that the product of two virtual reserves remains constant after each transaction. When the pool is created, the virtual reserves are set as follows:

  • nftBalance: The number of NFTs to be sold in the position + 1

  • tokenBalance: The number of NFTs to be sold in the position * starting price

The net price for selling X NFTs (excluding fees) is:

inputValueWithoutFee = (x * tokenBalance) / (nftBalance - x)

Conversely, the net price for buying X NFTs is:

outputValueWithoutFee = (x * tokenBalance) / (nftBalance + x)

After each transaction, the virtual reserves are updated immediately.

For selling NFTs:

nftBalance = nftBalance - x, tokenBalance = tokenBalance + outputValueWithoutFee

For buying NFTs:

nftBalance = nftBalance + x, tokenBalance = tokenBalance - outputValueWithoutFee

PreviousSwap MethodNextDEVELOPERS

Last updated 12 months ago