okx-dex-market by okx/onchainos-skills
npx skills add https://github.com/okx/onchainos-skills --skill okx-dex-market提供链上价格、K线、指数价格、钱包盈亏分析以及地址追踪活动等10个命令。
每次运行任何 onchainos 命令前,请务必按顺序执行以下步骤。不要向用户回显常规命令输出;仅在安装、更新或处理失败时提供简短的状态更新。
解析最新稳定版本:从 GitHub API 获取最新的稳定发布标签:
curl -sSL "https://api.github.com/repos/okx/onchainos-skills/releases/latest"
将 tag_name 字段(例如 v1.0.5)提取到 LATEST_TAG 中。如果 API 调用失败且 onchainos 已在本地安装,则跳过步骤 2-3 并继续运行命令(用户可能离线或受到速率限制;过时的二进制文件总比阻塞要好)。如果 onchainos 未安装,则停止并告知用户检查网络连接或从 https://github.com/okx/onchainos-skills 手动安装。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
onchainos,或者缓存文件 ~/.onchainos/last_check(Windows 上为 $env:USERPROFILE\.onchainos\last_check)超过 12 小时: * 从最新的发布标签下载安装程序及其校验和文件:
* **macOS/Linux**:`curl -sSL "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.sh" -o /tmp/onchainos-install.sh"` `curl -sSL "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -o /tmp/installer-checksums.txt`
* **Windows**:`Invoke-WebRequest -Uri "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.ps1" -OutFile "$env:TEMP\onchainos-install.ps1"` `Invoke-WebRequest -Uri "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -OutFile "$env:TEMP\installer-checksums.txt"`
* 根据 `installer-checksums.txt` 验证安装程序的 SHA256。如果不匹配,则**停止**并警告——安装程序可能已被篡改。
* 执行:`sh /tmp/onchainos-install.sh`(或在 Windows 上执行 `& "$env:TEMP\onchainos-install.ps1"`)。安装程序内部处理版本比较,仅在需要时下载二进制文件。
* 如果出现其他故障,请指引用户访问 <https://github.com/okx/onchainos-skills>。
3. 验证二进制文件完整性(每个会话一次):运行 onchainos --version 获取已安装版本(例如 1.0.5 或 2.0.0-beta.0)。将已安装的标签构造为 v<version>。下载已安装版本标签(不一定是 LATEST_TAG)对应的 checksums.txt:curl -sSL "https://github.com/okx/onchainos-skills/releases/download/v<version>/checksums.txt" -o /tmp/onchainos-checksums.txt 查找平台目标,并将已安装二进制文件的 SHA256 与校验和进行比较。如果不匹配,则重新安装(步骤 2)并重新验证。如果仍然不匹配,则停止并警告。
* 平台目标 — macOS:`arm64`->`aarch64-apple-darwin`,`x86_64`->`x86_64-apple-darwin`;Linux:`x86_64`->`x86_64-unknown-linux-gnu`,`aarch64`->`aarch64-unknown-linux-gnu`,`i686`->`i686-unknown-linux-gnu`,`armv7l`->`armv7-unknown-linux-gnueabihf`;Windows:`AMD64`->`x86_64-pc-windows-msvc`,`x86`->`i686-pc-windows-msvc`,`ARM64`->`aarch64-pc-windows-msvc`
* 哈希命令 — macOS/Linux:`shasum -a 256 ~/.local/bin/onchainos`;Windows:`(Get-FileHash "$env:USERPROFILE\.local\bin\onchainos.exe" -Algorithm SHA256).Hash.ToLower()`
4. 检查技能版本漂移(每个会话一次):如果 onchainos --version 比此技能的 metadata.version 新,则显示一次性通知,提示该技能可能已过时,并建议用户通过其平台的方法重新安装技能。不要阻塞操作。
命令失败时不要自动重新安装。 报告错误并建议运行 onchainos --version 或从 https://github.com/okx/onchainos-skills 手动重新安装。
速率限制错误。 如果命令遇到速率限制,共享的 API 密钥可能被限制。建议在 OKX 开发者门户 创建个人密钥。如果用户创建了 .env 文件,提醒他们将 .env 添加到 .gitignore。
okx-dex-tokenokx-dex-tokenokx-dex-tokenokx-dex-swapokx-onchain-gatewayokx-wallet-portfoliookx-dex-market 的投资组合命令(本技能)okx-dex-signalokx-dex-signal (onchainos leaderboard list)okx-dex-tokenokx-dex-trenches| 中文 | 英文 / 平台术语 | 映射到 |
|---|---|---|
| 行情 / 价格 / 多少钱 | market data, price, "how much is X" | price (默认), kline — 绝不使用index |
| 指数价格 / 综合价格 / 跨所价格 | index price, aggregate price, cross-exchange composite | index — 仅当用户明确请求时使用 |
| 盈亏 / 收益 / PnL | PnL, profit and loss, realized/unrealized | portfolio-overview, portfolio-recent-pnl, portfolio-token-pnl |
| 已实现盈亏 | realized PnL, realized profit | portfolio-token-pnl (realizedPnlUsd) |
| 未实现盈亏 | unrealized PnL, paper profit, holding gain | portfolio-token-pnl (unrealizedPnlUsd) |
| 胜率 | win rate, success rate | portfolio-overview (winRate) |
| 历史交易 / 交易记录 | DEX transaction history, trade log | portfolio-dex-history |
| 追踪地址交易 / 聪明钱最新交易 / KOL交易动态 / 追踪聪明钱 | address tracker activities, latest DEX transactions by smart money / KOL wallets / custom addresses, raw activity feed, what are KOL wallets buying (transaction-level) | address-tracker-activities |
| 清仓 | sold all, liquidated, sell off | portfolio-recent-pnl (unrealizedPnlUsd = "SELL_ALL") |
| 画像 / 钱包画像 / 持仓分析 | wallet profile, portfolio analysis | portfolio-overview |
| 近期收益 | recent PnL, latest earnings by token | portfolio-recent-pnl |
# 获取 XLayer 上 OKB 的实时价格
onchainos market price --address 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee --chain xlayer
# 获取小时 K 线
onchainos market kline --address 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee --chain xlayer --bar 1H --limit 24
# Solana USDC K 线
onchainos market kline --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --chain solana --bar 1H --limit 24
# 批量获取多个代币的价格
onchainos market prices --tokens "1:0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,501:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
# 获取钱包盈亏概览(7天)
onchainos market portfolio-overview --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain ethereum --time-frame 3
# 获取钱包 DEX 交易历史
onchainos market portfolio-dex-history --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain ethereum \
--begin 1700000000000 --end 1710000000000
# 获取按代币分类的近期盈亏
onchainos market portfolio-recent-pnl --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain ethereum
# 获取特定代币的盈亏快照
onchainos market portfolio-token-pnl --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain ethereum \
--token 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
CLI 接受人类可读的链名称(例如 ethereum、solana、xlayer)或数字链索引(例如 1、501、196)。
| 链 | 名称 | chainIndex |
|---|---|---|
| XLayer | xlayer | 196 |
| Solana | solana | 501 |
| Ethereum | ethereum | 1 |
| Base | base | 8453 |
| BSC | bsc | 56 |
| Arbitrum | arbitrum | 42161 |
---|---|---
1 | onchainos market price --address <address> | 获取单个代币价格
2 | onchainos market prices --tokens <tokens> | 批量价格查询
3 | onchainos market kline --address <address> | 获取 K 线 / 蜡烛图数据
---|---|---
4 | onchainos market index --address <address> | 获取指数价格(从多个来源聚合) — 仅当用户明确请求聚合/指数价格时使用;所有其他价格查询请使用price
---|---|---
5 | onchainos market portfolio-supported-chains | 获取盈亏端点支持的链
6 | onchainos market portfolio-overview | 获取钱包盈亏概览(已实现/未实现盈亏、胜率、前 3 代币)
7 | onchainos market portfolio-dex-history | 获取钱包的 DEX 交易历史(分页,最多 1000 条记录)
8 | onchainos market portfolio-recent-pnl | 获取钱包按代币分类的近期盈亏列表(分页,最多 1000 条记录)
9 | onchainos market portfolio-token-pnl | 获取钱包中特定代币的最新盈亏快照
---|---|---
10 | onchainos market address-tracker-activities --tracker-type <type> | 获取聪明钱、KOL 或自定义追踪地址的最新 DEX 交易
| 需求 | 使用本技能 (okx-dex-market) | 使用其他技能替代 |
|---|---|---|
| 实时价格(单一数值) | onchainos market price | - |
| 价格 + 市值 + 流动性 + 24 小时变化 | - | okx-dex-token → onchainos token price-info |
| K 线 / 蜡烛图 | onchainos market kline | - |
| 指数价格(多来源聚合) | onchainos market index | - |
| 按名称/符号搜索代币 | - | okx-dex-token → onchainos token search |
| 代币元数据(小数位、图标) | - | okx-dex-token → onchainos token info |
| 代币排名(趋势) | - | okx-dex-token → onchainos token trending |
| 持有者分布 | - | okx-dex-token → onchainos token holders |
| 按标签(KOL、巨鲸、聪明钱)筛选的持有者 | - | okx-dex-token → onchainos token holders --tag-filter |
| 代币的前 5 大流动性池 | - | okx-dex-token → onchainos token liquidity |
| 按趋势得分或 X 提及的热门代币 | - | okx-dex-token → onchainos token hot-tokens |
| 高级代币信息(风险、创建者、开发者统计) | - | okx-dex-token → onchainos token advanced-info |
| 顶级交易者 / 盈利地址 | - | okx-dex-token → onchainos token top-trader |
| 带标签/钱包筛选的交易历史 | - | okx-dex-token → onchainos token trades |
| 聚合的聪明钱 / 巨鲸 / KOL 买入信号提醒 | - | okx-dex-signal → onchainos signal list |
| 聪明钱 / KOL 地址的原始 DEX 交易流 | `onchainos market address-tracker-activities --tracker-type smart_money | kol` |
| 信号支持的链 | - | okx-dex-signal → onchainos signal chains |
| 排行榜 / 按盈亏、胜率、交易量排名的顶级交易者 | - | okx-dex-signal → onchainos leaderboard list |
| 排行榜支持的链 | - | okx-dex-signal → onchainos leaderboard supported-chains |
| 持有者集群集中度(跑路百分比、新地址百分比) | - | okx-dex-token → onchainos token cluster-overview |
| 前 10/50/100 持有者行为(平均盈亏、平均成本、趋势) | - | okx-dex-token → onchainos token cluster-top-holders |
| 持有者集群分组(前 300 名持有者及地址详情) | - | okx-dex-token → onchainos token cluster-list |
| 集群支持的链 | - | okx-dex-token → onchainos token cluster-supported-chains |
| 按阶段浏览 Meme 暴涨代币 | - | okx-dex-trenches → onchainos memepump tokens |
| Meme 代币审计(前10、开发者、内部人士) | - | okx-dex-trenches → onchainos memepump token-details |
| 开发者声誉 / 跑路历史 | - | okx-dex-trenches → onchainos memepump token-dev-info |
| 相同创建者的类似代币 | - | okx-dex-trenches → onchainos memepump similar-tokens |
| 捆绑/狙击检测 | - | okx-dex-trenches → onchainos memepump token-bundle-info |
| 跟风(同车)钱包分析 | - | okx-dex-trenches → onchainos memepump aped-wallet |
| 钱包盈亏概览(胜率、已实现盈亏、前几代币) | onchainos market portfolio-overview | - |
| 钱包 DEX 交易历史 | onchainos market portfolio-dex-history | - |
| 按代币分类的近期盈亏列表 | onchainos market portfolio-recent-pnl | - |
| 每个代币的最新盈亏(已实现/未实现) | onchainos market portfolio-token-pnl | - |
| 盈亏支持的链列表 | onchainos market portfolio-supported-chains | - |
| 平台聪明钱的最新交易 | onchainos market address-tracker-activities --tracker-type smart_money | - |
| 平台 KOL 地址的最新交易 | onchainos market address-tracker-activities --tracker-type kol | - |
| 自定义钱包地址的最新交易 | onchainos market address-tracker-activities --tracker-type multi_address --wallet-address <addrs> | - |
经验法则:okx-dex-market = 原始价格数据流、图表和钱包盈亏分析。使用 okx-dex-signal 进行信号追踪,okx-dex-trenches 进行 Meme 代币研究,okx-dex-token 进行代币发现和分析。
用户:"告诉我 BONK 的信息,显示图表,如果看起来不错就买入"
1. okx-dex-token onchainos token search --query BONK --chains solana → 获取 tokenContractAddress + chain
2. okx-dex-token onchainos token price-info --address <address> --chain solana → 市值、流动性、24 小时交易量
3. okx-dex-token onchainos token holders --address <address> --chain solana → 检查持有者分布
4. okx-dex-market onchainos market kline --address <address> --chain solana → K 线图用于视觉趋势判断
↓ 用户决定购买
5. okx-dex-swap onchainos swap quote --from ... --to ... --amount ... --chain solana
6. okx-dex-swap onchainos swap swap --from ... --to ... --amount ... --chain solana --wallet <addr>
数据传递:步骤 1 中的 tokenContractAddress 在步骤 2-6 中作为 <address> 重复使用。
1. okx-dex-token onchainos token trending --chains solana --sort-by 5 → 按交易量查找趋势代币
↓ 选择感兴趣的代币
2. okx-dex-market onchainos market price --address <address> --chain solana → 获取每个代币的当前价格
3. okx-dex-market onchainos market kline --address <address> --chain solana --bar 1H → 小时图
4. okx-dex-market onchainos market index --address <address> --chain solana → (可选)比较链上价格与聚合指数价格 — 仅当用户明确要求时
用户:"我的钱包在以太坊上表现如何?显示我的盈亏"
1. okx-dex-market onchainos market portfolio-supported-chains → 验证以太坊是否支持
2. okx-dex-market onchainos market portfolio-overview --address <wallet> --chain ethereum --time-frame 3
→ 7 天盈亏概览:已实现盈亏、胜率、前 3 代币
↓ 用户想要深入查看特定代币
3. okx-dex-market onchainos market portfolio-recent-pnl --address <wallet> --chain ethereum
→ 列出按代币分类的近期盈亏
↓ 用户选择一个代币
4. okx-dex-market onchainos market portfolio-token-pnl --address <wallet> --chain ethereum --token <address>
→ 该代币的最新已实现/未实现盈亏
5. okx-dex-token onchainos token price-info --address <address> --chain ethereum → 当前市场背景
数据传递:--address(钱包)在所有投资组合步骤中重复使用;步骤 3 中的 --token 传递到步骤 4。
用户:"显示我在以太坊上的近期 DEX 交易"
1. okx-dex-market onchainos market portfolio-dex-history --address <wallet> --chain ethereum
--begin <start_ms> --end <end_ms>
→ 分页的 DEX 交易列表(买入/卖出/转账)
↓ 按特定代币筛选
2. okx-dex-market onchainos market portfolio-dex-history --address <wallet> --chain ethereum
--begin <start_ms> --end <end_ms> --token <address> --tx-type 1,2
→ 一个代币的买入+卖出历史
↓ 检查该代币的盈亏
3. okx-dex-market onchainos market portfolio-token-pnl --address <wallet> --chain ethereum --token <address>
→ 已实现/未实现盈亏快照
注意:--begin 和 --end 是必需的 Unix 毫秒时间戳。对于"最近 30 天",计算:end = now * 1000, begin = (now - 2592000) * 1000。
onchainos market price(所有价格 / 行情查询的默认选择)onchainos market klineonchainos market pricesonchainos market index — 仅当用户明确要求"聚合价格"、"指数价格"、"综合价格"、"指数价格"或跨交易所综合价格时使用。不要用于一般的"价格" / "行情" / "X 多少钱"查询 — 请改用onchainos market price。onchainos market portfolio-overviewonchainos market portfolio-dex-historyonchainos market portfolio-recent-pnlonchainos market portfolio-token-pnlonchainos market portfolio-supported-chainsonchainos market address-tracker-activities--chain xlayer,低 gas 费,快速确认)作为默认值,然后询问用户偏好哪个链;对于投资组合盈亏查询,首先调用 onchainos market portfolio-supported-chains 以确认链是否支持okx-dex-token 的 onchainos token search 来解析ts → 时间,o → 开盘价,h → 最高价,l → 最低价,c → 收盘价,vol → 交易量,volUsd → 交易量(美元),confirm → 状态(0=未完成,1=已完成)。切勿向用户显示原始字段名如 o、h、l、c。| 刚刚调用 | 建议 |
|---|---|
market price | 1. 查看 K 线图 → onchainos market kline(本技能) 2. 深入分析(市值、流动性、24 小时交易量) → okx-dex-token 3. 购买/兑换此代币 → okx-dex-swap |
market kline | 1. 查看筛选后的交易历史 → onchainos token trades (okx-dex-token) 2. 根据图表买入/卖出 → okx-dex-swap |
market index | 1. 与链上 DEX 价格比较 → onchainos market price(本技能) 2. 查看完整价格图表 → onchainos market kline(本技能) |
market portfolio-supported-chains | 1. 获取盈亏概览 → onchainos market portfolio-overview(本技能) |
market portfolio-overview | 1. 深入查看交易历史 → onchainos market portfolio-dex-history(本技能) 2. 查看按代币分类的近期盈亏 → onchainos market portfolio-recent-pnl(本技能) 3. 买入/卖出盈亏最高的代币 → okx-dex-swap |
market portfolio-dex-history | 1. 检查特定交易代币的盈亏 → onchainos market portfolio-token-pnl(本技能) 2. 查看代币价格图表 → onchainos market kline(本技能) |
market portfolio-recent-pnl | 1. 获取特定代币的详细盈亏 → onchainos market portfolio-token-pnl(本技能) 2. 查看代币分析 → okx-dex-token |
market portfolio-token-pnl | 1. 查看此代币的完整交易历史 → onchainos market portfolio-dex-history(本技能) 2. 查看代币价格图表 → onchainos market kline(本技能) |
market address-tracker-activities | 1. 获取交易代币的价格 → onchainos market price(本技能) 2. 深入代币分析 → okx-dex-token 3. 买入/卖出聪明钱正在购买的代币 → okx-dex-swap |
以对话方式呈现,例如:"您想查看 K 线图,还是购买这个代币?" — 切勿向用户暴露技能名称或端点路径。
有关所有 10 个命令的详细参数表、返回字段架构和使用示例,请查阅:
references/cli-reference.md — 完整的 CLI 命令参考,包含参数、返回字段和示例要搜索特定命令的详细信息:grep -n "onchainos market <command>" references/cli-reference.md
某些服务受地理限制。当命令因错误代码 50125 或 80001 失败时,返回友好的消息,不要暴露原始错误代码:
| 服务 | 限制区域 | 封锁方法 |
|---|---|---|
| DEX | 英国 | API 密钥认证 |
| DeFi | 香港 | API 密钥认证 + 后端 |
| Wallet | 无 | 无 |
| Global | 受制裁国家 | 网关 (403) |
错误处理:当 CLI 返回错误 50125 或 80001 时,显示:
{service_name} 在您所在的区域不可用。请切换到受支持的区域后重试。
示例:
不要向用户暴露原始错误代码或内部错误消息。
onchainos token search 来解析11111111111111111111111111111111) 不适用于 market price 或 market kline。请改用 wSOL SPL 代币地址 (So11111111111111111111111111111111111111112)。注意:对于兑换操作,必须使用原生地址 — 参见 okx-dex-swap。onchainos market portfolio-supported-chains 验证portfolio-dex-history 需要 --begin 和 --end:两个时间戳(Unix 毫秒)都是必需的;如果用户说"最近 30 天",请在调用前计算它们portfolio-recent-pnl 的 unrealizedPnlUsd 返回 SELL_ALL:这意味着地址已卖出该代币的所有持仓portfolio-token-pnl 的 isPnlSupported = false:此代币/链组合不支持盈亏计算⚠️ 服务在您所在的区域不可用。请切换到受支持的区域后重试。1.5 ETH),绝不使用基础单位1.5 ETH ≈ $4,500)ethereum → 1,solana → 501)每周安装量
3.2K
代码库
GitHub 星标
173
首次出现
2026年2月28日
安全审计
已安装于
codex3.1K
opencode3.1K
cursor3.1K
github-copilot3.1K
gemini-cli3.1K
amp3.1K
10 commands for on-chain prices, candlesticks, index prices, wallet PnL analysis, and address tracker activities.
Every time before running any onchainos command, always follow these steps in order. Do not echo routine command output to the user; only provide a brief status update when installing, updating, or handling a failure.
Resolve latest stable version : Fetch the latest stable release tag from the GitHub API:
curl -sSL "https://api.github.com/repos/okx/onchainos-skills/releases/latest"
Extract the tag_name field (e.g., v1.0.5) into LATEST_TAG. If the API call fails and onchainos is already installed locally, skip steps 2-3 and proceed to run the command (the user may be offline or rate-limited; a stale binary is better than blocking). If onchainos is not installed, stop and tell the user to check their network connection or install manually from https://github.com/okx/onchainos-skills.
Install or update : If onchainos is not found, or if the cache at ~/.onchainos/last_check ($env:USERPROFILE\.onchainos\last_check on Windows) is older than 12 hours:
curl -sSL "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.sh" -o /tmp/onchainos-install.sh curl -sSL "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -o /tmp/installer-checksums.txtInvoke-WebRequest -Uri "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.ps1" -OutFile "$env:TEMP\onchainos-install.ps1" okx-dex-tokenokx-dex-tokenokx-dex-tokenokx-dex-swapokx-onchain-gatewayokx-wallet-portfoliookx-dex-market portfolio commands (this skill)okx-dex-signal| Chinese | English / Platform Terms | Maps To |
|---|---|---|
| 行情 / 价格 / 多少钱 | market data, price, "how much is X" | price (default), kline — neverindex |
| 指数价格 / 综合价格 / 跨所价格 | index price, aggregate price, cross-exchange composite | index — only when user explicitly requests it |
| 盈亏 / 收益 / PnL | PnL, profit and loss, realized/unrealized | portfolio-overview, portfolio-recent-pnl, |
# Get real-time price of OKB on XLayer
onchainos market price --address 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee --chain xlayer
# Get hourly candles
onchainos market kline --address 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee --chain xlayer --bar 1H --limit 24
# Solana USDC candles
onchainos market kline --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --chain solana --bar 1H --limit 24
# Get batch prices for multiple tokens
onchainos market prices --tokens "1:0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,501:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
# Get wallet PnL overview (7D)
onchainos market portfolio-overview --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain ethereum --time-frame 3
# Get wallet DEX transaction history
onchainos market portfolio-dex-history --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain ethereum \
--begin 1700000000000 --end 1710000000000
# Get recent PnL by token
onchainos market portfolio-recent-pnl --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain ethereum
# Get per-token PnL snapshot
onchainos market portfolio-token-pnl --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain ethereum \
--token 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
The CLI accepts human-readable chain names (e.g., ethereum, solana, xlayer) or numeric chain indices (e.g., 1, 501, 196).
| Chain | Name | chainIndex |
|---|---|---|
| XLayer | xlayer | 196 |
| Solana | solana | 501 |
| Ethereum | ethereum | 1 |
| Base | base |
---|---|---
1 | onchainos market price --address <address> | Get single token price
2 | onchainos market prices --tokens <tokens> | Batch price query
3 | onchainos market kline --address <address> | Get K-line / candlestick data
---|---|---
4 | onchainos market index --address <address> | Get index price (aggregated from multiple sources) — use only when user explicitly requests aggregate/index price; useprice for all other price queries
---|---|---
5 | onchainos market portfolio-supported-chains | Get chains supported by portfolio PnL endpoints
6 | onchainos market portfolio-overview | Get wallet PnL overview (realized/unrealized PnL, win rate, Top 3 tokens)
7 | onchainos market portfolio-dex-history | Get DEX transaction history for a wallet (paginated, up to 1000 records)
8 | onchainos market portfolio-recent-pnl | Get recent PnL list by token for a wallet (paginated, up to 1000 records)
9 | onchainos market portfolio-token-pnl | Get latest PnL snapshot for a specific token in a wallet
---|---|---
10 | onchainos market address-tracker-activities --tracker-type <type> | Get latest DEX trades for smart money, KOL, or custom tracked addresses
| Need | Use this skill (okx-dex-market) | Use other skill instead |
|---|---|---|
| Real-time price (single value) | onchainos market price | - |
| Price + market cap + liquidity + 24h change | - | okx-dex-token → onchainos token price-info |
| K-line / candlestick chart | onchainos market kline | - |
| Index price (multi-source aggregate) | onchainos market index |
Rule of thumb : okx-dex-market = raw price feeds, charts, and wallet PnL analysis. Use okx-dex-signal for signal tracking, okx-dex-trenches for meme token research, okx-dex-token for token discovery & analytics.
User: "Tell me about BONK, show me the chart, then buy if it looks good"
1. okx-dex-token onchainos token search --query BONK --chains solana → get tokenContractAddress + chain
2. okx-dex-token onchainos token price-info --address <address> --chain solana → market cap, liquidity, 24h volume
3. okx-dex-token onchainos token holders --address <address> --chain solana → check holder distribution
4. okx-dex-market onchainos market kline --address <address> --chain solana → K-line chart for visual trend
↓ user decides to buy
5. okx-dex-swap onchainos swap quote --from ... --to ... --amount ... --chain solana
6. okx-dex-swap onchainos swap swap --from ... --to ... --amount ... --chain solana --wallet <addr>
Data handoff : tokenContractAddress from step 1 is reused as <address> in steps 2-6.
1. okx-dex-token onchainos token trending --chains solana --sort-by 5 → find trending tokens by volume
↓ select tokens of interest
2. okx-dex-market onchainos market price --address <address> --chain solana → get current price for each
3. okx-dex-market onchainos market kline --address <address> --chain solana --bar 1H → hourly chart
4. okx-dex-market onchainos market index --address <address> --chain solana → (optional) compare on-chain vs aggregate index price — only if user explicitly asks for it
User: "How is my wallet performing on Ethereum? Show me my PnL"
1. okx-dex-market onchainos market portfolio-supported-chains → verify Ethereum is supported
2. okx-dex-market onchainos market portfolio-overview --address <wallet> --chain ethereum --time-frame 3
→ 7D PnL overview: realized PnL, win rate, top 3 tokens
↓ user wants to drill into a specific token
3. okx-dex-market onchainos market portfolio-recent-pnl --address <wallet> --chain ethereum
→ list recent PnL by token
↓ user picks a token
4. okx-dex-market onchainos market portfolio-token-pnl --address <wallet> --chain ethereum --token <address>
→ latest realized/unrealized PnL for that token
5. okx-dex-token onchainos token price-info --address <address> --chain ethereum → current market context
Data handoff : --address (wallet) is reused across all portfolio steps; --token from step 3 feeds into step 4.
User: "Show me my recent DEX trades on Ethereum"
1. okx-dex-market onchainos market portfolio-dex-history --address <wallet> --chain ethereum
--begin <start_ms> --end <end_ms>
→ paginated DEX tx list (buy/sell/transfer)
↓ filter by specific token
2. okx-dex-market onchainos market portfolio-dex-history --address <wallet> --chain ethereum
--begin <start_ms> --end <end_ms> --token <address> --tx-type 1,2
→ buy+sell history for one token
↓ check PnL for that token
3. okx-dex-market onchainos market portfolio-token-pnl --address <wallet> --chain ethereum --token <address>
→ realized/unrealized PnL snapshot
Note : --begin and --end are required Unix millisecond timestamps. For "last 30 days", compute: end = now * 1000, begin = (now - 2592000) * 1000.
onchainos market price (default for all price / 行情 queries)onchainos market klineonchainos market pricesonchainos market index — ONLY when the user explicitly asks for "aggregate price", "index price", "综合价格", "指数价格", or a cross-exchange composite price. Do NOT use for general "price" / "行情" / "how much is X" queries — useonchainos market price instead.onchainos market portfolio-overviewonchainos market portfolio-dex-historyonchainos market portfolio-recent-pnl--chain xlayer, low gas, fast confirmation) as the default, then ask which chain the user prefers; for portfolio PnL queries, first call onchainos market portfolio-supported-chains to confirm the chain is supportedokx-dex-token onchainos token search first to resolvets → Time, o → Open, h → High, l → Low, c → Close, vol → Volume, volUsd → Volume (USD), confirm → Status (0=incomplete, 1=completed). Never show raw field names like o, h, , to users.| Just called | Suggest |
|---|---|
market price | 1. View K-line chart → onchainos market kline (this skill) 2. Deeper analytics (market cap, liquidity, 24h volume) → okx-dex-token 3. Buy/swap this token → okx-dex-swap |
market kline | 1. Check filtered trade history → onchainos token trades (okx-dex-token) 2. Buy/swap based on the chart → okx-dex-swap |
market index |
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.
For detailed parameter tables, return field schemas, and usage examples for all 10 commands, consult:
references/cli-reference.md — Full CLI command reference with params, return fields, and examplesTo search for specific command details: grep -n "onchainos market <command>" references/cli-reference.md
Some services are geo-restricted. When a command fails with error code 50125 or 80001, return a friendly message without exposing the raw error code:
| Service | Restricted Regions | Blocking Method |
|---|---|---|
| DEX | United Kingdom | API key auth |
| DeFi | Hong Kong | API key auth + backend |
| Wallet | None | None |
| Global | Sanctioned countries | Gateway (403) |
Error handling : When the CLI returns error 50125 or 80001, display:
{service_name} is not available in your region. Please switch to a supported region and try again.
Examples:
Do not expose raw error codes or internal error messages to the user.
onchainos token search to resolve11111111111111111111111111111111) does not work for market price or market kline. Use the wSOL SPL token address (So11111111111111111111111111111111111111112) instead. Note: for swap operations, the native address must be used — see okx-dex-swap.onchainos market portfolio-supported-chains first1.5 ETH), never base units1.5 ETH ≈ $4,500)ethereum → 1, solana → 501)Weekly Installs
3.2K
Repository
GitHub Stars
173
First Seen
Feb 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex3.1K
opencode3.1K
cursor3.1K
github-copilot3.1K
gemini-cli3.1K
amp3.1K
38,500 周安装
Invoke-WebRequest -Uri "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -OutFile "$env:TEMP\installer-checksums.txt"installer-checksums.txt. On mismatch, stop and warn — the installer may have been tampered with.sh /tmp/onchainos-install.sh (or & "$env:TEMP\onchainos-install.ps1" on Windows). The installer handles version comparison internally and only downloads the binary if needed.Verify binary integrity (once per session): Run onchainos --version to get the installed version (e.g., 1.0.5 or 2.0.0-beta.0). Construct the installed tag as v<version>. Download checksums.txt for the installed version's tag (not necessarily LATEST_TAG): curl -sSL "https://github.com/okx/onchainos-skills/releases/download/v<version>/checksums.txt" -o /tmp/onchainos-checksums.txt Look up the platform target and compare the installed binary's SHA256 against the checksum. On mismatch, reinstall (step 2) and re-verify. If still mismatched, stop and warn.
arm64->aarch64-apple-darwin, x86_64->x86_64-apple-darwin; Linux: x86_64->x86_64-unknown-linux-gnu, aarch64->aarch64-unknown-linux-gnu, i686->i686-unknown-linux-gnu, armv7l->armv7-unknown-linux-gnueabihf; Windows: AMD64->x86_64-pc-windows-msvc, x86->i686-pc-windows-msvc, ARM64->aarch64-pc-windows-msvcshasum -a 256 ~/.local/bin/onchainos; Windows: (Get-FileHash "$env:USERPROFILE\.local\bin\onchainos.exe" -Algorithm SHA256).Hash.ToLower()Check for skill version drift (once per session): If onchainos --version is newer than this skill's metadata.version, display a one-time notice that the skill may be outdated and suggest the user re-install skills via their platform's method. Do not block.
Do NOT auto-reinstall on command failures. Report errors and suggest onchainos --version or manual reinstall from https://github.com/okx/onchainos-skills.
Rate limit errors. If a command hits rate limits, the shared API key may be throttled. Suggest creating a personal key at the OKX Developer Portal. If the user creates a .env file, remind them to add .env to .gitignore.
okx-dex-signalonchainos leaderboard listokx-dex-tokenokx-dex-trenchesportfolio-token-pnl| 已实现盈亏 | realized PnL, realized profit | portfolio-token-pnl (realizedPnlUsd) |
| 未实现盈亏 | unrealized PnL, paper profit, holding gain | portfolio-token-pnl (unrealizedPnlUsd) |
| 胜率 | win rate, success rate | portfolio-overview (winRate) |
| 历史交易 / 交易记录 | DEX transaction history, trade log | portfolio-dex-history |
| 追踪地址交易 / 聪明钱最新交易 / KOL交易动态 / 追踪聪明钱 | address tracker activities, latest DEX transactions by smart money / KOL wallets / custom addresses, raw activity feed, what are KOL wallets buying (transaction-level) | address-tracker-activities |
| 清仓 | sold all, liquidated, sell off | portfolio-recent-pnl (unrealizedPnlUsd = "SELL_ALL") |
| 画像 / 钱包画像 / 持仓分析 | wallet profile, portfolio analysis | portfolio-overview |
| 近期收益 | recent PnL, latest earnings by token | portfolio-recent-pnl |
8453 |
| BSC | bsc | 56 |
| Arbitrum | arbitrum | 42161 |
| - |
| Token search by name/symbol | - | okx-dex-token → onchainos token search |
| Token metadata (decimals, logo) | - | okx-dex-token → onchainos token info |
| Token ranking (trending) | - | okx-dex-token → onchainos token trending |
| Holder distribution | - | okx-dex-token → onchainos token holders |
| Holders filtered by tag (KOL, whale, smart money) | - | okx-dex-token → onchainos token holders --tag-filter |
| Top 5 liquidity pools for a token | - | okx-dex-token → onchainos token liquidity |
| Hot tokens by trending score or X mentions | - | okx-dex-token → onchainos token hot-tokens |
| Advanced token info (risk, creator, dev stats) | - | okx-dex-token → onchainos token advanced-info |
| Top traders / profit addresses | - | okx-dex-token → onchainos token top-trader |
| Trade history with tag/wallet filter | - | okx-dex-token → onchainos token trades |
| Aggregated smart money / whale / KOL buy signal alerts | - | okx-dex-signal → onchainos signal list |
| Raw DEX transaction feed for smart money / KOL addresses | `onchainos market address-tracker-activities --tracker-type smart_money | kol` |
| Signal-supported chains | - | okx-dex-signal → onchainos signal chains |
| Leaderboard / top traders by PnL, win rate, volume | - | okx-dex-signal → onchainos leaderboard list |
| Leaderboard-supported chains | - | okx-dex-signal → onchainos leaderboard supported-chains |
| Holder cluster concentration (rug pull %, new address %) | - | okx-dex-token → onchainos token cluster-overview |
| Top 10/50/100 holder behavior (avg PnL, avg cost, trend) | - | okx-dex-token → onchainos token cluster-top-holders |
| Holder cluster groups (top 300 holders with address details) | - | okx-dex-token → onchainos token cluster-list |
| Cluster-supported chains | - | okx-dex-token → onchainos token cluster-supported-chains |
| Browse meme pump tokens by stage | - | okx-dex-trenches → onchainos memepump tokens |
| Meme token audit (top10, dev, insiders) | - | okx-dex-trenches → onchainos memepump token-details |
| Developer reputation / rug pull history | - | okx-dex-trenches → onchainos memepump token-dev-info |
| Similar tokens by same creator | - | okx-dex-trenches → onchainos memepump similar-tokens |
| Bundle/sniper detection | - | okx-dex-trenches → onchainos memepump token-bundle-info |
| Aped (same-car) wallet analysis | - | okx-dex-trenches → onchainos memepump aped-wallet |
| Wallet PnL overview (win rate, realized PnL, top tokens) | onchainos market portfolio-overview | - |
| Wallet DEX transaction history | onchainos market portfolio-dex-history | - |
| Recent PnL list by token | onchainos market portfolio-recent-pnl | - |
| Per-token latest PnL (realized/unrealized) | onchainos market portfolio-token-pnl | - |
| PnL-supported chain list | onchainos market portfolio-supported-chains | - |
| Latest trades by platform smart money | onchainos market address-tracker-activities --tracker-type smart_money | - |
| Latest trades by platform KOL addresses | onchainos market address-tracker-activities --tracker-type kol | - |
| Latest trades for custom wallet addresses | onchainos market address-tracker-activities --tracker-type multi_address --wallet-address <addrs> | - |
onchainos market portfolio-token-pnlonchainos market portfolio-supported-chainsonchainos market address-tracker-activitieslc1. Compare with on-chain DEX price → onchainos market price (this skill) 2. View full price chart → onchainos market kline (this skill) |
market portfolio-supported-chains | 1. Get PnL overview → onchainos market portfolio-overview (this skill) |
market portfolio-overview | 1. Drill into trade history → onchainos market portfolio-dex-history (this skill) 2. Check recent PnL by token → onchainos market portfolio-recent-pnl (this skill) 3. Buy/sell a top-PnL token → okx-dex-swap |
market portfolio-dex-history | 1. Check PnL for a specific traded token → onchainos market portfolio-token-pnl (this skill) 2. View token price chart → onchainos market kline (this skill) |
market portfolio-recent-pnl | 1. Get detailed PnL for a specific token → onchainos market portfolio-token-pnl (this skill) 2. View token analytics → okx-dex-token |
market portfolio-token-pnl | 1. View full trade history for this token → onchainos market portfolio-dex-history (this skill) 2. View token price chart → onchainos market kline (this skill) |
market address-tracker-activities | 1. Get token price for a traded token → onchainos market price (this skill) 2. Deeper token analytics → okx-dex-token 3. Buy/swap a token that smart money is buying → okx-dex-swap |
portfolio-dex-history requires --begin and --end: both timestamps (Unix milliseconds) are mandatory; if the user says "last 30 days" compute them before callingportfolio-recent-pnl unrealizedPnlUsd returns SELL_ALL: this means the address has sold all its holdings of that tokenportfolio-token-pnl isPnlSupported = false: PnL calculation is not supported for this token/chain combination⚠️ Service is not available in your region. Please switch to a supported region and try again.