okx-cex-portfolio

Query OKX account balances, positions, P&L, bills, and transfer funds via CLI.

Updated Aug 21, 2026
One-click install
npx skills add https://github.com/nickthelegend/xorr-monorepo --skill okx-cex-portfolio-nickthelegend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: okx-cex-portfolio
Source: https://github.com/nickthelegend/xorr-monorepo/tree/main/.agents/skills/okx-cex-portfolio
Command: npx skills add https://github.com/nickthelegend/xorr-monorepo --skill okx-cex-portfolio-nickthelegend

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @okx_ai/okx-trade-cli.

What problem does it solve? Checking balances, positions, P&L, and moving funds across OKX sub-accounts normally requires manual dashboard navigation or raw API calls; this Skill lets an AI agent answer account questions and execute transfers through the okx CLI with proper credential and demo/live mode handling. ## Core Features & Use Cases - Aggregated Asset Snapshot: One-shot okx account balance-all returns trading, funding, and cross-account valuation totals for net-worth queries. - Positions & P&L: View open positions with unrealized PnL, closed position history with realized PnL, account bills, and fee tiers. - Fund Transfers & Limits: Transfer funds between funding (6) and trading (18) accounts, check max order size and withdrawable amounts, and switch position modes. - Use Case: A user asks "How much USDT do I have in total?" — the agent runs okx account balance-all, reports trading equity, funding balances, and total valuation, then offers to transfer idle funding USDT into the trading account. ## Quick Start Ask the agent "show my total OKX balance and open positions" and it will verify your credentials, confirm live or demo mode, and return your balances and positions.

Frequently Asked Questions about okx-cex-portfolio

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

FAQPage Schema
How do I check my OKX account balance from the command line?

Run okx account balance for trading account equity or okx account asset-balance for funding balances. For a full snapshot across all accounts with total valuation, use okx account balance-all, which returns trading, funding, and valuation sections in one call.

How to transfer USDT from funding to trading account on OKX?

Use okx account transfer --ccy USDT --amt <amount> --from 6 --to 18, where 6 is the funding account and 18 is the unified trading account. Verify the source balance first with okx account asset-balance USDT, then confirm with okx account balance USDT afterward.

Does the okx CLI support demo trading mode?

Yes. OAuth users add the --demo flag (e.g., okx --demo account balance) for simulated funds, while API key users select a demo profile with --profile <demo-profile>. Live trading is the default for OAuth sessions.

Why does okx account positions show nothing when I hold crypto?

The positions command only shows open contract positions (SWAP, FUTURES, OPTION) with nonzero size. Spot holdings are not positions; check them with okx account balance or okx account balance-all instead.

What credentials does the okx CLI need for account commands?

Either an API key stored via okx config init profiles or an active OAuth login session. Verify with okx config show --json for API keys and okx auth status --json for OAuth state before running authenticated commands.