@bitget-ai/bitget-agent-skill 1.2.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,55 +1,58 @@
1
- # Bitget Demo Trading
1
+ # Bitget Demo / Paper Trading
2
2
 
3
- Demo Trading lets you trade with virtual funds in a real-market environment.
4
- Use it to test strategies without risking real money.
3
+ Demo Trading lets you trade with virtual funds against real market data. Use it to
4
+ test strategies without risking real money.
5
5
 
6
6
  ## Prerequisites
7
7
 
8
8
  1. Log in to https://www.bitget.com
9
- 2. Switch to Demo Trading mode (toggle in the top navigation bar)
9
+ 2. Switch to **Demo Trading** mode (toggle in the top navigation bar)
10
10
  3. Go to **Personal Center → API Key Management**
11
11
  4. Create a **Demo API Key** with Trade permissions
12
- 5. Note: Demo API Keys are completely separate from live trading keys
12
+ 5. Demo API Keys are completely separate from live keys
13
13
 
14
- ## Using Demo Mode with bgc CLI
14
+ ## Using demo mode with `bgc`
15
15
 
16
- Set your Demo API Key credentials as environment variables:
16
+ Set your **demo** credentials as the environment variables, then add `--paper-trading`
17
+ to route writes to the Bitget demo environment:
17
18
 
18
19
  ```bash
19
20
  export BITGET_API_KEY="your-demo-api-key"
20
21
  export BITGET_SECRET_KEY="your-demo-secret-key"
21
22
  export BITGET_PASSPHRASE="your-demo-passphrase"
22
- ```
23
-
24
- Then add `--paper-trading` flag to any bgc command:
25
23
 
26
- ```bash
27
- # Check demo account balance
28
- bgc --paper-trading account get_account_assets
24
+ # Demo account snapshot
25
+ bgc --paper-trading account_overview
29
26
 
30
- # Place a demo spot order
31
- bgc --paper-trading spot spot_place_order --orders '[{"symbol":"BTCUSDT","side":"buy","orderType":"market","size":"0.01"}]'
27
+ # Demo spot market buy (qty is quote coin = USDT for a spot market buy)
28
+ bgc --paper-trading order --action place \
29
+ --category SPOT --symbol BTCUSDT --side buy --orderType market --qty 50
32
30
 
33
- # Check demo futures positions
34
- bgc --paper-trading futures futures_get_positions --productType USDT-FUTURES
31
+ # Demo futures positions
32
+ bgc --paper-trading position --action info --category USDT-FUTURES --symbol BTCUSDT
35
33
 
36
- # Place a demo futures order
37
- bgc --paper-trading futures futures_place_order --orders '[{"symbol":"BTCUSDT","productType":"USDT-FUTURES","marginCoin":"USDT","size":"0.01","side":"open_long","orderType":"market"}]'
34
+ # Demo futures order
35
+ bgc --paper-trading order --action place \
36
+ --category USDT-FUTURES --symbol BTCUSDT --side buy --orderType market --qty 0.01
38
37
  ```
39
38
 
40
- ## Using Demo Mode with bitget-mcp
39
+ `--paper-trading` is mutually exclusive with `--read-only`.
40
+
41
+ ## Using demo mode with the MCP server
41
42
 
42
- Start the MCP server with the `--paper-trading` flag:
43
+ Start the MCP server with `--paper-trading`; every tool in that session runs in demo mode:
43
44
 
44
45
  ```bash
45
- bitget-mcp --paper-trading --modules spot,futures,account
46
+ bitget-agent-mcp --paper-trading --modules market,trade,account
46
47
  ```
47
48
 
48
- All tools in that MCP session will operate in demo mode.
49
+ (Install: `npm install -g @bitget-ai/bitget-agent-mcp`.)
49
50
 
50
- ## Important Caveats
51
+ ## Important caveats
51
52
 
