meteora

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Pre-flight Dependencies (auto-injected by Plugin Store CI)

前置依赖检查(由插件商店CI自动注入)

Run once per session before first use. These checks ensure required tools are installed.
每次会话首次使用前运行一次,这些检查会确保所需工具已安装。

Install onchainos CLI + Skills (auto-injected)

安装onchainos CLI + Skills(自动注入)

bash
undefined
bash
undefined

1. Install onchainos CLI

1. Install onchainos CLI

onchainos --version 2>/dev/null || curl -fsSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh
onchainos --version 2>/dev/null || curl -fsSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh

2. Install onchainos skills (enables AI agent to use onchainos commands)

2. Install onchainos skills (enables AI agent to use onchainos commands)

npx skills add okx/onchainos-skills --yes --global
npx skills add okx/onchainos-skills --yes --global

3. Install plugin-store skills (enables plugin discovery and management)

3. Install plugin-store skills (enables plugin discovery and management)

npx skills add okx/plugin-store --skill plugin-store --yes --global
undefined
npx skills add okx/plugin-store --skill plugin-store --yes --global
undefined

Install meteora binary (auto-injected)

安装meteora二进制文件(自动注入)

bash
if ! command -v meteora >/dev/null 2>&1; then
  OS=$(uname -s | tr A-Z a-z)
  ARCH=$(uname -m)
  EXT=""
  case "${OS}_${ARCH}" in
    darwin_arm64)  TARGET="aarch64-apple-darwin" ;;
    darwin_x86_64) TARGET="x86_64-apple-darwin" ;;
    linux_x86_64)  TARGET="x86_64-unknown-linux-gnu" ;;
    linux_i686)    TARGET="i686-unknown-linux-gnu" ;;
    linux_aarch64) TARGET="aarch64-unknown-linux-gnu" ;;
    linux_armv7l)  TARGET="armv7-unknown-linux-gnueabihf" ;;
    mingw*_x86_64|msys*_x86_64|cygwin*_x86_64)   TARGET="x86_64-pc-windows-msvc"; EXT=".exe" ;;
    mingw*_i686|msys*_i686|cygwin*_i686)           TARGET="i686-pc-windows-msvc"; EXT=".exe" ;;
    mingw*_aarch64|msys*_aarch64|cygwin*_aarch64)  TARGET="aarch64-pc-windows-msvc"; EXT=".exe" ;;
  esac
  mkdir -p ~/.local/bin
  curl -fsSL "https://github.com/okx/plugin-store/releases/download/plugins/meteora@0.1.0/meteora-${TARGET}${EXT}" -o ~/.local/bin/meteora${EXT}
  chmod +x ~/.local/bin/meteora${EXT}
fi
bash
if ! command -v meteora >/dev/null 2>&1; then
  OS=$(uname -s | tr A-Z a-z)
  ARCH=$(uname -m)
  EXT=""
  case "${OS}_${ARCH}" in
    darwin_arm64)  TARGET="aarch64-apple-darwin" ;;
    darwin_x86_64) TARGET="x86_64-apple-darwin" ;;
    linux_x86_64)  TARGET="x86_64-unknown-linux-gnu" ;;
    linux_i686)    TARGET="i686-unknown-linux-gnu" ;;
    linux_aarch64) TARGET="aarch64-unknown-linux-gnu" ;;
    linux_armv7l)  TARGET="armv7-unknown-linux-gnueabihf" ;;
    mingw*_x86_64|msys*_x86_64|cygwin*_x86_64)   TARGET="x86_64-pc-windows-msvc"; EXT=".exe" ;;
    mingw*_i686|msys*_i686|cygwin*_i686)           TARGET="i686-pc-windows-msvc"; EXT=".exe" ;;
    mingw*_aarch64|msys*_aarch64|cygwin*_aarch64)  TARGET="aarch64-pc-windows-msvc"; EXT=".exe" ;;
  esac
  mkdir -p ~/.local/bin
  curl -fsSL "https://github.com/okx/plugin-store/releases/download/plugins/meteora@0.1.0/meteora-${TARGET}${EXT}" -o ~/.local/bin/meteora${EXT}
  chmod +x ~/.local/bin/meteora${EXT}
fi

Report install (auto-injected, runs once)

安装上报(自动注入,仅运行一次)

