计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
okx-cex-trade【效率与协作】Execute and manage OKX spot, perpetual, futures, and supported options trades on Zo. Use when the user wants to place, cancel, amend, or inspect tradable orders, but require explicit same-thread confirmation before any live execution.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Execute OKX trades on Zo with a strict quote, validate, confirm, execute flow.
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.
okx trading commandsZo secrets are the source of truth for:
OKX_API_KEYOKX_SECRET_KEYOKX_PASSPHRASEGenerate local OKX config from those secrets if the CLI requires it. Do not ask the user to paste credentials into chat.
If the CLI needs a local config file, generate it from Zo secrets:
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
demo or live.demo: simulated fundslive: real fundsIf the user has not clearly specified one, ask.
Before any write action:
Require explicit confirmation in the current conversation before executing any live write action.
For demo writes, still confirm if the order details are ambiguous.
Only after confirmation, run the specific command.
okx --profile demo spot place --instId BTC-USDT --side buy --ordType market --sz 0.01
okx --profile demo spot cancel --instId BTC-USDT --ordId <ordId>
okx --profile demo spot amend --instId BTC-USDT --ordId <ordId> --newPx 100000
okx --profile demo swap place --instId BTC-USDT-SWAP --side buy --ordType market --sz 1 --tdMode cross --posSide long
okx --profile demo swap close --instId BTC-USDT-SWAP --mgnMode cross --posSide long
okx --profile demo swap leverage --instId BTC-USDT-SWAP --lever 10 --mgnMode cross
okx --profile demo swap algo trail --instId BTC-USDT-SWAP --side sell --sz 1 --tdMode cross --posSide long --callbackRatio 0.02
Load the matching reference file before running anything beyond the simplest spot or swap flow:
references/spot-commands.mdreferences/swap-commands.mdreferences/futures-commands.mdreferences/options-commands.mdreferences/templates.mdreferences/workflows.mdBefore placing SWAP, FUTURES, or OPTION orders, retrieve instrument details and validate contract face value. Do not assume contract sizing.
Examples:
okx market instruments --instType SWAP --instId BTC-USDT-SWAP
okx market instruments --instType FUTURES --instId BTC-USDT-250328
okx market instruments --instType OPTION --instId BTC-USD-250328-95000-C
Use the validated contract value to explain:
okx-cex-marketokx-cex-portfolio