@curvefi/api 2.15.1 → 2.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,889 @@
1
+ [
2
+ {
3
+ "name": "TokenExchange",
4
+ "inputs": [
5
+ {
6
+ "name": "buyer",
7
+ "type": "address",
8
+ "indexed": true
9
+ },
10
+ {
11
+ "name": "sold_id",
12
+ "type": "int128",
13
+ "indexed": false
14
+ },
15
+ {
16
+ "name": "tokens_sold",
17
+ "type": "uint256",
18
+ "indexed": false
19
+ },
20
+ {
21
+ "name": "bought_id",
22
+ "type": "int128",
23
+ "indexed": false
24
+ },
25
+ {
26
+ "name": "tokens_bought",
27
+ "type": "uint256",
28
+ "indexed": false
29
+ }
30
+ ],
31
+ "anonymous": false,
32
+ "type": "event"
33
+ },
34
+ {
35
+ "name": "AddLiquidity",
36
+ "inputs": [
37
+ {
38
+ "name": "provider",
39
+ "type": "address",
40
+ "indexed": true
41
+ },
42
+ {
43
+ "name": "token_amounts",
44
+ "type": "uint256[2]",
45
+ "indexed": false
46
+ },
47
+ {
48
+ "name": "fees",
49
+ "type": "uint256[2]",
50
+ "indexed": false
51
+ },
52
+ {
53
+ "name": "invariant",
54
+ "type": "uint256",
55
+ "indexed": false
56
+ },
57
+ {
58
+ "name": "token_supply",
59
+ "type": "uint256",
60
+ "indexed": false
61
+ }
62
+ ],
63
+ "anonymous": false,
64
+ "type": "event"
65
+ },
66
+ {
67
+ "name": "RemoveLiquidity",
68
+ "inputs": [
69
+ {
70
+ "name": "provider",
71
+ "type": "address",
72
+ "indexed": true
73
+ },
74
+ {
75
+ "name": "token_amounts",
76
+ "type": "uint256[2]",
77
+ "indexed": false
78
+ },
79
+ {
80
+ "name": "fees",
81
+ "type": "uint256[2]",
82
+ "indexed": false
83
+ },
84
+ {
85
+ "name": "token_supply",
86
+ "type": "uint256",
87
+ "indexed": false
88
+ }
89
+ ],
90
+ "anonymous": false,
91
+ "type": "event"
92
+ },
93
+ {
94
+ "name": "RemoveLiquidityOne",
95
+ "inputs": [
96
+ {
97
+ "name": "provider",
98
+ "type": "address",
99
+ "indexed": true
100
+ },
101
+ {
102
+ "name": "token_amount",
103
+ "type": "uint256",
104
+ "indexed": false
105
+ },
106
+ {
107
+ "name": "coin_amount",
108
+ "type": "uint256",
109
+ "indexed": false
110
+ },
111
+ {
112
+ "name": "token_supply",
113
+ "type": "uint256",
114
+ "indexed": false
115
+ }
116
+ ],
117
+ "anonymous": false,
118
+ "type": "event"
119
+ },
120
+ {
121
+ "name": "RemoveLiquidityImbalance",
122
+ "inputs": [
123
+ {
124
+ "name": "provider",
125
+ "type": "address",
126
+ "indexed": true
127
+ },
128
+ {
129
+ "name": "token_amounts",
130
+ "type": "uint256[2]",
131
+ "indexed": false
132
+ },
133
+ {
134
+ "name": "fees",
135
+ "type": "uint256[2]",
136
+ "indexed": false
137
+ },
138
+ {
139
+ "name": "invariant",
140
+ "type": "uint256",
141
+ "indexed": false
142
+ },
143
+ {
144
+ "name": "token_supply",
145
+ "type": "uint256",
146
+ "indexed": false
147
+ }
148
+ ],
149
+ "anonymous": false,
150
+ "type": "event"
151
+ },
152
+ {
153
+ "name": "CommitNewAdmin",
154
+ "inputs": [
155
+ {
156
+ "name": "deadline",
157
+ "type": "uint256",
158
+ "indexed": true
159
+ },
160
+ {
161
+ "name": "admin",
162
+ "type": "address",
163
+ "indexed": true
164
+ }
165
+ ],
166
+ "anonymous": false,
167
+ "type": "event"
168
+ },
169
+ {
170
+ "name": "NewAdmin",
171
+ "inputs": [
172
+ {
173
+ "name": "admin",
174
+ "type": "address",
175
+ "indexed": true
176
+ }
177
+ ],
178
+ "anonymous": false,
179
+ "type": "event"
180
+ },
181
+ {
182
+ "name": "CommitNewFee",
183
+ "inputs": [
184
+ {
185
+ "name": "deadline",
186
+ "type": "uint256",
187
+ "indexed": true
188
+ },
189
+ {
190
+ "name": "fee",
191
+ "type": "uint256",
192
+ "indexed": false
193
+ },
194
+ {
195
+ "name": "admin_fee",
196
+ "type": "uint256",
197
+ "indexed": false
198
+ }
199
+ ],
200
+ "anonymous": false,
201
+ "type": "event"
202
+ },
203
+ {
204
+ "name": "NewFee",
205
+ "inputs": [
206
+ {
207
+ "name": "fee",
208
+ "type": "uint256",
209
+ "indexed": false
210
+ },
211
+ {
212
+ "name": "admin_fee",
213
+ "type": "uint256",
214
+ "indexed": false
215
+ }
216
+ ],
217
+ "anonymous": false,
218
+ "type": "event"
219
+ },
220
+ {
221
+ "name": "RampA",
222
+ "inputs": [
223
+ {
224
+ "name": "old_A",
225
+ "type": "uint256",
226
+ "indexed": false
227
+ },
228
+ {
229
+ "name": "new_A",
230
+ "type": "uint256",
231
+ "indexed": false
232
+ },
233
+ {
234
+ "name": "initial_time",
235
+ "type": "uint256",
236
+ "indexed": false
237
+ },
238
+ {
239
+ "name": "future_time",
240
+ "type": "uint256",
241
+ "indexed": false
242
+ }
243
+ ],
244
+ "anonymous": false,
245
+ "type": "event"
246
+ },
247
+ {
248
+ "name": "StopRampA",
249
+ "inputs": [
250
+ {
251
+ "name": "A",
252
+ "type": "uint256",
253
+ "indexed": false
254
+ },
255
+ {
256
+ "name": "t",
257
+ "type": "uint256",
258
+ "indexed": false
259
+ }
260
+ ],
261
+ "anonymous": false,
262
+ "type": "event"
263
+ },
264
+ {
265
+ "stateMutability": "nonpayable",
266
+ "type": "constructor",
267
+ "inputs": [
268
+ {
269
+ "name": "_owner",
270
+ "type": "address"
271
+ },
272
+ {
273
+ "name": "_coins",
274
+ "type": "address[2]"
275
+ },
276
+ {
277
+ "name": "_pool_token",
278
+ "type": "address"
279
+ },
280
+ {
281
+ "name": "_A",
282
+ "type": "uint256"
283
+ },
284
+ {
285
+ "name": "_fee",
286
+ "type": "uint256"
287
+ },
288
+ {
289
+ "name": "_admin_fee",
290
+ "type": "uint256"
291
+ }
292
+ ],
293
+ "outputs": []
294
+ },
295
+ {
296
+ "stateMutability": "view",
297
+ "type": "function",
298
+ "name": "A",
299
+ "inputs": [],
300
+ "outputs": [
301
+ {
302
+ "name": "",
303
+ "type": "uint256"
304
+ }
305
+ ]
306
+ },
307
+ {
308
+ "stateMutability": "view",
309
+ "type": "function",
310
+ "name": "A_precise",
311
+ "inputs": [],
312
+ "outputs": [
313
+ {
314
+ "name": "",
315
+ "type": "uint256"
316
+ }
317
+ ]
318
+ },
319
+ {
320
+ "stateMutability": "view",
321
+ "type": "function",
322
+ "name": "get_p",
323
+ "inputs": [],
324
+ "outputs": [
325
+ {
326
+ "name": "",
327
+ "type": "uint256"
328
+ }
329
+ ]
330
+ },
331
+ {
332
+ "stateMutability": "view",
333
+ "type": "function",
334
+ "name": "price_oracle",
335
+ "inputs": [],
336
+ "outputs": [
337
+ {
338
+ "name": "",
339
+ "type": "uint256"
340
+ }
341
+ ]
342
+ },
343
+ {
344
+ "stateMutability": "view",
345
+ "type": "function",
346
+ "name": "get_virtual_price",
347
+ "inputs": [],
348
+ "outputs": [
349
+ {
350
+ "name": "",
351
+ "type": "uint256"
352
+ }
353
+ ]
354
+ },
355
+ {
356
+ "stateMutability": "view",
357
+ "type": "function",
358
+ "name": "calc_token_amount",
359
+ "inputs": [
360
+ {
361
+ "name": "_amounts",
362
+ "type": "uint256[2]"
363
+ },
364
+ {
365
+ "name": "_is_deposit",
366
+ "type": "bool"
367
+ }
368
+ ],
369
+ "outputs": [
370
+ {
371
+ "name": "",
372
+ "type": "uint256"
373
+ }
374
+ ]
375
+ },
376
+ {
377
+ "stateMutability": "payable",
378
+ "type": "function",
379
+ "name": "add_liquidity",
380
+ "inputs": [
381
+ {
382
+ "name": "_amounts",
383
+ "type": "uint256[2]"
384
+ },
385
+ {
386
+ "name": "_min_mint_amount",
387
+ "type": "uint256"
388
+ }
389
+ ],
390
+ "outputs": [
391
+ {
392
+ "name": "",
393
+ "type": "uint256"
394
+ }
395
+ ]
396
+ },
397
+ {
398
+ "stateMutability": "view",
399
+ "type": "function",
400
+ "name": "get_dy",
401
+ "inputs": [
402
+ {
403
+ "name": "i",
404
+ "type": "int128"
405
+ },
406
+ {
407
+ "name": "j",
408
+ "type": "int128"
409
+ },
410
+ {
411
+ "name": "_dx",
412
+ "type": "uint256"
413
+ }
414
+ ],
415
+ "outputs": [
416
+ {
417
+ "name": "",
418
+ "type": "uint256"
419
+ }
420
+ ]
421
+ },
422
+ {
423
+ "stateMutability": "payable",
424
+ "type": "function",
425
+ "name": "exchange",
426
+ "inputs": [
427
+ {
428
+ "name": "i",
429
+ "type": "int128"
430
+ },
431
+ {
432
+ "name": "j",
433
+ "type": "int128"
434
+ },
435
+ {
436
+ "name": "_dx",
437
+ "type": "uint256"
438
+ },
439
+ {
440
+ "name": "_min_dy",
441
+ "type": "uint256"
442
+ }
443
+ ],
444
+ "outputs": [
445
+ {
446
+ "name": "",
447
+ "type": "uint256"
448
+ }
449
+ ]
450
+ },
451
+ {
452
+ "stateMutability": "nonpayable",
453
+ "type": "function",
454
+ "name": "remove_liquidity",
455
+ "inputs": [
456
+ {
457
+ "name": "_amount",
458
+ "type": "uint256"
459
+ },
460
+ {
461
+ "name": "_min_amounts",
462
+ "type": "uint256[2]"
463
+ }
464
+ ],
465
+ "outputs": [
466
+ {
467
+ "name": "",
468
+ "type": "uint256[2]"
469
+ }
470
+ ]
471
+ },
472
+ {
473
+ "stateMutability": "nonpayable",
474
+ "type": "function",
475
+ "name": "remove_liquidity_imbalance",
476
+ "inputs": [
477
+ {
478
+ "name": "_amounts",
479
+ "type": "uint256[2]"
480
+ },
481
+ {
482
+ "name": "_max_burn_amount",
483
+ "type": "uint256"
484
+ }
485
+ ],
486
+ "outputs": [
487
+ {
488
+ "name": "",
489
+ "type": "uint256"
490
+ }
491
+ ]
492
+ },
493
+ {
494
+ "stateMutability": "view",
495
+ "type": "function",
496
+ "name": "calc_withdraw_one_coin",
497
+ "inputs": [
498
+ {
499
+ "name": "_token_amount",
500
+ "type": "uint256"
501
+ },
502
+ {
503
+ "name": "i",
504
+ "type": "int128"
505
+ }
506
+ ],
507
+ "outputs": [
508
+ {
509
+ "name": "",
510
+ "type": "uint256"
511
+ }
512
+ ]
513
+ },
514
+ {
515
+ "stateMutability": "nonpayable",
516
+ "type": "function",
517
+ "name": "remove_liquidity_one_coin",
518
+ "inputs": [
519
+ {
520
+ "name": "_token_amount",
521
+ "type": "uint256"
522
+ },
523
+ {
524
+ "name": "i",
525
+ "type": "int128"
526
+ },
527
+ {
528
+ "name": "_min_amount",
529
+ "type": "uint256"
530
+ }
531
+ ],
532
+ "outputs": [
533
+ {
534
+ "name": "",
535
+ "type": "uint256"
536
+ }
537
+ ]
538
+ },
539
+ {
540
+ "stateMutability": "nonpayable",
541
+ "type": "function",
542
+ "name": "ramp_A",
543
+ "inputs": [
544
+ {
545
+ "name": "_future_A",
546
+ "type": "uint256"
547
+ },
548
+ {
549
+ "name": "_future_time",
550
+ "type": "uint256"
551
+ }
552
+ ],
553
+ "outputs": []
554
+ },
555
+ {
556
+ "stateMutability": "nonpayable",
557
+ "type": "function",
558
+ "name": "stop_ramp_A",
559
+ "inputs": [],
560
+ "outputs": []
561
+ },
562
+ {
563
+ "stateMutability": "nonpayable",
564
+ "type": "function",
565
+ "name": "commit_new_fee",
566
+ "inputs": [
567
+ {
568
+ "name": "_new_fee",
569
+ "type": "uint256"
570
+ },
571
+ {
572
+ "name": "_new_admin_fee",
573
+ "type": "uint256"
574
+ }
575
+ ],
576
+ "outputs": []
577
+ },
578
+ {
579
+ "stateMutability": "nonpayable",
580
+ "type": "function",
581
+ "name": "apply_new_fee",
582
+ "inputs": [],
583
+ "outputs": []
584
+ },
585
+ {
586
+ "stateMutability": "nonpayable",
587
+ "type": "function",
588
+ "name": "revert_new_parameters",
589
+ "inputs": [],
590
+ "outputs": []
591
+ },
592
+ {
593
+ "stateMutability": "nonpayable",
594
+ "type": "function",
595
+ "name": "set_ma_exp_time",
596
+ "inputs": [
597
+ {
598
+ "name": "_ma_exp_time",
599
+ "type": "uint256"
600
+ }
601
+ ],
602
+ "outputs": []
603
+ },
604
+ {
605
+ "stateMutability": "nonpayable",
606
+ "type": "function",
607
+ "name": "commit_transfer_ownership",
608
+ "inputs": [
609
+ {
610
+ "name": "_owner",
611
+ "type": "address"
612
+ }
613
+ ],
614
+ "outputs": []
615
+ },
616
+ {
617
+ "stateMutability": "nonpayable",
618
+ "type": "function",
619
+ "name": "apply_transfer_ownership",
620
+ "inputs": [],
621
+ "outputs": []
622
+ },
623
+ {
624
+ "stateMutability": "nonpayable",
625
+ "type": "function",
626
+ "name": "revert_transfer_ownership",
627
+ "inputs": [],
628
+ "outputs": []
629
+ },
630
+ {
631
+ "stateMutability": "view",
632
+ "type": "function",
633
+ "name": "admin_balances",
634
+ "inputs": [
635
+ {
636
+ "name": "i",
637
+ "type": "uint256"
638
+ }
639
+ ],
640
+ "outputs": [
641
+ {
642
+ "name": "",
643
+ "type": "uint256"
644
+ }
645
+ ]
646
+ },
647
+ {
648
+ "stateMutability": "nonpayable",
649
+ "type": "function",
650
+ "name": "withdraw_admin_fees",
651
+ "inputs": [],
652
+ "outputs": []
653
+ },
654
+ {
655
+ "stateMutability": "nonpayable",
656
+ "type": "function",
657
+ "name": "donate_admin_fees",
658
+ "inputs": [],
659
+ "outputs": []
660
+ },
661
+ {
662
+ "stateMutability": "nonpayable",
663
+ "type": "function",
664
+ "name": "kill_me",
665
+ "inputs": [],
666
+ "outputs": []
667
+ },
668
+ {
669
+ "stateMutability": "nonpayable",
670
+ "type": "function",
671
+ "name": "unkill_me",
672
+ "inputs": [],
673
+ "outputs": []
674
+ },
675
+ {
676
+ "stateMutability": "view",
677
+ "type": "function",
678
+ "name": "coins",
679
+ "inputs": [
680
+ {
681
+ "name": "arg0",
682
+ "type": "uint256"
683
+ }
684
+ ],
685
+ "outputs": [
686
+ {
687
+ "name": "",
688
+ "type": "address"
689
+ }
690
+ ]
691
+ },
692
+ {
693
+ "stateMutability": "view",
694
+ "type": "function",
695
+ "name": "balances",
696
+ "inputs": [
697
+ {
698
+ "name": "arg0",
699
+ "type": "uint256"
700
+ }
701
+ ],
702
+ "outputs": [
703
+ {
704
+ "name": "",
705
+ "type": "uint256"
706
+ }
707
+ ]
708
+ },
709
+ {
710
+ "stateMutability": "view",
711
+ "type": "function",
712
+ "name": "fee",
713
+ "inputs": [],
714
+ "outputs": [
715
+ {
716
+ "name": "",
717
+ "type": "uint256"
718
+ }
719
+ ]
720
+ },
721
+ {
722
+ "stateMutability": "view",
723
+ "type": "function",
724
+ "name": "admin_fee",
725
+ "inputs": [],
726
+ "outputs": [
727
+ {
728
+ "name": "",
729
+ "type": "uint256"
730
+ }
731
+ ]
732
+ },
733
+ {
734
+ "stateMutability": "view",
735
+ "type": "function",
736
+ "name": "owner",
737
+ "inputs": [],
738
+ "outputs": [
739
+ {
740
+ "name": "",
741
+ "type": "address"
742
+ }
743
+ ]
744
+ },
745
+ {
746
+ "stateMutability": "view",
747
+ "type": "function",
748
+ "name": "lp_token",
749
+ "inputs": [],
750
+ "outputs": [
751
+ {
752
+ "name": "",
753
+ "type": "address"
754
+ }
755
+ ]
756
+ },
757
+ {
758
+ "stateMutability": "view",
759
+ "type": "function",
760
+ "name": "initial_A",
761
+ "inputs": [],
762
+ "outputs": [
763
+ {
764
+ "name": "",
765
+ "type": "uint256"
766
+ }
767
+ ]
768
+ },
769
+ {
770
+ "stateMutability": "view",
771
+ "type": "function",
772
+ "name": "future_A",
773
+ "inputs": [],
774
+ "outputs": [
775
+ {
776
+ "name": "",
777
+ "type": "uint256"
778
+ }
779
+ ]
780
+ },
781
+ {
782
+ "stateMutability": "view",
783
+ "type": "function",
784
+ "name": "initial_A_time",
785
+ "inputs": [],
786
+ "outputs": [
787
+ {
788
+ "name": "",
789
+ "type": "uint256"
790
+ }
791
+ ]
792
+ },
793
+ {
794
+ "stateMutability": "view",
795
+ "type": "function",
796
+ "name": "future_A_time",
797
+ "inputs": [],
798
+ "outputs": [
799
+ {
800
+ "name": "",
801
+ "type": "uint256"
802
+ }
803
+ ]
804
+ },
805
+ {
806
+ "stateMutability": "view",
807
+ "type": "function",
808
+ "name": "admin_actions_deadline",
809
+ "inputs": [],
810
+ "outputs": [
811
+ {
812
+ "name": "",
813
+ "type": "uint256"
814
+ }
815
+ ]
816
+ },
817
+ {
818
+ "stateMutability": "view",
819
+ "type": "function",
820
+ "name": "transfer_ownership_deadline",
821
+ "inputs": [],
822
+ "outputs": [
823
+ {
824
+ "name": "",
825
+ "type": "uint256"
826
+ }
827
+ ]
828
+ },
829
+ {
830
+ "stateMutability": "view",
831
+ "type": "function",
832
+ "name": "future_fee",
833
+ "inputs": [],
834
+ "outputs": [
835
+ {
836
+ "name": "",
837
+ "type": "uint256"
838
+ }
839
+ ]
840
+ },
841
+ {
842
+ "stateMutability": "view",
843
+ "type": "function",
844
+ "name": "future_admin_fee",
845
+ "inputs": [],
846
+ "outputs": [
847
+ {
848
+ "name": "",
849
+ "type": "uint256"
850
+ }
851
+ ]
852
+ },
853
+ {
854
+ "stateMutability": "view",
855
+ "type": "function",
856
+ "name": "future_owner",
857
+ "inputs": [],
858
+ "outputs": [
859
+ {
860
+ "name": "",
861
+ "type": "address"
862
+ }
863
+ ]
864
+ },
865
+ {
866
+ "stateMutability": "view",
867
+ "type": "function",
868
+ "name": "ma_exp_time",
869
+ "inputs": [],
870
+ "outputs": [
871
+ {
872
+ "name": "",
873
+ "type": "uint256"
874
+ }
875
+ ]
876
+ },
877
+ {
878
+ "stateMutability": "view",
879
+ "type": "function",
880
+ "name": "ma_last_time",
881
+ "inputs": [],
882
+ "outputs": [
883
+ {
884
+ "name": "",
885
+ "type": "uint256"
886
+ }
887
+ ]
888
+ }
889
+ ]
@@ -31,6 +31,7 @@ exports.ETH_COINS_ETHEREUM = {
31
31
  seth: "0x5e74c9036fb86bd7ecdcb084a0673efc32ea31cb",
32
32
  reth: "0x9559aaa82d9649c7a7b220e7c461d2e74c9a3593",
33
33
  weth: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
34
+ frxeth: "0x5E8422345238F34275888049021821E8E08CAa1f",
34
35
  xaut: "0x68749665ff8d2d112fa859aa293f07a622782f38", // XAUt TODO move to GOLD
35
36
  };
36
37
  exports.LINK_COINS_ETHEREUM = {
@@ -40,7 +41,8 @@ exports.LINK_COINS_ETHEREUM = {
40
41
  exports.EUR_COINS_ETHEREUM = {
41
42
  eurs: "0xdB25f211AB05b1c97D595516F45794528a807ad8",
42
43
  seur: "0xD71eCFF9342A5Ced620049e616c5035F1dB98620",
43
- eurt: "0xC581b735A1688071A1746c968e0798D642EDE491", // EURT
44
+ eurt: "0xC581b735A1688071A1746c968e0798D642EDE491",
45
+ euroc: "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
44
46
  };
45
47
  exports.USD_COINS_ETHEREUM = {
46
48
  ycdai: "0x99d1Fa417f94dcD62BfE781a1213c092a47041Bc",
@@ -21,7 +21,6 @@ exports.POOLS_DATA_ARBITRUM = (0, utils_1.lowerCasePoolDataAddresses)({
21
21
  reference_asset: "USD",
22
22
  swap_address: '0x7f90122bf0700f9e7e1f688fe926940e8839f353',
23
23
  token_address: '0x7f90122bf0700f9e7e1f688fe926940e8839f353',
24
- // gauge_address: '0xbF7E49483881C76487b0989CD7d9A8239B20CA41', // Rewards-Only
25
24
  gauge_address: '0xCE5F24B7A95e9cBa7df4B54E911B4A3Dc8CDAf6f',
26
25
  is_plain: true,
27
26
  underlying_coins: ['USDC', 'USDT'],
@@ -47,7 +46,6 @@ exports.POOLS_DATA_ARBITRUM = (0, utils_1.lowerCasePoolDataAddresses)({
47
46
  is_crypto: true,
48
47
  swap_address: '0x960ea3e3C7FB317332d990873d354E18d7645590',
49
48
  token_address: '0x8e0B8c8BB9db49a46697F3a5Bb8A308e744821D2',
50
- // gauge_address: '0x97E2768e8E73511cA874545DC5Ff8067eB19B787', // Rewards-Only
51
49
  gauge_address: '0x555766f3da968ecBefa690Ffd49A2Ac02f47aa5f',
52
50
  deposit_address: '0xF97c707024ef0DD3E77a0824555a46B622bfB500',
53
51
  underlying_coins: ['USDT', 'WBTC', 'ETH'],
@@ -76,7 +74,6 @@ exports.POOLS_DATA_ARBITRUM = (0, utils_1.lowerCasePoolDataAddresses)({
76
74
  is_plain: true,
77
75
  swap_address: '0x3E01dD8a5E1fb3481F0F589056b428Fc308AF0Fb',
78
76
  token_address: '0x3E01dD8a5E1fb3481F0F589056b428Fc308AF0Fb',
79
- // gauge_address: '0xC2b1DF84112619D190193E48148000e3990Bf627', // Rewards-Only
80
77
  gauge_address: '0xDB3fd1bfC67b5D4325cb31C04E0Cae52f1787FD6',
81
78
  underlying_coins: ['WBTC', 'renBTC'],
82
79
  wrapped_coins: ['WBTC', 'renBTC'],
@@ -100,7 +97,6 @@ exports.POOLS_DATA_ARBITRUM = (0, utils_1.lowerCasePoolDataAddresses)({
100
97
  reference_asset: 'CRYPTO',
101
98
  swap_address: '0xA827a652Ead76c6B0b3D19dba05452E06e25c27e',
102
99
  token_address: '0x3dFe1324A0ee9d86337d06aEB829dEb4528DB9CA',
103
- // gauge_address: '0x37C7ef6B0E23C9bd9B620A6daBbFEC13CE30D824', // Rewards-Only
104
100
  gauge_address: '0x6339eF8Df0C2d3d3E7eE697E241666a916B81587',
105
101
  deposit_address: '0x25e2e8d104BC1A70492e2BE32dA7c1f8367F9d2c',
106
102
  is_meta: true,
@@ -89,6 +89,7 @@ var deposit_json_23 = __importDefault(require("../abis/rai/deposit.json"));
89
89
  var swap_json_40 = __importDefault(require("../abis/2pool/swap.json"));
90
90
  var swap_json_41 = __importDefault(require("../abis/4pool/swap.json"));
91
91
  var swap_json_42 = __importDefault(require("../abis/fraxusdc/swap.json"));
92
+ var swap_json_43 = __importDefault(require("../abis/frxeth/swap.json"));
92
93
  var utils_1 = require("../utils");
93
94
  exports.POOLS_DATA_ETHEREUM = (0, utils_1.lowerCasePoolDataAddresses)({
94
95
  compound: {
@@ -1549,4 +1550,28 @@ exports.POOLS_DATA_ETHEREUM = (0, utils_1.lowerCasePoolDataAddresses)({
1549
1550
  gauge_abi: gauge_v5_json_1.default,
1550
1551
  deposit_abi: deposit_json_22.default,
1551
1552
  },
1553
+ frxeth: {
1554
+ name: "frxeth",
1555
+ full_name: "frxeth",
1556
+ symbol: "frxeth",
1557
+ reference_asset: 'ETH',
1558
+ swap_address: "0xa1F8A6807c402E4A15ef4EBa36528A3FED24E577",
1559
+ token_address: "0xf43211935C781D5ca1a41d2041F397B8A7366C7A",
1560
+ gauge_address: "0x2932a86df44Fe8D2A706d8e9c5d51c24883423F5",
1561
+ is_plain: true,
1562
+ underlying_coins: ['ETH', 'frxrETH'],
1563
+ wrapped_coins: ['ETH', 'frxrETH'],
1564
+ underlying_coin_addresses: [
1565
+ '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
1566
+ '0x5E8422345238F34275888049021821E8E08CAa1f',
1567
+ ],
1568
+ wrapped_coin_addresses: [
1569
+ '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
1570
+ '0x5E8422345238F34275888049021821E8E08CAa1f',
1571
+ ],
1572
+ underlying_decimals: [18, 18],
1573
+ wrapped_decimals: [18, 18],
1574
+ swap_abi: swap_json_43.default,
1575
+ gauge_abi: gauge_v5_json_1.default,
1576
+ },
1552
1577
  });
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.POOLS_DATA_OPTIMISM = void 0;
7
7
  var swap_json_1 = __importDefault(require("../abis/3pool-optimism/swap.json"));
8
8
  var swap_json_2 = __importDefault(require("../abis/wsteth/swap.json"));
9
- var gauge_rewards_only_json_1 = __importDefault(require("../abis/gauge_rewards_only.json"));
10
9
  var gauge_child_json_1 = __importDefault(require("../abis/gauge_child.json"));
11
10
  var utils_1 = require("../utils");
12
11
  exports.POOLS_DATA_OPTIMISM = (0, utils_1.lowerCasePoolDataAddresses)({
@@ -18,7 +17,7 @@ exports.POOLS_DATA_OPTIMISM = (0, utils_1.lowerCasePoolDataAddresses)({
18
17
  is_plain: true,
19
18
  swap_address: '0x1337BedC9D22ecbe766dF105c9623922A27963EC',
20
19
  token_address: '0x1337BedC9D22ecbe766dF105c9623922A27963EC',
21
- gauge_address: '0x7f90122BF0700F9E7e1F688fe926940E8839F353',
20
+ gauge_address: '0x15F52286C0FF1d7A7dDbC9E300dd66628D46D4e6',
22
21
  underlying_coins: ['DAI', 'USDC', 'USDT'],
23
22
  wrapped_coins: ['DAI', 'USDC', 'USDT'],
24
23
  underlying_coin_addresses: [
@@ -34,7 +33,7 @@ exports.POOLS_DATA_OPTIMISM = (0, utils_1.lowerCasePoolDataAddresses)({
34
33
  underlying_decimals: [18, 6, 6],
35
34
  wrapped_decimals: [18, 6, 6],
36
35
  swap_abi: swap_json_1.default,
37
- gauge_abi: gauge_rewards_only_json_1.default,
36
+ gauge_abi: gauge_child_json_1.default,
38
37
  },
39
38
  wsteth: {
40
39
  name: "wsteth",
@@ -10,6 +10,7 @@ var deposit_json_1 = __importDefault(require("../abis/rai/deposit.json"));
10
10
  var swap_json_3 = __importDefault(require("../abis/tricrypto-xdai/swap.json"));
11
11
  var zap_json_1 = __importDefault(require("../abis/tricrypto-xdai/zap.json"));
12
12
  var gauge_rewards_only_json_1 = __importDefault(require("../abis/gauge_rewards_only.json"));
13
+ var gauge_child_json_1 = __importDefault(require("../abis/gauge_child.json"));
13
14
  var streamer_json_1 = __importDefault(require("../abis/streamer.json"));
14
15
  var utils_1 = require("../utils");
15
16
  exports.POOLS_DATA_XDAI = (0, utils_1.lowerCasePoolDataAddresses)({
@@ -20,7 +21,7 @@ exports.POOLS_DATA_XDAI = (0, utils_1.lowerCasePoolDataAddresses)({
20
21
  reference_asset: 'USD',
21
22
  swap_address: '0x7f90122BF0700F9E7e1F688fe926940E8839F353',
22
23
  token_address: '0x1337BedC9D22ecbe766dF105c9623922A27963EC',
23
- gauge_address: '0x78CF256256C8089d68Cde634Cf7cDEFb39286470',
24
+ gauge_address: '0xb721cc32160ab0da2614cc6ab16ed822aeebc101',
24
25
  sCurveRewards_address: '0x6C09F6727113543Fd061a721da512B7eFCDD0267',
25
26
  is_plain: true,
26
27
  underlying_coins: ['WXDAI', 'USDC', 'USDT'],
@@ -38,7 +39,7 @@ exports.POOLS_DATA_XDAI = (0, utils_1.lowerCasePoolDataAddresses)({
38
39
  underlying_decimals: [18, 6, 6],
39
40
  wrapped_decimals: [18, 6, 6],
40
41
  swap_abi: swap_json_1.default,
41
- gauge_abi: gauge_rewards_only_json_1.default,
42
+ gauge_abi: gauge_child_json_1.default,
42
43
  sCurveRewards_abi: streamer_json_1.default,
43
44
  },
44
45
  rai: {
package/lib/index.d.ts CHANGED
@@ -33,6 +33,7 @@ declare const curve: {
33
33
  getFactoryPoolList: () => string[];
34
34
  getCryptoFactoryPoolList: () => string[];
35
35
  getUserPoolList: (address?: string | undefined) => Promise<string[]>;
36
+ getUserLiquidityUSD: (pools: string[], address?: string | undefined) => Promise<string[]>;
36
37
  PoolTemplate: typeof PoolTemplate;
37
38
  getPool: (poolId: string) => PoolTemplate;
38
39
  getUsdRate: (coin: string) => Promise<number>;
package/lib/index.js CHANGED
@@ -99,6 +99,7 @@ var curve = {
99
99
  getFactoryPoolList: utils_1.getFactoryPoolList,
100
100
  getCryptoFactoryPoolList: utils_1.getCryptoFactoryPoolList,
101
101
  getUserPoolList: utils_1.getUserPoolList,
102
+ getUserLiquidityUSD: utils_1.getUserLiquidityUSD,
102
103
  PoolTemplate: pools_1.PoolTemplate,
103
104
  getPool: pools_1.getPool,
104
105
  getUsdRate: utils_2.getUsdRate,
@@ -365,16 +365,18 @@ var PoolTemplate = /** @class */ (function () {
365
365
  if (isDeposit === void 0) { isDeposit = true; }
366
366
  if (useUnderlying === void 0) { useUnderlying = true; }
367
367
  return __awaiter(_this, void 0, void 0, function () {
368
- var _rates_1, e_1, lpContract, _lpTotalSupply, decimals_1, amounts, seedAmounts_1, N_coins, decimals_2, calcContractAddress, calcContract, poolContract, lpContract, calls, res, _c, _totalSupply, _fee, _lpTokenAmount, balances, _d, totalSupplyBN, feeBN, lpTokenAmountBN, balancesBN, amountsBN, feesBN, i, _fees, _lpTokenFee, e_2, lpContract, _lpTotalSupply, decimals_3, amounts_1, _amounts18Decimals;
368
+ var _rates, e_1, lpContract, _lpTotalSupply, decimals_1, amounts, seedAmounts_1, N_coins, decimals_2, calcContractAddress, calcContract, poolContract, lpContract, calls, res, _c, _totalSupply, _fee, _lpTokenAmount, balances, _d, totalSupplyBN, feeBN, lpTokenAmountBN, balancesBN, amountsBN, feesBN, i, _fees, _lpTokenFee, e_2, lpContract, _lpTotalSupply, decimals_3, amounts_1, _amounts18Decimals;
369
369
  return __generator(this, function (_e) {
370
370
  switch (_e.label) {
371
371
  case 0:
372
+ _rates = [];
372
373
  if (!(!this.isMeta && useUnderlying)) return [3 /*break*/, 2];
373
374
  return [4 /*yield*/, this._getRates()];
374
375
  case 1:
375
- _rates_1 = _e.sent();
376
+ // For lending pools. For others rate = 1
377
+ _rates = _e.sent();
376
378
  _amounts = _amounts.map(function (_amount, i) {
377
- return _amount.mul(ethers_1.ethers.BigNumber.from(10).pow(18)).div(_rates_1[i]);
379
+ return _amount.mul(ethers_1.ethers.BigNumber.from(10).pow(18)).div(_rates[i]);
378
380
  });
379
381
  _e.label = 2;
380
382
  case 2:
@@ -443,6 +445,11 @@ var PoolTemplate = /** @class */ (function () {
443
445
  }
444
446
  }
445
447
  _fees = feesBN.map(function (fBN, i) { return (0, utils_1.fromBN)(fBN, decimals_2[i]); });
448
+ if (!this.isMeta && useUnderlying) {
449
+ _fees = _fees.map(function (_fee, i) {
450
+ return _fee.mul(ethers_1.ethers.BigNumber.from(10).pow(18)).div(_rates[i]);
451
+ });
452
+ }
446
453
  return [4 /*yield*/, this._pureCalcLpTokenAmount(_fees, !isDeposit, useUnderlying)];
447
454
  case 10:
448
455
  _lpTokenFee = _e.sent();
@@ -2555,22 +2562,16 @@ var PoolTemplate = /** @class */ (function () {
2555
2562
  PoolTemplate.prototype.userLiquidityUSD = function (address) {
2556
2563
  if (address === void 0) { address = ""; }
2557
2564
  return __awaiter(this, void 0, void 0, function () {
2558
- var balances, promises, _i, _c, addr, prices, totalLiquidity;
2559
- return __generator(this, function (_d) {
2560
- switch (_d.label) {
2561
- case 0: return [4 /*yield*/, this.userBalances(address)];
2565
+ var lpBalanceBN, lpPrice;
2566
+ return __generator(this, function (_c) {
2567
+ switch (_c.label) {
2568
+ case 0: return [4 /*yield*/, this._userLpTotalBalance(address)];
2562
2569
  case 1:
2563
- balances = _d.sent();
2564
- promises = [];
2565
- for (_i = 0, _c = this.underlyingCoinAddresses; _i < _c.length; _i++) {
2566
- addr = _c[_i];
2567
- promises.push((0, utils_1._getUsdRate)(addr));
2568
- }
2569
- return [4 /*yield*/, Promise.all(promises)];
2570
+ lpBalanceBN = _c.sent();
2571
+ return [4 /*yield*/, (0, utils_1._getUsdRate)(this.lpToken)];
2570
2572
  case 2:
2571
- prices = _d.sent();
2572
- totalLiquidity = balances.reduce(function (liquidity, b, i) { return liquidity + (Number(b) * prices[i]); }, 0);
2573
- return [2 /*return*/, totalLiquidity.toFixed(8)];
2573
+ lpPrice = _c.sent();
2574
+ return [2 /*return*/, lpBalanceBN.times(lpPrice).toFixed(8)];
2574
2575
  }
2575
2576
  });
2576
2577
  });
@@ -1,4 +1,7 @@
1
+ import { ethers } from "ethers";
1
2
  export declare const getPoolList: () => string[];
2
3
  export declare const getFactoryPoolList: () => string[];
3
4
  export declare const getCryptoFactoryPoolList: () => string[];
5
+ export declare const _getUserLpBalances: (pools: string[], address?: string) => Promise<ethers.BigNumber[]>;
4
6
  export declare const getUserPoolList: (address?: string) => Promise<string[]>;
7
+ export declare const getUserLiquidityUSD: (pools: string[], address?: string) => Promise<string[]>;
@@ -45,45 +45,84 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
45
45
  return to.concat(ar || Array.prototype.slice.call(from));
46
46
  };
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.getUserPoolList = exports.getCryptoFactoryPoolList = exports.getFactoryPoolList = exports.getPoolList = void 0;
48
+ exports.getUserLiquidityUSD = exports.getUserPoolList = exports._getUserLpBalances = exports.getCryptoFactoryPoolList = exports.getFactoryPoolList = exports.getPoolList = void 0;
49
49
  var ethers_1 = require("ethers");
50
- var curve_1 = require("../curve");
51
50
  var poolConstructor_1 = require("./poolConstructor");
51
+ var curve_1 = require("../curve");
52
+ var utils_1 = require("../utils");
52
53
  var getPoolList = function () { return Object.keys(curve_1.curve.constants.POOLS_DATA); };
53
54
  exports.getPoolList = getPoolList;
54
55
  var getFactoryPoolList = function () { return Object.keys(curve_1.curve.constants.FACTORY_POOLS_DATA); };
55
56
  exports.getFactoryPoolList = getFactoryPoolList;
56
57
  var getCryptoFactoryPoolList = function () { return Object.keys(curve_1.curve.constants.CRYPTO_FACTORY_POOLS_DATA); };
57
58
  exports.getCryptoFactoryPoolList = getCryptoFactoryPoolList;
58
- var getUserPoolList = function (address) { return __awaiter(void 0, void 0, void 0, function () {
59
- var poolIds, calls, _i, poolIds_1, poolId, pool, userPoolList, _rawBalances, _a, poolIds_2, poolId, pool, _balance;
60
- return __generator(this, function (_b) {
61
- switch (_b.label) {
59
+ var _userLpBalance = {};
60
+ var _isUserLpBalanceExpired = function (address, poolId) {
61
+ var _a, _b;
62
+ return (((_b = (_a = _userLpBalance[address]) === null || _a === void 0 ? void 0 : _a[poolId]) === null || _b === void 0 ? void 0 : _b.time) || 0) + 600000 < Date.now();
63
+ };
64
+ var _getUserLpBalances = function (pools, address) { return __awaiter(void 0, void 0, void 0, function () {
65
+ var poolsToFetch, _i, pools_1, poolId, calls, _a, poolsToFetch_1, poolId, pool, _rawBalances, _b, poolsToFetch_2, poolId, pool, _balance, _lpBalances, _c, pools_2, poolId;
66
+ var _d;
67
+ return __generator(this, function (_e) {
68
+ switch (_e.label) {
62
69
  case 0:
63
70
  if (!address)
64
71
  address = curve_1.curve.signerAddress;
65
72
  address = address;
66
- poolIds = __spreadArray(__spreadArray(__spreadArray([], (0, exports.getPoolList)(), true), (0, exports.getFactoryPoolList)(), true), (0, exports.getCryptoFactoryPoolList)(), true);
73
+ poolsToFetch = [];
74
+ for (_i = 0, pools_1 = pools; _i < pools_1.length; _i++) {
75
+ poolId = pools_1[_i];
76
+ if (_isUserLpBalanceExpired(address, poolId))
77
+ poolsToFetch.push(poolId);
78
+ }
79
+ if (!(poolsToFetch.length > 0)) return [3 /*break*/, 2];
67
80
  calls = [];
68
- for (_i = 0, poolIds_1 = poolIds; _i < poolIds_1.length; _i++) {
69
- poolId = poolIds_1[_i];
81
+ for (_a = 0, poolsToFetch_1 = poolsToFetch; _a < poolsToFetch_1.length; _a++) {
82
+ poolId = poolsToFetch_1[_a];
70
83
  pool = (0, poolConstructor_1.getPool)(poolId);
71
84
  calls.push(curve_1.curve.contracts[pool.lpToken].multicallContract.balanceOf(address));
72
85
  if (pool.gauge !== ethers_1.ethers.constants.AddressZero)
73
86
  calls.push(curve_1.curve.contracts[pool.gauge].multicallContract.balanceOf(address));
74
87
  }
75
- userPoolList = [];
76
88
  return [4 /*yield*/, curve_1.curve.multicallProvider.all(calls)];
77
89
  case 1:
78
- _rawBalances = _b.sent();
79
- for (_a = 0, poolIds_2 = poolIds; _a < poolIds_2.length; _a++) {
80
- poolId = poolIds_2[_a];
90
+ _rawBalances = _e.sent();
91
+ for (_b = 0, poolsToFetch_2 = poolsToFetch; _b < poolsToFetch_2.length; _b++) {
92
+ poolId = poolsToFetch_2[_b];
81
93
  pool = (0, poolConstructor_1.getPool)(poolId);
82
94
  _balance = _rawBalances.shift();
83
95
  if (pool.gauge !== ethers_1.ethers.constants.AddressZero)
84
96
  _balance = _balance.add(_rawBalances.shift());
85
- if (_balance.gt(0)) {
86
- userPoolList.push(poolId);
97
+ if (!_userLpBalance[address])
98
+ _userLpBalance[address] = {};
99
+ _userLpBalance[address][poolId] = { '_lpBalance': _balance, 'time': Date.now() };
100
+ }
101
+ _e.label = 2;
102
+ case 2:
103
+ _lpBalances = [];
104
+ for (_c = 0, pools_2 = pools; _c < pools_2.length; _c++) {
105
+ poolId = pools_2[_c];
106
+ _lpBalances.push((_d = _userLpBalance[address]) === null || _d === void 0 ? void 0 : _d[poolId]._lpBalance);
107
+ }
108
+ return [2 /*return*/, _lpBalances];
109
+ }
110
+ });
111
+ }); };
112
+ exports._getUserLpBalances = _getUserLpBalances;
113
+ var getUserPoolList = function (address) { return __awaiter(void 0, void 0, void 0, function () {
114
+ var pools, _lpBalances, userPoolList, i;
115
+ return __generator(this, function (_a) {
116
+ switch (_a.label) {
117
+ case 0:
118
+ pools = __spreadArray(__spreadArray(__spreadArray([], (0, exports.getPoolList)(), true), (0, exports.getFactoryPoolList)(), true), (0, exports.getCryptoFactoryPoolList)(), true);
119
+ return [4 /*yield*/, (0, exports._getUserLpBalances)(pools, address)];
120
+ case 1:
121
+ _lpBalances = _a.sent();
122
+ userPoolList = [];
123
+ for (i = 0; i < pools.length; i++) {
124
+ if (_lpBalances[i].gt(0)) {
125
+ userPoolList.push(pools[i]);
87
126
  }
88
127
  }
89
128
  return [2 /*return*/, userPoolList];
@@ -91,3 +130,29 @@ var getUserPoolList = function (address) { return __awaiter(void 0, void 0, void
91
130
  });
92
131
  }); };
93
132
  exports.getUserPoolList = getUserPoolList;
133
+ var getUserLiquidityUSD = function (pools, address) { return __awaiter(void 0, void 0, void 0, function () {
134
+ var _lpBalances, userLiquidityUSD, i, pool, price;
135
+ return __generator(this, function (_a) {
136
+ switch (_a.label) {
137
+ case 0: return [4 /*yield*/, (0, exports._getUserLpBalances)(pools, address)];
138
+ case 1:
139
+ _lpBalances = _a.sent();
140
+ userLiquidityUSD = [];
141
+ i = 0;
142
+ _a.label = 2;
143
+ case 2:
144
+ if (!(i < pools.length)) return [3 /*break*/, 5];
145
+ pool = (0, poolConstructor_1.getPool)(pools[i]);
146
+ return [4 /*yield*/, (0, utils_1._getUsdRate)(pool.lpToken)];
147
+ case 3:
148
+ price = _a.sent();
149
+ userLiquidityUSD.push((0, utils_1.toBN)(_lpBalances[i]).times(price).toFixed(8));
150
+ _a.label = 4;
151
+ case 4:
152
+ i++;
153
+ return [3 /*break*/, 2];
154
+ case 5: return [2 /*return*/, userLiquidityUSD];
155
+ }
156
+ });
157
+ }); };
158
+ exports.getUserLiquidityUSD = getUserLiquidityUSD;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.15.1",
3
+ "version": "2.16.1",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",