From cdcx-cli
Cancels all open orders, closes positions at market, and sweeps advanced orders using cdcx CLI and jq. For market crashes, API key compromise, or emergency hard stops.
npx claudepluginhub crypto-com/cdcx-cli --plugin cdcx-cliThis skill uses the workspace's default tool permissions.
- Market is moving violently against current exposure
Cancels all Kraken spot and futures orders and closes all positions at market prices in emergencies. Verifies completion and warns of slippage risks.
Emergency flattens all open paper positions in OpenTradex at last mark and sets 30-minute trading cooldown. User-invoked only via explicit 'panic', 'flatten', 'close everything', or 'stop'.
Places LIMIT/MARKET orders, amends prices/quantities, cancels orders, closes positions via CLI with dry-run previews, preflight checks, and tiered safety model.
Share bugs, ideas, or general feedback.
This is a destructive workflow. Only run when the user asks for it explicitly.
CDCX_API_KEY / CDCX_API_SECRET, or a profile)--allow-dangerous (this workflow uses tier-dangerous commands)--yes to skip prompts, or acknowledge each prompt# 1. Cancel every open order (dangerous)
cdcx trade cancel-all --yes -o json
# 2. Confirm no open orders remain
cdcx trade open-orders -o json
# 3. List every open position
cdcx account positions -o json
# 4. Close each position at market
# Run this per row returned in step 3
cdcx trade close-position <INSTRUMENT_NAME> --type MARKET --yes -o json
# 5. Verify positions are flat
cdcx account positions -o json
# 6. Also sweep advanced (OTO/OTOCO) orders — they live in a separate namespace
cdcx advanced cancel-all --yes -o json
cdcx advanced open-orders -o json
# 7. Final wallet check
cdcx account summary -o json
cdcx trade cancel-all --yes && \
cdcx advanced cancel-all --yes && \
cdcx account positions -o json | \
jq -r '.data[].instrument_name' | \
while read i; do cdcx trade close-position "$i" --type MARKET --yes; done && \
cdcx account positions -o json
cancel-all without an instrument cancels every open order across the accountclose-position is asynchronous — it returns an ack, not a fill. The position may remain open for a moment; step 5 confirmscdcx trade cancel-all — sweep them separately with cdcx advanced cancel-allcdcx account positions and cdcx trade open-orders until both are empty