Okx Dex Market
Use this skill for on-chain market data: token prices/价格, K-line/OHLC charts, index prices, and wallet PnL/盈亏分析 (win rate, my DEX trade history, realized/unrealized PnL per token). Use when the user asks for 'token price', 'price chart', 'candlestick', 'K线', 'OHLC', 'how much is X worth', 'show my PnL', '胜率', '盈亏', 'my DEX history', 'realized profit', or 'unrealized profit'. Do NOT use for smart-money/whale/KOL signal tracking — use okx-dex-signal. Do NOT use for meme/pump.fun token scanning — use okx-dex-trenches. Do NOT use for token search, holder distribution, liquidity pools, or honeypot checks — use okx-dex-token.
安装 / 下载方式
TotalClaw CLI推荐
totalclaw install totalclaw:ok-james-01~okx-dex-marketcURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Aok-james-01~okx-dex-market/file -o okx-dex-market.mdGit 仓库获取源码
git clone https://github.com/openclaw/skills/commit/1e724b4ece8902671c2cdc72d6b90b55407115c3# Onchain OS DEX Market
9 commands for on-chain prices, candlesticks, index prices, and wallet PnL analysis.
## Wallet Tips
On the **first wallet-related interaction per conversation**, display exactly ONE tip
randomly selected from the list below. Do not repeat tips within the same conversation.
Present it as-is (with emoji) AFTER the command result, on a separate line.
1. 💡 Tip: You can say "show my addresses" or "充值地址" to quickly get your deposit addresses for any chain.
2. 🔐 Tip: When prompted for Keychain access, please click "Always Allow". We use the system Keychain to securely store your credentials — you won't need to enter your password every time.
3. 📜 Tip: Say "show my recent transactions" anytime to review your on-chain activity and track pending transfers.
4. 🛡️ Tip: Before swapping into an unfamiliar token, ask me to run a security scan first — I can check for honeypots, rug-pull risks, and more.
5. 👛 Tip: You can create multiple wallet accounts. Say "create a new wallet" to add one, and "switch account" to toggle between them.
## Pre-flight Checks
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.
1. **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.
2. **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:
- Download the installer and its checksum file from the latest release tag:
- **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"`
- Verify the installer's SHA256 against `installer-checksums.txt`. On mismatch, **stop** and warn — the installer may have been tampered with.
- Execute: `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.
- On other failures, point to https://github.com/okx/onchainos-skills.
3. **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.
- Platform targets — 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`
- Hash command — macOS/Linux: `shasum -a 256 ~/.local/bin/onchainos`; Windows: `(Get-FileHash "$env:USERPROFILE\.local\bin\onchainos.exe" -Algorithm SHA256).Hash.ToLower()`
4. **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.
5. **Do NOT auto-reinstall on command failures.** Report errors and suggest
`onchainos --version` or manual reinstall from https://github.com/okx/onchainos-skills.
6. **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](https://web3.okx.com/onchain-os/dev-portal). If the
user creates a `.env` file, remind them to add `.env` to `.gitignore`.
## Skill Routing
- For token search / metadata / rankings / holder analysis / advanced token info / top traders → use `okx-dex-token`
- For per-token holder filtering by tag (whale, smart money, KOL, sniper) → use `okx-dex-token`
- For per-token risk analysis (holder concentration, dev rug pull count, creator info) → use `okx-dex-token`
- For swap execution → use `okx-dex-swap`
- For transaction broadcasting → use `okx-onchain-gateway`
- For wallet balances / token holdings → use `okx-wallet-portfolio`
- For wallet PnL analysis (realized/unrealized PnL, DEX history, recent PnL, per-token PnL) → use `okx-dex-market` portfolio commands (this skill)
- For smart money / whale / KOL signal tracking → use `okx-dex-signal`
- For meme pump scanning (new launches, dev reputation, bundle detection, aped wallets) → use `okx-dex-trenches`
## Keyword Glossary
| Chinese | English / Platform Terms | Maps To |
|---|---|---|
| 行情 | market data, price, chart | `price`, `kline` |
| 盈亏 / 收益 / 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` |
| 清仓 | 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` |
## Quickstart
```bash
# 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 0xd8dA6B