Something.cool
  • Getting started
    • Why Something.cool?
    • 1st stage - Bonding curve
    • 2nd stage - CoolDEX trading
  • Zero-fee coins
    • What is Zero-fee coin?
    • How to launch Zero-fee coin
  • Community coins
    • What is Community coin?
    • Community contribution / How it works?
      • Holders
      • Liquidity providers
      • Burning
    • How to launch Сommunity coin
  • Features
    • Coin Explore
      • New Pairs
      • Coin Vision
    • Spaces
    • Rewards
  • Community
    • Referral program
    • X
    • Media kit
  • Developer Resources
  • Platform Architecture
    • Technical Introduction
    • Overview
    • Components
  • SC Bonding Curve
    • Overview
    • Functions
      • Create Token
      • Buy Token
      • Sell Token
      • Migrate
      • Admin Set Properties
    • Price Calculation
    • Fees
  • CoolDEX
    • Overview
    • Functions
      • Initialize Pool
      • Swap Base In
      • Swap Base Out
      • Deposit
      • Withdraw
      • Withdraw PnL
    • Price Calculation
    • Fees
  • Token Types
    • Token Types
  • Migration Process
    • Migration Process
  • Rewards Claiming
    • Overview
    • Authentication
    • Endpoints
    • Errors
    • Example
  • Reference
    • SC Bonding Curve IDL
    • CoolDEX IDL
    • Log Structure
    • DEVNET EXAMPLES
  • INTERNAL API
    • Overview
    • Register
  • Example: Registering a User via Internal API (JavaScript)
Powered by GitBook
On this page
  • Instruction INDEX
  • Instruction
  • Parameters
  • Required Accounts
  • Function Logic
  • Notes
  1. SC Bonding Curve
  2. Functions

Migrate

Collects all funds from curve to init a pool on CoolDEX after.

Instruction INDEX

4

Instruction

BondingCurveInstruction::Migrate {
    pda_token_nonce: u8,
}

Parameters

Parameter
Type
Description

pda_token_nonce

u8

Nonce for the token owner PDA

Required Accounts

  1. Token mint

  2. Token program

  3. Token owner PDA

  4. Fee account (signer)

  5. Token owner token account

  6. Fee token account

Function Logic

  1. Verifies the fee account is the authorized admin

  2. Verifies the PDA token owner matches the expected PDA for the token mint

  3. Verifies that the token sale is finalized (status = 2)

  4. Marks the token as migrated (status = 3)

  5. Determines the amount of tokens in the bonding curve vault

  6. Transfers all remaining tokens to the fee account

  7. Closes the token account

  8. Transfers the remaining SOL in the bonding curve (minus a small amount for rent) to the fee account

Notes

  • Migration can only be performed by the admin fee account

  • The token must be in the finalized state (status = 2)

  • All remaining tokens and SOL are extracted from the bonding curve

  • After migration, the token can be listed on the CoolDEX with a liquidity pool

  • The extracted tokens and SOL will be used to create the initial liquidity pool

PreviousSell TokenNextAdmin Set Properties

Last updated 2 months ago