52
- - **Demo keys ≠ Live keys**: Never mix them. Demo keys only work with `--paper-trading`.
53
- - **Virtual funds only**: No real money is involved; balances can be reset manually via the Bitget demo dashboard.
54
- - **Real market data**: Prices reflect live market conditions.
55
- - **All modules supported**: Spot, futures, account, etc. all work in demo mode.
53
+ - **Demo keys ≠ live keys.** Never mix them. Demo keys only work with `--paper-trading`.
54
+ - **Keep the whole session in one mode.** Don't interleave live and `--paper-trading`
55
+ commands — decide up front and stay consistent.
56
+ - **Virtual funds only.** No real money; reset balances from the Bitget demo dashboard.
57
+ - **Real market data.** Prices reflect live conditions.
58
+ - **All categories supported.** SPOT, MARGIN, and the futures categories all work in demo.
@@ -0,0 +1,112 @@
1
+ # Discovering the Surface with `bgc discover`
2
+
3
+ `bgc` introspects its own live tool surface. Use `discover` instead of guessing
4
+ parameters — it returns the exact, doc-grounded contract for whatever is callable
5
+ right now (it respects `--modules`, `--surface`, and `--read-only`, so it shows
6
+ exactly what you can run).
7
+
8
+ All `discover` output is read-only and needs no credentials.
9
+
10
+ ## The four rungs of disclosure
11
+
12
+ Climb only as far as you need.
13
+
14
+ ### 1. Map — `bgc discover`
15
+
16
+ Lists the business **domains** and how many verbs each has, plus the `meta` tools
17
+ (`raw`, `discover`). Start here when you don't know where a capability lives.
18
+
19
+ ```bash
20
+ bgc discover
21
+ ```
22
+
23
+ ### 2. Domain — `bgc discover --domain <d>`
24
+
25
+ Lists the verbs in one domain with one-line descriptions, their risk level, write
26
+ flag, and the catalog operations each one fronts.
27
+
28
+ ```bash
29
+ bgc discover --domain trade
30
+ bgc discover --domain funds
31
+ ```
32
+
33
+ ### 3. Verb — `bgc discover --tool <verb>`
34
+
35
+ Returns one verb's full input schema and metadata. Two shapes:
36
+
37
+ - **Action-routed verb** (most verbs): you get an `actions` list and a hint to drill
38
+ into a specific action. The top-level schema is the *union* across all actions —
39
+ don't assemble a call from it; go to rung 4 for the exact per-action contract.
40
+ - **Action-less verb** (e.g. `account_overview`): you get an explicit
41
+ `required` / `optional` param split directly — ready to call.
42
+
43
+ ```bash
44
+ bgc discover --tool order # action-routed → see actions list
45
+ bgc discover --tool account_overview # action-less → ready-to-call params
46
+ ```
47
+
48
+ ### 4. Action — `bgc discover --tool <verb> --action <name>`
49
+
50
+ The authoritative contract: this action's `required` and `optional` params, each
51
+ with `type`, `enum` (allowed values), and a doc-grounded `description`, plus the
52
+ underlying `method`, `path`, `operationId`, `isWrite`, `riskLevel`
53
+ (`read`|`write`|`high`), and `requiresConfirm` (`true` only for the high-risk ops
54
+ that need `--confirm`). **Read this before constructing any non-trivial or any
55
+ trading command.**
56
+
57
+ ```bash
58
+ bgc discover --tool order --action place
59
+ bgc discover --tool position --action closeAll
60
+ bgc discover --tool withdraw --action submit
61
+ ```
62
+
63
+ ## Keyword search — `bgc discover --search <q>`
64
+
65
+ When you don't know the domain or verb, search the whole surface (verb names,
66
+ actions, fronts, descriptions). Returns ranked matches and which verb to open next.
67
+
68
+ ```bash
69
+ bgc discover --search "funding rate"
70
+ bgc discover --search leverage
71
+ bgc discover --search withdraw
72
+ ```
73
+
74
+ ## Widening the surface
75
+
76
+ By default the CLI exposes `--modules all` at the **intent** surface (the 14 curated
77
+ verbs). Two ways to see more:
78
+
79
+ - **Hidden to-B modules** (`broker`, `inst_loan`) are NOT in `all` — name them
80
+ explicitly to make them discoverable and callable:
81
+
82
+ ```bash
83
+ bgc discover --modules broker --domain broker
84
+ bgc broker --action listSubs --modules broker
85
+ ```
86
+
87
+ - **`--full` / `--surface full`** also exposes the 1:1 generated tool per catalog
88
+ operation (one tool per raw endpoint) for power/debug use. The intent verbs cover
89
+ every operation, so you rarely need this.
90
+
91
+ ## When no verb fits: `raw`
92
+
93
+ Every catalog operation is reachable by id through the `raw` escape hatch, bypassing
94
+ the intent layer. Find the `operationId` from rung 4 (or `commands.md`) and call:
95
+
96
+ ```bash
97
+ bgc raw --operationId getTickers --args '{"category":"SPOT","symbol":"BTCUSDT"}'
98
+ ```
99
+
100
+ `raw` still flows through the same write-safety gate, so high-risk operations via
101
+ `raw` also require `confirm: true` in `--args`.
102
+
103
+ ## Typical flow
104
+
105
+ ```bash
106
+ # "What can I do with orders, and how do I place one?"
107
+ bgc discover --domain trade # find the `order` verb
108
+ bgc discover --tool order # see its actions
109
+ bgc discover --tool order --action place # get the exact params
110
+ bgc order --action place --category SPOT --symbol BTCUSDT \
111
+ --side buy --orderType market --qty 0.001 --dry-run # preview first
112
+ ```
@@ -1,53 +1,118 @@
1
- # Bitget Error Codes
2
-
3
- ## bgc client errors
4
-
5
- | Code | Meaning | Recovery |
6
- |------|---------|----------|
7
- | `AUTH_MISSING` | No API credentials set | Set `BITGET_API_KEY`, `BITGET_SECRET_KEY`, `BITGET_PASSPHRASE` |
8
- | `RATE_LIMITED` | Too many requests | Wait 1 second and retry |
9
- | `INVALID_SYMBOL` | Unknown trading pair | Check format: `BTCUSDT` not `BTC/USDT` |
10
- | `INSUFFICIENT_BALANCE` | Not enough funds | Check balance with `bgc account get_account_assets` |
11
- | `MODULE_FILTERED` | Module not enabled | Add module with `--modules` flag |
12
- | `TOOL_NOT_AVAILABLE` | Tool not in current session | Run `bgc <module> --help` |
13
- | `CONFIG_ERROR` | Invalid configuration | Check env vars and flags |
14
-
15
- ## Bitget API error codes
16
-
17
- | Code | Meaning | Recovery |
18
- |------|---------|----------|
19
- | `00000` | Success | — |
20
- | `40001` | Access denied | Check API key permissions |
21
- | `40003` | Invalid signature | Check `BITGET_SECRET_KEY` is correct |
22
- | `40005` | Invalid timestamp | System clock may be out of sync |
23
- | `40006` | IP not in whitelist | Add your IP to API key whitelist |
24
- | `40007` | Request expired | Retry the request |
25
- | `40009` | Duplicate client order id | Use a unique `clientOid` |
26
- | `40017` | Invalid API key | Re-check `BITGET_API_KEY` |
27
- | `40018` | API key permissions insufficient | Enable Trade permission on API key |
28
- | `40037` | API key does not exist | Verify key is active |
29
- | `40786` | Insufficient balance | Transfer funds to correct account |
30
- | `40788` | Price out of range | Adjust order price |
31
- | `43011` | Invalid parameter | Check required fields in request |
32
- | `43012` | Symbol does not exist | Verify symbol format (e.g. `BTCUSDT`) |
33
- | `43025` | Order does not exist | Order may have already been filled or cancelled |
34
- | `45110` | Minimum order size not met | Increase order size |
35
-
36
- ## Common recovery patterns
37
-
38
- **Missing credentials:**
1
+ # Bitget Errors (UTA / v3)
2
+
3
+ ## Error payload shape
4
+
5
+ On failure, `bgc` writes this JSON to **stderr** and exits **1**:
6
+
7
+ ```json
8
+ {
9
+ "ok": false,
10
+ "error": {
11
+ "type": "ValidationError",
12
+ "category": "param",
13
+ "message": "human-readable what-went-wrong",
14
+ "suggestion": "the concrete next step",
15
+ "retryable": false
16
+ },
17
+ "timestamp": "2026-06-18T09:38:09.514Z"
18
+ }
19
+ ```
20
+
21
+ > A high-risk write run without `--confirm` is **not** an error — it returns
22
+ > `{ confirmationRequired: true, ... }` on stdout (exit 0). Likewise `--dry-run`
23
+ > returns `{ dryRun: true, wouldSend, ... }` on stdout. Don't treat these as failures.
24
+
25
+ ## Branch on `error.category`
26
+
27
+ The category tells you how to recover without parsing the message:
28
+
29
+ | Category | Meaning | What to do |
30
+ |----------|---------|-----------|
31
+ | `auth` | Bad/missing credentials, signature, permission, IP | Fix credentials/permissions; do **not** retry blindly |
32
+ | `param` | Invalid/missing parameter, bad order/price/qty | Fix the request and resend |
33
+ | `balance` | Insufficient balance or margin | Surface to user — cannot self-heal |
34
+ | `risk` | Account at risk / liquidating | Surface to user — reduce risk first |
35
+ | `rate` | Throttled (too frequent / HTTP 429) | Back off and retry |
36
+ | `network` | Transient server/transport error (5xx, timeout) | Back off and retry |
37
+ | `region` | Geo-restricted | Fall back to another surface |
38
+ | `config` | Account not in UTA mode, unsupported mode switch | Check account mode / config |
39
+ | `unknown` | Uncategorized | Show message + suggestion to user |
40
+
41
+ `error.retryable` is the authoritative retry signal: only retry the identical call
42
+ when it is `true` (rate/network). Everything else needs a change first.
43
+
44
+ ## Error types (`error.type`)
45
+
46
+ - `ValidationError` — bad input or a blocked write (category `param`).
47
+ - `ConfigError` — bad configuration / partial credentials (category `config`/`auth`).
48
+ - `AuthenticationError` — signature/key/permission failure (category `auth`).
49
+ - `RateLimitError` — throttled (category `rate`, retryable).
50
+ - `NetworkError` — transport failure/timeout (category `network`, retryable).
51
+ - `BitgetApiError` — a Bitget API error code (see table below).
52
+
53
+ ## Curated Bitget API codes
54
+
55
+ A high-confidence subset; uncatalogued codes fall back to type-based classification.
56
+
57
+ ### Transport (HTTP status)
58
+
59
+ | Code | Category | Retry | Meaning |
60
+ |------|----------|-------|---------|
61
+ | `429` | rate | yes | Rate limit exceeded — back off and retry |
62
+ | `500`/`502`/`503`/`504` | network | yes | Transient server/upstream error — retry after backoff |
63
+
64
+ ### Account & trading (UTA `25xxx`)
65
+
66
+ | Code | Category | Retry | Meaning / fix |
67
+ |------|----------|-------|---------------|
68
+ | `25000` | network | yes | System error — retry |
69
+ | `25001` | network | yes | Operation timed out — retry |
70
+ | `25003` | network | yes | Concurrent operation conflict — retry |
71
+ | `25004` | rate | yes | Operations too frequent — slow down |
72
+ | `25008` | risk | no | Account in liquidation — cannot trade |
73
+ | `25009` | config | no | Unsupported account-mode switch |
74
+ | `25010` | config | no | Unsupported position-mode switch |
75
+ | `25012` | risk | no | Account at risk — add margin / close exposure first |
76
+ | `25110` | config | no | Coin can't be moved into the unified account |
77
+ | `25200` | param | no | Parameter validation failed — re-check the schema |
78
+ | `25202` | balance | no | Insufficient balance — fund the account or reduce size |
79
+ | `25203` | balance | no | Insufficient margin — add margin / lower leverage / reduce size |
80
+ | `25204` | param | no | Order not found — verify orderId/clientOid |
81
+ | `25207` | param | no | Quantity below the minimum — increase `qty` |
82
+ | `25212` | param | no | Duplicate `clientOid` — use a fresh idempotency key |
83
+ | `25236` | param | no | Incorrect open type — check `posSide`/`reduceOnly` vs position mode |
84
+ | `25244` | param | no | Price not a multiple of tick size — round to the price step |
85
+ | `25245` | config | no | Account not in unified (UTA) mode — switch to unified |
86
+ | `25620` | auth | no | No permission for this resource — enable it on the API key |
87
+
88
+ ### Auth (`40xxx`) & risk
89
+
90
+ | Code | Category | Retry | Meaning / fix |
91
+ |------|----------|-------|---------------|
92
+ | `40001` | auth | no | ACCESS_KEY empty — set `BITGET_API_KEY` |
93
+ | `40002` | auth | no | SECRET_KEY empty — set `BITGET_SECRET_KEY` |
94
+ | `40003` | auth | no | Signature empty — request not signed |
95
+ | `40006` | auth | no | Invalid ACCESS_KEY — verify the key |
96
+ | `40008` | auth | no | Timestamp expired — sync the local clock |
97
+ | `40009` | auth | no | Signature verification failed — check secret/payload |
98
+ | `40017` | auth | no | Signature parameter check failed — check key/secret/passphrase |
99
+ | `40018` | auth | no | Permission or IP restriction — check perms & IP whitelist |
100
+ | `40034` | param | no | A parameter is invalid/missing — re-check names and values |
101
+ | `40036` | auth | no | API key invalid/revoked — regenerate and update creds |
102
+ | `40042` | auth | no | Restricted institutional sub-account — use a different account |
103
+ | `95001` | risk | no | User being liquidated — wait until it completes |
104
+
105
+ ## Missing credentials
106
+
39
107
  ```bash
40
108
  export BITGET_API_KEY="your-key"
41
109
  export BITGET_SECRET_KEY="your-secret"
42
110
  export BITGET_PASSPHRASE="your-passphrase"
43
111
  ```
