Interest Protocol
  • 👋Welcome to Interest Protocol
  • Overview
    • Sui💧
      • Contracts
        • Memez
        • Libs 📚
      • Suicoins
        • Swap
        • Dollar-Cost Averaging (DCA)
        • Airdrop
          • Suiplay Airdrop
        • Incinerator
        • Send
        • Merger
        • Suicoins Terminal
      • Memez.gg
        • Coins on Memez.GG
        • Memez.Fun
          • SDK
            • Pump API
            • Interfaces
          • Configuration
          • Migrators
          • Bonding Curve
          • Fees
      • IPX Coin Standard
    • Movement
      • Interest Protocol Decentralized Exchange (DEX)
        • Key Features
        • Core Innovations
      • sr-AMM
      • Token
        • Tokenomics
        • Utility
      • GTM
    • Audits
    • Security
    • Deprecated
      • Coin X Oracle 🔮
        • Pyth Network
        • Switchboard
      • Sui Tears 💧
        • Airdrop
          • Airdrop
          • Airdrop Utils
          • Linear Vesting Airdrop
        • Capabilities
          • Access Control
          • Owner
          • Quest
          • Timelock
        • Collections
          • Bitmap
          • Coin Decimals
        • DeFi
          • Oracle
          • Farm
          • Fund
          • Linear Vesting Wallet
          • Linear Clawback Vesting Wallet
          • Vesting
        • Governance
          • DAO
          • DAO Admin
          • DAO Treasury
        • Utils
          • ASCII
          • Comparator
          • Merkle Proof
          • Vectors
        • Math
          • Fixed Point 64
          • Fixed Point Roll
          • Fixed Point Wad
          • Int
          • Math64
          • Math128
          • Math256
      • CLAMM🐚
        • Hooks
      • Whitepapers
  • Glossary
Powered by GitBook
On this page
  • Constant Product
  • Virtual Liquidity

Was this helpful?

Export as PDF
  1. Overview
  2. Sui💧
  3. Memez.gg
  4. Memez.Fun

Bonding Curve

PreviousMigratorsNextFees

Last updated 4 months ago

Was this helpful?

The pump and auction strategies utilize the popularized by UniswapV2. The stable strategy utilizes a fixed rate to provide a no loss bonding curve.

Constant Product

k=x∗yk = x * yk=x∗y
  • k = constant

  • x = Reserves of Coin X

  • y = Reserves of Coin Y

This formula defines the pricing relationship between Coin X and Coin Y in a pool.

Pricing Function

X’ * Y’ = K

X’ = X + amountIn

Y’ = Y - amountOut

X * Y = (X + amountIn) * (Y - amountOut)

XY / (X + amountIn) = Y - amountOut

XY / (X + amountIn) - Y = -amountOut

XY / (X + amountIn) - Y (X + amountIn) / (X + amountIn) = - amountOut

- Y *amountIn / (X + amountIn) = - amountOut

We conclude that amountOut in Y is defined by

After every mutation, we ensure that the pool always maintains the invariant k = x * y by using the pricing formula above.

Virtual Liquidity

The use of virtual liquidity to create a floor price for the meme coin brings two benefits:

  • Allows the token creator to start a market without supplying any Sui liquidity

  • Prevents early buyers from getting too much supply.

Let us assume a pool of Meme/Sui. All pools on Memez.Fun use the Meme coin as the base coin and Sui as the quote coin. For example, let's imagine the absence of fees and first buy from the coin creator. If we would set up a pool with 1 billion coins of Meme and 0 Sui, we would break the invariant as k = 1e9 * 0.

This means that the pool would always be worth 0. To circumvent this issue, UniV2 forces the user to always supply both coins: the base coin and the quote coin. This is where virtual liquidity comes in, we can virtually set the pool with a floor price without requiring any investment from the token creator.

For example, We can set the virtual liquidity to be 1,000 Sui. If we assume that Sui is 5 dollars for simplicity sake, this means that at pool creation. The pool would be worth 10 thousand USD:

  • 5 Thousand worth of Sui

  • 5 Thousand worth of Meme

Assume we create Meme coin with 1e9 supply. 1 Meme coin would be worth 0.000001 Sui or ~$0.000005 (assuming Sui is $5).

Memez.Fun has a target Sui reserve that once it is achieved, the pool is migrated to a DEX.

Let's assume that we want the pool to migrate once the Meme achieves a market cap of $60,000.

Pool at start:

  • Virtual Liquidity: 1,000 Sui

  • Sui Reserves: 0

  • Meme Reserves: 1e9

  • Target Sui Reserve: 2,464 Sui

  • Meme Coin price: 0.000001 Sui

  • Target Meme Coin price: 0.000012 SUI

  • Pool Value: $0

  • Pool Virtual Value: $10,000

Target Meme Coin price explanation:

$60_000 / 1e9 Meme coin = $0.00006 per Meme

In Sui: $0.00006/$5 = 0.000012 SUI per Meme

0.000012 SUI per Meme Coin * 1e9 Meme Coin = 12,000 Sui ~ ($60,000)

How do we come up with a target Sui Reserve of 2,464 Sui?

  • Target Price = 0.000012 Sui

  • k = x * y = 1e12 (1e9 * 1000)

x * (0.000012x) = 1e12

0.000012x² = 1e12

x = sqrt(1e12/0.000012) ≈ 288,675,135 Meme tokens

Final y = 1e12/288,675,135 ≈ 3,464 Sui

Sui needed = 3,464 - 1,000 = 2,464 Sui

Conclusion: We would need a total of $12,321 (2,464 Sui) to migrate.

If we use the pricing formula above, we can see that it holds true:

(1e9 Meme * 2,464 Sui) / (1,000 Sui + 2,464 Sui) = 711,316,397 Meme

1e9 - 711,316,397 = 288,683,603

The pool would have 288,683,603 Meme and 3,464 Sui after a 2,464 Sui purchase. Using the price formula.

Price = y / x

3,464 Sui / 288,683,603 Meme ~ 0.000012

0.000012 * 1e9 = 12,000 Sui ($60,000)

Pool at the end:

  • Virtual Liquidity: 1,000 Sui

  • Sui Reserves: 2,464

  • Meme Reserves: 288,683,603

  • Target Sui Reserve: 2,464 Sui

  • Meme Coin price: 0.000012 Sui

  • Target Meme Coin price: 0.000012 Sui

  • Pool Value: $12,320

  • Pool Virtual Value: $17,320

Y∗amountIn/X+amountInY * amountIn / X + amountInY∗amountIn/X+amountIn
Price=y/xMemePrice=SuiReserve/MemeReservePrice = y / x\\MemePrice = Sui Reserve / Meme Reserve Price=y/xMemePrice=SuiReserve/MemeReserve
constant product invariant