一键导入
raydium
Comprehensive guide for integrating Raydium AMMs on Solana. Use when building swaps, liquidity, and farming features with CLMM/CPMM/AMM via the Raydium SDK.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Comprehensive guide for integrating Raydium AMMs on Solana. Use when building swaps, liquidity, and farming features with CLMM/CPMM/AMM via the Raydium SDK.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Assess and enhance software projects for enterprise-grade security, quality, and automation. This skill should be used when evaluating projects for production readiness, implementing supply chain security (SLSA, signing, SBOMs), hardening CI/CD pipelines, establishing quality gates, reviewing code or PRs, writing documentation (ADRs, changelogs, migration guides), or pursuing OpenSSF Best Practices Badge. Aligned with OpenSSF Scorecard, Best Practices Badge (all levels), SLSA, and S2C2F. By Netresearch.
Agent Skill: Git workflow best practices for teams and CI/CD. This skill should be used when establishing branching strategies, implementing Conventional Commits, creating or reviewing PRs, managing PR review threads, merging PRs with signed commits, handling merge conflicts, or integrating Git with CI/CD. By Netresearch.
Translate EPUB (.epub) ebooks to another language by unpacking the EPUB container, extracting XHTML block-level fragments into JSONL translation units, translating them via the OpenAI Responses API (e.g. gpt-5.1 / gpt-5-mini) while preserving markup, updating language metadata, and repackaging a valid EPUB (mimetype-first and uncompressed). Use when Codex needs to translate and rebuild EPUB files.
Build deep architectural understanding through ultra-granular code analysis. Use when doing security audits, code reviews, or getting oriented in an unfamiliar codebase.
Comprehensive guide for building Solana trading apps using DFlow's Swap API. Use when integrating quotes, routing, imperative/declarative swaps, or prediction markets.
An example skill demonstrating the basic structure and format
| name | raydium |
| description | Comprehensive guide for integrating Raydium AMMs on Solana. Use when building swaps, liquidity, and farming features with CLMM/CPMM/AMM via the Raydium SDK. |
A comprehensive guide for building applications with Raydium - Solana's leading AMM and liquidity protocol.
Raydium is a suite of automated market makers (AMMs) on Solana offering:
npm install @raydium-io/raydium-sdk-v2
# or
yarn add @raydium-io/raydium-sdk-v2
import { Raydium } from '@raydium-io/raydium-sdk-v2';
import { Connection, Keypair } from '@solana/web3.js';
import bs58 from 'bs58';
// Setup connection and wallet
const connection = new Connection('https://api.mainnet-beta.solana.com');
const owner = Keypair.fromSecretKey(bs58.decode('YOUR_SECRET_KEY'));
// Initialize SDK
const raydium = await Raydium.load({
connection,
owner,
cluster: 'mainnet',
disableLoadToken: false, // Load token list
});
// Access token data
const tokenList = raydium.token.tokenList;
const tokenMap = raydium.token.tokenMap;
// Access account data
const tokenAccounts = raydium.account.tokenAccounts;
Allows LPs to concentrate liquidity in specific price ranges for higher capital efficiency.
// Fetch CLMM pool
const poolId = 'POOL_ID_HERE';
const poolInfo = await raydium.clmm.getPoolInfoFromRpc(poolId);
// Or from API (mainnet only)
const poolData = await raydium.api.fetchPoolById({ ids: poolId });
Simplified AMM without OpenBook market requirement, supports Token22.
// Fetch CPMM pool
const cpmmPool = await raydium.cpmm.getPoolInfoFromRpc(poolId);
Classic AMM integrated with OpenBook central limit order book.
// Fetch AMM pool
const ammPool = await raydium.liquidity.getPoolInfoFromRpc({ poolId });
import { CurveCalculator } from '@raydium-io/raydium-sdk-v2';
// Calculate swap
const { amountOut, fee } = CurveCalculator.swapBaseInput({
poolInfo,
amountIn: 1000000n, // lamports
mintIn: inputMint,
mintOut: outputMint,
});
// Execute CPMM swap
const { execute } = await raydium.cpmm.swap({
poolInfo,
inputAmount: 1000000n,
inputMint,
slippage: 0.01, // 1%
txVersion: 'V0',
});
await execute({ sendAndConfirm: true });
// CPMM deposit
const { execute } = await raydium.cpmm.addLiquidity({
poolInfo,
inputAmount: 1000000n,
baseIn: true,
slippage: 0.01,
});
await execute({ sendAndConfirm: true });
// Create CPMM pool
const { execute } = await raydium.cpmm.createPool({
mintA,
mintB,
mintAAmount: 1000000n,
mintBAmount: 1000000n,
startTime: new BN(0),
feeConfig, // from API
txVersion: 'V0',
});
const { txId } = await execute({ sendAndConfirm: true });
| Program | Mainnet | Devnet |
|---|---|---|
| AMM | 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 | DRaya7Kj3aMWQSy19kSjvmuwq9docCHofyP9kanQGaav |
| CLMM | CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK | devi51mZmdwUJGU9hjN27vEz64Gps7uUefqxg27EAtH |
| CPMM | CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C | CPMDWBwJDtYax9qW7AyRuVC19Cc4L4Vcy4n2BHAbHkCW |
// Mainnet API
const API_URL = 'https://api-v3.raydium.io';
// Devnet API
const DEVNET_API = 'https://api-v3.raydium.io/main/';
// Common endpoints
const endpoints = {
tokenList: '/mint/list',
poolList: '/pools/info/list',
poolById: '/pools/info/ids',
farmList: '/farms/info/list',
clmmConfigs: '/clmm/configs',
};
const { execute } = await raydium.cpmm.swap({
poolInfo,
inputAmount,
inputMint,
slippage: 0.01,
txVersion: 'V0', // or 'LEGACY'
computeBudgetConfig: {
units: 600000,
microLamports: 100000, // priority fee
},
});
// Execute with options
const { txId } = await execute({
sendAndConfirm: true,
skipPreflight: true,
});
console.log(`https://solscan.io/tx/${txId}`);
| Feature | CLMM | CPMM | AMM |
|---|---|---|---|
| Concentrated Liquidity | Yes | No | No |
| Token22 Support | Limited | Yes | No |
| OpenBook Required | No | No | Yes |
| Custom Price Ranges | Yes | No | No |
| LP NFT Positions | Yes | No | No |
raydium/
├── SKILL.md # This file
├── resources/
│ ├── sdk-api-reference.md # Complete SDK API
│ ├── program-ids.md # All program addresses
│ └── pool-types.md # Pool type comparison
├── examples/
│ ├── swap/README.md # Token swap examples
│ ├── clmm-pool/README.md # CLMM pool creation
│ ├── clmm-position/README.md # CLMM position management
│ ├── cpmm-pool/README.md # CPMM pool operations
│ └── liquidity/README.md # Liquidity management
├── templates/
│ └── raydium-setup.ts # SDK setup template
└── docs/
├── clmm-guide.md # CLMM deep dive
└── troubleshooting.md # Common issues