- OKX DEX Token Info CLI
- 5 commands for token search, metadata, detailed pricing, rankings, and holder distribution.
- 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.
- Confirm installed
-
- Run
- which onchainos
- . If not found, install it:
- curl
- -sSL
- https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh
- |
- sh
- If the install script fails, ask the user to install manually following the instructions at:
- https://github.com/okx/onchainos-skills
- Check for updates
- Read
~/.onchainos/last_check
and compare it with the current timestamp:
cached_ts
=
$(
cat
~/.onchainos/last_check
2
/dev/null || true ) now = $( date +%s ) If cached_ts is non-empty and (now - cached_ts) < 43200 (12 hours), skip the update and proceed. Otherwise (file missing or older than 12 hours), run the installer to check for updates: curl -sSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh If a newer version is installed, tell the user and suggest updating their onchainos skills from https://github.com/okx/onchainos-skills to get the latest features. If any onchainos command fails with an unexpected error during this session, try reinstalling before giving up: curl -sSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh Create a .env file in the project root to override the default API credentials (optional — skip this for quick start): OKX_API_KEY= OKX_SECRET_KEY= OKX_PASSPHRASE= Skill Routing For real-time prices / K-lines / trade history → use okx-dex-market For swap execution → use okx-dex-swap For transaction broadcasting → use okx-onchain-gateway For wallet balances / portfolio → use okx-wallet-portfolio For meme token safety (dev reputation, rug pull, bundlers, similar tokens by same dev) → use okx-dex-market For smart money / whale / KOL signals → use okx-dex-market Quickstart
Search token
onchainos token search xETH --chains "ethereum,solana"
Get detailed price info
onchainos token price-info 0xe7b000003a45145decf8a28fc755ad5ec5ea025a --chain xlayer
What's trending on Solana by volume?
onchainos token trending --chains solana --sort-by 5 --time-frame 4
Check holder distribution
onchainos token holders 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee --chain xlayer Chain Name Support The CLI accepts human-readable chain names (e.g., ethereum , solana , xlayer ) and resolves them automatically. Chain Name chainIndex XLayer xlayer 196 Solana solana 501 Ethereum ethereum 1 Base base 8453 BSC bsc 56 Arbitrum arbitrum 42161 Command Index
Command
Description
1
onchainos token search
Yes - Token contract address (positional) --chain No ethereum Chain name Return fields : Field Type Description tokenName String Token full name tokenSymbol String Token symbol (e.g., "ETH" ) tokenLogoUrl String Token logo image URL decimal String Token decimals (e.g., "18" ) tokenContractAddress String Token contract address tagList.communityRecognized Boolean true = listed on Top 10 CEX or community verified 3. onchainos token price-info Get detailed price info including market cap, liquidity, volume, and multi-timeframe price changes. onchainos token price-info < address > [ --chain < chain > ] Param Required Default Description Yes - Token contract address (positional) --chain No ethereum Chain name Return fields : Field Type Description price String Current price in USD time String Timestamp (Unix milliseconds) marketCap String Market capitalization in USD liquidity String Total liquidity in USD circSupply String Circulating supply holders String Number of token holders tradeNum String 24-hour trade count priceChange5M String Price change percentage — last 5 minutes priceChange1H String Price change percentage — last 1 hour priceChange4H String Price change percentage — last 4 hours priceChange24H String Price change percentage — last 24 hours volume5M String Trading volume (USD) — last 5 minutes volume1H String Trading volume (USD) — last 1 hour volume4H String Trading volume (USD) — last 4 hours volume24H String Trading volume (USD) — last 24 hours txs5M String Transaction count — last 5 minutes txs1H String Transaction count — last 1 hour txs4H String Transaction count — last 4 hours txs24H String Transaction count — last 24 hours maxPrice String 24-hour highest price minPrice String 24-hour lowest price 4. onchainos token trending Get trending / top tokens by various criteria. onchainos token trending [ --chains < chains > ] [ --sort-by < sort > ] [ --time-frame < frame > ] Param Required Default Description --chains No "1,501" Chain names or IDs, comma-separated --sort-by No "5" Sort: 2 =price change, 5 =volume, 6 =market cap --time-frame No "4" Window: 1 =5min, 2 =1h, 3 =4h, 4 =24h Return fields : Field Type Description tokenSymbol String Token symbol tokenContractAddress String Token contract address tokenLogoUrl String Token logo image URL chainIndex String Chain identifier price String Current price in USD change String Price change percentage (for selected time frame) volume String Trading volume in USD (for selected time frame) marketCap String Market capitalization in USD liquidity String Total liquidity in USD holders String Number of token holders uniqueTraders String Number of unique traders (for selected time frame) txsBuy String Buy transaction count (for selected time frame) txsSell String Sell transaction count (for selected time frame) txs String Total transaction count (for selected time frame) firstTradeTime String First trade timestamp (Unix milliseconds) 5. onchainos token holders Get token holder distribution (top 20). onchainos token holders < address > [ --chain < chain > ] Param Required Default Description Yes - Token contract address (positional) --chain No ethereum Chain name Return fields (top 20 holders): Field Type Description data[].holdAmount String Token amount held data[].holderWalletAddress String Holder wallet address Input / Output Examples User says: "Search for xETH token on XLayer" onchainos token search xETH --chains xlayer # → Display: # xETH (0xe7b0...) - XLayer # Price: $X,XXX.XX | 24h: +X% | Market Cap: $XXM | Liquidity: $XXM # Community Recognized: Yes User says: "What's trending on Solana by volume?" onchainos token trending --chains solana --sort-by 5 --time-frame 4 # → Display top tokens sorted by 24h volume: # #1 SOL - Vol: $1.2B | Change: +3.5% | MC: $80B # #2 BONK - Vol: $450M | Change: +12.8% | MC: $1.5B # ... User says: "Who are the top holders of this token?" onchainos token holders 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee --chain xlayer # → Display top 20 holders with amounts and addresses Edge Cases Token not found : suggest verifying the contract address (symbols can collide) Same symbol on multiple chains : show all matches with chain names Unverified token : communityRecognized = false — warn user about risk Too many results : name/symbol search caps at 100 — suggest using exact contract address Network error : retry once Region restriction (error code 50125 or 80001) : do NOT show the raw error code to the user. Instead, display a friendly message: ⚠️ Service is not available in your region. Please switch to a supported region and try again. Amount Display Rules Use appropriate precision: 2 decimals for high-value, significant digits for low-value Market cap / liquidity in shorthand ($1.2B, $45M) 24h change with sign and color hint (+X% / -X%) Global Notes Use contract address as primary identity — symbols can collide across tokens communityRecognized = true means listed on Top 10 CEX or community verified The CLI resolves chain names automatically (e.g., ethereum → 1 , solana → 501 ) EVM addresses must be all lowercase The CLI handles authentication internally via environment variables — see Prerequisites step 4 for default values[ --chains < chains
] Param Required Default Description
Yes - Keyword: token name, symbol, or contract address (positional) --chains No "1,501" Chain names or IDs, comma-separated (e.g., "ethereum,solana" or "196,501" ) Return fields : Field Type Description tokenContractAddress String Token contract address tokenSymbol String Token symbol (e.g., "ETH" ) tokenName String Token full name tokenLogoUrl String Token logo image URL chainIndex String Chain identifier decimal String Token decimals (e.g., "18" ) price String Current price in USD change String 24-hour price change percentage marketCap String Market capitalization in USD liquidity String Liquidity in USD holders String Number of token holders explorerUrl String Block explorer URL for the token tagList.communityRecognized Boolean true = listed on Top 10 CEX or community verified 2. onchainos token info Get token basic info (name, symbol, decimals, logo). onchainos token info < address [ --chain < chain
] Param Required Default Description