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

Last updated