Solana: Listening to pump.fun migrations to Raydium
For the full pump.fun bot, see Solana: Creating a trading and sniping pump.fun bot.
This article is an add-on for two scripts:
This guide shows you how to track the lifecycle of pump.fun tokens from their initial bonding curve state through migration to Raydium using Python scripts.
Prerequisites
Get you own node endpoint today
Start for free and get your app to production levels immediately. No credit card required.
You can sign up with your GitHub, X, Google, or Microsoft account.
- Clone the pump-fun-bot GitHub repository
- Install the requirements
pip install -r requirements.txt
- Provide the node HTTP and WebSocket endpoints in
config.py
Understanding pump.fun token migration
Tokens on pump.fun start trading against a bonding curve—a mathematical formula that determines the token's price based on supply and demand. However, once certain conditions are met, the token "graduates" and migrates its liquidity to Raydium DEX.
A token migrates to Raydium when:
- The bonding curve reaches completion status (tracked by the
complete
flag in the curve's state) - The token has accumulated sufficient liquidity and trading volume
- The migration transaction is executed by the protocol
After migration, trading moves from the bonding curve mechanism to Raydium's traditional AMM (Automated Market Maker) model. This transition is significant because:
- Trading mechanics change from bonding curve to AMM
- Liquidity becomes more flexible and can be added/removed by users
- The token becomes accessible to the broader Raydium ecosystem
Monitoring tools
This guide covers two essential scripts for tracking this migration process:
check_boding_curve_status.py
- Checks if a token is still on the bonding curve or ready for migrationlisten_to_raydium_migration.py
- Monitors real-time migrations to Raydium
Checking bonding curve status
The check_boding_curve_status.py
script lets you check if a token's bonding curve is still active or has completed and is ready for Raydium migration.
Usage
python check_boding_curve_status.py TOKEN_ADDRESS
Replace TOKEN_ADDRESS
with the Solana address of the token you want to check. The script derives the associated bonding curve address from the token address that you provide and then makes a getAccountInfo | Solana call to the bonding curve.
Example output
For an active bonding curve:
Token Status:
--------------------------------------------------
Token Mint: TokenAddressHere...
Associated Bonding Curve: BondingCurveAddressHere...
Bump Seed: 255
--------------------------------------------------
Bonding Curve Status:
--------------------------------------------------
Completion Status: Not Completed
--------------------------------------------------
For a completed bonding curve:
Token Status:
--------------------------------------------------
Token Mint: TokenAddressHere...
Associated Bonding Curve: BondingCurveAddressHere...
Bump Seed: 255
--------------------------------------------------
Bonding Curve Status:
--------------------------------------------------
Completion Status: Completed
Note: This bonding curve has completed and liquidity has been migrated to Raydium.
--------------------------------------------------
Monitoring Raydium migrations
The listen_to_raydium_migration.py
script uses WebSocket subscriptions to monitor real-time migrations of tokens from pump.fun to Raydium DEX.
The pump.fun migration account is 39azUYFWPz3VHgKCf3VChUwbpURdCHRxjWVowf5jUJjg.
This is the account that—on the token bonding curve completion status—adds the token to a Raydium's AMM pool with the token's liquidity. This essentially constitutes token migration from pump.fun to Raydium.
Our script uses the blockSubscribe | Solana method over WebSocket by listening to all the transactions involving the migration account 39azUYFWPz3VHgKCf3VChUwbpURdCHRxjWVowf5jUJjg
, then decodes the transactions using the Raydium IDL raydium_amm_idl.json
that's also in our pump-fun-bot repository . After decoding the data, it prints what we actually need—the address of the pump.fun token that migrated and the new liquidity pool address for this token on Raydium.
Usage
python listen_to_raydium_migration.py
Example output
When a migration occurs:
Found initialize2 instruction!
Signature: 5KtPn3...
Token Address: TokenAddressHere...
Liquidity Address: LiquidityPoolAddressHere...
==================================================
Use cases
These monitoring tools are particularly useful for:
- Traders who need to adjust their strategies when trading moves to Raydium
- Arbitrage bots that operate differently on bonding curves vs AMMs
- Market makers looking to provide liquidity as soon as tokens migrate
- Sniping successful tokens on Raydium early
- Analytics tools tracking the pump.fun ecosystem
Conclusion
Understanding and monitoring the token migration process from pump.fun to Raydium is crucial for trading strategies. These tools help you stay informed about the state and location of token liquidity, allowing you to adapt your trading approach accordingly.
For the complete trading bot implementation, see Creating a pump.fun trading bot.
Updated about 13 hours ago