Shyft
Start BuildingSupportWebsite
  • Welcome
    • πŸ‘‹Introducing Shyft
    • πŸ—οΈStart Building
  • Solana Infrastructure
    • 🚁Shyft RPCs
  • Yellowstone gRPC Network
    • Decoding gRPC Latency
    • ⚑gRPC Docs
      • Introduction
      • Authentication
      • Subscribe Requests
      • FAQ
      • Getting Started
        • Initializing the Yellowstone Client
        • Making a gRPC connection
        • Adding a Reconnection Mechanism
        • πŸ”₯Replaying Slots with Solana yellowstone gRPCs
        • Modifying your Subscribe Request
        • Closing a gRPC Connection
      • Subscribing to Transactions
        • All Transactions of an address
        • Subscribing to all transactions of a Liquidity Pool
        • Subscribing to all transactions of multiple addresses
        • Subscribing to all transactions of a Token
      • Subscribing to Accounts
        • Account Updates for a Program
        • Account Updates for an Address
        • Account updates using memcmp
      • Streaming Blocks & BlocksMeta
        • Streaming Block Updates
        • Subscribing to BlocksMeta
      • Modifying & Unsubscribing
  • Solana defi data
    • DeFI APIs
      • Get Pool By Address
      • Get Pools By Token Pair
      • Get All Pools for a Token
      • Get Liquidity Details of a Pool
  • Callbacks
    • ☎️What are Callbacks?
      • Transaction Callbacks
      • Account Callbacks
    • πŸ“”Callback APIs
      • Response Structure
      • List Callbacks
      • Register callback
      • Remove callback
      • πŸ”₯Pause a callback
      • πŸ”₯Resume a callback
      • Update Callbacks
      • Add Addresses
      • Remove addresses
  • Solana Super Indexers
    • 🌩️GraphQL APIs
      • Getting Started
      • Building Queries
      • Paginating Response
      • Applying Filters
      • Ordering and Sorting Data
    • πŸ“€Case Studies
      • Tensor
        • Get Active Listings of a Wallet
        • Get Active Bids of a Wallet
        • Get Active Listings of a Collection
        • Get all Bids of a Collection
        • Get all Pools of a Margin Account
        • Get all Pools by Owner
      • Raydium
        • Get Pool By Address
        • Get Pools By Token Address
        • Get Pools Created Between Time
        • Get Pool Burn Percentage
        • Get Liquidity Details of a Pool
        • Get Pool and OpenBook Market Info
        • Get Token Supply Percentage In Pool
      • Orca Whirlpool
        • Get Pool by Address
        • Get Pool by Token Address
        • Get Positions for a Pool
        • Get Positions for a Wallet
        • Get Liquidity Details of a Pool
      • Kamino
        • Get Borrow Details of a Wallet
        • Get Deposit Details of a Wallet
        • Get Reserve Details
      • Cross Marketplace Queries
        • Get active listings across marketplaces for a wallet
        • Get listings for a collection across marketplaces
        • Get floor price of a collection
      • Cross Defi Queries
        • Fetch Liquidity Pools for Token
      • Native Staking
        • Get Stakes for a Wallet
        • Get Stakes For Validator
      • Governance/Realms
        • Get DAO Token Owners
        • Get Proposals For Governing Mint
        • Get All Proposals For DAO
        • Get DAO Treasury Info
        • Get All Active Proposals For Wallet
      • Meteora
        • Get All LB Position Pairs
        • Get Position of a User Wallet
        • Get Pool by Token Addresses
        • Get All Deposits for a User
        • Get All Withdraws for a User
        • Get All Fees Claimed by a User
        • Get All User Positions and Deposits for a Pool
        • Get All User Positions and Withdrawals for a Pool
      • Fluxbeam
        • Get Pool by Address
        • Get Pool by Token Addresses
      • Drift
        • Get User account for Delegate
        • Get User accounts based on authority
        • Get User details based on Referrer
        • Get Borrow/Deposit Amount for an User
        • Get PrepPositions for an User Account
        • Getting OrderId and userOrderId
        • Get OpenOrders for a User Account
      • πŸ”₯Pumpswap
        • πŸ”₯Get Pool by Address
        • πŸ”₯Get Pool by Creator Address
        • πŸ”₯Get Pools by Token Addresses
      • Raydium Launchpad
        • Get Bonding Curve Details by Pool Address
        • Get All Pools for a Creator
        • Get Pools by Token Addresses
        • Get Migration details of a Pool
  • Solana APIs
    • API Reference
    • Transactions
      • Parsed Transaction Structure
      • Transaction APIs
        • History
        • Parse Signature
        • Parse Multiple Signatures
        • Send
        • Send Multiple
    • NFT
      • πŸ”₯Create Gasless
      • Create
      • Read All
      • Burn
      • πŸ”₯Burn Multiple NFTs V2
      • Update
      • πŸ”₯Create NFT from Metadata
      • πŸ”₯Read Wallet Nfts
      • πŸ”₯Read Selected NFTs
      • πŸ”₯Get NFT Owners
      • πŸ”₯Update NFT Metadata Uri
      • πŸ”₯Update V2
      • Search
      • Transfer
      • Transfer Multiple NFTs
      • Mint
      • Read
    • Wallet
      • Get Balance
      • Get Token Balance
      • Get All Tokens Balance
      • Get Portfolio
      • Resolve Address
      • Get All Domains
      • Get Stake Accounts
    • Fungible Tokens
      • Create
      • Mint
      • Burn
      • πŸ”₯Update
      • Get Token Info
      • Transfer
      • Airdrop