44
112
 
45
- **Wrong account type for transfer:**
46
- - Spot account: `spot`
47
- - USDT futures: `futures_usdt` (not `usdt-futures`)
48
- - Funding account: `mix_usdt`
113
+ All three are required together; providing a partial set is a `config` error.
114
+
115
+ ## `category` values (the v3 model)
49
116
 
50
- **Futures productType values:**
51
- - USDT-margined perpetuals: `USDT-FUTURES`
52
- - Coin-margined perpetuals: `COIN-FUTURES`
53
- - USDC-margined perpetuals: `USDC-FUTURES`
117
+ `SPOT`, `MARGIN`, `USDT-FUTURES`, `COIN-FUTURES`, `USDC-FUTURES`. There are no
118
+ separate spot/futures modules and no `productType` — one `--category` selects the market.
@@ -0,0 +1,163 @@
1
+ # Trading Safety (UTA / v3)
2
+
3
+ Read this before constructing futures close, TP/SL, cancel-all, or withdrawal
4
+ commands. For the exact parameter contract of any action, always confirm with
5
+ `bgc discover --tool <verb> --action <name>`.
6
+
7
+ ## Always preview a risky write
8
+
9
+ Run with `--dry-run` first to see the exact would-send payload, show it to the user,
10
+ then execute. For high-risk operations, the real run also needs `--confirm`.
11
+
12
+ ```bash
13
+ bgc order --action place --category USDT-FUTURES --symbol BTCUSDT \
14
+ --side sell --orderType market --qty 0.01 --reduceOnly yes --dry-run
15
+ ```
16
+
17
+ ## Closing a position (the #1 mistake)
18
+
19
+ Two ways to close, by whether you want a **market** close (fastest) or to exit **at your
20
+ own price**. Either way, check the position first so you get the side and mode right:
21
+
22
+ ```bash
23
+ bgc position --action info --category USDT-FUTURES --symbol BTCUSDT
24
+ ```
25
+
26
+ ### Market-close ONE position — `position --action close`
27
+
28
+ The direct way to flatten a single position at market. It **hard-requires `--symbol`**
29
+ (so it can never close the whole category by omission), is **high-risk → requires
30
+ `--confirm`**, and in hedge mode also needs `--posSide`:
31
+
32
+ ```bash
33
+ # one-way mode
34
+ bgc position --action close --category USDT-FUTURES --symbol BTCUSDT --confirm
35
+
36
+ # hedge mode — name the book you're closing
37
+ bgc position --action close --category USDT-FUTURES --symbol BTCUSDT --posSide long --confirm
38
+ ```
39
+
40
+ > Omitting `--symbol` is rejected with a clear error — use `closeAll` if you really mean
41
+ > the whole category.
42
+
43
+ ### Close at YOUR price — opposite-side `order --action place`
44
+
45
+ To exit at a chosen price (or with a limit) instead of at market, place an order on the
46
+ **opposite side** of the position with `--reduceOnly`. There is no `close` action on the
47
+ `order` verb itself — this is how you close through `order`.
48
+
49
+ #### One-way mode
50
+
51
+ A symbol holds one net position. Close it with the opposite `side` + `--reduceOnly yes`:
52
+
53
+ | Position | `--side` to close | Extra |
54
+ |----------|-------------------|-------|
55
+ | Long | `sell` | `--reduceOnly yes` |
56
+ | Short | `buy` | `--reduceOnly yes` |
57
+
58
+ ```bash
59
+ # Close a long in one-way mode, at a limit price
60
+ bgc order --action place --category USDT-FUTURES --symbol BTCUSDT \
61
+ --side sell --orderType limit --price 70000 --qty 0.01 --reduceOnly yes
62
+ ```
63
+
64
+ #### Hedge mode
65
+
66
+ Long and short books coexist. Set `--posSide` to the book you are closing and use the
67
+ opposite `--side`:
68
+
69
+ | Position book | `--posSide` | `--side` to close |
70
+ |---------------|-------------|-------------------|
71
+ | Long | `long` | `sell` |
72
+ | Short | `short` | `buy` |
73
+
74
+ ```bash
75
+ # Close the short book in hedge mode
76
+ bgc order --action place --category USDT-FUTURES --symbol BTCUSDT \
77
+ --side buy --orderType market --qty 0.01 --posSide short
78
+ ```
79
+
80
+ > **Selling to "close" a short opens MORE short.** Confirm the position's side before
81
+ > choosing `--side`.
82
+
83
+ ### Close EVERYTHING in a category — `position --action closeAll`
84
+
85
+ `position --action closeAll` flattens every position (optionally narrowed by
86
+ `--category` / `--symbol`). It is **high-risk and requires `--confirm`**. When you mean
87
+ just one position, prefer `--action close --symbol`:
88
+
89
+ ```bash
90
+ bgc position --action closeAll --category USDT-FUTURES --confirm
91
+ ```
92
+
93
+ ## Limit vs market: `--price` is conditionally required
94
+
95
+ - **Limit** orders **require `--price`** — omitting it is rejected.
96
+ - **Market** orders take **no `--price`** (the price is the market).
97
+ - In **hedge mode**, `--posSide` is required on the order.
98
+
99
+ `bgc discover --tool order --action place` reports these under `conditionalRequired` (and
100
+ `requiredWhen` on each field), so you can see the obligation before you send.
101
+
102
+ ## Take-profit / stop-loss
103
+
104
+ **Preset at entry** — attach to the opening `order --action place`:
105
+
106
+ ```bash
107
+ bgc order --action place --category USDT-FUTURES --symbol BTCUSDT \
108
+ --side buy --orderType limit --price 60000 --qty 0.01 \
109
+ --takeProfit 66000 --stopLoss 57000
110
+ ```
111
+
112
+ Fine-tune with `--tpTriggerBy` / `--slTriggerBy` (`market`|`mark`), `--tpOrderType` /
113
+ `--slOrderType` (`limit`|`market`), and `--tpLimitPrice` / `--slLimitPrice` (for limit
114
+ TP/SL). Confirm exact fields with `bgc discover --tool order --action place`.
115
+
116
+ **Manage after entry** — use the `strategy_order` verb (trigger/plan orders):
117
+
118
+ ```bash
119
+ bgc discover --tool strategy_order # place | cancel | modify | open | history
120
+ bgc strategy_order --action open --category USDT-FUTURES --symbol BTCUSDT
121
+ ```
122
+
123
+ ## Order quantity (`qty`) units — easy to get wrong
124
+
125
+ `qty` means different things by category and side:
126
+
127
+ | Market | `qty` unit |
128
+ |--------|-----------|
129
+ | Spot/Margin — **market BUY** | **quote coin (e.g. USDT)** |
130
+ | Spot/Margin — limit, or market SELL | base coin |
131
+ | USDT-FUTURES / USDC-FUTURES | base coin |
132
+ | COIN-FUTURES | quote coin |
133
+
134
+ > For a spot market buy, `--qty 100` means **100 USDT of BTC**, not 100 BTC. Confirm
135
+ > the user's intent before sizing a market buy.
136
+
137
+ ## Cancelling
138
+
139
+ - `order --action cancel` — cancel one order (needs `--orderId` or `--clientOid`).
140
+ - `order --action cancelAll` — **high-risk, requires `--confirm`**. Scope it with
141
+ `--category` / `--symbol` to avoid wiping unrelated orders.
142
+
143
+ ```bash
144
+ bgc order --action cancelAll --category SPOT --symbol BTCUSDT --confirm
145
+ ```
146
+
147
+ ## Withdrawals
148
+
149
+ `withdraw --action submit` is **high-risk and requires `--confirm`**. Withdrawals are
150
+ **irreversible**:
151
+
152
+ - Always show the **coin, chain, destination address, and amount** in the confirmation prompt.
153
+ - If the user hasn't named a chain, do not assume one — confirm it explicitly. A wrong
154
+ chain loses the funds.
155
+ - Preview with `--dry-run` and show the `wouldSend` payload before the real `--confirm` run.
156
+
157
+ ## High-risk operations (require `--confirm`)
158
+
159
+ `closeAllPositions` · `cancelAllOrders` · `withdrawal` · `brokerSubaccountWithdrawal`
160
+
161
+ Without `--confirm`, these return `{ confirmationRequired: true }` and send nothing —
162
+ that is a normal result, not an error. Surface it to the user, get a yes, then re-run
163
+ with `--confirm`.