@bitget-ai/bitget-agent-skill 1.2.0 → 3.0.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.
- package/CHANGELOG.md +23 -0
- package/README.md +189 -57
- package/VERSION +1 -1
- package/package.json +5 -3
- package/references/auth-setup.md +37 -9
- package/references/commands.md +1903 -774
- package/references/demo-trading.md +31 -28
- package/references/discover-guide.md +112 -0
- package/references/error-codes.md +111 -46
- package/references/trading-safety.md +163 -0
- package/scripts/gen-references.js +241 -45
- package/scripts/install.js +8 -1
- package/skills/SKILL.md +158 -139
- package/references/trading/README.md +0 -36
- package/references/trading/futures-cancel-orders.md +0 -113
- package/references/trading/futures-get-orders.md +0 -155
- package/references/trading/futures-leverage-config.md +0 -184
- package/references/trading/futures-modify-order.md +0 -173
- package/references/trading/futures-place-order.md +0 -429
- package/references/trading/futures-positions.md +0 -154
- package/references/trading/spot-cancel-orders.md +0 -87
- package/references/trading/spot-get-orders.md +0 -120
- package/references/trading/spot-modify-order.md +0 -95
- package/references/trading/spot-place-order.md +0 -166
- package/references/trading/spot-plan-orders.md +0 -160
package/references/commands.md
CHANGED
|
@@ -1,1258 +1,2387 @@
|
|
|
1
|
-
# bgc Command Reference
|
|
1
|
+
# bgc Command Reference (UTA / v3)
|
|
2
2
|
|
|
3
|
-
Auto-generated from
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
703
|
+
#### `bgc position --action close` — **[DANGER] requires `--confirm`**
|
|
12
704
|
|
|
13
|
-
|
|
705
|
+
`POST /api/v3/trade/close-positions` · private · write
|
|
14
706
|
|
|
15
|
-
|
|
707
|
+
Close All Positions
|
|
16
708
|
|
|
17
|
-
|
|
709
|
+
Required:
|
|
18
710
|
|
|
19
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
|
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
|
|
723
|
+
bgc position --action close --category <category> --symbol <symbol>
|
|
28
724
|
```
|
|
29
725
|
|
|
30
|
-
|
|
726
|
+
#### `bgc position --action closeAll` — **[DANGER] requires `--confirm`**
|
|
727
|
+
|
|
728
|
+
`POST /api/v3/trade/close-positions` · private · write
|
|
31
729
|
|
|
32
|
-
|
|
730
|
+
Close All Positions
|
|
33
731
|
|
|
34
|
-
|
|
732
|
+
Required:
|
|
35
733
|
|
|
36
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
|
41
|
-
|
|
42
|
-
| `
|
|
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
|
|
746
|
+
bgc position --action closeAll --category <category>
|
|
47
747
|
```
|
|
48
748
|
|
|
49
|
-
### `
|
|
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
|
-
|
|
757
|
+
#### `bgc strategy_order --action place`
|
|
52
758
|
|
|
53
|
-
|
|
759
|
+
`POST /api/v3/trade/place-strategy-order` · private · write
|
|
54
760
|
|
|
55
|
-
|
|
761
|
+
Place Strategy Order
|
|
56
762
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
|
60
|
-
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
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
|
|
789
|
+
bgc strategy_order --action place --category <category> --symbol <symbol> --qty <qty> --posSide <posSide>
|
|
68
790
|
```
|
|
69
791
|
|
|
70
|
-
|
|
792
|
+
#### `bgc strategy_order --action cancel`
|
|
793
|
+
|
|
794
|
+
`POST /api/v3/trade/cancel-strategy-order` · private · write
|
|
71
795
|
|
|
72
|
-
|
|
796
|
+
Cancel Strategy Order
|
|
73
797
|
|
|
74
|
-
|
|
798
|
+
Required:
|
|
75
799
|
|
|
76
|
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
|
81
|
-
|
|
82
|
-
| `
|
|
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
|
|
811
|
+
bgc strategy_order --action cancel --orderId <orderId>
|
|
88
812
|
```
|
|
89
813
|
|
|
90
|
-
|
|
814
|
+
#### `bgc strategy_order --action modify`
|
|
815
|
+
|
|
816
|
+
`POST /api/v3/trade/modify-strategy-order` · private · write
|
|
91
817
|
|
|
92
|
-
|
|
818
|
+
Modify Strategy Order
|
|
93
819
|
|
|
94
|
-
|
|
820
|
+
Required:
|
|
95
821
|
|
|
96
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
|
101
|
-
|
|
102
|
-
| `
|
|
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
|
|
842
|
+
bgc strategy_order --action modify --orderId <orderId> --qty <qty>
|
|
107
843
|
```
|
|
108
844
|
|
|
109
|
-
|
|
845
|
+
#### `bgc strategy_order --action open`
|
|
846
|
+
|
|
847
|
+
`GET /api/v3/trade/unfilled-strategy-orders` · private
|
|
110
848
|
|
|
111
|
-
|
|
849
|
+
Unfilled Strategy Orders
|
|
112
850
|
|
|
113
|
-
|
|
851
|
+
Required:
|
|
114
852
|
|
|
115
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
|
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
|
|
864
|
+
bgc strategy_order --action open --category <category>
|
|
124
865
|
```
|
|
125
866
|
|
|
126
|
-
|
|
867
|
+
#### `bgc strategy_order --action history`
|
|
868
|
+
|
|
869
|
+
`GET /api/v3/trade/history-strategy-orders` · private
|
|
127
870
|
|
|
128
|
-
|
|
871
|
+
History Strategy Orders
|
|
129
872
|
|
|
130
|
-
|
|
873
|
+
Required:
|
|
131
874
|
|
|
132
|
-
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
|
137
|
-
|
|
138
|
-
| `
|
|
139
|
-
| `
|
|
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
|
|
890
|
+
bgc strategy_order --action history --category <category>
|
|
144
891
|
```
|
|
145
892
|
|
|
146
|
-
|
|
893
|
+
## Domain: account
|
|
894
|
+
|
|
895
|
+
### `account_overview`
|
|
147
896
|
|
|
148
|
-
|
|
897
|
+
risk: **read** · write: no · auth: private
|
|
149
898
|
|
|
150
|
-
|
|
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
|
-
|
|
901
|
+
Optional:
|
|
153
902
|
|
|
154
|
-
|
|
|
155
|
-
|
|
156
|
-
| `
|
|
157
|
-
| `
|
|
158
|
-
| `
|
|
159
|
-
| `
|
|
160
|
-
| `
|
|
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
|
|
912
|
+
bgc account_overview
|
|
165
913
|
```
|
|
166
914
|
|
|
167
|
-
### `
|
|
915
|
+
### `account_config`
|
|
168
916
|
|
|
169
|
-
|
|
917
|
+
risk: **write** · write: no · auth: private
|
|
170
918
|
|
|
171
|
-
|
|
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
|
-
**
|
|
921
|
+
**Actions:** `setAccountMode`, `setHoldingMode`, `setLeverage`, `switchAccount`, `switchDeduct`, `switchStatus`, `deductInfo`, `oiLimit`, `paymentCoins`
|
|
174
922
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
|
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
|
|
942
|
+
bgc account_config --action setAccountMode --mode <mode>
|
|
188
943
|
```
|
|
189
944
|
|
|
190
|
-
|
|
945
|
+
#### `bgc account_config --action setHoldingMode`
|
|
191
946
|
|
|
192
|
-
|
|
947
|
+
`POST /api/v3/account/set-hold-mode` · private · write
|
|
193
948
|
|
|
194
|
-
|
|
949
|
+
Set Holding Mode
|
|
195
950
|
|
|
196
|
-
|
|
951
|
+
Required:
|
|
197
952
|
|
|
198
|
-
|
|
|
199
|
-
|
|
200
|
-
| `
|
|
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
|
|
958
|
+
bgc account_config --action setHoldingMode --holdMode <holdMode>
|
|
209
959
|
```
|
|
210
960
|
|
|
211
|
-
|
|
961
|
+
#### `bgc account_config --action setLeverage`
|
|
962
|
+
|
|
963
|
+
`POST /api/v3/account/set-leverage` · private · write
|
|
964
|
+
|
|
965
|
+
Set Leverage
|
|
212
966
|
|
|
213
|
-
|
|
967
|
+
Required:
|
|
214
968
|
|
|
215
|
-
|
|
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
|
-
|
|
974
|
+
Optional:
|
|
218
975
|
|
|
219
|
-
|
|
|
220
|
-
|
|
221
|
-
| `
|
|
222
|
-
| `
|
|
223
|
-
| `
|
|
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
|
|
983
|
+
bgc account_config --action setLeverage --category <category> --leverage <leverage>
|
|
233
984
|
```
|
|
234
985
|
|
|
235
|
-
|
|
986
|
+
#### `bgc account_config --action switchAccount`
|
|
236
987
|
|
|
237
|
-
|
|
988
|
+
`POST /api/v3/account/switch` · private · write
|
|
238
989
|
|
|
239
|
-
|
|
990
|
+
Switch Account
|
|
240
991
|
|
|
241
|
-
|
|
992
|
+
_No business parameters._
|
|
242
993
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
|
1011
|
+
bgc account_config --action switchDeduct --deduct <deduct>
|
|
254
1012
|
```
|
|
255
1013
|
|
|
256
|
-
|
|
1014
|
+
#### `bgc account_config --action switchStatus`
|
|
1015
|
+
|
|
1016
|
+
`GET /api/v3/account/switch-status` · private
|
|
257
1017
|
|
|
258
|
-
|
|
1018
|
+
Get Switch Status
|
|
259
1019
|
|
|
260
|
-
|
|
1020
|
+
_No business parameters._
|
|
261
1021
|
|
|
262
|
-
|
|
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
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
|
1035
|
+
bgc account_config --action deductInfo
|
|
272
1036
|
```
|
|
273
1037
|
|
|
274
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1051
|
+
```bash
|
|
1052
|
+
bgc account_config --action oiLimit --symbol <symbol> --category <category>
|
|
1053
|
+
```
|
|
279
1054
|
|
|
280
|
-
|
|
1055
|
+
#### `bgc account_config --action paymentCoins`
|
|
281
1056
|
|
|
282
|
-
|
|
1057
|
+
`GET /api/v3/account/payment-coins` · private
|
|
283
1058
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
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
|
|
1064
|
+
bgc account_config --action paymentCoins
|
|
292
1065
|
```
|
|
293
1066
|
|
|
294
|
-
### `
|
|
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
|
-
|
|
1079
|
+
Repay
|
|
297
1080
|
|
|
298
|
-
|
|
1081
|
+
Required:
|
|
299
1082
|
|
|
300
|
-
|
|
1083
|
+
| Param | Type | Enum | Description |
|
|
1084
|
+
|-------|------|------|-------------|
|
|
1085
|
+
| `repayableCoinList` | array | | Repayable coin list |
|
|
1086
|
+
| `paymentCoinList` | array | | Payment coin list |
|
|
301
1087
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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
|
|
1101
|
+
bgc repayment --action repayable
|
|
312
1102
|
```
|
|
313
1103
|
|
|
314
|
-
|
|
1104
|
+
## Domain: funds
|
|
1105
|
+
|
|
1106
|
+
### `transfer_funds`
|
|
1107
|
+
|
|
1108
|
+
risk: **write** · write: no · auth: private
|
|
315
1109
|
|
|
316
|
-
|
|
1110
|
+
[VERB] Move funds by intent: action internal \| mainToSub \| subToMain. preflight reports max transferable without moving anything; transfers honor dryRun/readOnly.
|
|
317
1111
|
|
|
318
|
-
**
|
|
1112
|
+
**Actions:** `internal`, `mainToSub`, `subToMain`
|
|
319
1113
|
|
|
320
|
-
|
|
1114
|
+
#### `bgc transfer_funds --action internal`
|
|
321
1115
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
|
329
|
-
|
|
330
|
-
| `
|
|
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
|
|
1137
|
+
bgc transfer_funds --action internal --fromType <fromType> --toType <toType> --amount <amount> --coin <coin>
|
|
335
1138
|
```
|
|
336
1139
|
|
|
337
|
-
|
|
1140
|
+
#### `bgc transfer_funds --action mainToSub`
|
|
1141
|
+
|
|
1142
|
+
`POST /api/v3/account/sub-transfer` · private · write
|
|
338
1143
|
|
|
339
|
-
|
|
1144
|
+
Main-Sub Account Transfer
|
|
340
1145
|
|
|
341
|
-
|
|
1146
|
+
Required:
|
|
342
1147
|
|
|
343
|
-
|
|
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
|
-
|
|
346
|
-
|
|
347
|
-
|
|
|
348
|
-
|
|
349
|
-
| `
|
|
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
|
|
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
|
-
|
|
1168
|
+
#### `bgc transfer_funds --action subToMain`
|
|
1169
|
+
|
|
1170
|
+
`POST /api/v3/account/sub-master-transfer` · private · write
|
|
359
1171
|
|
|
360
|
-
|
|
1172
|
+
Sub-Main Account Transfer
|
|
361
1173
|
|
|
362
|
-
|
|
1174
|
+
Required:
|
|
363
1175
|
|
|
364
|
-
|
|
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
|
-
|
|
367
|
-
|
|
368
|
-
|
|
|
369
|
-
|
|
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
|
|
1190
|
+
bgc transfer_funds --action subToMain --fromType <fromType> --toType <toType> --amount <amount> --coin <coin>
|
|
374
1191
|
```
|
|
375
1192
|
|
|
376
|
-
### `
|
|
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
|
-
|
|
1201
|
+
#### `bgc deposit --action address`
|
|
379
1202
|
|
|
380
|
-
|
|
1203
|
+
`GET /api/v3/account/deposit-address` · private
|
|
381
1204
|
|
|
382
|
-
|
|
1205
|
+
Get Deposit Address
|
|
383
1206
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
|
387
|
-
|
|
388
|
-
| `
|
|
389
|
-
|
|
390
|
-
|
|
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
|
|
1221
|
+
bgc deposit --action address --coin <coin>
|
|
395
1222
|
```
|
|
396
1223
|
|
|
397
|
-
|
|
1224
|
+
#### `bgc deposit --action records`
|
|
1225
|
+
|
|
1226
|
+
`GET /api/v3/account/deposit-records` · private
|
|
398
1227
|
|
|
399
|
-
Get
|
|
1228
|
+
Get Deposit Records
|
|
400
1229
|
|
|
401
|
-
|
|
1230
|
+
Required:
|
|
402
1231
|
|
|
403
|
-
|
|
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
|
-
|
|
406
|
-
|
|
407
|
-
|
|
|
408
|
-
|
|
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
|
|
1247
|
+
bgc deposit --action records --startTime <startTime> --endTime <endTime>
|
|
413
1248
|
```
|
|
414
1249
|
|
|
415
|
-
|
|
1250
|
+
#### `bgc deposit --action setupAccount`
|
|
416
1251
|
|
|
417
|
-
|
|
1252
|
+
`POST /api/v3/account/deposit-account` · private · write
|
|
418
1253
|
|
|
419
|
-
|
|
1254
|
+
Set Up Deposit Account
|
|
420
1255
|
|
|
421
|
-
|
|
1256
|
+
Required:
|
|
422
1257
|
|
|
423
|
-
|
|
|
424
|
-
|
|
425
|
-
| `
|
|
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
|
|
1264
|
+
bgc deposit --action setupAccount --coin <coin> --accountType <accountType>
|
|
430
1265
|
```
|
|
431
1266
|
|
|
432
|
-
### `
|
|
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
|
-
|
|
1281
|
+
Required:
|
|
435
1282
|
|
|
436
|
-
|
|
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
|
-
|
|
1290
|
+
Optional:
|
|
439
1291
|
|
|
440
|
-
|
|
|
441
|
-
|
|
442
|
-
| `
|
|
443
|
-
| `
|
|
444
|
-
| `
|
|
445
|
-
| `
|
|
446
|
-
| `
|
|
447
|
-
| `
|
|
448
|
-
| `
|
|
449
|
-
| `
|
|
450
|
-
| `
|
|
451
|
-
| `
|
|
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
|
|
1307
|
+
bgc withdraw --action submit --coin <coin> --transferType <transferType> --address <address> --size <size>
|
|
456
1308
|
```
|
|
457
1309
|
|
|
458
|
-
|
|
1310
|
+
#### `bgc withdraw --action records`
|
|
459
1311
|
|
|
460
|
-
|
|
1312
|
+
`GET /api/v3/account/withdrawal-records` · private
|
|
461
1313
|
|
|
462
|
-
|
|
1314
|
+
Get Withdrawal Records
|
|
463
1315
|
|
|
464
|
-
|
|
1316
|
+
Required:
|
|
465
1317
|
|
|
466
|
-
|
|
|
467
|
-
|
|
468
|
-
| `
|
|
469
|
-
| `
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
|
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
|
|
1334
|
+
bgc withdraw --action records --startTime <startTime> --endTime <endTime>
|
|
478
1335
|
```
|
|
479
1336
|
|
|
480
|
-
### `
|
|
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
|
-
|
|
1351
|
+
Required:
|
|
483
1352
|
|
|
484
|
-
|
|
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
|
-
|
|
1357
|
+
Optional:
|
|
487
1358
|
|
|
488
|
-
|
|
|
489
|
-
|
|
490
|
-
| `
|
|
491
|
-
| `
|
|
492
|
-
| `
|
|
493
|
-
| `
|
|
494
|
-
| `
|
|
495
|
-
| `
|
|
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
|
|
1369
|
+
bgc funds_records --action financial --category <category>
|
|
501
1370
|
```
|
|
502
1371
|
|
|
503
|
-
|
|
1372
|
+
#### `bgc funds_records --action convert`
|
|
504
1373
|
|
|
505
|
-
|
|
1374
|
+
`GET /api/v3/account/convert-records` · private
|
|
506
1375
|
|
|
507
|
-
|
|
1376
|
+
Get Convert Records
|
|
508
1377
|
|
|
509
|
-
|
|
1378
|
+
Required:
|
|
510
1379
|
|
|
511
|
-
|
|
|
512
|
-
|
|
513
|
-
| `
|
|
514
|
-
| `
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
|
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
|
|
1395
|
+
bgc funds_records --action convert --fromCoin <fromCoin> --toCoin <toCoin>
|
|
523
1396
|
```
|
|
524
1397
|
|
|
525
|
-
|
|
1398
|
+
#### `bgc funds_records --action subTransfers`
|
|
526
1399
|
|
|
527
|
-
|
|
1400
|
+
`GET /api/v3/account/sub-transfer-record` · private
|
|
528
1401
|
|
|
529
|
-
|
|
1402
|
+
Get the transfer records of Main-Sub account
|
|
530
1403
|
|
|
531
|
-
|
|
1404
|
+
Optional:
|
|
532
1405
|
|
|
533
|
-
|
|
|
534
|
-
|
|
535
|
-
| `
|
|
536
|
-
| `
|
|
537
|
-
| `
|
|
538
|
-
| `
|
|
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
|
|
1418
|
+
bgc funds_records --action subTransfers
|
|
543
1419
|
```
|
|
544
1420
|
|
|
545
|
-
|
|
1421
|
+
#### `bgc funds_records --action transferableCoins`
|
|
546
1422
|
|
|
547
|
-
|
|
1423
|
+
`GET /api/v3/account/transferable-coins` · private
|
|
548
1424
|
|
|
549
|
-
|
|
1425
|
+
Get Transferable Coins
|
|
550
1426
|
|
|
551
|
-
|
|
1427
|
+
Required:
|
|
552
1428
|
|
|
553
|
-
|
|
|
554
|
-
|
|
555
|
-
| `
|
|
556
|
-
| `
|
|
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
|
|
1435
|
+
bgc funds_records --action transferableCoins --fromType <fromType> --toType <toType>
|
|
564
1436
|
```
|
|
565
1437
|
|
|
566
|
-
|
|
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
|
-
|
|
1452
|
+
Create Sub-account
|
|
569
1453
|
|
|
570
|
-
|
|
1454
|
+
Required:
|
|
571
1455
|
|
|
572
|
-
|
|
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
|
-
|
|
575
|
-
|
|
576
|
-
|
|
|
577
|
-
|
|
578
|
-
| `
|
|
579
|
-
| `
|
|
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
|
|
1468
|
+
bgc subaccount --action create --username <username>
|
|
586
1469
|
```
|
|
587
1470
|
|
|
588
|
-
|
|
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
|
-
|
|
1489
|
+
#### `bgc subaccount --action list`
|
|
591
1490
|
|
|
592
|
-
|
|
1491
|
+
`GET /api/v3/user/sub-list` · private
|
|
593
1492
|
|
|
594
|
-
|
|
1493
|
+
Get Sub-account List
|
|
595
1494
|
|
|
596
|
-
|
|
1495
|
+
Optional:
|
|
597
1496
|
|
|
598
|
-
|
|
|
599
|
-
|
|
600
|
-
| `
|
|
601
|
-
| `
|
|
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
|
|
1503
|
+
bgc subaccount --action list
|
|
607
1504
|
```
|
|
608
1505
|
|
|
609
|
-
|
|
1506
|
+
#### `bgc subaccount --action freeze`
|
|
610
1507
|
|
|
611
|
-
|
|
1508
|
+
`POST /api/v3/user/freeze-sub` · private · write
|
|
612
1509
|
|
|
613
|
-
|
|
1510
|
+
Freeze/Unfreeze Sub-account
|
|
614
1511
|
|
|
615
|
-
|
|
1512
|
+
Required:
|
|
616
1513
|
|
|
617
|
-
|
|
|
618
|
-
|
|
619
|
-
| `
|
|
620
|
-
| `
|
|
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
|
|
1520
|
+
bgc subaccount --action freeze --subUid <subUid> --operation <operation>
|
|
630
1521
|
```
|
|
631
1522
|
|
|
632
|
-
|
|
1523
|
+
#### `bgc subaccount --action assets`
|
|
633
1524
|
|
|
634
|
-
|
|
1525
|
+
`GET /api/v3/account/sub-unified-assets` · private
|
|
635
1526
|
|
|
636
|
-
|
|
1527
|
+
Get SubAccount Unified Assets
|
|
637
1528
|
|
|
638
|
-
|
|
1529
|
+
Optional:
|
|
639
1530
|
|
|
640
|
-
|
|
|
641
|
-
|
|
642
|
-
| `
|
|
643
|
-
| `
|
|
644
|
-
| `
|
|
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
|
|
1538
|
+
bgc subaccount --action assets
|
|
655
1539
|
```
|
|
656
1540
|
|
|
657
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1639
|
+
Optional:
|
|
662
1640
|
|
|
663
|
-
|
|
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
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
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
|
|
1697
|
+
bgc broker --action createSub --subaccountName <subaccountName> --label <label>
|
|
678
1698
|
```
|
|
679
1699
|
|
|
680
|
-
|
|
1700
|
+
#### `bgc broker --action modifySub`
|
|
1701
|
+
|
|
1702
|
+
`POST /api/v3/broker/modify-sub` · private · write
|
|
681
1703
|
|
|
682
|
-
|
|
1704
|
+
Modify Broker Sub-Account
|
|
683
1705
|
|
|
684
|
-
|
|
1706
|
+
Required:
|
|
685
1707
|
|
|
686
|
-
|
|
1708
|
+
| Param | Type | Enum | Description |
|
|
1709
|
+
|-------|------|------|-------------|
|
|
1710
|
+
| `subUid` | string | | Sub-account UID |
|
|
687
1711
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
|
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
|
|
1720
|
+
bgc broker --action modifySub --subUid <subUid>
|
|
695
1721
|
```
|
|
696
1722
|
|
|
697
|
-
|
|
1723
|
+
#### `bgc broker --action listSubs`
|
|
698
1724
|
|
|
699
|
-
|
|
1725
|
+
`GET /api/v3/broker/sub-list` · private
|
|
700
1726
|
|
|
701
|
-
|
|
1727
|
+
Get Broker Sub-Account List
|
|
702
1728
|
|
|
703
|
-
|
|
1729
|
+
Optional:
|
|
704
1730
|
|
|
705
|
-
|
|
|
706
|
-
|
|
707
|
-
| `
|
|
708
|
-
| `
|
|
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
|
|
1738
|
+
bgc broker --action listSubs
|
|
713
1739
|
```
|
|
714
1740
|
|
|
715
|
-
|
|
1741
|
+
#### `bgc broker --action createApiKey`
|
|
716
1742
|
|
|
717
|
-
|
|
1743
|
+
`POST /api/v3/broker/create-sub-apikey` · private · write
|
|
718
1744
|
|
|
719
|
-
|
|
1745
|
+
Create Broker Sub-Account API Key
|
|
720
1746
|
|
|
721
|
-
|
|
1747
|
+
Required:
|
|
722
1748
|
|
|
723
|
-
|
|
|
724
|
-
|
|
725
|
-
| `
|
|
726
|
-
| `
|
|
727
|
-
| `
|
|
728
|
-
| `
|
|
729
|
-
| `
|
|
730
|
-
| `
|
|
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
|
|
1759
|
+
bgc broker --action createApiKey --subUid <subUid> --passphrase <passphrase> --label <label> --ipList <ipList> --permType <permType> --permList <permList>
|
|
735
1760
|
```
|
|
736
1761
|
|
|
737
|
-
|
|
1762
|
+
#### `bgc broker --action modifyApiKey`
|
|
1763
|
+
|
|
1764
|
+
`POST /api/v3/broker/modify-sub-apikey` · private · write
|
|
738
1765
|
|
|
739
|
-
|
|
1766
|
+
Modify Broker Sub-Account API Key
|
|
740
1767
|
|
|
741
|
-
|
|
1768
|
+
Required:
|
|
742
1769
|
|
|
743
|
-
|
|
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
|
-
|
|
746
|
-
|
|
747
|
-
|
|
|
748
|
-
|
|
749
|
-
| `
|
|
750
|
-
| `
|
|
751
|
-
| `
|
|
752
|
-
| `
|
|
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
|
|
1786
|
+
bgc broker --action modifyApiKey --subUid <subUid> --passphrase <passphrase> --apiKey <apiKey>
|
|
762
1787
|
```
|
|
763
1788
|
|
|
764
|
-
|
|
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
|
-
|
|
1806
|
+
#### `bgc broker --action apiKeys`
|
|
767
1807
|
|
|
768
|
-
|
|
1808
|
+
`GET /api/v3/broker/query-sub-apikey` · private
|
|
769
1809
|
|
|
770
|
-
|
|
1810
|
+
Get Broker Sub-Account API Key
|
|
771
1811
|
|
|
772
|
-
|
|
1812
|
+
Required:
|
|
773
1813
|
|
|
774
|
-
|
|
|
775
|
-
|
|
776
|
-
| `
|
|
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
|
|
1819
|
+
bgc broker --action apiKeys --subUid <subUid>
|
|
783
1820
|
```
|
|
784
1821
|
|
|
785
|
-
|
|
1822
|
+
#### `bgc broker --action withdraw` — **[DANGER] requires `--confirm`**
|
|
786
1823
|
|
|
787
|
-
|
|
1824
|
+
`POST /api/v3/broker/sub-withdrawal` · private · write
|
|
788
1825
|
|
|
789
|
-
|
|
1826
|
+
Broker Subaccount Withdrawal
|
|
790
1827
|
|
|
791
|
-
|
|
1828
|
+
Required:
|
|
792
1829
|
|
|
793
|
-
|
|
|
794
|
-
|
|
795
|
-
| `
|
|
796
|
-
| `coin` | string |
|
|
797
|
-
| `
|
|
798
|
-
| `
|
|
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
|
|
1847
|
+
bgc broker --action withdraw --subUid <subUid> --coin <coin> --dest <dest> --address <address> --amount <amount>
|
|
803
1848
|
```
|
|
804
1849
|
|
|
805
|
-
|
|
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
|
-
|
|
1856
|
+
Required:
|
|
808
1857
|
|
|
809
|
-
|
|
1858
|
+
| Param | Type | Enum | Description |
|
|
1859
|
+
|-------|------|------|-------------|
|
|
1860
|
+
| `subUid` | string | | Sub-account UID |
|
|
1861
|
+
| `coin` | string | | Coin name |
|
|
810
1862
|
|
|
811
|
-
|
|
1863
|
+
Optional:
|
|
812
1864
|
|
|
813
|
-
|
|
|
814
|
-
|
|
815
|
-
| `
|
|
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
|
|
1870
|
+
bgc broker --action depositAddress --subUid <subUid> --coin <coin>
|
|
824
1871
|
```
|
|
825
1872
|
|
|
826
|
-
|
|
1873
|
+
#### `bgc broker --action depositWithdrawRecords`
|
|
827
1874
|
|
|
828
|
-
|
|
1875
|
+
`GET /api/v3/broker/all-sub-deposit-withdrawal` · private
|
|
829
1876
|
|
|
830
|
-
|
|
1877
|
+
Get All Broker Subaccount Deposit Withdrawal
|
|
831
1878
|
|
|
832
|
-
|
|
1879
|
+
Optional:
|
|
833
1880
|
|
|
834
|
-
|
|
|
835
|
-
|
|
836
|
-
| `
|
|
837
|
-
| `
|
|
838
|
-
| `
|
|
839
|
-
| `
|
|
840
|
-
| `
|
|
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
|
|
1890
|
+
bgc broker --action depositWithdrawRecords
|
|
848
1891
|
```
|
|
849
1892
|
|
|
850
|
-
|
|
1893
|
+
#### `bgc broker --action commission`
|
|
851
1894
|
|
|
852
|
-
|
|
1895
|
+
`GET /api/v3/broker/commission` · private
|
|
853
1896
|
|
|
854
|
-
|
|
1897
|
+
Get Broker Commission
|
|
855
1898
|
|
|
856
|
-
|
|
1899
|
+
Optional:
|
|
857
1900
|
|
|
858
|
-
|
|
|
859
|
-
|
|
860
|
-
| `
|
|
861
|
-
| `
|
|
862
|
-
| `
|
|
863
|
-
| `
|
|
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
|
|
1911
|
+
bgc broker --action commission
|
|
868
1912
|
```
|
|
869
1913
|
|
|
870
|
-
|
|
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
|
-
|
|
1924
|
+
#### `bgc loan --action borrow`
|
|
873
1925
|
|
|
874
|
-
|
|
1926
|
+
`POST /api/v3/loan/borrow` · private · write
|
|
875
1927
|
|
|
876
|
-
|
|
1928
|
+
Borrow Coins
|
|
877
1929
|
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
|
881
|
-
|
|
882
|
-
| `
|
|
883
|
-
| `
|
|
884
|
-
| `
|
|
885
|
-
|
|
886
|
-
|
|
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
|
|
1946
|
+
bgc loan --action borrow --loanCoin <loanCoin> --pledgeCoin <pledgeCoin> --daily <daily>
|
|
891
1947
|
```
|
|
892
1948
|
|
|
893
|
-
|
|
1949
|
+
#### `bgc loan --action repay`
|
|
1950
|
+
|
|
1951
|
+
`POST /api/v3/loan/repay` · private · write
|
|
894
1952
|
|
|
895
|
-
|
|
1953
|
+
Repay Coins
|
|
896
1954
|
|
|
897
|
-
|
|
1955
|
+
Required:
|
|
898
1956
|
|
|
899
|
-
|
|
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
|
-
|
|
902
|
-
|
|
903
|
-
|
|
|
904
|
-
|
|
905
|
-
| `
|
|
906
|
-
| `
|
|
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
|
|
1971
|
+
bgc loan --action repay --orderId <orderId> --method <method> --repayAll <repayAll>
|
|
914
1972
|
```
|
|
915
1973
|
|
|
916
|
-
|
|
1974
|
+
#### `bgc loan --action revisePledge`
|
|
1975
|
+
|
|
1976
|
+
`POST /api/v3/loan/revise-pledge` · private · write
|
|
917
1977
|
|
|
918
|
-
|
|
1978
|
+
Revise Pledge
|
|
919
1979
|
|
|
920
|
-
|
|
1980
|
+
Required:
|
|
921
1981
|
|
|
922
|
-
|
|
1982
|
+
| Param | Type | Enum | Description |
|
|
1983
|
+
|-------|------|------|-------------|
|
|
1984
|
+
| `orderId` | string | | Order ID |
|
|
1985
|
+
| `amount` | string | | Adjustment amount |
|
|
1986
|
+
| `pledgeCoin` | string | | Collateral coin |
|
|
923
1987
|
|
|
924
|
-
|
|
1988
|
+
Optional:
|
|
925
1989
|
|
|
926
|
-
|
|
|
927
|
-
|
|
928
|
-
| `
|
|
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
|
|
1995
|
+
bgc loan --action revisePledge --orderId <orderId> --amount <amount> --pledgeCoin <pledgeCoin>
|
|
935
1996
|
```
|
|
936
1997
|
|
|
937
|
-
|
|
1998
|
+
#### `bgc loan --action ongoing`
|
|
938
1999
|
|
|
939
|
-
|
|
2000
|
+
`GET /api/v3/loan/borrow-ongoing` · private
|
|
940
2001
|
|
|
941
|
-
|
|
2002
|
+
Get Borrow Ongoing
|
|
942
2003
|
|
|
943
|
-
|
|
2004
|
+
Optional:
|
|
944
2005
|
|
|
945
|
-
|
|
|
946
|
-
|
|
947
|
-
| `
|
|
948
|
-
| `
|
|
949
|
-
| `
|
|
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
|
|
2013
|
+
bgc loan --action ongoing
|
|
963
2014
|
```
|
|
964
2015
|
|
|
965
|
-
|
|
2016
|
+
#### `bgc loan --action borrowHistory`
|
|
2017
|
+
|
|
2018
|
+
`GET /api/v3/loan/borrow-history` · private
|
|
2019
|
+
|
|
2020
|
+
Get Borrow History
|
|
966
2021
|
|
|
967
|
-
|
|
2022
|
+
Required:
|
|
968
2023
|
|
|
969
|
-
|
|
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
|
-
|
|
2029
|
+
Optional:
|
|
972
2030
|
|
|
973
|
-
|
|
|
974
|
-
|
|
975
|
-
| `
|
|
976
|
-
| `
|
|
977
|
-
| `
|
|
978
|
-
| `
|
|
979
|
-
| `
|
|
980
|
-
| `
|
|
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
|
|
2041
|
+
bgc loan --action borrowHistory --startTime <startTime> --endTime <endTime>
|
|
985
2042
|
```
|
|
986
2043
|
|
|
987
|
-
|
|
2044
|
+
#### `bgc loan --action repayHistory`
|
|
988
2045
|
|
|
989
|
-
|
|
2046
|
+
`GET /api/v3/loan/repay-history` · private
|
|
990
2047
|
|
|
991
|
-
|
|
2048
|
+
Get Repay History
|
|
992
2049
|
|
|
993
|
-
|
|
2050
|
+
Required:
|
|
994
2051
|
|
|
995
|
-
|
|
|
996
|
-
|
|
997
|
-
| `
|
|
998
|
-
| `
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
|
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
|
|
2080
|
+
bgc loan --action debts
|
|
1007
2081
|
```
|
|
1008
2082
|
|
|
1009
|
-
|
|
2083
|
+
#### `bgc loan --action interest`
|
|
1010
2084
|
|
|
1011
|
-
|
|
2085
|
+
`GET /api/v3/loan/interest` · private
|
|
1012
2086
|
|
|
1013
|
-
|
|
2087
|
+
Get Loan Interest
|
|
1014
2088
|
|
|
1015
|
-
|
|
2089
|
+
Required:
|
|
1016
2090
|
|
|
1017
|
-
|
|
|
1018
|
-
|
|
1019
|
-
| `
|
|
1020
|
-
| `
|
|
1021
|
-
| `
|
|
1022
|
-
| `
|
|
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
|
|
2099
|
+
bgc loan --action interest --loanCoin <loanCoin> --pledgeCoin <pledgeCoin> --daily <daily> --pledgeAmount <pledgeAmount>
|
|
1030
2100
|
```
|
|
1031
2101
|
|
|
1032
|
-
|
|
2102
|
+
#### `bgc loan --action reduces`
|
|
2103
|
+
|
|
2104
|
+
`GET /api/v3/loan/reduces` · private
|
|
1033
2105
|
|
|
1034
|
-
|
|
2106
|
+
Get Loan Reduces
|
|
1035
2107
|
|
|
1036
|
-
|
|
2108
|
+
Required:
|
|
1037
2109
|
|
|
1038
|
-
|
|
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
|
-
|
|
2115
|
+
Optional:
|
|
1041
2116
|
|
|
1042
|
-
|
|
|
1043
|
-
|
|
1044
|
-
| `
|
|
1045
|
-
| `
|
|
1046
|
-
| `
|
|
1047
|
-
| `
|
|
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
|
|
2127
|
+
bgc loan --action reduces --startTime <startTime> --endTime <endTime>
|
|
1052
2128
|
```
|
|
1053
2129
|
|
|
1054
|
-
|
|
2130
|
+
#### `bgc loan --action coins`
|
|
1055
2131
|
|
|
1056
|
-
|
|
2132
|
+
`GET /api/v3/loan/coins` · private
|
|
1057
2133
|
|
|
1058
|
-
|
|
2134
|
+
Get Loan Coins
|
|
1059
2135
|
|
|
1060
|
-
|
|
2136
|
+
Optional:
|
|
1061
2137
|
|
|
1062
|
-
|
|
|
1063
|
-
|
|
1064
|
-
| `
|
|
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
|
|
2143
|
+
bgc loan --action coins
|
|
1075
2144
|
```
|
|
1076
2145
|
|
|
1077
|
-
|
|
2146
|
+
#### `bgc loan --action pledgeRateHistory`
|
|
2147
|
+
|
|
2148
|
+
`GET /api/v3/loan/pledge-rate-history` · private
|
|
2149
|
+
|
|
2150
|
+
Get Pledge Rate History
|
|
1078
2151
|
|
|
1079
|
-
|
|
2152
|
+
Required:
|
|
1080
2153
|
|
|
1081
|
-
|
|
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
|
-
|
|
2159
|
+
Optional:
|
|
1084
2160
|
|
|
1085
|
-
|
|
|
1086
|
-
|
|
1087
|
-
| `
|
|
1088
|
-
| `
|
|
1089
|
-
| `
|
|
1090
|
-
| `
|
|
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
|
|
2170
|
+
bgc loan --action pledgeRateHistory --startTime <startTime> --endTime <endTime>
|
|
1095
2171
|
```
|
|
1096
2172
|
|
|
1097
|
-
##
|
|
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
|
-
|
|
2183
|
+
**Actions:** `bindUid`, `orders`, `ltv`, `marginCoins`, `products`, `repaymentOrders`, `riskUnit`, `symbols`, `transferred`
|
|
1100
2184
|
|
|
1101
|
-
|
|
2185
|
+
#### `bgc inst_loan --action bindUid`
|
|
1102
2186
|
|
|
1103
|
-
|
|
2187
|
+
`POST /api/v3/ins-loan/bind-uid` · private · write
|
|
1104
2188
|
|
|
1105
|
-
|
|
2189
|
+
Bind/Unbind UID to Risk Unit
|
|
1106
2190
|
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
|
1110
|
-
|
|
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
|
|
2205
|
+
bgc inst_loan --action bindUid --uid <uid> --operate <operate>
|
|
1115
2206
|
```
|
|
1116
2207
|
|
|
1117
|
-
|
|
2208
|
+
#### `bgc inst_loan --action orders`
|
|
1118
2209
|
|
|
1119
|
-
|
|
2210
|
+
`GET /api/v3/ins-loan/loan-order` · private
|
|
1120
2211
|
|
|
1121
|
-
|
|
2212
|
+
Get Loan Orders
|
|
1122
2213
|
|
|
1123
|
-
|
|
2214
|
+
Optional:
|
|
1124
2215
|
|
|
1125
|
-
|
|
|
1126
|
-
|
|
1127
|
-
| `
|
|
1128
|
-
| `
|
|
1129
|
-
| `
|
|
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
|
|
2223
|
+
bgc inst_loan --action orders
|
|
1136
2224
|
```
|
|
1137
2225
|
|
|
1138
|
-
|
|
2226
|
+
#### `bgc inst_loan --action ltv`
|
|
1139
2227
|
|
|
1140
|
-
|
|
2228
|
+
`GET /api/v3/ins-loan/ltv-convert` · private
|
|
1141
2229
|
|
|
1142
|
-
|
|
2230
|
+
Get LTV
|
|
1143
2231
|
|
|
1144
|
-
|
|
2232
|
+
Optional:
|
|
1145
2233
|
|
|
1146
|
-
|
|
|
1147
|
-
|
|
1148
|
-
| `
|
|
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
|
|
2239
|
+
bgc inst_loan --action ltv
|
|
1154
2240
|
```
|
|
1155
2241
|
|
|
1156
|
-
|
|
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
|
-
|
|
2258
|
+
#### `bgc inst_loan --action products`
|
|
1159
2259
|
|
|
1160
|
-
|
|
2260
|
+
`GET /api/v3/ins-loan/product-infos` · private
|
|
1161
2261
|
|
|
1162
|
-
|
|
2262
|
+
Get Product Info
|
|
1163
2263
|
|
|
1164
|
-
|
|
2264
|
+
Required:
|
|
1165
2265
|
|
|
1166
|
-
|
|
|
1167
|
-
|
|
1168
|
-
| `
|
|
2266
|
+
| Param | Type | Enum | Description |
|
|
2267
|
+
|-------|------|------|-------------|
|
|
2268
|
+
| `productId` | string | | Product Id |
|
|
1169
2269
|
|
|
1170
|
-
**Example:**
|
|
1171
2270
|
```bash
|
|
1172
|
-
bgc
|
|
2271
|
+
bgc inst_loan --action products --productId <productId>
|
|
1173
2272
|
```
|
|
1174
2273
|
|
|
1175
|
-
|
|
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
|
-
|
|
2292
|
+
#### `bgc inst_loan --action riskUnit`
|
|
1178
2293
|
|
|
1179
|
-
|
|
2294
|
+
`GET /api/v3/ins-loan/risk-unit` · private
|
|
1180
2295
|
|
|
1181
|
-
|
|
2296
|
+
Get Risk Unit
|
|
1182
2297
|
|
|
1183
|
-
|
|
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
|
|
2301
|
+
bgc inst_loan --action riskUnit
|
|
1196
2302
|
```
|
|
1197
2303
|
|
|
1198
|
-
|
|
2304
|
+
#### `bgc inst_loan --action symbols`
|
|
2305
|
+
|
|
2306
|
+
`GET /api/v3/ins-loan/symbols` · private
|
|
1199
2307
|
|
|
1200
|
-
|
|
2308
|
+
Get Trade Symbols
|
|
1201
2309
|
|
|
1202
|
-
|
|
2310
|
+
Required:
|
|
1203
2311
|
|
|
1204
|
-
|
|
2312
|
+
| Param | Type | Enum | Description |
|
|
2313
|
+
|-------|------|------|-------------|
|
|
2314
|
+
| `productId` | string | | Product Id |
|
|
1205
2315
|
|
|
1206
|
-
**Example:**
|
|
1207
2316
|
```bash
|
|
1208
|
-
bgc
|
|
2317
|
+
bgc inst_loan --action symbols --productId <productId>
|
|
1209
2318
|
```
|
|
1210
2319
|
|
|
1211
|
-
|
|
2320
|
+
#### `bgc inst_loan --action transferred`
|
|
2321
|
+
|
|
2322
|
+
`GET /api/v3/ins-loan/transfered` · private
|
|
2323
|
+
|
|
2324
|
+
Get Transferred Quantity
|
|
1212
2325
|
|
|
1213
|
-
|
|
2326
|
+
Required:
|
|
1214
2327
|
|
|
1215
|
-
|
|
2328
|
+
| Param | Type | Enum | Description |
|
|
2329
|
+
|-------|------|------|-------------|
|
|
2330
|
+
| `coin` | string | | Coin |
|
|
1216
2331
|
|
|
1217
|
-
|
|
2332
|
+
Optional:
|
|
1218
2333
|
|
|
1219
|
-
|
|
|
1220
|
-
|
|
1221
|
-
| `
|
|
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
|
|
2339
|
+
bgc inst_loan --action transferred --coin <coin>
|
|
1234
2340
|
```
|
|
1235
2341
|
|
|
1236
|
-
|
|
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
|
-
|
|
2352
|
+
#### `bgc tax --action records`
|
|
1239
2353
|
|
|
1240
|
-
|
|
2354
|
+
`GET /api/v3/tax/records` · private
|
|
1241
2355
|
|
|
1242
|
-
|
|
2356
|
+
Get Unified Account Tax Records
|
|
1243
2357
|
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
|
1247
|
-
|
|
1248
|
-
| `
|
|
1249
|
-
| `
|
|
1250
|
-
| `
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
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
|
|
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.
|