Powered by GitBook
On this page
  • Get all pools which are ready to migrate
  • Fetch Status and Migration Destination of a Pool by address

Was this helpful?

  1. Solana Super Indexers
  2. Case Studies
  3. Raydium Launchpad

Get Migration details of a Pool

Fetch migration details of a pool on Raydium Launchpad

Raydium Launchpad pools begin in a fundraising phase using a bonding curve. Once the target amount of quote tokens (like SOL or USDC) is raised, the pool becomes eligible for migration. This migration moves the raised liquidity into a Raydium AMM or CPswap pool, enabling open trading.

Migration is tracked using the following fields:

  • status β€” Indicates the phase of the pool: 0 = Funding, 1 = Ready to Migrate, 2 = Migrated.

  • migrate_type β€” Shows the destination of the liquidity: 0 = Raydium AMM, 1 = CPswap.

  • total_quote_fund_raising β€” The total amount of quote tokens raised before migration.

  • real_base & real_quote β€” The actual token balances in the pool vaults; these drop to near zero after migration.

  • migrate_fee β€” Fee deducted during migration, defined in the global config.

These fields allow you to monitor the entire lifecycle of a poolβ€”from launch to AMM-ready trading.

You can directly copy paste this code on replit and see it in action.

Get all pools which are ready to migrate

As mentioned above, the pools which are ready to migrate have a `status` of 1.

async function getMigrationReadyPools() {
  const SHYFT_API_KEY = "YOUR_SHYFT_API_KEY";
  const operationsDoc = `
    query MyQuery {
      raydium_launchpad_PoolState(where: {status: {_eq: "1"}}) {
        pubkey
        status
        migrate_type
        migrate_fee
        total_quote_fund_raising
        total_base_sell
        quote_protocol_fee
        platform_fee
      }
    }
  `; //status `1` indicates the pool has completed its bonding curve

  const result = await fetch(
    `https://programs.shyft.to/v0/graphql?api_key=${SHYFT_API_KEY}&network=mainnet-beta`, //SHYFT's GQL endpoint
    {
      method: "POST",
      body: JSON.stringify({
        query: operationsDoc,
        variables: {},
        operationName: "MyQuery",
      }),
    }
  );

  const { errors, data } = await result.json();

  console.dir(data, { depth: null });
}
getMigrationReadyPools();
{
  "raydium_launchpad_PoolState": [
    {
      "pubkey": "CA1qvWVsoQuXqJFJFMQdtoEgMifwvGZpeZcNZHrNtm2U",
      "status": 1,
      "migrate_type": 0,
      "migrate_fee": 0,
      "total_quote_fund_raising": 85000000000,
      "total_base_sell": 793100000000000,
      "quote_protocol_fee": 1685495465,
      "platform_fee": 5056485898
    },
    {
      "pubkey": "GCEmSEvmp4nhJeNR2t8SHkNuHr8bXi2sKf5oqzg7whoP",
      "status": 1,
      "migrate_type": 1,
      "migrate_fee": 0,
      "total_quote_fund_raising": 85000000000,
      "total_base_sell": 54723900000000,
      "quote_protocol_fee": 1185672824,
      "platform_fee": 4742690963
    },
    {
      "pubkey": "BZeC16F3o6QQ6q7zdBA4ZZhwWXi6xARC8pefg4Lk9yHj",
      "status": 1,
      "migrate_type": 1,
      "migrate_fee": 0,
      "total_quote_fund_raising": 30000000000,
      "total_base_sell": 550000000000000,
      "quote_protocol_fee": 102441837,
      "platform_fee": 307325468
    }
  ]
}

The response includes several key fields that provide details such as the amount raised, platform fees, and more(as described above). The migrate_type field specifies whether the migration destination is a Raydium AMM or CPswap.

Fetch Status and Migration Destination of a Pool by address

async function getMigrationByPoolAddress(address) {
  const SHYFT_API_KEY = "YOUR_SHYFT_API_KEY";
  /*
  * The status field returns if the pool is funding, ready to migrate, or migrated
  * the migrate_type field indicates the destination, 0 for Raydium AMM, 1 for CpSwap
  */
  const operationsDoc = `
    query MyQuery {
            raydium_launchpad_PoolState(
                where: {pubkey: {_eq: ${JSON.stringify(address)}}}
            ) {
                status
                migrate_type
                total_base_sell
                total_quote_fund_raising
                pubkey
            }
      }
  `; 


  const result = await fetch(
    `https://programs.shyft.to/v0/graphql/accounts?api_key=${SHYFT_API_KEY}&network=mainnet-beta`, //SHYFT's GQL endpoint
    {
      method: "POST",
      body: JSON.stringify({
        query: operationsDoc,
        variables: {},
        operationName: "MyQuery",
      }),
    }
  );

  const { errors, data } = await result.json();

  if (errors) {
    console.error(errors);
    console.log(
      "Failed to fetch data, please provide correct API key or pool address."
    );
    return;
  }

  console.dir(data, { depth: null });
}
getMigrationByPoolAddress("4yhL99wpeeM2ptRT6U81hG8P3bCaCNabuw28gSBTCemU");
//replace with your Pool address
{
  "raydium_launchpad_PoolState": [
    {
      "status": 0, //Indicates status funding
      "migrate_type": 0, //indicated Raydium AMM
      "total_base_sell": 80000000000000,
      "total_quote_fund_raising": 85000000000,
      "pubkey": "4yhL99wpeeM2ptRT6U81hG8P3bCaCNabuw28gSBTCemU"
    }
  ]
}
PreviousGet Pools by Token AddressesNextAPI Reference

Last updated 20 days ago

Was this helpful?

πŸ“€