Skip to content
Back to skills

Crypto Com Recipe Emergency Flatten

ASecurity

Emergency flatten — cancel all open orders and close every open position as quickly as possible. Use when markets turn against you or credentials may be compromised.

  • 81 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 7, 2026
securitygoapi

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add jiayaoqijia/cryptoskill --skill crypto-com-recipe-emergency-flatten --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Crypto Com Recipe Emergency Flatten?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Crypto Com Recipe Emergency Flatten
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jiayaoqijia-crypto-com-recipe-emergency-flatten/badge)](https://www.skillsdirectory.com/skills/jiayaoqijia-crypto-com-recipe-emergency-flatten)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: recipe-emergency-flatten
description: Emergency flatten — cancel all open orders and close every open position as quickly as possible. Use when markets turn against you or credentials may be compromised.
---

# Emergency Flatten

## When to Use

- Market is moving violently against current exposure
- Suspect API key compromise — reduce blast radius
- End-of-session sweep to go flat overnight
- Agent has behaved unexpectedly and the human wants a hard stop

This is a destructive workflow. Only run when the user asks for it explicitly.

## Assumptions

- Authentication is configured (`CDCX_API_KEY` / `CDCX_API_SECRET`, or a profile)
- MCP mode: server must be started with `--allow-dangerous` (this workflow uses tier-`dangerous` commands)
- CLI mode: use `--yes` to skip prompts, or acknowledge each prompt

## Workflow

```
# 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
```

## Automated One-Liner

```
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
```

## Notes

- `cancel-all` without an instrument cancels *every* open order across the account
- `close-position` is asynchronous — it returns an ack, not a fill. The position may remain open for a moment; step 5 confirms
- Advanced orders (OTO/OTOCO) are not cancelled by `cdcx trade cancel-all` — sweep them separately with `cdcx advanced cancel-all`
- If you are in doubt about the current state, re-run `cdcx account positions` and `cdcx trade open-orders` until both are empty
- If API access itself is the concern, also rotate the API key at https://crypto.com/exchange/settings/api afterwards

Files in this skill

  • SKILL.md2.3 KB
  • SOURCE.md368 B
  • TRUST.auto.yaml2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.