<< All versions
Skill v1.0.1
currentAutomated scan96/100alsk1992/cloddsbot/trading-solana
2 files
──Details
PublishedSeptember 9, 2026 at 01:10 AM
Content Hashsha256:610ff857cf6037cf...
Git SHA715fd4a6c06b
Bump Typepatch
──Files
Files (1 file, 10.9 KB)
SKILL.md10.9 KBactive
SKILL.md · 419 lines · 10.9 KB
version: "1.0.1" name: trading-solana description: "Trade tokens on Solana DEXes - Jupiter, Raydium, Orca, Meteora, Pump.fun" emoji: "☀️" gates: envs:
- SOLANA_PRIVATE_KEY
Solana DEX Trading - Complete API Reference
Trade any token on Solana using Jupiter aggregator, Raydium, Orca Whirlpools, Meteora DLMM, and Pump.fun.
Required Environment Variables
bash
SOLANA_PRIVATE_KEY=base58_or_json_array # Your Solana wallet private keySOLANA_RPC_URL=https://api.mainnet-beta.solana.com # Optional: custom RPC
Chat Commands
Swaps
/sol swap <amount> <from> to <to> # Swap tokens on Solana/sol swap 1 SOL to USDC # Swap 1 SOL to USDC/sol swap 100 USDC to JUP # Swap 100 USDC to JUP/sol swap 0.5 SOL to BONK # Swap 0.5 SOL to BONK
Quotes
/sol quote <amount> <from> to <to> # Get swap quote without executing/sol quote 1 SOL to USDC # Quote 1 SOL → USDC
Pool Discovery
/sol pools <token> # List liquidity pools for token/sol pools SOL # All SOL pools/sol pools BONK # All BONK pools
Balances & Wallet
/sol balance # Check SOL and token balances/sol address # Show wallet address
Supported DEXes
| DEX | Type | Features | |
|---|---|---|---|
| Jupiter | Aggregator | Best route across all DEXes, limit orders, DCA | |
| Raydium | AMM | Concentrated liquidity, high volume | |
| Orca | Whirlpool | Concentrated liquidity pools, LP management | |
| Meteora | DLMM | Dynamic liquidity market maker, LP management | |
| Pump.fun | Launchpad | New token launches |
TypeScript API Reference
Jupiter (Aggregator - Recommended)
typescript
import {executeJupiterSwap,getJupiterQuote,createJupiterLimitOrder,cancelJupiterLimitOrder,listJupiterLimitOrders,createJupiterDCA,closeJupiterDCA,listJupiterDCAs,} from 'clodds/solana/jupiter';// Execute swap via Jupiter (best route)const result = await executeJupiterSwap(connection, keypair, {inputMint: 'So11111111111111111111111111111111111111112', // SOLoutputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDCamount: '1000000000', // 1 SOL in lamportsslippageBps: 50, // 0.5% slippage});console.log(`Swapped: ${result.inAmount} → ${result.outAmount}`);console.log(`TX: ${result.signature}`);
Jupiter Limit Orders
typescript
// Create limit order - sell 1 SOL for minimum 250 USDCconst order = await createJupiterLimitOrder(connection, keypair, {inputMint: 'So11111111111111111111111111111111111111112',outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',inAmount: '1000000000', // 1 SOLoutAmount: '250000000', // 250 USDCexpiredAtMs: Date.now() + 7 * 24 * 60 * 60 * 1000, // 1 week expiry});console.log(`Order created: ${order.orderPubKey}`);// List open ordersconst orders = await listJupiterLimitOrders(connection, keypair.publicKey.toBase58());console.log(`Open orders: ${orders.length}`);// Cancel orderawait cancelJupiterLimitOrder(connection, keypair, order.orderPubKey);
Jupiter DCA (Dollar Cost Averaging)
typescript
// Create DCA - swap 100 USDC to JUP, 10 USDC every hourconst dca = await createJupiterDCA(connection, keypair, {inputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDCoutputMint: 'JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN', // JUPinAmount: '100000000', // Total 100 USDCinAmountPerCycle: '10000000', // 10 USDC per swapcycleSecondsApart: 3600, // Every hour (min 30 seconds)});console.log(`DCA created: ${dca.dcaPubKey}`);// List active DCAsconst dcas = await listJupiterDCAs(connection, keypair.publicKey.toBase58());// Close DCA and withdraw remaining fundsawait closeJupiterDCA(connection, keypair, dca.dcaPubKey);
Raydium
typescript
import {executeRaydiumSwap,getRaydiumQuote,listRaydiumPools,getClmmPositions,createClmmPosition,increaseClmmLiquidity,decreaseClmmLiquidity,closeClmmPosition,harvestClmmRewards,addAmmLiquidity,removeAmmLiquidity,} from 'clodds/solana/raydium';// Get quoteconst quote = await getRaydiumQuote({inputMint: 'SOL',outputMint: 'USDC',amount: 1_000_000_000,});console.log(`Expected output: ${quote.outAmount}`);// Execute swapconst result = await executeRaydiumSwap(connection, keypair, {inputMint: 'So11111111111111111111111111111111111111112',outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',amount: '1000000000',slippageBps: 50,});// List poolsconst pools = await listRaydiumPools({ tokenMints: ['So11111111111111111111111111111111111111112'] });// CLMM: Open concentrated liquidity positionconst position = await createClmmPosition(connection, keypair, {poolId: 'POOL_ID_HERE',priceLower: 100,priceUpper: 200,baseAmount: '1000000000',});// CLMM: List positionsconst positions = await getClmmPositions(connection, keypair);// CLMM: Harvest rewardsconst rewards = await harvestClmmRewards(connection, keypair);// AMM: Add liquidityawait addAmmLiquidity(connection, keypair, {poolId: 'AMM_POOL_ID',amountA: '1000000000',fixedSide: 'a',});
Orca Whirlpools
typescript
import { executeOrcaWhirlpoolSwap, getOrcaWhirlpoolQuote, listOrcaWhirlpoolPools } from 'clodds/solana/orca';// Get quoteconst quote = await getOrcaWhirlpoolQuote({inputMint: 'SOL',outputMint: 'USDC',amount: 1_000_000_000,});// Execute swapconst result = await executeOrcaWhirlpoolSwap({inputMint: 'SOL',outputMint: 'USDC',amount: 1_000_000_000,slippage: 0.5,});// List poolsconst pools = await listOrcaWhirlpoolPools({ token: 'SOL' });
Meteora DLMM
typescript
import { executeMeteoraDlmmSwap, getMeteoraDlmmQuote, listMeteoraDlmmPools } from 'clodds/solana/meteora';// Get quoteconst quote = await getMeteoraDlmmQuote({inputMint: 'SOL',outputMint: 'USDC',amount: 1_000_000_000,});// Execute swapconst result = await executeMeteoraDlmmSwap({inputMint: 'SOL',outputMint: 'USDC',amount: 1_000_000_000,slippage: 0.5,});// List poolsconst pools = await listMeteoraDlmmPools({ token: 'SOL' });
Pump.fun
typescript
import {executePumpFunTrade,getBondingCurveState,getTokenPriceInfo,calculateBuyQuote,calculateSellQuote,isGraduated,getTokenInfo,getPumpFunQuote,} from 'clodds/solana/pumpapi';// Buy token on Pump.funconst result = await executePumpFunTrade(connection, keypair, {mint: 'token_mint_address',action: 'buy',amount: 0.1, // SOL amountdenominatedInSol: true,slippageBps: 500, // 5% slippage for volatile tokens});// Sell tokenconst result = await executePumpFunTrade(connection, keypair, {mint: 'token_mint_address',action: 'sell',amount: 1000000, // Token amountdenominatedInSol: false,slippageBps: 500,});
On-Chain Bonding Curve
typescript
import BN from 'bn.js';// Get bonding curve state directly from chainconst state = await getBondingCurveState(connection, 'token_mint');if (state) {console.log(`Virtual SOL: ${state.virtualSolReserves.toString()}`);console.log(`Virtual Tokens: ${state.virtualTokenReserves.toString()}`);console.log(`Graduated: ${state.complete}`);}// Get comprehensive price infoconst priceInfo = await getTokenPriceInfo(connection, 'token_mint', 200); // 200 = SOL price USDconsole.log(`Price: ${priceInfo.priceInSol} SOL ($${priceInfo.priceInUsd})`);console.log(`Market Cap: $${priceInfo.marketCapUsd}`);console.log(`Bonding Progress: ${(priceInfo.bondingProgress * 100).toFixed(1)}%`);// Calculate buy quote with price impactconst solAmount = new BN(0.5 * 1e9); // 0.5 SOL in lamportsconst buyQuote = calculateBuyQuote(state, solAmount, 100); // 1% feeconsole.log(`Tokens out: ${buyQuote.tokensOut.toNumber() / 1e6}`);console.log(`Price impact: ${buyQuote.priceImpact.toFixed(2)}%`);// Calculate sell quoteconst tokenAmount = new BN(1000000 * 1e6); // 1M tokensconst sellQuote = calculateSellQuote(state, tokenAmount, 100);console.log(`SOL out: ${sellQuote.solOut.toNumber() / 1e9}`);// Check if token graduated to PumpSwapconst graduation = await isGraduated(connection, 'token_mint');if (graduation.graduated) {console.log(`PumpSwap pool: ${graduation.pumpswapPool}`);}
Pump.fun Local Quote
typescript
// Computed locally via the official SDK (fee-tier-aware) — no third-party relay callconst quote = await getPumpFunQuote({mint: 'token_mint',action: 'buy',amount: '0.5', // 0.5 SOL});console.log(`Input: ${quote.inputAmount}, Output: ${quote.outputAmount}`);
Token Resolution
typescript
import { resolveTokenMints, getTokenList } from 'clodds/solana/tokenlist';// Resolve token symbols to mint addressesconst mints = await resolveTokenMints(['SOL', 'USDC', 'JUP', 'BONK']);// ['So111...', 'EPjF...', '...', '...']// Get full token listconst tokens = await getTokenList();
Pool Discovery
typescript
import { listAllPools, selectBestPool } from 'clodds/solana/pools';// List all pools for a token pairconst pools = await listAllPools({inputMint: 'SOL',outputMint: 'USDC',});// Select best pool based on liquidityconst best = await selectBestPool({inputMint: 'SOL',outputMint: 'USDC',amount: 1_000_000_000,});
Wallet Utilities
typescript
import { loadSolanaKeypair, getSolanaConnection, signAndSendTransaction } from 'clodds/solana/wallet';// Load keypair from envconst keypair = loadSolanaKeypair();// Get connectionconst connection = getSolanaConnection();// Sign and send transactionconst signature = await signAndSendTransaction(connection, transaction, keypair);
Token Symbols
Common token symbols that can be used:
| Symbol | Name | Mint Address | |
|---|---|---|---|
| SOL | Solana | So11111111111111111111111111111111111111112 | |
| USDC | USD Coin | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v | |
| USDT | Tether | Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB | |
| JUP | Jupiter | JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN | |
| BONK | Bonk | DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263 | |
| WIF | dogwifhat | EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm | |
| PYTH | Pyth | HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3 |
Slippage Settings
| Token Type | Recommended Slippage | |
|---|---|---|
| Major (SOL, USDC) | 0.5% | |
| Mid-cap | 1-2% | |
| Small-cap / Meme | 3-5% | |
| New launches | 5-10% |
Error Handling
typescript
import { SolanaSwapError, InsufficientBalanceError, SlippageExceededError } from 'clodds/solana';try {await executeJupiterSwap({ ... });} catch (error) {if (error instanceof InsufficientBalanceError) {console.log('Not enough balance');} else if (error instanceof SlippageExceededError) {console.log('Price moved too much, increase slippage');}}