okx-dex-token

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OKX DEX Token Info API

OKX DEX Token Info API

5 endpoints for token search, metadata, detailed pricing, rankings, and holder distribution.
Base URL:
https://web3.okx.com
Base path:
/api/v6/dex/market
Auth: HMAC-SHA256 signature, 4 headers required (
OK-ACCESS-KEY
,
OK-ACCESS-SIGN
,
OK-ACCESS-PASSPHRASE
,
OK-ACCESS-TIMESTAMP
)
提供5个端点,用于代币搜索、元数据查询、详细定价、排名及持有者分布查询。
基础URL
https://web3.okx.com
基础路径
/api/v6/dex/market
认证方式:HMAC-SHA256签名,需携带4个请求头(
OK-ACCESS-KEY
OK-ACCESS-SIGN
OK-ACCESS-PASSPHRASE
OK-ACCESS-TIMESTAMP

Authentication & Credentials

认证与凭证

API Key Application: OKX Developer Portal
Read credentials from environment variables:
  • OKX_API_KEY
    → API key
  • OKX_SECRET_KEY
    → Secret key (system-generated)
  • OKX_PASSPHRASE
    → Passphrase (developer-supplied)
Never output the above credentials to logs, response content, or any user-visible interface.
typescript
import crypto from 'crypto';

const BASE = 'https://web3.okx.com';

// Signature rule:
//   GET  → body = "", requestPath includes query string (e.g., "/api/v6/dex/market/token/search?chains=1&search=PEPE")
//   POST → body = JSON string of request body, requestPath is path only (e.g., "/api/v6/dex/market/price-info")
async function okxFetch(method: 'GET' | 'POST', path: string, body?: object) {
  const timestamp = new Date().toISOString();
  const bodyStr = body ? JSON.stringify(body) : '';
  const sign = crypto
    .createHmac('sha256', process.env.OKX_SECRET_KEY!)
    .update(timestamp + method + path + bodyStr)
    .digest('base64');
  const headers: Record<string, string> = {
    'OK-ACCESS-KEY': process.env.OKX_API_KEY!,
    'OK-ACCESS-SIGN': sign,
    'OK-ACCESS-PASSPHRASE': process.env.OKX_PASSPHRASE!,
    'OK-ACCESS-TIMESTAMP': timestamp,
    'Content-Type': 'application/json',
  };
  const res = await fetch(`${BASE}${path}`, {
    method,
    headers,
    ...(body && { body: bodyStr }),
  });
  if (res.status === 429) throw { code: 'RATE_LIMITED', msg: 'Rate limited — retry with backoff', retryable: true };
  if (res.status >= 500) throw { code: `HTTP_${res.status}`, msg: 'Server error', retryable: true };
  const json = await res.json();
  if (json.code !== '0') throw { code: json.code, msg: json.msg || 'API error', retryable: false };
  return json.data;
}
Response envelope:
{ "code": "0", "data": [...], "msg": "" }
.
code
=
"0"
means success.
API密钥申请OKX开发者门户
设置指南开发者门户文档
从环境变量中读取凭证:
  • OKX_API_KEY
    → API密钥
  • OKX_SECRET_KEY
    → 密钥(系统生成)
  • OKX_PASSPHRASE
    → 密码短语(开发者自定义)
绝对不要将上述凭证输出到日志、响应内容或任何用户可见的界面中。
typescript
import crypto from 'crypto';

const BASE = 'https://web3.okx.com';

// 签名规则:
//   GET 请求 → body 为空字符串,requestPath 包含查询参数(例如:"/api/v6/dex/market/token/search?chains=1&search=PEPE")
//   POST 请求 → body 为请求体的JSON字符串,requestPath 仅包含路径(例如:"/api/v6/dex/market/price-info")
async function okxFetch(method: 'GET' | 'POST', path: string, body?: object) {
  const timestamp = new Date().toISOString();
  const bodyStr = body ? JSON.stringify(body) : '';
  const sign = crypto
    .createHmac('sha256', process.env.OKX_SECRET_KEY!)
    .update(timestamp + method + path + bodyStr)
    .digest('base64');
  const headers: Record<string, string> = {
    'OK-ACCESS-KEY': process.env.OKX_API_KEY!,
    'OK-ACCESS-SIGN': sign,
    'OK-ACCESS-PASSPHRASE': process.env.OKX_PASSPHRASE!,
    'OK-ACCESS-TIMESTAMP': timestamp,
    'Content-Type': 'application/json',
  };
  const res = await fetch(`${BASE}${path}`, {
    method,
    headers,
    ...(body && { body: bodyStr }),
  });
  if (res.status === 429) throw { code: 'RATE_LIMITED', msg: '请求频率超限 — 请延迟后重试', retryable: true };
  if (res.status >= 500) throw { code: `HTTP_${res.status}`, msg: '服务器错误', retryable: true };
  const json = await res.json();
  if (json.code !== '0') throw { code: json.code, msg: json.msg || 'API错误', retryable: false };
  return json.data;
}
响应格式:
{ "code": "0", "data": [...], "msg": "" }
code
=
"0"
表示请求成功。

Developer Quickstart

开发者快速入门

typescript
// Search token (GET)
const tokens = await okxFetch('GET', '/api/v6/dex/market/token/search?' + new URLSearchParams({
  chains: '1,501', search: 'PEPE',
}));
// → tokens[].tokenContractAddress, price, communityRecognized

// Get detailed price info (POST — body is JSON array)
const path = '/api/v6/dex/market/price-info';
const prices = await okxFetch('POST', path, [
  { chainIndex: '1', tokenContractAddress: '0x6982508145454ce325ddbe47a25d4ec3d2311933' },
]);
// → prices[].price, marketCap, liquidity, volume24H, priceChange24H
typescript
// 搜索代币(GET请求)
const tokens = await okxFetch('GET', '/api/v6/dex/market/token/search?' + new URLSearchParams({
  chains: '1,501', search: 'PEPE',
}));
// → tokens[].tokenContractAddress, price, communityRecognized

// 获取详细价格信息(POST请求 — 请求体为JSON数组)
const path = '/api/v6/dex/market/price-info';
const prices = await okxFetch('POST', path, [
  { chainIndex: '1', tokenContractAddress: '0x6982508145454ce325ddbe47a25d4ec3d2311933' },
]);
// → prices[].price, marketCap, liquidity, volume24H, priceChange24H

Common Chain IDs

常用链ID

ChainchainIndexChainchainIndex
Ethereum
1
Arbitrum
42161
BSC
56
Base
8453
Polygon
137
Solana
501
链名称chainIndex链名称chainIndex
Ethereum
1
Arbitrum
42161
BSC
56
Base
8453
Polygon
137
Solana
501

Endpoint Index

端点索引

#MethodPathDocs
1GET
/api/v6/dex/market/token/search
market-token-search
2POST
/api/v6/dex/market/token/basic-info
market-token-basic-info
3POST
/api/v6/dex/market/price-info
market-token-price-info
4GET
/api/v6/dex/market/token/toplist
market-token-ranking
5GET
/api/v6/dex/market/token/holder
market-token-holder
Error Codes: Token Error Codes
序号请求方法路径文档
1GET
/api/v6/dex/market/token/search
market-token-search
2POST
/api/v6/dex/market/token/basic-info
market-token-basic-info
3POST
/api/v6/dex/market/price-info
market-token-price-info
4GET
/api/v6/dex/market/token/toplist
market-token-ranking
5GET
/api/v6/dex/market/token/holder
market-token-holder
错误码参考:Token错误码

Boundary: token vs market skill

技能边界:代币信息与市场数据技能

NeedUse this skill (
okx-dex-token
)
Use
okx-dex-market
instead
Search token by name/symbol
GET /market/token/search
-
Token metadata (decimals, logo)
POST /market/token/basic-info
-
Price + market cap + liquidity + multi-timeframe change
POST /market/price-info
-
Token ranking (trending)
GET /market/token/toplist
-
Holder distribution
GET /market/token/holder
-
Raw real-time price (single value)-
POST /market/price
K-line / candlestick chart-
GET /market/candles
Trade history (buy/sell log)-
GET /market/trades
Index price (multi-source aggregate)-
POST /index/current-price
Rule of thumb:
okx-dex-token
= token discovery & enriched analytics.
okx-dex-market
= raw price feeds & charts.
需求使用本技能(
okx-dex-token
改用
okx-dex-market
按名称/符号搜索代币
GET /market/token/search
-
代币元数据(小数位数、Logo)
POST /market/token/basic-info
-
价格 + 市值 + 流动性 + 多时间段涨跌幅
POST /market/price-info
-
代币排名(热门)
GET /market/token/toplist
-
持有者分布
GET /market/token/holder
-
实时 raw 价格(单一数值)-
POST /market/price
K线/蜡烛图-
GET /market/candles
交易历史(买卖记录)-
GET /market/trades
指数价格(多源聚合)-
POST /index/current-price
经验法则
okx-dex-token
= 代币发现与深度分析。
okx-dex-market
= 原始价格数据与图表。

Cross-Skill Workflows

跨技能工作流

This skill is the typical entry point — users often start by searching/discovering tokens, then proceed to check balance and swap.
本技能通常是入口技能 — 用户通常先搜索/发现代币,然后再进行余额查询和兑换操作。

Workflow A: Search → Research → Buy

工作流A:搜索 → 研究 → 购买

User: "Find BONK token, analyze it, then buy some"
1. okx-dex-token   /market/token/search?search=BONK&chains=501             → get tokenContractAddress, chainIndex, price, communityRecognized
       ↓ tokenContractAddress + chainIndex
2. okx-dex-token   /market/price-info                                       → market cap, liquidity, volume24H, priceChange24H, holders
3. okx-dex-token   /market/token/holder                                     → top 20 holders distribution
4. okx-dex-market  /market/candles?bar=1H                                   → hourly price chart
       ↓ user decides to buy
5. okx-wallet-portfolio /balance/all-token-balances-by-address                   → verify wallet has enough SOL
6. okx-dex-swap    /aggregator/quote → /aggregator/swap-instruction → execute
Data handoff:
  • tokenContractAddress
    from step 1 → reused in all subsequent steps
  • chainIndex
    from step 1 → reused in all subsequent steps
  • decimal
    from step 1 or
    /market/token/basic-info
    → needed for minimal unit conversion in swap
用户:“找到BONK代币,分析它,然后买一些”
1. okx-dex-token   /market/token/search?search=BONK&chains=501             → 获取tokenContractAddress、chainIndex、价格、communityRecognized
       ↓ tokenContractAddress + chainIndex
2. okx-dex-token   /market/price-info                                       → 市值、流动性、24小时交易量、24小时涨跌幅、持有者数量
3. okx-dex-token   /market/token/holder                                     → 前20名持有者分布
4. okx-dex-market  /market/candles?bar=1H                                   → 小时级价格图表
       ↓ 用户决定购买
5. okx-wallet-portfolio /balance/all-token-balances-by-address                   → 验证钱包中有足够的SOL
6. okx-dex-swap    /aggregator/quote → /aggregator/swap-instruction → 执行兑换
数据传递
  • 步骤1的
    tokenContractAddress
    → 后续所有步骤复用
  • 步骤1的
    chainIndex
    → 后续所有步骤复用
  • 步骤1或
    /market/token/basic-info
    中的
    decimal
    → 兑换时需要用于最小单位转换

Workflow B: Discover Trending → Investigate → Trade

工作流B:发现热门代币 → 调研 → 交易

User: "What's trending on Solana?"
1. okx-dex-token   /market/token/toplist?chains=501&sortBy=5&timeFrame=4               → top tokens by 24h volume
       ↓ user picks a token
2. okx-dex-token   /market/price-info                                                   → detailed analytics
3. okx-dex-token   /market/token/holder                                                 → check if whale-dominated
4. okx-dex-market  /market/candles                                                      → K-line for visual trend
       ↓ user decides to trade
5. okx-dex-swap    → execute
用户:“Solana上当前热门的代币有哪些?”
1. okx-dex-token   /market/token/toplist?chains=501&sortBy=5&timeFrame=4               → 按24小时交易量排序的顶级代币
       ↓ 用户选择某个代币
2. okx-dex-token   /market/price-info                                                   → 详细分析数据
3. okx-dex-token   /market/token/holder                                                 → 检查是否由巨鲸主导
4. okx-dex-market  /market/candles                                                      → K线图查看趋势
       ↓ 用户决定交易
5. okx-dex-swap    → 执行交易

Workflow C: Token Verification Before Swap

工作流C:兑换前的代币验证

Before swapping an unknown token, always verify:
1. okx-dex-token   /market/token/search                                     → find token
2. Check communityRecognized:
   - true → proceed with normal caution
   - false → warn user about risk
3. okx-dex-token   /market/price-info → check liquidity:
   - liquidity < $10K → warn about high slippage risk
   - liquidity < $1K → strongly discourage trade
4. okx-dex-swap    /aggregator/quote → check isHoneyPot and taxRate
5. If all checks pass → proceed to swap
在兑换未知代币前,务必进行以下验证:
1. okx-dex-token   /market/token/search                                     → 查找代币
2. 检查communityRecognized:
   - true → 正常谨慎操作
   - false → 警告用户存在风险
3. okx-dex-token   /market/price-info → 检查流动性:
   - 流动性 < 1万美元 → 警告滑点风险高
   - 流动性 < 1千美元 → 强烈不建议交易
4. okx-dex-swap    /aggregator/quote → 检查isHoneyPot和taxRate
5. 所有检查通过 → 执行兑换

Operation Flow

操作流程

Step 1: Identify Intent

步骤1:识别用户意图

  • Search for a token ->
    GET /market/token/search
  • Get token metadata ->
    POST /market/token/basic-info
  • Get price + market cap + liquidity ->
    POST /market/price-info
  • View rankings ->
    GET /market/token/toplist
  • View holder distribution ->
    GET /market/token/holder
  • 搜索代币 →
    GET /market/token/search
  • 获取代币元数据 →
    POST /market/token/basic-info
  • 获取价格 + 市值 + 流动性 →
    POST /market/price-info
  • 查看排名 →
    GET /market/token/toplist
  • 查看持有者分布 →
    GET /market/token/holder

Step 2: Collect Parameters

步骤2:收集参数

  • Missing
    chainIndex
    -> ask which chain
  • Only have token name, no address -> use
    /market/token/search
    first
  • Batch query -> use
    /market/token/basic-info
    or
    /market/price-info
    with JSON array body
  • 缺少
    chainIndex
    → 询问用户具体链
  • 仅有代币名称,无地址 → 先调用
    /market/token/search
  • 批量查询 → 使用
    /market/token/basic-info
    /market/price-info
    ,请求体为JSON数组

Step 3: Call and Display

步骤3:调用接口并展示结果

  • Search results: show name, symbol, chain, price, 24h change
  • Indicate
    communityRecognized
    status for trust signaling
  • Price info: show market cap, liquidity, and volume together
  • 搜索结果:展示名称、符号、链、价格、24小时涨跌幅
  • 标注
    communityRecognized
    状态以提示可信度
  • 价格信息:同时展示市值、流动性和交易量

Step 4: Suggest Next Steps

步骤4:建议后续操作

After displaying results, suggest 2-3 relevant follow-up actions based on the endpoint just called:
Just calledSuggest
/market/token/search
1. View detailed analytics (market cap, liquidity) →
/market/price-info
(this skill) 2. View price chart →
okx-dex-market
3. Buy/swap this token →
okx-dex-swap
/market/token/basic-info
1. View price and market data →
/market/price-info
(this skill) 2. Check holder distribution →
/market/token/holder
(this skill)
/market/price-info
1. View K-line chart →
okx-dex-market
2. Check holder distribution →
/market/token/holder
(this skill) 3. Buy/swap this token →
okx-dex-swap
/market/token/toplist
1. View details for a specific token →
/market/price-info
(this skill) 2. View price chart →
okx-dex-market
3. Buy a trending token →
okx-dex-swap
/market/token/holder
1. View price trend →
okx-dex-market
2. Check your own balance →
okx-wallet-portfolio
3. Buy/swap this token →
okx-dex-swap
Present conversationally, e.g.: "Would you like to see the price chart or check the holder distribution?" — never expose skill names or endpoint paths to the user.
展示结果后,根据刚调用的端点,建议2-3个相关的后续操作:
刚调用的端点建议操作
/market/token/search
1. 查看详细分析数据(市值、流动性)→
/market/price-info
(本技能) 2. 查看价格图表 →
okx-dex-market
3. 购买/兑换该代币 →
okx-dex-swap
/market/token/basic-info
1. 查看价格和市场数据 →
/market/price-info
(本技能) 2. 检查持有者分布 →
/market/token/holder
(本技能)
/market/price-info
1. 查看K线图表 →
okx-dex-market
2. 检查持有者分布 →
/market/token/holder
(本技能) 3. 购买/兑换该代币 →
okx-dex-swap
/market/token/toplist
1. 查看特定代币的详细信息 →
/market/price-info
(本技能) 2. 查看价格图表 →
okx-dex-market
3. 购买热门代币 →
okx-dex-swap
/market/token/holder
1. 查看价格趋势 →
okx-dex-market
2. 检查自己的钱包余额 →
okx-wallet-portfolio
3. 购买/兑换该代币 →
okx-dex-swap
需以对话式的方式呈现,例如:“你想查看价格图表还是检查持有者分布?” — 绝对不要向用户暴露技能名称或端点路径。

API Reference

API参考

1. GET /market/token/search

1. GET /market/token/search

ParamTypeRequiredDescription
chains
StringYesChain IDs, comma-separated (e.g.,
"1,501"
)
search
StringYesKeyword: token name, symbol, or contract address
Response key fields:
tokenContractAddress
,
tokenSymbol
,
tokenName
,
tokenLogoUrl
,
chainIndex
,
decimal
,
price
,
change
(24h %),
marketCap
,
liquidity
,
holders
,
explorerUrl
,
tagList.communityRecognized
(true = Top 10 CEX listed or community verified). Full fields: see docs.
参数类型必填说明
chains
字符串链ID,逗号分隔(例如:
"1,501"
search
字符串关键词:代币名称、符号或合约地址
响应核心字段
tokenContractAddress
tokenSymbol
tokenName
tokenLogoUrl
chainIndex
decimal
price
change
(24小时涨跌幅 %)、
marketCap
liquidity
holders
explorerUrl
tagList.communityRecognized
(true = 已上线Top 10中心化交易所或经社区验证)。完整字段:查看文档

2. POST /market/token/basic-info

2. POST /market/token/basic-info

Request body is a JSON array. Supports batch queries.
ParamTypeRequiredDescription
chainIndex
StringYesChain ID
tokenContractAddress
StringYesToken address
Response key fields:
tokenName
,
tokenSymbol
,
tokenLogoUrl
,
decimal
,
tokenContractAddress
,
tagList.communityRecognized
. Full fields: see docs.
json
{
  "code": "0",
  "data": [{ "chainIndex": "501", "decimal": "6", "tokenName": "michi", "tokenSymbol": "$michi",
    "tokenContractAddress": "5mbK36SZ...", "tagList": { "communityRecognized": true } }],
  "msg": ""
}
请求体为JSON数组,支持批量查询
参数类型必填说明
chainIndex
字符串链ID
tokenContractAddress
字符串代币合约地址
响应核心字段
tokenName
tokenSymbol
tokenLogoUrl
decimal
tokenContractAddress
tagList.communityRecognized
。完整字段:查看文档
json
{
  "code": "0",
  "data": [{ "chainIndex": "501", "decimal": "6", "tokenName": "michi", "tokenSymbol": "$michi",
    "tokenContractAddress": "5mbK36SZ...", "tagList": { "communityRecognized": true } }],
  "msg": ""
}

3. POST /market/price-info

3. POST /market/price-info

Request body is a JSON array. Supports batch queries.
ParamTypeRequiredDescription
chainIndex
StringYesChain ID
tokenContractAddress
StringYesToken address
Response key fields:
price
,
time
(Unix ms),
marketCap
,
liquidity
,
circSupply
,
holders
,
tradeNum
(24h trade count); price changes by timeframe —
priceChange5M
/
1H
/
4H
/
24H
; volumes —
volume5M
/
1H
/
4H
/
24H
; transactions —
txs5M
/
1H
/
4H
/
24H
; 24h range —
maxPrice
/
minPrice
. Full fields: see docs.
请求体为JSON数组,支持批量查询
参数类型必填说明
chainIndex
字符串链ID
tokenContractAddress
字符串代币合约地址
响应核心字段
price
time
(Unix时间戳,毫秒)、
marketCap
liquidity
circSupply
holders
tradeNum
(24小时交易次数);多时间段涨跌幅 —
priceChange5M
/
1H
/
4H
/
24H
;交易量 —
volume5M
/
1H
/
4H
/
24H
;交易笔数 —
txs5M
/
1H
/
4H
/
24H
;24小时价格区间 —
maxPrice
/
minPrice
。完整字段:查看文档

4. GET /market/token/toplist

4. GET /market/token/toplist

ParamTypeRequiredDescription
chains
StringYesChain IDs, comma-separated
sortBy
StringYesSort:
2
=price change,
5
=volume,
6
=market cap
timeFrame
StringYesWindow:
1
=5min,
2
=1h,
3
=4h,
4
=24h
Response key fields:
tokenSymbol
,
tokenContractAddress
,
tokenLogoUrl
,
chainIndex
,
price
,
change
(%),
volume
,
marketCap
,
liquidity
,
holders
,
uniqueTraders
,
txsBuy
/
txsSell
/
txs
,
firstTradeTime
. Full fields: see docs.
参数类型必填说明
chains
字符串链ID,逗号分隔
sortBy
字符串排序方式:
2
=价格涨跌幅,
5
=交易量,
6
=市值
timeFrame
字符串统计窗口:
1
=5分钟,
2
=1小时,
3
=4小时,
4
=24小时
响应核心字段
tokenSymbol
tokenContractAddress
tokenLogoUrl
chainIndex
price
change
(%)、
volume
marketCap
liquidity
holders
uniqueTraders
txsBuy
/
txsSell
/
txs
firstTradeTime
。完整字段:查看文档

5. GET /market/token/holder

5. GET /market/token/holder

ParamTypeRequiredDescription
chainIndex
StringYesChain ID
tokenContractAddress
StringYesToken address
Response: Returns top 20 holders.
FieldTypeDescription
data[].holdAmount
StringToken amount held
data[].holderWalletAddress
StringHolder wallet address
参数类型必填说明
chainIndex
字符串链ID
tokenContractAddress
字符串代币合约地址
响应:返回前20名持有者信息。
字段类型说明
data[].holdAmount
字符串持有代币数量
data[].holderWalletAddress
字符串持有者钱包地址

Input / Output Examples

输入/输出示例

User says: "Search for PEPE token"
GET /api/v6/dex/market/token/search?chains=1&search=PEPE
-> Display:
  PEPE (0x6982...) - Ethereum
  Price: $0.0000XX | 24h: +X% | Market Cap: $X.XB | Liquidity: $XXM
  Community Recognized: Yes
User says: "Get info on these three tokens at once"
POST /api/v6/dex/market/token/basic-info
Body: [
  { "chainIndex": "1", "tokenContractAddress": "0xaaa..." },
  { "chainIndex": "1", "tokenContractAddress": "0xbbb..." },
  { "chainIndex": "56", "tokenContractAddress": "0xccc..." }
]
-> Returns name, symbol, decimals, community status for each
User says: "What's trending on Solana by volume?"
GET /api/v6/dex/market/token/toplist?chains=501&sortBy=5&timeFrame=4
-> Display top tokens sorted by 24h volume:
  #1 SOL  - Vol: $1.2B | Change: +3.5% | MC: $80B
  #2 BONK - Vol: $450M | Change: +12.8% | MC: $1.5B
  ...
用户说: “搜索PEPE代币”
GET /api/v6/dex/market/token/search?chains=1&search=PEPE
-> 展示:
  PEPE (0x6982...) - Ethereum
  价格:$0.0000XX | 24小时:+X% | 市值:$X.XB | 流动性:$XXM
  社区认证:是
用户说: “一次性获取这三个代币的信息”
POST /api/v6/dex/market/token/basic-info
请求体:[
  { "chainIndex": "1", "tokenContractAddress": "0xaaa..." },
  { "chainIndex": "1", "tokenContractAddress": "0xbbb..." },
  { "chainIndex": "56", "tokenContractAddress": "0xccc..." }
]
-> 返回每个代币的名称、符号、小数位数、社区认证状态
用户说: “Solana上按交易量排名的热门代币有哪些?”
GET /api/v6/dex/market/token/toplist?chains=501&sortBy=5&timeFrame=4
-> 展示按24小时交易量排序的顶级代币:
  #1 SOL  - 交易量:$12亿 | 涨跌幅:+3.5% | 市值:$800亿
  #2 BONK - 交易量:$4.5亿 | 涨跌幅:+12.8% | 市值:$15亿
  ...

Edge Cases

边缘情况

  • Token not found: suggest verifying the contract address (symbols can collide)
  • Same symbol on multiple chains: show all matches with chain names
  • Unverified token:
    communityRecognized = false
    — warn user about risk
  • Too many results: name/symbol search caps at 100 — suggest using exact contract address
  • 429 rate limit: exponential backoff with jitter. See Rate Limit & Fee Docs for tier-specific RPS limits (Trial: 1 RPS, Start-up: 2-50 RPS, Enterprise: custom).
  • Cross-skill pipeline rate limit: when chaining calls across multiple skills (e.g., token search → price-info → balance), add 300-500ms delay between requests to avoid triggering rate limit (error code
    50011
    ).
  • Network error: retry once
  • Request timeout: all API calls must set a 10-second timeout limit
  • 代币未找到:建议用户验证合约地址(符号可能重复)
  • 同一符号存在于多条链:展示所有匹配结果,并标注链名称
  • 未验证代币
    communityRecognized = false
    — 警告用户存在风险
  • 结果过多:名称/符号搜索最多返回100条结果 — 建议使用精确合约地址
  • 429请求频率超限:使用指数退避策略重试。查看请求频率限制与费用文档获取不同层级的RPS限制(试用版:1 RPS,初创版:2-50 RPS,企业版:自定义)。
  • 跨技能流水线请求频率超限:跨多个技能链式调用时(例如:代币搜索 → 价格信息 → 余额查询),在请求之间添加300-500毫秒的延迟,避免触发限制(错误码
    50011
    )。
  • 网络错误:重试一次
  • 请求超时:所有API调用必须设置10秒的超时限制

Amount Display Rules

数值展示规则

  • Use appropriate precision: 2 decimals for high-value, significant digits for low-value
  • Market cap / liquidity in shorthand ($1.2B, $45M)
  • 24h change with sign and color hint (+X% / -X%)
  • 使用合适的精度:高价值代币保留2位小数,低价值代币保留有效数字
  • 市值/流动性使用简写格式($1.2B、$45M)
  • 24小时涨跌幅显示正负号和颜色提示(+X% / -X%)

Global Notes

全局注意事项

  • Use contract address as primary identity — symbols can collide across tokens
  • communityRecognized = true
    means listed on Top 10 CEX or community verified
  • POST endpoints (
    /basic-info
    ,
    /price-info
    ) use JSON body
  • /basic-info
    and
    /price-info
    both support batch queries (JSON array)
  • EVM addresses must be all lowercase
  • For raw real-time prices / K-lines / trade history -> use
    okx-dex-market
  • For balance queries -> use
    okx-wallet-portfolio
  • For swap execution -> use
    okx-dex-swap
  • 使用合约地址作为唯一标识 — 符号可能在不同代币中重复
  • communityRecognized = true
    表示已上线Top 10中心化交易所或经社区验证
  • POST端点(
    /basic-info
    /price-info
    )使用JSON请求体
  • /basic-info
    /price-info
    均支持批量查询(JSON数组)
  • EVM地址必须为全小写
  • 若需获取原始实时价格 / K线 / 交易历史 → 使用
    okx-dex-market
  • 若需查询余额 → 使用
    okx-wallet-portfolio
  • 若需执行兑换 → 使用
    okx-dex-swap