okx-dex-market
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOKX DEX Market Data API
OKX DEX 市场数据API
7 endpoints for on-chain prices, trades, candlesticks, and index prices.
Base URL:
https://web3.okx.comBase path: and
/api/v6/dex/market/api/v6/dex/indexAuth: HMAC-SHA256 signature, 4 headers required (, , , )
OK-ACCESS-KEYOK-ACCESS-SIGNOK-ACCESS-PASSPHRASEOK-ACCESS-TIMESTAMP提供7个端点,用于获取链上价格、交易记录、K线数据和指数价格。
Base URL:
https://web3.okx.comBase path: 和
/api/v6/dex/market/api/v6/dex/index身份验证: 采用HMAC-SHA256签名,需要4个请求头(、、、)
OK-ACCESS-KEYOK-ACCESS-SIGNOK-ACCESS-PASSPHRASEOK-ACCESS-TIMESTAMPAuthentication & Credentials
身份验证与凭证
API Key Application: OKX Developer Portal
Setup Guide: Developer Portal Docs
Read credentials from environment variables:
- → API key
OKX_API_KEY - → Secret key (system-generated)
OKX_SECRET_KEY - → Passphrase (developer-supplied)
OKX_PASSPHRASE
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/candles?chainIndex=1&tokenContractAddress=0x...")
// POST → body = JSON string of request body, requestPath is path only (e.g., "/api/v6/dex/market/price")
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: . = means success.
{ "code": "0", "data": [...], "msg": "" }code"0"API密钥申请: OKX开发者门户
设置指南: 开发者门户文档
从环境变量中读取凭证:
- → API密钥
OKX_API_KEY - → 密钥(系统生成)
OKX_SECRET_KEY - → 密码短语(开发者自定义)
OKX_PASSPHRASE
绝对不要将上述凭证输出到日志、响应内容或任何用户可见的界面中。
typescript
import crypto from 'crypto';
const BASE = 'https://web3.okx.com';
// 签名规则:
// GET → body = "", requestPath包含查询字符串(例如:"/api/v6/dex/market/candles?chainIndex=1&tokenContractAddress=0x...")
// POST → body = 请求体的JSON字符串,requestPath仅为路径(例如:"/api/v6/dex/market/price")
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
// Get real-time price (POST — body is JSON array)
const prices = await okxFetch('POST', '/api/v6/dex/market/price', [
{ chainIndex: '1', tokenContractAddress: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' },
]);
// → prices[].price (USD string)
// Get hourly candles (GET)
const candles = await okxFetch('GET', '/api/v6/dex/market/candles?' + new URLSearchParams({
chainIndex: '1', tokenContractAddress: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
bar: '1H', limit: '24',
}));
// → candles[]: [ts, open, high, low, close, vol, volUsd, confirm]
// Solana SOL — candles and trades endpoints require the wSOL SPL token address,
// while /market/price accepts both wSOL and the system program address.
const solCandles = await okxFetch('GET', '/api/v6/dex/market/candles?' + new URLSearchParams({
chainIndex: '501', tokenContractAddress: 'So11111111111111111111111111111111111111112',
bar: '1H', limit: '24',
}));typescript
// 获取实时价格(POST — 请求体为JSON数组)
const prices = await okxFetch('POST', '/api/v6/dex/market/price', [
{ chainIndex: '1', tokenContractAddress: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' },
]);
// → prices[].price(USD字符串)
// 获取小时级K线数据(GET)
const candles = await okxFetch('GET', '/api/v6/dex/market/candles?' + new URLSearchParams({
chainIndex: '1', tokenContractAddress: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
bar: '1H', limit: '24',
}));
// → candles[]: [ts, open, high, low, close, vol, volUsd, confirm]
// Solana SOL — K线和交易记录端点需要wSOL SPL代币地址,
// 而/market/price同时支持wSOL和系统程序地址。
const solCandles = await okxFetch('GET', '/api/v6/dex/market/candles?' + new URLSearchParams({
chainIndex: '501', tokenContractAddress: 'So11111111111111111111111111111111111111112',
bar: '1H', limit: '24',
}));Common Chain IDs
常用链ID
| Chain | chainIndex | Chain | chainIndex |
|---|---|---|---|
| Ethereum | | Arbitrum | |
| BSC | | Base | |
| Polygon | | Solana | |
| 区块链 | chainIndex | 区块链 | chainIndex |
|---|---|---|---|
| Ethereum | | Arbitrum | |
| BSC | | Base | |
| Polygon | | Solana | |
Endpoint Index
端点索引
Market Price API
市场价格API
| # | Method | Path | Docs |
|---|---|---|---|
| 1 | GET | | market-price-chains |
| 2 | POST | | market-price |
| 3 | GET | | market-trades |
| 4 | GET | | market-candlesticks |
| 5 | GET | | market-candlesticks-history |
Error Codes: Market Price Error Codes
| 序号 | 请求方法 | 路径 | 文档 |
|---|---|---|---|
| 1 | GET | | market-price-chains |
| 2 | POST | | market-price |
| 3 | GET | | market-trades |
| 4 | GET | | market-candlesticks |
| 5 | GET | | market-candlesticks-history |
错误码: 市场价格API错误码
Index Price API
指数价格API
| # | Method | Path | Docs |
|---|---|---|---|
| 6 | POST | | current-price |
| 7 | GET | | historical-price |
Error Codes: Index Price Error Codes
| 序号 | 请求方法 | 路径 | 文档 |
|---|---|---|---|
| 6 | POST | | current-price |
| 7 | GET | | historical-price |
错误码: 指数价格API错误码
Boundary: market vs token skill
Market与Token Skill的边界
| Need | Use this skill ( | Use |
|---|---|---|
| Real-time price (single value) | | - |
| Price + market cap + liquidity + 24h change | - | |
| K-line / candlestick chart | | - |
| Trade history (buy/sell log) | | - |
| Index price (multi-source aggregate) | | - |
| Token search by name/symbol | - | |
| Token metadata (decimals, logo) | - | |
| Token ranking (trending) | - | |
| Holder distribution | - | |
Rule of thumb: = raw price feeds & charts. = token discovery & enriched analytics.
okx-dex-marketokx-dex-token| 需求 | 使用本Skill ( | 改用 |
|---|---|---|
| 实时价格(单一数值) | | - |
| 价格+市值+流动性+24小时涨跌幅 | - | |
| K线/蜡烛图 | | - |
| 交易历史(买卖记录) | | - |
| 指数价格(多源聚合) | | - |
| 通过名称/符号搜索代币 | - | |
| 代币元数据(小数位数、Logo) | - | |
| 代币排名(热门) | - | |
| 持有者分布 | - | |
经验法则: = 原始价格数据与图表。 = 代币发现与增强分析。
okx-dex-marketokx-dex-tokenCross-Skill Workflows
跨Skill工作流
Workflow A: Research Token Before Buying
工作流A:购买前研究代币
User: "Tell me about BONK, show me the chart, then buy if it looks good"
1. okx-dex-token /market/token/search?search=BONK → get tokenContractAddress + chainIndex
2. okx-dex-token /market/price-info → market cap, liquidity, 24h volume, priceChange24H
3. okx-dex-token /market/token/holder → check holder distribution
4. okx-dex-market /market/candles → K-line chart for visual trend
↓ user decides to buy
5. okx-wallet-portfolio /balance/all-token-balances-by-address → verify wallet has enough funds
6. okx-dex-swap /aggregator/quote → /aggregator/swap → executeData handoff: + from step 1 are reused in steps 2-6.
tokenContractAddresschainIndex用户:“告诉我BONK的情况,展示它的K线图,如果看起来不错就买入”
1. okx-dex-token /market/token/search?search=BONK → 获取tokenContractAddress + chainIndex
2. okx-dex-token /market/price-info → 市值、流动性、24小时交易量、24小时涨跌幅
3. okx-dex-token /market/token/holder → 查看持有者分布
4. okx-dex-market /market/candles → K线图用于趋势可视化
↓ 用户决定买入
5. okx-wallet-portfolio /balance/all-token-balances-by-address → 验证钱包资金是否充足
6. okx-dex-swap /aggregator/quote → /aggregator/swap → 执行交易数据传递: 步骤1中的 + 会在步骤2-6中复用。
tokenContractAddresschainIndexWorkflow B: Price Monitoring / Alerts
工作流B:价格监控/提醒
1. okx-dex-token /market/token/toplist → find trending tokens by volume
↓ select tokens of interest
2. okx-dex-market /market/price → get current price for each
3. okx-dex-market /market/candles?bar=1H → hourly chart
4. okx-dex-market /index/current-price → compare on-chain vs index price1. okx-dex-token /market/token/toplist → 按交易量查找热门代币
↓ 选择感兴趣的代币
2. okx-dex-market /market/price → 获取每个代币的当前价格
3. okx-dex-market /market/candles?bar=1H → 小时级K线图
4. okx-dex-market /index/current-price → 对比链上价格与指数价格Workflow C: Historical Analysis
工作流C:历史分析
1. okx-dex-market /market/historical-candles?bar=1D → daily candles for long-term view
2. okx-dex-market /index/historical-price?period=1d → historical index price comparison1. okx-dex-market /market/historical-candles?bar=1D → 日线K线图用于长期趋势查看
2. okx-dex-market /index/historical-price?period=1d → 历史指数价格对比Operation Flow
操作流程
Step 1: Identify Intent
步骤1:识别用户意图
- Real-time price (single token) ->
POST /market/price - Trade history ->
GET /market/trades - K-line chart (recent) ->
GET /market/candles - K-line chart (historical) ->
GET /market/historical-candles - Supported chains for market price ->
GET /market/supported/chain - Index price (current) ->
POST /index/current-price - Index price (historical) ->
GET /index/historical-price
- 实时价格(单一代币)->
POST /market/price - 交易历史 ->
GET /market/trades - K线图(近期)->
GET /market/candles - K线图(历史)->
GET /market/historical-candles - 市场价格支持的链 ->
GET /market/supported/chain - 指数价格(当前)->
POST /index/current-price - 指数价格(历史)->
GET /index/historical-price
Step 2: Collect Parameters
步骤2:收集参数
- Missing -> ask which chain
chainIndex - Missing token address -> use
okx-dex-tokenfirst to resolve/market/token/search - K-line requests -> confirm bar size and time range with user
- 缺少-> 询问用户具体链
chainIndex - 缺少代币地址 -> 先使用的
okx-dex-token解析/market/token/search - K线请求 -> 与用户确认时间周期和时间范围
Step 3: Call and Display
步骤3:调用并展示结果
- Call directly, return formatted results
- Use appropriate precision: 2 decimals for high-value tokens, significant digits for low-value
- Show USD value alongside
- 直接调用API,返回格式化结果
- 使用合适的精度:高价值代币保留2位小数,低价值代币保留有效数字
- 同时显示USD价值
Step 4: Suggest Next Steps
步骤4:建议后续操作
After displaying results, suggest 2-3 relevant follow-up actions based on the endpoint just called:
| Just called | Suggest |
|---|---|
| 1. View K-line chart → |
| 1. Check recent trades → |
| 1. View price chart for context → |
| 1. Compare with on-chain DEX price → |
Present conversationally, e.g.: "Would you like to see the K-line chart, or buy this token?" — never expose skill names or endpoint paths to the user.
展示结果后,根据刚刚调用的端点,建议2-3个相关的后续操作:
| 刚刚调用的端点 | 建议操作 |
|---|---|
| 1. 查看K线图 → |
| 1. 查看近期交易记录 → |
| 1. 查看价格图表获取趋势背景 → |
| 1. 与链上DEX价格对比 → |
用对话式语言呈现,例如:“您想要查看K线图,还是买入该代币?” — 绝对不要向用户暴露Skill名称或端点路径。
API Reference
API参考
1. GET /market/supported/chain
1. GET /market/supported/chain
| Param | Type | Required | Description |
|---|---|---|---|
| String | No | Filter to a specific chain (e.g., |
Response:
| Field | Type | Description |
|---|---|---|
| String | Chain name (e.g., "Ethereum") |
| String | Chain logo URL |
| String | Chain symbol (e.g., "ETH") |
| String | Chain unique identifier (e.g., "1") |
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| String | 否 | 过滤特定链(例如: |
响应:
| 字段 | 类型 | 说明 |
|---|---|---|
| String | 链名称(例如:"Ethereum") |
| String | 链Logo链接 |
| String | 链符号(例如:"ETH") |
| String | 链唯一标识(例如:"1") |
2. POST /market/price
2. POST /market/price
Request body is a JSON array of objects.
| Param | Type | Required | Description |
|---|---|---|---|
| String | Yes | Chain ID (e.g., |
| String | Yes | Token address (all lowercase for EVM) |
Response:
| Field | Type | Description |
|---|---|---|
| String | Chain ID |
| String | Token address |
| String | Unix timestamp in milliseconds |
| String | Latest token price in USD |
json
{
"code": "0",
"data": [{ "chainIndex": "1", "tokenContractAddress": "0x...", "time": "1716892020000", "price": "26.458" }],
"msg": ""
}请求体为JSON数组。
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| String | 是 | 链ID(例如: |
| String | 是 | 代币地址(EVM链需全小写) |
响应:
| 字段 | 类型 | 说明 |
|---|---|---|
| String | 链ID |
| String | 代币地址 |
| String | 毫秒级Unix时间戳 |
| String | 代币最新USD价格 |
json
{
"code": "0",
"data": [{ "chainIndex": "1", "tokenContractAddress": "0x...", "time": "1716892020000", "price": "26.458" }],
"msg": ""
}3. GET /market/trades
3. GET /market/trades
| Param | Type | Required | Description |
|---|---|---|---|
| String | Yes | Chain ID |
| String | Yes | Token address (all lowercase for EVM) |
Optional params: (pagination id), (max 500, default 100).
afterlimitResponse key fields: , , , (/), , (USD), , , , , (each has , ), , . Full fields: see docs.
idchainIndextokenContractAddresstypebuysellpricevolumetimedexNametxHashUrluserAddresschangedTokenInfo[]amounttokenSymbolpoolLogoUrlisFiltered| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| String | 是 | 链ID |
| String | 是 | 代币地址(EVM链需全小写) |
可选参数: (分页ID)、(最大500,默认100)。
afterlimit响应核心字段: , , , (/), , (USD), , , , , (包含, ), , 。完整字段请查看文档。
idchainIndextokenContractAddresstypebuysellpricevolumetimedexNametxHashUrluserAddresschangedTokenInfo[]amounttokenSymbolpoolLogoUrlisFiltered4. GET /market/candles
4. GET /market/candles
| Param | Type | Required | Description |
|---|---|---|---|
| String | Yes | Chain ID |
| String | Yes | Token address (all lowercase for EVM) |
Optional params: (default ; values: , , , , , , , , , , , , , , ; UTC variants: , , , , , ), , , (max 299, default 100).
bar1m1s1m3m5m15m30m1H2H4H6H12H1D1W1M3M6Hutc12Hutc1Dutc1Wutc1Mutc3MutcafterbeforelimitResponse: Each element in is an array (positional fields):
data| Position | Field | Description |
|---|---|---|
| 0 | | Opening time, Unix ms |
| 1 | | Open price |
| 2 | | High price |
| 3 | | Low price |
| 4 | | Close price |
| 5 | | Volume (base currency) |
| 6 | | Volume (USD) |
| 7 | | |
json
{ "code": "0", "data": [["1597026383085","3.721","3.743","3.677","3.708","22698348","226348","1"]], "msg": "" }| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| String | 是 | 链ID |
| String | 是 | 代币地址(EVM链需全小写) |
可选参数: (默认;可选值:, , , , , , , , , , , , , , ;UTC变体:, , , , , ), , , (最大299,默认100)。
bar1m1s1m3m5m15m30m1H2H4H6H12H1D1W1M3M6Hutc12Hutc1Dutc1Wutc1Mutc3Mutcafterbeforelimit响应: 中的每个元素为数组(按位置对应字段):
data| 位置 | 字段 | 说明 |
|---|---|---|
| 0 | | K线开盘时间,毫秒级Unix时间戳 |
| 1 | | 开盘价 |
| 2 | | 最高价 |
| 3 | | 最低价 |
| 4 | | 收盘价 |
| 5 | | 交易量(基础货币) |
| 6 | | 交易量(USD) |
| 7 | | |
json
{ "code": "0", "data": [["1597026383085","3.721","3.743","3.677","3.708","22698348","226348","1"]], "msg": "" }5. GET /market/historical-candles
5. GET /market/historical-candles
Same parameters and response schema as endpoint #4 (). Use this for older historical data.
/market/candles参数和响应结构与端点#4()相同。用于获取较旧的历史数据。
/market/candles6. POST /index/current-price
6. POST /index/current-price
Request body is a JSON array. Max 100 tokens per request.
| Param | Type | Required | Description |
|---|---|---|---|
| String | Yes | Chain ID |
| String | Yes | Token address ( |
Response:
| Field | Type | Description |
|---|---|---|
| String | Chain ID |
| String | Token address |
| String | Index price (aggregated from multiple sources) |
| String | Unix timestamp in milliseconds |
请求体为JSON数组。每次请求最多支持100个代币。
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| String | 是 | 链ID |
| String | 是 | 代币地址(原生代币填 |
响应:
| 字段 | 类型 | 说明 |
|---|---|---|
| String | 链ID |
| String | 代币地址 |
| String | 指数价格(多源聚合) |
| String | 毫秒级Unix时间戳 |
7. GET /index/historical-price
7. GET /index/historical-price
| Param | Type | Required | Description |
|---|---|---|---|
| String | Yes | Chain ID |
| String | No | Token address ( |
Optional params: (, , , , default), (max 200, default 50), , / (Unix ms).
period1m5m30m1h1dlimitcursorbeginendResponse:
| Field | Type | Description |
|---|---|---|
| String | Pagination cursor |
| String | Timestamp (whole minute) |
| String | Price (18 decimal precision) |
json
{
"code": "0",
"data": [{ "cursor": "31", "prices": [{ "time": "1700040600000", "price": "1994.430000000000000000" }] }],
"msg": "success"
}| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| String | 是 | 链ID |
| String | 否 | 代币地址(原生代币填 |
可选参数: (, , , , 默认), (最大200,默认50), , /(毫秒级Unix时间戳)。
period1m5m30m1h1dlimitcursorbeginend响应:
| 字段 | 类型 | 说明 |
|---|---|---|
| String | 分页游标 |
| String | 时间戳(整分钟) |
| String | 价格(18位小数精度) |
json
{
"code": "0",
"data": [{ "cursor": "31", "prices": [{ "time": "1700040600000", "price": "1994.430000000000000000" }] }],
"msg": "success"
}Input / Output Examples
输入/输出示例
User says: "Check the current price of ETH on Ethereum"
POST /api/v6/dex/market/price
Body: [{ "chainIndex": "1", "tokenContractAddress": "0xeeee...eeee" }]
-> Display: ETH current price $X,XXX.XXUser says: "Show me hourly candles for USDC"
GET /api/v6/dex/market/candles?chainIndex=1&tokenContractAddress=0xa0b8...&bar=1H
-> Display candlestick data (open/high/low/close/volume)用户提问: "查询以太坊上ETH的当前价格"
POST /api/v6/dex/market/price
请求体: [{ "chainIndex": "1", "tokenContractAddress": "0xeeee...eeee" }]
-> 展示: ETH当前价格 $X,XXX.XX用户提问: "展示USDC的小时级K线图"
GET /api/v6/dex/market/candles?chainIndex=1&tokenContractAddress=0xa0b8...&bar=1H
-> 展示K线数据(开盘价/最高价/最低价/收盘价/交易量)Edge Cases
边缘情况
- Invalid token address: returns empty data or error — prompt user to verify, or use to resolve
okx-dex-token /market/token/search - Unsupported chain: call first to confirm
/market/supported/chain - No candle data: may be a new token or low liquidity — inform user
- 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 → candles), add 300-500ms delay between requests to avoid triggering rate limit (error code ).
50011 - Network error: retry once, then prompt user to try again later
- Request timeout: all API calls must set a 10-second timeout limit
- 无效代币地址: 返回空数据或错误 — 提示用户验证,或使用解析
okx-dex-token /market/token/search - 不支持的链: 先调用确认
/market/supported/chain - 无K线数据: 可能是新代币或流动性低 — 告知用户
- 429请求超限: 带抖动的指数退避。查看请求限制与费用文档了解不同等级的RPS限制(试用版: 1 RPS, 初创版: 2-50 RPS, 企业版: 自定义)。
- 跨Skill流水线请求超限: 跨多个Skill链式调用时(例如:代币搜索→K线图),在请求之间添加300-500ms延迟,避免触发请求限制(错误码)。
50011 - 网络错误: 重试一次,然后提示用户稍后再试
- 请求超时: 所有API调用必须设置10秒超时限制
Amount Display Rules
金额显示规则
- Always display in UI units (), never base units
1.5 ETH - Show USD value alongside ()
1.5 ETH ≈ $4,500 - Prices are strings — handle precision carefully
- 始终以UI单位显示(),绝不显示基础单位
1.5 ETH - 同时显示USD价值()
1.5 ETH ≈ $4,500 - 价格为字符串 — 需谨慎处理精度
Global Notes
全局注意事项
- EVM contract addresses must be all lowercase
- is a string
chainIndex - POST endpoints (,
/market/price) use JSON body/index/current-price - GET endpoints use query params
- For token search / metadata / rankings / holder analysis -> use
okx-dex-token - For balance queries -> use
okx-wallet-portfolio - For swap execution -> use
okx-dex-swap - For transaction broadcasting -> use
okx-onchain-gateway
- EVM合约地址必须全小写
- 是字符串类型
chainIndex - POST端点(,
/market/price)使用JSON请求体/index/current-price - GET端点使用查询参数
- 代币搜索/元数据/排名/持有者分析 -> 使用
okx-dex-token - 余额查询 -> 使用
okx-wallet-portfolio - 兑换交易执行 -> 使用
okx-dex-swap - 交易广播 -> 使用
okx-onchain-gateway