跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.raydium.io/llms.txt

Use this file to discover all available pages before exploring further.

本页内容由 AI 自动翻译,所有内容以英文版本为准。查看英文版 →
这些文档既为人类设计,也为 AI 工具设计。如果你在构建编码 AI(Claude Code、Cursor、Windsurf、Continue 等)或在文档上运行 RAG,下面的接口可以让你直接接入 Raydium 文档,无需自定义爬虫。

可用的接口

接口URL 模式使用场景
MCP 服务器https://docs.raydium.io/mcp你希望 AI 编辑器(Claude Code、Cursor、Windsurf 等)能够原生查询并引用 Raydium 文档。
llms.txt 索引https://docs.raydium.io/llms.txt你在构建 RAG 管道,需要每个页面的扁平索引。
llms-full.txt 内容https://docs.raydium.io/llms-full.txt你需要完整的文档集合作为单个连接的文件,用于离线索引。
逐页复制菜单每个内容页顶部的「复制页面」按钮你要将一个页面粘贴到与 LLM 的对话中。
逐页深层链接查看为 Markdown在 ChatGPT 中打开在 Claude 中打开在 Cursor 中打开在 VS Code 中打开从文档页面一键切换到你选择的工具。
「复制页面」按钮和深层链接菜单位于每个页面的右上角(页面标题旁边)。两者都由文档平台的上下文菜单支持。

MCP 服务器

MCP(模型上下文协议)服务器允许 AI 客户端将 Raydium 文档作为工具进行查询。配置完成后,你的 AI 可以询问「在 Raydium 文档中搜索 addLiquidity 参数」,并获得引用的权威答案。

Claude Code

claude mcp add --transport http raydium-docs https://docs.raydium.io/mcp
添加后,要求 Claude Code「在 Raydium 文档中搜索 X」,它将使用该工具。

Cursor

添加到你的 Cursor 设置(Cmd/Ctrl + , → MCP):
{
  "mcpServers": {
    "raydium-docs": {
      "url": "https://docs.raydium.io/mcp"
    }
  }
}

Windsurf、Continue、通用客户端

任何与 MCP 兼容的客户端都可以指向 https://docs.raydium.io/mcp。如果你的客户端需要清单文件,它位于 https://docs.raydium.io/mcp/.well-known/mcp.json

服务器暴露的功能

Raydium 文档 MCP 服务器暴露一个主要工具 search_docs(query: string),它返回查询的最高排名段落及其规范 URL。AI 负责引用它使用的 URL;我们不进行按 AI 的追踪或速率限制。

用于 RAG 的 llms.txt

llms.txt 是一个新兴的「机器可读文档索引」标准。Raydium 提供:
  • https://docs.raydium.io/llms.txt — 每个页面的扁平列表,包括标题和一行摘要,按章节组织。
  • https://docs.raydium.io/llms-full.txt — 每个页面的完整 Markdown 内容,连接在一起,页面边界以标题形式保留。
full 版本在每次文档部署时重新生成。定期拉取(每天一次足够)或按需获取。
# 将完整的文档集合放入你的 RAG 摄取管道。
curl -sSL https://docs.raydium.io/llms-full.txt -o raydium-docs.md

逐页切换菜单

每个内容页都有一个上下文菜单(右上角,标题旁边),包含以下一键操作:
  • 复制 — 将页面作为纯 Markdown 复制。
  • 查看为 Markdown — 在新标签页中打开源 .md 文件,以便保存。
  • 在 ChatGPT / Claude / Perplexity 中打开 — 将页面内容预加载到指定工具的聊天提示中。
  • 在 Cursor / VS Code 中打开 — 在指定编辑器中打开包含页面内容的缓冲区。
当你想在不设置 MCP 的情况下向模型提出关于单个页面的问题时,这是合适的接口。

为编码 AI 预构建的上下文文件

如果你在集成 Raydium 并希望 AI 从一开始就拥有正确的基础知识,将这些文件放入你的项目:

.cursorrules / .windsurfrules / AI 系统提示

You are integrating with Raydium, a Solana DeFi protocol with five product
surfaces: AMM v4, CPMM, CLMM, Farm, and LaunchLab. Authoritative docs live
at docs.raydium.io. The official SDK is `@raydium-io/raydium-sdk-v2` (pin
the version you've verified against). For server-built swaps, prefer the
Trade API at transaction-v1.raydium.io. Always:

- Pass a `Connection` and `cluster` that match.
- Keep all amounts as `BN` instances; never call `.toNumber()` on amounts.
- Pre-fund the user's wallet for ATA creation rent.
- Pass an explicit `computeBudgetConfig` for any tx that may compete in
  high-volume windows.
- Re-fetch `poolInfo` immediately before high-value transactions; cached
  state goes stale.

When uncertain about an instruction's accounts list, defer to
`docs.raydium.io/products/<product>/accounts` and the on-chain IDL.
另存为 .cursorrules(Cursor)、.windsurfrules(Windsurf)或 CLAUDE.md(Claude Code),或粘贴到你的 AI 系统提示中。具体的文件名和位置因工具版本而异,如果自动选取失败,请检查你的工具设置文档。

固定上下文列表

对于接受「始终包含」页面列表的编码 AI,此列表是大多数 Raydium 集成所需的最小有用上下文:
https://docs.raydium.io/sdk-api/typescript-sdk
https://docs.raydium.io/sdk-api/trade-api
https://docs.raydium.io/products/cpmm/instructions
https://docs.raydium.io/products/clmm/instructions
https://docs.raydium.io/integration-guides/priority-fee-tuning
https://docs.raydium.io/reference/program-addresses
https://docs.raydium.io/reference/error-codes
根据你集成的产品进行调整。

索引配方

如果你在构建自己的 RAG 并不想使用 llms-full.txt,这是规范的配方:
import { fetch } from "undici";

const INDEX_URL = "https://docs.raydium.io/llms.txt";
const BASE      = "https://docs.raydium.io";

const index    = await (await fetch(INDEX_URL)).text();
const pageUrls = [...index.matchAll(/^- \[(.+?)\]\((.+?)\)/gm)].map(m => m[2]);

for (const path of pageUrls) {
  const md = await (await fetch(`${BASE}${path}.md`)).text();
  // ingest md into your vector store, keyed by path
}
每个页面都在其规范路径上提供,附加 .md 后缀(例如 /sdk-api/typescript-sdk/sdk-api/typescript-sdk.md)。

注意事项

  • 不要将私密状态粘贴到提示中。 MCP 服务器只了解公开文档中的内容。钱包密钥、RPC 凭证和类似的密钥不应进入 AI 上下文。
  • AI 输出不是权威的。 模型有些轻率地幻觉程序地址、指令名称和账户列表。在信任 AI 生成的交易之前,始终针对文档和 IDL 进行验证。
  • 版本漂移。 SDK v2 是 pre-1.0;在较旧版本上训练的 AI 可能会生成针对你的固定版本无法编译的代码。在 AI 的系统提示中包含固定的 SDK 版本。

相关资源

来源: