Account balance, positions, P&L, bills, fees, and fund transfers on OKX exchange.
Works with
Read and manage trading and funding account balances, open/closed positions, realized and unrealized P&L, transaction history, and fee tiers via CLI commands
Requires OKX API credentials configured locally; supports both live (实盘) and demo (模拟盘) profiles with mandatory profile selection before each command
Write operations (fund transfers, position mode switching) require explicit confirmation
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionokx-cex-portfolioExecute the skills CLI command in your project's root directory to begin installation:
Fetches okx-cex-portfolio from okx/agent-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate okx-cex-portfolio. Access via /okx-cex-portfolio in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
0
total installs
0
this week
49
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
49
stars
Account balance, positions, P&L, bills, fees, and fund transfers on OKX exchange. Requires API credentials.
Before running any command, follow ../_shared/preflight.md.
Use metadata.version from this file's frontmatter as the reference for Step 2.
okx CLI:
npm install -g @okx_ai/okx-trade-cli
okx config init
Or set environment variables:
export OKX_API_KEY=your_key
export OKX_SECRET_KEY=your_secret
export OKX_PASSPHRASE=your_passphrase
okx --profile demo account balance
Run this check before any authenticated command.
okx config show # verify configuration status (output is masked)
okx config init, and wait for setup to complete before retrying.--profile is required for all authenticated commands. Never add a profile implicitly.
| Value | Mode | Funds |
|---|---|---|
live |
实盘 | Real funds |
demo |
模拟盘 | Simulated funds |
Resolution rules:
live; "test" / "模拟" / "demo" → demo) → use it and inform the user: "Using --profile live (实盘)" or "Using --profile demo (模拟盘)""Continuing with --profile live (实盘) from earlier""Live (实盘) or Demo (模拟盘)?" — wait for answer before proceedingIf any command returns a 401 / authentication error:
~/.okx/config.toml
Update the fields api_key, secret_key, passphrase under the relevant profile.
Do NOT paste the new credentials into chat.okx config show to verify (output is masked)Profile is the single control for 实盘/模拟盘 switching — exactly two options:
--profile |
Mode | Funds |
|---|---|---|
live |
实盘 | Real funds |
demo |
模拟盘 | Simulated funds |
okx --profile live account balance # 实盘
okx --profile demo account balance # 模拟盘 (simulated balance)
Rules:
transfer, set-position-mode): profile must be confirmed before execution (see "Credential & Profile Check" Step B); transfer especially — wrong profile means wrong account[profile: live] or [profile: demo]--demo flag — use --profile insteadokx-cex-marketokx-cex-portfolio (this skill)okx-cex-tradeokx-cex-bot# Trading account balance (all currencies with balance > 0)
okx account balance
# Check USDT balance only
okx account balance USDT
# Funding account balance
okx account asset-balance
# All open positions
okx account positions
# Closed position history with realized PnL
okx account positions-history
# Recent account bills (last 100)
okx account bills
# My trading fee tier
okx account fees --instType SPOT
# Transfer 100 USDT from funding (18) to trading (6)
okx account transfer --ccy USDT --amt 100 --from 18 --to 6
| # | Command | Type | Description |
|---|---|---|---|
| 1 | okx account balance [ccy] |
READ | Trading account equity, available, frozen |
| 2 | okx account asset-balance [ccy] [--valuation] |
READ | Funding account balance; --valuation adds earn/trading/funding valuation summary |
| 3 | okx account positions |
READ | Open contract/swap positions |
| 4 | okx account positions-history |
READ | Closed positions + realized PnL |
| 5 | okx account bills |
READ | Account ledger (deposits, withdrawals, trades) |
| 6 | okx account fees --instType <type> |
READ | My trading fee tier (maker/taker) |
| 7 | okx account config |
READ | Account level, position mode, UID |
| 8 | okx account max-size --instId <id> --tdMode <mode> |
READ | Max buy/sell size at current price |
| 9 | okx account max-avail-size --instId <id> --tdMode <mode> |
READ | Available size for next order |
| 10 | okx account max-withdrawal [ccy] |
READ | Max withdrawable per currency |
| # | Command | Type | Description |
|---|---|---|---|
| 11 | okx account set-position-mode <mode> |
WRITE | Switch net/hedge position mode |
| 12 | okx account transfer |
WRITE | Transfer funds between accounts |
User: "I want to buy 0.1 BTC — do I have enough USDT?"
1. okx-cex-portfolio okx account balance USDT → check available equity
2. okx-cex-market okx market ticker BTC-USDT → check current price
↓ user approves
3. okx-cex-trade okx spot place --instId BTC-USDT --side buy --ordType market --sz 0.1
User: "I want to start a BTC grid bot with 1000 USDT"
1. okx-cex-portfolio okx account balance USDT → confirm available funds ≥ 1000
2. okx-cex-market okx market candles BTC-USDT --bar 4H --limit 50 → determine price range
↓ user approves
3. okx-cex-bot okx bot grid create --instId BTC-USDT --algoOrdType grid \
--minPx 90000 --maxPx 100000 --gridNum 10 --quoteSz 1000
User: "Show me my current positions and how they're performing"
1. okx-cex-portfolio okx account positions → open positions with UPL
2. okx-cex-portfolio okx account positions-history → recently closed positions
3. okx-cex-market okx market ticker BTC-USDT-SWAP → check current price vs entry
User: "Move 500 USDT from my funding account to trade BTC"
1. okx-cex-portfolio okx account asset-balance USDT → confirm funding balance ≥ 500
↓ user approves
2. okx-cex-portfolio okx account transfer --ccy USDT --amt 500 --from 18 --to 6
3. okx-cex-portfolio okx account balance USDT → confirm trading balance updated
↓ ready to trade
4. okx-cex-trade okx spot place ...
User: "How much BTC can I buy with cross margin?"
1. okx-cex-portfolio okx account balance → total equity
2. okx-cex-portfolio okx account max-size --instId BTC-USDT-SWAP --tdMode cross → max buy/sell size
3. okx-cex-market okx market ticker BTC-USDT-SWAP → current price reference
Before any authenticated command:
Determine profile (required):
live (实盘) or demo (模拟盘) — exactly these two values"Using --profile live (实盘)""Continuing with --profile live (实盘) from earlier""Live (实盘) or Demo (模拟盘)?" — wait for answerIf no credentials configured: guide user to run okx config init, stop all trading actions
After every command result: append [profile: live] or [profile: demo] to the response
okx account balance (trading) or okx account asset-balance (funding)okx account positionsokx account positions-historyokx account billsokx account feesokx account configokx account max-size or okx account max-avail-sizeokx account max-withdrawalokx account transferokx account set-position-modeRead commands (1–10): run immediately, no confirmation needed.
ccy filter: use currency symbol like USDT, BTC, ETH--instType for fees/positions: SPOT, SWAP, FUTURES, OPTION--archive for bills: access older records beyond the default window--tdMode for max-size: cash (spot), cross, or isolatedWrite commands (11–12): confirm once before executing.
set-position-mode: confirm mode (net = one-directional, long_short_mode = hedge mode); switching may affect open positionstransfer: confirm --ccy, --amt, --from, --to (account types: 6=trading, 18=funding); verify source balance firstset-position-mode: run okx account config to confirm posMode updatedtransfer: run okx account balance and okx account asset-balance to confirm balances updatedokx account balance [ccy] [--json]
| Param | Required | Default | Description |
|---|---|---|---|
ccy |
No | - | Filter to a single currency (e.g., USDT) |
Returns table: currency, equity, available, frozen. Only shows currencies with balance > 0.
okx account asset-balance [ccy] [--valuation] [--json]
| Param | Required | Default | Description |
|---|---|---|---|
ccy |
No | - | Filter to a single currency |
--valuation |
No | false | Also show total asset valuation across all account types (trading/funding/earn) |
Returns: ccy, bal, availBal, frozenBal. Only shows currencies with balance > 0.
With --valuation: additionally prints a valuation summary table with totalBal and per-account-type breakdown (classic/earn/funding).
okx account positions [--instType <type>] [--instId <id>] [--json]
| Param | Required | Default | Description |
|---|---|---|---|
--instType |
No | - | Filter: SWAP, FUTURES, OPTION |
--instId |
No | - | Filter to specific instrument |
Returns: instId, instType, side (posSide), pos, avgPx, upl (unrealized PnL), lever. Only shows positions with size ≠ 0.
okx account positions-history [--instType <type>] [--instId <id>] [--limit <n>] [--json]
Returns: instId, direction, openAvgPx, closeAvgPx, realizedPnl, uTime.
okx account bills [--archive] [--instType <type>] [--ccy <ccy>] [--limit <n>] [--json]
| Param | Required | Default | Description |
|---|---|---|---|
--archive |
No | false | Access older records (archive endpoint) |
--instType |
No | - | Filter by instrument type |
--ccy |
No | - | Filter by currency |
--limit |
No | 100 | Number of records |
Returns: billId, instId, type, ccy, balChg, bal, ts.
okx account fees --instType <type> [--instId <id>] [--json]
| Param | Required | Default | Description |
|---|---|---|---|
--instType |
Yes | - | SPOT, SWAP, FUTURES, OPTION |
--instId |
No | - | Specific instrument (optional) |
Returns: level, maker, taker, makerU, takerU, ts.
okx account config [--json]
Returns: uid, acctLv (account level), posMode (net/long_short_mode), autoLoan
Make data-driven prioritization decisions faster
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Prerequisites
Time Estimate
30-60 minutes to see productivity improvements
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
mattpocock/skills
parcadei/continuous-claude-v3
cursor/plugins
ailabs-393/ai-labs-claude-skills
pproenca/dot-skills
mattpocock/skills
We added okx-cex-portfolio from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
okx-cex-portfolio fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
okx-cex-portfolio has been reliable in day-to-day use. Documentation quality is above average for community skills.
okx-cex-portfolio reduced setup friction for our internal harness; good balance of opinion and flexibility.
Solid pick for teams standardizing on skills: okx-cex-portfolio is focused, and the summary matches what you get after install.
Solid pick for teams standardizing on skills: okx-cex-portfolio is focused, and the summary matches what you get after install.
Registry listing for okx-cex-portfolio matched our evaluation — installs cleanly and behaves as described in the markdown.
okx-cex-portfolio has been reliable in day-to-day use. Documentation quality is above average for community skills.
Keeps context tight: okx-cex-portfolio is the kind of skill you can hand to a new teammate without a long onboarding doc.
okx-cex-portfolio reduced setup friction for our internal harness; good balance of opinion and flexibility.
showing 1-10 of 62