bash
REPORT_FLAG="$HOME/.plugin-store/reported/meteora"
if [ ! -f "$REPORT_FLAG" ]; then
  mkdir -p "$HOME/.plugin-store/reported"
  DEV_RAW="$(hostname):$(uname -s):$(uname -m):$HOME"
  DEV_ID=$(echo -n "$DEV_RAW" | shasum -a 256 | head -c 32)
  _K=$(echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | base64 -d 2>/dev/null || echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | openssl base64 -d)
  HMAC_SIG=$(echo -n "${_K}${DEV_ID}" | shasum -a 256 | head -c 8)
  DIV_ID="${DEV_ID}${HMAC_SIG}"
  unset _K
  curl -s -X POST "https://plugin-store-dun.vercel.app/install" \
    -H "Content-Type: application/json" \
    -d '{"name":"meteora","version":"0.1.0"}' >/dev/null 2>&1 || true
  curl -s -X POST "https://www.okx.com/priapi/v1/wallet/plugins/download/report" \
    -H "Content-Type: application/json" \
    -d '{"pluginName":"meteora","divId":"'"$DIV_ID"'"}' >/dev/null 2>&1 || true
  touch "$REPORT_FLAG"
fi

bash
REPORT_FLAG="$HOME/.plugin-store/reported/meteora"
if [ ! -f "$REPORT_FLAG" ]; then
  mkdir -p "$HOME/.plugin-store/reported"
  DEV_RAW="$(hostname):$(uname -s):$(uname -m):$HOME"
  DEV_ID=$(echo -n "$DEV_RAW" | shasum -a 256 | head -c 32)
  _K=$(echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | base64 -d 2>/dev/null || echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | openssl base64 -d)
  HMAC_SIG=$(echo -n "${_K}${DEV_ID}" | shasum -a 256 | head -c 8)
  DIV_ID="${DEV_ID}${HMAC_SIG}"
  unset _K
  curl -s -X POST "https://plugin-store-dun.vercel.app/install" \
    -H "Content-Type: application/json" \
    -d '{"name":"meteora","version":"0.1.0"}' >/dev/null 2>&1 || true
  curl -s -X POST "https://www.okx.com/priapi/v1/wallet/plugins/download/report" \
    -H "Content-Type: application/json" \
    -d '{"pluginName":"meteora","divId":"'"$DIV_ID"'"}' >/dev/null 2>&1 || true
  touch "$REPORT_FLAG"
fi

Architecture

架构说明

  • Read operations (
    get-pools
    ,
    get-pool-detail
    ,
    get-swap-quote
    ,
    get-user-positions
    ) → direct REST API calls to
    https://dlmm.datapi.meteora.ag
    ; no wallet or confirmation needed
  • Write operations (
    swap
    ) → after user confirmation, executes via
    onchainos swap execute --chain solana
    ; CLI handles signing and broadcast automatically (no
    --force
    needed on Solana)
  • 读操作 (
    get-pools
    ,
    get-pool-detail
    ,
    get-swap-quote
    ,
    get-user-positions
    ) → 直接向
    https://dlmm.datapi.meteora.ag
    发送REST API请求,无需钱包或确认
  • 写操作 (
    swap
    ) → 用户确认后,通过
    onchainos swap execute --chain solana
    执行;CLI会自动处理签名和广播(Solana上不需要使用
    --force
    参数)

Supported Operations

支持的操作

get-pools — List liquidity pools

get-pools — 列出流动性池

Search and list Meteora DLMM pools. Supports filtering by token pair, sorting by TVL, APY, volume, and fee/TVL ratio.
meteora get-pools [--page <n>] [--page-size <n>] [--sort-key tvl|volume|apr|fee_tvl_ratio] [--order-by asc|desc] [--search-term <token_symbol_or_address>]
Examples:
meteora get-pools --search-term SOL-USDC --sort-key tvl --order-by desc
meteora get-pools --sort-key apr --order-by desc --page-size 5

搜索并列出Meteora DLMM池,支持按代币对筛选,按TVL、APY、交易量、手续费/TVL比率排序。
meteora get-pools [--page <n>] [--page-size <n>] [--sort-key tvl|volume|apr|fee_tvl_ratio] [--order-by asc|desc] [--search-term <token_symbol_or_address>]
示例:
meteora get-pools --search-term SOL-USDC --sort-key tvl --order-by desc
meteora get-pools --sort-key apr --order-by desc --page-size 5

get-pool-detail — Get pool details

get-pool-detail — 获取池子详情

Retrieve full details for a specific DLMM pool: configuration, TVL, fee structure, reserves, APY.
meteora get-pool-detail --address <pool_address>
Example:
meteora get-pool-detail --address 5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6

获取指定DLMM池的完整信息:配置、TVL、手续费结构、储备金、APY。
meteora get-pool-detail --address <pool_address>
示例:
meteora get-pool-detail --address 5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6

get-swap-quote — Get swap quote

get-swap-quote — 获取兑换报价

Get an estimated swap quote for a token pair using the onchainos DEX aggregator on Solana.
meteora get-swap-quote --from-token <mint> --to-token <mint> --amount <readable_amount>
Examples:
meteora get-swap-quote --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0

使用Solana上的onchainos DEX聚合器获取代币对的预估兑换报价。
meteora get-swap-quote --from-token <mint> --to-token <mint> --amount <readable_amount>
示例:
meteora get-swap-quote --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0

get-user-positions — View LP positions

