-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbitget_ws_asyncapi.yaml
1094 lines (1094 loc) · 32.3 KB
/
bitget_ws_asyncapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
asyncapi: 3.0.0
info:
title: Bitget Websocket API
version: 1.0.0
tags:
- name: Spot API
- name: Futures API
servers:
Public:
host: ws.bitget.com
pathname: /v2/ws/public
protocol: wss
description: Public Channel
Private:
host: ws.bitget.com
pathname: /v2/ws/private
protocol: wss
description: Private Channel
channels:
ticker:
address: ticker
messages:
PublishToMarketData.message:
payload:
$ref: "#/components/schemas/PublishedMessage"
SubscribeToMarketData.message:
$ref: "#/components/messages/Subscription"
description: >
Get the product's latest price, bid price, bid price and 24h trading
volume information. Frequency of data push: 100ms ~ 300ms
candlestick:
address: candlestick
messages:
PublishToCandleData.message:
payload:
$ref: "#/components/schemas/PublishedMessage"
SubscribeToCandleData.message:
$ref: "#/components/messages/Subscription"
description: >
Get the candlestick data of the product.After first subscription, it will
push the recent snapshot data and then push the update data
trade:
address: trade
messages:
PublishToTradeData.message:
payload:
$ref: "#/components/schemas/PublishedMessage"
SubscribeToTradeData.message:
$ref: "#/components/messages/Subscription"
description: >
Push once if any trade is matched(taker orders).After first subscription,
it will push the recent snapshot data and then push the update data
depth:
address: depth
messages:
PublishToBookData.message:
payload:
$ref: "#/components/schemas/PublishedMessage"
SubscribeToBookData.message:
$ref: "#/components/messages/Subscription"
description: >
Use books for full data, book1 for 1 depth level, book5 for 5 depth
levels, book15 for 15 depth levels.Default data push frequency is
200ms.Default data push frequency for books1 is 60ms
fill:
address: fill
messages:
PublishToFillData.message:
payload:
$ref: "#/components/schemas/PublishedMessage"
SubscribeToFillData.message:
$ref: "#/components/messages/Subscription"
description: |
Trade details channels
orders:
address: orders
messages:
PublishToOrderData.message:
payload:
$ref: "#/components/schemas/PublishedMessage"
SubscribeToOrderData.message:
$ref: "#/components/messages/Subscription"
description: >
Get order information. Initial subscriptions will not trigger any push
notifications.Data will be pushed when the following events
occurred:<br><ul><li>Place orders</li><li>Orders are filled</li>Cancel
orders</li><li>Modify orders</li></ul>
trigger:
address: trigger
messages:
PublishToTriggerData.message:
payload:
$ref: "#/components/schemas/PublishedMessage"
SubscribeToTriggerData.message:
$ref: "#/components/messages/Subscription"
description: |
Subscribe trigger order channel
account:
address: account
messages:
PublishToAccountData.message:
payload:
$ref: "#/components/schemas/PublishedMessage"
SubscribeToAccountData.message:
$ref: "#/components/messages/Subscription"
description: >
Get account information, push data according to the subscription
dimensions for the first subscription.Data will be pushed when the
following events occurred:<br><ul><li>Orders are
filled</li><li>Transfer</li><li>Deposit</li><li>Withdrawal</li></ul>
operations:
PublishToMarketData:
action: receive
channel:
$ref: "#/channels/ticker"
summary: Server publishes market Data to subscriber
tags:
- name: Spot Public
messages:
- $ref: "#/channels/ticker/messages/PublishToMarketData.message"
SubscribeToMarketData:
action: send
channel:
$ref: "#/channels/ticker"
messages:
- $ref: "#/channels/ticker/messages/SubscribeToMarketData.message"
PublishToCandleData:
action: receive
channel:
$ref: "#/channels/candlestick"
summary: Server publishes Candlestick Data to subscriber
tags:
- name: Spot Public
messages:
- $ref: "#/channels/candlestick/messages/PublishToCandleData.message"
SubscribeToCandleData:
action: send
channel:
$ref: "#/channels/candlestick"
messages:
- $ref: "#/channels/candlestick/messages/SubscribeToCandleData.message"
PublishToTradeData:
action: receive
channel:
$ref: "#/channels/trade"
summary: Server publishes Trade Data to subscriber
tags:
- name: Spot Public
messages:
- $ref: "#/channels/trade/messages/PublishToTradeData.message"
SubscribeToTradeData:
action: send
channel:
$ref: "#/channels/trade"
messages:
- $ref: "#/channels/trade/messages/SubscribeToTradeData.message"
PublishToBookData:
action: receive
channel:
$ref: "#/channels/depth"
summary: Server publishes book depth Data to subscriber
tags:
- name: Spot Public
messages:
- $ref: "#/channels/depth/messages/PublishToBookData.message"
SubscribeToBookData:
action: send
channel:
$ref: "#/channels/depth"
messages:
- $ref: "#/channels/depth/messages/SubscribeToBookData.message"
PublishToFillData:
action: receive
channel:
$ref: "#/channels/fill"
summary: Server publishes fill Data to subscriber
tags:
- name: Spot Private
messages:
- $ref: "#/channels/fill/messages/PublishToFillData.message"
SubscribeToFillData:
action: send
channel:
$ref: "#/channels/fill"
messages:
- $ref: "#/channels/fill/messages/SubscribeToFillData.message"
PublishToOrderData:
action: receive
channel:
$ref: "#/channels/orders"
summary: Server publishes fill Data to subscriber
tags:
- name: Spot Private
messages:
- $ref: "#/channels/orders/messages/PublishToOrderData.message"
SubscribeToOrderData:
action: send
channel:
$ref: "#/channels/orders"
messages:
- $ref: "#/channels/orders/messages/SubscribeToOrderData.message"
PublishToTriggerData:
action: receive
channel:
$ref: "#/channels/trigger"
summary: Server publishes trigger Data to subscriber
tags:
- name: Spot Private
messages:
- $ref: "#/channels/trigger/messages/PublishToTriggerData.message"
SubscribeToTriggerData:
action: send
channel:
$ref: "#/channels/trigger"
messages:
- $ref: "#/channels/trigger/messages/SubscribeToTriggerData.message"
PublishToAccountData:
action: receive
channel:
$ref: "#/channels/account"
summary: Server publishes trigger Data to subscriber
tags:
- name: Spot Private
messages:
- $ref: "#/channels/account/messages/PublishToAccountData.message"
SubscribeToAccountData:
action: send
channel:
$ref: "#/channels/account"
messages:
- $ref: "#/channels/account/messages/SubscribeToAccountData.message"
components:
messages:
Subscription:
payload:
$ref: "#/components/schemas/Payload"
schemas:
Payload:
oneOf:
- $ref: "#/components/schemas/GeneralResponse"
- $ref: "#/components/schemas/PushResponse"
PublishedMessage:
type: object
properties:
op:
$ref: "#/components/schemas/opEnum"
args:
type: array
items:
$ref: "#/components/schemas/Args"
Args:
oneOf:
- $ref: "#/components/schemas/GeneralRequest"
- $ref: "#/components/schemas/LoginRequest"
opEnum:
type: string
enum:
- subscribe
- snapshot
- login
GeneralRequest:
type: object
properties:
InstType:
type: string
example: SPOT
ennum:
- SPOT
- USDT-FUTURES
- COIN-FUTURES
- USDC-FUTURES
InstId:
type: string
example: ETHUSDT
channel:
$ref: "#/components/schemas/channelEnum"
channelEnum:
type: string
description: >-
Channel name, e.g., candle1m for 1 minute, candle5m for 5 minutes,
candle15m for 15 minutes, etc.
enum:
- ticker
- candle1m
- candle5m
- candle15m
- candle30m
- candle1H
- candle4H
- candle6H
- candle12H
- candle1D
- candle3D
- candle1W
- candle1M
- candle6Hutc
- candle12Hutc
- candle1Dutc
- candle3Dutc
- candle1Wutc
- candle1Mutc
- trade
- book
- book1
- book5
- book15
- fill
- orders
- orders-algo
- account
- positions
GeneralResponse:
type: object
properties:
InstType:
type: string
example: SPOT
ennum:
- SPOT
InstId:
type: string
example: ETHUSDT
channel:
$ref: "#/components/schemas/channelEnum"
code:
type: string
example: "500"
msg:
type: string
example: something went wrong
PushResponse:
type: object
properties:
action:
type: string
description: "Type of action, e.g., snapshot or update"
arg:
$ref: "#/components/schemas/GeneralRequest"
data:
type: array
items:
- $ref: "#/components/schemas/DataItem"
- $ref: "#/components/schemas/SubscriptionData"
- $ref: "#/components/schemas/TradeData"
- $ref: "#/components/schemas/BookData"
- $ref: "#/components/schemas/FillData"
- $ref: "#/components/schemas/OrderData"
- $ref: "#/components/schemas/TriggerData"
- $ref: "#/components/schemas/Account"
- $ref: "#/components/schemas/FutureData"
- $ref: "#/components/schemas/FuturesAccountData"
- $ref: "#/components/schemas/FuturesPositionData"
- $ref: "#/components/schemas/FuturesFillData"
ts:
type: string
description: Timestamp of the request
DataItem:
type: object
properties:
instId:
type: string
description: "Product ID, e.g., ETHUSDT"
lastPr:
type: string
description: Last price
open24h:
type: string
description: Open price for the last 24 hours
high24h:
type: string
description: High price for the last 24 hours
low24h:
type: string
description: Low price for the last 24 hours
change24h:
type: string
description: Change in price over the last 24 hours
bidPr:
type: string
description: Bid price
askPr:
type: string
description: Ask price
bidSz:
type: string
description: Bid size
askSz:
type: string
description: Ask size
baseVolume:
type: string
description: Base volume
quoteVolume:
type: string
description: Quote volume
openUtc:
type: string
description: Open price in UTC
changeUtc24h:
type: string
description: Price change in UTC over 24 hours
ts:
type: string
description: Timestamp of data item
required:
- instId
- lastPr
- ts
SubscriptionData:
type: array
items:
type: string
minItems: 8
maxItems: 8
description: Array of candlestick data in a predefined order
properties:
"0":
type: string
description: >-
Start time, milliseconds format of Unix timestamp, e.g.,
1597026383085
"1":
type: string
description: Opening price
"2":
type: string
description: Highest price
"3":
type: string
description: Lowest price
"4":
type: string
description: Closing price
"5":
type: string
description: Trading volume of the coin
"6":
type: string
description: Trading volume of quote currency
"7":
type: string
description: Trading volume (USDT) or candlestick status
TradeData:
type: object
properties:
ts:
type: string
description: "Timestamp of the trade in milliseconds format, e.g., 1695709835822"
price:
type: string
description: "Trade price, e.g., 26293.4"
size:
type: string
description: "Trade size, e.g., 0.0013"
side:
type: string
description: "Side of the trade, e.g., 'buy' or 'sell'"
tradeId:
type: string
description: "Unique trade ID, e.g., 1000000000"
required:
- ts
- price
- size
- side
- tradeId
BookData:
type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/DepthItem"
description: List of subscription data for market depth
DepthItem:
type: object
properties:
asks:
type: array
items:
$ref: "#/components/schemas/BidsAsks"
bids:
type: array
items:
$ref: "#/components/schemas/BidsAsks"
ts:
type: string
description: "Timestamp of the data in milliseconds format, e.g., 1597026383085"
checksum:
type: integer
description: Checksum for data integrity
required:
- asks
- bids
- ts
- checksum
BidsAsks:
type: array
items:
type: string
description: Seller depth
FillData:
type: object
properties:
orderId:
type: string
description: "Order ID, e.g., 111"
tradeId:
type: string
description: "Trade ID, e.g., 111"
symbol:
type: string
description: "Trading pair symbol, e.g., BTCUSDT"
orderType:
type: string
description: "Order type, e.g., limit"
side:
type: string
description: "Order side, e.g., buy or sell"
priceAvg:
type: string
description: "Average price of the trade, e.g., 42740.41"
size:
type: string
description: "Size of the trade, e.g., 0.0006"
amount:
type: string
description: "Amount involved in the trade, e.g., 25.644246"
tradeScope:
type: string
description: "Trade scope, e.g., marker"
feeDetail:
type: array
items:
$ref: "#/components/schemas/FeeDetail"
description: Details of fees applied to the trade
cTime:
type: string
description: "Creation timestamp in milliseconds, e.g., 1703580202094"
uTime:
type: string
description: "Update timestamp in milliseconds, e.g., 1703580202094"
required:
- orderId
- tradeId
- symbol
- orderType
- side
- priceAvg
- size
- amount
- tradeScope
- feeDetail
- cTime
- uTime
FeeDetail:
type: object
properties:
feeCoin:
type: string
description: "Currency in which the fee is charged, e.g., USDT"
deduction:
type: string
description: "Deduction status, e.g., no"
totalDeductionFee:
type: string
description: "Total deduction fee, e.g., 0"
totalFee:
type: string
description: "Total fee charged, e.g., 0.01538655"
required:
- feeCoin
- deduction
- totalDeductionFee
- totalFee
OrderData:
type: object
properties:
instId:
type: string
description: "Instrument ID, e.g., BTCUSDT"
orderId:
type: string
description: "Order ID, e.g., 1"
clientOid:
type: string
description: "Client Order ID, e.g., 1"
size:
type: string
description: "Initial order size, e.g., 8.0000"
newSize:
type: string
description: "Updated order size, e.g., 500.0000"
notional:
type: string
description: "Notional value, e.g., 8.000000"
orderType:
type: string
description: "Order type, e.g., market"
force:
type: string
description: "Order execution policy, e.g., gtc"
side:
type: string
description: "Order side, e.g., buy or sell"
fillPrice:
type: string
description: "Price at which the order was filled, e.g., 26256.0"
tradeId:
type: string
description: "Trade ID, e.g., 1"
baseVolume:
type: string
description: "Base volume filled, e.g., 0.0003"
fillTime:
type: string
description: "Fill timestamp in milliseconds, e.g., 1695797773286"
fillFee:
type: string
description: "Fill fee amount, e.g., -0.00000018"
fillFeeCoin:
type: string
description: "Currency in which the fill fee is charged, e.g., BTC"
tradeScope:
type: string
description: "Scope of the trade, e.g., T"
accBaseVolume:
type: string
description: "Accumulated base volume, e.g., 0.0003"
priceAvg:
type: string
description: "Average price, e.g., 26256.0"
status:
type: string
description: "Order status, e.g., partially_filled"
cTime:
type: string
description: "Creation timestamp in milliseconds, e.g., 1695797773257"
uTime:
type: string
description: "Update timestamp in milliseconds, e.g., 1695797773326"
stpMode:
type: string
description: "Self-trade prevention mode, e.g., cancel_taker"
feeDetail:
type: array
items:
$ref: "#/components/schemas/FeeDetail"
description: Details of fees applied to the order
enterPointSource:
type: string
description: "Source of the order entry, e.g., WEB"
required:
- instId
- orderId
- clientOid
- size
- newSize
- notional
- orderType
- force
- side
- fillPrice
- tradeId
- baseVolume
- fillTime
- fillFee
- fillFeeCoin
- tradeScope
- accBaseVolume
- priceAvg
- status
- cTime
- uTime
- stpMode
- feeDetail
- enterPointSource
TriggerData:
type: object
properties:
instId:
type: string
description: "Instrument ID, e.g., BTCUSDT"
orderId:
type: string
description: "Order ID, e.g., 1"
clientOid:
type: string
description: "Client Order ID, e.g., 1"
triggerPrice:
type: string
description: "Trigger price for the order, e.g., 27000.000000000"
triggerType:
type: string
description: "Type of trigger, e.g., fill_price"
planType:
type: string
description: "Plan type, e.g., amount"
price:
type: string
description: "Order price, e.g., 27000.000000000"
size:
type: string
description: "Order size, e.g., 0.020000000"
actualSize:
type: string
description: "Actual filled size, e.g., 0.000000000"
orderType:
type: string
description: "Type of order, e.g., market"
side:
type: string
description: "Order side, e.g., buy or sell"
status:
type: string
description: "Current status of the order, e.g., live"
executePrice:
type: string
description: "Execution price, e.g., 0.1"
enterPointSource:
type: string
description: "Source of the order entry, e.g., web"
cTime:
type: string
description: "Creation timestamp in milliseconds, e.g., 1695719197612"
uTime:
type: string
description: "Update timestamp in milliseconds, e.g., 1695719197612"
stpMode:
type: string
description: "Self-trade prevention mode, e.g., cancel_taker"
required:
- instId
- orderId
- clientOid
- triggerPrice
- triggerType
- planType
- price
- size
- actualSize
- orderType
- side
- status
- executePrice
- enterPointSource
- cTime
- uTime
- stpMode
Account:
type: object
properties:
coin:
type: string
description: "Currency type, e.g., USDT"
available:
type: string
description: "Available balance, e.g., 100000"
frozen:
type: string
description: "Frozen balance, e.g., 0"
locked:
type: string
description: "Locked balance, e.g., 0"
limitAvailable:
type: string
description: "Available limit, e.g., 0"
uTime:
type: string
description: "Timestamp of the last update in milliseconds, e.g., 1697092295506"
required:
- coin
- available
- frozen
- locked
- limitAvailable
- uTime
LoginRequest:
type: object
properties:
apiKey:
type: string
description: "API key for authentication, e.g., xx_xxx"
passphrase:
type: string
description: "Passphrase for additional security, e.g., xxx"
timestamp:
type: string
description: "Timestamp for the request, e.g., 1538054050"
sign:
type: string
description: >-
Generated signature for the request, e.g.,
8RCOqCJAhhEh4PWcZB/96QojLDqMAg4qNynIixFzS3E=
required:
- apiKey
- passphrase
- timestamp
- sign
FutureData:
type: object
properties:
instId:
type: string
description: "Instrument ID, e.g., BTCUSDT"
lastPr:
type: string
description: "Last price, e.g., 27000.5"
bidPr:
type: string
description: "Highest bid price, e.g., 27000"
askPr:
type: string
description: "Lowest ask price, e.g., 27000.5"
bidSz:
type: string
description: "Bid size, e.g., 2.71"
askSz:
type: string
description: "Ask size, e.g., 8.76"
open24h:
type: string
description: "Opening price in the last 24 hours, e.g., 27000.5"
high24h:
type: string
description: "Highest price in the last 24 hours, e.g., 30668.5"
low24h:
type: string
description: "Lowest price in the last 24 hours, e.g., 26999.0"
change24h:
type: string
description: "Change in price over the last 24 hours, e.g., -0.00002"
fundingRate:
type: string
description: "Funding rate, e.g., 0.000010"
nextFundingTime:
type: string
description: "Next funding time in milliseconds, e.g., 1695722400000"
markPrice:
type: string
description: "Mark price, e.g., 27000.0"
indexPrice:
type: string
description: "Index price, e.g., 25702.4"
holdingAmount:
type: string
description: "Amount held, e.g., 929.502"
baseVolume:
type: string
description: "Base volume, e.g., 368.900"
quoteVolume:
type: string
description: "Quote volume, e.g., 10152429.961"
openUtc:
type: string
description: "Opening price in UTC, e.g., 27000.5"
symbolType:
type: integer
description: "Type of symbol, e.g., 1"
symbol:
type: string
description: "Symbol representation, e.g., BTCUSDT"
deliveryPrice:
type: string
description: "Delivery price, e.g., 0"
ts:
type: string
description: "Timestamp of the last update in milliseconds, e.g., 1695715383021"
required:
- instId
- lastPr
- bidPr
- askPr
- bidSz
- askSz
- open24h
- high24h
- low24h
- change24h
- fundingRate
- nextFundingTime
- markPrice
- indexPrice
- holdingAmount
- baseVolume
- quoteVolume
- openUtc
- symbolType
- symbol
- deliveryPrice
- ts
FuturesAccountData:
type: object
properties:
marginCoin:
type: string
description: "The coin used for margin trading, e.g., USDT"
frozen:
type: string
description: "Amount frozen, e.g., 0.00000000"
available:
type: string
description: "Available margin amount, e.g., 11490.16841069"
maxOpenPosAvailable:
type: string
description: "Maximum open position available, e.g., 10940.45841069"
maxTransferOut:
type: string
description: "Maximum transferable amount out, e.g., 10940.45841069"
equity:
type: string
description: "Total equity, e.g., 11489.96841069"
usdtEquity:
type: string
description: "Equity value in USDT, e.g., 11489.968410691679"
required:
- marginCoin
- frozen
- available
- maxOpenPosAvailable
- maxTransferOut
- equity
- usdtEquity
FuturesPositionData:
type: object
properties:
posId:
type: string
description: "The unique identifier for the position, e.g., '1'"
instId:
type: string
description: "The instrument ID, e.g., 'ETHUSDT'"
marginCoin:
type: string
description: "The coin used for margin, e.g., 'USDT'"
marginSize:
type: string
description: "The size of the margin used, e.g., '9.5'"
marginMode:
type: string
description: "The mode of margin, e.g., 'crossed'"
holdSide:
type: string
description: "The side of the position, e.g., 'short'"
posMode:
type: string
description: "The position mode, e.g., 'hedge_mode'"
total:
type: string
description: "Total position size, e.g., '0.1'"
available:
type: string
description: "Available position size, e.g., '0.1'"
frozen:
type: string
description: "Amount frozen, e.g., '0'"
openPriceAvg:
type: string
description: "Average open price, e.g., '1900'"
leverage:
type: integer
description: "The leverage used for the position, e.g., 20"
achievedProfits:
type: string
description: "Profits achieved, e.g., '0'"
unrealizedPL:
type: string
description: "Unrealized profit/loss, e.g., '0'"
unrealizedPLR:
type: string
description: "Unrealized profit/loss ratio, e.g., '0'"
liquidationPrice:
type: string
description: "The liquidation price, e.g., '5788.108475905242'"
keepMarginRate:
type: string
description: "The maintenance margin rate, e.g., '0.005'"
marginRate:
type: string
description: "The margin rate, e.g., '0.004416374196'"
cTime:
type: string
description: >-
Creation time in milliseconds since Unix epoch, e.g.,
'1695649246169'
breakEvenPrice:
type: string
description: "The break-even price, e.g., '24778.97'"
totalFee:
type: string
description: "Total fees incurred, e.g., '1.45'"
deductedFee:
type: string
description: "Fees deducted, e.g., '0.388'"
uTime:
type: string
description: "Update time in milliseconds since Unix epoch, e.g., '1695711602568'"
autoMargin:
type: string
description: "Auto margin status, e.g., 'off'"