raydium
БесплатноЗапускает вложенные скриптыНе проверенComplete Raydium Protocol SDK - the single source of truth for integrating Raydium on Solana. Covers SDK, Trade API, CLMM, CPMM, AMM pools, LaunchLab token…
от sendaifun★ 129 звёзд на GitHubОб этом скилле
Raydium Protocol - Complete Integration Guide
The definitive guide for integrating Raydium - Solana's leading AMM and liquidity infrastructure powering DeFi since 2021.
What is Raydium?
Raydium is a decentralized exchange on Solana providing:
- Token Swapping - Fast, cheap swaps via smart routing across all pool types
- Liquidity Provision - Earn trading fees and rewards by providing liquidity
- Token Launches - LaunchLab for permissionless token launches with bonding curves
- Perpetual Trading - Leverage trading on crypto assets
Key Statistics
- Most widely integrated liquidity infrastructure on Solana
- 35,000+ tokens launched via LaunchLab (2025)
- Multiple pool types for different use cases
Core Products
Pool Types
| Type | Description | Best For |
|---|---|---|
| CLMM | Concentrated Liquidity Market Maker | Professional LPs, stablecoin pairs, active management |
| CPMM | Constant Product (x*y=k) with Token22 | New token launches, simple integrations |
| AMM V4 | Classic AMM + OpenBook CLOB | Existing markets, hybrid liquidity |
Additional Features
- LaunchLab - Permissionless token launches with bonding curves
- Farms - Yield farming and staking rewards
- Burn & Earn - Permanent liquidity locking
- Trade API - HTTP API for swap routing
API Overview
1. SDK (TypeScript)
Package: @raydium-io/raydium-sdk-v2
For programmatic integration with full control over pools, positions, and transactions.
2. Trade API (HTTP)
Base URL: https://transaction-v1.raydium.io
For swap routing - get quotes and serialized transactions via HTTP.
3. Data API
Base URL: https://api-v3.raydium.io
For pool data, token lists, farm info, and configurations.
Quick Start
Installation
npm install @raydium-io/raydium-sdk-v2
# or
yarn add @raydium-io/raydium-sdk-v2
Basic Setup
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;
Pool Types
CLMM (Concentrated Liquidity)
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 });
CPMM (Constant Product)
Simplified AMM without OpenBook market requirement, supports Token22.
// Fetch CPMM pool
const cpmmPool = await raydium.cpmm.getPoolInfoFromRpc(poolId);
AMM (Legacy)
Classic AMM integrated with OpenBook central limit order book.
// Fetch AMM pool
const ammPool = await raydium.liquidity.getPoolInfoFromRpc({ poolId });
Core Operations
Swap
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 });
Add Liquidity
// CPMM deposit
const { execute } = await raydium.cpmm.addLiquidity({
poolInfo,
inputAmount: 1000000n,
baseIn: true,
slippage: 0.01,
});
await execute({ sendAndConfirm: true });
Create Pool
// 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 IDs
| Program | Mainnet | Devnet |
|---|---|---|
| AMM | 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 |
DRaya7Kj3aMWQSy19kSjvmuwq9docCHofyP9kanQGaav |
| CLMM | CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK |
devi51mZmdwUJGU9hjN27vEz64Gps7uUefqxg27EAtH |
| CPMM | CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C |
CPMDWBwJDtYax9qW7AyRuVC19Cc4L4Vcy4n2BHAbHkCW |
API Endpoints
// 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: '/m
Установить raydium в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл raydium?
Complete Raydium Protocol SDK - the single source of truth for integrating Raydium on Solana. Covers SDK, Trade API, CLMM, CPMM, AMM pools, LaunchLab token launches, farming, CPI integration, and all Raydium tools.
Как установить скилл raydium?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл raydium запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic