forked from ccxt/ccxt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexmo.php
1596 lines (1560 loc) · 98.3 KB
/
exmo.php
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
<?php
namespace ccxt;
// 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
use Exception; // a common import
use \ccxt\ExchangeError;
use \ccxt\ArgumentsRequired;
use \ccxt\BadRequest;
use \ccxt\NotSupported;
class exmo extends Exchange {
public function describe() {
return $this->deep_extend(parent::describe (), array(
'id' => 'exmo',
'name' => 'EXMO',
'countries' => array( 'ES', 'RU' ), // Spain, Russia
'rateLimit' => 350, // once every 350 ms ≈ 180 requests per minute ≈ 3 requests per second
'version' => 'v1.1',
'has' => array(
'cancelOrder' => true,
'CORS' => false,
'createOrder' => true,
'fetchBalance' => true,
'fetchCurrencies' => true,
'fetchDepositAddress' => true,
'fetchFundingFees' => true,
'fetchMarkets' => true,
'fetchMyTrades' => true,
'fetchOHLCV' => true,
'fetchOpenOrders' => true,
'fetchOrder' => 'emulated',
'fetchOrderBook' => true,
'fetchOrderBooks' => true,
'fetchOrderTrades' => true,
'fetchTicker' => true,
'fetchTickers' => true,
'fetchTrades' => true,
'fetchTradingFee' => true,
'fetchTradingFees' => true,
'fetchTransactions' => true,
'withdraw' => true,
),
'timeframes' => array(
'1m' => '1',
'5m' => '5',
'15m' => '15',
'30m' => '30',
'45m' => '45',
'1h' => '60',
'2h' => '120',
'3h' => '180',
'4h' => '240',
'1d' => 'D',
'1w' => 'W',
'1M' => 'M',
),
'urls' => array(
'logo' => 'https://user-images.githubusercontent.com/1294454/27766491-1b0ea956-5eda-11e7-9225-40d67b481b8d.jpg',
'api' => array(
'public' => 'https://api.exmo.com',
'private' => 'https://api.exmo.com',
'web' => 'https://exmo.me',
),
'www' => 'https://exmo.me',
'referral' => 'https://exmo.me/?ref=131685',
'doc' => array(
'https://exmo.me/en/api_doc?ref=131685',
'https://github.com/exmo-dev/exmo_api_lib/tree/master/nodejs',
),
'fees' => 'https://exmo.com/en/docs/fees',
),
'api' => array(
'web' => array(
'get' => array(
'ctrl/feesAndLimits',
'en/docs/fees',
),
),
'public' => array(
'get' => array(
'currency',
'currency/list/extended',
'order_book',
'pair_settings',
'ticker',
'trades',
'candles_history',
'required_amount',
'payments/providers/crypto/list',
),
),
'private' => array(
'post' => array(
'user_info',
'order_create',
'order_cancel',
'stop_market_order_create',
'stop_market_order_cancel',
'user_open_orders',
'user_trades',
'user_cancelled_orders',
'order_trades',
'deposit_address',
'withdraw_crypt',
'withdraw_get_txid',
'excode_create',
'excode_load',
'code_check',
'wallet_history',
'wallet_operations',
),
),
),
'fees' => array(
'trading' => array(
'feeSide' => 'get',
'tierBased' => false,
'percentage' => true,
'maker' => 0.2 / 100,
'taker' => 0.2 / 100,
),
'funding' => array(
'tierBased' => false,
'percentage' => false, // fixed funding fees for crypto, see fetchFundingFees below
),
),
'options' => array(
'useWebapiForFetchingFees' => false, // TODO => figure why Exmo bans us when we try to fetch() their web urls
'feesAndLimits' => array(
'success' => 1,
'ctlr' => 'feesAndLimits',
'error' => '',
'data' => array(
'limits' => array(
array( 'pair' => 'BTC/USD', 'min_q' => '0.0001', 'max_q' => '1000', 'min_p' => '1', 'max_p' => '30000', 'min_a' => '1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTC/RUB', 'min_q' => '0.0001', 'max_q' => '1000', 'min_p' => '1', 'max_p' => '2000000', 'min_a' => '10', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTC/EUR', 'min_q' => '0.0001', 'max_q' => '1000', 'min_p' => '1', 'max_p' => '30000', 'min_a' => '1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTC/GBP', 'min_q' => '0.0001', 'max_q' => '1000', 'min_p' => '1', 'max_p' => '30000', 'min_a' => '1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTC/UAH', 'min_q' => '0.0001', 'max_q' => '1000', 'min_p' => '1', 'max_p' => '15000000', 'min_a' => '10', 'max_a' => '15000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTC/PLN', 'min_q' => '0.0001', 'max_q' => '1000', 'min_p' => '1', 'max_p' => '20000000', 'min_a' => '50', 'max_a' => '2000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTC/TRY', 'min_q' => '0.0001', 'max_q' => '1000', 'min_p' => '1', 'max_p' => '800000', 'min_a' => '40', 'max_a' => '6000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTC/KZT', 'min_q' => '0.0001', 'max_q' => '1000', 'min_p' => '1000', 'max_p' => '12000000', 'min_a' => '1000', 'max_a' => '100000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTC/USDT', 'min_q' => '0.0001', 'max_q' => '1000', 'min_p' => '0.01', 'max_p' => '30000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0', 'maker' => '0' ),
array( 'pair' => 'ETH/BTC', 'min_q' => '0.001', 'max_q' => '5000', 'min_p' => '0.00000001', 'max_p' => '10', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETH/USD', 'min_q' => '0.001', 'max_q' => '5000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETH/RUB', 'min_q' => '0.001', 'max_q' => '5000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '150', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XRP/BTC', 'min_q' => '1', 'max_q' => '5000000', 'min_p' => '0.0000001', 'max_p' => '1', 'min_a' => '0.00001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XRP/USD', 'min_q' => '1', 'max_q' => '5000000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '0.001', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XRP/RUB', 'min_q' => '1', 'max_q' => '5000000', 'min_p' => '0.000001', 'max_p' => '1000', 'min_a' => '0.01', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ADA/BTC', 'min_q' => '1', 'max_q' => '10000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ADA/ETH', 'min_q' => '0.01', 'max_q' => '10000000', 'min_p' => '0.00000001', 'max_p' => '10', 'min_a' => '0.001', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ADA/USD', 'min_q' => '0.01', 'max_q' => '10000000', 'min_p' => '0.0001', 'max_p' => '1000', 'min_a' => '0.01', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ALGO/EXM', 'min_q' => '1', 'max_q' => '1000000', 'min_p' => '0.001', 'max_p' => '10000', 'min_a' => '1', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ALGO/BTC', 'min_q' => '1', 'max_q' => '1000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.000001', 'max_a' => '50', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ALGO/USDT', 'min_q' => '1', 'max_q' => '1000000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '1', 'max_a' => '500000', 'taker' => '0', 'maker' => '0' ),
array( 'pair' => 'ALGO/RUB', 'min_q' => '1', 'max_q' => '1000000', 'min_p' => '0.000001', 'max_p' => '10000', 'min_a' => '1', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ALGO/EUR', 'min_q' => '1', 'max_q' => '1000000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ATOM/EXM', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '200', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ATOM/BTC', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ATOM/USD', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '0.5', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ATOM/EUR', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '0.5', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BCH/USD', 'min_q' => '0.003', 'max_q' => '5000', 'min_p' => '0.00000001', 'max_p' => '30000', 'min_a' => '0.0001', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BCH/RUB', 'min_q' => '0.003', 'max_q' => '5000', 'min_p' => '0.00000001', 'max_p' => '2000000', 'min_a' => '0.0001', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BCH/EUR', 'min_q' => '0.003', 'max_q' => '5000', 'min_p' => '0.01', 'max_p' => '300000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BCH/UAH', 'min_q' => '0.003', 'max_q' => '5000', 'min_p' => '0.1', 'max_p' => '30000', 'min_a' => '10', 'max_a' => '15000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BCH/BTC', 'min_q' => '0.003', 'max_q' => '5000', 'min_p' => '0.00000001', 'max_p' => '5', 'min_a' => '0.0001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BCH/ETH', 'min_q' => '0.003', 'max_q' => '5000', 'min_p' => '0.0000001', 'max_p' => '200', 'min_a' => '0.0001', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BCH/USDT', 'min_q' => '0.003', 'max_q' => '5000', 'min_p' => '0.01', 'max_p' => '5000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0', 'maker' => '0' ),
array( 'pair' => 'BTG/USD', 'min_q' => '0.01', 'max_q' => '100000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTG/BTC', 'min_q' => '0.01', 'max_q' => '100000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTG/ETH', 'min_q' => '0.01', 'max_q' => '100000', 'min_p' => '0.0001', 'max_p' => '100', 'min_a' => '0.01', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTT/RUB', 'min_q' => '1', 'max_q' => '500000000', 'min_p' => '0.000001', 'max_p' => '1000', 'min_a' => '0.000001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTT/UAH', 'min_q' => '1', 'max_q' => '500000000', 'min_p' => '0.000001', 'max_p' => '1000', 'min_a' => '0.000001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'BTT/BTC', 'min_q' => '1', 'max_q' => '500000000', 'min_p' => '0.00000001', 'max_p' => '0.1', 'min_a' => '0.00001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'CRON/BTC', 'min_q' => '1', 'max_q' => '100000', 'min_p' => '0.0000001', 'max_p' => '1', 'min_a' => '0.00001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'CRON/ETH', 'min_q' => '1', 'max_q' => '100000', 'min_p' => '0.0000001', 'max_p' => '10', 'min_a' => '0.00001', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'CRON/USDT', 'min_q' => '1', 'max_q' => '100000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '0.001', 'max_a' => '500000', 'taker' => '0', 'maker' => '0' ),
array( 'pair' => 'CRON/EXM', 'min_q' => '1', 'max_q' => '100000000', 'min_p' => '0.00000001', 'max_p' => '1000', 'min_a' => '0.01', 'max_a' => '100000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DAI/USD', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DAI/RUB', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '0.5', 'max_a' => '30000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DAI/BTC', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.0000001', 'max_p' => '0.1', 'min_a' => '0.00001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DAI/ETH', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.000001', 'max_p' => '10', 'min_a' => '0.0001', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DASH/USD', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.01', 'max_p' => '10000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DASH/RUB', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '150', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DASH/UAH', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.01', 'max_p' => '200000', 'min_a' => '10', 'max_a' => '15000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DASH/BTC', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.0001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DASH/USDT', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.01', 'max_p' => '5000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0', 'maker' => '0' ),
array( 'pair' => 'DCR/RUB', 'min_q' => '0.01', 'max_q' => '50000', 'min_p' => '0.00001', 'max_p' => '100000', 'min_a' => '0.5', 'max_a' => '3000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DCR/UAH', 'min_q' => '0.01', 'max_q' => '50000', 'min_p' => '0.00001', 'max_p' => '100000', 'min_a' => '0.25', 'max_a' => '1000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DCR/BTC', 'min_q' => '0.01', 'max_q' => '50000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DOGE/USD', 'min_q' => '100', 'max_q' => '500000000', 'min_p' => '0.0000001', 'max_p' => '1000', 'min_a' => '0.01', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'DOGE/BTC', 'min_q' => '100', 'max_q' => '500000000', 'min_p' => '0.0000001', 'max_p' => '1', 'min_a' => '0.0001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'EOS/USD', 'min_q' => '0.01', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '1000', 'min_a' => '0.5', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'EOS/EUR', 'min_q' => '0.01', 'max_q' => '500000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '0.5', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'EOS/BTC', 'min_q' => '0.01', 'max_q' => '500000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETC/USD', 'min_q' => '0.2', 'max_q' => '100000', 'min_p' => '0.01', 'max_p' => '10000', 'min_a' => '0.01', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETC/RUB', 'min_q' => '0.2', 'max_q' => '100000', 'min_p' => '0.01', 'max_p' => '10000', 'min_a' => '0.01', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETC/BTC', 'min_q' => '0.2', 'max_q' => '100000', 'min_p' => '0.0001', 'max_p' => '0.5', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETH/EUR', 'min_q' => '0.001', 'max_q' => '5000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETH/GBP', 'min_q' => '0.001', 'max_q' => '5000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETH/UAH', 'min_q' => '0.001', 'max_q' => '5000', 'min_p' => '0.01', 'max_p' => '1000000', 'min_a' => '90', 'max_a' => '15000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETH/PLN', 'min_q' => '0.001', 'max_q' => '5000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '50', 'max_a' => '2000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETH/TRY', 'min_q' => '0.001', 'max_q' => '5000', 'min_p' => '0.1', 'max_p' => '80000', 'min_a' => '10', 'max_a' => '6000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETH/KZT', 'min_q' => '0.001', 'max_q' => '5000', 'min_p' => '4', 'max_p' => '40000000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETH/USDT', 'min_q' => '0.001', 'max_q' => '5000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0', 'maker' => '0' ),
array( 'pair' => 'ETH/LTC', 'min_q' => '0.001', 'max_q' => '5000', 'min_p' => '0.00000001', 'max_p' => '100000', 'min_a' => '0.05', 'max_a' => '100000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETZ/BTC', 'min_q' => '1', 'max_q' => '50000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.0001', 'max_a' => '10', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETZ/ETH', 'min_q' => '1', 'max_q' => '50000000', 'min_p' => '0.00000001', 'max_p' => '100', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ETZ/USDT', 'min_q' => '1', 'max_q' => '50000000', 'min_p' => '0.000001', 'max_p' => '1000', 'min_a' => '0.01', 'max_a' => '1000', 'taker' => '0', 'maker' => '0' ),
array( 'pair' => 'EXM/USDT', 'min_q' => '1', 'max_q' => '100000000', 'min_p' => '0.00000001', 'max_p' => '1000', 'min_a' => '0.01', 'max_a' => '100000', 'taker' => '0', 'maker' => '0' ),
array( 'pair' => 'EXM/ETH', 'min_q' => '1', 'max_q' => '100000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.0001', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'GAS/USD', 'min_q' => '0.01', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '50000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'GAS/BTC', 'min_q' => '0.01', 'max_q' => '500000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'GNT/BTC', 'min_q' => '1', 'max_q' => '10000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'GNT/ETH', 'min_q' => '0.01', 'max_q' => '10000000', 'min_p' => '0.00000001', 'max_p' => '10', 'min_a' => '0.01', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'GUSD/USD', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.1', 'max_p' => '10', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'GUSD/RUB', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '1000', 'min_a' => '10', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'GUSD/BTC', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.0015', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'HP/BTC', 'min_q' => '1', 'max_q' => '100000000', 'min_p' => '0.00000001', 'max_p' => '0.1', 'min_a' => '0.00001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'HB/BTC', 'min_q' => '10', 'max_q' => '100000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.000001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'LSK/USD', 'min_q' => '0.1', 'max_q' => '500000', 'min_p' => '0.1', 'max_p' => '1000', 'min_a' => '1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'LSK/RUB', 'min_q' => '0.1', 'max_q' => '500000', 'min_p' => '0.001', 'max_p' => '100000', 'min_a' => '0.5', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'LSK/BTC', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.0000001', 'max_p' => '1', 'min_a' => '0.0015', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'LTC/USD', 'min_q' => '0.05', 'max_q' => '10000', 'min_p' => '0.01', 'max_p' => '10000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'LTC/RUB', 'min_q' => '0.05', 'max_q' => '10000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '150', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'LTC/EUR', 'min_q' => '0.05', 'max_q' => '10000', 'min_p' => '0.01', 'max_p' => '10000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'LTC/UAH', 'min_q' => '0.05', 'max_q' => '10000', 'min_p' => '0.01', 'max_p' => '300000', 'min_a' => '5', 'max_a' => '18000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'LTC/BTC', 'min_q' => '0.05', 'max_q' => '10000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'MKR/BTC', 'min_q' => '0.0001', 'max_q' => '1000', 'min_p' => '0.0001', 'max_p' => '100', 'min_a' => '0.000001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'MKR/DAI', 'min_q' => '0.0001', 'max_q' => '1000', 'min_p' => '0.5', 'max_p' => '500000', 'min_a' => '0.005', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'MNC/USD', 'min_q' => '10', 'max_q' => '500000000', 'min_p' => '0.000001', 'max_p' => '10000', 'min_a' => '0.01', 'max_a' => '100000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'MNC/BTC', 'min_q' => '10', 'max_q' => '500000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.000001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'MNC/ETH', 'min_q' => '10', 'max_q' => '500000000', 'min_p' => '0.0000001', 'max_p' => '10', 'min_a' => '0.00001', 'max_a' => '1000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'NEO/USD', 'min_q' => '0.01', 'max_q' => '100000', 'min_p' => '0.01', 'max_p' => '50000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'NEO/RUB', 'min_q' => '0.01', 'max_q' => '100000', 'min_p' => '0.001', 'max_p' => '1500000', 'min_a' => '50', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'NEO/BTC', 'min_q' => '0.1', 'max_q' => '100000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'OMG/USD', 'min_q' => '0.01', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '1000', 'min_a' => '0.5', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'OMG/BTC', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'OMG/ETH', 'min_q' => '0.01', 'max_q' => '500000', 'min_p' => '0.00000001', 'max_p' => '10', 'min_a' => '0.01', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ONG/EXM', 'min_q' => '1', 'max_q' => '1000000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '100', 'max_a' => '15000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ONG/BTC', 'min_q' => '1', 'max_q' => '1000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.00001', 'max_a' => '10', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ONG/RUB', 'min_q' => '1', 'max_q' => '1000000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '100', 'max_a' => '250000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ONG/UAH', 'min_q' => '1', 'max_q' => '1000000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '50', 'max_a' => '6000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ONT/EXM', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '200', 'max_a' => '15000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ONT/BTC', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.00001', 'max_a' => '10', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ONT/RUB', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '100', 'max_a' => '6000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ONT/UAH', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '100000', 'min_a' => '200', 'max_a' => '250000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'PTI/RUB', 'min_q' => '1', 'max_q' => '50000000', 'min_p' => '0.00000001', 'max_p' => '600000', 'min_a' => '10', 'max_a' => '600000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'PTI/BTC', 'min_q' => '1', 'max_q' => '50000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.000001', 'max_a' => '10', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'PTI/EOS', 'min_q' => '1', 'max_q' => '50000000', 'min_p' => '0.0000001', 'max_p' => '5000', 'min_a' => '0.01', 'max_a' => '20000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'PTI/USDT', 'min_q' => '1', 'max_q' => '50000000', 'min_p' => '0.000001', 'max_p' => '10000', 'min_a' => '0.01', 'max_a' => '100000', 'taker' => '0', 'maker' => '0' ),
array( 'pair' => 'QTUM/USD', 'min_q' => '0.1', 'max_q' => '500000', 'min_p' => '0.00000001', 'max_p' => '10000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'QTUM/BTC', 'min_q' => '0.1', 'max_q' => '500000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.0001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'QTUM/ETH', 'min_q' => '0.1', 'max_q' => '500000', 'min_p' => '0.00000001', 'max_p' => '100', 'min_a' => '0.001', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ROOBEE/BTC', 'min_q' => '1', 'max_q' => '10000000', 'min_p' => '0.00000001', 'max_p' => '0.1', 'min_a' => '0.00001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'SMART/USD', 'min_q' => '10', 'max_q' => '100000000', 'min_p' => '0.000001', 'max_p' => '1000', 'min_a' => '1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'SMART/RUB', 'min_q' => '10', 'max_q' => '100000000', 'min_p' => '0.0001', 'max_p' => '100000', 'min_a' => '10', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'SMART/EUR', 'min_q' => '10', 'max_q' => '100000000', 'min_p' => '0.000001', 'max_p' => '1000', 'min_a' => '1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'SMART/BTC', 'min_q' => '10', 'max_q' => '100000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.00001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'TRX/USD', 'min_q' => '1', 'max_q' => '50000000', 'min_p' => '0.0001', 'max_p' => '1000', 'min_a' => '0.01', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'TRX/EUR', 'min_q' => '0.01', 'max_q' => '50000000', 'min_p' => '0.0001', 'max_p' => '1000', 'min_a' => '0.01', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'TRX/RUB', 'min_q' => '1', 'max_q' => '50000000', 'min_p' => '0.000001', 'max_p' => '100000', 'min_a' => '0.1', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'TRX/UAH', 'min_q' => '1', 'max_q' => '50000000', 'min_p' => '0.000001', 'max_p' => '100000', 'min_a' => '0.1', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'TRX/BTC', 'min_q' => '1', 'max_q' => '50000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'USDC/USD', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.0001', 'max_p' => '1000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'USDC/BTC', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.0001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'USDC/ETH', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.0000001', 'max_p' => '100', 'min_a' => '0.001', 'max_a' => '1000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'USDC/USDT', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.0001', 'max_p' => '1000', 'min_a' => '3', 'max_a' => '500000', 'taker' => '0', 'maker' => '0' ),
array( 'pair' => 'USDT/USD', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.5', 'max_p' => '10', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'USDT/RUB', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '1000', 'min_a' => '10', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'USDT/EUR', 'min_q' => '0.01', 'max_q' => '500000', 'min_p' => '0.1', 'max_p' => '10', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'USDT/GBP', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.5', 'max_p' => '10', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'USDT/UAH', 'min_q' => '0.01', 'max_q' => '500000', 'min_p' => '1', 'max_p' => '3000', 'min_a' => '2', 'max_a' => '15000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'USDT/KZT', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '200', 'max_p' => '4000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'VLX/BTC', 'min_q' => '1', 'max_q' => '10000000', 'min_p' => '0.00000001', 'max_p' => '0.1', 'min_a' => '0.00001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'WAVES/USD', 'min_q' => '0.5', 'max_q' => '500000', 'min_p' => '0.001', 'max_p' => '3500', 'min_a' => '0.5', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'WAVES/RUB', 'min_q' => '0.5', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '10000', 'min_a' => '1', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'WAVES/BTC', 'min_q' => '0.5', 'max_q' => '500000', 'min_p' => '0.000001', 'max_p' => '1', 'min_a' => '0.0001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'WAVES/ETH', 'min_q' => '0.5', 'max_q' => '500000', 'min_p' => '0.00001', 'max_p' => '30', 'min_a' => '0.0035', 'max_a' => '3500', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XEM/USD', 'min_q' => '10', 'max_q' => '10000000', 'min_p' => '0.00001', 'max_p' => '1000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XEM/EUR', 'min_q' => '10', 'max_q' => '10000000', 'min_p' => '0.00001', 'max_p' => '1000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XEM/UAH', 'min_q' => '1', 'max_q' => '10000000', 'min_p' => '0.0001', 'max_p' => '30000', 'min_a' => '10', 'max_a' => '15000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XEM/BTC', 'min_q' => '10', 'max_q' => '10000000', 'min_p' => '0.0000001', 'max_p' => '1', 'min_a' => '0.00015', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XLM/USD', 'min_q' => '0.01', 'max_q' => '5000000', 'min_p' => '0.0001', 'max_p' => '1000', 'min_a' => '0.01', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XLM/RUB', 'min_q' => '0.01', 'max_q' => '5000000', 'min_p' => '0.00001', 'max_p' => '100000', 'min_a' => '0.1', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XLM/TRY', 'min_q' => '0.01', 'max_q' => '5000000', 'min_p' => '0.00001', 'max_p' => '100000', 'min_a' => '0.1', 'max_a' => '6000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XLM/BTC', 'min_q' => '1', 'max_q' => '5000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XMR/USD', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XMR/RUB', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.001', 'max_p' => '600000', 'min_a' => '10', 'max_a' => '16000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XMR/EUR', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XMR/UAH', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.001', 'max_p' => '300000', 'min_a' => '5', 'max_a' => '16000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XMR/BTC', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.0001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XMR/ETH', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.00000001', 'max_p' => '100', 'min_a' => '0.001', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XRP/EUR', 'min_q' => '1', 'max_q' => '5000000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '0.001', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XRP/GBP', 'min_q' => '1', 'max_q' => '5000000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '0.001', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XRP/TRY', 'min_q' => '1', 'max_q' => '5000000', 'min_p' => '0.0001', 'max_p' => '1000', 'min_a' => '0.01', 'max_a' => '6000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XRP/UAH', 'min_q' => '1', 'max_q' => '5000000', 'min_p' => '0.0001', 'max_p' => '1000', 'min_a' => '0.01', 'max_a' => '15000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XRP/USDT', 'min_q' => '1', 'max_q' => '5000000', 'min_p' => '0.001', 'max_p' => '1000', 'min_a' => '0.001', 'max_a' => '500000', 'taker' => '0', 'maker' => '0' ),
array( 'pair' => 'XRP/ETH', 'min_q' => '1', 'max_q' => '5000000', 'min_p' => '0.00000001', 'max_p' => '10', 'min_a' => '0.00001', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XTZ/USD', 'min_q' => '0.1', 'max_q' => '100000', 'min_p' => '0.0001', 'max_p' => '1000', 'min_a' => '0.1', 'max_a' => '100000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XTZ/RUB', 'min_q' => '0.1', 'max_q' => '100000', 'min_p' => '0.00001', 'max_p' => '100000', 'min_a' => '0.5', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XTZ/BTC', 'min_q' => '0.1', 'max_q' => '100000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.00001', 'max_a' => '10', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'XTZ/ETH', 'min_q' => '0.1', 'max_q' => '100000', 'min_p' => '0.0000001', 'max_p' => '10', 'min_a' => '0.0001', 'max_a' => '1000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ZEC/USD', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.001', 'max_p' => '5000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ZEC/RUB', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.001', 'max_p' => '100000', 'min_a' => '0.1', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ZEC/EUR', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.001', 'max_p' => '5000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ZEC/BTC', 'min_q' => '0.01', 'max_q' => '10000', 'min_p' => '0.00001', 'max_p' => '10', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ZRX/USD', 'min_q' => '0.01', 'max_q' => '10000000', 'min_p' => '0.00001', 'max_p' => '1000', 'min_a' => '0.1', 'max_a' => '500000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ZRX/BTC', 'min_q' => '1', 'max_q' => '10000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ZRX/ETH', 'min_q' => '0.01', 'max_q' => '10000000', 'min_p' => '0.00000001', 'max_p' => '10', 'min_a' => '0.01', 'max_a' => '5000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'ZAG/BTC', 'min_q' => '1', 'max_q' => '10000000', 'min_p' => '0.00000001', 'max_p' => '0.1', 'min_a' => '0.00001', 'max_a' => '100', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'USD/RUB', 'min_q' => '1', 'max_q' => '500000', 'min_p' => '0.01', 'max_p' => '1000', 'min_a' => '10', 'max_a' => '50000000', 'taker' => '0.4', 'maker' => '0.4' ),
array( 'pair' => 'EXM/BTC', 'min_q' => '1', 'max_q' => '100000000', 'min_p' => '0.00000001', 'max_p' => '1', 'min_a' => '0.0000001', 'max_a' => '1', 'taker' => '0.4', 'maker' => '0.4' ),
),
'fees' => array(
array(
'group' => 'crypto',
'title' => 'Cryptocurrency',
'items' => array(
array( 'prov' => 'EXM', 'dep' => '0%', 'wd' => '1 EXM' ),
array( 'prov' => 'BTC', 'dep' => '0%', 'wd' => '0.0004 BTC' ),
array( 'prov' => 'LTC', 'dep' => '0%', 'wd' => '0.01 LTC' ),
array( 'prov' => 'DOGE', 'dep' => '0%', 'wd' => '1 Doge' ),
array( 'prov' => 'DASH', 'dep' => '0%', 'wd' => '0.002 DASH' ),
array( 'prov' => 'ETH', 'dep' => '0%', 'wd' => '0.003 ETH' ),
array( 'prov' => 'WAVES', 'dep' => '0%', 'wd' => '0.001 WAVES' ),
array( 'prov' => 'ZEC', 'dep' => '0%', 'wd' => '0.001 ZEC' ),
array( 'prov' => 'USDT', 'dep' => '0%', 'wd' => '' ),
array( 'prov' => 'XMR', 'dep' => '0%', 'wd' => '0.001 XMR' ),
array( 'prov' => 'XRP', 'dep' => '0%', 'wd' => '0.02 XRP' ),
array( 'prov' => 'ETC', 'dep' => '0%', 'wd' => '0.01 ETC' ),
array( 'prov' => 'BCH', 'dep' => '0%', 'wd' => '0.001 BCH' ),
array( 'prov' => 'BTG', 'dep' => '0%', 'wd' => '0.001 BTG' ),
array( 'prov' => 'EOS', 'dep' => '0%', 'wd' => '0.05 EOS' ),
array( 'prov' => 'XLM', 'dep' => '0%', 'wd' => '0.01 XLM' ),
array( 'prov' => 'OMG', 'dep' => '0.1 OMG', 'wd' => '0.5 OMG' ),
array( 'prov' => 'TRX', 'dep' => '0%', 'wd' => '1 TRX' ),
array( 'prov' => 'ADA', 'dep' => '0%', 'wd' => '1 ADA' ),
array( 'prov' => 'NEO', 'dep' => '0%', 'wd' => '0%' ),
array( 'prov' => 'GAS', 'dep' => '0%', 'wd' => '0%' ),
array( 'prov' => 'ZRX', 'dep' => '0%', 'wd' => '1 ZRX' ),
array( 'prov' => 'GNT', 'dep' => '0%', 'wd' => '1 GNT' ),
array( 'prov' => 'GUSD', 'dep' => '0%', 'wd' => '0.5 GUSD' ),
array( 'prov' => 'LSK', 'dep' => '0%', 'wd' => '0.1 LSK' ),
array( 'prov' => 'XEM', 'dep' => '0%', 'wd' => '5 XEM' ),
array( 'prov' => 'SMART', 'dep' => '0%', 'wd' => '0.5 SMART' ),
array( 'prov' => 'QTUM', 'dep' => '0%', 'wd' => '0.01 QTUM' ),
array( 'prov' => 'HB', 'dep' => '0%', 'wd' => '10 HB' ),
array( 'prov' => 'DAI', 'dep' => '0%', 'wd' => '1 DAI' ),
array( 'prov' => 'MKR', 'dep' => '0%', 'wd' => '0.005 MKR' ),
array( 'prov' => 'MNC', 'dep' => '0%', 'wd' => '15 MNC' ),
array( 'prov' => 'PTI', 'dep' => '-', 'wd' => '10 PTI' ),
array( 'prov' => 'ETZ', 'dep' => '0%', 'wd' => '1 ETZ' ),
array( 'prov' => 'USDC', 'dep' => '0%', 'wd' => '0.5 USDC' ),
array( 'prov' => 'ROOBEE', 'dep' => '0%', 'wd' => '200 ROOBEE' ),
array( 'prov' => 'DCR', 'dep' => '0%', 'wd' => '0.01 DCR' ),
array( 'prov' => 'ZAG', 'dep' => '0%', 'wd' => '0%' ),
array( 'prov' => 'BTT', 'dep' => '0 BTT', 'wd' => '100 BTT' ),
array( 'prov' => 'VLX', 'dep' => '0%', 'wd' => '1 VLX' ),
array( 'prov' => 'CRON', 'dep' => '0%', 'wd' => '5 CRON' ),
array( 'prov' => 'ONT', 'dep' => '0%', 'wd' => '1 ONT' ),
array( 'prov' => 'ONG', 'dep' => '0%', 'wd' => '5 ONG' ),
array( 'prov' => 'ALGO', 'dep' => '0%', 'wd' => '0.01 ALGO' ),
array( 'prov' => 'ATOM', 'dep' => '0%', 'wd' => '0.05 ATOM' ),
),
),
array(
'group' => 'usd',
'title' => 'USD',
'items' => array(
array( 'prov' => 'Payeer', 'dep' => '3.95%', 'wd' => '-' ),
array( 'prov' => 'EX-CODE', 'dep' => '', 'wd' => '0.2%' ),
array( 'prov' => 'AdvCash', 'dep' => '0%', 'wd' => '2.49%' ),
array( 'prov' => 'Visa/MasterCard (Simplex)', 'dep' => '4.5% + 0.5 USD', 'wd' => '-' ),
array( 'prov' => 'Visa', 'dep' => '3.45%', 'wd' => '-' ),
array( 'prov' => 'Frick Bank', 'dep' => '0 USD', 'wd' => '-' ),
),
),
array(
'group' => 'eur',
'title' => 'EUR',
'items' => array(
array( 'prov' => 'Visa/MasterCard', 'dep' => '4.5% + 0.5 EUR', 'wd' => '-' ),
array( 'prov' => 'EX-CODE', 'dep' => '', 'wd' => '0.2%' ),
array( 'prov' => 'Visa', 'dep' => '2.95%', 'wd' => '-' ),
array( 'prov' => 'Frick Internal Transfer', 'dep' => '0 EUR', 'wd' => '-' ),
array( 'prov' => 'SEPA Frick Bank', 'dep' => '0 EUR', 'wd' => '1 EUR' ),
array( 'prov' => 'WIRE Frick Bank', 'dep' => '0%', 'wd' => '20 EUR' ),
array( 'prov' => 'SEPA Weg Ag', 'dep' => '-', 'wd' => '1 EUR' ),
),
),
array(
'group' => 'gbp',
'title' => 'GBP',
'items' => array(
array( 'prov' => 'EX-CODE', 'dep' => '', 'wd' => '0.2%' ),
array( 'prov' => 'WIRE Frick Bank', 'dep' => '10 GBP', 'wd' => '-' ),
),
),
array(
'group' => 'rub',
'title' => 'RUB',
'items' => array(
array( 'prov' => 'Payeer', 'dep' => '2.49%', 'wd' => '3.49%' ),
array( 'prov' => 'EX-CODE', 'dep' => '', 'wd' => '0.2%' ),
array( 'prov' => 'Qiwi', 'dep' => '1.49%', 'wd' => '2.49%' ),
array( 'prov' => 'Yandex Money', 'dep' => '1.49%', 'wd' => '1.95 %' ),
array( 'prov' => 'AdvCash', 'dep' => '0.99%', 'wd' => '0.99%' ),
array( 'prov' => 'Visa/MasterCard', 'dep' => '2.99%', 'wd' => '3.99% + 60 RUB' ),
),
),
array(
'group' => 'pln',
'title' => 'PLN',
'items' => array(
array( 'prov' => 'EX-CODE', 'dep' => '', 'wd' => '0.2%' ),
),
),
array(
'group' => 'try',
'title' => 'TRY',
'items' => array(
array( 'prov' => 'EX-CODE', 'dep' => '', 'wd' => '0.2%' ),
array( 'prov' => 'Visa', 'dep' => '3.05%', 'wd' => '-' ),
array( 'prov' => 'Visa/MasterCard (Simplex)', 'dep' => '4.5% + 2 TRY', 'wd' => '-' ),
array( 'prov' => 'AdvCash', 'dep' => '0%', 'wd' => '-' ),
),
),
array(
'group' => 'uah',
'title' => 'UAH',
'items' => array(
array( 'prov' => 'EX-CODE', 'dep' => '', 'wd' => '0.2%' ),
array( 'prov' => 'Terminal', 'dep' => '2.6%', 'wd' => '-' ),
array( 'prov' => 'Visa/MasterCard EasyTransfer', 'dep' => '-', 'wd' => '2.99%' ),
array( 'prov' => 'Visa/MasterCard', 'dep' => '1% + 5 UAH', 'wd' => '-' ),
),
),
array(
'group' => 'kzt',
'title' => 'KZT',
'items' => array(
array( 'prov' => 'Visa/MasterCard', 'dep' => '3.5%', 'wd' => '2.99% + 450 KZT' ),
array( 'prov' => 'EX-CODE', 'dep' => '', 'wd' => '0.2%' ),
array( 'prov' => 'AdvCash', 'dep' => '0%', 'wd' => '-' ),
),
),
),
),
),
),
'exceptions' => array(
'exact' => array(
'40005' => '\\ccxt\\AuthenticationError', // Authorization error, incorrect signature
'40009' => '\\ccxt\\InvalidNonce', //
'40015' => '\\ccxt\\ExchangeError', // API function do not exist
'40016' => '\\ccxt\\OnMaintenance', // array("result":false,"error":"Error 40016 => Maintenance work in progress")
'40017' => '\\ccxt\\AuthenticationError', // Wrong API Key
'40032' => '\\ccxt\\PermissionDenied', // array("result":false,"error":"Error 40032 => Access is denied for this API key")
'40034' => '\\ccxt\\RateLimitExceeded', // array("result":false,"error":"Error 40034 => Access is denied, rate limit is exceeded")
'50052' => '\\ccxt\\InsufficientFunds',
'50054' => '\\ccxt\\InsufficientFunds',
'50304' => '\\ccxt\\OrderNotFound', // "Order was not found '123456789'" (fetching order trades for an order that does not have trades yet)
'50173' => '\\ccxt\\OrderNotFound', // "Order with id X was not found." (cancelling non-existent, closed and cancelled order)
'50277' => '\\ccxt\\InvalidOrder',
'50319' => '\\ccxt\\InvalidOrder', // Price by order is less than permissible minimum for this pair
'50321' => '\\ccxt\\InvalidOrder', // Price by order is more than permissible maximum for this pair
),
'broad' => array(
'range period is too long' => '\\ccxt\\BadRequest',
'invalid syntax' => '\\ccxt\\BadRequest',
'API rate limit exceeded' => '\\ccxt\\RateLimitExceeded', // array("result":false,"error":"API rate limit exceeded for 99.33.55.224. Retry after 60 sec.","history":array(),"begin":1579392000,"end":1579478400)
),
),
'orders' => array(), // orders cache / emulation
));
}
public function fetch_trading_fees($params = array ()) {
if ($this->options['useWebapiForFetchingFees']) {
$response = $this->webGetEnDocsFees ($params);
$parts = explode('<td class="th_fees_2" colspan="2">', $response);
$numParts = is_array($parts) ? count($parts) : 0;
if ($numParts !== 2) {
throw new NotSupported($this->id . ' fetchTradingFees format has changed');
}
$rest = $parts[1];
$parts = explode('</td>', $rest);
$numParts = is_array($parts) ? count($parts) : 0;
if ($numParts < 2) {
throw new NotSupported($this->id . ' fetchTradingFees format has changed');
}
$fee = floatval(str_replace('%', '', $parts[0])) * 0.01;
$taker = $fee;
$maker = $fee;
return array(
// 'info' => $response,
'maker' => $maker,
'taker' => $taker,
);
} else {
return array(
'maker' => $this->fees['trading']['maker'],
'taker' => $this->fees['trading']['taker'],
);
}
}
public function parse_fixed_float_value($input) {
if (($input === null) || ($input === '-')) {
return null;
}
if ($input === '') {
return 0;
}
$isPercentage = (mb_strpos($input, '%') !== false);
$parts = explode(' ', $input);
$value = str_replace('%', '', $parts[0]);
$result = floatval($value);
if (($result > 0) && $isPercentage) {
throw new ExchangeError($this->id . ' parseFixedFloatValue detected an unsupported non-zero percentage-based fee ' . $input);
}
return $result;
}
public function fetch_funding_fees($params = array ()) {
$response = null;
if ($this->options['useWebapiForFetchingFees']) {
$response = $this->webGetCtrlFeesAndLimits ($params);
} else {
$response = $this->options['feesAndLimits'];
}
// the $code below assumes all non-zero crypto fees are fixed (for now)
$withdraw = array();
$deposit = array();
$groups = $this->safe_value($response['data'], 'fees');
$groupsByGroup = $this->index_by($groups, 'group');
$items = $groupsByGroup['crypto']['items'];
for ($i = 0; $i < count($items); $i++) {
$item = $items[$i];
$code = $this->safe_currency_code($this->safe_string($item, 'prov'));
$withdrawalFee = $this->safe_string($item, 'wd');
$depositFee = $this->safe_string($item, 'dep');
if ($withdrawalFee !== null) {
$withdraw[$code] = $this->parse_fixed_float_value($withdrawalFee);
}
if ($depositFee !== null) {
$deposit[$code] = $this->parse_fixed_float_value($depositFee);
}
}
// sets fiat fees to null
$fiatGroups = $this->to_array($this->omit($groupsByGroup, 'crypto'));
for ($i = 0; $i < count($fiatGroups); $i++) {
$code = $this->safe_currency_code($this->safe_string($fiatGroups[$i], 'title'));
$withdraw[$code] = null;
$deposit[$code] = null;
}
$result = array(
'info' => $response,
'withdraw' => $withdraw,
'deposit' => $deposit,
);
// cache them for later use
$this->options['fundingFees'] = $result;
return $result;
}
public function fetch_currencies($params = array ()) {
$fees = $this->fetch_funding_fees($params);
// todo redesign the 'fee' property in currencies
$ids = is_array($fees['withdraw']) ? array_keys($fees['withdraw']) : array();
$limitsByMarketId = $this->index_by($fees['info']['data']['limits'], 'pair');
$marketIds = is_array($limitsByMarketId) ? array_keys($limitsByMarketId) : array();
$minAmounts = array();
$minPrices = array();
$minCosts = array();
$maxAmounts = array();
$maxPrices = array();
$maxCosts = array();
for ($i = 0; $i < count($marketIds); $i++) {
$marketId = $marketIds[$i];
$limit = $limitsByMarketId[$marketId];
list($baseId, $quoteId) = explode('/', $marketId);
$base = $this->safe_currency_code($baseId);
$quote = $this->safe_currency_code($quoteId);
$maxAmount = $this->safe_number($limit, 'max_q');
$maxPrice = $this->safe_number($limit, 'max_p');
$maxCost = $this->safe_number($limit, 'max_a');
$minAmount = $this->safe_number($limit, 'min_q');
$minPrice = $this->safe_number($limit, 'min_p');
$minCost = $this->safe_number($limit, 'min_a');
$minAmounts[$base] = min ($this->safe_number($minAmounts, $base, $minAmount), $minAmount);
$maxAmounts[$base] = max ($this->safe_number($maxAmounts, $base, $maxAmount), $maxAmount);
$minPrices[$quote] = min ($this->safe_number($minPrices, $quote, $minPrice), $minPrice);
$minCosts[$quote] = min ($this->safe_number($minCosts, $quote, $minCost), $minCost);
$maxPrices[$quote] = max ($this->safe_number($maxPrices, $quote, $maxPrice), $maxPrice);
$maxCosts[$quote] = max ($this->safe_number($maxCosts, $quote, $maxCost), $maxCost);
}
$result = array();
for ($i = 0; $i < count($ids); $i++) {
$id = $ids[$i];
$code = $this->safe_currency_code($id);
$fee = $this->safe_value($fees['withdraw'], $code);
$active = true;
$result[$code] = array(
'id' => $id,
'code' => $code,
'name' => $code,
'active' => $active,
'fee' => $fee,
'precision' => 8,
'limits' => array(
'amount' => array(
'min' => $this->safe_number($minAmounts, $code),
'max' => $this->safe_number($maxAmounts, $code),
),
'price' => array(
'min' => $this->safe_number($minPrices, $code),
'max' => $this->safe_number($maxPrices, $code),
),
'cost' => array(
'min' => $this->safe_number($minCosts, $code),
'max' => $this->safe_number($maxCosts, $code),
),
),
'info' => $id,
);
}
return $result;
}
public function fetch_markets($params = array ()) {
$response = $this->publicGetPairSettings ($params);
//
// {
// "BTC_USD":array(
// "min_quantity":"0.0001",
// "max_quantity":"1000",
// "min_price":"1",
// "max_price":"30000",
// "max_amount":"500000",
// "min_amount":"1",
// "price_precision":8,
// "commission_taker_percent":"0.4",
// "commission_maker_percent":"0.4"
// ),
// }
//
$keys = is_array($response) ? array_keys($response) : array();
$result = array();
for ($i = 0; $i < count($keys); $i++) {
$id = $keys[$i];
$market = $response[$id];
$symbol = str_replace('_', '/', $id);
list($baseId, $quoteId) = explode('/', $symbol);
$base = $this->safe_currency_code($baseId);
$quote = $this->safe_currency_code($quoteId);
$takerString = $this->safe_string($market, 'commission_taker_percent');
$makerString = $this->safe_string($market, 'commission_maker_percent');
$taker = $this->parse_number(Precise::string_div($takerString, '100'));
$maker = $this->parse_number(Precise::string_div($makerString, '100'));
$result[] = array(
'id' => $id,
'symbol' => $symbol,
'base' => $base,
'quote' => $quote,
'baseId' => $baseId,
'quoteId' => $quoteId,
'active' => true,
'taker' => $taker,
'maker' => $maker,
'limits' => array(
'amount' => array(
'min' => $this->safe_number($market, 'min_quantity'),
'max' => $this->safe_number($market, 'max_quantity'),
),
'price' => array(
'min' => $this->safe_number($market, 'min_price'),
'max' => $this->safe_number($market, 'max_price'),
),
'cost' => array(
'min' => $this->safe_number($market, 'min_amount'),
'max' => $this->safe_number($market, 'max_amount'),
),
),
'precision' => array(
'amount' => 8,
'price' => $this->safe_integer($market, 'price_precision'),
),
'info' => $market,
);
}
return $result;
}
public function fetch_ohlcv($symbol, $timeframe = '1m', $since = null, $limit = null, $params = array ()) {
$this->load_markets();
$market = $this->market($symbol);
$request = array(
'symbol' => $market['id'],
'resolution' => $this->timeframes[$timeframe],
);
$options = $this->safe_value($this->options, 'fetchOHLCV');
$maxLimit = $this->safe_integer($options, 'maxLimit', 3000);
$duration = $this->parse_timeframe($timeframe);
$now = $this->milliseconds();
if ($since === null) {
if ($limit === null) {
throw new ArgumentsRequired($this->id . ' fetchOHLCV() requires a $since argument or a $limit argument');
} else {
if ($limit > $maxLimit) {
throw new BadRequest($this->id . ' fetchOHLCV will serve ' . (string) $maxLimit . ' $candles at most');
}
$request['from'] = intval($now / 1000) - $limit * $duration - 1;
$request['to'] = intval($now / 1000);
}
} else {
$request['from'] = intval($since / 1000) - 1;
if ($limit === null) {
$request['to'] = intval($now / 1000);
} else {
if ($limit > $maxLimit) {
throw new BadRequest($this->id . ' fetchOHLCV will serve ' . (string) $maxLimit . ' $candles at most');
}
$to = $this->sum($since, $limit * $duration * 1000);
$request['to'] = intval($to / 1000);
}
}
$response = $this->publicGetCandlesHistory (array_merge($request, $params));
//
// {
// "$candles":array(
// array("t":1584057600000,"o":0.02235144,"c":0.02400233,"h":0.025171,"l":0.02221,"v":5988.34031761),
// array("t":1584144000000,"o":0.0240373,"c":0.02367413,"h":0.024399,"l":0.0235,"v":2027.82522329),
// array("t":1584230400000,"o":0.02363458,"c":0.02319242,"h":0.0237948,"l":0.02223196,"v":1707.96944997),
// )
// }
//
$candles = $this->safe_value($response, 'candles', array());
return $this->parse_ohlcvs($candles, $market, $timeframe, $since, $limit);
}
public function parse_ohlcv($ohlcv, $market = null) {
//
// {
// "t":1584057600000,
// "o":0.02235144,
// "c":0.02400233,
// "h":0.025171,
// "l":0.02221,
// "v":5988.34031761
// }
//
return array(
$this->safe_integer($ohlcv, 't'),
$this->safe_number($ohlcv, 'o'),
$this->safe_number($ohlcv, 'h'),
$this->safe_number($ohlcv, 'l'),
$this->safe_number($ohlcv, 'c'),
$this->safe_number($ohlcv, 'v'),
);
}
public function fetch_balance($params = array ()) {
$this->load_markets();
$response = $this->privatePostUserInfo ($params);
$result = array( 'info' => $response );
$free = $this->safe_value($response, 'balances', array());
$used = $this->safe_value($response, 'reserved', array());
$codes = is_array($free) ? array_keys($free) : array();
for ($i = 0; $i < count($codes); $i++) {
$code = $codes[$i];
$currencyId = $this->currency_id($code);
$account = $this->account();
if (is_array($free) && array_key_exists($currencyId, $free)) {
$account['free'] = $this->safe_string($free, $currencyId);
}
if (is_array($used) && array_key_exists($currencyId, $used)) {
$account['used'] = $this->safe_string($used, $currencyId);
}
$result[$code] = $account;
}
return $this->parse_balance($result, false);
}
public function fetch_order_book($symbol, $limit = null, $params = array ()) {
$this->load_markets();
$market = $this->market($symbol);
$request = array(
'pair' => $market['id'],
);
if ($limit !== null) {
$request['limit'] = $limit;
}
$response = $this->publicGetOrderBook (array_merge($request, $params));
$result = $this->safe_value($response, $market['id']);
return $this->parse_order_book($result, $symbol, null, 'bid', 'ask');
}
public function fetch_order_books($symbols = null, $limit = null, $params = array ()) {
$this->load_markets();
$ids = null;
if ($symbols === null) {
$ids = implode(',', $this->ids);
// max URL length is 2083 $symbols, including http schema, hostname, tld, etc...
if (strlen($ids) > 2048) {
$numIds = is_array($this->ids) ? count($this->ids) : 0;
throw new ExchangeError($this->id . ' has ' . (string) $numIds . ' $symbols exceeding max URL length, you are required to specify a list of $symbols in the first argument to fetchOrderBooks');
}
} else {
$ids = $this->market_ids($symbols);
$ids = implode(',', $ids);
}
$request = array(
'pair' => $ids,
);
if ($limit !== null) {
$request['limit'] = $limit;
}
$response = $this->publicGetOrderBook (array_merge($request, $params));
$result = array();
$marketIds = is_array($response) ? array_keys($response) : array();
for ($i = 0; $i < count($marketIds); $i++) {
$marketId = $marketIds[$i];
$symbol = $marketId;
if (is_array($this->markets_by_id) && array_key_exists($marketId, $this->markets_by_id)) {
$market = $this->markets_by_id[$marketId];
$symbol = $market['symbol'];
}
$result[$symbol] = $this->parse_order_book($response[$marketId], null, 'bid', 'ask');
}
return $result;
}
public function parse_ticker($ticker, $market = null) {
$timestamp = $this->safe_timestamp($ticker, 'updated');
$symbol = null;
if ($market !== null) {
$symbol = $market['symbol'];
}
$last = $this->safe_number($ticker, 'last_trade');
return array(
'symbol' => $symbol,
'timestamp' => $timestamp,
'datetime' => $this->iso8601($timestamp),
'high' => $this->safe_number($ticker, 'high'),
'low' => $this->safe_number($ticker, 'low'),
'bid' => $this->safe_number($ticker, 'buy_price'),
'bidVolume' => null,
'ask' => $this->safe_number($ticker, 'sell_price'),
'askVolume' => null,
'vwap' => null,
'open' => null,
'close' => $last,
'last' => $last,
'previousClose' => null,
'change' => null,
'percentage' => null,
'average' => $this->safe_number($ticker, 'avg'),
'baseVolume' => $this->safe_number($ticker, 'vol'),
'quoteVolume' => $this->safe_number($ticker, 'vol_curr'),
'info' => $ticker,
);
}
public function fetch_tickers($symbols = null, $params = array ()) {
$this->load_markets();
$response = $this->publicGetTicker ($params);
$result = array();
$ids = is_array($response) ? array_keys($response) : array();
for ($i = 0; $i < count($ids); $i++) {
$id = $ids[$i];
$market = $this->markets_by_id[$id];
$symbol = $market['symbol'];
$ticker = $response[$id];
$result[$symbol] = $this->parse_ticker($ticker, $market);
}
return $this->filter_by_array($result, 'symbol', $symbols);
}
public function fetch_ticker($symbol, $params = array ()) {
$this->load_markets();
$response = $this->publicGetTicker ($params);
$market = $this->market($symbol);
return $this->parse_ticker($response[$market['id']], $market);
}
public function parse_trade($trade, $market = null) {
//
// fetchTrades (public)
//
// array(
// "trade_id":165087520,
// "date":1587470005,
// "$type":"buy",
// "quantity":"1.004",
// "$price":"0.02491461",
// "$amount":"0.02501426"
// ),
//
// fetchMyTrades, fetchOrderTrades
//
// {
// "trade_id" => 3,
// "date" => 1435488248,
// "$type" => "buy",
// "pair" => "BTC_USD",
// "order_id" => 12345,
// "quantity" => 1,
// "$price" => 100,
// "$amount" => 100,
// "exec_type" => "taker",
// "commission_amount" => "0.02",
// "commission_currency" => "BTC",
// "commission_percent" => "0.2"
// }
//
$timestamp = $this->safe_timestamp($trade, 'date');
$symbol = null;
$id = $this->safe_string($trade, 'trade_id');
$orderId = $this->safe_string($trade, 'order_id');
$price = $this->safe_number($trade, 'price');
$amount = $this->safe_number($trade, 'quantity');
$cost = $this->safe_number($trade, 'amount');
$side = $this->safe_string($trade, 'type');
$type = null;
$marketId = $this->safe_string($trade, 'pair');
if ($marketId !== null) {
if (is_array($this->markets_by_id) && array_key_exists($marketId, $this->markets_by_id)) {
$market = $this->markets_by_id[$marketId];
} else {
list($baseId, $quoteId) = explode('_', $marketId);
$base = $this->safe_currency_code($baseId);
$quote = $this->safe_currency_code($quoteId);
$symbol = $base . '/' . $quote;
}
}
if (($symbol === null) && ($market !== null)) {
$symbol = $market['symbol'];
}
$takerOrMaker = $this->safe_string($trade, 'exec_type');
$fee = null;
$feeCost = $this->safe_number($trade, 'commission_amount');
if ($feeCost !== null) {
$feeCurrencyId = $this->safe_string($trade, 'commission_currency');
$feeCurrencyCode = $this->safe_currency_code($feeCurrencyId);
$feeRate = $this->safe_number($trade, 'commission_percent');
if ($feeRate !== null) {
$feeRate /= 1000;
}
$fee = array(
'cost' => $feeCost,
'currency' => $feeCurrencyCode,
'rate' => $feeRate,
);
}
return array(
'id' => $id,
'info' => $trade,
'timestamp' => $timestamp,
'datetime' => $this->iso8601($timestamp),
'symbol' => $symbol,
'order' => $orderId,
'type' => $type,
'side' => $side,
'takerOrMaker' => $takerOrMaker,
'price' => $price,
'amount' => $amount,
'cost' => $cost,
'fee' => $fee,
);
}
public function fetch_trades($symbol, $since = null, $limit = null, $params = array ()) {
$this->load_markets();
$market = $this->market($symbol);
$request = array(
'pair' => $market['id'],
);
$response = $this->publicGetTrades (array_merge($request, $params));
//
// {
// "ETH_BTC":array(
// array(
// "trade_id":165087520,
// "date":1587470005,
// "type":"buy",
// "quantity":"1.004",
// "price":"0.02491461",
// "amount":"0.02501426"
// ),
// {
// "trade_id":165087369,
// "date":1587469938,
// "type":"buy",
// "quantity":"0.94",