agentleFS
open-crab-aiopen-crab-ai/okx-plugin/skills/okx-account/SKILL.md

okx-account

Skill1 starsChanged 9 months agoApache-2.0View on GitHub

Use this skill when users need to manage their OKX trading account: check balance, view positions, get bills/transaction history, configure account settings (leverage, margin mode, position mode), manage collateral, check risk state, or handle borrowing/repaying. For placing/canceling orders, use okx-trade. For funding account (deposits/withdrawals), use okx-asset.

  • Reads credentials
  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every time before running any okx command, follow these steps:

    line 17
  2. Very specific:

    Confirm installed: Run which okx. If not found, install:

    line 19
  3. Very specific:

    API credentials: Ensure .env file exists in project root or ~/.okx/.env:

    line 24
  4. Distinctive:

    All responses are JSON with structure:

    line 198

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

OKX Trading Account CLI

37+ commands for trading account management: balance, positions, bills, leverage, margin, risk, collateral, and configuration.

Pre-flight Checks

Every time before running any okx command, follow these steps:

  1. Confirm installed: Run which okx. If not found, install:
    npm install -g okx-trader-cli
  2. API credentials: Ensure .env file exists in project root or ~/.okx/.env:
    OKX_API_KEY=your-api-key
    OKX_SECRET_KEY=your-secret-key
    OKX_PASSPHRASE=your-passphrase

Skill Routing

  • For order placement/cancellation → use okx-trade
  • For market data (tickers, candles, order book) → use okx-market
  • For public data (instruments, funding rate) → use okx-public
  • For funding account (deposit/withdrawal/transfer) → use okx-asset
  • For trading bots (grid, signal, DCA) → use okx-trading-bot

Commands

Get Account Balance

okx account balance
okx account balance --ccy BTC,ETH

Get Positions

okx account positions
okx account positions --instType SWAP
okx account positions --instId BTC-USDT-SWAP

Get Historical Positions

okx account positions-history
okx account positions-history --instType SWAP --limit 50

Get Account Position Risk

okx account position-risk
okx account position-risk --instType SWAP

Get Bills (7 days)

okx account bills
okx account bills --instType SPOT --ccy BTC
okx account bills --type 2 --limit 50

Get Bills Archive (3 months)

okx account bills-archive --instType SWAP

Get Account Configuration

okx account config

Set Position Mode

okx account set-position-mode --posMode long_short_mode
okx account set-position-mode --posMode net_mode

Set Leverage

okx account set-leverage --instId BTC-USDT-SWAP --lever 10 --mgnMode cross
okx account set-leverage --instId BTC-USDT-SWAP --lever 5 --mgnMode isolated --posSide long

Get Maximum Order Size

okx account max-size --instId BTC-USDT --tdMode cash
okx account max-size --instId BTC-USDT-SWAP --tdMode cross

Get Maximum Available Size

okx account max-avail-size --instId BTC-USDT --tdMode cash

Adjust Margin (Isolated)

okx account adjust-margin --instId BTC-USDT-SWAP --posSide long --type add --amt 10
okx account adjust-margin --instId BTC-USDT-SWAP --posSide long --type reduce --amt 5

Get Leverage Info

okx account leverage-info --instId BTC-USDT-SWAP --mgnMode cross

Get Max Loan

okx account max-loan --instId BTC-USDT-SWAP --mgnMode cross

Get Trade Fee Rates

okx account trade-fee --instType SPOT
okx account trade-fee --instType SWAP --instFamily BTC-USDT

Get Interest Accrued

okx account interest-accrued
okx account interest-accrued --ccy USDT

Get Interest Rate

okx account interest-rate
okx account interest-rate --ccy BTC

Set Greeks Display (PA/BS)

okx account set-greeks --greeksType PA
okx account set-greeks --greeksType BS

Get Max Withdrawal

okx account max-withdrawal
okx account max-withdrawal --ccy USDT

Get Risk State

okx account risk-state

Get Interest Limits

okx account interest-limits
okx account interest-limits --ccy BTC

Manual Borrow/Repay

okx account spot-borrow-repay --ccy USDT --side borrow --amt 1000
okx account spot-borrow-repay --ccy USDT --side repay --amt 1000

Get Account Greeks

okx account greeks
okx account greeks --ccy BTC

Set Account Level

okx account set-account-level --acctLv 2

Set Collateral Assets

okx account set-collateral-assets --ccy BTC,ETH,USDT

Get Collateral Assets

okx account collateral-assets

Get Instruments (Private)

okx account instruments --instType SPOT
okx account instruments --instType SWAP --instFamily BTC-USDT

Response Format

All responses are JSON with structure:

{
  "code": "0",
  "msg": "",
  "data": [...]
}

code = "0" means success. Non-zero means error — check msg for details.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.