The Raydium module provides comprehensive integration with Raydium’s platform, featuring professional token launching through their Launchpad and sophisticated swapping capabilities via their AMM infrastructure.
Core Functionalities
JustSendIt Mode Simplified token launch with pre-configured settings for quick deployment with industry standards
LaunchLab Mode Advanced token configuration with custom bonding curves, vesting schedules, and pool parameters
Token Swapping Execute efficient token swaps via Raydium’s advanced AMM with optimal price discovery
Pool Migration Automated migration from bonding curves to AMM or CPMM pools with configurable parameters
Installation & Setup
Backend Service
Ensure your backend server is running for Raydium SDK operations: SERVER_URL = http://localhost:8080/api
Environment Configuration
Configure Raydium-specific settings in .env.local
: SERVER_URL = your_backend_server_url
HELIUS_STAKED_URL = your_rpc_endpoint
CLUSTER = mainnet-beta
Import Module
Import the components and services you need: import {
LaunchlabsScreen ,
LaunchlabsLaunchSection ,
AdvancedOptionsSection ,
raydiumService
} from '@/modules/raydium' ;
Backend Dependency : This module requires a backend service that implements Raydium SDK operations for token creation and swapping.
Module Architecture
src/modules/raydium/
├── components/ # UI components for token launching
├── screens/ # Complete screen implementations
├── services/ # Raydium API integration
├── utils/ # Advanced configuration utilities
└── index.ts # Public API exports
Core Components
Launchlabs Screen Launch Section Advanced Options LaunchlabsScreen
- Complete token launching interfaceimport { LaunchlabsScreen } from '@/modules/raydium' ;
function TokenLaunchPlatform () {
const handleTokenLaunched = ( result ) => {
console . log ( 'Token launched:' , result );
// Handle success (navigation, notifications, etc.)
};
return (
< LaunchlabsScreen
onTokenLaunched = { handleTokenLaunched }
enableAdvancedMode = { true }
showPreviewMode = { true }
/>
);
}
Features:
Two-step launch process (basic info → advanced config)
Mode selection (JustSendIt vs LaunchLab)
Real-time validation and preview
Integrated metadata upload
Launch Modes
JustSendIt Mode LaunchLab Mode Quick Launch - Pre-configured for immediate deploymentconst justSendItConfig = {
mode: 'JustSendIt' ,
supply: 1000000000 , // 1B tokens
ammThreshold: 85 , // 85 SOL
bondingCurvePercentage: 51 , // 51% on bonding curve
vestingPercentage: 0 , // No vesting
quoteToken: 'SOL' ,
poolType: 'AMM' ,
slippage: 0.5
};
const result = await raydiumService . createAndLaunchToken ({
... tokenData ,
config: justSendItConfig
});
Standard Configuration:
1 Billion token supply
85 SOL AMM threshold
51% on bonding curve
No vesting period
SOL as quote token
AMM pool migration
Raydium Services
The raydiumService.ts
provides comprehensive Raydium platform integration:
import { raydiumService } from '@/modules/raydium' ;
// Upload token metadata to IPFS
const metadataUri = await raydiumService . uploadTokenMetadata ({
name: 'My Token' ,
symbol: 'MTK' ,
description: 'A professional token built on Raydium' ,
image: imageFile ,
website: 'https://mytoken.com' ,
twitter: '@mytoken' ,
telegram: 't.me/mytoken'
});
// Launch token with full configuration
const launchResult = await raydiumService . createAndLaunchToken ({
// Basic token data
name: 'My Token' ,
symbol: 'MTK' ,
description: 'A professional token built on Raydium' ,
image: imageFile ,
metadataUri: metadataUri ,
// Advanced configuration
config: {
mode: 'LaunchLab' ,
quoteToken: 'SOL' ,
supply: 1000000000 ,
solToBeRaised: 200 ,
bondingCurvePercentage: 70 ,
vestingPercentage: 15 ,
vestingSchedule: {
duration: 6 ,
cliff: 1 ,
timeUnit: 'months'
},
poolType: 'CPMM' ,
feeSharing: true ,
slippage: 0.5 ,
enableInitialBuy: true ,
initialBuyAmount: 10
}
});
Available Functions:
uploadTokenMetadata()
- Upload metadata to IPFS
createAndLaunchToken()
- Complete token launch process
Status callbacks for real-time updates
Error handling and validation
// Execute token swap via Raydium
const swapResult = await raydiumService . executeSwap ({
inputToken: 'So11111111111111111111111111111111111111112' , // SOL
outputToken: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' , // USDC
amount: 1.0 ,
slippage: 0.5 ,
userPublicKey: wallet . publicKey
});
console . log ( 'Swap completed:' , swapResult );
Swap Features:
Optimal routing through Raydium pools
Slippage protection
Real-time quotes
Transaction status tracking
Quick Start Examples
Simple Token Launch (JustSendIt)
Advanced Token Launch (LaunchLab)
Token Swapping
import { LaunchlabsScreen } from '@/modules/raydium' ;
import { useWallet } from '@/modules/wallet-providers' ;
function QuickTokenLaunch () {
const { wallet } = useWallet ();
const [ launching , setLaunching ] = useState ( false );
const handleQuickLaunch = async ( tokenData ) => {
if ( ! wallet ) return ;
setLaunching ( true );
try {
// Use JustSendIt mode for quick launch
const result = await raydiumService . createAndLaunchToken ({
... tokenData ,
config: {
mode: 'JustSendIt' ,
enableInitialBuy: true ,
initialBuyAmount: 1 // 1 SOL initial buy
}
});
Alert . alert (
'Token Launched!' ,
` ${ tokenData . name } successfully launched on Raydium! \n Mint: ${ result . mint } `
);
} catch ( error ) {
Alert . alert ( 'Launch Failed' , error . message );
} finally {
setLaunching ( false );
}
};
return (
< View style = {styles. container } >
< Text style = {styles. title } > Quick Token Launch </ Text >
< Text style = {styles. subtitle } >
Launch with industry - standard settings
</ Text >
< LaunchlabsScreen
mode = "JustSendIt"
onTokenLaunched = { handleQuickLaunch }
loading = { launching }
/>
</ View >
);
}
Advanced Configuration Utilities
The AdvancedOptionsSectionUtils.tsx
provides comprehensive utilities for token launch configuration:
Show Validation Functions
import {
validateBondingCurvePercentage ,
validateVestingPercentage ,
validateSolRaised ,
calculatePoolMigrationPercentage
} from '@/modules/raydium/utils' ;
// Validate bonding curve percentage (51%-80%)
const isValidBondingCurve = validateBondingCurvePercentage ( 65 );
// Validate vesting percentage (0%-30%)
const isValidVesting = validateVestingPercentage ( 20 );
// Validate SOL to be raised
const isValidSolRaised = validateSolRaised ( 100 );
// Calculate pool migration percentage
const poolMigration = calculatePoolMigrationPercentage ( 65 , 20 );
// Returns: 15% (100% - 65% bonding - 20% vesting)
Show Calculation Functions
import {
calculateGraphData ,
convertVestingPeriodToSeconds ,
formatNumber ,
parseNumericString
} from '@/modules/raydium/utils' ;
// Generate bonding curve graph data
const graphData = calculateGraphData ({
supply: 1000000000 ,
solRaised: 100 ,
bondingCurvePercentage: 65
});
// Convert vesting period to seconds
const vestingSeconds = convertVestingPeriodToSeconds ( 6 , 'months' );
// Format numbers for display
const formatted = formatNumber ( 1000000 ); // Returns: "1,000,000"
// Parse numeric strings
const parsed = parseNumericString ( '1,000.50' ); // Returns: 1000.5
import {
TOKEN_SUPPLY_OPTIONS ,
TIME_UNIT_OPTIONS ,
SAMPLE_TOKENS
} from '@/modules/raydium/utils' ;
// Predefined supply options
console . log ( TOKEN_SUPPLY_OPTIONS );
// [100000000, 500000000, 1000000000, 5000000000, 10000000000]
// Time unit options for vesting
console . log ( TIME_UNIT_OPTIONS );
// ['days', 'weeks', 'months', 'years']
// Sample tokens for testing/demo
console . log ( SAMPLE_TOKENS );
// Array of sample token configurations
Bonding Curve Visualization
The module includes real-time bonding curve visualization:
function BondingCurvePreview ({ config }) {
const [ graphData , setGraphData ] = useState ([]);
useEffect (() => {
const data = calculateGraphData ({
supply: config . supply ,
solRaised: config . solRaised ,
bondingCurvePercentage: config . bondingCurvePercentage
});
setGraphData ( data );
}, [ config ]);
return (
< View style = {styles. graphContainer } >
< Text style = {styles. graphTitle } > Bonding Curve Preview </ Text >
< LineChart
data = { graphData }
width = { 300 }
height = { 200 }
chartConfig = {{
backgroundColor : '#1e1e1e' ,
backgroundGradientFrom : '#2a2a2a' ,
backgroundGradientTo : '#1e1e1e' ,
decimalPlaces : 4 ,
color : ( opacity = 1 ) => `rgba(25, 255, 146, ${ opacity } )` ,
}}
/>
< View style = {styles. graphStats } >
< Text > Starting Price : { graphData [ 0 ] ? . price || 0 } SOL </ Text >
< Text > Migration Price : { graphData [ graphData . length - 1 ] ? . price || 0 } SOL </ Text >
< Text > Tokens on Curve : { config . bondingCurvePercentage }%</ Text >
</ View >
</ View >
);
}
Integration with Other Modules
Professional Launch Workflow
import { useWallet } from '@/modules/wallet-providers' ;
import { useFetchTokens } from '@/modules/data-module' ;
import { useThread } from '@/core/thread' ;
import { raydiumService } from '@/modules/raydium' ;
function ProfessionalTokenPlatform () {
const { wallet } = useWallet ();
const { refetch : refetchTokens } = useFetchTokens ( wallet ?. address );
const { createPost } = useThread ();
const handleProfessionalLaunch = async ( tokenData , config ) => {
try {
// Launch token with advanced configuration
const result = await raydiumService . createAndLaunchToken ({
... tokenData ,
config
});
// Refresh user's portfolio
await refetchTokens ();
// Create professional announcement
await createPost ({
content: `🏗️ Just launched ${ tokenData . name } on @RaydiumProtocol with professional-grade tokenomics! \n\n 📊 Bonding Curve: ${ config . bondingCurvePercentage } % \n ⏰ Vesting: ${ config . vestingPercentage } % over ${ config . vestingSchedule . duration } ${ config . vestingSchedule . timeUnit } \n 💰 Target: ${ config . solRaised } SOL` ,
type: 'professional_launch' ,
sections: [
{
type: 'trade' ,
data: {
tokenAddress: result . mint ,
action: 'buy' ,
platform: 'raydium' ,
launchType: 'professional'
}
}
]
});
return result ;
} catch ( error ) {
console . error ( 'Professional launch failed:' , error );
throw error ;
}
};
return < AdvancedLaunchInterface onLaunch ={ handleProfessionalLaunch } />;
}
Error Handling & Troubleshooting
Backend Connection Issues
Verify SERVER_URL
is correctly configured
Ensure Raydium backend service is running
Check network connectivity and firewall settings
Token Launch Failures
Invalid bonding curve parameters (must be 51%-80%)
Vesting percentage too high (max 30%)
Insufficient SOL for transaction fees
Metadata upload failures
Configuration Errors
Pool migration percentage calculation errors
Invalid vesting schedule parameters
Quote token not supported
AMM vs CPMM pool type mismatch
Swap Failures
Insufficient liquidity for large swaps
Slippage tolerance too low
Token not available on Raydium
Network congestion issues
function RobustRaydiumOperations () {
const [ retryCount , setRetryCount ] = useState ( 0 );
const maxRetries = 3 ;
const safeRaydiumOperation = async ( operation , params ) => {
try {
return await operation ( params );
} catch ( error ) {
console . error ( 'Raydium operation failed:' , error );
if ( retryCount < maxRetries && error . message . includes ( 'network' )) {
setRetryCount ( prev => prev + 1 );
const delay = 1000 * Math . pow ( 2 , retryCount ); // Exponential backoff
await new Promise ( resolve => setTimeout ( resolve , delay ));
return safeRaydiumOperation ( operation , params );
}
// Handle specific Raydium errors
if ( error . message . includes ( 'bonding curve' )) {
throw new Error ( 'Invalid bonding curve configuration. Please adjust parameters.' );
}
if ( error . message . includes ( 'vesting' )) {
throw new Error ( 'Vesting percentage must be between 0% and 30%.' );
}
throw error ;
}
};
return { safeRaydiumOperation };
}
Configuration Validation : Use the provided validation functions to ensure parameters are valid before launching to avoid transaction failures.
Backend Optimization : Complex token launches involve multiple transactions. Ensure your backend can handle the load and has proper error recovery.
API Reference
For detailed API documentation, see:
The Raydium module provides professional-grade token launching capabilities with sophisticated configuration options, making it ideal for serious projects requiring advanced tokenomics and institutional-quality infrastructure.