Repository navigation
Expand file tree
/
Copy pathbitget.py
More file actions
8785 lines (8544 loc) · 432 KB
/
Copy pathbitget.py
File metadata and controls
8785 lines (8544 loc) · 432 KB
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
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
from ccxt.abstract.bitget import ImplicitAPI
import asyncio
import hashlib
import json
from ccxt.base.types import Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, FundingHistory, Int, IsolatedBorrowRate, LedgerEntry, Leverage, LeverageTier, Liquidation, LongShortRatio, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
from typing import List
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import AccountSuspended
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors import BadSymbol
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidAddress
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors import OrderNotFound
from ccxt.base.errors import NotSupported
from ccxt.base.errors import DDoSProtection
from ccxt.base.errors import RateLimitExceeded
from ccxt.base.errors import ExchangeNotAvailable
from ccxt.base.errors import OnMaintenance
from ccxt.base.errors import InvalidNonce
from ccxt.base.errors import RequestTimeout
from ccxt.base.errors import CancelPending
from ccxt.base.decimal_to_precision import TICK_SIZE
from ccxt.base.precise import Precise
class bitget(Exchange, ImplicitAPI):
def describe(self):
return self.deep_extend(super(bitget, self).describe(), {
'id': 'bitget',
'name': 'Bitget',
'countries': ['SG'],
'version': 'v2',
'rateLimit': 50, # up to 3000 requests per 5 minutes ≈ 600 requests per minute ≈ 10 requests per second ≈ 100 ms
'certified': True,
'pro': True,
'has': {
'CORS': None,
'spot': True,
'margin': True,
'swap': True,
'future': True,
'option': False,
'addMargin': True,
'borrowCrossMargin': True,
'borrowIsolatedMargin': True,
'cancelAllOrders': True,
'cancelOrder': True,
'cancelOrders': True,
'closeAllPositions': True,
'closePosition': True,
'createConvertTrade': True,
'createDepositAddress': False,
'createMarketBuyOrderWithCost': True,
'createMarketOrderWithCost': False,
'createMarketSellOrderWithCost': False,
'createOrder': True,
'createOrders': True,
'createOrderWithTakeProfitAndStopLoss': True,
'createPostOnlyOrder': True,
'createReduceOnlyOrder': False,
'createStopLimitOrder': True,
'createStopLossOrder': True,
'createStopMarketOrder': True,
'createStopOrder': True,
'createTakeProfitOrder': True,
'createTrailingAmountOrder': False,
'createTrailingPercentOrder': True,
'createTriggerOrder': True,
'editOrder': True,
'fetchAccounts': False,
'fetchBalance': True,
'fetchBorrowInterest': True,
'fetchBorrowRateHistories': False,
'fetchBorrowRateHistory': False,
'fetchCanceledAndClosedOrders': True,
'fetchCanceledOrders': True,
'fetchClosedOrders': True,
'fetchConvertCurrencies': True,
'fetchConvertQuote': True,
'fetchConvertTrade': False,
'fetchConvertTradeHistory': True,
'fetchCrossBorrowRate': True,
'fetchCrossBorrowRates': False,
'fetchCurrencies': True,
'fetchDeposit': False,
'fetchDepositAddress': True,
'fetchDepositAddresses': False,
'fetchDepositAddressesByNetwork': False,
'fetchDeposits': True,
'fetchDepositsWithdrawals': False,
'fetchDepositWithdrawFee': 'emulated',
'fetchDepositWithdrawFees': True,
'fetchFundingHistory': True,
'fetchFundingInterval': True,
'fetchFundingIntervals': False,
'fetchFundingRate': True,
'fetchFundingRateHistory': True,
'fetchFundingRates': True,
'fetchIndexOHLCV': True,
'fetchIsolatedBorrowRate': True,
'fetchIsolatedBorrowRates': False,
'fetchLedger': True,
'fetchLeverage': True,
'fetchLeverageTiers': False,
'fetchLiquidations': False,
'fetchLongShortRatio': False,
'fetchLongShortRatioHistory': True,
'fetchMarginAdjustmentHistory': False,
'fetchMarginMode': True,
'fetchMarketLeverageTiers': True,
'fetchMarkets': True,
'fetchMarkOHLCV': True,
'fetchMarkPrice': True,
'fetchMyLiquidations': True,
'fetchMyTrades': True,
'fetchOHLCV': True,
'fetchOpenInterest': True,
'fetchOpenInterestHistory': False,
'fetchOpenOrders': True,
'fetchOrder': True,
'fetchOrderBook': True,
'fetchOrderBooks': False,
'fetchOrders': False,
'fetchOrderTrades': False,
'fetchPosition': True,
'fetchPositionHistory': 'emulated',
'fetchPositionMode': False,
'fetchPositions': True,
'fetchPositionsHistory': True,
'fetchPositionsRisk': False,
'fetchPremiumIndexOHLCV': False,
'fetchStatus': False,
'fetchTicker': True,
'fetchTickers': True,
'fetchTime': True,
'fetchTrades': True,
'fetchTradingFee': True,
'fetchTradingFees': True,
'fetchTransactions': False,
'fetchTransfer': False,
'fetchTransfers': True,
'fetchWithdrawAddresses': False,
'fetchWithdrawal': False,
'fetchWithdrawals': True,
'reduceMargin': True,
'repayCrossMargin': True,
'repayIsolatedMargin': True,
'setLeverage': True,
'setMargin': False,
'setMarginMode': True,
'setPositionMode': True,
'signIn': False,
'transfer': True,
'withdraw': True,
},
'timeframes': {
'1m': '1m',
'3m': '3m',
'5m': '5m',
'15m': '15m',
'30m': '30m',
'1h': '1h',
'2h': '2h',
'4h': '4h',
'6h': '6h',
'12h': '12h',
'1d': '1d',
'3d': '3d',
'1w': '1w',
'1M': '1m',
},
'hostname': 'bitget.com',
'urls': {
'logo': 'https://github.com/user-attachments/assets/fbaa10cc-a277-441d-a5b7-997dd9a87658',
'api': {
'spot': 'https://api.{hostname}',
'mix': 'https://api.{hostname}',
'user': 'https://api.{hostname}',
'p2p': 'https://api.{hostname}',
'broker': 'https://api.{hostname}',
'margin': 'https://api.{hostname}',
'common': 'https://api.{hostname}',
'tax': 'https://api.{hostname}',
'convert': 'https://api.{hostname}',
'copy': 'https://api.{hostname}',
'earn': 'https://api.{hostname}',
},
'www': 'https://www.bitget.com',
'doc': [
'https://www.bitget.com/api-doc/common/intro',
'https://www.bitget.com/api-doc/spot/intro',
'https://www.bitget.com/api-doc/contract/intro',
'https://www.bitget.com/api-doc/broker/intro',
'https://www.bitget.com/api-doc/margin/intro',
'https://www.bitget.com/api-doc/copytrading/intro',
'https://www.bitget.com/api-doc/earn/intro',
'https://bitgetlimited.github.io/apidoc/en/mix',
'https://bitgetlimited.github.io/apidoc/en/spot',
'https://bitgetlimited.github.io/apidoc/en/broker',
'https://bitgetlimited.github.io/apidoc/en/margin',
],
'fees': 'https://www.bitget.cc/zh-CN/rate?tab=1',
'referral': 'https://www.bitget.com/expressly?languageType=0&channelCode=ccxt&vipCode=tg9j',
},
'api': {
'public': {
'common': {
'get': {
'v2/public/annoucements': 1,
'v2/public/time': 1,
},
},
'spot': {
'get': {
'spot/v1/notice/queryAllNotices': 1, # 20 times/1s(IP) => 20/20 = 1
'spot/v1/public/time': 1,
'spot/v1/public/currencies': 6.6667, # 3 times/1s(IP) => 20/3 = 6.6667
'spot/v1/public/products': 1,
'spot/v1/public/product': 1,
'spot/v1/market/ticker': 1,
'spot/v1/market/tickers': 1,
'spot/v1/market/fills': 2, # 10 times/1s(IP) => 20/10 = 2
'spot/v1/market/fills-history': 2,
'spot/v1/market/candles': 1,
'spot/v1/market/depth': 1,
'spot/v1/market/spot-vip-level': 2,
'spot/v1/market/merge-depth': 1,
'spot/v1/market/history-candles': 1,
'spot/v1/public/loan/coinInfos': 2, # 10 times/1s(IP) => 20/10 = 2
'spot/v1/public/loan/hour-interest': 2, # 10 times/1s(IP) => 20/10 = 2
'v2/spot/public/coins': 6.6667,
'v2/spot/public/symbols': 1,
'v2/spot/market/vip-fee-rate': 2,
'v2/spot/market/tickers': 1,
'v2/spot/market/merge-depth': 1,
'v2/spot/market/orderbook': 1,
'v2/spot/market/candles': 1,
'v2/spot/market/history-candles': 1,
'v2/spot/market/fills': 2,
'v2/spot/market/fills-history': 2,
},
},
'mix': {
'get': {
'mix/v1/market/contracts': 1,
'mix/v1/market/depth': 1,
'mix/v1/market/ticker': 1,
'mix/v1/market/tickers': 1,
'mix/v1/market/contract-vip-level': 2,
'mix/v1/market/fills': 1,
'mix/v1/market/fills-history': 2,
'mix/v1/market/candles': 1,
'mix/v1/market/index': 1,
'mix/v1/market/funding-time': 1,
'mix/v1/market/history-fundRate': 1,
'mix/v1/market/current-fundRate': 1,
'mix/v1/market/open-interest': 1,
'mix/v1/market/mark-price': 1,
'mix/v1/market/symbol-leverage': 1,
'mix/v1/market/queryPositionLever': 1,
'mix/v1/market/open-limit': 1,
'mix/v1/market/history-candles': 1,
'mix/v1/market/history-index-candles': 1,
'mix/v1/market/history-mark-candles': 1,
'mix/v1/market/merge-depth': 1,
'v2/mix/market/vip-fee-rate': 2,
'v2/mix/market/merge-depth': 1,
'v2/mix/market/ticker': 1,
'v2/mix/market/tickers': 1,
'v2/mix/market/fills': 1,
'v2/mix/market/fills-history': 2,
'v2/mix/market/candles': 1,
'v2/mix/market/history-candles': 1,
'v2/mix/market/history-index-candles': 1,
'v2/mix/market/history-mark-candles': 1,
'v2/mix/market/open-interest': 1,
'v2/mix/market/funding-time': 1,
'v2/mix/market/symbol-price': 1,
'v2/mix/market/history-fund-rate': 1,
'v2/mix/market/current-fund-rate': 1,
'v2/mix/market/contracts': 1,
'v2/mix/market/query-position-lever': 2,
'v2/mix/market/account-long-short': 20,
},
},
'margin': {
'get': {
'margin/v1/cross/public/interestRateAndLimit': 2, # 10 times/1s(IP) => 20/10 = 2
'margin/v1/isolated/public/interestRateAndLimit': 2, # 10 times/1s(IP) => 20/10 = 2
'margin/v1/cross/public/tierData': 2, # 10 times/1s(IP) => 20/10 = 2
'margin/v1/isolated/public/tierData': 2, # 10 times/1s(IP) => 20/10 = 2
'margin/v1/public/currencies': 1, # 20 times/1s(IP) => 20/20 = 1
'v2/margin/currencies': 2,
'v2/margin/market/long-short-ratio': 20,
},
},
'earn': {
'get': {
'v2/earn/loan/public/coinInfos': 2,
'v2/earn/loan/public/hour-interest': 2,
},
},
},
'private': {
'spot': {
'get': {
'spot/v1/wallet/deposit-address': 4,
'spot/v1/wallet/withdrawal-list': 1,
'spot/v1/wallet/deposit-list': 1,
'spot/v1/account/getInfo': 20,
'spot/v1/account/assets': 2,
'spot/v1/account/assets-lite': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/account/transferRecords': 1, # 20 times/1s(UID) => 20/20 = 1
'spot/v1/convert/currencies': 2,
'spot/v1/convert/convert-record': 2,
'spot/v1/loan/ongoing-orders': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/loan/repay-history': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/loan/revise-history': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/loan/borrow-history': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/loan/debts': 2, # 10 times/1s(UID) => 20/10 = 2
'v2/spot/trade/orderInfo': 1,
'v2/spot/trade/unfilled-orders': 1,
'v2/spot/trade/history-orders': 1,
'v2/spot/trade/fills': 2,
'v2/spot/trade/current-plan-order': 1,
'v2/spot/trade/history-plan-order': 1,
'v2/spot/account/info': 20,
'v2/spot/account/assets': 2,
'v2/spot/account/subaccount-assets': 2,
'v2/spot/account/bills': 2,
'v2/spot/account/transferRecords': 1,
'v2/account/funding-assets': 2,
'v2/account/bot-assets': 2,
'v2/account/all-account-balance': 20,
'v2/spot/wallet/deposit-address': 2,
'v2/spot/wallet/deposit-records': 2,
'v2/spot/wallet/withdrawal-records': 2,
},
'post': {
'spot/v1/wallet/transfer': 4,
'spot/v1/wallet/transfer-v2': 4,
'spot/v1/wallet/subTransfer': 10,
'spot/v1/wallet/withdrawal': 4,
'spot/v1/wallet/withdrawal-v2': 4,
'spot/v1/wallet/withdrawal-inner': 4,
'spot/v1/wallet/withdrawal-inner-v2': 4,
'spot/v1/account/sub-account-spot-assets': 200,
'spot/v1/account/bills': 2,
'spot/v1/trade/orders': 2,
'spot/v1/trade/batch-orders': 4,
'spot/v1/trade/cancel-order': 2,
'spot/v1/trade/cancel-order-v2': 2,
'spot/v1/trade/cancel-symbol-order': 2,
'spot/v1/trade/cancel-batch-orders': 4,
'spot/v1/trade/cancel-batch-orders-v2': 4,
'spot/v1/trade/orderInfo': 1,
'spot/v1/trade/open-orders': 1,
'spot/v1/trade/history': 1,
'spot/v1/trade/fills': 1,
'spot/v1/plan/placePlan': 1,
'spot/v1/plan/modifyPlan': 1,
'spot/v1/plan/cancelPlan': 1,
'spot/v1/plan/currentPlan': 1,
'spot/v1/plan/historyPlan': 1,
'spot/v1/plan/batchCancelPlan': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/convert/quoted-price': 4,
'spot/v1/convert/trade': 4,
'spot/v1/loan/borrow': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/loan/repay': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/loan/revise-pledge': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/order/orderCurrentList': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/order/orderHistoryList': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/order/closeTrackingOrder': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/order/updateTpsl': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/order/followerEndOrder': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/order/spotInfoList': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/config/getTraderSettings': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/config/getFollowerSettings': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/user/myTraders': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/config/setFollowerConfig': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/user/myFollowers': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/config/setProductCode': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/user/removeTrader': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/getRemovableFollower': 2,
'spot/v1/trace/user/removeFollower': 2,
'spot/v1/trace/profit/totalProfitInfo': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/profit/totalProfitList': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/profit/profitHisList': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/profit/profitHisDetailList': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/profit/waitProfitDetailList': 2, # 10 times/1s(UID) => 20/10 = 2
'spot/v1/trace/user/getTraderInfo': 2, # 10 times/1s(UID) => 20/10 = 2
'v2/spot/trade/place-order': 2,
'v2/spot/trade/cancel-order': 2,
'v2/spot/trade/batch-orders': 20,
'v2/spot/trade/batch-cancel-order': 2,
'v2/spot/trade/cancel-symbol-order': 4,
'v2/spot/trade/place-plan-order': 1,
'v2/spot/trade/modify-plan-order': 1,
'v2/spot/trade/cancel-plan-order': 1,
'v2/spot/trade/batch-cancel-plan-order': 2,
'v2/spot/wallet/transfer': 2,
'v2/spot/wallet/subaccount-transfer': 2,
'v2/spot/wallet/withdrawal': 2,
'v2/spot/wallet/cancel-withdrawal': 2,
'v2/spot/wallet/modify-deposit-account': 2,
},
},
'mix': {
'get': {
'mix/v1/account/account': 2,
'mix/v1/account/accounts': 2,
'mix/v1/position/singlePosition': 2,
'mix/v1/position/singlePosition-v2': 2,
'mix/v1/position/allPosition': 4, # 5 times/1s(UID) => 20/5 = 4
'mix/v1/position/allPosition-v2': 4, # 5 times/1s(UID) => 20/5 = 4
'mix/v1/position/history-position': 1,
'mix/v1/account/accountBill': 2,
'mix/v1/account/accountBusinessBill': 4,
'mix/v1/order/current': 1, # 20 times/1s(UID) => 20/20 = 1
'mix/v1/order/marginCoinCurrent': 1, # 20 times/1s(UID) => 20/20 = 1
'mix/v1/order/history': 2,
'mix/v1/order/historyProductType': 4, # 5 times/1s(UID) => 20/5 = 4
'mix/v1/order/detail': 2,
'mix/v1/order/fills': 2,
'mix/v1/order/allFills': 2,
'mix/v1/plan/currentPlan': 1, # 20 times/1s(UID) => 20/20 = 1
'mix/v1/plan/historyPlan': 2,
'mix/v1/trace/currentTrack': 2,
'mix/v1/trace/followerOrder': 2,
'mix/v1/trace/followerHistoryOrders': 2,
'mix/v1/trace/historyTrack': 2,
'mix/v1/trace/summary': 1, # 20 times/1s(UID) => 20/20 = 1
'mix/v1/trace/profitSettleTokenIdGroup': 1, # 20 times/1s(UID) => 20/20 = 1
'mix/v1/trace/profitDateGroupList': 1, # 20 times/1s(UID) => 20/20 = 1
'mix/v1/trade/profitDateList': 2,
'mix/v1/trace/waitProfitDateList': 1, # 20 times/1s(UID) => 20/20 = 1
'mix/v1/trace/traderSymbols': 1, # 20 times/1s(UID) => 20/20 = 1
'mix/v1/trace/traderList': 2,
'mix/v1/trace/traderDetail': 2, # 10 times/1s(UID) => 20/10 = 2
'mix/v1/trace/queryTraceConfig': 2,
'v2/mix/account/account': 2,
'v2/mix/account/accounts': 2,
'v2/mix/account/sub-account-assets': 200,
'v2/mix/account/open-count': 2,
'v2/mix/account/bill': 2,
'v2/mix/market/query-position-lever': 2,
'v2/mix/position/single-position': 2,
'v2/mix/position/all-position': 4,
'v2/mix/position/history-position': 1,
'v2/mix/order/detail': 2,
'v2/mix/order/fills': 2,
'v2/mix/order/fill-history': 2,
'v2/mix/order/orders-pending': 2,
'v2/mix/order/orders-history': 2,
'v2/mix/order/orders-plan-pending': 2,
'v2/mix/order/orders-plan-history': 2,
'v2/mix/market/position-long-short': 20,
},
'post': {
'mix/v1/account/sub-account-contract-assets': 200, # 0.1 times/1s(UID) => 20/0.1 = 200
'mix/v1/account/open-count': 1,
'mix/v1/account/setLeverage': 4, # 5 times/1s(UID) => 20/5 = 4
'mix/v1/account/setMargin': 4, # 5 times/1s(UID) => 20/5 = 4
'mix/v1/account/setMarginMode': 4, # 5 times/1s(UID) => 20/5 = 4
'mix/v1/account/setPositionMode': 4, # 5 times/1s(UID) => 20/5 = 4
'mix/v1/order/placeOrder': 2,
'mix/v1/order/batch-orders': 2,
'mix/v1/order/cancel-order': 2,
'mix/v1/order/cancel-batch-orders': 2,
'mix/v1/order/modifyOrder': 2, # 10 times/1s(UID) => 20/10 = 2
'mix/v1/order/cancel-symbol-orders': 2,
'mix/v1/order/cancel-all-orders': 2,
'mix/v1/order/close-all-positions': 20,
'mix/v1/plan/placePlan': 2,
'mix/v1/plan/modifyPlan': 2,
'mix/v1/plan/modifyPlanPreset': 2,
'mix/v1/plan/placeTPSL': 2,
'mix/v1/plan/placeTrailStop': 2,
'mix/v1/plan/placePositionsTPSL': 2,
'mix/v1/plan/modifyTPSLPlan': 2,
'mix/v1/plan/cancelPlan': 2,
'mix/v1/plan/cancelSymbolPlan': 2,
'mix/v1/plan/cancelAllPlan': 2,
'mix/v1/trace/closeTrackOrder': 2,
'mix/v1/trace/modifyTPSL': 2, # 10 times/1s(UID) => 20/10 = 2
'mix/v1/trace/closeTrackOrderBySymbol': 2,
'mix/v1/trace/setUpCopySymbols': 2,
'mix/v1/trace/followerSetBatchTraceConfig': 2,
'mix/v1/trace/followerCloseByTrackingNo': 2,
'mix/v1/trace/followerCloseByAll': 2,
'mix/v1/trace/followerSetTpsl': 2,
'mix/v1/trace/cancelCopyTrader': 4, # 5 times/1s(UID) => 20/5 = 4
'mix/v1/trace/traderUpdateConfig': 2, # 10 times/1s(UID) => 20/10 = 2
'mix/v1/trace/myTraderList': 2, # 10 times/1s(UID) => 20/10 = 2
'mix/v1/trace/myFollowerList': 2, # 10 times/1s(UID) => 20/10 = 2
'mix/v1/trace/removeFollower': 2, # 10 times/1s(UID) => 20/10 = 2
'mix/v1/trace/public/getFollowerConfig': 2, # 10 times/1s(UID) => 20/10 = 2
'mix/v1/trace/report/order/historyList': 2, # 10 times/1s(IP) => 20/10 = 2
'mix/v1/trace/report/order/currentList': 2, # 10 times/1s(IP) => 20/10 = 2
'mix/v1/trace/queryTraderTpslRatioConfig': 2, # 10 times/1s(UID) => 20/10 = 2
'mix/v1/trace/traderUpdateTpslRatioConfig': 2, # 10 times/1s(UID) => 20/10 = 2
'v2/mix/account/set-leverage': 4,
'v2/mix/account/set-margin': 4,
'v2/mix/account/set-margin-mode': 4,
'v2/mix/account/set-position-mode': 4,
'v2/mix/order/place-order': 2,
'v2/mix/order/click-backhand': 20,
'v2/mix/order/batch-place-order': 20,
'v2/mix/order/modify-order': 2,
'v2/mix/order/cancel-order': 2,
'v2/mix/order/batch-cancel-orders': 2,
'v2/mix/order/close-positions': 20,
'v2/mix/order/place-tpsl-order': 2,
'v2/mix/order/place-plan-order': 2,
'v2/mix/order/modify-tpsl-order': 2,
'v2/mix/order/modify-plan-order': 2,
'v2/mix/order/cancel-plan-order': 2,
},
},
'user': {
'get': {
'user/v1/fee/query': 2,
'user/v1/sub/virtual-list': 2,
'user/v1/sub/virtual-api-list': 2,
'user/v1/tax/spot-record': 1,
'user/v1/tax/future-record': 1,
'user/v1/tax/margin-record': 1,
'user/v1/tax/p2p-record': 1,
'v2/user/virtual-subaccount-list': 2,
'v2/user/virtual-subaccount-apikey-list': 2,
},
'post': {
'user/v1/sub/virtual-create': 4,
'user/v1/sub/virtual-modify': 4,
'user/v1/sub/virtual-api-batch-create': 20, # 1 times/1s(UID) => 20/1 = 20
'user/v1/sub/virtual-api-create': 4,
'user/v1/sub/virtual-api-modify': 4,
'v2/user/create-virtual-subaccount': 4,
'v2/user/modify-virtual-subaccount': 4,
'v2/user/batch-create-subaccount-and-apikey': 20,
'v2/user/create-virtual-subaccount-apikey': 4,
'v2/user/modify-virtual-subaccount-apikey': 4,
},
},
'p2p': {
'get': {
'p2p/v1/merchant/merchantList': 2, # 10 times/1s(UID) => 20/10 = 2
'p2p/v1/merchant/merchantInfo': 2, # 10 times/1s(UID) => 20/10 = 2
'p2p/v1/merchant/advList': 2, # 10 times/1s(UID) => 20/10 = 2
'p2p/v1/merchant/orderList': 2, # 10 times/1s(UID) => 20/10 = 2
'v2/p2p/merchantList': 2,
'v2/p2p/merchantInfo': 2,
'v2/p2p/orderList': 2,
'v2/p2p/advList': 2,
},
},
'broker': {
'get': {
'broker/v1/account/info': 2, # 10 times/1s(UID) => 20/10 = 2
'broker/v1/account/sub-list': 20, # 1 times/1s(UID) => 20/1 = 20
'broker/v1/account/sub-email': 20, # 1 times/1s(UID) => 20/1 = 20
'broker/v1/account/sub-spot-assets': 2, # 10 times/1s(UID) => 20/10 = 2
'broker/v1/account/sub-future-assets': 2, # 10 times/1s(UID) => 20/10 = 2
'broker/v1/account/subaccount-transfer': 1, # unknown
'broker/v1/account/subaccount-deposit': 1, # unknown
'broker/v1/account/subaccount-withdrawal': 1, # unknown
'broker/v1/account/sub-api-list': 2, # 10 times/1s(UID) => 20/10 = 2
'v2/broker/account/info': 2,
'v2/broker/account/subaccount-list': 20,
'v2/broker/account/subaccount-email': 2,
'v2/broker/account/subaccount-spot-assets': 2,
'v2/broker/account/subaccount-future-assets': 2,
'v2/broker/manage/subaccount-apikey-list': 2,
},
'post': {
'broker/v1/account/sub-create': 20, # 1 times/1s(UID) => 20/1 = 20
'broker/v1/account/sub-modify': 20, # 1 times/1s(UID) => 20/1 = 20
'broker/v1/account/sub-modify-email': 20, # 1 times/1s(UID) => 20/1 = 20
'broker/v1/account/sub-address': 2, # 10 times/1s(UID) => 20/10 = 2
'broker/v1/account/sub-withdrawal': 2, # 10 times/1s(UID) => 20/10 = 2
'broker/v1/account/sub-auto-transfer': 4, # 5 times/1s(UID) => 20/5 = 4
'broker/v1/account/sub-api-create': 2, # 10 times/1s(UID) => 20/10 = 2
'broker/v1/account/sub-api-modify': 2, # 10 times/1s(UID) => 20/10 = 2
'v2/broker/account/modify-subaccount-email': 2,
'v2/broker/account/create-subaccount': 20,
'v2/broker/account/modify-subaccount': 20,
'v2/broker/account/subaccount-address': 2,
'v2/broker/account/subaccount-withdrawal': 2,
'v2/broker/account/set-subaccount-autotransfer': 2,
'v2/broker/manage/create-subaccount-apikey': 2,
'v2/broker/manage/modify-subaccount-apikey': 2,
},
},
'margin': {
'get': {
'margin/v1/cross/account/riskRate': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/account/maxTransferOutAmount': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/account/maxTransferOutAmount': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/order/openOrders': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/order/history': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/order/fills': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/loan/list': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/repay/list': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/interest/list': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/liquidation/list': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/fin/list': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/order/openOrders': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/order/history': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/order/fills': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/loan/list': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/repay/list': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/interest/list': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/liquidation/list': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/fin/list': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/account/assets': 2, # 10 times/1s(IP) => 20/10 = 2
'margin/v1/isolated/account/assets': 2, # 10 times/1s(IP) => 20/10 = 2
'v2/margin/crossed/borrow-history': 2,
'v2/margin/crossed/repay-history': 2,
'v2/margin/crossed/interest-history': 2,
'v2/margin/crossed/liquidation-history': 2,
'v2/margin/crossed/financial-records': 2,
'v2/margin/crossed/account/assets': 2,
'v2/margin/crossed/account/risk-rate': 2,
'v2/margin/crossed/account/max-borrowable-amount': 2,
'v2/margin/crossed/account/max-transfer-out-amount': 2,
'v2/margin/crossed/interest-rate-and-limit': 2,
'v2/margin/crossed/tier-data': 2,
'v2/margin/crossed/open-orders': 2,
'v2/margin/crossed/history-orders': 2,
'v2/margin/crossed/fills': 2,
'v2/margin/isolated/borrow-history': 2,
'v2/margin/isolated/repay-history': 2,
'v2/margin/isolated/interest-history': 2,
'v2/margin/isolated/liquidation-history': 2,
'v2/margin/isolated/financial-records': 2,
'v2/margin/isolated/account/assets': 2,
'v2/margin/isolated/account/risk-rate': 2,
'v2/margin/isolated/account/max-borrowable-amount': 2,
'v2/margin/isolated/account/max-transfer-out-amount': 2,
'v2/margin/isolated/interest-rate-and-limit': 2,
'v2/margin/isolated/tier-data': 2,
'v2/margin/isolated/open-orders': 2,
'v2/margin/isolated/history-orders': 2,
'v2/margin/isolated/fills': 2,
},
'post': {
'margin/v1/cross/account/borrow': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/account/borrow': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/account/repay': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/account/repay': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/account/riskRate': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/account/maxBorrowableAmount': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/account/maxBorrowableAmount': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/account/flashRepay': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/account/queryFlashRepayStatus': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/account/flashRepay': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/account/queryFlashRepayStatus': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/order/placeOrder': 4, # 5 times/1s(UID) => 20/5 = 4
'margin/v1/isolated/order/batchPlaceOrder': 4, # 5 times/1s(UID) => 20/5 = 4
'margin/v1/isolated/order/cancelOrder': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/isolated/order/batchCancelOrder': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/order/placeOrder': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/order/batchPlaceOrder': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/order/cancelOrder': 2, # 10 times/1s(UID) => 20/10 = 2
'margin/v1/cross/order/batchCancelOrder': 2, # 10 times/1s(UID) => 20/10 = 2
'v2/margin/crossed/account/borrow': 2,
'v2/margin/crossed/account/repay': 2,
'v2/margin/crossed/account/flash-repay': 2,
'v2/margin/crossed/account/query-flash-repay-status': 2,
'v2/margin/crossed/place-order': 2,
'v2/margin/crossed/batch-place-order': 2,
'v2/margin/crossed/cancel-order': 2,
'v2/margin/crossed/batch-cancel-order': 2,
'v2/margin/isolated/account/borrow': 2,
'v2/margin/isolated/account/repay': 2,
'v2/margin/isolated/account/flash-repay': 2,
'v2/margin/isolated/account/query-flash-repay-status': 2,
'v2/margin/isolated/place-order': 2,
'v2/margin/isolated/batch-place-order': 2,
'v2/margin/isolated/cancel-order': 2,
'v2/margin/isolated/batch-cancel-order': 2,
},
},
'copy': {
'get': {
'v2/copy/mix-trader/order-current-track': 2,
'v2/copy/mix-trader/order-history-track': 2,
'v2/copy/mix-trader/order-total-detail': 2,
'v2/copy/mix-trader/profit-history-summarys': 1,
'v2/copy/mix-trader/profit-history-details': 1,
'v2/copy/mix-trader/profit-details': 1,
'v2/copy/mix-trader/profits-group-coin-date': 1,
'v2/copy/mix-trader/config-query-symbols': 1,
'v2/copy/mix-trader/config-query-followers': 2,
'v2/copy/mix-follower/query-current-orders': 2,
'v2/copy/mix-follower/query-history-orders': 1,
'v2/copy/mix-follower/query-settings': 2,
'v2/copy/mix-follower/query-traders': 2,
'v2/copy/mix-follower/query-quantity-limit': 2,
'v2/copy/mix-broker/query-traders': 2,
'v2/copy/mix-broker/query-history-traces': 2,
'v2/copy/mix-broker/query-current-traces': 2,
'v2/copy/spot-trader/profit-summarys': 2,
'v2/copy/spot-trader/profit-history-details': 2,
'v2/copy/spot-trader/profit-details': 2,
'v2/copy/spot-trader/order-total-detail': 2,
'v2/copy/spot-trader/order-history-track': 2,
'v2/copy/spot-trader/order-current-track': 2,
'v2/copy/spot-trader/config-query-settings': 2,
'v2/copy/spot-trader/config-query-followers': 2,
'v2/copy/spot-follower/query-traders': 2,
'v2/copy/spot-follower/query-trader-symbols': 2,
'v2/copy/spot-follower/query-settings': 2,
'v2/copy/spot-follower/query-history-orders': 2,
'v2/copy/spot-follower/query-current-orders': 2,
},
'post': {
'v2/copy/mix-trader/order-modify-tpsl': 2,
'v2/copy/mix-trader/order-close-positions': 2,
'v2/copy/mix-trader/config-setting-symbols': 2,
'v2/copy/mix-trader/config-setting-base': 2,
'v2/copy/mix-trader/config-remove-follower': 2,
'v2/copy/mix-follower/setting-tpsl': 1,
'v2/copy/mix-follower/settings': 2,
'v2/copy/mix-follower/close-positions': 2,
'v2/copy/mix-follower/cancel-trader': 4,
'v2/copy/spot-trader/order-modify-tpsl': 2,
'v2/copy/spot-trader/order-close-tracking': 2,
'v2/copy/spot-trader/config-setting-symbols': 2,
'v2/copy/spot-trader/config-remove-follower': 2,
'v2/copy/spot-follower/stop-order': 2,
'v2/copy/spot-follower/settings': 2,
'v2/copy/spot-follower/setting-tpsl': 2,
'v2/copy/spot-follower/order-close-tracking': 2,
'v2/copy/spot-follower/cancel-trader': 2,
},
},
'tax': {
'get': {
'v2/tax/spot-record': 20,
'v2/tax/future-record': 20,
'v2/tax/margin-record': 20,
'v2/tax/p2p-record': 20,
},
},
'convert': {
'get': {
'v2/convert/currencies': 2,
'v2/convert/quoted-price': 2,
'v2/convert/convert-record': 2,
'v2/convert/bgb-convert-coin-list': 2,
'v2/convert/bgb-convert-records': 2,
},
'post': {
'v2/convert/trade': 2,
'v2/convert/bgb-convert': 2,
},
},
'earn': {
'get': {
'v2/earn/savings/product': 2,
'v2/earn/savings/account': 2,
'v2/earn/savings/assets': 2,
'v2/earn/savings/records': 2,
'v2/earn/savings/subscribe-info': 2,
'v2/earn/savings/subscribe-result': 2,
'v2/earn/savings/redeem-result': 2,
'v2/earn/sharkfin/product': 2,
'v2/earn/sharkfin/account': 2,
'v2/earn/sharkfin/assets': 2,
'v2/earn/sharkfin/records': 2,
'v2/earn/sharkfin/subscribe-info': 2,
'v2/earn/sharkfin/subscribe-result': 4,
'v2/earn/loan/ongoing-orders': 2,
'v2/earn/loan/repay-history': 2,
'v2/earn/loan/revise-history': 2,
'v2/earn/loan/borrow-history': 2,
'v2/earn/loan/debts': 2,
'v2/earn/loan/reduces': 2,
'v2/earn/account/assets': 2,
},
'post': {
'v2/earn/savings/subscribe': 2,
'v2/earn/savings/redeem': 2,
'v2/earn/sharkfin/subscribe': 2,
'v2/earn/loan/borrow': 2,
'v2/earn/loan/repay': 2,
'v2/earn/loan/revise-pledge': 2,
},
},
'common': {
'get': {
'v2/common/trade-rate': 2,
},
},
},
},
'fees': {
'spot': {
'taker': self.parse_number('0.002'),
'maker': self.parse_number('0.002'),
},
'swap': {
'taker': self.parse_number('0.0006'),
'maker': self.parse_number('0.0004'),
},
},
'requiredCredentials': {
'apiKey': True,
'secret': True,
'password': True,
},
'exceptions': {
# http error codes
# 400 Bad Request — Invalid request format
# 401 Unauthorized — Invalid API Key
# 403 Forbidden — You do not have access to the requested resource
# 404 Not Found
# 500 Internal Server Error — We had a problem with our server
'exact': {
'1': ExchangeError, # {"code": 1, "message": "System error"}
# undocumented
'failure to get a peer from the ring-balancer': ExchangeNotAvailable, # {"message": "failure to get a peer from the ring-balancer"}
'4010': PermissionDenied, # {"code": 4010, "message": "For the security of your funds, withdrawals are not permitted within 24 hours after changing fund password / mobile number / Google Authenticator settings "}
# common
# '0': ExchangeError, # 200 successful,when the order placement / cancellation / operation is successful
'4001': ExchangeError, # no data received in 30s
'4002': ExchangeError, # Buffer full. cannot write data
# --------------------------------------------------------
'30001': AuthenticationError, # {"code": 30001, "message": 'request header "OK_ACCESS_KEY" cannot be blank'}
'30002': AuthenticationError, # {"code": 30002, "message": 'request header "OK_ACCESS_SIGN" cannot be blank'}
'30003': AuthenticationError, # {"code": 30003, "message": 'request header "OK_ACCESS_TIMESTAMP" cannot be blank'}
'30004': AuthenticationError, # {"code": 30004, "message": 'request header "OK_ACCESS_PASSPHRASE" cannot be blank'}
'30005': InvalidNonce, # {"code": 30005, "message": "invalid OK_ACCESS_TIMESTAMP"}
'30006': AuthenticationError, # {"code": 30006, "message": "invalid OK_ACCESS_KEY"}
'30007': BadRequest, # {"code": 30007, "message": 'invalid Content_Type, please use "application/json" format'}
'30008': RequestTimeout, # {"code": 30008, "message": "timestamp request expired"}
'30009': ExchangeError, # {"code": 30009, "message": "system error"}
'30010': AuthenticationError, # {"code": 30010, "message": "API validation failed"}
'30011': PermissionDenied, # {"code": 30011, "message": "invalid IP"}
'30012': AuthenticationError, # {"code": 30012, "message": "invalid authorization"}
'30013': AuthenticationError, # {"code": 30013, "message": "invalid sign"}
'30014': DDoSProtection, # {"code": 30014, "message": "request too frequent"}
'30015': AuthenticationError, # {"code": 30015, "message": 'request header "OK_ACCESS_PASSPHRASE" incorrect'}
'30016': ExchangeError, # {"code": 30015, "message": "you are using v1 apiKey, please use v1 endpoint. If you would like to use v3 endpoint, please subscribe to v3 apiKey"}
'30017': ExchangeError, # {"code": 30017, "message": "apikey's broker id does not match"}
'30018': ExchangeError, # {"code": 30018, "message": "apikey's domain does not match"}
'30019': ExchangeNotAvailable, # {"code": 30019, "message": "Api is offline or unavailable"}
'30020': BadRequest, # {"code": 30020, "message": "body cannot be blank"}
'30021': BadRequest, # {"code": 30021, "message": "Json data format error"}, {"code": 30021, "message": "json data format error"}
'30022': PermissionDenied, # {"code": 30022, "message": "Api has been frozen"}
'30023': BadRequest, # {"code": 30023, "message": "{0} parameter cannot be blank"}
'30024': BadSymbol, # {"code":30024,"message":"\"instrument_id\" is an invalid parameter"}
'30025': BadRequest, # {"code": 30025, "message": "{0} parameter category error"}
'30026': DDoSProtection, # {"code": 30026, "message": "requested too frequent"}
'30027': AuthenticationError, # {"code": 30027, "message": "login failure"}
'30028': PermissionDenied, # {"code": 30028, "message": "unauthorized execution"}
'30029': AccountSuspended, # {"code": 30029, "message": "account suspended"}
'30030': ExchangeError, # {"code": 30030, "message": "endpoint request failed. Please try again"}
'30031': BadRequest, # {"code": 30031, "message": "token does not exist"}
'30032': BadSymbol, # {"code": 30032, "message": "pair does not exist"}
'30033': BadRequest, # {"code": 30033, "message": "exchange domain does not exist"}
'30034': ExchangeError, # {"code": 30034, "message": "exchange ID does not exist"}
'30035': ExchangeError, # {"code": 30035, "message": "trading is not hasattr(self, supported) website"}
'30036': ExchangeError, # {"code": 30036, "message": "no relevant data"}
'30037': ExchangeNotAvailable, # {"code": 30037, "message": "endpoint is offline or unavailable"}
# '30038': AuthenticationError, # {"code": 30038, "message": "user does not exist"}
'30038': OnMaintenance, # {"client_oid":"","code":"30038","error_code":"30038","error_message":"Matching engine is being upgraded. Please try in about 1 minute.","message":"Matching engine is being upgraded. Please try in about 1 minute.","order_id":"-1","result":false}
# futures
'32001': AccountSuspended, # {"code": 32001, "message": "futures account suspended"}
'32002': PermissionDenied, # {"code": 32002, "message": "futures account does not exist"}
'32003': CancelPending, # {"code": 32003, "message": "canceling, please wait"}
'32004': ExchangeError, # {"code": 32004, "message": "you have no unfilled orders"}
'32005': InvalidOrder, # {"code": 32005, "message": "max order quantity"}
'32006': InvalidOrder, # {"code": 32006, "message": "the order price or trigger price exceeds USD 1 million"}
'32007': InvalidOrder, # {"code": 32007, "message": "leverage level must be the same for orders on the same side of the contract"}
'32008': InvalidOrder, # {"code": 32008, "message": "Max. positions to open(cross margin)"}
'32009': InvalidOrder, # {"code": 32009, "message": "Max. positions to open(fixed margin)"}
'32010': ExchangeError, # {"code": 32010, "message": "leverage cannot be changed with open positions"}
'32011': ExchangeError, # {"code": 32011, "message": "futures status error"}
'32012': ExchangeError, # {"code": 32012, "message": "futures order update error"}
'32013': ExchangeError, # {"code": 32013, "message": "token type is blank"}
'32014': ExchangeError, # {"code": 32014, "message": "your number of contracts closing is larger than the number of contracts available"}
'32015': ExchangeError, # {"code": 32015, "message": "margin ratio is lower than 100% before opening positions"}
'32016': ExchangeError, # {"code": 32016, "message": "margin ratio is lower than 100% after opening position"}
'32017': ExchangeError, # {"code": 32017, "message": "no BBO"}
'32018': ExchangeError, # {"code": 32018, "message": "the order quantity is less than 1, please try again"}
'32019': ExchangeError, # {"code": 32019, "message": "the order price deviates from the price of the previous minute by more than 3%"}
'32020': ExchangeError, # {"code": 32020, "message": "the price is not in the range of the price limit"}
'32021': ExchangeError, # {"code": 32021, "message": "leverage error"}
'32022': ExchangeError, # {"code": 32022, "message": "self function is not supported in your country or region according to the regulations"}
'32023': ExchangeError, # {"code": 32023, "message": "self account has outstanding loan"}
'32024': ExchangeError, # {"code": 32024, "message": "order cannot be placed during delivery"}
'32025': ExchangeError, # {"code": 32025, "message": "order cannot be placed during settlement"}
'32026': ExchangeError, # {"code": 32026, "message": "your account is restricted from opening positions"}
'32027': ExchangeError, # {"code": 32027, "message": "cancelled over 20 orders"}
'32028': AccountSuspended, # {"code": 32028, "message": "account is suspended and liquidated"}
'32029': ExchangeError, # {"code": 32029, "message": "order info does not exist"}
'32030': InvalidOrder, # The order cannot be cancelled
'32031': ArgumentsRequired, # client_oid or order_id is required.
'32038': AuthenticationError, # User does not exist
'32040': ExchangeError, # User have open contract orders or position
'32044': ExchangeError, # {"code": 32044, "message": "The margin ratio after submitting self order is lower than the minimum requirement({0}) for your tier."}
'32045': ExchangeError, # str of commission over 1 million
'32046': ExchangeError, # Each user can hold up to 10 trade plans at the same time
'32047': ExchangeError, # system error
'32048': InvalidOrder, # Order strategy track range error
'32049': ExchangeError, # Each user can hold up to 10 track plans at the same time
'32050': InvalidOrder, # Order strategy rang error
'32051': InvalidOrder, # Order strategy ice depth error
'32052': ExchangeError, # str of commission over 100 thousand
'32053': ExchangeError, # Each user can hold up to 6 ice plans at the same time
'32057': ExchangeError, # The order price is zero. Market-close-all function cannot be executed
'32054': ExchangeError, # Trade not allow
'32055': InvalidOrder, # cancel order error
'32056': ExchangeError, # iceberg per order average should between {0}-{1} contracts
'32058': ExchangeError, # Each user can hold up to 6 initiative plans at the same time
'32059': InvalidOrder, # Total amount should exceed per order amount
'32060': InvalidOrder, # Order strategy type error
'32061': InvalidOrder, # Order strategy initiative limit error
'32062': InvalidOrder, # Order strategy initiative range error
'32063': InvalidOrder, # Order strategy initiative rate error
'32064': ExchangeError, # Time Stringerval of orders should set between 5-120s
'32065': ExchangeError, # Close amount exceeds the limit of Market-close-all(999 for BTC, and 9999 for the rest tokens)
'32066': ExchangeError, # You have open orders. Please cancel all open orders before changing your leverage level.
'32067': ExchangeError, # Account equity < required hasattr(self, margin) setting. Please adjust your leverage level again.
'32068': ExchangeError, # The margin for self position will fall short of the required hasattr(self, margin) setting. Please adjust your leverage level or increase your margin to proceed.
'32069': ExchangeError, # Target leverage level too low. Your account balance is insufficient to cover the margin required. Please adjust the leverage level again.
'32070': ExchangeError, # Please check open position or unfilled order
'32071': ExchangeError, # Your current liquidation mode does not support self action.
'32072': ExchangeError, # The highest available margin for your order’s tier is {0}. Please edit your margin and place a new order.
'32073': ExchangeError, # The action does not apply to the token
'32074': ExchangeError, # The number of contracts of your position, open orders, and the current order has exceeded the maximum order limit of self asset.
'32075': ExchangeError, # Account risk rate breach
'32076': ExchangeError, # Liquidation of the holding position(s) at market price will require cancellation of all pending close orders of the contracts.
'32077': ExchangeError, # Your margin for self asset in futures account is insufficient and the position has been taken over for liquidation.(You will not be able to place orders, close positions, transfer funds, or add margin during self period of time. Your account will be restored after the liquidation is complete.)
'32078': ExchangeError, # Please cancel all open orders before switching the liquidation mode(Please cancel all open orders before switching the liquidation mode)
'32079': ExchangeError, # Your open positions are at high risk.(Please add margin or reduce positions before switching the mode)
'32080': ExchangeError, # Funds cannot be transferred out within 30 minutes after futures settlement
'32083': ExchangeError, # The number of contracts should be a positive multiple of %%. Please place your order again
# token and margin trading
'33001': PermissionDenied, # {"code": 33001, "message": "margin account for self pair is not enabled yet"}
'33002': AccountSuspended, # {"code": 33002, "message": "margin account for self pair is suspended"}
'33003': InsufficientFunds, # {"code": 33003, "message": "no loan balance"}
'33004': ExchangeError, # {"code": 33004, "message": "loan amount cannot be smaller than the minimum limit"}
'33005': ExchangeError, # {"code": 33005, "message": "repayment amount must exceed 0"}
'33006': ExchangeError, # {"code": 33006, "message": "loan order not found"}
'33007': ExchangeError, # {"code": 33007, "message": "status not found"}
'33008': InsufficientFunds, # {"code": 33008, "message": "loan amount cannot exceed the maximum limit"}
'33009': ExchangeError, # {"code": 33009, "message": "user ID is blank"}
'33010': ExchangeError, # {"code": 33010, "message": "you cannot cancel an order during session 2 of call auction"}
'33011': ExchangeError, # {"code": 33011, "message": "no new market data"}
'33012': ExchangeError, # {"code": 33012, "message": "order cancellation failed"}
'33013': InvalidOrder, # {"code": 33013, "message": "order placement failed"}
'33014': OrderNotFound, # {"code": 33014, "message": "order does not exist"}
'33015': InvalidOrder, # {"code": 33015, "message": "exceeded maximum limit"}
'33016': ExchangeError, # {"code": 33016, "message": "margin trading is not open for self token"}
'33017': InsufficientFunds, # {"code": 33017, "message": "insufficient balance"}
'33018': ExchangeError, # {"code": 33018, "message": "self parameter must be smaller than 1"}
'33020': ExchangeError, # {"code": 33020, "message": "request not supported"}
'33021': BadRequest, # {"code": 33021, "message": "token and the pair do not match"}
'33022': InvalidOrder, # {"code": 33022, "message": "pair and the order do not match"}
'33023': ExchangeError, # {"code": 33023, "message": "you can only place market orders during call auction"}
'33024': InvalidOrder, # {"code": 33024, "message": "trading amount too small"}
'33025': InvalidOrder, # {"code": 33025, "message": "base token amount is blank"}
'33026': ExchangeError, # {"code": 33026, "message": "transaction completed"}
'33027': InvalidOrder, # {"code": 33027, "message": "cancelled order or order cancelling"}
'33028': InvalidOrder, # {"code": 33028, "message": "the decimal places of the trading price exceeded the limit"}
'33029': InvalidOrder, # {"code": 33029, "message": "the decimal places of the trading size exceeded the limit"}
'33034': ExchangeError, # {"code": 33034, "message": "You can only place limit order after Call Auction has started"}
'33035': ExchangeError, # This type of order cannot be canceled(This type of order cannot be canceled)
'33036': ExchangeError, # Exceeding the limit of entrust order
'33037': ExchangeError, # The buy order price should be lower than 130% of the trigger price
'33038': ExchangeError, # The sell order price should be higher than 70% of the trigger price
'33039': ExchangeError, # The limit of callback rate is 0 < x <= 5%
'33040': ExchangeError, # The trigger price of a buy order should be lower than the latest transaction price
'33041': ExchangeError, # The trigger price of a sell order should be higher than the latest transaction price
'33042': ExchangeError, # The limit of price variance is 0 < x <= 1%
'33043': ExchangeError, # The total amount must be larger than 0
'33044': ExchangeError, # The average amount should be 1/1000 * total amount <= x <= total amount
'33045': ExchangeError, # The price should not be 0, including trigger price, order price, and price limit
'33046': ExchangeError, # Price variance should be 0 < x <= 1%
'33047': ExchangeError, # Sweep ratio should be 0 < x <= 100%
'33048': ExchangeError, # Per order limit: Total amount/1000 < x <= Total amount
'33049': ExchangeError, # Total amount should be X > 0
'33050': ExchangeError, # Time interval should be 5 <= x <= 120s
'33051': ExchangeError, # cancel order number not higher limit: plan and track entrust no more than 10, ice and time entrust no more than 6
'33059': BadRequest, # {"code": 33059, "message": "client_oid or order_id is required"}
'33060': BadRequest, # {"code": 33060, "message": "Only fill in either parameter client_oid or order_id"}