@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,1258 +1,2387 @@
1
- # bgc Command Reference
1
+ # bgc Command Reference (UTA / v3)
2
2
 
3
- Auto-generated from @bitget-ai/bitget-agent-sdk tool definitions.
3
+ Auto-generated from `@bitget-ai/bitget-agent-sdk` v3.0.0 (OpenAPI spec 3.0.0, 109 operations, UTA (Unified Trading Account) v3).
4
+ Do not edit by hand — run `npm run gen-references`.
4
5
 
5
- ## Usage
6
+ This catalog is the **static** mirror of the live surface. For a verb's exact, doc-grounded contract at any moment, run `bgc discover --tool <verb> --action <name>`.
6
7
 
8
+ ## Grammar
9
+
10
+ ```
11
+ bgc <tool> [--action <name>] [--<param> <value> ...] [global flags]
12
+ bgc discover [--domain <d> | --tool <t> [--action <a>] | --search <q>]
13
+ bgc raw --operationId <id> [--args '<json>']
14
+ ```
15
+
16
+ One verb per call. `--action` selects the intent for action-routed verbs. Values coerce by shape: `true`/`false` → boolean, a value starting with `[` or `{` → JSON (e.g. `--orders '[{...}]'`), everything else stays a string. Output is JSON on stdout (exit 0); errors are a JSON payload on stderr (exit 1).
17
+
18
+ ## Global flags
19
+
20
+ | Flag | Effect |
21
+ |------|--------|
22
+ | `--action <name>` | Action for an action-routed verb |
23
+ | `--modules <list>` | Modules to enable (CLI default: `all`). Name a hidden to-B module to expose it, e.g. `--modules broker` |
24
+ | `--surface <mode>` | `intent` (default) or `full` (also expose the 1:1 generated operations) |
25
+ | `--full` | Shorthand for `--surface full` |
26
+ | `--read-only` | Block all writes (mutually exclusive with `--paper-trading`) |
27
+ | `--paper-trading` | Route writes to the Bitget demo environment (needs demo credentials) |
28
+ | `--dry-run` | Preview a write without sending it (maps to `dryRun`) |
29
+ | `--confirm` | Required to execute destructive (high-risk) writes |
30
+ | `--base-url <url>` | Override API base URL (else `BITGET_API_BASE_URL`) |
31
+ | `--timeout <ms>` | Per-request timeout (else `BITGET_TIMEOUT_MS`, default 15000) |
32
+ | `--pretty` | Pretty-print JSON output |
33
+ | `--help`, `--version` | Help / version |
34
+
35
+ ## Write safety
36
+
37
+ Every operation is graded **read** < **write** < **high**. Reads run freely. Writes honor `--dry-run`, `--read-only`, and `--paper-trading`. **High-risk** operations refuse to run without `--confirm` — without it the call returns `{ confirmationRequired: true }` (a normal result on stdout, not an error).
38
+
39
+ High-risk operations (require `--confirm`): `closeAllPositions`, `cancelAllOrders`, `withdrawal`, `brokerSubaccountWithdrawal`.
40
+
41
+ Common params available on most verbs (not repeated in the tables below): `dryRun`, `confirm` (writes); `view` (`summary`|`full`) and `fields` (read normalization / token economy); `fetchAll`, `cursor`, `limit` (paginated reads).
42
+
43
+ ## Domains
44
+
45
+ - **market** — [`market`](#market)
46
+ - **trade** — [`order`](#order), [`position`](#position), [`strategy_order`](#strategy-order)
47
+ - **account** — [`account_overview`](#account-overview), [`account_config`](#account-config), [`repayment`](#repayment)
48
+ - **funds** — [`transfer_funds`](#transfer-funds), [`deposit`](#deposit), [`withdraw`](#withdraw), [`funds_records`](#funds-records)
49
+ - **subaccount** — [`subaccount`](#subaccount)
50
+ - **broker** — [`broker`](#broker)
51
+ - **loan** — [`loan`](#loan)
52
+ - **instloan** — [`inst_loan`](#inst-loan)
53
+ - **tax** — [`tax`](#tax)
54
+ - **meta** — [`raw`](#raw), [`discover`](#discover)
55
+
56
+ ## Domain: market
57
+
58
+ ### `market`
59
+
60
+ risk: **read** · write: no · auth: public
61
+
62
+ [VERB] Public market data: tickers, orderbook, candles, instruments, funding rate, open interest, recent fills, and reference reads (no credentials required).
63
+
64
+ **Actions:** `tickers`, `orderbook`, `candles`, `candlesHistory`, `instruments`, `fundingRate`, `fundingRateHistory`, `openInterest`, `openInterestLimit`, `recentFills`, `positionTier`, `discountRate`, `indexComponents`, `marginLoan`, `proofOfReserves`, `riskReserve`
65
+
66
+ #### `bgc market --action tickers`
67
+
68
+ `GET /api/v3/market/tickers` · public
69
+
70
+ Get Tickers
71
+
72
+ Required:
73
+
74
+ | Param | Type | Enum | Description |
75
+ |-------|------|------|-------------|
76
+ | `category` | string | `SPOT` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type SPOT Spot trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
77
+
78
+ Optional:
79
+
80
+ | Param | Type | Enum | Description |
81
+ |-------|------|------|-------------|
82
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
83
+
84
+ ```bash
85
+ bgc market --action tickers --category <category>
86
+ ```
87
+
88
+ #### `bgc market --action orderbook`
89
+
90
+ `GET /api/v3/market/orderbook` · public
91
+
92
+ Get OrderBook
93
+
94
+ Required:
95
+
96
+ | Param | Type | Enum | Description |
97
+ |-------|------|------|-------------|
98
+ | `category` | string | `SPOT` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product Type SPOT Spot trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
99
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
100
+
101
+ Optional:
102
+
103
+ | Param | Type | Enum | Description |
104
+ |-------|------|------|-------------|
105
+ | `limit` | string | | Level Default: 5. Maximum: 200 |
106
+
107
+ ```bash
108
+ bgc market --action orderbook --category <category> --symbol <symbol>
109
+ ```
110
+
111
+ #### `bgc market --action candles`
112
+
113
+ `GET /api/v3/market/candles` · public
114
+
115
+ Get Kline/Candlestick
116
+
117
+ Required:
118
+
119
+ | Param | Type | Enum | Description |
120
+ |-------|------|------|-------------|
121
+ | `category` | string | `SPOT` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product Type SPOT Spot trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
122
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
123
+ | `interval` | string | `1m` \| `3m` \| `5m` \| `15m` \| `30m` \| `1H` \| `4H` \| `6H` \| `12H` \| `1D` | Granularity 1m,3m,5m,15m,30m,1H,4H,6H,12H,1D |
124
+
125
+ Optional:
126
+
127
+ | Param | Type | Enum | Description |
128
+ |-------|------|------|-------------|
129
+ | `startTime` | string | | Start timestamp A Unix millisecond timestamp, e.g.,1672410780000 |
130
+ | `endTime` | string | | End timestamp A Unix millisecond timestamp, e.g.,1672410781000 |
131
+ | `type` | string | `market` \| `mark` \| `index` \| `premium` | Candlestick type market, mark, index, premium. Default: market |
132
+ | `limit` | string | | Limit per page Default:1000. Maximum: 100 |
133
+
134
+ ```bash
135
+ bgc market --action candles --category <category> --symbol <symbol> --interval <interval>
136
+ ```
137
+
138
+ #### `bgc market --action candlesHistory`
139
+
140
+ `GET /api/v3/market/history-candles` · public
141
+
142
+ Get Kline/Candlestick History
143
+
144
+ Required:
145
+
146
+ | Param | Type | Enum | Description |
147
+ |-------|------|------|-------------|
148
+ | `category` | string | `SPOT` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product Type SPOT Spot trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
149
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
150
+ | `interval` | string | `1m` \| `3m` \| `5m` \| `15m` \| `30m` \| `1H` \| `4H` \| `6H` \| `12H` \| `1D` | Granularity 1m,3m,5m,15m,30m,1H,4H,6H,12H,1D |
151
+
152
+ Optional:
153
+
154
+ | Param | Type | Enum | Description |
155
+ |-------|------|------|-------------|
156
+ | `startTime` | string | | Start timestamp A Unix millisecond timestamp, e.g.,1672410780000 Request data after this start time (the maximum time query range is 90 days) |
157
+ | `endTime` | string | | End timestamp A Unix millisecond timestamp, e.g.,1672410781000 Request data before this end time (the maximum time query range is 90 days) |
158
+ | `type` | string | `market` \| `mark` \| `index` \| `premium` | Candlestick type market, mark, index, premium. Default: market |
159
+ | `limit` | string | | Limit per page Default:100. Maximum: 100 |
160
+
161
+ ```bash
162
+ bgc market --action candlesHistory --category <category> --symbol <symbol> --interval <interval>
163
+ ```
164
+
165
+ #### `bgc market --action instruments`
166
+
167
+ `GET /api/v3/market/instruments` · public
168
+
169
+ Get Instruments
170
+
171
+ Required:
172
+
173
+ | Param | Type | Enum | Description |
174
+ |-------|------|------|-------------|
175
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
176
+
177
+ Optional:
178
+
179
+ | Param | Type | Enum | Description |
180
+ |-------|------|------|-------------|
181
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
182
+
183
+ ```bash
184
+ bgc market --action instruments --category <category>
185
+ ```
186
+
187
+ #### `bgc market --action fundingRate`
188
+
189
+ `GET /api/v3/market/current-fund-rate` · public
190
+
191
+ Get Current Funding Rate
192
+
193
+ Required:
194
+
195
+ | Param | Type | Enum | Description |
196
+ |-------|------|------|-------------|
197
+ | `symbol` | string | | Trading pair, based on the symbolName, i.e. BTCUSDT |
198
+
199
+ ```bash
200
+ bgc market --action fundingRate --symbol <symbol>
201
+ ```
202
+
203
+ #### `bgc market --action fundingRateHistory`
204
+
205
+ `GET /api/v3/market/history-fund-rate` · public
206
+
207
+ Get Funding Rate History
208
+
209
+ Required:
210
+
211
+ | Param | Type | Enum | Description |
212
+ |-------|------|------|-------------|
213
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product Type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
214
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
215
+
216
+ Optional:
217
+
218
+ | Param | Type | Enum | Description |
219
+ |-------|------|------|-------------|
220
+ | `cursor` | string | | Page number Default: 1. Maximum: 100 |
221
+ | `limit` | string | | Limit per page Default: 200. Maximum: 200 |
222
+
223
+ ```bash
224
+ bgc market --action fundingRateHistory --category <category> --symbol <symbol>
225
+ ```
226
+
227
+ #### `bgc market --action openInterest`
228
+
229
+ `GET /api/v3/market/open-interest` · public
230
+
231
+ Get Open Interest
232
+
233
+ Required:
234
+
235
+ | Param | Type | Enum | Description |
236
+ |-------|------|------|-------------|
237
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product Type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
238
+
239
+ Optional:
240
+
241
+ | Param | Type | Enum | Description |
242
+ |-------|------|------|-------------|
243
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
244
+
245
+ ```bash
246
+ bgc market --action openInterest --category <category>
247
+ ```
248
+
249
+ #### `bgc market --action openInterestLimit`
250
+
251
+ `GET /api/v3/market/oi-limit` · public
252
+
253
+ Get Open Interest Limit
254
+
255
+ Required:
256
+
257
+ | Param | Type | Enum | Description |
258
+ |-------|------|------|-------------|
259
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type USDT-FUTURES USDT-M Futures COIN-FUTURES Coin-M Futures USDC-FUTURES USDC-M Futures |
260
+
261
+ Optional:
262
+
263
+ | Param | Type | Enum | Description |
264
+ |-------|------|------|-------------|
265
+ | `symbol` | string | | Trading pair, based on the symbolName, i.e. BTCUSDT |
266
+
267
+ ```bash
268
+ bgc market --action openInterestLimit --category <category>
269
+ ```
270
+
271
+ #### `bgc market --action recentFills`
272
+
273
+ `GET /api/v3/market/fills` · public
274
+
275
+ Get Recent Public Fills
276
+
277
+ Required:
278
+
279
+ | Param | Type | Enum | Description |
280
+ |-------|------|------|-------------|
281
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product Type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
282
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
283
+
284
+ Optional:
285
+
286
+ | Param | Type | Enum | Description |
287
+ |-------|------|------|-------------|
288
+ | `limit` | string | | Limit per page Default: 100. Maximum: 100 |
289
+
290
+ ```bash
291
+ bgc market --action recentFills --category <category> --symbol <symbol>
292
+ ```
293
+
294
+ #### `bgc market --action positionTier`
295
+
296
+ `GET /api/v3/market/position-tier` · public
297
+
298
+ Get Position Tier
299
+
300
+ Required:
301
+
302
+ | Param | Type | Enum | Description |
303
+ |-------|------|------|-------------|
304
+ | `category` | string | `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
305
+
306
+ Optional:
307
+
308
+ | Param | Type | Enum | Description |
309
+ |-------|------|------|-------------|
310
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT, applies to Futures |
311
+ | `coin` | string | | Coin name e.g.,BTC, applies to Margin |
312
+
313
+ ```bash
314
+ bgc market --action positionTier --category <category>
315
+ ```
316
+
317
+ #### `bgc market --action discountRate`
318
+
319
+ `GET /api/v3/market/discount-rate` · public
320
+
321
+ Get Discount Rate
322
+
323
+ _No business parameters._
324
+
325
+ ```bash
326
+ bgc market --action discountRate
327
+ ```
328
+
329
+ #### `bgc market --action indexComponents`
330
+
331
+ `GET /api/v3/market/index-components` · public
332
+
333
+ Get Index Price Components
334
+
335
+ Required:
336
+
337
+ | Param | Type | Enum | Description |
338
+ |-------|------|------|-------------|
339
+ | `symbol` | string | | Trading pair, e.g. BTCUSDT |
340
+
341
+ ```bash
342
+ bgc market --action indexComponents --symbol <symbol>
343
+ ```
344
+
345
+ #### `bgc market --action marginLoan`
346
+
347
+ `GET /api/v3/market/margin-loans` · public
348
+
349
+ Get Margin Loan
350
+
351
+ Required:
352
+
353
+ | Param | Type | Enum | Description |
354
+ |-------|------|------|-------------|
355
+ | `coin` | string | | Coin name e.g.,BTC |
356
+
357
+ ```bash
358
+ bgc market --action marginLoan --coin <coin>
359
+ ```
360
+
361
+ #### `bgc market --action proofOfReserves`
362
+
363
+ `GET /api/v3/market/proof-of-reserves` · public
364
+
365
+ Get Proof Of Reserves
366
+
367
+ _No business parameters._
368
+
369
+ ```bash
370
+ bgc market --action proofOfReserves
371
+ ```
372
+
373
+ #### `bgc market --action riskReserve`
374
+
375
+ `GET /api/v3/market/risk-reserve` · public
376
+
377
+ Get Risk Reserve
378
+
379
+ Required:
380
+
381
+ | Param | Type | Enum | Description |
382
+ |-------|------|------|-------------|
383
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
384
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
385
+
386
+ Optional:
387
+
388
+ | Param | Type | Enum | Description |
389
+ |-------|------|------|-------------|
390
+ | `marginCoin` | string | | Margin coin, It is required when the category is COIN-FUTURES |
391
+
392
+ ```bash
393
+ bgc market --action riskReserve --category <category> --symbol <symbol>
394
+ ```
395
+
396
+ ## Domain: trade
397
+
398
+ ### `order`
399
+
400
+ risk: **write** · write: no · auth: private
401
+
402
+ [VERB] Manage orders by intent: place/cancel/modify (single or batch via `orders`), cancelAll, countdownCancel, plus open/detail/history/fills reads. Writes honor dryRun/confirm/readOnly; cancelAll requires confirm.
403
+
404
+ **Actions:** `place`, `cancel`, `modify`, `cancelAll`, `countdownCancel`, `open`, `detail`, `history`, `fills`, `maxOpen`
405
+
406
+ #### `bgc order --action place`
407
+
408
+ `POST /api/v3/trade/place-order` · private · write
409
+
410
+ Place Order
411
+
412
+ Required:
413
+
414
+ | Param | Type | Enum | Description |
415
+ |-------|------|------|-------------|
416
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
417
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
418
+ | `qty` | string | | Order quantity Spot/Margin For market buy orders,the unit is quote coin For limit and market sell orders, the unit is base coin USDT/USDC-Futures The unit is base coin COIN-Futures The unit is quote coin |
419
+ | `side` | string | `buy` \| `sell` | Order side buy/sell |
420
+ | `orderType` | string | `limit` \| `market` | Order type limit/market |
421
+
422
+ Optional:
423
+
424
+ | Param | Type | Enum | Description |
425
+ |-------|------|------|-------------|
426
+ | `price` | string | | Order price This field is required when the order type is a limit order . This field is not applicable when the order type is a market order. |
427
+ | `timeInForce` | string | `ioc` \| `fok` \| `gtc` \| `post_only` | Time in force ioc Immediate or cancel. It must be executed immediately, with any unfilled portion canceled. fok Fill or kill. It must be fully executed immediately, or it is canceled entirely. gtc Good 'til canceled. It… |
428
+ | `posSide` | string | `long` \| `short` | Position side long/short This field is required in hedge-mode position. Available only for futures |
429
+ | `clientOid` | string | | Client order ID |
430
+ | `reduceOnly` | string | `yes` \| `no` | Reduce-only identifier yes/no, default no; yes indicates that your position may only be reduced in size upon the activation of this order |
431
+ | `stpMode` | string | `none` \| `cancel_taker` \| `cancel_maker` \| `cancel_both` | STP Mode(Self Trade Prevention) none: not setting STP(default) cancel_taker: cancel taker order cancel_maker: cancel maker order cancel_both: cancel both of taker and maker orders |
432
+ | `tpTriggerBy` | string | `market` \| `mark` | Preset Take-Profit Trigger Type market: Market Price mark: Mark Price If not specified, the default value is market price Note: This field is only valid for the contract business lines: USDT-Futures, COIN-Futures, and U… |
433
+ | `slTriggerBy` | string | `market` \| `mark` | Preset Stop-Loss Trigger Type market: Market Price mark: Mark Price If not filled in, the default value is market price Note: This field is only valid for the contract business lines: USDT-Futures, COIN-Futures, and USD… |
434
+ | `takeProfit` | string | | Preset Take-Profit Trigger Price |
435
+ | `stopLoss` | string | | Preset Stop-Loss Trigger Price |
436
+ | `tpOrderType` | string | `limit` \| `market` | Take-Profit Trigger Strategy Order Type limit: Limit Order market: Market Order |
437
+ | `slOrderType` | string | `limit` \| `market` | Stop-Loss Trigger Strategy Order Type limit: Limit Order market: Market Order |
438
+ | `tpLimitPrice` | string | | Take-Profit Strategy Order Execution Price This field is only valid for limit orders (when tpOrderType=limit); it is ignored for market orders. |
439
+ | `slLimitPrice` | string | | Stop-Loss Strategy Order Execution Price This field is only valid for limit orders (when slOrderType=limit); it is ignored for market orders. |
440
+
441
+ ```bash
442
+ bgc order --action place --category <category> --symbol <symbol> --qty <qty> --side <side> --orderType <orderType>
443
+ ```
444
+
445
+ #### `bgc order --action cancel`
446
+
447
+ `POST /api/v3/trade/cancel-order` · private · write
448
+
449
+ Cancel Order
450
+
451
+ Optional:
452
+
453
+ | Param | Type | Enum | Description |
454
+ |-------|------|------|-------------|
455
+ | `orderId` | string | | Order ID Either clientOid or orderId must be provided. If both are present or do not match, orderId will take priority |
456
+ | `clientOid` | string | | Client order ID Either clientOid or orderId must be provided. If both are present or do not match, orderId will take priority |
457
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
458
+
459
+ ```bash
460
+ bgc order --action cancel
461
+ ```
462
+
463
+ #### `bgc order --action modify`
464
+
465
+ `POST /api/v3/trade/modify-order` · private · write
466
+
467
+ Modify Order
468
+
469
+ Optional:
470
+
471
+ | Param | Type | Enum | Description |
472
+ |-------|------|------|-------------|
473
+ | `orderId` | string | | Order ID Either orderId or clientOid must be provided If both orderId and clientOid are provided simultaneously, orderId takes higher priority |
474
+ | `clientOid` | string | | Client order ID Either orderId or clientOid must be provided If both orderId and clientOid are provided simultaneously, orderId takes higher priority |
475
+ | `qty` | string | | Order quantity Base coin Either qty or price must be provided |
476
+ | `price` | string | | Order price Either qty or price must be provided |
477
+ | `autoCancel` | string | `yes` \| `no` | Will the original order be canceled if the order modification fails yes: Cancel no: Not cancel(default) |
478
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
479
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
480
+
481
+ ```bash
482
+ bgc order --action modify
483
+ ```
484
+
485
+ #### `bgc order --action cancelAll` — **[DANGER] requires `--confirm`**
486
+
487
+ `POST /api/v3/trade/cancel-symbol-order` · private · write
488
+
489
+ Cancel All Orders
490
+
491
+ Required:
492
+
493
+ | Param | Type | Enum | Description |
494
+ |-------|------|------|-------------|
495
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
496
+
497
+ Optional:
498
+
499
+ | Param | Type | Enum | Description |
500
+ |-------|------|------|-------------|
501
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT If no symbol is provided, all pending orders in the corresponding category will be closed. |
502
+
503
+ ```bash
504
+ bgc order --action cancelAll --category <category>
505
+ ```
506
+
507
+ #### `bgc order --action countdownCancel`
508
+
509
+ `POST /api/v3/trade/countdown-cancel-all` · private · write
510
+
511
+ CountDown Cancel All
512
+
513
+ Required:
514
+
515
+ | Param | Type | Enum | Description |
516
+ |-------|------|------|-------------|
517
+ | `countdown` | string | | Reconnect Window - Unit: seconds - Positive integer, range: [5, 60]. The minimum countdown is 5 second, and the maximum is 60 seconds. Filling in 0 cancels the countdown order cancellation function. |
518
+
519
+ ```bash
520
+ bgc order --action countdownCancel --countdown <countdown>
521
+ ```
522
+
523
+ #### `bgc order --action open`
524
+
525
+ `GET /api/v3/trade/unfilled-orders` · private
526
+
527
+ Get Open Orders
528
+
529
+ Optional:
530
+
531
+ | Param | Type | Enum | Description |
532
+ |-------|------|------|-------------|
533
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
534
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT \| |
535
+ | `startTime` | string | | Start timestamp A Unix timestamp in milliseconds e.g.,1597026383085 |
536
+ | `endTime` | string | | End timestamp A Unix timestamp in milliseconds e.g.,1597026383085 |
537
+ | `limit` | string | | Limit per page Default:100. Maximum:100 |
538
+ | `cursor` | string | | Cursor Pagination is implemented by omitting the cursor in the first query and applying the cursor from the previous query for subsequent pages |
539
+
540
+ ```bash
541
+ bgc order --action open
542
+ ```
543
+
544
+ #### `bgc order --action detail`
545
+
546
+ `GET /api/v3/trade/order-info` · private
547
+
548
+ Get Order Details
549
+
550
+ Optional:
551
+
552
+ | Param | Type | Enum | Description |
553
+ |-------|------|------|-------------|
554
+ | `orderId` | string | | Order ID Either clientOid or orderId must be provided. If both are present or do not match, orderId will take priority |
555
+ | `clientOid` | string | | Client order ID Either clientOid or orderId must be provided. If both are present or do not match, orderId will take priority |
556
+
557
+ ```bash
558
+ bgc order --action detail
559
+ ```
560
+
561
+ #### `bgc order --action history`
562
+
563
+ `GET /api/v3/trade/history-orders` · private
564
+
565
+ Get Order History
566
+
567
+ Required:
568
+
569
+ | Param | Type | Enum | Description |
570
+ |-------|------|------|-------------|
571
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
572
+
573
+ Optional:
574
+
575
+ | Param | Type | Enum | Description |
576
+ |-------|------|------|-------------|
577
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT \| |
578
+ | `startTime` | string | | Start timestamp A Unix timestamp in milliseconds e.g.,1597026383085 The access window is 90 days |
579
+ | `endTime` | string | | End timestamp A Unix timestamp in milliseconds e.g.,1597026383185 The time range between startTime and endTime must not exceed 30 days |
580
+ | `limit` | string | | Limit per page Default:100. Maximum:100 |
581
+ | `cursor` | string | | Cursor Pagination is implemented by omitting the cursor in the first query and applying the cursor from the previous query for subsequent pages |
582
+
583
+ ```bash
584
+ bgc order --action history --category <category>
585
+ ```
586
+
587
+ #### `bgc order --action fills`
588
+
589
+ `GET /api/v3/trade/fills` · private
590
+
591
+ Get Fill History
592
+
593
+ Optional:
594
+
595
+ | Param | Type | Enum | Description |
596
+ |-------|------|------|-------------|
597
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
598
+ | `orderId` | string | | Order ID |
599
+ | `startTime` | string | | Start timestamp A Unix timestamp in milliseconds e.g.,1597026383085 The access window is 90 days. |
600
+ | `endTime` | string | | End timestamp A Unix timestamp in milliseconds e.g.,1597026383185 The time range between startTime and endTime must not exceed 30 days. |
601
+ | `limit` | string | | Limit per page Default:100. Maximum:100 |
602
+ | `cursor` | string | | Cursor Pagination is implemented by omitting the cursor in the first query and applying the cursor from the previous query for subsequent pages |
603
+
604
+ ```bash
605
+ bgc order --action fills
606
+ ```
607
+
608
+ #### `bgc order --action maxOpen`
609
+
610
+ `POST /api/v3/account/max-open-available` · private
611
+
612
+ Get Max Open Available
613
+
614
+ Required:
615
+
616
+ | Param | Type | Enum | Description |
617
+ |-------|------|------|-------------|
618
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
619
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
620
+ | `orderType` | string | `limit` \| `market` | Order type limit/market |
621
+ | `side` | string | `buy` \| `sell` | Transaction direction buy/sell |
622
+
623
+ Optional:
624
+
625
+ | Param | Type | Enum | Description |
626
+ |-------|------|------|-------------|
627
+ | `price` | string | | Order price This field is required when orderType is limit |
628
+ | `size` | string | | Order quantity, base coin |
629
+
630
+ ```bash
631
+ bgc order --action maxOpen --category <category> --symbol <symbol> --orderType <orderType> --side <side>
632
+ ```
633
+
634
+ ### `position`
635
+
636
+ risk: **write** · write: no · auth: private
637
+
638
+ [VERB] Positions by intent: info (current) \| history \| adlRank \| close (ONE position by symbol, at market) \| closeAll (every position in a category). close & closeAll are destructive and require confirm; reads are n…
639
+
640
+ **Actions:** `info`, `history`, `adlRank`, `close`, `closeAll`
641
+
642
+ #### `bgc position --action info`
643
+
644
+ `GET /api/v3/position/current-position` · private
645
+
646
+ Get Position Info
647
+
648
+ Required:
649
+
650
+ | Param | Type | Enum | Description |
651
+ |-------|------|------|-------------|
652
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
653
+
654
+ Optional:
655
+
656
+ | Param | Type | Enum | Description |
657
+ |-------|------|------|-------------|
658
+ | `symbol` | string | | Symbol name e.g.BTCUSDT If no symbol is provided, all positions in the corresponding category will be returned. |
659
+ | `posSide` | string | `long` \| `short` | Position side long/short If this field is provided, only the position in the corresponding side will be returned. |
660
+
661
+ ```bash
662
+ bgc position --action info --category <category>
663
+ ```
664
+
665
+ #### `bgc position --action history`
666
+
667
+ `GET /api/v3/position/history-position` · private
668
+
669
+ Get Positions History
670
+
671
+ Required:
672
+
673
+ | Param | Type | Enum | Description |
674
+ |-------|------|------|-------------|
675
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
676
+
677
+ Optional:
678
+
679
+ | Param | Type | Enum | Description |
680
+ |-------|------|------|-------------|
681
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
682
+ | `startTime` | string | | Start timestamp A Unix timestamp in milliseconds e.g.,1597026383085 The access window is 90 days |
683
+ | `endTime` | string | | End timestamp A Unix timestamp in milliseconds e.g.,1597026383185 The time range between startTime and endTime must not exceed 30 days |
684
+ | `limit` | string | | Limit per page Default:100. Maximum:100 |
685
+ | `cursor` | string | | Cursor Pagination is implemented by omitting the cursor in the first query and applying the cursor from the previous query for subsequent pages |
686
+
687
+ ```bash
688
+ bgc position --action history --category <category>
7
689
  ```
8
- bgc <module> <tool_name> [--param value ...]
690
+
691
+ #### `bgc position --action adlRank`
692
+
693
+ `GET /api/v3/position/adlRank` · private
694
+
695
+ Get Position ADL Rank
696
+
697
+ _No business parameters._
698
+
699
+ ```bash
700
+ bgc position --action adlRank
9
701
  ```
10
702
 
11
- ## Module: spot
703
+ #### `bgc position --action close` — **[DANGER] requires `--confirm`**
12
704
 
13
- ### `spot_get_ticker`
705
+ `POST /api/v3/trade/close-positions` · private · write
14
706
 
15
- Get real-time ticker data for spot trading pair(s). Public endpoint. Rate limit: 20 req/s per IP.
707
+ Close All Positions
16
708
 
17
- **Write operation:** No
709
+ Required:
18
710
 
19
- **Parameters:**
711
+ | Param | Type | Enum | Description |
712
+ |-------|------|------|-------------|
713
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
714
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT If no symbol is provided, all positions in the corresponding category will be closed. |
20
715
 
21
- | Name | Type | Required | Description |
22
- |------|------|----------|-------------|
23
- | `symbol` | string | No | Trading pair symbol, e.g. BTCUSDT. Omit for all tickers. |
716
+ Optional:
717
+
718
+ | Param | Type | Enum | Description |
719
+ |-------|------|------|-------------|
720
+ | `posSide` | string | `long` \| `short` | Position side long/short If this field is provided, only the position in the corresponding side will be closed. |
24
721
 
25
- **Example:**
26
722
  ```bash
27
- bgc spot spot_get_ticker --symbol <value>
723
+ bgc position --action close --category <category> --symbol <symbol>
28
724
  ```
29
725
 
30
- ### `spot_get_depth`
726
+ #### `bgc position --action closeAll` — **[DANGER] requires `--confirm`**
727
+
728
+ `POST /api/v3/trade/close-positions` · private · write
31
729
 
32
- Get orderbook depth for a spot trading pair. Public endpoint. Rate limit: 20 req/s per IP.
730
+ Close All Positions
33
731
 
34
- **Write operation:** No
732
+ Required:
35
733
 
36
- **Parameters:**
734
+ | Param | Type | Enum | Description |
735
+ |-------|------|------|-------------|
736
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
37
737
 
38
- | Name | Type | Required | Description |
39
- |------|------|----------|-------------|
40
- | `symbol` | string | Yes | Trading pair symbol, e.g. BTCUSDT |
41
- | `type` | string | No | Depth merge level. step0 means raw orderbook. |
42
- | `limit` | number | No | Depth levels, default 150, max 150. |
738
+ Optional:
739
+
740
+ | Param | Type | Enum | Description |
741
+ |-------|------|------|-------------|
742
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT If no symbol is provided, all positions in the corresponding category will be closed. |
743
+ | `posSide` | string | `long` \| `short` | Position side long/short If this field is provided, only the position in the corresponding side will be closed. |
43
744
 
44
- **Example:**
45
745
  ```bash
46
- bgc spot spot_get_depth --symbol <value> --type <value>
746
+ bgc position --action closeAll --category <category>
47
747
  ```
48
748
 
49
- ### `spot_get_candles`
749
+ ### `strategy_order`
750
+
751
+ risk: **write** · write: no · auth: private
752
+
753
+ [VERB] Strategy (trigger/plan) orders by intent: place \| cancel \| modify \| open (unfilled) \| history. Writes honor dryRun/confirm/readOnly.
754
+
755
+ **Actions:** `place`, `cancel`, `modify`, `open`, `history`
50
756
 
51
- Get K-line data for spot trading pair. Public endpoint. Rate limit: 20 req/s per IP.
757
+ #### `bgc strategy_order --action place`
52
758
 
53
- **Write operation:** No
759
+ `POST /api/v3/trade/place-strategy-order` · private · write
54
760
 
55
- **Parameters:**
761
+ Place Strategy Order
56
762
 
57
- | Name | Type | Required | Description |
58
- |------|------|----------|-------------|
59
- | `symbol` | string | Yes | Trading pair symbol, e.g. BTCUSDT |
60
- | `granularity` | string | Yes | Candlestick period. |
61
- | `startTime` | string | No | Start time in milliseconds. |
62
- | `endTime` | string | No | End time in milliseconds. |
63
- | `limit` | number | No | Result size, default 100, max 1000. |
763
+ Required:
764
+
765
+ | Param | Type | Enum | Description |
766
+ |-------|------|------|-------------|
767
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
768
+ | `symbol` | string | | Symbol name e.g.,BTCUSDT |
769
+ | `qty` | string | | Order Quantity This is a required field when tpslMode=partial, and the unit is in the base coin |
770
+ | `posSide` | string | `long` \| `short` | Position side long/short |
771
+
772
+ Optional:
773
+
774
+ | Param | Type | Enum | Description |
775
+ |-------|------|------|-------------|
776
+ | `clientOid` | string | | Client order ID The idempotent validity period is six hours (not fully guaranteed) |
777
+ | `type` | string | `tpsl` | Strategy Type tpslTake-Profit and Stop-Loss Default:tpsl |
778
+ | `tpslMode` | string | `full` \| `partial` | Take-Profit and Stop-Loss Mode fullAll Positions Take-Profit and Stop-Loss partialPartial Position Take-Profit and Stop-Loss If left blank, the default value is full |
779
+ | `tpTriggerBy` | string | `market` \| `mark` | Take-Profit Trigger Type market: Market Price mark: Mark Price If not specified, the default value is market price |
780
+ | `slTriggerBy` | string | `market` \| `mark` | Stop-Loss Trigger Type market: Market Price mark: Mark Price If not filled in, the default value is market price |
781
+ | `takeProfit` | string | | Take-Profit Trigger Price |
782
+ | `stopLoss` | string | | Stop-Loss Trigger Price |
783
+ | `tpOrderType` | string | `limit` \| `market` | Take-Profit Trigger Strategy Order Type limit: Limit Order market: Market Order If not filled in, the default value is market price |
784
+ | `slOrderType` | string | `limit` \| `market` | Stop-Loss Trigger Strategy Order Type limit: Limit Order market: Market Order If not filled in, the default value is market price |
785
+ | `tpLimitPrice` | string | | Take-Profit Strategy Order Execution Price This field is only valid for limit orders (when tpOrderType=limit); it is ignored for market orders. |
786
+ | `slLimitPrice` | string | | Stop-Loss Strategy Order Execution Price This field is only valid for limit orders (when slOrderType=limit); it is ignored for market orders |
64
787
 
65
- **Example:**
66
788
  ```bash
67
- bgc spot spot_get_candles --symbol <value> --granularity <value>
789
+ bgc strategy_order --action place --category <category> --symbol <symbol> --qty <qty> --posSide <posSide>
68
790
  ```
69
791
 
70
- ### `spot_get_trades`
792
+ #### `bgc strategy_order --action cancel`
793
+
794
+ `POST /api/v3/trade/cancel-strategy-order` · private · write
71
795
 
72
- Get recent or historical trade records for spot symbol. Public endpoint. Rate limit: 10 req/s per IP.
796
+ Cancel Strategy Order
73
797
 
74
- **Write operation:** No
798
+ Required:
75
799
 
76
- **Parameters:**
800
+ | Param | Type | Enum | Description |
801
+ |-------|------|------|-------------|
802
+ | `orderId` | string | | Order ID Either orderId or clientOid must be provided If both orderId and clientOid are provided simultaneously, orderId takes higher priority |
77
803
 
78
- | Name | Type | Required | Description |
79
- |------|------|----------|-------------|
80
- | `symbol` | string | Yes | Trading pair symbol. |
81
- | `limit` | number | No | Result size, default 100, max 500. |
82
- | `startTime` | string | No | Start time in milliseconds. |
83
- | `endTime` | string | No | End time in milliseconds. |
804
+ Optional:
805
+
806
+ | Param | Type | Enum | Description |
807
+ |-------|------|------|-------------|
808
+ | `clientOid` | string | | Client order ID Either orderId or clientOid must be provided If both orderId and clientOid are provided simultaneously, orderId takes higher priority |
84
809
 
85
- **Example:**
86
810
  ```bash
87
- bgc spot spot_get_trades --symbol <value> --limit <value>
811
+ bgc strategy_order --action cancel --orderId <orderId>
88
812
  ```
89
813
 
90
- ### `spot_get_symbols`
814
+ #### `bgc strategy_order --action modify`
815
+
816
+ `POST /api/v3/trade/modify-strategy-order` · private · write
91
817
 
92
- Get spot symbol info or coin chain info. Public endpoint. Rate limit: 20 req/s per IP.
818
+ Modify Strategy Order
93
819
 
94
- **Write operation:** No
820
+ Required:
95
821
 
96
- **Parameters:**
822
+ | Param | Type | Enum | Description |
823
+ |-------|------|------|-------------|
824
+ | `orderId` | string | | Order ID Either orderId or clientOid must be provided If both orderId and clientOid are provided simultaneously, orderId takes higher priority |
825
+ | `qty` | string | | Order Quantity Can be modified under partial take-profit/stop-loss mode, and the unit is in the base coin |
97
826
 
98
- | Name | Type | Required | Description |
99
- |------|------|----------|-------------|
100
- | `type` | string | No | symbols(default) or coins. |
101
- | `symbol` | string | No | Specific symbol filter. |
102
- | `coin` | string | No | Specific coin filter. |
827
+ Optional:
828
+
829
+ | Param | Type | Enum | Description |
830
+ |-------|------|------|-------------|
831
+ | `clientOid` | string | | Client order ID Either orderId or clientOid must be provided If both orderId and clientOid are provided simultaneously, orderId takes higher priority |
832
+ | `tpTriggerBy` | string | `market` \| `mark` | Take-Profit Trigger Type market: Market Price mark: Mark Price |
833
+ | `slTriggerBy` | string | `market` \| `mark` | Stop-Loss Trigger Type market: Market Price mark: Mark Price |
834
+ | `takeProfit` | string | | Take-Profit Trigger Price |
835
+ | `stopLoss` | string | | Stop-Loss Trigger Price |
836
+ | `tpOrderType` | string | `limit` \| `market` | Take-Profit Trigger Strategy Order Type limit: Limit Order market: Market Order |
837
+ | `slOrderType` | string | `limit` \| `market` | Stop-Loss Trigger Strategy Order Type limit: Limit Order market: Market Order |
838
+ | `tpLimitPrice` | string | | Take-Profit Strategy Order Execution Price This field is only valid for limit orders (when tpOrderType=limit); it is ignored for market orders. |
839
+ | `slLimitPrice` | string | | Stop-Loss Strategy Order Execution Price This field is only valid for limit orders (when slOrderType=limit); it is ignored for market orders |
103
840
 
104
- **Example:**
105
841
  ```bash
106
- bgc spot spot_get_symbols --type <value> --symbol <value>
842
+ bgc strategy_order --action modify --orderId <orderId> --qty <qty>
107
843
  ```
108
844
 
109
- ### `spot_place_order`
845
+ #### `bgc strategy_order --action open`
846
+
847
+ `GET /api/v3/trade/unfilled-strategy-orders` · private
110
848
 
111
- Place one or more spot orders. [CAUTION] Executes real trades. Private endpoint. Rate limit: 10 req/s per UID.
849
+ Unfilled Strategy Orders
112
850
 
113
- **Write operation:** Yes — requires confirmation
851
+ Required:
114
852
 
115
- **Parameters:**
853
+ | Param | Type | Enum | Description |
854
+ |-------|------|------|-------------|
855
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
116
856
 
117
- | Name | Type | Required | Description |
118
- |------|------|----------|-------------|
119
- | `orders` | array | Yes | Array of order objects. Single order should still be passed as an array with one item. |
857
+ Optional:
858
+
859
+ | Param | Type | Enum | Description |
860
+ |-------|------|------|-------------|
861
+ | `type` | string | `tpsl` | Strategy Type tpslTake-Profit and Stop-Loss |
120
862
 
121
- **Example:**
122
863
  ```bash
123
- bgc spot spot_place_order --orders <value>
864
+ bgc strategy_order --action open --category <category>
124
865
  ```
125
866
 
126
- ### `spot_cancel_orders`
867
+ #### `bgc strategy_order --action history`
868
+
869
+ `GET /api/v3/trade/history-strategy-orders` · private
127
870
 
128
- Cancel one or more spot orders by id, batch ids, or symbol-wide cancel. Private endpoint. Rate limit: 10 req/s per UID.
871
+ History Strategy Orders
129
872
 
130
- **Write operation:** Yes — requires confirmation
873
+ Required:
131
874
 
132
- **Parameters:**
875
+ | Param | Type | Enum | Description |
876
+ |-------|------|------|-------------|
877
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
133
878
 
134
- | Name | Type | Required | Description |
135
- |------|------|----------|-------------|
136
- | `symbol` | string | Yes | Trading pair symbol. |
137
- | `orderId` | string | No | Single order id. |
138
- | `orderIds` | array | No | Multiple order ids. Max 50. |
139
- | `cancelAll` | boolean | No | If true, cancel all open orders for symbol. |
879
+ Optional:
880
+
881
+ | Param | Type | Enum | Description |
882
+ |-------|------|------|-------------|
883
+ | `type` | string | `tpsl` | Strategy Type tpslTake-Profit and Stop-Loss |
884
+ | `startTime` | string | | Start timestamp A Unix timestamp in milliseconds e.g.,1597026383085 |
885
+ | `endTime` | string | | End timestamp A Unix timestamp in milliseconds e.g.,1597026383085 |
886
+ | `limit` | string | | Limit per page Default:100. Maximum:100 |
887
+ | `cursor` | string | | Cursor Pagination is implemented by omitting the cursor in the first query and applying the cursor from the previous query for subsequent pages |
140
888
 
141
- **Example:**
142
889
  ```bash
143
- bgc spot spot_cancel_orders --symbol <value> --orderId <value>
890
+ bgc strategy_order --action history --category <category>
144
891
  ```
145
892
 
146
- ### `spot_modify_order`
893
+ ## Domain: account
894
+
895
+ ### `account_overview`
147
896
 
148
- Cancel and replace a spot order atomically. Private endpoint. Rate limit: 10 req/s per UID.
897
+ risk: **read** · write: no · auth: private
149
898
 
150
- **Write operation:** Yes — requires confirmation
899
+ [VERB] One-call account snapshot: fans out to assets, settings, funding assets, and (with category/symbol) positions and fee rate. Each section reports ok/error independently.
151
900
 
152
- **Parameters:**
901
+ Optional:
153
902
 
154
- | Name | Type | Required | Description |
155
- |------|------|----------|-------------|
156
- | `symbol` | string | Yes | Trading pair symbol. |
157
- | `orderId` | string | Yes | Original order id. |
158
- | `newPrice` | string | No | New price for limit order. |
159
- | `newSize` | string | No | New order size. |
160
- | `newClientOid` | string | No | New client order id. |
903
+ | Param | Type | Enum | Description |
904
+ |-------|------|------|-------------|
905
+ | `coin` | string | | Optional coin filter for funding assets. |
906
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | If provided, also fetches current positions (and fee rate when symbol is given too). |
907
+ | `symbol` | string | | With category, also fetches the fee rate for this symbol. |
908
+ | `view` | string | `summary` \| `full` | summary (default) trims null fields to save tokens; full returns the untouched payload. |
909
+ | `fields` | any | | Optional list (array or comma-separated string) of fields to keep on each returned row. |
161
910
 
162
- **Example:**
163
911
  ```bash
164
- bgc spot spot_modify_order --symbol <value> --orderId <value>
912
+ bgc account_overview
165
913
  ```
166
914
 
167
- ### `spot_get_orders`
915
+ ### `account_config`
168
916
 
169
- Query spot order detail, open orders, or history orders. Private endpoint. Rate limit: 10 req/s per UID.
917
+ risk: **write** · write: no · auth: private
170
918
 
171
- **Write operation:** No
919
+ [VERB] Account settings by intent: set account mode (basic/advanced), position holding mode (one-way/hedge), and leverage; switch account & fee-deduction; plus oiLimit / paymentCoins / switchStatus / deductInfo reads. (…
172
920
 
173
- **Parameters:**
921
+ **Actions:** `setAccountMode`, `setHoldingMode`, `setLeverage`, `switchAccount`, `switchDeduct`, `switchStatus`, `deductInfo`, `oiLimit`, `paymentCoins`
174
922
 
175
- | Name | Type | Required | Description |
176
- |------|------|----------|-------------|
177
- | `orderId` | string | No | Specific order id. |
178
- | `symbol` | string | No | Trading pair filter. |
179
- | `status` | string | No | open(default) or history. |
180
- | `startTime` | string | No | Start time in milliseconds. |
181
- | `endTime` | string | No | End time in milliseconds. |
182
- | `limit` | number | No | Result size, default 100. |
183
- | `idLessThan` | string | No | Pagination cursor. |
923
+ #### `bgc account_config --action setAccountMode`
924
+
925
+ `POST /api/v3/account/adjust-account-mode` · private · write
926
+
927
+ Adjust Account Mode
928
+
929
+ Required:
930
+
931
+ | Param | Type | Enum | Description |
932
+ |-------|------|------|-------------|
933
+ | `mode` | string | `basic` \| `advanced` | Account mode basic Basic mode advanced Advanced mode |
934
+
935
+ Optional:
936
+
937
+ | Param | Type | Enum | Description |
938
+ |-------|------|------|-------------|
939
+ | `targetUid` | string | | Target account UID. If not provided, it defaults to the currently operated account. If a sub-account UID is provided, it indicates the master account is operating on the sub-account. |
184
940
 
185
- **Example:**
186
941
  ```bash
187
- bgc spot spot_get_orders --orderId <value> --symbol <value>
942
+ bgc account_config --action setAccountMode --mode <mode>
188
943
  ```
189
944
 
190
- ### `spot_get_fills`
945
+ #### `bgc account_config --action setHoldingMode`
191
946
 
192
- Get spot fills for order execution details. Private endpoint. Rate limit: 10 req/s per UID.
947
+ `POST /api/v3/account/set-hold-mode` · private · write
193
948
 
194
- **Write operation:** No
949
+ Set Holding Mode
195
950
 
196
- **Parameters:**
951
+ Required:
197
952
 
198
- | Name | Type | Required | Description |
199
- |------|------|----------|-------------|
200
- | `symbol` | string | No | Trading pair symbol. |
201
- | `orderId` | string | No | Specific order id. |
202
- | `startTime` | string | No | Start time in milliseconds. |
203
- | `endTime` | string | No | End time in milliseconds. |
204
- | `limit` | number | No | Result size, default 100. |
953
+ | Param | Type | Enum | Description |
954
+ |-------|------|------|-------------|
955
+ | `holdMode` | string | `one_way_mode` \| `hedge_mode` | Holding mode one_way_mode This mode allows holding positions in a single direction, either long or short, but not both at the same time hedge_mode This mode allows holding both long and short positions simultaneously |
205
956
 
206
- **Example:**
207
957
  ```bash
208
- bgc spot spot_get_fills --symbol <value> --orderId <value>
958
+ bgc account_config --action setHoldingMode --holdMode <holdMode>
209
959
  ```
210
960
 
211
- ### `spot_place_plan_order`
961
+ #### `bgc account_config --action setLeverage`
962
+
963
+ `POST /api/v3/account/set-leverage` · private · write
964
+
965
+ Set Leverage
212
966
 
213
- Create or modify spot plan order (trigger order). Private endpoint. Rate limit: 10 req/s per UID.
967
+ Required:
214
968
 
215
- **Write operation:** Yes — requires confirmation
969
+ | Param | Type | Enum | Description |
970
+ |-------|------|------|-------------|
971
+ | `category` | string | `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURESCoin-M futures USDC-FUTURES USDC futures |
972
+ | `leverage` | string | | Leverage multiple |
216
973
 
217
- **Parameters:**
974
+ Optional:
218
975
 
219
- | Name | Type | Required | Description |
220
- |------|------|----------|-------------|
221
- | `orderId` | string | No | When provided, modify existing plan order. |
222
- | `symbol` | string | No | Trading pair symbol. |
223
- | `side` | string | No | Order side. |
224
- | `triggerPrice` | string | Yes | Trigger price. |
225
- | `triggerType` | string | No | Trigger source. |
226
- | `orderType` | string | No | Execution order type. |
227
- | `price` | string | No | Execution price for limit orders. |
228
- | `size` | string | No | Order quantity. |
976
+ | Param | Type | Enum | Description |
977
+ |-------|------|------|-------------|
978
+ | `symbol` | string | | Symbol name This field is required to set leverage for futures |
979
+ | `coin` | string | | Coin name This field is required to set leverage for margin trading |
980
+ | `posSide` | string | `long` \| `short` | Position side long/short This field is required to set leverage for isolated margin |
229
981
 
230
- **Example:**
231
982
  ```bash
232
- bgc spot spot_place_plan_order --orderId <value> --symbol <value>
983
+ bgc account_config --action setLeverage --category <category> --leverage <leverage>
233
984
  ```
234
985
 
235
- ### `spot_get_plan_orders`
986
+ #### `bgc account_config --action switchAccount`
236
987
 
237
- Get current or historical spot plan orders. Private endpoint. Rate limit: 10 req/s per UID.
988
+ `POST /api/v3/account/switch` · private · write
238
989
 
239
- **Write operation:** No
990
+ Switch Account
240
991
 
241
- **Parameters:**
992
+ _No business parameters._
242
993
 
243
- | Name | Type | Required | Description |
244
- |------|------|----------|-------------|
245
- | `symbol` | string | No | Trading pair symbol. |
246
- | `status` | string | No | current(default) or history. |
247
- | `startTime` | string | No | Start time in milliseconds. |
248
- | `endTime` | string | No | End time in milliseconds. |
249
- | `limit` | number | No | Result size, default 100. |
994
+ ```bash
995
+ bgc account_config --action switchAccount
996
+ ```
997
+
998
+ #### `bgc account_config --action switchDeduct`
999
+
1000
+ `POST /api/v3/account/switch-deduct` · private · write
1001
+
1002
+ Switch Deduct
1003
+
1004
+ Required:
1005
+
1006
+ | Param | Type | Enum | Description |
1007
+ |-------|------|------|-------------|
1008
+ | `deduct` | string | `on` \| `off` | Is it enabled on enabled off disabled |
250
1009
 
251
- **Example:**
252
1010
  ```bash
253
- bgc spot spot_get_plan_orders --symbol <value> --status <value>
1011
+ bgc account_config --action switchDeduct --deduct <deduct>
254
1012
  ```
255
1013
 
256
- ### `spot_cancel_plan_orders`
1014
+ #### `bgc account_config --action switchStatus`
1015
+
1016
+ `GET /api/v3/account/switch-status` · private
257
1017
 
258
- Cancel one or multiple spot plan orders. Private endpoint. Rate limit: 10 req/s per UID.
1018
+ Get Switch Status
259
1019
 
260
- **Write operation:** Yes — requires confirmation
1020
+ _No business parameters._
261
1021
 
262
- **Parameters:**
1022
+ ```bash
1023
+ bgc account_config --action switchStatus
1024
+ ```
1025
+
1026
+ #### `bgc account_config --action deductInfo`
1027
+
1028
+ `GET /api/v3/account/deduct-info` · private
263
1029
 
264
- | Name | Type | Required | Description |
265
- |------|------|----------|-------------|
266
- | `orderId` | string | No | Single plan order id. |
267
- | `symbol` | string | No | Cancel all plan orders for symbol. |
1030
+ Get Deduct Info
1031
+
1032
+ _No business parameters._
268
1033
 
269
- **Example:**
270
1034
  ```bash
271
- bgc spot spot_cancel_plan_orders --orderId <value> --symbol <value>
1035
+ bgc account_config --action deductInfo
272
1036
  ```
273
1037
 
274
- ## Module: futures
1038
+ #### `bgc account_config --action oiLimit`
1039
+
1040
+ `GET /api/v3/account/open-interest-limit` · private
1041
+
1042
+ Get OI Limit
1043
+
1044
+ Required:
275
1045
 
276
- ### `futures_get_ticker`
1046
+ | Param | Type | Enum | Description |
1047
+ |-------|------|------|-------------|
1048
+ | `symbol` | string | | Symbol e.g.,BTCUSDT |
1049
+ | `category` | string | `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` | Product type USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures |
277
1050
 
278
- Get futures ticker for one symbol or all symbols in product type. Public endpoint. Rate limit: 20 req/s per IP.
1051
+ ```bash
1052
+ bgc account_config --action oiLimit --symbol <symbol> --category <category>
1053
+ ```
279
1054
 
280
- **Write operation:** No
1055
+ #### `bgc account_config --action paymentCoins`
281
1056
 
282
- **Parameters:**
1057
+ `GET /api/v3/account/payment-coins` · private
283
1058
 
284
- | Name | Type | Required | Description |
285
- |------|------|----------|-------------|
286
- | `productType` | string | Yes | Futures product type. |
287
- | `symbol` | string | No | Contract symbol, e.g. BTCUSDT. |
1059
+ Get Payment Coins
1060
+
1061
+ _No business parameters._
288
1062
 
289
- **Example:**
290
1063
  ```bash
291
- bgc futures futures_get_ticker --productType <value> --symbol <value>
1064
+ bgc account_config --action paymentCoins
292
1065
  ```
293
1066
 
294
- ### `futures_get_depth`
1067
+ ### `repayment`
1068
+
1069
+ risk: **write** · write: no · auth: private
1070
+
1071
+ [VERB] Repay account liabilities: submit a repayment, or list repayable coins/amounts.
1072
+
1073
+ **Actions:** `submit`, `repayable`
1074
+
1075
+ #### `bgc repayment --action submit`
1076
+
1077
+ `POST /api/v3/account/repay` · private · write
295
1078
 
296
- Get futures orderbook depth with precision levels. Public endpoint. Rate limit: 20 req/s per IP.
1079
+ Repay
297
1080
 
298
- **Write operation:** No
1081
+ Required:
299
1082
 
300
- **Parameters:**
1083
+ | Param | Type | Enum | Description |
1084
+ |-------|------|------|-------------|
1085
+ | `repayableCoinList` | array | | Repayable coin list |
1086
+ | `paymentCoinList` | array | | Payment coin list |
301
1087
 
302
- | Name | Type | Required | Description |
303
- |------|------|----------|-------------|
304
- | `productType` | string | Yes | |
305
- | `symbol` | string | Yes | Contract symbol. |
306
- | `limit` | number | No | Depth levels, default 100. |
307
- | `precision` | string | No | Merge precision value. |
1088
+ ```bash
1089
+ bgc repayment --action submit --repayableCoinList <repayableCoinList> --paymentCoinList <paymentCoinList>
1090
+ ```
1091
+
1092
+ #### `bgc repayment --action repayable`
1093
+
1094
+ `GET /api/v3/account/repayable-coins` · private
1095
+
1096
+ Get Repayable Coins
1097
+
1098
+ _No business parameters._
308
1099
 
309
- **Example:**
310
1100
  ```bash
311
- bgc futures futures_get_depth --productType <value> --symbol <value>
1101
+ bgc repayment --action repayable
312
1102
  ```
313
1103
 
314
- ### `futures_get_candles`
1104
+ ## Domain: funds
1105
+
1106
+ ### `transfer_funds`
1107
+
1108
+ risk: **write** · write: no · auth: private
315
1109
 
316
- Get futures candles from trade/index/mark price sources. Public endpoint. Rate limit: 20 req/s per IP.
1110
+ [VERB] Move funds by intent: action internal \| mainToSub \| subToMain. preflight reports max transferable without moving anything; transfers honor dryRun/readOnly.
317
1111
 
318
- **Write operation:** No
1112
+ **Actions:** `internal`, `mainToSub`, `subToMain`
319
1113
 
320
- **Parameters:**
1114
+ #### `bgc transfer_funds --action internal`
321
1115
 
322
- | Name | Type | Required | Description |
323
- |------|------|----------|-------------|
324
- | `productType` | string | Yes | |
325
- | `symbol` | string | Yes | |
326
- | `granularity` | string | Yes | |
327
- | `priceType` | string | No | trade(default), index, or mark. |
328
- | `startTime` | string | No | |
329
- | `endTime` | string | No | |
330
- | `limit` | number | No | |
1116
+ `POST /api/v3/account/transfer` · private · write
1117
+
1118
+ Transfer
1119
+
1120
+ Required:
1121
+
1122
+ | Param | Type | Enum | Description |
1123
+ |-------|------|------|-------------|
1124
+ | `fromType` | string | `spot` \| `p2p` \| `coin_futures` \| `usdt_futures` \| `usdc_futures` \| `crossed_margin` \| `isolated_margin` \| `uta` | From (source) account type spot Spot account/Funding Account p2p P2P account/OTC account coin_futures Coin-M futures account usdt_futures USDT futures account usdc_futures USDC futures account crossed_margin Cross margi… |
1125
+ | `toType` | string | `spot` \| `p2p` \| `coin_futures` \| `usdt_futures` \| `usdc_futures` \| `crossed_margin` \| `isolated_margin` \| `uta` | To (target) account type spot Spot account/Funding Account p2p P2P account/OTC account coin_futures Coin-M futures account usdt_futures USDT futures account usdc_futures USDC futures account crossed_margin Cross margin … |
1126
+ | `amount` | string | | transfer amount |
1127
+ | `coin` | string | | transfer coin e.g: BTC |
1128
+
1129
+ Optional:
1130
+
1131
+ | Param | Type | Enum | Description |
1132
+ |-------|------|------|-------------|
1133
+ | `symbol` | string | | Isolated spot margin e.g: BTCUSDT |
1134
+ | `allowBorrow` | string | | Body field allowBorrow. |
331
1135
 
332
- **Example:**
333
1136
  ```bash
334
- bgc futures futures_get_candles --productType <value> --symbol <value>
1137
+ bgc transfer_funds --action internal --fromType <fromType> --toType <toType> --amount <amount> --coin <coin>
335
1138
  ```
336
1139
 
337
- ### `futures_get_trades`
1140
+ #### `bgc transfer_funds --action mainToSub`
1141
+
1142
+ `POST /api/v3/account/sub-transfer` · private · write
338
1143
 
339
- Get recent or historical futures trade records. Public endpoint. Rate limit: 10 req/s per IP.
1144
+ Main-Sub Account Transfer
340
1145
 
341
- **Write operation:** No
1146
+ Required:
342
1147
 
343
- **Parameters:**
1148
+ | Param | Type | Enum | Description |
1149
+ |-------|------|------|-------------|
1150
+ | `fromType` | string | `spot` \| `p2p` \| `usdt_futures` \| `coin_futures` \| `usdc_futures` \| `crossed_margin` \| `uta` | Transferring Account Type spot Spot account/Funding account p2p P2P account/OTC account usdt_futures USDT-Margined Futures Account coin_futures Coin-Margined Futures Account usdc_futures USDC Futures Account crossed_mar… |
1151
+ | `toType` | string | `spot` \| `p2p` \| `usdt_futures` \| `coin_futures` \| `usdc_futures` \| `crossed_margin` \| `uta` | Receiving Account Type spot Spot account/Funding account p2p P2P account/OTC account usdt_futures USDT-Margined Futures Account coin_futures Coin-Margined Futures Account usdc_futures USDC Futures Account crossed_margin… |
1152
+ | `amount` | string | | Amount to Transfer In |
1153
+ | `coin` | string | | Transfer Currency, e.g., BTC |
1154
+ | `fromUserId` | string | | Transferring Account UID |
1155
+ | `toUserId` | string | | Receiving Account UID |
1156
+ | `clientOid` | string | | clientOid,Cannot exceed 64 characters. |
344
1157
 
345
- | Name | Type | Required | Description |
346
- |------|------|----------|-------------|
347
- | `productType` | string | Yes | |
348
- | `symbol` | string | Yes | |
349
- | `limit` | number | No | |
350
- | `startTime` | string | No | |
351
- | `endTime` | string | No | |
1158
+ Optional:
1159
+
1160
+ | Param | Type | Enum | Description |
1161
+ |-------|------|------|-------------|
1162
+ | `allowBorrow` | string | | Body field allowBorrow. |
352
1163
 
353
- **Example:**
354
1164
  ```bash
355
- bgc futures futures_get_trades --productType <value> --symbol <value>
1165
+ bgc transfer_funds --action mainToSub --fromType <fromType> --toType <toType> --amount <amount> --coin <coin> --fromUserId <fromUserId> --toUserId <toUserId> --clientOid <clientOid>
356
1166
  ```
357
1167
 
358
- ### `futures_get_contracts`
1168
+ #### `bgc transfer_funds --action subToMain`
1169
+
1170
+ `POST /api/v3/account/sub-master-transfer` · private · write
359
1171
 
360
- Get futures contract configuration details. Public endpoint. Rate limit: 20 req/s per IP.
1172
+ Sub-Main Account Transfer
361
1173
 
362
- **Write operation:** No
1174
+ Required:
363
1175
 
364
- **Parameters:**
1176
+ | Param | Type | Enum | Description |
1177
+ |-------|------|------|-------------|
1178
+ | `fromType` | string | `spot` \| `uta` | Transferring Account Type spot Funding account uta Unified Account |
1179
+ | `toType` | string | `spot` \| `p2p` \| `uta` | Receiving Account Type spot Funding account p2p OTC account uta Unified Account |
1180
+ | `amount` | string | | Amount to Transfer In |
1181
+ | `coin` | string | | Transfer Currency, e.g., BTC |
365
1182
 
366
- | Name | Type | Required | Description |
367
- |------|------|----------|-------------|
368
- | `productType` | string | Yes | |
369
- | `symbol` | string | No | Optional symbol filter. |
1183
+ Optional:
1184
+
1185
+ | Param | Type | Enum | Description |
1186
+ |-------|------|------|-------------|
1187
+ | `clientOid` | string | | clientOid,Cannot exceed 64 characters. |
370
1188
 
371
- **Example:**
372
1189
  ```bash
373
- bgc futures futures_get_contracts --productType <value> --symbol <value>
1190
+ bgc transfer_funds --action subToMain --fromType <fromType> --toType <toType> --amount <amount> --coin <coin>
374
1191
  ```
375
1192
 
376
- ### `futures_get_funding_rate`
1193
+ ### `deposit`
1194
+
1195
+ risk: **write** · write: no · auth: private
1196
+
1197
+ [VERB] Deposits by intent: address (get a deposit address) \| records (deposit history) \| setupAccount.
1198
+
1199
+ **Actions:** `address`, `records`, `setupAccount`
377
1200
 
378
- Get current or historical funding rates for a futures symbol. Public endpoint. Rate limit: 20 req/s per IP.
1201
+ #### `bgc deposit --action address`
379
1202
 
380
- **Write operation:** No
1203
+ `GET /api/v3/account/deposit-address` · private
381
1204
 
382
- **Parameters:**
1205
+ Get Deposit Address
383
1206
 
384
- | Name | Type | Required | Description |
385
- |------|------|----------|-------------|
386
- | `productType` | string | Yes | |
387
- | `symbol` | string | Yes | |
388
- | `history` | boolean | No | true for historical funding rates. |
389
- | `pageSize` | number | No | Page size for history mode. |
390
- | `pageNo` | number | No | Page number for history mode. |
1207
+ Required:
1208
+
1209
+ | Param | Type | Enum | Description |
1210
+ |-------|------|------|-------------|
1211
+ | `coin` | string | | Coin name - The currency name can be obtained using the Get Currency Information API. |
1212
+
1213
+ Optional:
1214
+
1215
+ | Param | Type | Enum | Description |
1216
+ |-------|------|------|-------------|
1217
+ | `chain` | string | | Chain Name - The chain name can be obtained using the Get Currency Information API. - If not filled, the system will automatically match a chain to generate a deposit address |
1218
+ | `size` | string | | Deposit Quantity - Only applies to BTC Lightning Network - Limit range: 0.000001 - 0.01. |
391
1219
 
392
- **Example:**
393
1220
  ```bash
394
- bgc futures futures_get_funding_rate --productType <value> --symbol <value>
1221
+ bgc deposit --action address --coin <coin>
395
1222
  ```
396
1223
 
397
- ### `futures_get_open_interest`
1224
+ #### `bgc deposit --action records`
1225
+
1226
+ `GET /api/v3/account/deposit-records` · private
398
1227
 
399
- Get open interest for a futures contract. Public endpoint. Rate limit: 20 req/s per IP.
1228
+ Get Deposit Records
400
1229
 
401
- **Write operation:** No
1230
+ Required:
402
1231
 
403
- **Parameters:**
1232
+ | Param | Type | Enum | Description |
1233
+ |-------|------|------|-------------|
1234
+ | `startTime` | string | | Query record start time<ul><li>Unix millisecond timestamp, e.g., 1690196141868</li></ul> |
1235
+ | `endTime` | string | | Query record end time<ul><li>Unix millisecond timestamp, e.g., 1690196141868</li></ul> |
404
1236
 
405
- | Name | Type | Required | Description |
406
- |------|------|----------|-------------|
407
- | `productType` | string | Yes | |
408
- | `symbol` | string | Yes | |
1237
+ Optional:
1238
+
1239
+ | Param | Type | Enum | Description |
1240
+ |-------|------|------|-------------|
1241
+ | `coin` | string | | Coin name - If left blank, all currency deposit records will be retrieved. |
1242
+ | `limit` | string | | Items per page The default value is 20, and the maximum value is 100. |
1243
+ | `cursor` | string | | Cursor ID - Used for pagination to reduce query response time - Do not send for the initial query. When querying the second page and subsequent data, use the smallest orderId returned from the previous query. The result… |
1244
+ | `orderId` | string | | Order ID - Used for specifying order queries. |
409
1245
 
410
- **Example:**
411
1246
  ```bash
412
- bgc futures futures_get_open_interest --productType <value> --symbol <value>
1247
+ bgc deposit --action records --startTime <startTime> --endTime <endTime>
413
1248
  ```
414
1249
 
415
- ### `futures_place_order`
1250
+ #### `bgc deposit --action setupAccount`
416
1251
 
417
- Place one or more futures orders with optional TP/SL. [CAUTION] Executes real trades. Private endpoint. Rate limit: 10 req/s per UID.
1252
+ `POST /api/v3/account/deposit-account` · private · write
418
1253
 
419
- **Write operation:** Yes — requires confirmation
1254
+ Set Up Deposit Account
420
1255
 
421
- **Parameters:**
1256
+ Required:
422
1257
 
423
- | Name | Type | Required | Description |
424
- |------|------|----------|-------------|
425
- | `orders` | array | Yes | Array of futures order objects. |
1258
+ | Param | Type | Enum | Description |
1259
+ |-------|------|------|-------------|
1260
+ | `coin` | string | | Recharge coin 如BTC |
1261
+ | `accountType` | string | `funding` \| `unified` \| `otc` | Account type funding Funding account unified Unified account otc OTC account The current default is the funding account, and it can be modified to a unified account or an OTC account |
426
1262
 
427
- **Example:**
428
1263
  ```bash
429
- bgc futures futures_place_order --orders <value>
1264
+ bgc deposit --action setupAccount --coin <coin> --accountType <accountType>
430
1265
  ```
431
1266
 
432
- ### `futures_modify_order`
1267
+ ### `withdraw`
1268
+
1269
+ risk: **write** · write: no · auth: private
1270
+
1271
+ [VERB] Withdrawals by intent: submit (send funds out — irreversible, needs confirm) \| records (withdrawal history).
1272
+
1273
+ **Actions:** `submit`, `records`
1274
+
1275
+ #### `bgc withdraw --action submit` — **[DANGER] requires `--confirm`**
1276
+
1277
+ `POST /api/v3/account/withdrawal` · private · write
1278
+
1279
+ Withdrawal
433
1280
 
434
- Modify a pending futures order: adjust TP/SL prices, size, or limit price. Modifying TP/SL only does NOT cancel the order. Modifying size/price cancels and recreates it. Pass '0' for newPresetStopSurplusPrice or newPresetStopLossPrice to delete that preset. [CAUTION] Affects live orders. Private endpoint. Rate limit: 10 req/s per UID.
1281
+ Required:
435
1282
 
436
- **Write operation:** Yes — requires confirmation
1283
+ | Param | Type | Enum | Description |
1284
+ |-------|------|------|-------------|
1285
+ | `coin` | string | | Coin name |
1286
+ | `transferType` | string | `on_chain` \| `internal_transfer` | Withdrawal Type on_chainOn-chain deposit internal_transferInternal transfer |
1287
+ | `address` | string | | Withdrawal Address - When transferType is on_chain, fill in the chain address. - When transferType is internal_transfer, fill in the UID, email, or mobile number based on innerToType. |
1288
+ | `size` | string | | Withdrawal Quantity Special Notes for Bitcoin Lightning Network Withdrawals: This parameter must exactly match the amount on the Bitcoin Lightning Network deposit invoice; The withdrawal quantity for Bitcoin Lightning N… |
437
1289
 
438
- **Parameters:**
1290
+ Optional:
439
1291
 
440
- | Name | Type | Required | Description |
441
- |------|------|----------|-------------|
442
- | `symbol` | string | Yes | Trading pair, e.g. BTCUSDT. |
443
- | `productType` | string | Yes | Futures product type. |
444
- | `marginCoin` | string | Yes | Margin asset, e.g. USDT. |
445
- | `orderId` | string | No | Order ID. One of orderId or clientOid required. |
446
- | `clientOid` | string | No | Custom order ID. orderId takes priority if both provided. |
447
- | `newClientOid` | string | Yes | New custom order ID for the modified order. |
448
- | `newSize` | string | No | New order quantity. Must be provided together with newPrice. |
449
- | `newPrice` | string | No | New limit price. Must be provided together with newSize. |
450
- | `newPresetStopSurplusPrice` | string | No | New take-profit trigger price. Pass '0' to delete. |
451
- | `newPresetStopLossPrice` | string | No | New stop-loss trigger price. Pass '0' to delete. |
1292
+ | Param | Type | Enum | Description |
1293
+ |-------|------|------|-------------|
1294
+ | `chain` | string | | Blockchain Network - For example, erc20, trc20, etc. - This parameter is required when transferType=on_chain - The chain name can be obtained using the Get Currency Information API. |
1295
+ | `innerToType` | string | `uid` \| `email` \| `mobile` | Internal Withdrawal Address Type uidUser ID email Email mobile Mobile phone number - If not filled, the default value is uid |
1296
+ | `areaCode` | string | | Area Code This parameter is required when innerToType = mobile |
1297
+ | `tag` | string | | Address Tag This is required for withdrawals of certain cryptocurrencies, like EOS. |
1298
+ | `remark` | string | | Remark |
1299
+ | `clientOid` | string | | Client Order ID |
1300
+ | `memberCode` | string | | Member Code bithumb korbit coinone |
1301
+ | `identityType` | string | `company` \| `user` | Identity Type companyInstitutional Company user Individual User |
1302
+ | `companyName` | string | | Company Name Fill in this parameter when identity=company |
1303
+ | `firstName` | string | | First Name Fill in this parameter when identity=user |
1304
+ | `lastName` | string | | Last Name Fill in this parameter when identity=user |
452
1305
 
453
- **Example:**
454
1306
  ```bash
455
- bgc futures futures_modify_order --symbol <value> --productType <value>
1307
+ bgc withdraw --action submit --coin <coin> --transferType <transferType> --address <address> --size <size>
456
1308
  ```
457
1309
 
458
- ### `futures_cancel_orders`
1310
+ #### `bgc withdraw --action records`
459
1311
 
460
- Cancel futures orders by order id, batch ids, or cancel-all mode. Private endpoint. Rate limit: 10 req/s per UID.
1312
+ `GET /api/v3/account/withdrawal-records` · private
461
1313
 
462
- **Write operation:** Yes — requires confirmation
1314
+ Get Withdrawal Records
463
1315
 
464
- **Parameters:**
1316
+ Required:
465
1317
 
466
- | Name | Type | Required | Description |
467
- |------|------|----------|-------------|
468
- | `productType` | string | Yes | |
469
- | `symbol` | string | Yes | |
470
- | `orderId` | string | No | |
471
- | `orderIds` | array | No | |
472
- | `cancelAll` | boolean | No | |
473
- | `marginCoin` | string | No | |
1318
+ | Param | Type | Enum | Description |
1319
+ |-------|------|------|-------------|
1320
+ | `startTime` | string | | Query record start time<ul><li>Unix millisecond timestamp, e.g., 1690196141868</li></ul> |
1321
+ | `endTime` | string | | Query record end time<ul><li>Unix millisecond timestamp, e.g., 1690196141868</li></ul> |
1322
+
1323
+ Optional:
1324
+
1325
+ | Param | Type | Enum | Description |
1326
+ |-------|------|------|-------------|
1327
+ | `coin` | string | | Coin name - If not filled in, all coin deposit records will be retrieved. |
1328
+ | `orderId` | string | | order ID - Either clientOid or orderId must be provided. If both are present or do not match, orderId will take priority |
1329
+ | `clientOid` | string | | Client Order ID - Either clientOid or orderId must be provided. If both are present or do not match, orderId will take priority |
1330
+ | `limit` | string | | Items per page The default value is 20, and the maximum value is 100. |
1331
+ | `cursor` | string | | Cursor ID - Used for pagination to reduce query response time - Do not send for the initial query. When querying the second page and subsequent data, use the smallest orderId returned from the previous query. The result… |
474
1332
 
475
- **Example:**
476
1333
  ```bash
477
- bgc futures futures_cancel_orders --productType <value> --symbol <value>
1334
+ bgc withdraw --action records --startTime <startTime> --endTime <endTime>
478
1335
  ```
479
1336
 
480
- ### `futures_get_orders`
1337
+ ### `funds_records`
1338
+
1339
+ risk: **read** · write: no · auth: private
1340
+
1341
+ [VERB] Funds history (read-only): financial ledger \| convert records \| main↔sub transfer records \| transferableCoins.
1342
+
1343
+ **Actions:** `financial`, `convert`, `subTransfers`, `transferableCoins`
1344
+
1345
+ #### `bgc funds_records --action financial`
1346
+
1347
+ `GET /api/v3/account/financial-records` · private
1348
+
1349
+ Get Financial Records
481
1350
 
482
- Query futures orders by id, open status, or history. Private endpoint. Rate limit: 10 req/s per UID.
1351
+ Required:
483
1352
 
484
- **Write operation:** No
1353
+ | Param | Type | Enum | Description |
1354
+ |-------|------|------|-------------|
1355
+ | `category` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` \| `OTHER` | Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures OTHER Other |
485
1356
 
486
- **Parameters:**
1357
+ Optional:
487
1358
 
488
- | Name | Type | Required | Description |
489
- |------|------|----------|-------------|
490
- | `productType` | string | Yes | |
491
- | `orderId` | string | No | |
492
- | `symbol` | string | No | |
493
- | `status` | string | No | |
494
- | `startTime` | string | No | |
495
- | `endTime` | string | No | |
496
- | `limit` | number | No | |
1359
+ | Param | Type | Enum | Description |
1360
+ |-------|------|------|-------------|
1361
+ | `coin` | string | | Coin name e.g.,BTC |
1362
+ | `type` | string | `TRANSFER_IN` \| `TRANSFER_OUT` | Type TRANSFER_IN/TRANSFER_OUT...... All enumeration values can be viewed under the Enumeration category. |
1363
+ | `startTime` | string | | Start timestamp A Unix timestamp in milliseconds e.g.,1597026383085 The access window is 90 days |
1364
+ | `endTime` | string | | End timestamp A Unix timestamp in milliseconds e.g.,1597026383185 The time range between startTime and endTime must not exceed 30 days |
1365
+ | `limit` | string | | Limit per page Default:100. Maximum:100 |
1366
+ | `cursor` | string | | Cursor Pagination is implemented by omitting the cursor in the first query and applying the cursor from the previous query for subsequent pages |
497
1367
 
498
- **Example:**
499
1368
  ```bash
500
- bgc futures futures_get_orders --productType <value> --orderId <value>
1369
+ bgc funds_records --action financial --category <category>
501
1370
  ```
502
1371
 
503
- ### `futures_get_fills`
1372
+ #### `bgc funds_records --action convert`
504
1373
 
505
- Get futures fills and fill history records. Private endpoint. Rate limit: 10 req/s per UID.
1374
+ `GET /api/v3/account/convert-records` · private
506
1375
 
507
- **Write operation:** No
1376
+ Get Convert Records
508
1377
 
509
- **Parameters:**
1378
+ Required:
510
1379
 
511
- | Name | Type | Required | Description |
512
- |------|------|----------|-------------|
513
- | `productType` | string | Yes | |
514
- | `symbol` | string | No | |
515
- | `orderId` | string | No | |
516
- | `startTime` | string | No | |
517
- | `endTime` | string | No | |
518
- | `limit` | number | No | |
1380
+ | Param | Type | Enum | Description |
1381
+ |-------|------|------|-------------|
1382
+ | `fromCoin` | string | | From coin (source coin) It refers to the coin being converted |
1383
+ | `toCoin` | string | | To coin (target coin) It refers to the coin being converted into (received) |
1384
+
1385
+ Optional:
1386
+
1387
+ | Param | Type | Enum | Description |
1388
+ |-------|------|------|-------------|
1389
+ | `startTime` | string | | Start timestamp A Unix timestamp in milliseconds e.g.,1597026383085 The access window is 90 days |
1390
+ | `endTime` | string | | End timestamp A Unix timestamp in milliseconds e.g.,1597026383185 The time range between startTime and endTime must not exceed 30 days |
1391
+ | `limit` | string | | Limit per page Default:100. Maximum:100 |
1392
+ | `cursor` | string | | Cursor Pagination is implemented by omitting the cursor in the first query and applying the cursor from the previous query for subsequent pages |
519
1393
 
520
- **Example:**
521
1394
  ```bash
522
- bgc futures futures_get_fills --productType <value> --symbol <value>
1395
+ bgc funds_records --action convert --fromCoin <fromCoin> --toCoin <toCoin>
523
1396
  ```
524
1397
 
525
- ### `futures_get_positions`
1398
+ #### `bgc funds_records --action subTransfers`
526
1399
 
527
- Get current or historical futures positions. Private endpoint. Rate limit: 10 req/s per UID.
1400
+ `GET /api/v3/account/sub-transfer-record` · private
528
1401
 
529
- **Write operation:** No
1402
+ Get the transfer records of Main-Sub account
530
1403
 
531
- **Parameters:**
1404
+ Optional:
532
1405
 
533
- | Name | Type | Required | Description |
534
- |------|------|----------|-------------|
535
- | `productType` | string | Yes | |
536
- | `symbol` | string | No | |
537
- | `marginCoin` | string | No | |
538
- | `history` | boolean | No | |
1406
+ | Param | Type | Enum | Description |
1407
+ |-------|------|------|-------------|
1408
+ | `subUid` | string | | Sub-account UID. If not provided, transfer records of the main account will be retrieved. |
1409
+ | `role` | string | `initiator` \| `receiver` | Transfer-out account type initiator Initiator of the transfer receiver Recipient of the transfer Default: initiator |
1410
+ | `coin` | string | | Coin name |
1411
+ | `startTime` | string | | Start time for querying transfer records<ul><li>Unix millisecond timestamp, e.g., 1690196141868</li><li>The time interval between startTime and endTime should not exceed 90 days.</li></ul> |
1412
+ | `endTime` | string | | End time for querying transfer records<ul><li>Unix millisecond timestamp, e.g., 1690196141868</li><li>The time interval between startTime and endTime should not exceed 90 days.</li></ul> |
1413
+ | `clientOid` | string | | clientOid,Cannot exceed 64 characters. |
1414
+ | `limit` | string | | Items per page The default value is 100, and the maximum value is 100. |
1415
+ | `cursor` | string | | Cursor ID Used for pagination. Do not pass it for the first query. For subsequent queries (second page and beyond), use the cursor returned from the previous query. |
539
1416
 
540
- **Example:**
541
1417
  ```bash
542
- bgc futures futures_get_positions --productType <value> --symbol <value>
1418
+ bgc funds_records --action subTransfers
543
1419
  ```
544
1420
 
545
- ### `futures_set_leverage`
1421
+ #### `bgc funds_records --action transferableCoins`
546
1422
 
547
- Set futures leverage for symbol and margin coin. [CAUTION] Affects risk exposure. Private endpoint. Rate limit: 5 req/s per UID.
1423
+ `GET /api/v3/account/transferable-coins` · private
548
1424
 
549
- **Write operation:** Yes — requires confirmation
1425
+ Get Transferable Coins
550
1426
 
551
- **Parameters:**
1427
+ Required:
552
1428
 
553
- | Name | Type | Required | Description |
554
- |------|------|----------|-------------|
555
- | `productType` | string | Yes | |
556
- | `symbol` | string | Yes | |
557
- | `marginCoin` | string | Yes | |
558
- | `leverage` | string | Yes | |
559
- | `holdSide` | string | No | |
1429
+ | Param | Type | Enum | Description |
1430
+ |-------|------|------|-------------|
1431
+ | `fromType` | string | `spot` \| `p2p` \| `coin_futures` \| `usdt_futures` \| `usdc_futures` \| `crossed_margin` \| `isolated_margin` \| `uta` | From (source) account type spot Spot account/Funding account p2p P2P account/OTC account coin_futures Coin-M futures account usdt_futures USDT futures account usdc_futures USDC futures account crossed_margin Cross margi… |
1432
+ | `toType` | string | `spot` \| `p2p` \| `coin_futures` \| `usdt_futures` \| `usdc_futures` \| `crossed_margin` \| `isolated_margin` \| `uta` | To (target) account type spot Spot account/Funding account p2p P2P account/OTC account coin_futures Coin-M futures account usdt_futures USDT futures account usdc_futures USDC futures account crossed_margin Cross margin … |
560
1433
 
561
- **Example:**
562
1434
  ```bash
563
- bgc futures futures_set_leverage --productType <value> --symbol <value>
1435
+ bgc funds_records --action transferableCoins --fromType <fromType> --toType <toType>
564
1436
  ```
565
1437
 
566
- ### `futures_update_config`
1438
+ ## Domain: subaccount
1439
+
1440
+ ### `subaccount`
1441
+
1442
+ risk: **write** · write: no · auth: private
1443
+
1444
+ [VERB] Sub-accounts by intent: create \| createAgent \| list \| freeze \| assets \| API keys (apiKeys/createApiKey/modifyApiKey/deleteApiKey) \| depositAddress \| depositRecords.
1445
+
1446
+ **Actions:** `create`, `createAgent`, `list`, `freeze`, `assets`, `apiKeys`, `createApiKey`, `modifyApiKey`, `deleteApiKey`, `depositAddress`, `depositRecords`
1447
+
1448
+ #### `bgc subaccount --action create`
1449
+
1450
+ `POST /api/v3/user/create-sub` · private · write
567
1451
 
568
- Update futures margin mode, position mode, or auto-margin setting. [CAUTION] Affects trading behavior. Private endpoint. Rate limit: 5 req/s per UID.
1452
+ Create Sub-account
569
1453
 
570
- **Write operation:** Yes — requires confirmation
1454
+ Required:
571
1455
 
572
- **Parameters:**
1456
+ | Param | Type | Enum | Description |
1457
+ |-------|------|------|-------------|
1458
+ | `username` | string | | Generate a virtual email address username. It can only contain lowercase letters and cannot exceed 20 characters. |
573
1459
 
574
- | Name | Type | Required | Description |
575
- |------|------|----------|-------------|
576
- | `productType` | string | Yes | |
577
- | `symbol` | string | Yes | |
578
- | `marginCoin` | string | Yes | |
579
- | `setting` | string | Yes | |
580
- | `value` | string | Yes | |
581
- | `holdSide` | string | No | |
1460
+ Optional:
1461
+
1462
+ | Param | Type | Enum | Description |
1463
+ |-------|------|------|-------------|
1464
+ | `accountMode` | string | `classic` \| `unified` | Sub-account Mode classic Classic Account Sub-account unified Unified Account Sub-account |
1465
+ | `note` | string | | Note, cannot exceed 50 characters. |
582
1466
 
583
- **Example:**
584
1467
  ```bash
585
- bgc futures futures_update_config --productType <value> --symbol <value>
1468
+ bgc subaccount --action create --username <username>
586
1469
  ```
587
1470
 
588
- ## Module: account
1471
+ #### `bgc subaccount --action createAgent`
1472
+
1473
+ `POST /api/v3/user/sub-account/agent-create` · private · write
1474
+
1475
+ Create Agent Sub-account
1476
+
1477
+ Optional:
1478
+
1479
+ | Param | Type | Enum | Description |
1480
+ |-------|------|------|-------------|
1481
+ | `username` | string | | Body field username. |
1482
+ | `passphrase` | string | | Body field passphrase. |
1483
+ | `note` | string | | Body field note. |
1484
+
1485
+ ```bash
1486
+ bgc subaccount --action createAgent
1487
+ ```
589
1488
 
590
- ### `get_account_assets`
1489
+ #### `bgc subaccount --action list`
591
1490
 
592
- Get spot/futures/funding/all account balances. Private endpoint. Rate limit: 10 req/s per UID.
1491
+ `GET /api/v3/user/sub-list` · private
593
1492
 
594
- **Write operation:** No
1493
+ Get Sub-account List
595
1494
 
596
- **Parameters:**
1495
+ Optional:
597
1496
 
598
- | Name | Type | Required | Description |
599
- |------|------|----------|-------------|
600
- | `accountType` | string | No | Target account type. Default all. |
601
- | `coin` | string | No | Optional coin filter. |
602
- | `productType` | string | No | Required when accountType=futures. |
1497
+ | Param | Type | Enum | Description |
1498
+ |-------|------|------|-------------|
1499
+ | `limit` | string | | Items per page The default value is 100, and the maximum value is 100. |
1500
+ | `cursor` | string | | Cursor ID Used for pagination. Do not pass it for the first query. For subsequent queries (second page and beyond), use the cursor returned from the previous query. |
603
1501
 
604
- **Example:**
605
1502
  ```bash
606
- bgc account get_account_assets --accountType <value> --coin <value>
1503
+ bgc subaccount --action list
607
1504
  ```
608
1505
 
609
- ### `get_account_bills`
1506
+ #### `bgc subaccount --action freeze`
610
1507
 
611
- Get account bill records for spot or futures account. Private endpoint. Rate limit: 10 req/s per UID.
1508
+ `POST /api/v3/user/freeze-sub` · private · write
612
1509
 
613
- **Write operation:** No
1510
+ Freeze/Unfreeze Sub-account
614
1511
 
615
- **Parameters:**
1512
+ Required:
616
1513
 
617
- | Name | Type | Required | Description |
618
- |------|------|----------|-------------|
619
- | `accountType` | string | No | |
620
- | `coin` | string | No | |
621
- | `productType` | string | No | |
622
- | `businessType` | string | No | |
623
- | `startTime` | string | No | |
624
- | `endTime` | string | No | |
625
- | `limit` | number | No | |
1514
+ | Param | Type | Enum | Description |
1515
+ |-------|------|------|-------------|
1516
+ | `subUid` | string | | Sub-account ID to be frozen/unfrozen |
1517
+ | `operation` | string | `freeze` \| `unfreeze` | Operation Type: freeze Freeze unfreeze Unfreeze \| |
626
1518
 
627
- **Example:**
628
1519
  ```bash
629
- bgc account get_account_bills --accountType <value> --coin <value>
1520
+ bgc subaccount --action freeze --subUid <subUid> --operation <operation>
630
1521
  ```
631
1522
 
632
- ### `transfer`
1523
+ #### `bgc subaccount --action assets`
633
1524
 
634
- Transfer funds between accounts or sub-account. [CAUTION] Moves funds. Private endpoint. Rate limit: 10 req/s per UID.
1525
+ `GET /api/v3/account/sub-unified-assets` · private
635
1526
 
636
- **Write operation:** Yes — requires confirmation
1527
+ Get SubAccount Unified Assets
637
1528
 
638
- **Parameters:**
1529
+ Optional:
639
1530
 
640
- | Name | Type | Required | Description |
641
- |------|------|----------|-------------|
642
- | `fromAccountType` | string | Yes | |
643
- | `toAccountType` | string | Yes | |
644
- | `coin` | string | Yes | |
645
- | `amount` | string | Yes | |
646
- | `subAccountUid` | string | No | |
647
- | `fromUserId` | string | No | Sub-account user ID (sender). If omitted, subAccountUid is used as fallback. |
648
- | `toUserId` | string | No | Sub-account user ID (recipient). |
649
- | `symbol` | string | No | |
650
- | `clientOid` | string | No | |
1531
+ | Param | Type | Enum | Description |
1532
+ |-------|------|------|-------------|
1533
+ | `subUid` | string | | Sub-account UID Leave blank to return all sub-account asset lists |
1534
+ | `cursor` | string | | Cursor ID For pagination. Omit in first request. Pass previous cursor in subsequent requests. |
1535
+ | `limit` | string | | Sub-accounts per Page Default value is 10, maximum is 50. |
651
1536
 
652
- **Example:**
653
1537
  ```bash
654
- bgc account transfer --fromAccountType <value> --toAccountType <value>
1538
+ bgc subaccount --action assets
655
1539
  ```
656
1540
 
657
- ### `withdraw`
1541
+ #### `bgc subaccount --action apiKeys`
1542
+
1543
+ `GET /api/v3/user/sub-api-list` · private
1544
+
1545
+ Get Sub-account API Keys
1546
+
1547
+ Required:
1548
+
1549
+ | Param | Type | Enum | Description |
1550
+ |-------|------|------|-------------|
1551
+ | `subUid` | string | | Sub-account UID |
1552
+
1553
+ Optional:
1554
+
1555
+ | Param | Type | Enum | Description |
1556
+ |-------|------|------|-------------|
1557
+ | `limit` | string | | Items per page The default value is 100, and the maximum value is 100. |
1558
+ | `cursor` | string | | Cursor ID Used for pagination. Do not pass it for the first query. For subsequent queries (second page and beyond), use the cursor returned from the previous query. |
1559
+
1560
+ ```bash
1561
+ bgc subaccount --action apiKeys --subUid <subUid>
1562
+ ```
1563
+
1564
+ #### `bgc subaccount --action createApiKey`
1565
+
1566
+ `POST /api/v3/user/create-sub-api` · private · write
1567
+
1568
+ Create Sub-account API Key
1569
+
1570
+ Required:
1571
+
1572
+ | Param | Type | Enum | Description |
1573
+ |-------|------|------|-------------|
1574
+ | `subUid` | string | | Sub-account ID |
1575
+ | `note` | string | | Note Name The note needs to start with a letter and supports [0-9], [a-z], [A-Z], as well as [-,_] |
1576
+ | `type` | string | `read_write` \| `read_only` | Permission Type read_write Read/Write read_only Read-only |
1577
+ | `passphrase` | string | | passphrase A combination of 8 to 32 characters of letters and numbers |
1578
+ | `permissions` | array | | permission values <ul><li>Unified Account Permissions: uta_mgt Unified Account Management uta_trade Unified Account Trading </li></ul> |
1579
+ | `ips` | array | | Withdrawal Whitelist IP Multiple IP addresses are supported A maximum of 30 IPs can be bound to a single key Only supports IPv4 |
1580
+
1581
+ ```bash
1582
+ bgc subaccount --action createApiKey --subUid <subUid> --note <note> --type <type> --passphrase <passphrase> --permissions <permissions> --ips <ips>
1583
+ ```
1584
+
1585
+ #### `bgc subaccount --action modifyApiKey`
1586
+
1587
+ `POST /api/v3/user/update-sub-api` · private · write
1588
+
1589
+ Modify Sub-account API Key
1590
+
1591
+ Required:
1592
+
1593
+ | Param | Type | Enum | Description |
1594
+ |-------|------|------|-------------|
1595
+ | `apikey` | string | | Sub-account API Key |
1596
+ | `passphrase` | string | | passphrase A combination of 8 to 32 characters of letters and numbers |
1597
+
1598
+ Optional:
1599
+
1600
+ | Param | Type | Enum | Description |
1601
+ |-------|------|------|-------------|
1602
+ | `type` | string | `read_write` \| `read_only` | Permission Type read_write Read/Write read_only Read-only This parameter is required when permissions has a value. |
1603
+ | `permissions` | array | | permission values <ul><li>Unified Account Permissions: uta_mgt Unified Account Management uta_trade Unified Account Trading </li></ul>This parameter is required when type has a value. |
1604
+ | `ips` | array | | Withdrawal Whitelist IP <ul><li>If not provided, the IP address will not be modified.</li><li>If an empty value is provided, the withdrawal whitelist will be deleted.</li></ul>Multiple IP addresses are supported A maxim… |
1605
+
1606
+ ```bash
1607
+ bgc subaccount --action modifyApiKey --apikey <apikey> --passphrase <passphrase>
1608
+ ```
1609
+
1610
+ #### `bgc subaccount --action deleteApiKey`
1611
+
1612
+ `POST /api/v3/user/delete-sub-api` · private · write
1613
+
1614
+ Delete Sub-account API Key
1615
+
1616
+ Required:
1617
+
1618
+ | Param | Type | Enum | Description |
1619
+ |-------|------|------|-------------|
1620
+ | `apikey` | string | | The sub-account API Key |
1621
+
1622
+ ```bash
1623
+ bgc subaccount --action deleteApiKey --apikey <apikey>
1624
+ ```
1625
+
1626
+ #### `bgc subaccount --action depositAddress`
1627
+
1628
+ `GET /api/v3/account/sub-deposit-address` · private
1629
+
1630
+ Get Sub Deposit Address
1631
+
1632
+ Required:
658
1633
 
659
- Withdraw funds to external address. [DANGER] Irreversible fund movement. Private endpoint. Rate limit: 1 req/s per UID.
1634
+ | Param | Type | Enum | Description |
1635
+ |-------|------|------|-------------|
1636
+ | `subUid` | string | | Sub-account UID - The sub-account UID can be obtained via the Sub-account List API. |
1637
+ | `coin` | string | | Coin name - The currency name can be obtained using the Get Currency Information API. |
660
1638
 
661
- **Write operation:** Yes — requires confirmation
1639
+ Optional:
662
1640
 
663
- **Parameters:**
1641
+ | Param | Type | Enum | Description |
1642
+ |-------|------|------|-------------|
1643
+ | `chain` | string | | Chain Name - The chain name can be obtained using the Get Currency Information API. |
1644
+ | `size` | string | | Deposit Quantity - Only applies to BTC Lightning Network - Limit range: 0.000001 - 0.01. |
664
1645
 
665
- | Name | Type | Required | Description |
666
- |------|------|----------|-------------|
667
- | `coin` | string | Yes | |
668
- | `transferType` | string | Yes | |
669
- | `address` | string | Yes | |
670
- | `chain` | string | No | |
671
- | `amount` | string | Yes | |
672
- | `tag` | string | No | |
673
- | `clientOid` | string | No | |
1646
+ ```bash
1647
+ bgc subaccount --action depositAddress --subUid <subUid> --coin <coin>
1648
+ ```
1649
+
1650
+ #### `bgc subaccount --action depositRecords`
1651
+
1652
+ `GET /api/v3/account/sub-deposit-records` · private
1653
+
1654
+ Get Sub Deposit Records
1655
+
1656
+ Optional:
1657
+
1658
+ | Param | Type | Enum | Description |
1659
+ |-------|------|------|-------------|
1660
+ | `coin` | string | | Coin, e.g. USDT. |
1661
+ | `subUid` | string | | Query parameter subUid. |
1662
+ | `startTime` | string | | Query parameter startTime. |
1663
+ | `endTime` | string | | Query parameter endTime. |
1664
+ | `limit` | string | | Query parameter limit. |
1665
+ | `cursor` | string | | Pagination cursor returned by the previous page. |
1666
+
1667
+ ```bash
1668
+ bgc subaccount --action depositRecords
1669
+ ```
1670
+
1671
+ ## Domain: broker
1672
+
1673
+ ### `broker`
1674
+
1675
+ risk: **write** · write: no · auth: private
1676
+
1677
+ > Hidden to-B verb — opt in with `--modules broker` (not in `--modules all`).
1678
+
1679
+ [VERB] Broker sub-accounts by intent: createSub \| modifySub \| listSubs \| API keys (apiKeys/createApiKey/modifyApiKey/deleteApiKey) \| withdraw \| depositAddress \| depositWithdrawRecords \| commission.
1680
+
1681
+ **Actions:** `createSub`, `modifySub`, `listSubs`, `createApiKey`, `modifyApiKey`, `deleteApiKey`, `apiKeys`, `withdraw`, `depositAddress`, `depositWithdrawRecords`, `commission`
1682
+
1683
+ #### `bgc broker --action createSub`
1684
+
1685
+ `POST /api/v3/broker/create-sub` · private · write
1686
+
1687
+ Create Broker Sub-Account
1688
+
1689
+ Required:
1690
+
1691
+ | Param | Type | Enum | Description |
1692
+ |-------|------|------|-------------|
1693
+ | `subaccountName` | string | | Sub-account username. |
1694
+ | `label` | string | | label up to a maximum of 50 characters. |
674
1695
 
675
- **Example:**
676
1696
  ```bash
677
- bgc account withdraw --coin <value> --transferType <value>
1697
+ bgc broker --action createSub --subaccountName <subaccountName> --label <label>
678
1698
  ```
679
1699
 
680
- ### `cancel_withdrawal`
1700
+ #### `bgc broker --action modifySub`
1701
+
1702
+ `POST /api/v3/broker/modify-sub` · private · write
681
1703
 
682
- Cancel pending withdrawal request by order id. Private endpoint. Rate limit: 10 req/s per UID.
1704
+ Modify Broker Sub-Account
683
1705
 
684
- **Write operation:** Yes — requires confirmation
1706
+ Required:
685
1707
 
686
- **Parameters:**
1708
+ | Param | Type | Enum | Description |
1709
+ |-------|------|------|-------------|
1710
+ | `subUid` | string | | Sub-account UID |
687
1711
 
688
- | Name | Type | Required | Description |
689
- |------|------|----------|-------------|
690
- | `orderId` | string | Yes | Withdrawal order id. |
1712
+ Optional:
1713
+
1714
+ | Param | Type | Enum | Description |
1715
+ |-------|------|------|-------------|
1716
+ | `status` | string | | Sub-account status: normal freeze |
1717
+ | `permList` | string | `spot_trade` \| `contract_trade` \| `margin_trade` \| `deposit` | Permission list withdraw transfer spot_trade spot trading contract_trade futures trading margin_trademargin trading deposit deposit permission |
691
1718
 
692
- **Example:**
693
1719
  ```bash
694
- bgc account cancel_withdrawal --orderId <value>
1720
+ bgc broker --action modifySub --subUid <subUid>
695
1721
  ```
696
1722
 
697
- ### `get_deposit_address`
1723
+ #### `bgc broker --action listSubs`
698
1724
 
699
- Get deposit address for coin and optional chain. Private endpoint. Rate limit: 10 req/s per UID.
1725
+ `GET /api/v3/broker/sub-list` · private
700
1726
 
701
- **Write operation:** No
1727
+ Get Broker Sub-Account List
702
1728
 
703
- **Parameters:**
1729
+ Optional:
704
1730
 
705
- | Name | Type | Required | Description |
706
- |------|------|----------|-------------|
707
- | `coin` | string | Yes | |
708
- | `chain` | string | No | |
1731
+ | Param | Type | Enum | Description |
1732
+ |-------|------|------|-------------|
1733
+ | `limit` | string | | Number of items per page - default 10, maximum 100. |
1734
+ | `cursor` | string | | Cursor ID Used for pagination. Omit it on the first call. For subsequent calls, pass in the last subUid returned by the previous query. |
1735
+ | `status` | string | `normal` \| `freeze` | Account status: normal normal freeze frozen |
709
1736
 
710
- **Example:**
711
1737
  ```bash
712
- bgc account get_deposit_address --coin <value> --chain <value>
1738
+ bgc broker --action listSubs
713
1739
  ```
714
1740
 
715
- ### `get_transaction_records`
1741
+ #### `bgc broker --action createApiKey`
716
1742
 
717
- Get deposit, withdrawal, or transfer records. Private endpoint. Rate limit: 10 req/s per UID.
1743
+ `POST /api/v3/broker/create-sub-apikey` · private · write
718
1744
 
719
- **Write operation:** No
1745
+ Create Broker Sub-Account API Key
720
1746
 
721
- **Parameters:**
1747
+ Required:
722
1748
 
723
- | Name | Type | Required | Description |
724
- |------|------|----------|-------------|
725
- | `recordType` | string | Yes | |
726
- | `coin` | string | No | |
727
- | `startTime` | string | No | |
728
- | `endTime` | string | No | |
729
- | `limit` | number | No | |
730
- | `orderId` | string | No | |
1749
+ | Param | Type | Enum | Description |
1750
+ |-------|------|------|-------------|
1751
+ | `subUid` | string | | Sub-account UID |
1752
+ | `passphrase` | string | | Passphrase required to call the API. If lost, please create a new API key. |
1753
+ | `label` | string | | label |
1754
+ | `ipList` | string | | IP whitelist up to 30 entries can be provided |
1755
+ | `permType` | string | `read_and_write` \| `readonly` | Permission type: read_and_write read & write readonly read-only |
1756
+ | `permList` | string | `uta_trade` \| `uta_mgt` \| `withdraw` | Permission list: uta_trade UTA trading uta_mgt UTA management withdraw (permType must be read_and_write) |
731
1757
 
732
- **Example:**
733
1758
  ```bash
734
- bgc account get_transaction_records --recordType <value> --coin <value>
1759
+ bgc broker --action createApiKey --subUid <subUid> --passphrase <passphrase> --label <label> --ipList <ipList> --permType <permType> --permList <permList>
735
1760
  ```
736
1761
 
737
- ### `manage_subaccounts`
1762
+ #### `bgc broker --action modifyApiKey`
1763
+
1764
+ `POST /api/v3/broker/modify-sub-apikey` · private · write
738
1765
 
739
- Create, modify, list subaccounts and manage subaccount API keys. [CAUTION] Account management operation. Private endpoint. Rate limit: 5 req/s per UID.
1766
+ Modify Broker Sub-Account API Key
740
1767
 
741
- **Write operation:** Yes — requires confirmation
1768
+ Required:
742
1769
 
743
- **Parameters:**
1770
+ | Param | Type | Enum | Description |
1771
+ |-------|------|------|-------------|
1772
+ | `subUid` | string | | Sub-account UID |
1773
+ | `passphrase` | string | | Passphrase required to call the API; if lost, please recreate the API key |
1774
+ | `apiKey` | string | | API Key |
744
1775
 
745
- | Name | Type | Required | Description |
746
- |------|------|----------|-------------|
747
- | `action` | string | Yes | |
748
- | `subAccountName` | string | No | |
749
- | `subAccountUid` | string | No | |
750
- | `remark` | string | No | |
751
- | `permList` | array | No | Permission list (required for modify, createApiKey, modifyApiKey). |
752
- | `status` | string | No | Sub-account status (required for modify). |
753
- | `apiKeyPermissions` | string | No | Single permission string (backward compat; prefer permList). |
754
- | `apiKeyIp` | string | No | Single IP string (backward compat; prefer ipList). |
755
- | `apiKeyPassphrase` | string | No | |
756
- | `label` | string | No | API key label (required for createApiKey/modifyApiKey). |
757
- | `subAccountApiKey` | string | No | The API key to modify (required for modifyApiKey). |
1776
+ Optional:
1777
+
1778
+ | Param | Type | Enum | Description |
1779
+ |-------|------|------|-------------|
1780
+ | `label` | string | | label |
1781
+ | `ipList` | string | | IP whitelist up to 30 entries |
1782
+ | `permType` | string | `read_and_write` \| `readonly` | Permission type: read_and_write read & write readonly read-only |
1783
+ | `permList` | string | `uta_trade` \| `uta_mgt` \| `withdraw` | Permission list: uta_trade UTA trading uta_mgt UTA management withdraw (permType must be read_and_write) |
758
1784
 
759
- **Example:**
760
1785
  ```bash
761
- bgc account manage_subaccounts --action <value> --subAccountName <value>
1786
+ bgc broker --action modifyApiKey --subUid <subUid> --passphrase <passphrase> --apiKey <apiKey>
762
1787
  ```
763
1788
 
764
- ## Module: margin
1789
+ #### `bgc broker --action deleteApiKey`
1790
+
1791
+ `POST /api/v3/broker/delete-sub-apikey` · private · write
1792
+
1793
+ Delete Broker Subaccount Apikey
1794
+
1795
+ Required:
1796
+
1797
+ | Param | Type | Enum | Description |
1798
+ |-------|------|------|-------------|
1799
+ | `subUid` | string | | Sub-account UID |
1800
+ | `apiKey` | string | | API Key |
1801
+
1802
+ ```bash
1803
+ bgc broker --action deleteApiKey --subUid <subUid> --apiKey <apiKey>
1804
+ ```
765
1805
 
766
- ### `margin_get_assets`
1806
+ #### `bgc broker --action apiKeys`
767
1807
 
768
- Get crossed or isolated margin assets and risk metrics. Private endpoint. Rate limit: 10 req/s per UID.
1808
+ `GET /api/v3/broker/query-sub-apikey` · private
769
1809
 
770
- **Write operation:** No
1810
+ Get Broker Sub-Account API Key
771
1811
 
772
- **Parameters:**
1812
+ Required:
773
1813
 
774
- | Name | Type | Required | Description |
775
- |------|------|----------|-------------|
776
- | `marginType` | string | Yes | |
777
- | `symbol` | string | No | |
778
- | `coin` | string | No | |
1814
+ | Param | Type | Enum | Description |
1815
+ |-------|------|------|-------------|
1816
+ | `subUid` | string | | Sub-account UID |
779
1817
 
780
- **Example:**
781
1818
  ```bash
782
- bgc margin margin_get_assets --marginType <value> --symbol <value>
1819
+ bgc broker --action apiKeys --subUid <subUid>
783
1820
  ```
784
1821
 
785
- ### `margin_borrow`
1822
+ #### `bgc broker --action withdraw` — **[DANGER] requires `--confirm`**
786
1823
 
787
- Borrow margin funds. [CAUTION] Creates debt. Private endpoint. Rate limit: 10 req/s per UID.
1824
+ `POST /api/v3/broker/sub-withdrawal` · private · write
788
1825
 
789
- **Write operation:** Yes — requires confirmation
1826
+ Broker Subaccount Withdrawal
790
1827
 
791
- **Parameters:**
1828
+ Required:
792
1829
 
793
- | Name | Type | Required | Description |
794
- |------|------|----------|-------------|
795
- | `marginType` | string | Yes | |
796
- | `coin` | string | Yes | |
797
- | `amount` | string | Yes | |
798
- | `symbol` | string | No | Required for isolated margin. |
1830
+ | Param | Type | Enum | Description |
1831
+ |-------|------|------|-------------|
1832
+ | `subUid` | string | | Sub-account UID |
1833
+ | `coin` | string | | coin name |
1834
+ | `dest` | string | `on_chain` \| `internal_transfer` | Withdrawal method: on_chain on-chain withdrawal internal_transfer internal transfer |
1835
+ | `address` | string | | Withdrawal address- when using on-chain withdrawal, enter the on-chain address; when using internal transfer, enter the UID |
1836
+ | `amount` | string | | Withdrawal amount |
1837
+
1838
+ Optional:
1839
+
1840
+ | Param | Type | Enum | Description |
1841
+ |-------|------|------|-------------|
1842
+ | `chain` | string | | Chain name- if this parameter is not provided, it defaults to the coin’s main chain |
1843
+ | `tag` | string | | Tag - used for some chains (e.g., EOS memo, TON comment) |
1844
+ | `clientOid` | string | | Custom order ID |
799
1845
 
800
- **Example:**
801
1846
  ```bash
802
- bgc margin margin_borrow --marginType <value> --coin <value>
1847
+ bgc broker --action withdraw --subUid <subUid> --coin <coin> --dest <dest> --address <address> --amount <amount>
803
1848
  ```
804
1849
 
805
- ### `margin_repay`
1850
+ #### `bgc broker --action depositAddress`
1851
+
1852
+ `POST /api/v3/broker/sub-deposit-address` · private
1853
+
1854
+ Get Broker Subaccount Deposit Address
806
1855
 
807
- Repay margin debt with optional flash repay. [CAUTION] Uses account funds. Private endpoint. Rate limit: 10 req/s per UID. For flash repay, coin is optional (omit to repay all). For isolated flash repay, symbol filters which pairs to repay.
1856
+ Required:
808
1857
 
809
- **Write operation:** Yes — requires confirmation
1858
+ | Param | Type | Enum | Description |
1859
+ |-------|------|------|-------------|
1860
+ | `subUid` | string | | Sub-account UID |
1861
+ | `coin` | string | | Coin name |
810
1862
 
811
- **Parameters:**
1863
+ Optional:
812
1864
 
813
- | Name | Type | Required | Description |
814
- |------|------|----------|-------------|
815
- | `marginType` | string | Yes | |
816
- | `coin` | string | No | Required for regular repay. Optional for flash repay (omit to repay all). |
817
- | `amount` | string | No | Required for regular repay. |
818
- | `symbol` | string | No | Required for isolated regular repay. Optional for isolated flash repay. |
819
- | `flashRepay` | boolean | No | |
1865
+ | Param | Type | Enum | Description |
1866
+ |-------|------|------|-------------|
1867
+ | `chain` | string | | Chain name If this parameter is not provided, the default will be the coin’s primary (main) chain |
820
1868
 
821
- **Example:**
822
1869
  ```bash
823
- bgc margin margin_repay --marginType <value> --coin <value>
1870
+ bgc broker --action depositAddress --subUid <subUid> --coin <coin>
824
1871
  ```
825
1872
 
826
- ### `margin_place_order`
1873
+ #### `bgc broker --action depositWithdrawRecords`
827
1874
 
828
- Place margin order in crossed or isolated mode. [CAUTION] Executes real trade. Private endpoint. Rate limit: 10 req/s per UID. For market buy orders, use quoteSize (quote currency amount) instead of size.
1875
+ `GET /api/v3/broker/all-sub-deposit-withdrawal` · private
829
1876
 
830
- **Write operation:** Yes — requires confirmation
1877
+ Get All Broker Subaccount Deposit Withdrawal
831
1878
 
832
- **Parameters:**
1879
+ Optional:
833
1880
 
834
- | Name | Type | Required | Description |
835
- |------|------|----------|-------------|
836
- | `marginType` | string | Yes | |
837
- | `symbol` | string | Yes | |
838
- | `side` | string | Yes | |
839
- | `orderType` | string | Yes | |
840
- | `price` | string | No | |
841
- | `size` | string | No | Base currency size. For market buy, use quoteSize instead. |
842
- | `quoteSize` | string | No | Quote currency size. Required for market buy orders. |
843
- | `loanType` | string | No | |
1881
+ | Param | Type | Enum | Description |
1882
+ |-------|------|------|-------------|
1883
+ | `startTime` | string | | Record start time Unix timestamp in milliseconds. If both startTime and endTime are empty, the default query time range is yesterday 00:00–23:59 (UTC+0). The time range between startTime and endTime cannot exceed 7 days. |
1884
+ | `endTime` | string | | Record end time Unix timestamp in milliseconds. If both startTime and endTime are empty, the default query time range is yesterday 00:00–23:59 (UTC+0). The time range between startTime and endTime cannot exceed 7 days. |
1885
+ | `limit` | string | | Number of items per page default 100, maximum 100. |
1886
+ | `cursor` | string | | Cursor ID. |
1887
+ | `status` | string | `pending` \| `fail` \| `success` | Status pendingConfirming failFailed successSuccessful |
844
1888
 
845
- **Example:**
846
1889
  ```bash
847
- bgc margin margin_place_order --marginType <value> --symbol <value>
1890
+ bgc broker --action depositWithdrawRecords
848
1891
  ```
849
1892
 
850
- ### `margin_cancel_orders`
1893
+ #### `bgc broker --action commission`
851
1894
 
852
- Cancel one or more margin orders. Private endpoint. Rate limit: 10 req/s per UID.
1895
+ `GET /api/v3/broker/commission` · private
853
1896
 
854
- **Write operation:** Yes — requires confirmation
1897
+ Get Broker Commission
855
1898
 
856
- **Parameters:**
1899
+ Optional:
857
1900
 
858
- | Name | Type | Required | Description |
859
- |------|------|----------|-------------|
860
- | `marginType` | string | Yes | |
861
- | `symbol` | string | Yes | |
862
- | `orderId` | string | No | |
863
- | `orderIds` | array | No | |
1901
+ | Param | Type | Enum | Description |
1902
+ |-------|------|------|-------------|
1903
+ | `startTime` | string | | Query start time Unix timestamp in milliseconds. If both startTime and endTime are omitted, the default query range is yesterday 00:00–23:59 (UTC+0). The interval between startTime and endTime for a single query cannot … |
1904
+ | `endTime` | string | | Query end time Unix timestamp in milliseconds. If both startTime and endTime are omitted, the default query range is yesterday 00:00–23:59 (UTC+0). The interval between startTime and endTime for a single query cannot ex… |
1905
+ | `pageSize` | string | | Number of items per page default 100, maximum 1000 |
1906
+ | `pageNo` | string | | Page number - default 1. |
1907
+ | `bizType` | string | | Business type spot futures - If not provided, commission data for all types will be returned. |
1908
+ | `subBizType` | string | `spot_trade` \| `spot_margin` \| `usdt_futures` \| `usdc_futures` \| `coin_futures` | Business sub-type: spot_trade spot trading spot_margin spot margin usdt_futures USDT futures usdc_futures USDC futures coin_futures coin-margin futures When bizType=spot, this parameter can be spot_trade or spot_margin.… |
864
1909
 
865
- **Example:**
866
1910
  ```bash
867
- bgc margin margin_cancel_orders --marginType <value> --symbol <value>
1911
+ bgc broker --action commission
868
1912
  ```
869
1913
 
870
- ### `margin_get_orders`
1914
+ ## Domain: loan
1915
+
1916
+ ### `loan`
1917
+
1918
+ risk: **write** · write: no · auth: private
1919
+
1920
+ [VERB] Crypto loans by intent: borrow \| repay \| revisePledge \| ongoing \| borrowHistory \| repayHistory \| debts \| interest \| reduces \| coins \| pledgeRateHistory.
1921
+
1922
+ **Actions:** `borrow`, `repay`, `revisePledge`, `ongoing`, `borrowHistory`, `repayHistory`, `debts`, `interest`, `reduces`, `coins`, `pledgeRateHistory`
871
1923
 
872
- Query margin orders (open/history/order detail). Private endpoint. Rate limit: 10 req/s per UID. Note: symbol and startTime are required by the API for open-orders queries.
1924
+ #### `bgc loan --action borrow`
873
1925
 
874
- **Write operation:** No
1926
+ `POST /api/v3/loan/borrow` · private · write
875
1927
 
876
- **Parameters:**
1928
+ Borrow Coins
877
1929
 
878
- | Name | Type | Required | Description |
879
- |------|------|----------|-------------|
880
- | `marginType` | string | Yes | |
881
- | `symbol` | string | No | Required for open-orders queries per API docs. |
882
- | `orderId` | string | No | |
883
- | `status` | string | No | |
884
- | `startTime` | string | No | Required for open-orders queries per API docs. |
885
- | `endTime` | string | No | |
886
- | `limit` | number | No | |
1930
+ Required:
1931
+
1932
+ | Param | Type | Enum | Description |
1933
+ |-------|------|------|-------------|
1934
+ | `loanCoin` | string | | Coin to borrow e.g.BTC |
1935
+ | `pledgeCoin` | string | | Collateral coin e.g.ETH |
1936
+ | `daily` | string | `SEVEN` \| `THIRTY` \| `FLEXIBLE` | Pledge term: SEVEN 7 days THIRTY 30 days FLEXIBLE flexible |
1937
+
1938
+ Optional:
1939
+
1940
+ | Param | Type | Enum | Description |
1941
+ |-------|------|------|-------------|
1942
+ | `pledgeAmount` | string | | Collateral amount choose one of pledgeAmount or loanAmount |
1943
+ | `loanAmount` | string | | Borrow amount choose one of loanAmount or pledgeAmount |
887
1944
 
888
- **Example:**
889
1945
  ```bash
890
- bgc margin margin_get_orders --marginType <value> --symbol <value>
1946
+ bgc loan --action borrow --loanCoin <loanCoin> --pledgeCoin <pledgeCoin> --daily <daily>
891
1947
  ```
892
1948
 
893
- ### `margin_get_records`
1949
+ #### `bgc loan --action repay`
1950
+
1951
+ `POST /api/v3/loan/repay` · private · write
894
1952
 
895
- Get borrow/repay/interest/liquidation records for margin accounts. Private endpoint. Rate limit: 10 req/s per UID.
1953
+ Repay Coins
896
1954
 
897
- **Write operation:** No
1955
+ Required:
898
1956
 
899
- **Parameters:**
1957
+ | Param | Type | Enum | Description |
1958
+ |-------|------|------|-------------|
1959
+ | `orderId` | string | | Order ID |
1960
+ | `method` | string | `borrowed_coin` \| `collateral` | Repayment method borrowed_coinborrowed coin collateralcollateral |
1961
+ | `repayAll` | string | | Repay in full yes no If yes, the repayment amount will be ignored |
900
1962
 
901
- | Name | Type | Required | Description |
902
- |------|------|----------|-------------|
903
- | `marginType` | string | Yes | |
904
- | `recordType` | string | Yes | |
905
- | `coin` | string | No | |
906
- | `symbol` | string | No | |
907
- | `startTime` | string | No | |
908
- | `endTime` | string | No | |
909
- | `limit` | number | No | |
1963
+ Optional:
1964
+
1965
+ | Param | Type | Enum | Description |
1966
+ |-------|------|------|-------------|
1967
+ | `amount` | string | | Repayment amount Required when repayAll=no |
1968
+ | `repayUnlock` | string | `yes` \| `no` | Whether to redeem collateral yesredeem nodo not redeem Default is no if omitted. Not effective when repayAll=yes |
910
1969
 
911
- **Example:**
912
1970
  ```bash
913
- bgc margin margin_get_records --marginType <value> --recordType <value>
1971
+ bgc loan --action repay --orderId <orderId> --method <method> --repayAll <repayAll>
914
1972
  ```
915
1973
 
916
- ## Module: copytrading
1974
+ #### `bgc loan --action revisePledge`
1975
+
1976
+ `POST /api/v3/loan/revise-pledge` · private · write
917
1977
 
918
- ### `copy_get_traders`
1978
+ Revise Pledge
919
1979
 
920
- Get copy-trading trader list and configuration candidates. Private endpoint. Rate limit: 10 req/s per UID.
1980
+ Required:
921
1981
 
922
- **Write operation:** No
1982
+ | Param | Type | Enum | Description |
1983
+ |-------|------|------|-------------|
1984
+ | `orderId` | string | | Order ID |
1985
+ | `amount` | string | | Adjustment amount |
1986
+ | `pledgeCoin` | string | | Collateral coin |
923
1987
 
924
- **Parameters:**
1988
+ Optional:
925
1989
 
926
- | Name | Type | Required | Description |
927
- |------|------|----------|-------------|
928
- | `productType` | string | No | Copy trading market type. |
929
- | `symbol` | string | No | Optional symbol filter for spot copy. |
930
- | `limit` | number | No | Page size, default 20. |
1990
+ | Param | Type | Enum | Description |
1991
+ |-------|------|------|-------------|
1992
+ | `reviseType` | string | `OUT` \| `IN` | Adjustment type OUT: withdraw collateral IN add collateral |
931
1993
 
932
- **Example:**
933
1994
  ```bash
934
- bgc copytrading copy_get_traders --productType <value> --symbol <value>
1995
+ bgc loan --action revisePledge --orderId <orderId> --amount <amount> --pledgeCoin <pledgeCoin>
935
1996
  ```
936
1997
 
937
- ### `copy_place_order`
1998
+ #### `bgc loan --action ongoing`
938
1999
 
939
- Create or update copy-trading follow settings. [CAUTION] Changes copy-trading behavior. Private endpoint. Rate limit: 10 req/s per UID.
2000
+ `GET /api/v3/loan/borrow-ongoing` · private
940
2001
 
941
- **Write operation:** Yes — requires confirmation
2002
+ Get Borrow Ongoing
942
2003
 
943
- **Parameters:**
2004
+ Optional:
944
2005
 
945
- | Name | Type | Required | Description |
946
- |------|------|----------|-------------|
947
- | `productType` | string | Yes | |
948
- | `traderId` | string | No | Required trader id. |
949
- | `symbol` | string | No | Symbol for copy settings. |
950
- | `leverageType` | string | No | Futures copy leverage type. Default position. |
951
- | `traceType` | string | No | Copy size mode. Default amount. |
952
- | `marginType` | string | No | Futures margin type. Default trader. |
953
- | `amount` | string | No | Trace amount/value (mapped to traceValue). |
954
- | `ratio` | string | No | Trace ratio (mapped to traceValue when traceType=ratio). |
955
- | `maxHoldSize` | string | No | Max hold size for spot copy settings. |
956
- | `autoSelectTrader` | boolean | No | When true (or traderId omitted), auto-select trader from query-traders list. |
957
- | `selectionPolicy` | string | No | Trader auto-selection policy. Default recommended. |
958
- | `dryRun` | boolean | No | When true, resolve trader and return payload preview without sending write request. |
2006
+ | Param | Type | Enum | Description |
2007
+ |-------|------|------|-------------|
2008
+ | `orderId` | string | | Order ID |
2009
+ | `loanCoin` | string | | Borrowed coin |
2010
+ | `pledgeCoin` | string | | Collateral coin |
959
2011
 
960
- **Example:**
961
2012
  ```bash
962
- bgc copytrading copy_place_order --productType <value> --traderId <value>
2013
+ bgc loan --action ongoing
963
2014
  ```
964
2015
 
965
- ### `copy_close_position`
2016
+ #### `bgc loan --action borrowHistory`
2017
+
2018
+ `GET /api/v3/loan/borrow-history` · private
2019
+
2020
+ Get Borrow History
966
2021
 
967
- Close copy-trading follower position (futures). [CAUTION] Closes positions. Private endpoint. Rate limit: 10 req/s per UID.
2022
+ Required:
968
2023
 
969
- **Write operation:** Yes — requires confirmation
2024
+ | Param | Type | Enum | Description |
2025
+ |-------|------|------|-------------|
2026
+ | `startTime` | string | | Start time only supports querying data from the last 3 months |
2027
+ | `endTime` | string | | End time |
970
2028
 
971
- **Parameters:**
2029
+ Optional:
972
2030
 
973
- | Name | Type | Required | Description |
974
- |------|------|----------|-------------|
975
- | `productType` | string | Yes | |
976
- | `symbol` | string | Yes | |
977
- | `subPosId` | string | No | Tracking number (maps to trackingNo). |
978
- | `marginCoin` | string | No | |
979
- | `marginMode` | string | No | |
980
- | `holdSide` | string | No | |
2031
+ | Param | Type | Enum | Description |
2032
+ |-------|------|------|-------------|
2033
+ | `orderId` | string | | Order ID |
2034
+ | `loanCoin` | string | | Borrowed coin |
2035
+ | `pledgeCoin` | string | | Collateral coin |
2036
+ | `status` | string | `ROLLBACK` \| `FORCE` \| `REPAY` | Status ROLLBACK: failed FORCE: liquidated REPAY: repaid |
2037
+ | `pageNum` | string | | Page number default is 1 |
2038
+ | `pageSize` | string | | Items per page default is 10,maximum is 100 |
981
2039
 
982
- **Example:**
983
2040
  ```bash
984
- bgc copytrading copy_close_position --productType <value> --symbol <value>
2041
+ bgc loan --action borrowHistory --startTime <startTime> --endTime <endTime>
985
2042
  ```
986
2043
 
987
- ### `copy_get_orders`
2044
+ #### `bgc loan --action repayHistory`
988
2045
 
989
- Query copy-trading historical orders. Private endpoint. Rate limit: 10 req/s per UID.
2046
+ `GET /api/v3/loan/repay-history` · private
990
2047
 
991
- **Write operation:** No
2048
+ Get Repay History
992
2049
 
993
- **Parameters:**
2050
+ Required:
994
2051
 
995
- | Name | Type | Required | Description |
996
- |------|------|----------|-------------|
997
- | `productType` | string | Yes | |
998
- | `symbol` | string | No | |
999
- | `startTime` | string | No | |
1000
- | `endTime` | string | No | |
1001
- | `limit` | number | No | |
1002
- | `traderId` | string | No | Optional trader id filter. |
2052
+ | Param | Type | Enum | Description |
2053
+ |-------|------|------|-------------|
2054
+ | `startTime` | string | | Start time only supports querying data from the last 3 months |
2055
+ | `endTime` | string | | End time |
2056
+
2057
+ Optional:
2058
+
2059
+ | Param | Type | Enum | Description |
2060
+ |-------|------|------|-------------|
2061
+ | `orderId` | string | | Order ID |
2062
+ | `loanCoin` | string | | Borrowed coin |
2063
+ | `pledgeCoin` | string | | Collateral coin |
2064
+ | `pageNum` | string | | Page number default is 1 |
2065
+ | `pageSize` | string | | Items per page default is 10,maximum is 100 |
2066
+
2067
+ ```bash
2068
+ bgc loan --action repayHistory --startTime <startTime> --endTime <endTime>
2069
+ ```
2070
+
2071
+ #### `bgc loan --action debts`
2072
+
2073
+ `GET /api/v3/loan/debts` · private
2074
+
2075
+ Get Loan Debts
2076
+
2077
+ _No business parameters._
1003
2078
 
1004
- **Example:**
1005
2079
  ```bash
1006
- bgc copytrading copy_get_orders --productType <value> --symbol <value>
2080
+ bgc loan --action debts
1007
2081
  ```
1008
2082
 
1009
- ### `copy_get_positions`
2083
+ #### `bgc loan --action interest`
1010
2084
 
1011
- Get current or historical copy-trading positions/orders. Private endpoint. Rate limit: 10 req/s per UID.
2085
+ `GET /api/v3/loan/interest` · private
1012
2086
 
1013
- **Write operation:** No
2087
+ Get Loan Interest
1014
2088
 
1015
- **Parameters:**
2089
+ Required:
1016
2090
 
1017
- | Name | Type | Required | Description |
1018
- |------|------|----------|-------------|
1019
- | `productType` | string | Yes | |
1020
- | `symbol` | string | No | |
1021
- | `history` | boolean | No | |
1022
- | `startTime` | string | No | |
1023
- | `endTime` | string | No | |
1024
- | `limit` | number | No | |
1025
- | `traderId` | string | No | |
2091
+ | Param | Type | Enum | Description |
2092
+ |-------|------|------|-------------|
2093
+ | `loanCoin` | string | | Coin to borrow e.g.BTC |
2094
+ | `pledgeCoin` | string | | Collateral coin e.g.ETH |
2095
+ | `daily` | string | `SEVEN` \| `THIRTY` \| `FLEXIBLE` | Pledge term: SEVEN 7 days THIRTY 30 days FLEXIBLE flexible |
2096
+ | `pledgeAmount` | string | | Pledge Amount |
1026
2097
 
1027
- **Example:**
1028
2098
  ```bash
1029
- bgc copytrading copy_get_positions --productType <value> --symbol <value>
2099
+ bgc loan --action interest --loanCoin <loanCoin> --pledgeCoin <pledgeCoin> --daily <daily> --pledgeAmount <pledgeAmount>
1030
2100
  ```
1031
2101
 
1032
- ## Module: convert
2102
+ #### `bgc loan --action reduces`
2103
+
2104
+ `GET /api/v3/loan/reduces` · private
1033
2105
 
1034
- ### `convert_get_quote`
2106
+ Get Loan Reduces
1035
2107
 
1036
- Get supported convert currencies or quoted conversion price. Private endpoint. Rate limit: 10 req/s per UID.
2108
+ Required:
1037
2109
 
1038
- **Write operation:** No
2110
+ | Param | Type | Enum | Description |
2111
+ |-------|------|------|-------------|
2112
+ | `startTime` | string | | Start time only supports querying data from the last 3 months |
2113
+ | `endTime` | string | | End time |
1039
2114
 
1040
- **Parameters:**
2115
+ Optional:
1041
2116
 
1042
- | Name | Type | Required | Description |
1043
- |------|------|----------|-------------|
1044
- | `fromCoin` | string | No | |
1045
- | `toCoin` | string | No | |
1046
- | `fromCoinAmount` | string | No | |
1047
- | `toCoinAmount` | string | No | |
2117
+ | Param | Type | Enum | Description |
2118
+ |-------|------|------|-------------|
2119
+ | `orderId` | string | | Order ID |
2120
+ | `loanCoin` | string | | Borrowed coin |
2121
+ | `pledgeCoin` | string | | Collateral coin |
2122
+ | `status` | string | `COMPLETE` \| `WAIT` | Liquidation status COMPLETE liquidated WAIT liquidation |
2123
+ | `pageNum` | string | | Page number default is 1 |
2124
+ | `pageSize` | string | | Items per page default is 10,maximum is 100 |
1048
2125
 
1049
- **Example:**
1050
2126
  ```bash
1051
- bgc convert convert_get_quote --fromCoin <value> --toCoin <value>
2127
+ bgc loan --action reduces --startTime <startTime> --endTime <endTime>
1052
2128
  ```
1053
2129
 
1054
- ### `convert_execute`
2130
+ #### `bgc loan --action coins`
1055
2131
 
1056
- Execute normal conversion or BGB small balance sweep. [CAUTION] Converts funds. Private endpoint. Rate limit: 5 req/s per UID.
2132
+ `GET /api/v3/loan/coins` · private
1057
2133
 
1058
- **Write operation:** Yes — requires confirmation
2134
+ Get Loan Coins
1059
2135
 
1060
- **Parameters:**
2136
+ Optional:
1061
2137
 
1062
- | Name | Type | Required | Description |
1063
- |------|------|----------|-------------|
1064
- | `type` | string | No | |
1065
- | `fromCoin` | string | Yes | |
1066
- | `toCoin` | string | Yes | |
1067
- | `fromCoinAmount` | string | No | |
1068
- | `toCoinAmount` | string | No | |
1069
- | `traceId` | string | No | |
1070
- | `coinList` | array | No | |
2138
+ | Param | Type | Enum | Description |
2139
+ |-------|------|------|-------------|
2140
+ | `coin` | string | | Coin name |
1071
2141
 
1072
- **Example:**
1073
2142
  ```bash
1074
- bgc convert convert_execute --type <value> --fromCoin <value>
2143
+ bgc loan --action coins
1075
2144
  ```
1076
2145
 
1077
- ### `convert_get_history`
2146
+ #### `bgc loan --action pledgeRateHistory`
2147
+
2148
+ `GET /api/v3/loan/pledge-rate-history` · private
2149
+
2150
+ Get Pledge Rate History
1078
2151
 
1079
- Get conversion or BGB sweep history. Private endpoint. Rate limit: 10 req/s per UID.
2152
+ Required:
1080
2153
 
1081
- **Write operation:** No
2154
+ | Param | Type | Enum | Description |
2155
+ |-------|------|------|-------------|
2156
+ | `startTime` | string | | Start time only supports querying data from the last 3 months |
2157
+ | `endTime` | string | | End time |
1082
2158
 
1083
- **Parameters:**
2159
+ Optional:
1084
2160
 
1085
- | Name | Type | Required | Description |
1086
- |------|------|----------|-------------|
1087
- | `type` | string | No | |
1088
- | `startTime` | string | No | |
1089
- | `endTime` | string | No | |
1090
- | `limit` | number | No | |
2161
+ | Param | Type | Enum | Description |
2162
+ |-------|------|------|-------------|
2163
+ | `orderId` | string | | Order ID |
2164
+ | `reviseSide` | string | `down` \| `up` | Adjustment direction down: transfer in, decrease up: transfer out, increase |
2165
+ | `pledgeCoin` | string | | Collateral coin |
2166
+ | `pageNum` | string | | Page number default is 1 |
2167
+ | `pageSize` | string | | Items per page default is 10,maximum is 100 |
1091
2168
 
1092
- **Example:**
1093
2169
  ```bash
1094
- bgc convert convert_get_history --type <value> --startTime <value>
2170
+ bgc loan --action pledgeRateHistory --startTime <startTime> --endTime <endTime>
1095
2171
  ```
1096
2172
 
1097
- ## Module: earn
2173
+ ## Domain: instloan
2174
+
2175
+ ### `inst_loan`
2176
+
2177
+ risk: **write** · write: no · auth: private
2178
+
2179
+ > Hidden to-B verb — opt in with `--modules instloan` (not in `--modules all`).
2180
+
2181
+ [VERB] Institutional loans by intent: bindUid (risk unit) \| orders \| ltv \| marginCoins \| products \| repaymentOrders \| riskUnit \| symbols \| transferred.
1098
2182
 
1099
- ### `earn_get_products`
2183
+ **Actions:** `bindUid`, `orders`, `ltv`, `marginCoins`, `products`, `repaymentOrders`, `riskUnit`, `symbols`, `transferred`
1100
2184
 
1101
- Query available earn products such as savings and staking. Private endpoint. Rate limit: 10 req/s per UID.
2185
+ #### `bgc inst_loan --action bindUid`
1102
2186
 
1103
- **Write operation:** No
2187
+ `POST /api/v3/ins-loan/bind-uid` · private · write
1104
2188
 
1105
- **Parameters:**
2189
+ Bind/Unbind UID to Risk Unit
1106
2190
 
1107
- | Name | Type | Required | Description |
1108
- |------|------|----------|-------------|
1109
- | `coin` | string | No | |
1110
- | `filter` | string | No | |
2191
+ Required:
2192
+
2193
+ | Param | Type | Enum | Description |
2194
+ |-------|------|------|-------------|
2195
+ | `uid` | string | | Sub UID(limit 50 UIDS for one Risk Unit) |
2196
+ | `operate` | string | `bind` \| `unbind` | bind Bind unbind Unbind |
2197
+
2198
+ Optional:
2199
+
2200
+ | Param | Type | Enum | Description |
2201
+ |-------|------|------|-------------|
2202
+ | `riskUnitId` | string | | Risk Unit ID (Required for parent account calls, not required for risk unit account calls) |
1111
2203
 
1112
- **Example:**
1113
2204
  ```bash
1114
- bgc earn earn_get_products --coin <value> --filter <value>
2205
+ bgc inst_loan --action bindUid --uid <uid> --operate <operate>
1115
2206
  ```
1116
2207
 
1117
- ### `earn_subscribe_redeem`
2208
+ #### `bgc inst_loan --action orders`
1118
2209
 
1119
- Subscribe or redeem earn products. [CAUTION] Locks/releases funds. Private endpoint. Rate limit: 5 req/s per UID.
2210
+ `GET /api/v3/ins-loan/loan-order` · private
1120
2211
 
1121
- **Write operation:** Yes — requires confirmation
2212
+ Get Loan Orders
1122
2213
 
1123
- **Parameters:**
2214
+ Optional:
1124
2215
 
1125
- | Name | Type | Required | Description |
1126
- |------|------|----------|-------------|
1127
- | `action` | string | Yes | |
1128
- | `productId` | string | Yes | |
1129
- | `amount` | string | Yes | |
1130
- | `periodType` | string | Yes | |
1131
- | `orderId` | string | No | |
2216
+ | Param | Type | Enum | Description |
2217
+ |-------|------|------|-------------|
2218
+ | `orderId` | string | | oan order id. If not passed, then return all orders, sort by loanTime in descend |
2219
+ | `startTime` | string | | The start timestamp (ms) |
2220
+ | `endTime` | string | | The end timestamp (ms) |
1132
2221
 
1133
- **Example:**
1134
2222
  ```bash
1135
- bgc earn earn_subscribe_redeem --action <value> --productId <value>
2223
+ bgc inst_loan --action orders
1136
2224
  ```
1137
2225
 
1138
- ### `earn_get_holdings`
2226
+ #### `bgc inst_loan --action ltv`
1139
2227
 
1140
- Get current earn holdings and earnings records. Private endpoint. Rate limit: 10 req/s per UID.
2228
+ `GET /api/v3/ins-loan/ltv-convert` · private
1141
2229
 
1142
- **Write operation:** No
2230
+ Get LTV
1143
2231
 
1144
- **Parameters:**
2232
+ Optional:
1145
2233
 
1146
- | Name | Type | Required | Description |
1147
- |------|------|----------|-------------|
1148
- | `coin` | string | No | |
1149
- | `periodType` | string | Yes | |
2234
+ | Param | Type | Enum | Description |
2235
+ |-------|------|------|-------------|
2236
+ | `riskUnitId` | string | | Risk Unit ID |
1150
2237
 
1151
- **Example:**
1152
2238
  ```bash
1153
- bgc earn earn_get_holdings --coin <value> --periodType <value>
2239
+ bgc inst_loan --action ltv
1154
2240
  ```
1155
2241
 
1156
- ## Module: p2p
2242
+ #### `bgc inst_loan --action marginCoins`
2243
+
2244
+ `GET /api/v3/ins-loan/ensure-coins-convert` · private
2245
+
2246
+ Get Margin Coin Info
2247
+
2248
+ Required:
2249
+
2250
+ | Param | Type | Enum | Description |
2251
+ |-------|------|------|-------------|
2252
+ | `productId` | string | | Product Id |
2253
+
2254
+ ```bash
2255
+ bgc inst_loan --action marginCoins --productId <productId>
2256
+ ```
1157
2257
 
1158
- ### `p2p_get_merchants`
2258
+ #### `bgc inst_loan --action products`
1159
2259
 
1160
- Get P2P merchant list or specific merchant details. Private endpoint. Rate limit: 10 req/s per UID.
2260
+ `GET /api/v3/ins-loan/product-infos` · private
1161
2261
 
1162
- **Write operation:** No
2262
+ Get Product Info
1163
2263
 
1164
- **Parameters:**
2264
+ Required:
1165
2265
 
1166
- | Name | Type | Required | Description |
1167
- |------|------|----------|-------------|
1168
- | `merchantId` | string | No | |
2266
+ | Param | Type | Enum | Description |
2267
+ |-------|------|------|-------------|
2268
+ | `productId` | string | | Product Id |
1169
2269
 
1170
- **Example:**
1171
2270
  ```bash
1172
- bgc p2p p2p_get_merchants --merchantId <value>
2271
+ bgc inst_loan --action products --productId <productId>
1173
2272
  ```
1174
2273
 
1175
- ### `p2p_get_orders`
2274
+ #### `bgc inst_loan --action repaymentOrders`
2275
+
2276
+ `GET /api/v3/ins-loan/repaid-history` · private
2277
+
2278
+ Get Repayment Orders
2279
+
2280
+ Optional:
2281
+
2282
+ | Param | Type | Enum | Description |
2283
+ |-------|------|------|-------------|
2284
+ | `startTime` | string | | The start timestamp (ms) |
2285
+ | `endTime` | string | | The end timestamp (ms) |
2286
+ | `limit` | string | | Limit default 100; max 100 |
2287
+
2288
+ ```bash
2289
+ bgc inst_loan --action repaymentOrders
2290
+ ```
1176
2291
 
1177
- Get P2P order list or advertisement list. Private endpoint. Rate limit: 10 req/s per UID.
2292
+ #### `bgc inst_loan --action riskUnit`
1178
2293
 
1179
- **Write operation:** No
2294
+ `GET /api/v3/ins-loan/risk-unit` · private
1180
2295
 
1181
- **Parameters:**
2296
+ Get Risk Unit
1182
2297
 
1183
- | Name | Type | Required | Description |
1184
- |------|------|----------|-------------|
1185
- | `type` | string | No | orders(default) or advertisements. |
1186
- | `status` | string | No | |
1187
- | `startTime` | string | No | |
1188
- | `endTime` | string | No | |
1189
- | `side` | string | No | Required for advertisements: buy or sell. |
1190
- | `coin` | string | No | Required for advertisements: coin to trade. |
1191
- | `fiat` | string | No | Required for advertisements: fiat currency. |
2298
+ _No business parameters._
1192
2299
 
1193
- **Example:**
1194
2300
  ```bash
1195
- bgc p2p p2p_get_orders --type <value> --status <value>
2301
+ bgc inst_loan --action riskUnit
1196
2302
  ```
1197
2303
 
1198
- ## Module: broker
2304
+ #### `bgc inst_loan --action symbols`
2305
+
2306
+ `GET /api/v3/ins-loan/symbols` · private
1199
2307
 
1200
- ### `broker_get_info`
2308
+ Get Trade Symbols
1201
2309
 
1202
- Get broker account information and commission data. Private endpoint. Rate limit: 10 req/s per UID.
2310
+ Required:
1203
2311
 
1204
- **Write operation:** No
2312
+ | Param | Type | Enum | Description |
2313
+ |-------|------|------|-------------|
2314
+ | `productId` | string | | Product Id |
1205
2315
 
1206
- **Example:**
1207
2316
  ```bash
1208
- bgc broker broker_get_info
2317
+ bgc inst_loan --action symbols --productId <productId>
1209
2318
  ```
1210
2319
 
1211
- ### `broker_manage_subaccounts`
2320
+ #### `bgc inst_loan --action transferred`
2321
+
2322
+ `GET /api/v3/ins-loan/transfered` · private
2323
+
2324
+ Get Transferred Quantity
1212
2325
 
1213
- Create, modify, or list broker subaccounts. Private endpoint. Rate limit: 5 req/s per UID.
2326
+ Required:
1214
2327
 
1215
- **Write operation:** Yes — requires confirmation
2328
+ | Param | Type | Enum | Description |
2329
+ |-------|------|------|-------------|
2330
+ | `coin` | string | | Coin |
1216
2331
 
1217
- **Parameters:**
2332
+ Optional:
1218
2333
 
1219
- | Name | Type | Required | Description |
1220
- |------|------|----------|-------------|
1221
- | `action` | string | Yes | |
1222
- | `subAccountUid` | string | No | |
1223
- | `subAccountName` | string | No | |
1224
- | `permList` | array | No | |
1225
- | `status` | string | No | |
1226
- | `limit` | number | No | |
1227
- | `idLessThan` | string | No | |
1228
- | `startTime` | string | No | |
1229
- | `endTime` | string | No | |
2334
+ | Param | Type | Enum | Description |
2335
+ |-------|------|------|-------------|
2336
+ | `userId` | string | | User Id (Master account or sub-accounts) |
1230
2337
 
1231
- **Example:**
1232
2338
  ```bash
1233
- bgc broker broker_manage_subaccounts --action <value> --subAccountUid <value>
2339
+ bgc inst_loan --action transferred --coin <coin>
1234
2340
  ```
1235
2341
 
1236
- ### `broker_manage_apikeys`
2342
+ ## Domain: tax
2343
+
2344
+ ### `tax`
2345
+
2346
+ risk: **read** · write: no · auth: private
2347
+
2348
+ [VERB] Tax records (read-only): records lists unified-account tax records.
2349
+
2350
+ **Actions:** `records`
1237
2351
 
1238
- Create, modify, list, or delete API keys for broker subaccounts. Private endpoint. Rate limit: 5 req/s per UID.
2352
+ #### `bgc tax --action records`
1239
2353
 
1240
- **Write operation:** Yes — requires confirmation
2354
+ `GET /api/v3/tax/records` · private
1241
2355
 
1242
- **Parameters:**
2356
+ Get Unified Account Tax Records
1243
2357
 
1244
- | Name | Type | Required | Description |
1245
- |------|------|----------|-------------|
1246
- | `action` | string | Yes | |
1247
- | `subAccountUid` | string | Yes | |
1248
- | `apiKeyPermissions` | string | No | |
1249
- | `apiKeyIp` | string | No | |
1250
- | `apiKeyPassphrase` | string | No | |
1251
- | `label` | string | No | |
1252
- | `permType` | string | No | |
1253
- | `apiKey` | string | No | |
2358
+ Required:
2359
+
2360
+ | Param | Type | Enum | Description |
2361
+ |-------|------|------|-------------|
2362
+ | `bizType` | string | `SPOT` \| `MARGIN` \| `USDT-FUTURES` \| `COIN-FUTURES` \| `USDC-FUTURES` \| `OTHER` | Product type SPOT Spot trading MARGIN Margin trading USDT-FUTURES USDT futures COIN-FUTURES Coin-M futures USDC-FUTURES USDC futures OTHER Other |
2363
+ | `startTime` | string | | Start timestamp A Unix timestamp in milliseconds e.g.,1597026383085 |
2364
+ | `endTime` | string | | End timestamp A Unix timestamp in milliseconds e.g.,1597026383185 The time range between startTime and endTime must not exceed 7 days |
2365
+
2366
+ Optional:
2367
+
2368
+ | Param | Type | Enum | Description |
2369
+ |-------|------|------|-------------|
2370
+ | `marginType` | string | `isolated` \| `crossed` | Margin Type: isolated isolated margin crossed cross margin. This field is effective when category=MARGIN. If not specified, the default is crossed (cross margin). |
2371
+ | `coin` | string | | Coin name - If not specified, tax records for all coins will be returned. |
2372
+ | `limit` | string | | Limit per page Default:500. Maximum:500 |
2373
+ | `cursor` | string | | Cursor ID - Used for pagination. Do not include it for the first query. When querying the second page and subsequent data, use the id returned from the previous query. The interface will then return the data for the nex… |
1254
2374
 
1255
- **Example:**
1256
2375
  ```bash
1257
- bgc broker broker_manage_apikeys --action <value> --subAccountUid <value>
2376
+ bgc tax --action records --bizType <bizType> --startTime <startTime> --endTime <endTime>
1258
2377
  ```
2378
+
2379
+ ## Meta tools
2380
+
2381
+ ### `discover`
2382
+
2383
+ Progressive introspection of the live surface. `bgc discover` lists domains; `--domain <d>` lists a domain's verbs; `--tool <t>` returns one verb's full schema; `--tool <t> --action <a>` returns one action's exact required/optional contract; `--search <q>` keyword-searches the whole surface.
2384
+
2385
+ ### `raw`
2386
+
2387
+ Escape hatch to any catalog operation by id, bypassing the intent layer: `bgc raw --operationId <id> --args '<json>'`. Use when no verb fronts the operation you need.