Zo okx cex portfolio

From zocomputer/skills · View interactive version

Zo okx cex portfolio is an AI agent skill from the GitHub repository zocomputer/skills. Inspect OKX account balances, positions, PnL, bills, fee levels, and related account state on Zo. Use when the user asks about holdings, positions, realized or unrealized PnL, transfers, or account configuration.

How to use this skill

Skill file

OKX Portfolio

Inspect OKX account state on Zo, including balances, positions, PnL, bills, fees, and selected account operations.

Preflight

Before running any OKX command in this session, follow ../_shared/preflight.md.

Use metadata.version from this file as the comparison version for drift checks.

What Zo Uses

Credential Model

Zo secrets are the source of truth for:

If local OKX config is needed, generate it from those secrets on the Zo machine instead of asking the user to paste credentials into chat.

Prerequisites

  1. Install the CLI:
npm install -g @okx_ai/okx-trade-cli
  1. Ensure OKX secrets exist in Settings > Advanced.
  1. Generate local config from Zo secrets if required by the CLI flow:
mkdir -p /root/.okx
cat > /root/.okx/config.toml <<EOF
default_profile = "demo"

[profiles.demo]
api_key = "${OKX_API_KEY}"
secret_key = "${OKX_SECRET_KEY}"
passphrase = "${OKX_PASSPHRASE}"
demo = true

[profiles.live]
api_key = "${OKX_API_KEY}"
secret_key = "${OKX_SECRET_KEY}"
passphrase = "${OKX_PASSPHRASE}"
EOF
  1. Verify configuration status:
okx config show

Profile Rule

Authenticated commands must always use an explicit profile:

If the user has not specified a profile and none is clearly established in the conversation, ask before proceeding.

Common Commands

okx --profile demo account balance
okx --profile demo account positions
okx --profile demo account positions-history
okx --profile demo account bills
okx --profile demo account fees --instType SPOT
okx --profile demo account config

Workflow

  1. Verify the CLI is available.
  2. Verify credentials are configured and masked correctly.
  3. Confirm the profile.
  4. Run the smallest account command that answers the user’s question.
  5. Summarize the output in chat and append the active profile.

Failure Handling

Output Rules

Safety Notes

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.