All skills
okx avatar

/okx-dex-market

@7ee532c
by OKX.comokx/onchainos-skills338 stars
75

Query read-only DEX token, market, signal, social, trenches, and WebSocket data. Use for token search, rankings, liquidity, holders, risk metadata, clusters, and trades; prices, K-lines/OHLC, indexes, and wallet PnL; smart-money/KOL/whale signals; news, sentiment, and token vibe; meme-launch, developer, bundle/sniper, and co-investor research; or DEX WebSocket clients. Triggers include hot tokens, holder concentration, smart money, top-trader leaderboards, pump.fun research, new token launches, on-chain token scanning, bundled or sniper activity, and WebSocket.

Use this Skill: https://skilld.dev/gh/okx/onchainos-skills/okx-dex-market

This session only. Nothing lands on disk.

referencesmarket.md

≈892 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Capability: Market

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

Commands

# Command Use When
1 onchainos market price --address <address> Single token price (default for all price queries)
2 onchainos market prices --tokens <tokens> Batch price query (multiple tokens at once)
3 onchainos market kline --address <address> K-line / candlestick chart — only when the user explicitly mentions chart, candle, K-line, OHLC, or bar data; a timeframe alone is NOT sufficient
4 onchainos market index --address <address> Index price — only when user explicitly asks for aggregate/cross-exchange price
5 onchainos market portfolio-supported-chains Check which chains support PnL
6 onchainos market portfolio-overview Wallet PnL overview (win rate, realized PnL, top 3 tokens)
7 onchainos market portfolio-dex-history Wallet DEX transaction history
8 onchainos market portfolio-recent-pnl Recent PnL by token for a wallet
9 onchainos market portfolio-token-pnl Per-token PnL snapshot (realized/unrealized)

portfolio-dex-history time window

onchainos market portfolio-dex-history --address <addr> --chain <chain> needs a time window: pass either --since 24h/--since 7d (CLI computes it and returns data.resolvedWindow {begin,end}) or absolute --begin <ms> --end <ms>. Supplying neither, or --since together with --begin/--end, returns a structured invalid_input error.

Mandatory routing rules:

Index price → onchainos market index only when the user explicitly asks for an aggregate, index, or cross-exchange composite price. For every other price or "how much is X" query, use onchainos market price.

K-line → onchainos market kline only when the user explicitly mentions a chart, candle, candlestick, K-line, OHLC, or bar. A timeframe alone ("5 minutes", "1h", "daily") does NOT trigger kline; default to onchainos market price. Examples: "BTC 5-minute candlestick chart" → kline. "BTC 5-minute up/down market" → blocked and routed to Polymarket by the top-level skill. "BTC 5-minute price" → price.

Step 1: Collect Parameters

  • Missing chain → ask the user which chain they want to use before proceeding; for portfolio PnL queries, first call onchainos market portfolio-supported-chains to confirm the chain is supported
  • Missing token address → use the Token capability's onchainos token search first to resolve
  • K-line requests → confirm bar size and time range with user

Step 2: Call and Display

  • Call directly, return formatted results
  • Use appropriate precision: 2 decimals for high-value tokens, significant digits for low-value
  • Show USD value alongside
  • Kline field mapping: The CLI returns named JSON fields using short API names. Always translate to human-readable labels when presenting to users: ts → 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, l, c to users.

Data Freshness

Render requestTime (Unix ms) as-is. Do NOT chain off a previous response's requestTime; for a relative window use --since on portfolio-dex-history.

Amount Display Rules

  • Always display in UI units (1.5 ETH), never base units
  • Show USD value alongside (1.5 ETH ≈ $4,500)
  • Prices are strings — handle precision carefully

Source: SKILL.md on GitHub

2 warnings6d5 checks · Risk SAFE
  • Gen Agent Trust Hub6d

    The skill is designed for querying DEX data and includes comprehensive instructions for the AI agent to handle external data securely. It retrieves information from news platforms, social media, and on-chain sources, which introduces a surface for indirect prompt injection. However, the skill explicitly commands the agent to treat this data as untrusted and not as instructions, and the underlying CLI tool includes measures to reduce the exposed content. The skill also installs a helper tool from the vendor's official package repository. No high-risk patterns were found.

  • Socket6d

    No alerts

  • Snyk6d

    Risk: MEDIUM · 2 issues

  • Runlayer6mo

    1/2 files flagged

  • ZeroLeaks5mo

    1 finding · Score: 82/100

Signed by skilld at 7ee532c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated last week
Other metadata
metadata
{
  "author": "okx",
  "version": "4.6.3",
  "homepage": "https://web3.okx.com"
}
  • okx
  • dex
  • market-data
  • token-prices
  • kline
  • ohlc
  • pnl
  • wallet-analytics
  • portfolio

README badge

README badge for okx/onchainos-skills

Fetches on-chain token prices, K-line candlestick charts, index prices, and wallet PnL analysis (realized/unrealized gains, trade history, win rates) via the OKX DEX Market API. Supports batch price queries, per-token profit snapshots, and portfolio overviews across multiple chains.

Generated from the current SKILL.md.

Does this skill handle prediction markets like Polymarket?
No. This skill is explicitly blocked from prediction-market queries (涨跌 / updown markets). Route those to okx-dapp-discovery instead. This skill handles on-chain market data only: token prices, K-line charts, index prices, and wallet PnL.
What chains does portfolio PnL support?
Not all chains support PnL analysis. Call `onchainos market portfolio-supported-chains` first to verify the chain is supported before running wallet PnL commands.
When should I use K-line versus price?
Use K-line only when the user explicitly mentions chart, candle, K线, OHLC, or bar data. A timeframe alone (e.g. '5 minutes') does not trigger K-line — default to price instead.
Does this skill require payment after the free quota?
Some endpoints require payment via the OKX Agent Payments Protocol after free quota is exhausted. Responses may include notification codes (NEW_USER_INTRO, OLD_USER_GRACE, etc.) that indicate tier status and payment requirements.
How do I query real-time prices or candlestick data?
Use the `onchainos ws` CLI for real-time monitoring via WebSocket channels (price, dex-token-candle1m). For custom bots, read the ws-protocol specification.

Generated from the current SKILL.md. These answers refresh after source changes.