okx-dex-market

Query on-chain token prices, K-line charts, and wallet PnL via the onchainos CLI.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/Nith567/xlayer-skills-arena --skill okx-dex-market-nith567
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: okx-dex-market
Source: https://github.com/Nith567/xlayer-skills-arena/tree/main/okx-dex-market
Command: npx skills add https://github.com/Nith567/xlayer-skills-arena --skill okx-dex-market-nith567

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Getting live on-chain market data and understanding a wallet's trading performance normally requires juggling multiple block explorers and analytics dashboards. This Skill unifies token prices, candlestick charts, index prices, and wallet profit-and-loss analysis into a single conversational interface backed by the OKX onchainos CLI. ## Core Features & Use Cases - Market Data Queries: Fetch single or batch token prices, K-line/OHLC candlestick data, and aggregated index prices across chains like XLayer, Ethereum, Solana, Base, BSC, and Arbitrum. - Wallet PnL Analysis: Retrieve realized/unrealized PnL, win rate, top-performing tokens, DEX trade history, and per-token PnL snapshots for any wallet address. - Guided Workflow: Resolves token addresses via search, verifies chain support for PnL endpoints, translates raw kline fields into human-readable labels, and suggests contextual next steps such as viewing charts or executing swaps. - Use Case: Ask "How is my Ethereum wallet performing this week?" and get a 7-day PnL overview with win rate and top 3 tokens, then drill into per-token trade history. ## Quick Start Ask the agent to show the current price and hourly candlestick chart for a token on XLayer, or to summarize your wallet's realized and unrealized PnL over the past month.

Frequently Asked Questions about okx-dex-market

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check a token price on-chain with onchainos?▼

Run onchainos market price with the token contract address and chain name, for example onchainos market price --address <address> --chain xlayer. For batch queries across multiple tokens or chains, use onchainos market prices with comma-separated chainIndex:address pairs.

How do I get K-line candlestick data for a token?▼

Use onchainos market kline with the token address, optionally specifying --bar (1m, 1H, 1D, etc.) and --limit up to 299 data points. The CLI returns named JSON fields (ts, o, h, l, c, vol, volUsd, confirm) that should be presented as Time, Open, High, Low, Close, and Volume.

Can I analyze my wallet's DEX trading PnL and win rate?▼

Yes, onchainos market portfolio-overview returns realized PnL, win rate, and top 3 tokens for a wallet over time frames from 1 day to 3 months. First call portfolio-supported-chains to confirm the chain supports PnL, since not all chains do.

Why does the SOL price query fail on Solana?▼

The native SOL address (11111111111111111111111111111111) does not work for market price or kline commands. Use the wrapped SOL token address So11111111111111111111111111111111111111112 instead; the native address is only valid for swap operations.

What does error code 50125 or 80001 mean when querying market data?▼

These codes indicate a region restriction, such as DEX services being unavailable in the United Kingdom or DeFi services in Hong Kong. The user should see a friendly message that the service is not available in their region, without exposing the raw error code.

When should I use index price instead of the regular price command?▼

Use onchainos market index only when the user explicitly requests an aggregate, index, or cross-exchange composite price. For all standard price and market data queries, onchainos market price is the correct default command.