get-user-positions — 查看LP头寸

View a user's DLMM LP positions including token amounts, bin ranges, and unclaimed fees.
meteora get-user-positions [--wallet <address>] [--pool <pool_address>]
If
--wallet
is omitted, uses the currently logged-in onchainos wallet.
Examples:
meteora get-user-positions
meteora get-user-positions --wallet GbE9k66MjLRQC7RnMCkRuSgHi3Lc8LJQXWdCmYFtGo2
meteora get-user-positions --pool 5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6

查看用户的DLMM LP头寸,包括代币数量、价格区间、未领取手续费。
meteora get-user-positions [--wallet <address>] [--pool <pool_address>]
如果省略
--wallet
参数,将使用当前登录的onchainos钱包。
示例:
meteora get-user-positions
meteora get-user-positions --wallet GbE9k66MjLRQC7RnMCkRuSgHi3Lc8LJQXWdCmYFtGo2
meteora get-user-positions --pool 5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6

swap — Execute a token swap

swap — 执行代币兑换

Execute a token swap on Solana via the onchainos DEX aggregator. Supports dry run mode.
meteora swap --from-token <mint> --to-token <mint> --amount <readable_amount> [--slippage <pct>] [--wallet <address>] [--dry-run]
Execution Flow:
  1. Run with
    --dry-run
    to preview the quote without submitting a transaction
  2. Ask user to confirm the swap details (from/to tokens, amount, estimated output, slippage)
  3. Execute after explicit user approval:
    meteora swap --from-token ... --to-token ... --amount ...
  4. Report transaction hash and Solscan link
Examples:
undefined
通过onchainos DEX聚合器在Solana上执行代币兑换,支持试运行模式。
meteora swap --from-token <mint> --to-token <mint> --amount <readable_amount> [--slippage <pct>] [--wallet <address>] [--dry-run]
执行流程:
  1. 携带
    --dry-run
    参数运行,预览报价而不提交交易
  2. 请求用户确认兑换详情(转出/转入代币、数量、预估产出、滑点)
  3. 获得用户明确批准后执行:
    meteora swap --from-token ... --to-token ... --amount ...
  4. 返回交易哈希和Solscan链接
示例:
undefined

Preview swap (dry run)

预览兑换(试运行)

meteora --dry-run swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0
meteora --dry-run swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0

Execute swap (after user confirmation)

执行兑换(用户确认后)

meteora swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0 --slippage 0.5

**Risk warnings:**
- Price impact > 5%: warning displayed, recommend splitting the trade
- APY > 50% on a pool: high-risk warning displayed

---
meteora swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0 --slippage 0.5

**风险提示:**
- 价格影响>5%:展示警告,建议拆分交易
- 池子APY>50%:展示高风险警告

---

Token Addresses (Solana Mainnet)

代币地址(Solana主网)

TokenMint Address
SOL (native)
11111111111111111111111111111111
Wrapped SOL
So11111111111111111111111111111111111111112
USDC
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
USDT
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB

代币铸币地址
SOL (原生)
11111111111111111111111111111111
封装SOL
So11111111111111111111111111111111111111112
USDC
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
USDT
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB

Typical User Scenarios

典型使用场景

Scenario 1: Swap SOL for USDC on Meteora

场景1:在Meteora上将SOL兑换为USDC

undefined
undefined

Step 1: Find best SOL-USDC pool

步骤1:查找最优的SOL-USDC池

meteora get-pools --search-term SOL-USDC --sort-key tvl --order-by desc --page-size 3
meteora get-pools --search-term SOL-USDC --sort-key tvl --order-by desc --page-size 3

Step 2: Get swap quote

步骤2:获取兑换报价

meteora get-swap-quote --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0
meteora get-swap-quote --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0

Step 3: Preview swap (dry run)

步骤3:预览兑换(试运行)

meteora --dry-run swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0
meteora --dry-run swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0

Step 4: Ask user to confirm, then execute

步骤4:请求用户确认后执行兑换

meteora swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0 --slippage 0.5
undefined
meteora swap --from-token So11111111111111111111111111111111111111112 --to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --amount 1.0 --slippage 0.5
undefined

Scenario 2: Check LP positions

场景2:查看LP头寸

undefined
undefined

View all positions for logged-in wallet

查看当前登录钱包的所有头寸

meteora get-user-positions
meteora get-user-positions

Filter by specific pool

按指定池子过滤

meteora get-user-positions --pool 5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6
undefined
meteora get-user-positions --pool 5rCf1DM8LjKTw4YqhnoLcngyZYeNnQqztScTogYHAS6
undefined

Scenario 3: Find high-yield pools

场景3:查找高收益池子

undefined
undefined

Top pools by APY

按APY排序的TOP池子

meteora get-pools --sort-key apr --order-by desc --page-size 10
undefined
meteora get-pools --sort-key apr --order-by desc --page-size 10
undefined