forked from carlosmiei/ast-transpiler
-
Notifications
You must be signed in to change notification settings - Fork 6
/
benchTest.js
8244 lines (8123 loc) · 395 KB
/
benchTest.js
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
// ---------------------------------------------------------------------------
const Exchange = require ('./base/Exchange');
const { TICK_SIZE } = require ('./base/functions/number');
const { AuthenticationError, ExchangeError, ArgumentsRequired, PermissionDenied, InvalidOrder, OrderNotFound, InsufficientFunds, BadRequest, RateLimitExceeded, InvalidNonce, NotSupported, RequestTimeout } = require ('./base/errors');
const Precise = require ('./base/Precise');
// ---------------------------------------------------------------------------
module.exports = class bybit extends Exchange {
describe () {
return this.deepExtend (super.describe (), {
'id': 'bybit',
'name': 'Bybit',
'countries': [ 'VG' ], // British Virgin Islands
'version': 'v5',
'userAgent': undefined,
'rateLimit': 20,
'hostname': 'bybit.com', // bybit.com, bytick.com
'pro': true,
'certified': true,
'has': {
'CORS': true,
'spot': true,
'margin': true,
'swap': true,
'future': true,
'option': undefined,
'cancelAllOrders': true,
'cancelOrder': true,
'createOrder': true,
'createPostOnlyOrder': true,
'createReduceOnlyOrder': true,
'createStopLimitOrder': true,
'createStopMarketOrder': true,
'createStopOrder': true,
'editOrder': true,
'fetchBalance': true,
'fetchBorrowInterest': false, // temporarily disabled, as it does not work
'fetchBorrowRate': true,
'fetchBorrowRateHistories': false,
'fetchBorrowRateHistory': false,
'fetchBorrowRates': false,
'fetchCanceledOrders': true,
'fetchClosedOrders': true,
'fetchCurrencies': true,
'fetchDeposit': false,
'fetchDepositAddress': true,
'fetchDepositAddresses': false,
'fetchDepositAddressesByNetwork': true,
'fetchDeposits': true,
'fetchFundingRate': true, // emulated in exchange
'fetchFundingRateHistory': true,
'fetchFundingRates': true,
'fetchIndexOHLCV': true,
'fetchLedger': true,
'fetchMarketLeverageTiers': true,
'fetchMarkets': true,
'fetchMarkOHLCV': true,
'fetchMyTrades': true,
'fetchOHLCV': true,
'fetchOpenInterest': true,
'fetchOpenInterestHistory': true,
'fetchOpenOrders': true,
'fetchOrder': true,
'fetchOrderBook': true,
'fetchOrders': true,
'fetchOrderTrades': true,
'fetchPosition': true,
'fetchPositions': true,
'fetchPremiumIndexOHLCV': true,
'fetchTicker': true,
'fetchTickers': true,
'fetchTime': true,
'fetchTrades': true,
'fetchTradingFee': true,
'fetchTradingFees': true,
'fetchTransactions': false,
'fetchTransfers': true,
'fetchWithdrawals': true,
'setLeverage': true,
'setMarginMode': true,
'setPositionMode': true,
'transfer': true,
'withdraw': true,
},
'timeframes': {
'1m': '1',
'3m': '3',
'5m': '5',
'15m': '15',
'30m': '30',
'1h': '60',
'2h': '120',
'4h': '240',
'6h': '360',
'12h': '720',
'1d': 'D',
'1w': 'W',
'1M': 'M',
},
'urls': {
'test': {
'spot': 'https://api-testnet.{hostname}',
'futures': 'https://api-testnet.{hostname}',
'v2': 'https://api-testnet.{hostname}',
'public': 'https://api-testnet.{hostname}',
'private': 'https://api-testnet.{hostname}',
},
'logo': 'https://user-images.githubusercontent.com/51840849/76547799-daff5b80-649e-11ea-87fb-3be9bac08954.jpg',
'api': {
'spot': 'https://api.{hostname}',
'futures': 'https://api.{hostname}',
'v2': 'https://api.{hostname}',
'public': 'https://api.{hostname}',
'private': 'https://api.{hostname}',
},
'www': 'https://www.bybit.com',
'doc': [
'https://bybit-exchange.github.io/docs/inverse/',
'https://bybit-exchange.github.io/docs/linear/',
'https://github.com/bybit-exchange',
],
'fees': 'https://help.bybit.com/hc/en-us/articles/360039261154',
'referral': 'https://www.bybit.com/register?affiliate_id=35953',
},
'api': {
'public': {
'get': {
// inverse swap
'v2/public/orderBook/L2': 1,
'v2/public/kline/list': 3,
'v2/public/tickers': 1,
'v2/public/trading-records': 1,
'v2/public/symbols': 1,
'v2/public/mark-price-kline': 3,
'v2/public/index-price-kline': 3,
'v2/public/premium-index-kline': 2,
'v2/public/open-interest': 1,
'v2/public/big-deal': 1,
'v2/public/account-ratio': 1,
'v2/public/funding-rate': 1,
'v2/public/elite-ratio': 1,
'v2/public/funding/prev-funding-rate': 1,
'v2/public/risk-limit/list': 1,
// linear swap USDT
'public/linear/kline': 3,
'public/linear/recent-trading-records': 1,
'public/linear/risk-limit': 1,
'public/linear/funding/prev-funding-rate': 1,
'public/linear/mark-price-kline': 1,
'public/linear/index-price-kline': 1,
'public/linear/premium-index-kline': 1,
// spot
'spot/v1/time': 1,
'spot/v1/symbols': 1,
'spot/quote/v1/depth': 1,
'spot/quote/v1/depth/merged': 1,
'spot/quote/v1/trades': 1,
'spot/quote/v1/kline': 1,
'spot/quote/v1/ticker/24hr': 1,
'spot/quote/v1/ticker/price': 1,
'spot/quote/v1/ticker/book_ticker': 1,
'spot/v3/public/symbols': 1,
'spot/v3/public/quote/depth': 1,
'spot/v3/public/quote/depth/merged': 1,
'spot/v3/public/quote/trades': 1,
'spot/v3/public/quote/kline': 1,
'spot/v3/public/quote/ticker/24hr': 1,
'spot/v3/public/quote/ticker/price': 1,
'spot/v3/public/quote/ticker/bookTicker': 1,
'spot/v3/public/server-time': 1,
'spot/v3/public/infos': 1,
// data
'v2/public/time': 1,
'v3/public/time': 1,
'v2/public/announcement': 1,
// USDC endpoints
// option USDC
'option/usdc/openapi/public/v1/order-book': 1,
'option/usdc/openapi/public/v1/symbols': 1,
'option/usdc/openapi/public/v1/tick': 1,
'option/usdc/openapi/public/v1/delivery-price': 1,
'option/usdc/openapi/public/v1/query-trade-latest': 1,
'option/usdc/openapi/public/v1/query-historical-volatility': 1,
'option/usdc/openapi/public/v1/all-tickers': 1,
// perpetual swap USDC
'perpetual/usdc/openapi/public/v1/order-book': 1,
'perpetual/usdc/openapi/public/v1/symbols': 1,
'perpetual/usdc/openapi/public/v1/tick': 1,
'perpetual/usdc/openapi/public/v1/kline/list': 1,
'perpetual/usdc/openapi/public/v1/mark-price-kline': 1,
'perpetual/usdc/openapi/public/v1/index-price-kline': 1,
'perpetual/usdc/openapi/public/v1/premium-index-kline': 1,
'perpetual/usdc/openapi/public/v1/open-interest': 1,
'perpetual/usdc/openapi/public/v1/big-deal': 1,
'perpetual/usdc/openapi/public/v1/account-ratio': 1,
'perpetual/usdc/openapi/public/v1/prev-funding-rate': 1,
'perpetual/usdc/openapi/public/v1/risk-limit/list': 1,
// account
'asset/v1/public/deposit/allowed-deposit-list': 1,
'contract/v3/public/copytrading/symbol/list': 1,
// derivative
'derivatives/v3/public/order-book/L2': 1,
'derivatives/v3/public/kline': 1,
'derivatives/v3/public/tickers': 1,
'derivatives/v3/public/instruments-info': 1,
'derivatives/v3/public/mark-price-kline': 1,
'derivatives/v3/public/index-price-kline': 1,
'derivatives/v3/public/funding/history-funding-rate': 1,
'derivatives/v3/public/risk-limit/list': 1,
'derivatives/v3/public/delivery-price': 1,
'derivatives/v3/public/recent-trade': 1,
'derivatives/v3/public/open-interest': 1,
'derivatives/v3/public/insurance': 1,
// v5
'v5/market/kline': 1,
'v5/market/mark-price-kline': 1,
'v5/market/index-price-kline': 1,
'v5/market/premium-index-price-kline': 1,
'v5/market/instruments-info': 1,
'v5/market/orderbook': 1,
'v5/market/tickers': 1,
'v5/market/funding/history': 1,
'v5/market/recent-trade': 1,
'v5/market/open-interest': 1,
'v5/market/historical-volatility': 1,
'v5/market/insurance': 1,
'v5/market/risk-limit': 1,
'v5/market/delivery-price': 1,
'v5/spot-lever-token/info': 1,
'v5/spot-lever-token/reference': 1,
},
},
'private': {
'get': {
// inverse swap
'v2/private/order/list': 5,
'v2/private/order': 5,
'v2/private/stop-order/list': 5,
'v2/private/stop-order': 1,
'v2/private/position/list': 25,
'v2/private/position/fee-rate': 40,
'v2/private/execution/list': 25,
'v2/private/trade/closed-pnl/list': 1,
'v2/public/risk-limit/list': 1, // TODO check
'v2/public/funding/prev-funding-rate': 25, // TODO check
'v2/private/funding/prev-funding': 25,
'v2/private/funding/predicted-funding': 25,
'v2/private/account/api-key': 5,
'v2/private/account/lcp': 1,
'v2/private/wallet/balance': 25, // 120 per minute = 2 per second => cost = 50 / 2 = 25
'v2/private/wallet/fund/records': 25,
'v2/private/wallet/withdraw/list': 25,
'v2/private/exchange-order/list': 1,
// linear swap USDT
'private/linear/order/list': 5, // 600 per minute = 10 per second => cost = 50 / 10 = 5
'private/linear/order/search': 5,
'private/linear/stop-order/list': 5,
'private/linear/stop-order/search': 5,
'private/linear/position/list': 25,
'private/linear/trade/execution/list': 25,
'private/linear/trade/closed-pnl/list': 25,
'public/linear/risk-limit': 1,
'private/linear/funding/predicted-funding': 25,
'private/linear/funding/prev-funding': 25,
// inverse futures
'futures/private/order/list': 5,
'futures/private/order': 5,
'futures/private/stop-order/list': 5,
'futures/private/stop-order': 5,
'futures/private/position/list': 25,
'futures/private/execution/list': 25,
'futures/private/trade/closed-pnl/list': 1,
// spot
'spot/v1/account': 2.5,
'spot/v1/order': 2.5,
'spot/v1/open-orders': 2.5,
'spot/v1/history-orders': 2.5,
'spot/v1/myTrades': 2.5,
'spot/v1/cross-margin/order': 10,
'spot/v1/cross-margin/accounts/balance': 10,
'spot/v1/cross-margin/loan-info': 10,
'spot/v1/cross-margin/repay/history': 10,
'spot/v3/private/order': 2.5,
'spot/v3/private/open-orders': 2.5,
'spot/v3/private/history-orders': 2.5,
'spot/v3/private/my-trades': 2.5,
'spot/v3/private/account': 2.5,
'spot/v3/private/reference': 2.5,
'spot/v3/private/record': 2.5,
'spot/v3/private/cross-margin-orders': 10,
'spot/v3/private/cross-margin-account': 10,
'spot/v3/private/cross-margin-loan-info': 10,
'spot/v3/private/cross-margin-repay-history': 10,
// account
'asset/v1/private/transfer/list': 50, // 60 per minute = 1 per second => cost = 50 / 1 = 50
'asset/v3/private/transfer/inter-transfer/list/query': 0.84, // 60/s
'asset/v1/private/sub-member/transfer/list': 50,
'asset/v3/private/transfer/sub-member/list/query': 0.84, // 60/s
'asset/v3/private/transfer/sub-member-transfer/list/query': 0.84, // 60/s
'asset/v3/private/transfer/universal-transfer/list/query': 0.84, // 60/s
'asset/v1/private/sub-member/member-ids': 50,
'asset/v1/private/deposit/record/query': 50,
'asset/v1/private/withdraw/record/query': 25,
'asset/v1/private/coin-info/query': 25,
'asset/v3/private/coin-info/query': 25, // 2/s
'asset/v1/private/asset-info/query': 50,
'asset/v1/private/deposit/address': 100,
'asset/v3/private/deposit/address/query': 0.17, // 300/s
'asset/v1/private/universal/transfer/list': 50,
'contract/v3/private/copytrading/order/list': 1,
'contract/v3/private/copytrading/position/list': 1,
'contract/v3/private/copytrading/wallet/balance': 1,
'contract/v3/private/position/limit-info': 25, // 120 per minute = 2 per second => cost = 50 / 2 = 25
'contract/v3/private/order/unfilled-orders': 1,
'contract/v3/private/order/list': 1,
'contract/v3/private/position/list': 1,
'contract/v3/private/execution/list': 1,
'contract/v3/private/position/closed-pnl': 1,
'contract/v3/private/account/wallet/balance': 1,
'contract/v3/private/account/fee-rate': 1,
'contract/v3/private/account/wallet/fund-records': 1,
// derivative
'unified/v3/private/order/unfilled-orders': 1,
'unified/v3/private/order/list': 1,
'unified/v3/private/position/list': 1,
'unified/v3/private/execution/list': 1,
'unified/v3/private/delivery-record': 1,
'unified/v3/private/settlement-record': 1,
'unified/v3/private/account/wallet/balance': 1,
'unified/v3/private/account/transaction-log': 1,
'asset/v2/private/exchange/exchange-order-all': 1,
'unified/v3/private/account/borrow-history': 1,
'unified/v3/private/account/borrow-rate': 1,
'unified/v3/private/account/info': 1,
'user/v3/private/frozen-sub-member': 10, // 5/s
'user/v3/private/query-sub-members': 5, // 10/s
'user/v3/private/query-api': 5, // 10/s
'asset/v3/private/transfer/transfer-coin/list/query': 0.84, // 60/s
'asset/v3/private/transfer/account-coin/balance/query': 0.84, // 60/s
'asset/v3/private/transfer/account-coins/balance/query': 50,
'asset/v3/private/transfer/asset-info/query': 0.84, // 60/s
'asset/v3/public/deposit/allowed-deposit-list/query': 0.17, // 300/s
'asset/v3/private/deposit/record/query': 0.17, // 300/s
'asset/v3/private/withdraw/record/query': 0.17, // 300/s
// v5
'v5/order/history': 2.5,
'v5/order/spot-borrow-check': 2.5,
'v5/order/realtime': 2.5,
'v5/position/list': 2.5,
'v5/execution/list': 2.5,
'v5/position/closed-pnl': 2.5,
'v5/account/wallet-balance': 2.5,
'v5/account/borrow-history': 2.5,
'v5/account/collateral-info': 2.5,
'v5/account/mmp-state': 2.5,
'v5/asset/coin-greeks': 2.5,
'v5/account/info': 2.5,
'v5/account/transaction-log': 2.5,
'v5/account/fee-rate': 1,
'v5/asset/exchange/order-record': 2.5,
'v5/asset/delivery-record': 2.5,
'v5/asset/settlement-record': 2.5,
'v5/asset/transfer/query-asset-info': 2.5,
'v5/asset/transfer/query-account-coin-balance': 2.5,
'v5/asset/transfer/query-transfer-coin-list': 2.5,
'v5/asset/transfer/query-inter-transfer-list': 2.5,
'v5/asset/transfer/query-sub-member-list': 2.5,
'v5/asset/transfer/query-universal-transfer-list': 1,
'v5/asset/deposit/query-allowed-list': 2.5,
'v5/asset/deposit/query-record': 2.5,
'v5/asset/deposit/query-sub-member-record': 2.5,
'v5/asset/deposit/query-address': 2.5,
'v5/asset/deposit/query-sub-member-address': 2.5,
'v5/asset/deposit/query-internal-record': 2.5,
'v5/asset/coin/query-info': 2.5,
'v5/asset/withdraw/query-record': 2.5,
'v5/asset/withdraw/withdrawable-amount': 2.5,
'v5/asset/transfer/query-account-coins-balance': 2.5,
// user
'v5/user/query-sub-members': 10,
'v5/user/query-api': 10,
},
'post': {
// inverse swap
'v2/private/order/create': 30,
'v2/private/order/cancel': 30,
'v2/private/order/cancelAll': 300, // 100 per minute + 'consumes 10 requests'
'v2/private/order/replace': 30,
'v2/private/stop-order/create': 30,
'v2/private/stop-order/cancel': 30,
'v2/private/stop-order/cancelAll': 300,
'v2/private/stop-order/replace': 30,
'v2/private/position/change-position-margin': 40,
'v2/private/position/trading-stop': 40,
'v2/private/position/leverage/save': 40,
'v2/private/tpsl/switch-mode': 40,
'v2/private/position/switch-isolated': 2.5,
'v2/private/position/risk-limit': 2.5,
'v2/private/position/switch-mode': 2.5,
// linear swap USDT
'private/linear/order/create': 30, // 100 per minute = 1.666 per second => cost = 50 / 1.6666 = 30
'private/linear/order/cancel': 30,
'private/linear/order/cancel-all': 300, // 100 per minute + 'consumes 10 requests'
'private/linear/order/replace': 30,
'private/linear/stop-order/create': 30,
'private/linear/stop-order/cancel': 30,
'private/linear/stop-order/cancel-all': 300,
'private/linear/stop-order/replace': 30,
'private/linear/position/set-auto-add-margin': 40,
'private/linear/position/switch-isolated': 40,
'private/linear/position/switch-mode': 40,
'private/linear/tpsl/switch-mode': 2.5,
'private/linear/position/add-margin': 40,
'private/linear/position/set-leverage': 40, // 75 per minute = 1.25 per second => cost = 50 / 1.25 = 40
'private/linear/position/trading-stop': 40,
'private/linear/position/set-risk': 2.5,
// inverse futures
'futures/private/order/create': 30,
'futures/private/order/cancel': 30,
'futures/private/order/cancelAll': 30,
'futures/private/order/replace': 30,
'futures/private/stop-order/create': 30,
'futures/private/stop-order/cancel': 30,
'futures/private/stop-order/cancelAll': 30,
'futures/private/stop-order/replace': 30,
'futures/private/position/change-position-margin': 40,
'futures/private/position/trading-stop': 40,
'futures/private/position/leverage/save': 40,
'futures/private/position/switch-mode': 40,
'futures/private/tpsl/switch-mode': 40,
'futures/private/position/switch-isolated': 40,
'futures/private/position/risk-limit': 2.5,
// spot
'spot/v1/order': 2.5,
'spot/v1/cross-margin/loan': 10,
'spot/v1/cross-margin/repay': 10,
'spot/v3/private/order': 2.5,
'spot/v3/private/cancel-order': 2.5,
'spot/v3/private/cancel-orders': 2.5,
'spot/v3/private/cancel-orders-by-ids': 2.5,
'spot/v3/private/purchase': 2.5,
'spot/v3/private/redeem': 2.5,
'spot/v3/private/cross-margin-loan': 10,
'spot/v3/private/cross-margin-repay': 10,
// account
'asset/v1/private/transfer': 150, // 20 per minute = 0.333 per second => cost = 50 / 0.3333 = 150
'asset/v3/private/transfer/inter-transfer': 2.5, // 20/s
'asset/v1/private/sub-member/transfer': 150,
'asset/v1/private/withdraw': 50,
'asset/v3/private/withdraw/create': 1, // 10/s
'asset/v1/private/withdraw/cancel': 50,
'asset/v3/private/withdraw/cancel': 0.84, // 60/s
'asset/v1/private/transferable-subs/save': 3000,
'asset/v1/private/universal/transfer': 1500,
'asset/v3/private/transfer/sub-member-transfer': 2.5, // 20/s
'asset/v3/private/transfer/transfer-sub-member-save': 2.5, // 20/s
'asset/v3/private/transfer/universal-transfer': 2.5, // 20/s
'user/v3/private/create-sub-member': 10, // 5/s
'user/v3/private/create-sub-api': 10, // 5/s
'user/v3/private/update-api': 10, // 5/s
'user/v3/private/delete-api': 10, // 5/s
'user/v3/private/update-sub-api': 10, // 5/s
'user/v3/private/delete-sub-api': 10, // 5/s
// USDC endpoints
// option USDC
'option/usdc/openapi/private/v1/place-order': 2.5,
'option/usdc/openapi/private/v1/batch-place-order': 2.5,
'option/usdc/openapi/private/v1/replace-order': 2.5,
'option/usdc/openapi/private/v1/batch-replace-orders': 2.5,
'option/usdc/openapi/private/v1/cancel-order': 2.5,
'option/usdc/openapi/private/v1/batch-cancel-orders': 2.5,
'option/usdc/openapi/private/v1/cancel-all': 2.5,
'option/usdc/openapi/private/v1/query-active-orders': 2.5,
'option/usdc/openapi/private/v1/query-order-history': 2.5,
'option/usdc/openapi/private/v1/execution-list': 2.5,
'option/usdc/openapi/private/v1/query-transaction-log': 2.5,
'option/usdc/openapi/private/v1/query-wallet-balance': 2.5,
'option/usdc/openapi/private/v1/query-asset-info': 2.5,
'option/usdc/openapi/private/v1/query-margin-info': 2.5,
'option/usdc/openapi/private/v1/query-position': 2.5,
'option/usdc/openapi/private/v1/query-delivery-list': 2.5,
'option/usdc/openapi/private/v1/query-position-exp-date': 2.5,
'option/usdc/openapi/private/v1/mmp-modify': 2.5,
'option/usdc/openapi/private/v1/mmp-reset': 2.5,
// perpetual swap USDC
'perpetual/usdc/openapi/private/v1/place-order': 2.5,
'perpetual/usdc/openapi/private/v1/replace-order': 2.5,
'perpetual/usdc/openapi/private/v1/cancel-order': 2.5,
'perpetual/usdc/openapi/private/v1/cancel-all': 2.5,
'perpetual/usdc/openapi/private/v1/position/leverage/save': 2.5,
'option/usdc/openapi/private/v1/session-settlement': 2.5,
'option/usdc/private/asset/account/setMarginMode': 2.5,
'perpetual/usdc/openapi/public/v1/risk-limit/list': 2.5,
'perpetual/usdc/openapi/private/v1/position/set-risk-limit': 2.5,
'perpetual/usdc/openapi/private/v1/predicted-funding': 2.5,
'contract/v3/private/copytrading/order/create': 2.5,
'contract/v3/private/copytrading/order/cancel': 2.5,
'contract/v3/private/copytrading/order/close': 2.5,
'contract/v3/private/copytrading/position/close': 2.5,
'contract/v3/private/copytrading/position/set-leverage': 2.5,
'contract/v3/private/copytrading/wallet/transfer': 2.5,
'contract/v3/private/copytrading/order/trading-stop': 2.5,
'contract/v3/private/order/create': 1,
'contract/v3/private/order/cancel': 1,
'contract/v3/private/order/cancel-all': 1,
'contract/v3/private/order/replace': 1,
'contract/v3/private/position/set-auto-add-margin': 1,
'contract/v3/private/position/switch-isolated': 1,
'contract/v3/private/position/switch-mode': 1,
'contract/v3/private/position/switch-tpsl-mode': 1,
'contract/v3/private/position/set-leverage': 1,
'contract/v3/private/position/trading-stop': 1,
'contract/v3/private/position/set-risk-limit': 1,
'contract/v3/private/account/setMarginMode': 1,
// derivative
'unified/v3/private/order/create': 2.5,
'unified/v3/private/order/replace': 2.5,
'unified/v3/private/order/cancel': 2.5,
'unified/v3/private/order/create-batch': 2.5,
'unified/v3/private/order/replace-batch': 2.5,
'unified/v3/private/order/cancel-batch': 2.5,
'unified/v3/private/order/cancel-all': 2.5,
'unified/v3/private/position/set-leverage': 2.5,
'unified/v3/private/position/tpsl/switch-mode': 2.5,
'unified/v3/private/position/set-risk-limit': 2.5,
'unified/v3/private/position/trading-stop': 2.5,
'unified/v3/private/account/upgrade-unified-account': 2.5,
'unified/v3/private/account/setMarginMode': 2.5,
// tax
'fht/compliance/tax/v3/private/registertime': 50,
'fht/compliance/tax/v3/private/create': 50,
'fht/compliance/tax/v3/private/status': 50,
'fht/compliance/tax/v3/private/url': 50,
// v5
'v5/order/create': 2.5,
'v5/order/amend': 2.5,
'v5/order/cancel': 2.5,
'v5/order/cancel-all': 2.5,
'v5/order/create-batch': 2.5,
'v5/order/amend-batch': 2.5,
'v5/order/cancel-batch': 2.5,
'v5/order/disconnected-cancel-all': 2.5,
'v5/position/set-leverage': 2.5,
'v5/position/set-tpsl-mode': 2.5,
'v5/position/set-risk-limit': 2.5,
'v5/position/trading-stop': 2.5,
'v5/account/upgrade-to-uta': 2.5,
'v5/account/set-margin-mode': 2.5,
'v5/asset/transfer/inter-transfer': 2.5,
'v5/asset/transfer/save-transfer-sub-member': 2.5,
'v5/asset/transfer/universal-transfer': 2.5,
'v5/asset/deposit/deposit-to-account': 2.5,
'v5/asset/withdraw/create': 2.5,
'v5/asset/withdraw/cancel': 2.5,
'v5/spot-lever-token/purchase': 2.5,
'v5/spot-lever-token/redeem': 2.5,
'v5/spot-lever-token/order-record': 2.5,
'v5/spot-margin-trade/switch-mode': 2.5,
'v5/spot-margin-trade/set-leverage': 2.5,
// user
'v5/user/create-sub-member': 10,
'v5/user/create-sub-api': 10,
'v5/user/frozen-sub-member': 10,
'v5/user/update-api': 10,
'v5/user/update-sub-api': 10,
'v5/user/delete-api': 10,
'v5/user/delete-sub-api': 10,
},
'delete': {
// spot
'spot/v1/order': 2.5,
'spot/v1/order/fast': 2.5,
'spot/order/batch-cancel': 2.5,
'spot/order/batch-fast-cancel': 2.5,
'spot/order/batch-cancel-by-ids': 2.5,
},
},
},
'httpExceptions': {
'403': RateLimitExceeded, // Forbidden -- You request too many times
},
'exceptions': {
// Uncodumented explanation of error strings:
// - oc_diff: order cost needed to place this order
// - new_oc: total order cost of open orders including the order you are trying to open
// - ob: order balance - the total cost of current open orders
// - ab: available balance
'exact': {
'-10009': BadRequest, // {"ret_code":-10009,"ret_msg":"Invalid period!","result":null,"token":null}
'-1004': BadRequest, // {"ret_code":-1004,"ret_msg":"Missing required parameter \u0027symbol\u0027","ext_code":null,"ext_info":null,"result":null}
'-1021': BadRequest, // {"ret_code":-1021,"ret_msg":"Timestamp for this request is outside of the recvWindow.","ext_code":null,"ext_info":null,"result":null}
'-1103': BadRequest, // An unknown parameter was sent.
'-1140': InvalidOrder, // {"ret_code":-1140,"ret_msg":"Transaction amount lower than the minimum.","result":{},"ext_code":"","ext_info":null,"time_now":"1659204910.248576"}
'-1197': InvalidOrder, // {"ret_code":-1197,"ret_msg":"Your order quantity to buy is too large. The filled price may deviate significantly from the market price. Please try again","result":{},"ext_code":"","ext_info":null,"time_now":"1659204531.979680"}
'-2013': InvalidOrder, // {"ret_code":-2013,"ret_msg":"Order does not exist.","ext_code":null,"ext_info":null,"result":null}
'-2015': AuthenticationError, // Invalid API-key, IP, or permissions for action.
'-6017': BadRequest, // Repayment amount has exceeded the total liability
'-6025': BadRequest, // Amount to borrow cannot be lower than the min. amount to borrow (per transaction)
'-6029': BadRequest, // Amount to borrow has exceeded the user's estimated max amount to borrow
'5004': ExchangeError, // {"retCode":5004,"retMsg":"Server Timeout","result":null,"retExtInfo":{},"time":1667577060106}
'7001': BadRequest, // {"retCode":7001,"retMsg":"request params type error"}
'10001': BadRequest, // parameter error
'10002': InvalidNonce, // request expired, check your timestamp and recv_window
'10003': AuthenticationError, // Invalid apikey
'10004': AuthenticationError, // invalid sign
'10005': PermissionDenied, // permission denied for current apikey
'10006': RateLimitExceeded, // too many requests
'10007': AuthenticationError, // api_key not found in your request parameters
'10008': AuthenticationError, // User had been banned
'10009': AuthenticationError, // IP had been banned
'10010': PermissionDenied, // request ip mismatch
'10014': BadRequest, // Request is duplicate
'10016': ExchangeError, // {"retCode":10016,"retMsg":"System error. Please try again later."}
'10017': BadRequest, // request path not found or request method is invalid
'10018': RateLimitExceeded, // exceed ip rate limit
'10020': PermissionDenied, // {"retCode":10020,"retMsg":"your account is not a unified margin account, please update your account","result":null,"retExtInfo":null,"time":1664783731123}
'10024': PermissionDenied, // Compliance rules triggered
'10027': PermissionDenied, // Trading Banned
'10028': PermissionDenied, // The API can only be accessed by unified account users.
'10029': PermissionDenied, // The requested symbol is invalid, please check symbol whitelist
'12201': BadRequest, // {"retCode":12201,"retMsg":"Invalid orderCategory parameter.","result":{},"retExtInfo":null,"time":1666699391220}
'100028': PermissionDenied, // The API cannot be accessed by unified account users.
'110001': InvalidOrder, // Order does not exist
'110003': InvalidOrder, // Order price is out of permissible range
'110004': InsufficientFunds, // Insufficient wallet balance
'110005': InvalidOrder, // position status
'110006': InsufficientFunds, // cannot afford estimated position_margin
'110007': InsufficientFunds, // {"retCode":110007,"retMsg":"ab not enough for new order","result":{},"retExtInfo":{},"time":1668838414793}
'110008': InvalidOrder, // Order has been finished or canceled
'110009': InvalidOrder, // The number of stop orders exceeds maximum limit allowed
'110010': InvalidOrder, // Order already cancelled
'110011': InvalidOrder, // Any adjustments made will trigger immediate liquidation
'110012': InsufficientFunds, // Available balance not enough
'110013': BadRequest, // Due to risk limit, cannot set leverage
'110014': InsufficientFunds, // Available balance not enough to add margin
'110015': BadRequest, // the position is in cross_margin
'110016': InvalidOrder, // Requested quantity of contracts exceeds risk limit, please adjust your risk limit level before trying again
'110017': InvalidOrder, // Reduce-only rule not satisfied
'110018': BadRequest, // userId illegal
'110019': InvalidOrder, // orderId illegal
'110020': InvalidOrder, // number of active orders greater than 500
'110021': InvalidOrder, // Open Interest exceeded
'110022': InvalidOrder, // qty has been limited, cannot modify the order to add qty
'110023': InvalidOrder, // This contract only supports position reduction operation, please contact customer service for details
'110024': InvalidOrder, // You have an existing position, so position mode cannot be switched
'110025': InvalidOrder, // Position mode is not modified
'110026': InvalidOrder, // Cross/isolated margin mode is not modified
'110027': InvalidOrder, // Margin is not modified
'110028': InvalidOrder, // Open orders exist, so you cannot change position mode
'110029': InvalidOrder, // Hedge mode is not available for this symbol
'110030': InvalidOrder, // Duplicate orderId
'110031': InvalidOrder, // risk limit info does not exists
'110032': InvalidOrder, // Illegal order
'110033': InvalidOrder, // Margin cannot be set without open position
'110034': InvalidOrder, // There is no net position
'110035': InvalidOrder, // Cancel order is not completed before liquidation
'110036': InvalidOrder, // Cross margin mode is not allowed to change leverage
'110037': InvalidOrder, // User setting list does not have this symbol
'110038': InvalidOrder, // Portfolio margin mode is not allowed to change leverage
'110039': InvalidOrder, // Maintain margin rate is too high, which may trigger liquidation
'110040': InvalidOrder, // Order will trigger forced liquidation, please resubmit the order
'110041': InvalidOrder, // Skip liquidation is not allowed when a position or maker order exists
'110042': InvalidOrder, // Pre-delivery status can only reduce positions
'110043': BadRequest, // Set leverage not modified
'110044': InsufficientFunds, // Insufficient available margin
'110045': InsufficientFunds, // Insufficient wallet balance
'110046': BadRequest, // Any adjustments made will trigger immediate liquidation
'110047': BadRequest, // Risk limit cannot be adjusted due to insufficient available margin
'110048': BadRequest, // Risk limit cannot be adjusted as the current/expected position value held exceeds the revised risk limit
'110049': BadRequest, // Tick notes can only be numbers
'110050': BadRequest, // Coin is not in the range of selected
'110051': InsufficientFunds, // The user's available balance cannot cover the lowest price of the current market
'110052': InsufficientFunds, // User's available balance is insufficient to set a price
'110053': InsufficientFunds, // The user's available balance cannot cover the current market price and upper limit price
'110054': InvalidOrder, // This position has at least one take profit link order, so the take profit and stop loss mode cannot be switched
'110055': InvalidOrder, // This position has at least one stop loss link order, so the take profit and stop loss mode cannot be switched
'110056': InvalidOrder, // This position has at least one trailing stop link order, so the take profit and stop loss mode cannot be switched
'110057': InvalidOrder, // Conditional order or limit order contains TP/SL related params
'110058': InvalidOrder, // Insufficient number of remaining position size to set take profit and stop loss
'110059': InvalidOrder, // In the case of partial filled of the open order, it is not allowed to modify the take profit and stop loss settings of the open order
'110060': BadRequest, // Under full TP/SL mode, it is not allowed to modify TP/SL
'110061': BadRequest, // Under partial TP/SL mode, TP/SL set more than 20
'110062': BadRequest, // Institution MMP profile not found.
'110063': ExchangeError, // Settlement in progress! xxx not available for trades.
'110064': InvalidOrder, // The number of contracts modified cannot be less than or equal to the filled quantity
'110065': PermissionDenied, // MMP hasn't yet been enabled for your account. Please contact your BD manager.
'110066': ExchangeError, // No trading is allowed at the current time
'110067': PermissionDenied, // unified account is not support
'110068': PermissionDenied, // Leveraged user trading is not allowed
'110069': PermissionDenied, // Do not allow OTC lending users to trade
'110070': InvalidOrder, // ETP symbols are not allowed to be traded
'110071': ExchangeError, // Sorry, we're revamping the Unified Margin Account! Currently, new upgrades are not supported. If you have any questions, please contact our 24/7 customer support.
'110072': InvalidOrder, // OrderLinkedID is duplicate
'110073': ExchangeError, // Set margin mode failed
'130006': InvalidOrder, // {"ret_code":130006,"ret_msg":"The number of contracts exceeds maximum limit allowed: too large","ext_code":"","ext_info":"","result":null,"time_now":"1658397095.099030","rate_limit_status":99,"rate_limit_reset_ms":1658397095097,"rate_limit":100}
'130021': InsufficientFunds, // {"ret_code":130021,"ret_msg":"orderfix price failed for CannotAffordOrderCost.","ext_code":"","ext_info":"","result":null,"time_now":"1644588250.204878","rate_limit_status":98,"rate_limit_reset_ms":1644588250200,"rate_limit":100} | {"ret_code":130021,"ret_msg":"oc_diff[1707966351], new_oc[1707966351] with ob[....]+AB[....]","ext_code":"","ext_info":"","result":null,"time_now":"1658395300.872766","rate_limit_status":99,"rate_limit_reset_ms":1658395300855,"rate_limit":100} caused issues/9149#issuecomment-1146559498
'130074': InvalidOrder, // {"ret_code":130074,"ret_msg":"expect Rising, but trigger_price[190000000] \u003c= current[211280000]??LastPrice","ext_code":"","ext_info":"","result":null,"time_now":"1655386638.067076","rate_limit_status":97,"rate_limit_reset_ms":1655386638065,"rate_limit":100}
'131001': InsufficientFunds, // {"retCode":131001,"retMsg":"the available balance is not sufficient to cover the handling fee","result":{},"retExtInfo":{},"time":1666892821245}
'131084': ExchangeError, // Withdraw failed because of Uta Upgrading
'131200': ExchangeError, // Service error
'131201': ExchangeError, // Internal error
'131202': BadRequest, // Invalid memberId
'131203': BadRequest, // Request parameter error
'131204': BadRequest, // Account info error
'131205': BadRequest, // Query transfer error
'131206': ExchangeError, // Fail to transfer
'131207': BadRequest, // Account not exist
'131208': ExchangeError, // Forbid transfer
'131209': BadRequest, // Get subMember relation error
'131210': BadRequest, // Amount accuracy error
'131211': BadRequest, // fromAccountType can't be the same as toAccountType
'131212': InsufficientFunds, // Insufficient balance
'131213': BadRequest, // TransferLTV check error
'131214': BadRequest, // TransferId exist
'131215': BadRequest, // Amount error
'131216': ExchangeError, // Query balance error
'131217': ExchangeError, // Risk check error
'131002': BadRequest, // Parameter error
'131003': ExchangeError, // Interal error
'131004': AuthenticationError, // KYC needed
'131085': InsufficientFunds, // Withdrawal amount is greater than your availale balance (the deplayed withdrawal is triggered)
'131086': BadRequest, // Withdrawal amount exceeds risk limit (the risk limit of margin trade is triggered)
'131088': BadRequest, // The withdrawal amount exceeds the remaining withdrawal limit of your identity verification level. The current available amount for withdrawal : %s
'131089': BadRequest, // User sensitive operation, withdrawal is prohibited within 24 hours
'131090': ExchangeError, // User withdraw has been banned
'131091': ExchangeError, // Blocked login status does not allow withdrawals
'131092': ExchangeError, // User status is abnormal
'131093': ExchangeError, // The withdrawal address is not in the whitelist
'131094': BadRequest, // UserId is not in the whitelist
'131095': BadRequest, // Withdrawl amount exceeds the 24 hour platform limit
'131096': BadRequest, // Withdraw amount does not satify the lower limit or upper limit
'131097': ExchangeError, // Withdrawal of this currency has been closed
'131098': ExchangeError, // Withdrawal currently is not availble from new address
'131099': ExchangeError, // Hot wallet status can cancel the withdraw
'140003': InvalidOrder, // Order price is out of permissible range
'140004': InsufficientFunds, // Insufficient wallet balance
'140005': InvalidOrder, // position status
'140006': InsufficientFunds, // cannot afford estimated position_margin
'140007': InsufficientFunds, // Insufficient available balance
'140008': InvalidOrder, // Order has been finished or canceled
'140009': InvalidOrder, // The number of stop orders exceeds maximum limit allowed
'140010': InvalidOrder, // Order already cancelled
'140011': InvalidOrder, // Any adjustments made will trigger immediate liquidation
'140012': InsufficientFunds, // Available balance not enough
'140013': BadRequest, // Due to risk limit, cannot set leverage
'140014': InsufficientFunds, // Available balance not enough to add margin
'140015': InvalidOrder, // the position is in cross_margin
'140016': InvalidOrder, // Requested quantity of contracts exceeds risk limit, please adjust your risk limit level before trying again
'140017': InvalidOrder, // Reduce-only rule not satisfied
'140018': BadRequest, // userId illegal
'140019': InvalidOrder, // orderId illegal
'140020': InvalidOrder, // number of active orders greater than 500
'140021': InvalidOrder, // Open Interest exceeded
'140022': InvalidOrder, // qty has been limited, cannot modify the order to add qty
'140023': InvalidOrder, // This contract only supports position reduction operation, please contact customer service for details
'140024': BadRequest, // You have an existing position, so position mode cannot be switched
'140025': BadRequest, // Position mode is not modified
'140026': BadRequest, // Cross/isolated margin mode is not modified
'140027': BadRequest, // Margin is not modified
'140028': InvalidOrder, // Open orders exist, so you cannot change position mode
'140029': BadRequest, // Hedge mode is not available for this symbol
'140030': InvalidOrder, // Duplicate orderId
'140031': BadRequest, // risk limit info does not exists
'140032': InvalidOrder, // Illegal order
'140033': InvalidOrder, // Margin cannot be set without open position
'140034': InvalidOrder, // There is no net position
'140035': InvalidOrder, // Cancel order is not completed before liquidation
'140036': BadRequest, // Cross margin mode is not allowed to change leverage
'140037': InvalidOrder, // User setting list does not have this symbol
'140038': BadRequest, // Portfolio margin mode is not allowed to change leverage
'140039': BadRequest, // Maintain margin rate is too high, which may trigger liquidation
'140040': InvalidOrder, // Order will trigger forced liquidation, please resubmit the order
'140041': InvalidOrder, // Skip liquidation is not allowed when a position or maker order exists
'140042': InvalidOrder, // Pre-delivery status can only reduce positions
'140043': BadRequest, // Set leverage not modified
'140044': InsufficientFunds, // Insufficient available margin
'140045': InsufficientFunds, // Insufficient wallet balance
'140046': BadRequest, // Any adjustments made will trigger immediate liquidation
'140047': BadRequest, // Risk limit cannot be adjusted due to insufficient available margin
'140048': BadRequest, // Risk limit cannot be adjusted as the current/expected position value held exceeds the revised risk limit
'140049': BadRequest, // Tick notes can only be numbers
'140050': InvalidOrder, // Coin is not in the range of selected
'140051': InsufficientFunds, // The user's available balance cannot cover the lowest price of the current market
'140052': InsufficientFunds, // User's available balance is insufficient to set a price
'140053': InsufficientFunds, // The user's available balance cannot cover the current market price and upper limit price
'140054': InvalidOrder, // This position has at least one take profit link order, so the take profit and stop loss mode cannot be switched
'140055': InvalidOrder, // This position has at least one stop loss link order, so the take profit and stop loss mode cannot be switched
'140056': InvalidOrder, // This position has at least one trailing stop link order, so the take profit and stop loss mode cannot be switched
'140057': InvalidOrder, // Conditional order or limit order contains TP/SL related params
'140058': InvalidOrder, // Insufficient number of remaining position size to set take profit and stop loss
'140059': InvalidOrder, // In the case of partial filled of the open order, it is not allowed to modify the take profit and stop loss settings of the open order
'140060': BadRequest, // Under full TP/SL mode, it is not allowed to modify TP/SL
'140061': BadRequest, // Under partial TP/SL mode, TP/SL set more than 20
'140062': BadRequest, // Institution MMP profile not found.
'140063': ExchangeError, // Settlement in progress! xxx not available for trades.
'140064': InvalidOrder, // The number of contracts modified cannot be less than or equal to the filled quantity
'140065': PermissionDenied, // MMP hasn't yet been enabled for your account. Please contact your BD manager.
'140066': ExchangeError, // No trading is allowed at the current time
'140067': PermissionDenied, // unified account is not support
'140068': PermissionDenied, // Leveraged user trading is not allowed
'140069': PermissionDenied, // Do not allow OTC lending users to trade
'140070': InvalidOrder, // ETP symbols are not allowed to be traded
'170001': ExchangeError, // Internal error.
'170007': RequestTimeout, // Timeout waiting for response from backend server.
'170005': InvalidOrder, // Too many new orders; current limit is %s orders per %s.
'170031': ExchangeError, // The feature has been suspended
'170032': ExchangeError, // Network error. Please try again later
'170033': InsufficientFunds, // margin Insufficient account balance
'170034': InsufficientFunds, // Liability over flow in spot leverage trade!
'170035': BadRequest, // Submitted to the system for processing!
'170036': BadRequest, // You haven't enabled Cross Margin Trading yet. To do so, please head to the PC trading site or the Bybit app
'170037': BadRequest, // Cross Margin Trading not yet supported by the selected coin
'170105': BadRequest, // Parameter '%s' was empty.
'170115': InvalidOrder, // Invalid timeInForce.
'170116': InvalidOrder, // Invalid orderType.
'170117': InvalidOrder, // Invalid side.
'170121': InvalidOrder, // Invalid symbol.
'170130': BadRequest, // Data sent for paramter '%s' is not valid.
'170131': InsufficientFunds, // Balance insufficient
'170132': InvalidOrder, // Order price too high.
'170133': InvalidOrder, // Order price lower than the minimum.
'170134': InvalidOrder, // Order price decimal too long.
'170135': InvalidOrder, // Order quantity too large.
'170136': InvalidOrder, // Order quantity lower than the minimum.
'170137': InvalidOrder, // Order volume decimal too long
'170139': InvalidOrder, // Order has been filled.
'170140': InvalidOrder, // Transaction amount lower than the minimum.
'170124': InvalidOrder, // Order amount too large.
'170141': InvalidOrder, // Duplicate clientOrderId
'170142': InvalidOrder, // Order has been canceled
'170143': InvalidOrder, // Cannot be found on order book
'170144': InvalidOrder, // Order has been locked
'170145': InvalidOrder, // This order type does not support cancellation
'170146': InvalidOrder, // Order creation timeout
'170147': InvalidOrder, // Order cancellation timeout
'170148': InvalidOrder, // Market order amount decimal too long
'170149': ExchangeError, // Create order failed
'170150': ExchangeError, // Cancel order failed
'170151': InvalidOrder, // The trading pair is not open yet
'170157': InvalidOrder, // The trading pair is not available for api trading
'170159': InvalidOrder, // Market Order is not supported within the first %s minutes of newly launched pairs due to risk control.
'170190': InvalidOrder, // Cancel order has been finished
'170191': InvalidOrder, // Can not cancel order, please try again later
'170192': InvalidOrder, // Order price cannot be higher than %s .
'170193': InvalidOrder, // Buy order price cannot be higher than %s.
'170194': InvalidOrder, // Sell order price cannot be lower than %s.
'170195': InvalidOrder, // Please note that your order may not be filled
'170196': InvalidOrder, // Please note that your order may not be filled
'170197': InvalidOrder, // Your order quantity to buy is too large. The filled price may deviate significantly from the market price. Please try again
'170198': InvalidOrder, // Your order quantity to sell is too large. The filled price may deviate significantly from the market price. Please try again
'170199': InvalidOrder, // Your order quantity to buy is too large. The filled price may deviate significantly from the nav. Please try again.
'170200': InvalidOrder, // Your order quantity to sell is too large. The filled price may deviate significantly from the nav. Please try again.
'170221': BadRequest, // This coin does not exist.
'170222': RateLimitExceeded, // Too many requests in this time frame.
'170223': InsufficientFunds, // Your Spot Account with Institutional Lending triggers an alert or liquidation.
'170224': PermissionDenied, // You're not a user of the Innovation Zone.
'170226': InsufficientFunds, // Your Spot Account for Margin Trading is being liquidated.
'170227': ExchangeError, // This feature is not supported.
'170228': InvalidOrder, // The purchase amount of each order exceeds the estimated maximum purchase amount.
'170229': InvalidOrder, // The sell quantity per order exceeds the estimated maximum sell quantity.
'170234': ExchangeError, // System Error
'170210': InvalidOrder, // New order rejected.
'170213': OrderNotFound, // Order does not exist.
'170217': InvalidOrder, // Only LIMIT-MAKER order is supported for the current pair.
'170218': InvalidOrder, // The LIMIT-MAKER order is rejected due to invalid price.
'170010': InvalidOrder, // Purchase failed: Exceed the maximum position limit of leveraged tokens, the current available limit is %s USDT
'170011': InvalidOrder, // "Purchase failed: Exceed the maximum position limit of innovation tokens,
'170019': InvalidOrder, // the current available limit is replaceKey0 USDT"
'170201': PermissionDenied, // Your account has been restricted for trades. If you have any questions, please email us at [email protected]
'170202': InvalidOrder, // Invalid orderFilter parameter.
'170203': InvalidOrder, // Please enter the TP/SL price.
'170204': InvalidOrder, // trigger price cannot be higher than 110% price.
'170206': InvalidOrder, // trigger price cannot be lower than 90% of qty.
'175000': InvalidOrder, // The serialNum is already in use.
'175001': InvalidOrder, // Daily purchase limit has been exceeded. Please try again later.
'175002': InvalidOrder, // There's a large number of purchase orders. Please try again later.
'175003': InsufficientFunds, // Insufficient available balance. Please make a deposit and try again.
'175004': InvalidOrder, // Daily redemption limit has been exceeded. Please try again later.
'175005': InvalidOrder, // There's a large number of redemption orders. Please try again later.
'175006': InsufficientFunds, // Insufficient available balance. Please make a deposit and try again.
'175007': InvalidOrder, // Order not found.
'175008': InvalidOrder, // Purchase period hasn't started yet.
'175009': InvalidOrder, // Purchase amount has exceeded the upper limit.
'175010': PermissionDenied, // You haven't passed the quiz yet! To purchase and/or redeem an LT, please complete the quiz first.
'175012': InvalidOrder, // Redemption period hasn't started yet.
'175013': InvalidOrder, // Redemption amount has exceeded the upper limit.
'175014': InvalidOrder, // Purchase of the LT has been temporarily suspended.
'175015': InvalidOrder, // Redemption of the LT has been temporarily suspended.
'175016': InvalidOrder, // Invalid format. Please check the length and numeric precision.
'175017': InvalidOrder, // Failed to place order:Exceed the maximum position limit of leveraged tokens, the current available limit is XXXX USDT
'175027': ExchangeError, // Subscriptions and redemptions are temporarily unavailable while account upgrade is in progress
'176002': BadRequest, // Query user account info error
'176004': BadRequest, // Query order history start time exceeds end time
'176003': BadRequest, // Query user loan history error
'176006': BadRequest, // Repayment Failed
'176005': BadRequest, // Failed to borrow
'176008': BadRequest, // You haven't enabled Cross Margin Trading yet. To do so
'176007': BadRequest, // User not found
'176010': BadRequest, // Failed to locate the coins to borrow
'176009': BadRequest, // You haven't enabled Cross Margin Trading yet. To do so
'176012': BadRequest, // Pair not available
'176011': BadRequest, // Cross Margin Trading not yet supported by the selected coin
'176014': BadRequest, // Repeated repayment requests
'176013': BadRequest, // Cross Margin Trading not yet supported by the selected pair
'176015': InsufficientFunds, // Insufficient available balance
'176016': BadRequest, // No repayment required
'176017': BadRequest, // Repayment amount has exceeded the total liability
'176018': BadRequest, // Settlement in progress
'176019': BadRequest, // Liquidation in progress
'176020': BadRequest, // Failed to locate repayment history
'176021': BadRequest, // Repeated borrowing requests
'176022': BadRequest, // Coins to borrow not generally available yet
'176023': BadRequest, // Pair to borrow not generally available yet
'176024': BadRequest, // Invalid user status
'176025': BadRequest, // Amount to borrow cannot be lower than the min. amount to borrow (per transaction)
'176026': BadRequest, // Amount to borrow cannot be larger than the max. amount to borrow (per transaction)
'176027': BadRequest, // Amount to borrow cannot be higher than the max. amount to borrow per user
'176028': BadRequest, // Amount to borrow has exceeded Bybit's max. amount to borrow
'176029': BadRequest, // Amount to borrow has exceeded the user's estimated max. amount to borrow
'176030': BadRequest, // Query user loan info error
'176031': BadRequest, // Number of decimals has exceeded the maximum precision
'176034': BadRequest, // The leverage ratio is out of range
'176035': PermissionDenied, // Failed to close the leverage switch during liquidation
'176036': PermissionDenied, // Failed to adjust leverage switch during forced liquidation
'176037': PermissionDenied, // For non-unified transaction users, the operation failed
'176038': BadRequest, // The spot leverage is closed and the current operation is not allowed
'176039': BadRequest, // Borrowing, current operation is not allowed
'176040': BadRequest, // There is a spot leverage order, and the adjustment of the leverage switch failed!
'181000': BadRequest, // category is null
'181001': BadRequest, // category only support linear or option or spot.
'181002': InvalidOrder, // symbol is null.
'181003': InvalidOrder, // side is null.
'181004': InvalidOrder, // side only support Buy or Sell.
'182000': InvalidOrder, // symbol related quote price is null
'20001': OrderNotFound, // Order not exists
'20003': InvalidOrder, // missing parameter side
'20004': InvalidOrder, // invalid parameter side
'20005': InvalidOrder, // missing parameter symbol
'20006': InvalidOrder, // invalid parameter symbol
'20007': InvalidOrder, // missing parameter order_type
'20008': InvalidOrder, // invalid parameter order_type
'20009': InvalidOrder, // missing parameter qty
'20010': InvalidOrder, // qty must be greater than 0
'20011': InvalidOrder, // qty must be an integer
'20012': InvalidOrder, // qty must be greater than zero and less than 1 million
'20013': InvalidOrder, // missing parameter price
'20014': InvalidOrder, // price must be greater than 0
'20015': InvalidOrder, // missing parameter time_in_force
'20016': InvalidOrder, // invalid value for parameter time_in_force
'20017': InvalidOrder, // missing parameter order_id
'20018': InvalidOrder, // invalid date format
'20019': InvalidOrder, // missing parameter stop_px
'20020': InvalidOrder, // missing parameter base_price
'20021': InvalidOrder, // missing parameter stop_order_id
'20022': BadRequest, // missing parameter leverage
'20023': BadRequest, // leverage must be a number
'20031': BadRequest, // leverage must be greater than zero
'20070': BadRequest, // missing parameter margin
'20071': BadRequest, // margin must be greater than zero
'20084': BadRequest, // order_id or order_link_id is required
'30001': BadRequest, // order_link_id is repeated
'30003': InvalidOrder, // qty must be more than the minimum allowed
'30004': InvalidOrder, // qty must be less than the maximum allowed
'30005': InvalidOrder, // price exceeds maximum allowed
'30007': InvalidOrder, // price exceeds minimum allowed
'30008': InvalidOrder, // invalid order_type
'30009': ExchangeError, // no position found
'30010': InsufficientFunds, // insufficient wallet balance
'30011': PermissionDenied, // operation not allowed as position is undergoing liquidation
'30012': PermissionDenied, // operation not allowed as position is undergoing ADL
'30013': PermissionDenied, // position is in liq or adl status
'30014': InvalidOrder, // invalid closing order, qty should not greater than size
'30015': InvalidOrder, // invalid closing order, side should be opposite
'30016': ExchangeError, // TS and SL must be cancelled first while closing position
'30017': InvalidOrder, // estimated fill price cannot be lower than current Buy liq_price
'30018': InvalidOrder, // estimated fill price cannot be higher than current Sell liq_price
'30019': InvalidOrder, // cannot attach TP/SL params for non-zero position when placing non-opening position order
'30020': InvalidOrder, // position already has TP/SL params
'30021': InvalidOrder, // cannot afford estimated position_margin
'30022': InvalidOrder, // estimated buy liq_price cannot be higher than current mark_price
'30023': InvalidOrder, // estimated sell liq_price cannot be lower than current mark_price
'30024': InvalidOrder, // cannot set TP/SL/TS for zero-position
'30025': InvalidOrder, // trigger price should bigger than 10% of last price
'30026': InvalidOrder, // price too high
'30027': InvalidOrder, // price set for Take profit should be higher than Last Traded Price
'30028': InvalidOrder, // price set for Stop loss should be between Liquidation price and Last Traded Price
'30029': InvalidOrder, // price set for Stop loss should be between Last Traded Price and Liquidation price
'30030': InvalidOrder, // price set for Take profit should be lower than Last Traded Price
'30031': InsufficientFunds, // insufficient available balance for order cost
'30032': InvalidOrder, // order has been filled or cancelled
'30033': RateLimitExceeded, // The number of stop orders exceeds maximum limit allowed
'30034': OrderNotFound, // no order found
'30035': RateLimitExceeded, // too fast to cancel
'30036': ExchangeError, // the expected position value after order execution exceeds the current risk limit
'30037': InvalidOrder, // order already cancelled
'30041': ExchangeError, // no position found
'30042': InsufficientFunds, // insufficient wallet balance