Devnet Limitations
Currently supporting SOL ↔ USDC pair on Devnet. Devnet liquidity pools can be unreliable - some swap directions may fail due to imbalanced pools or missing pool state.
Note: If USDC→SOL fails, try SOL→USDC instead. This is a devnet pool limitation, not a code issue.
💡 The same code works reliably on Mainnet where pools are properly maintained.
🤝 Raydium x LazorKit
Integrating with an existing Solana protocol while maintaining gasless UX.
Making Raydium Work with LazorKit
Request txVersion: 'LEGACY' from Raydium API to keep instructions simpler than versioned transactions.
LazorKit manages compute budget automatically. Filter them out:
instructions.filter(ix => !ix.programId.equals(COMPUTE_BUDGET_PROGRAM))LazorKit's execute_cpi expects smart wallet in ALL instructions. Some (like SyncNative) don't need it. Workaround:
if (!hasSmartWallet) {
ix.keys.push({ pubkey: smartWallet, isSigner: false, isWritable: false })
}💡 These patterns can be applied to most Solana protocols when integrating with LazorKit
What You'll Learn
- ✓Use Raydium Trade API for quotes & swaps
- ✓Handling legacy transactions
- ✓Work around LazorKit validation quirks
- ✓Manage token accounts & balances
Connect Your Wallet
Use LazorKit smart wallet for gasless swaps