Home/Blockchain & Web3/okx-dex-market
O

okx-dex-market

by @okxv
4.5(20)

Use this skill for on-chain market data: token prices, K-line/OHLC charts, index prices, and wallet PnL analysis (win rate, DEX trade history, realized/unrealized PnL per token).

okx-apidex-tradingmarket-dataweb3-analyticscryptocurrencyGitHub
Installation
npx skills add okx/onchainos-skills --skill okx-dex-market
compare_arrows

Before / After Comparison

1
Before

Before the OKX DEX Market tool, obtaining market data (such as token prices, K-line charts, index prices) from decentralized exchanges (DEX) typically required accessing multiple DEX platforms, aggregators, or blockchain explorers. This involved manual querying, data integration, and complex Profit and Loss (PnL) calculations, which was inefficient and prone to errors.

After

With the OKX DEX Market tool, comprehensive on-chain market data, including real-time token prices, K-line charts, and index prices, can be obtained in one place. It also enables wallet PnL analysis (win rate, transaction history, realized/unrealized PnL). This greatly simplifies the market analysis and investment decision-making process.

SKILL.md

OKX DEX Market Data CLI

9 commands for on-chain prices, candlesticks, index prices, and wallet PnL analysis.

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. 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

ChineseEnglish / Platform TermsMaps To
行情market data, price, chartprice, kline
盈亏 / 收益 / PnLPnL, profit and loss, realized/unrealizedportfolio-overview, portfolio-recent-pnl, portfolio-token-pnl
已实现盈亏realized PnL, realized profitportfolio-token-pnl (realizedPnlUsd)
未实现盈亏unrealized PnL, paper profit, holding gainportfolio-token-pnl (unrealizedPnlUsd)
胜率win rate, success rateportfolio-overview (winRate)
历史交易 / 交易记录DEX transaction history, trade logportfolio-dex-history
清仓sold all, liquidated, sell offportfolio-recent-pnl (unrealizedPnlUsd = "SELL_ALL")
画像 / 钱包画像 / 持仓分析wallet profile, portfolio analysisportfolio-overview
近期收益recent PnL, latest earnings by tokenportfolio-recent-pnl

Quickstart

# 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 SOL candles (use wSOL SPL token address for candles/trades)
onchainos market kline --address So11111111111111111111111111111111111111112 --chain solana --bar 1H --limit 24

# Get batch prices for multiple tokens
onchainos market prices --tokens "1:0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,501:So11111111111111111111111111111111111111112"

# 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

Chain Name Support

The CLI accepts human-readable chain names (e.g., ethereum, solana, xlayer) or numeric chain indices (e.g., 1, 501, 196).

ChainNamechainIndex
XLayerxlayer196
Solanasolana501
Ethereumethereum1
Basebase8453
BSCbsc56
Arbitrumarbitrum42161

Command Index

Market Price Commands

#CommandDescription
1onchainos market price --address <address>Get single token price
2onchainos market prices --tokens <tokens>Batch price query
3onchainos market kline --address <address>Get K-line / candlestick data

Index Price Commands

#CommandDescription
4onchainos market index --address <address>Get index price (aggregated from multiple sources)

Portfolio PnL Commands

#CommandDescription
5onchainos market portfolio-supported-chainsGet chains supported by portfolio PnL endpoints
6onchainos market portfolio-overviewGet wallet PnL overview (realized/unrealized PnL, win rate, Top 3 tokens)
7onchainos market portfolio-dex-historyGet DEX transaction history for a wallet (paginated, up to 1000 records)
8onchainos market portfolio-recent-pnlGet recent PnL list by token for a wallet (paginated, up to 1000 records)
9onchainos market portfolio-token-pnlGet latest PnL snapshot for a specific token in a wallet

Boundary: market vs other skills

NeedUse 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-tokenonchainos token price-info
K-line / candlestick chartonchainos market kline-
Index price (multi-source aggregate)onchainos market index-
Token search by name/symbol-okx-dex-tokenonchainos token search
Token metadata (decimals, logo)-okx-dex-tokenonchainos token info
Token ranking (trending)-okx-dex-tokenonchainos token trending
Holder distribution-okx-dex-tokenonchainos token holders
Holders filtered by tag (KOL, whale, smart money)-okx-dex-tokenonchainos token holders --tag-filter
Top 5 liquidity pools for a token-okx-dex-tokenonchainos token liquidity
Hot tokens by trending score or X mentions-okx-dex-tokenonchainos token hot-tokens
Advanced token info (risk, creator, dev stats)-okx-dex-tokenonchainos token advanced-info
Top traders / profit addresses-okx-dex-tokenonchainos token top-trader
Trade history with tag/wallet filter-okx-dex-tokenonchainos token trades
Smart money / whale / KOL signals-okx-dex-signalonchainos signal list
Signal-supported chains-okx-dex-signalonchainos signal chains
Browse meme pump tokens by stage-okx-dex-trenchesonchainos memepump tokens
Meme token audit (top10, dev, insiders)-okx-dex-trenchesonchainos memepump token-details
Developer reputation / rug pull history-okx-dex-trenchesonchainos memepump token-dev-info
Similar tokens by same creator-okx-dex-trenchesonchainos memepump similar-tokens
Bundle/sniper detection-okx-dex-trenchesonchainos memepump token-bundle-info
Aped (same-car) wallet analysis-okx-dex-trenchesonchainos memepump aped-wallet
Wallet PnL overview (win rate, realized PnL, top tokens)onchainos market portfolio-overview-
Wallet DEX transaction historyonchainos market portfolio-dex-history-
Recent PnL list by tokenonchainos market portfolio-recent-pnl-
Per-token latest PnL (realized/unrealized)onchainos market portfolio-token-pnl-
PnL-supported chain listonchainos market portfolio-supported-chains-

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.

Cross-Skill Workflows

Workflow A: Research Token Before Buying

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.

Workflow B: Price Monitoring / Alerts

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        → compare on-chain vs index price

Workflow C: Wallet PnL Analysis

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.

Workflow D: Wallet Trade History Review

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 mark

...

User Reviews (0)

Write a Review

Effect
Usability
Docs
Compatibility

No reviews yet

Statistics

Installs6.8K
Rating4.5 / 5.0
Version
Updated2026年5月23日
Comparisons1

User Rating

4.5(20)
5
85%
4
15%
3
0%
2
0%
1
0%

Rate this Skill

0.0

Compatible Platforms

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

Timeline

Created2026年3月16日
Last Updated2026年5月23日