@gearbox-protocol/sdk 0.0.52 → 0.0.53

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.
@@ -1,7 +1,7 @@
1
1
  import { AdapterInterface } from "./adapters";
2
2
  import { NetworkType } from "./constants";
3
3
  import { Protocols } from "./protocols";
4
- import { ConvexStakedPhantomToken, CurveLPToken, NormalToken } from "./token";
4
+ import { CurveLPToken, NormalToken, ConvexStakedPhantomToken } from "./token";
5
5
  export declare type UniswapV2Contract = "UNISWAP_V2_ROUTER" | "SUSHISWAP_ROUTER";
6
6
  export declare type CurvePoolContract = "CURVE_3CRV_POOL" | "CURVE_STETH_GATEWAY" | "CURVE_FRAX_POOL" | "CURVE_LUSD_POOL" | "CURVE_GUSD_POOL" | "CURVE_SUSD_POOL";
7
7
  export declare type YearnVaultContract = "YEARN_DAI_VAULT" | "YEARN_USDC_VAULT" | "YEARN_WETH_VAULT" | "YEARN_WBTC_VAULT" | "YEARN_CURVE_FRAX_VAULT" | "YEARN_CURVE_STETH_VAULT";
@@ -108,13 +108,13 @@ exports.contractParams = {
108
108
  protocol: protocols_1.Protocols.Curve,
109
109
  type: adapters_1.AdapterInterface.CURVE_V1_2ASSETS,
110
110
  lpToken: "LUSD3CRV",
111
- tokens: ["3Crv", "FRAX"]
111
+ tokens: ["3Crv", "LUSD"]
112
112
  },
113
113
  CURVE_SUSD_POOL: {
114
114
  protocol: protocols_1.Protocols.Curve,
115
- type: adapters_1.AdapterInterface.CURVE_V1_2ASSETS,
115
+ type: adapters_1.AdapterInterface.CURVE_V1_4ASSETS,
116
116
  lpToken: "crvPlain3andSUSD",
117
- tokens: ["3Crv", "FRAX"]
117
+ tokens: ["DAI", "USDC", "USDT", "sUSD"]
118
118
  },
119
119
  CURVE_GUSD_POOL: {
120
120
  protocol: protocols_1.Protocols.Curve,
package/lib/core/token.js CHANGED
@@ -119,7 +119,12 @@ exports.supportedTokens = {
119
119
  type: tradeTypes_1.TradeType.CurveExchange,
120
120
  contract: "CURVE_3CRV_POOL",
121
121
  tokenOut: ["USDC", "USDT"]
122
- }
122
+ },
123
+ {
124
+ type: tradeTypes_1.TradeType.CurveExchange,
125
+ contract: "CURVE_SUSD_POOL",
126
+ tokenOut: ["USDC", "USDT", "sUSD"]
127
+ },
123
128
  ],
124
129
  lpActions: [
125
130
  {
@@ -127,6 +132,11 @@ exports.supportedTokens = {
127
132
  contract: "CURVE_3CRV_POOL",
128
133
  tokenOut: "3Crv"
129
134
  },
135
+ {
136
+ type: tradeTypes_1.TradeType.CurveDepositLP,
137
+ contract: "CURVE_SUSD_POOL",
138
+ tokenOut: "crvPlain3andSUSD"
139
+ },
130
140
  {
131
141
  type: tradeTypes_1.TradeType.YearnDeposit,
132
142
  contract: "YEARN_DAI_VAULT",
@@ -250,6 +260,28 @@ exports.supportedTokens = {
250
260
  type: tradeTypes_1.TradeType.CurveExchange,
251
261
  contract: "CURVE_3CRV_POOL",
252
262
  tokenOut: ["DAI", "USDT"]
263
+ },
264
+ {
265
+ type: tradeTypes_1.TradeType.CurveExchange,
266
+ contract: "CURVE_SUSD_POOL",
267
+ tokenOut: ["DAI", "USDT", "sUSD"]
268
+ }
269
+ ],
270
+ lpActions: [
271
+ {
272
+ type: tradeTypes_1.TradeType.CurveDepositLP,
273
+ contract: "CURVE_3CRV_POOL",
274
+ tokenOut: "3Crv"
275
+ },
276
+ {
277
+ type: tradeTypes_1.TradeType.CurveDepositLP,
278
+ contract: "CURVE_SUSD_POOL",
279
+ tokenOut: "crvPlain3andSUSD"
280
+ },
281
+ {
282
+ type: tradeTypes_1.TradeType.YearnDeposit,
283
+ contract: "YEARN_USDC_VAULT",
284
+ tokenOut: "yvUSDC"
253
285
  }
254
286
  ]
255
287
  },
@@ -273,6 +305,23 @@ exports.supportedTokens = {
273
305
  type: tradeTypes_1.TradeType.CurveExchange,
274
306
  contract: "CURVE_3CRV_POOL",
275
307
  tokenOut: ["USDC", "DAI"]
308
+ },
309
+ {
310
+ type: tradeTypes_1.TradeType.CurveExchange,
311
+ contract: "CURVE_SUSD_POOL",
312
+ tokenOut: ["DAI", "USDC", "sUSD"]
313
+ },
314
+ ],
315
+ lpActions: [
316
+ {
317
+ type: tradeTypes_1.TradeType.CurveDepositLP,
318
+ contract: "CURVE_3CRV_POOL",
319
+ tokenOut: "3Crv"
320
+ },
321
+ {
322
+ type: tradeTypes_1.TradeType.CurveDepositLP,
323
+ contract: "CURVE_SUSD_POOL",
324
+ tokenOut: "crvPlain3andSUSD"
276
325
  }
277
326
  ]
278
327
  },
@@ -292,6 +341,13 @@ exports.supportedTokens = {
292
341
  type: tradeTypes_1.TradeType.UniswapV2Swap,
293
342
  contract: "SUSHISWAP_ROUTER"
294
343
  }
344
+ ],
345
+ lpActions: [
346
+ {
347
+ type: tradeTypes_1.TradeType.YearnDeposit,
348
+ contract: "YEARN_WBTC_VAULT",
349
+ tokenOut: "yvWBTC"
350
+ }
295
351
  ]
296
352
  },
297
353
  WETH: {
@@ -315,6 +371,18 @@ exports.supportedTokens = {
315
371
  contract: "CURVE_STETH_GATEWAY",
316
372
  tokenOut: ["STETH"]
317
373
  }
374
+ ],
375
+ lpActions: [
376
+ {
377
+ type: tradeTypes_1.TradeType.YearnDeposit,
378
+ contract: "YEARN_WETH_VAULT",
379
+ tokenOut: "yvWETH"
380
+ },
381
+ {
382
+ type: tradeTypes_1.TradeType.CurveDepositLP,
383
+ contract: "CURVE_STETH_GATEWAY",
384
+ tokenOut: "steCRV"
385
+ },
318
386
  ]
319
387
  },
320
388
  YFI: {
@@ -340,11 +408,30 @@ exports.supportedTokens = {
340
408
  symbol: "STETH",
341
409
  type: TokenType.NORMAL_TOKEN,
342
410
  swapActions: [
411
+ {
412
+ type: tradeTypes_1.TradeType.UniswapV3Swap,
413
+ contract: "UNISWAP_V3_ROUTER"
414
+ },
415
+ {
416
+ type: tradeTypes_1.TradeType.UniswapV2Swap,
417
+ contract: "UNISWAP_V2_ROUTER"
418
+ },
419
+ {
420
+ type: tradeTypes_1.TradeType.UniswapV2Swap,
421
+ contract: "SUSHISWAP_ROUTER"
422
+ },
343
423
  {
344
424
  type: tradeTypes_1.TradeType.CurveExchange,
345
425
  contract: "CURVE_STETH_GATEWAY",
346
- tokenOut: ["STETH"]
426
+ tokenOut: ["WETH"]
347
427
  }
428
+ ],
429
+ lpActions: [
430
+ {
431
+ type: tradeTypes_1.TradeType.CurveDepositLP,
432
+ contract: "CURVE_STETH_GATEWAY",
433
+ tokenOut: "steCRV"
434
+ },
348
435
  ]
349
436
  },
350
437
  FTM: {
@@ -362,11 +449,6 @@ exports.supportedTokens = {
362
449
  {
363
450
  type: tradeTypes_1.TradeType.UniswapV2Swap,
364
451
  contract: "SUSHISWAP_ROUTER"
365
- },
366
- {
367
- type: tradeTypes_1.TradeType.CurveExchange,
368
- contract: "CURVE_STETH_GATEWAY",
369
- tokenOut: ["STETH"]
370
452
  }
371
453
  ]
372
454
  },
@@ -385,11 +467,6 @@ exports.supportedTokens = {
385
467
  {
386
468
  type: tradeTypes_1.TradeType.UniswapV2Swap,
387
469
  contract: "SUSHISWAP_ROUTER"
388
- },
389
- {
390
- type: tradeTypes_1.TradeType.CurveExchange,
391
- contract: "CURVE_STETH_GATEWAY",
392
- tokenOut: ["STETH"]
393
470
  }
394
471
  ]
395
472
  },
@@ -414,6 +491,13 @@ exports.supportedTokens = {
414
491
  contract: "CURVE_FRAX_POOL",
415
492
  tokenOut: ["3Crv"]
416
493
  }
494
+ ],
495
+ lpActions: [
496
+ {
497
+ type: tradeTypes_1.TradeType.CurveDepositLP,
498
+ contract: "CURVE_FRAX_POOL",
499
+ tokenOut: "FRAX3CRV"
500
+ }
417
501
  ]
418
502
  },
419
503
  FXS: {
@@ -485,6 +569,18 @@ exports.supportedTokens = {
485
569
  {
486
570
  type: tradeTypes_1.TradeType.UniswapV2Swap,
487
571
  contract: "SUSHISWAP_ROUTER"
572
+ },
573
+ {
574
+ type: tradeTypes_1.TradeType.CurveExchange,
575
+ contract: "CURVE_LUSD_POOL",
576
+ tokenOut: ["3Crv"]
577
+ }
578
+ ],
579
+ lpActions: [
580
+ {
581
+ type: tradeTypes_1.TradeType.CurveDepositLP,
582
+ contract: "CURVE_LUSD_POOL",
583
+ tokenOut: "LUSD3CRV"
488
584
  }
489
585
  ]
490
586
  },
@@ -503,6 +599,18 @@ exports.supportedTokens = {
503
599
  {
504
600
  type: tradeTypes_1.TradeType.UniswapV2Swap,
505
601
  contract: "SUSHISWAP_ROUTER"
602
+ },
603
+ {
604
+ type: tradeTypes_1.TradeType.CurveExchange,
605
+ contract: "CURVE_SUSD_POOL",
606
+ tokenOut: ["DAI", "USDT", "USDC"]
607
+ }
608
+ ],
609
+ lpActions: [
610
+ {
611
+ type: tradeTypes_1.TradeType.CurveDepositLP,
612
+ contract: "CURVE_SUSD_POOL",
613
+ tokenOut: "crvPlain3andSUSD"
506
614
  }
507
615
  ]
508
616
  },
@@ -521,6 +629,18 @@ exports.supportedTokens = {
521
629
  {
522
630
  type: tradeTypes_1.TradeType.UniswapV2Swap,
523
631
  contract: "SUSHISWAP_ROUTER"
632
+ },
633
+ {
634
+ type: tradeTypes_1.TradeType.CurveExchange,
635
+ contract: "CURVE_GUSD_POOL",
636
+ tokenOut: ["3Crv"]
637
+ }
638
+ ],
639
+ lpActions: [
640
+ {
641
+ type: tradeTypes_1.TradeType.CurveDepositLP,
642
+ contract: "CURVE_GUSD_POOL",
643
+ tokenOut: "gusd3CRV"
524
644
  }
525
645
  ]
526
646
  },
@@ -618,6 +738,16 @@ exports.supportedTokens = {
618
738
  type: tradeTypes_1.TradeType.CurveWithdrawLP,
619
739
  contract: "CURVE_3CRV_POOL",
620
740
  tokenOut: ["DAI", "USDC", "USDT"]
741
+ },
742
+ {
743
+ type: tradeTypes_1.TradeType.ConvexDepositLP,
744
+ contract: "CONVEX_BOOSTER",
745
+ tokenOut: "cvx3Crv"
746
+ },
747
+ {
748
+ type: tradeTypes_1.TradeType.ConvexDepositLPAndStake,
749
+ contract: "CONVEX_BOOSTER",
750
+ tokenOut: "stkcvx3Crv"
621
751
  }
622
752
  ]
623
753
  },
@@ -628,30 +758,94 @@ exports.supportedTokens = {
628
758
  {
629
759
  type: tradeTypes_1.TradeType.CurveWithdrawLP,
630
760
  contract: "CURVE_STETH_GATEWAY",
631
- tokenOut: ["STETH"]
761
+ tokenOut: ["STETH", "WETH"]
762
+ },
763
+ {
764
+ type: tradeTypes_1.TradeType.ConvexDepositLP,
765
+ contract: "CONVEX_BOOSTER",
766
+ tokenOut: "cvxsteCRV"
767
+ },
768
+ {
769
+ type: tradeTypes_1.TradeType.ConvexDepositLPAndStake,
770
+ contract: "CONVEX_BOOSTER",
771
+ tokenOut: "stkcvxsteCRV"
632
772
  }
633
773
  ]
634
774
  },
635
775
  crvPlain3andSUSD: {
636
776
  symbol: "crvPlain3andSUSD",
637
777
  type: TokenType.CURVE_LP,
638
- lpActions: []
778
+ lpActions: [
779
+ {
780
+ type: tradeTypes_1.TradeType.CurveWithdrawLP,
781
+ contract: "CURVE_SUSD_POOL",
782
+ tokenOut: ["DAI", "USDC", "USDT", "sUSD"]
783
+ },
784
+ {
785
+ type: tradeTypes_1.TradeType.ConvexDepositLP,
786
+ contract: "CONVEX_BOOSTER",
787
+ tokenOut: "cvxcrvPlain3andSUSD"
788
+ },
789
+ {
790
+ type: tradeTypes_1.TradeType.ConvexDepositLPAndStake,
791
+ contract: "CONVEX_BOOSTER",
792
+ tokenOut: "stkcvxcrvPlain3andSUSD"
793
+ }
794
+ ]
639
795
  },
640
796
  // META CURVE LP TOKENS
641
797
  FRAX3CRV: {
642
798
  symbol: "FRAX3CRV",
643
799
  type: TokenType.META_CURVE_LP,
644
- lpActions: []
800
+ lpActions: [
801
+ {
802
+ type: tradeTypes_1.TradeType.CurveWithdrawLP,
803
+ contract: "CURVE_FRAX_POOL",
804
+ tokenOut: ["FRAX", "3Crv"]
805
+ },
806
+ {
807
+ type: tradeTypes_1.TradeType.ConvexDepositLP,
808
+ contract: "CONVEX_BOOSTER",
809
+ tokenOut: "cvxFRAX3CRV"
810
+ },
811
+ {
812
+ type: tradeTypes_1.TradeType.ConvexDepositLPAndStake,
813
+ contract: "CONVEX_BOOSTER",
814
+ tokenOut: "stkcvxFRAX3CRV"
815
+ }
816
+ ]
645
817
  },
646
818
  LUSD3CRV: {
647
819
  symbol: "LUSD3CRV",
648
820
  type: TokenType.META_CURVE_LP,
649
- lpActions: []
821
+ lpActions: [
822
+ {
823
+ type: tradeTypes_1.TradeType.CurveWithdrawLP,
824
+ contract: "CURVE_LUSD_POOL",
825
+ tokenOut: ["LUSD", "3Crv"]
826
+ }
827
+ ]
650
828
  },
651
829
  gusd3CRV: {
652
830
  symbol: "gusd3CRV",
653
831
  type: TokenType.META_CURVE_LP,
654
- lpActions: []
832
+ lpActions: [
833
+ {
834
+ type: tradeTypes_1.TradeType.CurveWithdrawLP,
835
+ contract: "CURVE_GUSD_POOL",
836
+ tokenOut: ["GUSD", "3Crv"]
837
+ },
838
+ {
839
+ type: tradeTypes_1.TradeType.ConvexDepositLP,
840
+ contract: "CONVEX_BOOSTER",
841
+ tokenOut: "cvxgusd3CRV"
842
+ },
843
+ {
844
+ type: tradeTypes_1.TradeType.ConvexDepositLPAndStake,
845
+ contract: "CONVEX_BOOSTER",
846
+ tokenOut: "stkcvxgusd3CRV"
847
+ }
848
+ ]
655
849
  },
656
850
  // CONVEX LP TOKENS
657
851
  cvx3Crv: {
@@ -660,7 +854,18 @@ exports.supportedTokens = {
660
854
  pool: "CONVEX_3CRV_POOL",
661
855
  underlying: "3Crv",
662
856
  stakedToken: "stkcvx3Crv",
663
- lpActions: []
857
+ lpActions: [
858
+ {
859
+ type: tradeTypes_1.TradeType.ConvexWithdrawLP,
860
+ contract: "CONVEX_BOOSTER",
861
+ tokenOut: "3Crv"
862
+ },
863
+ {
864
+ type: tradeTypes_1.TradeType.ConvexStake,
865
+ contract: "CONVEX_3CRV_POOL",
866
+ tokenOut: "stkcvx3Crv"
867
+ }
868
+ ]
664
869
  },
665
870
  cvxsteCRV: {
666
871
  symbol: "cvxsteCRV",
@@ -668,7 +873,18 @@ exports.supportedTokens = {
668
873
  pool: "CONVEX_STECRV_POOL",
669
874
  underlying: "steCRV",
670
875
  stakedToken: "stkcvxsteCRV",
671
- lpActions: []
876
+ lpActions: [
877
+ {
878
+ type: tradeTypes_1.TradeType.ConvexWithdrawLP,
879
+ contract: "CONVEX_BOOSTER",
880
+ tokenOut: "steCRV"
881
+ },
882
+ {
883
+ type: tradeTypes_1.TradeType.ConvexStake,
884
+ contract: "CONVEX_STECRV_POOL",
885
+ tokenOut: "stkcvxsteCRV"
886
+ }
887
+ ]
672
888
  },
673
889
  cvxFRAX3CRV: {
674
890
  symbol: "cvxFRAX3CRV",
@@ -676,7 +892,18 @@ exports.supportedTokens = {
676
892
  pool: "CONVEX_FRAX3CRV_POOL",
677
893
  underlying: "FRAX3CRV",
678
894
  stakedToken: "stkcvxFRAX3CRV",
679
- lpActions: []
895
+ lpActions: [
896
+ {
897
+ type: tradeTypes_1.TradeType.ConvexWithdrawLP,
898
+ contract: "CONVEX_BOOSTER",
899
+ tokenOut: "FRAX3CRV"
900
+ },
901
+ {
902
+ type: tradeTypes_1.TradeType.ConvexStake,
903
+ contract: "CONVEX_FRAX3CRV_POOL",
904
+ tokenOut: "stkcvxFRAX3CRV"
905
+ }
906
+ ]
680
907
  },
681
908
  cvxcrvPlain3andSUSD: {
682
909
  symbol: "cvxcrvPlain3andSUSD",
@@ -684,7 +911,18 @@ exports.supportedTokens = {
684
911
  pool: "CONVEX_SUSD_POOL",
685
912
  underlying: "crvPlain3andSUSD",
686
913
  stakedToken: "stkcvxcrvPlain3andSUSD",
687
- lpActions: []
914
+ lpActions: [
915
+ {
916
+ type: tradeTypes_1.TradeType.ConvexWithdrawLP,
917
+ contract: "CONVEX_BOOSTER",
918
+ tokenOut: "crvPlain3andSUSD"
919
+ },
920
+ {
921
+ type: tradeTypes_1.TradeType.ConvexStake,
922
+ contract: "CONVEX_SUSD_POOL",
923
+ tokenOut: "stkcvxcrvPlain3andSUSD"
924
+ }
925
+ ]
688
926
  },
689
927
  cvxgusd3CRV: {
690
928
  symbol: "cvxgusd3CRV",
@@ -692,20 +930,43 @@ exports.supportedTokens = {
692
930
  pool: "CONVEX_GUSD_POOL",
693
931
  underlying: "gusd3CRV",
694
932
  stakedToken: "stkcvxgusd3CRV",
695
- lpActions: []
933
+ lpActions: [
934
+ {
935
+ type: tradeTypes_1.TradeType.ConvexWithdrawLP,
936
+ contract: "CONVEX_BOOSTER",
937
+ tokenOut: "gusd3CRV"
938
+ },
939
+ {
940
+ type: tradeTypes_1.TradeType.ConvexStake,
941
+ contract: "CONVEX_GUSD_POOL",
942
+ tokenOut: "stkcvxgusd3CRV"
943
+ }
944
+ ]
696
945
  },
697
946
  // YEARN- CURVE TOKENS
698
947
  yvCurve_stETH: {
699
948
  symbol: "yvCurve_stETH",
700
949
  type: TokenType.YEARN_VAULT_OF_CURVE_LP,
701
950
  underlying: "steCRV",
702
- lpActions: []
951
+ lpActions: [
952
+ {
953
+ type: tradeTypes_1.TradeType.YearnWithdraw,
954
+ contract: "YEARN_CURVE_STETH_VAULT",
955
+ tokenOut: "steCRV"
956
+ }
957
+ ]
703
958
  },
704
959
  yvCURVE_FRAX_POOL: {
705
960
  symbol: "yvCURVE_FRAX_POOL",
706
961
  type: TokenType.YEARN_VAULT_OF_META_CURVE_LP,
707
962
  underlying: "FRAX3CRV",
708
- lpActions: []
963
+ lpActions: [
964
+ {
965
+ type: tradeTypes_1.TradeType.YearnWithdraw,
966
+ contract: "YEARN_CURVE_FRAX_VAULT",
967
+ tokenOut: "FRAX3CRV"
968
+ }
969
+ ]
709
970
  },
710
971
  // STAKED CONVEX
711
972
  stkcvx3Crv: {
@@ -714,7 +975,18 @@ exports.supportedTokens = {
714
975
  pool: "CONVEX_3CRV_POOL",
715
976
  underlying: "3Crv",
716
977
  lpToken: "cvx3Crv",
717
- lpActions: []
978
+ lpActions: [
979
+ {
980
+ type: tradeTypes_1.TradeType.ConvexWithdraw,
981
+ contract: "CONVEX_3CRV_POOL",
982
+ tokenOut: "cvx3Crv"
983
+ },
984
+ {
985
+ type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
986
+ contract: "CONVEX_3CRV_POOL",
987
+ tokenOut: "3Crv"
988
+ }
989
+ ]
718
990
  },
719
991
  stkcvxsteCRV: {
720
992
  symbol: "stkcvxsteCRV",
@@ -722,7 +994,18 @@ exports.supportedTokens = {
722
994
  pool: "CONVEX_STECRV_POOL",
723
995
  underlying: "steCRV",
724
996
  lpToken: "cvxsteCRV",
725
- lpActions: []
997
+ lpActions: [
998
+ {
999
+ type: tradeTypes_1.TradeType.ConvexWithdraw,
1000
+ contract: "CONVEX_STECRV_POOL",
1001
+ tokenOut: "cvxsteCRV"
1002
+ },
1003
+ {
1004
+ type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
1005
+ contract: "CONVEX_STECRV_POOL",
1006
+ tokenOut: "steCRV"
1007
+ }
1008
+ ]
726
1009
  },
727
1010
  stkcvxFRAX3CRV: {
728
1011
  symbol: "stkcvxFRAX3CRV",
@@ -730,7 +1013,18 @@ exports.supportedTokens = {
730
1013
  pool: "CONVEX_FRAX3CRV_POOL",
731
1014
  underlying: "FRAX3CRV",
732
1015
  lpToken: "cvxFRAX3CRV",
733
- lpActions: []
1016
+ lpActions: [
1017
+ {
1018
+ type: tradeTypes_1.TradeType.ConvexWithdraw,
1019
+ contract: "CONVEX_FRAX3CRV_POOL",
1020
+ tokenOut: "cvxFRAX3CRV"
1021
+ },
1022
+ {
1023
+ type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
1024
+ contract: "CONVEX_FRAX3CRV_POOL",
1025
+ tokenOut: "FRAX3CRV"
1026
+ }
1027
+ ]
734
1028
  },
735
1029
  stkcvxcrvPlain3andSUSD: {
736
1030
  symbol: "stkcvxcrvPlain3andSUSD",
@@ -738,7 +1032,18 @@ exports.supportedTokens = {
738
1032
  pool: "CONVEX_SUSD_POOL",
739
1033
  underlying: "crvPlain3andSUSD",
740
1034
  lpToken: "cvxcrvPlain3andSUSD",
741
- lpActions: []
1035
+ lpActions: [
1036
+ {
1037
+ type: tradeTypes_1.TradeType.ConvexWithdraw,
1038
+ contract: "CONVEX_SUSD_POOL",
1039
+ tokenOut: "cvxcrvPlain3andSUSD"
1040
+ },
1041
+ {
1042
+ type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
1043
+ contract: "CONVEX_SUSD_POOL",
1044
+ tokenOut: "crvPlain3andSUSD"
1045
+ }
1046
+ ]
742
1047
  },
743
1048
  stkcvxgusd3CRV: {
744
1049
  symbol: "stkcvxgusd3CRV",
@@ -746,7 +1051,18 @@ exports.supportedTokens = {
746
1051
  pool: "CONVEX_GUSD_POOL",
747
1052
  underlying: "gusd3CRV",
748
1053
  lpToken: "cvxgusd3CRV",
749
- lpActions: []
1054
+ lpActions: [
1055
+ {
1056
+ type: tradeTypes_1.TradeType.ConvexWithdraw,
1057
+ contract: "CONVEX_GUSD_POOL",
1058
+ tokenOut: "cvxgusd3CRV"
1059
+ },
1060
+ {
1061
+ type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
1062
+ contract: "CONVEX_GUSD_POOL",
1063
+ tokenOut: "gusd3CRV"
1064
+ }
1065
+ ]
750
1066
  }
751
1067
  };
752
1068
  exports.tokenDataByNetwork = {
@@ -10,9 +10,12 @@ export declare enum TradeType {
10
10
  YearnDeposit = 6,
11
11
  YearnWithdraw = 7,
12
12
  LidoStake = 8,
13
- ConvexDeposit = 9,
13
+ ConvexDepositLP = 9,
14
14
  ConvexStake = 10,
15
- ConvexDepositAndStake = 11
15
+ ConvexDepositLPAndStake = 11,
16
+ ConvexWithdrawLP = 12,
17
+ ConvexWithdraw = 13,
18
+ ConvexWithdrawAndUnwrap = 14
16
19
  }
17
20
  export declare type TradeAction = {
18
21
  type: TradeType.UniswapV2Swap;
@@ -45,15 +48,27 @@ export declare type TradeAction = {
45
48
  contract: "LIDO_STETH_GATEWAY";
46
49
  tokenOut: NormalToken;
47
50
  } | {
48
- type: TradeType.ConvexDeposit;
49
- contract: ConvexPoolContract;
51
+ type: TradeType.ConvexDepositLP;
52
+ contract: "CONVEX_BOOSTER";
50
53
  tokenOut: ConvexLPToken;
51
54
  } | {
52
55
  type: TradeType.ConvexStake;
53
56
  contract: ConvexPoolContract;
54
57
  tokenOut: ConvexStakedPhantomToken;
55
58
  } | {
56
- type: TradeType.ConvexDepositAndStake;
57
- contract: ConvexPoolContract;
59
+ type: TradeType.ConvexDepositLPAndStake;
60
+ contract: "CONVEX_BOOSTER";
58
61
  tokenOut: ConvexStakedPhantomToken;
62
+ } | {
63
+ type: TradeType.ConvexWithdrawLP;
64
+ contract: "CONVEX_BOOSTER";
65
+ tokenOut: CurveLPToken;
66
+ } | {
67
+ type: TradeType.ConvexWithdraw;
68
+ contract: ConvexPoolContract;
69
+ tokenOut: ConvexLPToken;
70
+ } | {
71
+ type: TradeType.ConvexWithdrawAndUnwrap;
72
+ contract: ConvexPoolContract;
73
+ tokenOut: CurveLPToken;
59
74
  };
@@ -12,7 +12,10 @@ var TradeType;
12
12
  TradeType[TradeType["YearnDeposit"] = 6] = "YearnDeposit";
13
13
  TradeType[TradeType["YearnWithdraw"] = 7] = "YearnWithdraw";
14
14
  TradeType[TradeType["LidoStake"] = 8] = "LidoStake";
15
- TradeType[TradeType["ConvexDeposit"] = 9] = "ConvexDeposit";
15
+ TradeType[TradeType["ConvexDepositLP"] = 9] = "ConvexDepositLP";
16
16
  TradeType[TradeType["ConvexStake"] = 10] = "ConvexStake";
17
- TradeType[TradeType["ConvexDepositAndStake"] = 11] = "ConvexDepositAndStake";
17
+ TradeType[TradeType["ConvexDepositLPAndStake"] = 11] = "ConvexDepositLPAndStake";
18
+ TradeType[TradeType["ConvexWithdrawLP"] = 12] = "ConvexWithdrawLP";
19
+ TradeType[TradeType["ConvexWithdraw"] = 13] = "ConvexWithdraw";
20
+ TradeType[TradeType["ConvexWithdrawAndUnwrap"] = 14] = "ConvexWithdrawAndUnwrap";
18
21
  })(TradeType = exports.TradeType || (exports.TradeType = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -7,12 +7,8 @@
7
7
  import { AdapterInterface } from "./adapters";
8
8
  import { NetworkType } from "./constants";
9
9
  import { Protocols } from "./protocols";
10
- import {
11
- ConvexStakedPhantomToken,
12
- CurveLPToken,
13
- NormalToken,
14
- tokenDataByNetwork
15
- } from "./token";
10
+ import { CurveLPToken, NormalToken, ConvexStakedPhantomToken, tokenDataByNetwork } from "./token";
11
+
16
12
 
17
13
  export type UniswapV2Contract = "UNISWAP_V2_ROUTER" | "SUSHISWAP_ROUTER";
18
14
 
@@ -210,13 +206,13 @@ export const contractParams: Record<SupportedContract, ContractParams> = {
210
206
  protocol: Protocols.Curve,
211
207
  type: AdapterInterface.CURVE_V1_2ASSETS,
212
208
  lpToken: "LUSD3CRV",
213
- tokens: ["3Crv", "FRAX"]
209
+ tokens: ["3Crv", "LUSD"]
214
210
  },
215
211
  CURVE_SUSD_POOL: {
216
212
  protocol: Protocols.Curve,
217
- type: AdapterInterface.CURVE_V1_2ASSETS,
213
+ type: AdapterInterface.CURVE_V1_4ASSETS,
218
214
  lpToken: "crvPlain3andSUSD",
219
- tokens: ["3Crv", "FRAX"]
215
+ tokens: ["DAI", "USDC", "USDT", "sUSD"]
220
216
  },
221
217
  CURVE_GUSD_POOL: {
222
218
  protocol: Protocols.Curve,
package/src/core/token.ts CHANGED
@@ -251,7 +251,12 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
251
251
  type: TradeType.CurveExchange,
252
252
  contract: "CURVE_3CRV_POOL",
253
253
  tokenOut: ["USDC", "USDT"]
254
- }
254
+ },
255
+ {
256
+ type: TradeType.CurveExchange,
257
+ contract: "CURVE_SUSD_POOL",
258
+ tokenOut: ["USDC", "USDT", "sUSD"]
259
+ },
255
260
  ],
256
261
  lpActions: [
257
262
  {
@@ -259,6 +264,11 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
259
264
  contract: "CURVE_3CRV_POOL",
260
265
  tokenOut: "3Crv"
261
266
  },
267
+ {
268
+ type: TradeType.CurveDepositLP,
269
+ contract: "CURVE_SUSD_POOL",
270
+ tokenOut: "crvPlain3andSUSD"
271
+ },
262
272
  {
263
273
  type: TradeType.YearnDeposit,
264
274
  contract: "YEARN_DAI_VAULT",
@@ -389,7 +399,29 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
389
399
  type: TradeType.CurveExchange,
390
400
  contract: "CURVE_3CRV_POOL",
391
401
  tokenOut: ["DAI", "USDT"]
402
+ },
403
+ {
404
+ type: TradeType.CurveExchange,
405
+ contract: "CURVE_SUSD_POOL",
406
+ tokenOut: ["DAI", "USDT", "sUSD"]
392
407
  }
408
+ ],
409
+ lpActions: [
410
+ {
411
+ type: TradeType.CurveDepositLP,
412
+ contract: "CURVE_3CRV_POOL",
413
+ tokenOut: "3Crv"
414
+ },
415
+ {
416
+ type: TradeType.CurveDepositLP,
417
+ contract: "CURVE_SUSD_POOL",
418
+ tokenOut: "crvPlain3andSUSD"
419
+ },
420
+ {
421
+ type: TradeType.YearnDeposit,
422
+ contract: "YEARN_USDC_VAULT",
423
+ tokenOut: "yvUSDC"
424
+ }
393
425
  ]
394
426
  },
395
427
 
@@ -413,7 +445,24 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
413
445
  type: TradeType.CurveExchange,
414
446
  contract: "CURVE_3CRV_POOL",
415
447
  tokenOut: ["USDC", "DAI"]
416
- }
448
+ },
449
+ {
450
+ type: TradeType.CurveExchange,
451
+ contract: "CURVE_SUSD_POOL",
452
+ tokenOut: ["DAI", "USDC", "sUSD"]
453
+ },
454
+ ],
455
+ lpActions: [
456
+ {
457
+ type: TradeType.CurveDepositLP,
458
+ contract: "CURVE_3CRV_POOL",
459
+ tokenOut: "3Crv"
460
+ },
461
+ {
462
+ type: TradeType.CurveDepositLP,
463
+ contract: "CURVE_SUSD_POOL",
464
+ tokenOut: "crvPlain3andSUSD"
465
+ }
417
466
  ]
418
467
  },
419
468
 
@@ -433,6 +482,13 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
433
482
  type: TradeType.UniswapV2Swap,
434
483
  contract: "SUSHISWAP_ROUTER"
435
484
  }
485
+ ],
486
+ lpActions: [
487
+ {
488
+ type: TradeType.YearnDeposit,
489
+ contract: "YEARN_WBTC_VAULT",
490
+ tokenOut: "yvWBTC"
491
+ }
436
492
  ]
437
493
  },
438
494
 
@@ -457,7 +513,19 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
457
513
  contract: "CURVE_STETH_GATEWAY",
458
514
  tokenOut: ["STETH"]
459
515
  }
460
- ]
516
+ ],
517
+ lpActions: [
518
+ {
519
+ type: TradeType.YearnDeposit,
520
+ contract: "YEARN_WETH_VAULT",
521
+ tokenOut: "yvWETH"
522
+ },
523
+ {
524
+ type: TradeType.CurveDepositLP,
525
+ contract: "CURVE_STETH_GATEWAY",
526
+ tokenOut: "steCRV"
527
+ },
528
+ ]
461
529
  },
462
530
 
463
531
  YFI: {
@@ -484,11 +552,30 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
484
552
  symbol: "STETH",
485
553
  type: TokenType.NORMAL_TOKEN,
486
554
  swapActions: [
487
- {
555
+ {
556
+ type: TradeType.UniswapV3Swap,
557
+ contract: "UNISWAP_V3_ROUTER"
558
+ },
559
+ {
560
+ type: TradeType.UniswapV2Swap,
561
+ contract: "UNISWAP_V2_ROUTER"
562
+ },
563
+ {
564
+ type: TradeType.UniswapV2Swap,
565
+ contract: "SUSHISWAP_ROUTER"
566
+ },
567
+ {
488
568
  type: TradeType.CurveExchange,
489
569
  contract: "CURVE_STETH_GATEWAY",
490
- tokenOut: ["STETH"]
491
- }
570
+ tokenOut: ["WETH"]
571
+ }
572
+ ],
573
+ lpActions: [
574
+ {
575
+ type: TradeType.CurveDepositLP,
576
+ contract: "CURVE_STETH_GATEWAY",
577
+ tokenOut: "steCRV"
578
+ },
492
579
  ]
493
580
  },
494
581
 
@@ -507,11 +594,6 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
507
594
  {
508
595
  type: TradeType.UniswapV2Swap,
509
596
  contract: "SUSHISWAP_ROUTER"
510
- },
511
- {
512
- type: TradeType.CurveExchange,
513
- contract: "CURVE_STETH_GATEWAY",
514
- tokenOut: ["STETH"]
515
597
  }
516
598
  ]
517
599
  },
@@ -531,11 +613,6 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
531
613
  {
532
614
  type: TradeType.UniswapV2Swap,
533
615
  contract: "SUSHISWAP_ROUTER"
534
- },
535
- {
536
- type: TradeType.CurveExchange,
537
- contract: "CURVE_STETH_GATEWAY",
538
- tokenOut: ["STETH"]
539
616
  }
540
617
  ]
541
618
  },
@@ -561,6 +638,13 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
561
638
  contract: "CURVE_FRAX_POOL",
562
639
  tokenOut: ["3Crv"]
563
640
  }
641
+ ],
642
+ lpActions: [
643
+ {
644
+ type: TradeType.CurveDepositLP,
645
+ contract: "CURVE_FRAX_POOL",
646
+ tokenOut: "FRAX3CRV"
647
+ }
564
648
  ]
565
649
  },
566
650
 
@@ -625,18 +709,30 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
625
709
  symbol: "LUSD",
626
710
  type: TokenType.NORMAL_TOKEN,
627
711
  swapActions: [
628
- {
629
- type: TradeType.UniswapV3Swap,
630
- contract: "UNISWAP_V3_ROUTER"
631
- },
632
- {
633
- type: TradeType.UniswapV2Swap,
634
- contract: "UNISWAP_V2_ROUTER"
635
- },
636
- {
637
- type: TradeType.UniswapV2Swap,
638
- contract: "SUSHISWAP_ROUTER"
639
- }
712
+ {
713
+ type: TradeType.UniswapV3Swap,
714
+ contract: "UNISWAP_V3_ROUTER"
715
+ },
716
+ {
717
+ type: TradeType.UniswapV2Swap,
718
+ contract: "UNISWAP_V2_ROUTER"
719
+ },
720
+ {
721
+ type: TradeType.UniswapV2Swap,
722
+ contract: "SUSHISWAP_ROUTER"
723
+ },
724
+ {
725
+ type: TradeType.CurveExchange,
726
+ contract: "CURVE_LUSD_POOL",
727
+ tokenOut: ["3Crv"]
728
+ }
729
+ ],
730
+ lpActions: [
731
+ {
732
+ type: TradeType.CurveDepositLP,
733
+ contract: "CURVE_LUSD_POOL",
734
+ tokenOut: "LUSD3CRV"
735
+ }
640
736
  ]
641
737
  },
642
738
 
@@ -647,15 +743,27 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
647
743
  {
648
744
  type: TradeType.UniswapV3Swap,
649
745
  contract: "UNISWAP_V3_ROUTER"
650
- },
651
- {
746
+ },
747
+ {
652
748
  type: TradeType.UniswapV2Swap,
653
749
  contract: "UNISWAP_V2_ROUTER"
654
- },
655
- {
750
+ },
751
+ {
656
752
  type: TradeType.UniswapV2Swap,
657
753
  contract: "SUSHISWAP_ROUTER"
658
- }
754
+ },
755
+ {
756
+ type: TradeType.CurveExchange,
757
+ contract: "CURVE_SUSD_POOL",
758
+ tokenOut: ["DAI", "USDT", "USDC"]
759
+ }
760
+ ],
761
+ lpActions: [
762
+ {
763
+ type: TradeType.CurveDepositLP,
764
+ contract: "CURVE_SUSD_POOL",
765
+ tokenOut: "crvPlain3andSUSD"
766
+ }
659
767
  ]
660
768
  },
661
769
 
@@ -663,18 +771,30 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
663
771
  symbol: "GUSD",
664
772
  type: TokenType.NORMAL_TOKEN,
665
773
  swapActions: [
666
- {
667
- type: TradeType.UniswapV3Swap,
668
- contract: "UNISWAP_V3_ROUTER"
669
- },
670
- {
671
- type: TradeType.UniswapV2Swap,
672
- contract: "UNISWAP_V2_ROUTER"
673
- },
674
- {
675
- type: TradeType.UniswapV2Swap,
676
- contract: "SUSHISWAP_ROUTER"
677
- }
774
+ {
775
+ type: TradeType.UniswapV3Swap,
776
+ contract: "UNISWAP_V3_ROUTER"
777
+ },
778
+ {
779
+ type: TradeType.UniswapV2Swap,
780
+ contract: "UNISWAP_V2_ROUTER"
781
+ },
782
+ {
783
+ type: TradeType.UniswapV2Swap,
784
+ contract: "SUSHISWAP_ROUTER"
785
+ },
786
+ {
787
+ type: TradeType.CurveExchange,
788
+ contract: "CURVE_GUSD_POOL",
789
+ tokenOut: ["3Crv"]
790
+ }
791
+ ],
792
+ lpActions: [
793
+ {
794
+ type: TradeType.CurveDepositLP,
795
+ contract: "CURVE_GUSD_POOL",
796
+ tokenOut: "gusd3CRV"
797
+ }
678
798
  ]
679
799
  },
680
800
 
@@ -777,6 +897,16 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
777
897
  type: TradeType.CurveWithdrawLP,
778
898
  contract: "CURVE_3CRV_POOL",
779
899
  tokenOut: ["DAI", "USDC", "USDT"]
900
+ },
901
+ {
902
+ type: TradeType.ConvexDepositLP,
903
+ contract: "CONVEX_BOOSTER",
904
+ tokenOut: "cvx3Crv"
905
+ },
906
+ {
907
+ type: TradeType.ConvexDepositLPAndStake,
908
+ contract: "CONVEX_BOOSTER",
909
+ tokenOut: "stkcvx3Crv"
780
910
  }
781
911
  ]
782
912
  },
@@ -788,7 +918,17 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
788
918
  {
789
919
  type: TradeType.CurveWithdrawLP,
790
920
  contract: "CURVE_STETH_GATEWAY",
791
- tokenOut: ["STETH"]
921
+ tokenOut: ["STETH", "WETH"]
922
+ },
923
+ {
924
+ type: TradeType.ConvexDepositLP,
925
+ contract: "CONVEX_BOOSTER",
926
+ tokenOut: "cvxsteCRV"
927
+ },
928
+ {
929
+ type: TradeType.ConvexDepositLPAndStake,
930
+ contract: "CONVEX_BOOSTER",
931
+ tokenOut: "stkcvxsteCRV"
792
932
  }
793
933
  ]
794
934
  },
@@ -796,26 +936,80 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
796
936
  crvPlain3andSUSD: {
797
937
  symbol: "crvPlain3andSUSD",
798
938
  type: TokenType.CURVE_LP,
799
- lpActions: []
939
+ lpActions: [
940
+ {
941
+ type: TradeType.CurveWithdrawLP,
942
+ contract: "CURVE_SUSD_POOL",
943
+ tokenOut: ["DAI", "USDC", "USDT", "sUSD"]
944
+ },
945
+ {
946
+ type: TradeType.ConvexDepositLP,
947
+ contract: "CONVEX_BOOSTER",
948
+ tokenOut: "cvxcrvPlain3andSUSD"
949
+ },
950
+ {
951
+ type: TradeType.ConvexDepositLPAndStake,
952
+ contract: "CONVEX_BOOSTER",
953
+ tokenOut: "stkcvxcrvPlain3andSUSD"
954
+ }
955
+ ]
800
956
  },
801
957
 
802
958
  // META CURVE LP TOKENS
803
959
  FRAX3CRV: {
804
960
  symbol: "FRAX3CRV",
805
961
  type: TokenType.META_CURVE_LP,
806
- lpActions: []
962
+ lpActions: [
963
+ {
964
+ type: TradeType.CurveWithdrawLP,
965
+ contract: "CURVE_FRAX_POOL",
966
+ tokenOut: ["FRAX", "3Crv"]
967
+ },
968
+ {
969
+ type: TradeType.ConvexDepositLP,
970
+ contract: "CONVEX_BOOSTER",
971
+ tokenOut: "cvxFRAX3CRV"
972
+ },
973
+ {
974
+ type: TradeType.ConvexDepositLPAndStake,
975
+ contract: "CONVEX_BOOSTER",
976
+ tokenOut: "stkcvxFRAX3CRV"
977
+ }
978
+ ]
807
979
  },
808
980
 
809
981
  LUSD3CRV: {
810
982
  symbol: "LUSD3CRV",
811
983
  type: TokenType.META_CURVE_LP,
812
- lpActions: []
984
+ lpActions: [
985
+ {
986
+ type: TradeType.CurveWithdrawLP,
987
+ contract: "CURVE_LUSD_POOL",
988
+ tokenOut: ["LUSD", "3Crv"]
989
+ }
990
+ ]
813
991
  },
814
992
 
815
993
  gusd3CRV: {
816
994
  symbol: "gusd3CRV",
817
995
  type: TokenType.META_CURVE_LP,
818
- lpActions: []
996
+ lpActions: [
997
+ {
998
+ type: TradeType.CurveWithdrawLP,
999
+ contract: "CURVE_GUSD_POOL",
1000
+ tokenOut: ["GUSD", "3Crv"]
1001
+ },
1002
+ {
1003
+ type: TradeType.ConvexDepositLP,
1004
+ contract: "CONVEX_BOOSTER",
1005
+ tokenOut: "cvxgusd3CRV"
1006
+ },
1007
+ {
1008
+ type: TradeType.ConvexDepositLPAndStake,
1009
+ contract: "CONVEX_BOOSTER",
1010
+ tokenOut: "stkcvxgusd3CRV"
1011
+ }
1012
+ ]
819
1013
  },
820
1014
 
821
1015
  // CONVEX LP TOKENS
@@ -825,7 +1019,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
825
1019
  pool: "CONVEX_3CRV_POOL",
826
1020
  underlying: "3Crv",
827
1021
  stakedToken: "stkcvx3Crv",
828
- lpActions: []
1022
+ lpActions: [
1023
+ {
1024
+ type: TradeType.ConvexWithdrawLP,
1025
+ contract: "CONVEX_BOOSTER",
1026
+ tokenOut: "3Crv"
1027
+ },
1028
+ {
1029
+ type: TradeType.ConvexStake,
1030
+ contract: "CONVEX_3CRV_POOL",
1031
+ tokenOut: "stkcvx3Crv"
1032
+ }
1033
+ ]
829
1034
  },
830
1035
 
831
1036
  cvxsteCRV: {
@@ -834,7 +1039,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
834
1039
  pool: "CONVEX_STECRV_POOL",
835
1040
  underlying: "steCRV",
836
1041
  stakedToken: "stkcvxsteCRV",
837
- lpActions: []
1042
+ lpActions: [
1043
+ {
1044
+ type: TradeType.ConvexWithdrawLP,
1045
+ contract: "CONVEX_BOOSTER",
1046
+ tokenOut: "steCRV"
1047
+ },
1048
+ {
1049
+ type: TradeType.ConvexStake,
1050
+ contract: "CONVEX_STECRV_POOL",
1051
+ tokenOut: "stkcvxsteCRV"
1052
+ }
1053
+ ]
838
1054
  },
839
1055
 
840
1056
  cvxFRAX3CRV: {
@@ -843,7 +1059,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
843
1059
  pool: "CONVEX_FRAX3CRV_POOL",
844
1060
  underlying: "FRAX3CRV",
845
1061
  stakedToken: "stkcvxFRAX3CRV",
846
- lpActions: []
1062
+ lpActions: [
1063
+ {
1064
+ type: TradeType.ConvexWithdrawLP,
1065
+ contract: "CONVEX_BOOSTER",
1066
+ tokenOut: "FRAX3CRV"
1067
+ },
1068
+ {
1069
+ type: TradeType.ConvexStake,
1070
+ contract: "CONVEX_FRAX3CRV_POOL",
1071
+ tokenOut: "stkcvxFRAX3CRV"
1072
+ }
1073
+ ]
847
1074
  },
848
1075
 
849
1076
  cvxcrvPlain3andSUSD: {
@@ -852,7 +1079,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
852
1079
  pool: "CONVEX_SUSD_POOL",
853
1080
  underlying: "crvPlain3andSUSD",
854
1081
  stakedToken: "stkcvxcrvPlain3andSUSD",
855
- lpActions: []
1082
+ lpActions: [
1083
+ {
1084
+ type: TradeType.ConvexWithdrawLP,
1085
+ contract: "CONVEX_BOOSTER",
1086
+ tokenOut: "crvPlain3andSUSD"
1087
+ },
1088
+ {
1089
+ type: TradeType.ConvexStake,
1090
+ contract: "CONVEX_SUSD_POOL",
1091
+ tokenOut: "stkcvxcrvPlain3andSUSD"
1092
+ }
1093
+ ]
856
1094
  },
857
1095
 
858
1096
  cvxgusd3CRV: {
@@ -861,7 +1099,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
861
1099
  pool: "CONVEX_GUSD_POOL",
862
1100
  underlying: "gusd3CRV",
863
1101
  stakedToken: "stkcvxgusd3CRV",
864
- lpActions: []
1102
+ lpActions: [
1103
+ {
1104
+ type: TradeType.ConvexWithdrawLP,
1105
+ contract: "CONVEX_BOOSTER",
1106
+ tokenOut: "gusd3CRV"
1107
+ },
1108
+ {
1109
+ type: TradeType.ConvexStake,
1110
+ contract: "CONVEX_GUSD_POOL",
1111
+ tokenOut: "stkcvxgusd3CRV"
1112
+ }
1113
+ ]
865
1114
  },
866
1115
 
867
1116
  // YEARN- CURVE TOKENS
@@ -869,13 +1118,25 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
869
1118
  symbol: "yvCurve_stETH",
870
1119
  type: TokenType.YEARN_VAULT_OF_CURVE_LP,
871
1120
  underlying: "steCRV",
872
- lpActions: []
1121
+ lpActions: [
1122
+ {
1123
+ type: TradeType.YearnWithdraw,
1124
+ contract: "YEARN_CURVE_STETH_VAULT",
1125
+ tokenOut: "steCRV"
1126
+ }
1127
+ ]
873
1128
  },
874
1129
  yvCURVE_FRAX_POOL: {
875
1130
  symbol: "yvCURVE_FRAX_POOL",
876
1131
  type: TokenType.YEARN_VAULT_OF_META_CURVE_LP,
877
1132
  underlying: "FRAX3CRV",
878
- lpActions: []
1133
+ lpActions: [
1134
+ {
1135
+ type: TradeType.YearnWithdraw,
1136
+ contract: "YEARN_CURVE_FRAX_VAULT",
1137
+ tokenOut: "FRAX3CRV"
1138
+ }
1139
+ ]
879
1140
  },
880
1141
 
881
1142
  // STAKED CONVEX
@@ -885,7 +1146,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
885
1146
  pool: "CONVEX_3CRV_POOL",
886
1147
  underlying: "3Crv",
887
1148
  lpToken: "cvx3Crv",
888
- lpActions: []
1149
+ lpActions: [
1150
+ {
1151
+ type: TradeType.ConvexWithdraw,
1152
+ contract: "CONVEX_3CRV_POOL",
1153
+ tokenOut: "cvx3Crv"
1154
+ },
1155
+ {
1156
+ type: TradeType.ConvexWithdrawAndUnwrap,
1157
+ contract: "CONVEX_3CRV_POOL",
1158
+ tokenOut: "3Crv"
1159
+ }
1160
+ ]
889
1161
  },
890
1162
  stkcvxsteCRV: {
891
1163
  symbol: "stkcvxsteCRV",
@@ -893,7 +1165,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
893
1165
  pool: "CONVEX_STECRV_POOL",
894
1166
  underlying: "steCRV",
895
1167
  lpToken: "cvxsteCRV",
896
- lpActions: []
1168
+ lpActions: [
1169
+ {
1170
+ type: TradeType.ConvexWithdraw,
1171
+ contract: "CONVEX_STECRV_POOL",
1172
+ tokenOut: "cvxsteCRV"
1173
+ },
1174
+ {
1175
+ type: TradeType.ConvexWithdrawAndUnwrap,
1176
+ contract: "CONVEX_STECRV_POOL",
1177
+ tokenOut: "steCRV"
1178
+ }
1179
+ ]
897
1180
  },
898
1181
  stkcvxFRAX3CRV: {
899
1182
  symbol: "stkcvxFRAX3CRV",
@@ -901,7 +1184,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
901
1184
  pool: "CONVEX_FRAX3CRV_POOL",
902
1185
  underlying: "FRAX3CRV",
903
1186
  lpToken: "cvxFRAX3CRV",
904
- lpActions: []
1187
+ lpActions: [
1188
+ {
1189
+ type: TradeType.ConvexWithdraw,
1190
+ contract: "CONVEX_FRAX3CRV_POOL",
1191
+ tokenOut: "cvxFRAX3CRV"
1192
+ },
1193
+ {
1194
+ type: TradeType.ConvexWithdrawAndUnwrap,
1195
+ contract: "CONVEX_FRAX3CRV_POOL",
1196
+ tokenOut: "FRAX3CRV"
1197
+ }
1198
+ ]
905
1199
  },
906
1200
  stkcvxcrvPlain3andSUSD: {
907
1201
  symbol: "stkcvxcrvPlain3andSUSD",
@@ -909,7 +1203,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
909
1203
  pool: "CONVEX_SUSD_POOL",
910
1204
  underlying: "crvPlain3andSUSD",
911
1205
  lpToken: "cvxcrvPlain3andSUSD",
912
- lpActions: []
1206
+ lpActions: [
1207
+ {
1208
+ type: TradeType.ConvexWithdraw,
1209
+ contract: "CONVEX_SUSD_POOL",
1210
+ tokenOut: "cvxcrvPlain3andSUSD"
1211
+ },
1212
+ {
1213
+ type: TradeType.ConvexWithdrawAndUnwrap,
1214
+ contract: "CONVEX_SUSD_POOL",
1215
+ tokenOut: "crvPlain3andSUSD"
1216
+ }
1217
+ ]
913
1218
  },
914
1219
  stkcvxgusd3CRV: {
915
1220
  symbol: "stkcvxgusd3CRV",
@@ -917,7 +1222,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
917
1222
  pool: "CONVEX_GUSD_POOL",
918
1223
  underlying: "gusd3CRV",
919
1224
  lpToken: "cvxgusd3CRV",
920
- lpActions: []
1225
+ lpActions: [
1226
+ {
1227
+ type: TradeType.ConvexWithdraw,
1228
+ contract: "CONVEX_GUSD_POOL",
1229
+ tokenOut: "cvxgusd3CRV"
1230
+ },
1231
+ {
1232
+ type: TradeType.ConvexWithdrawAndUnwrap,
1233
+ contract: "CONVEX_GUSD_POOL",
1234
+ tokenOut: "gusd3CRV"
1235
+ }
1236
+ ]
921
1237
  }
922
1238
  };
923
1239
 
@@ -22,9 +22,12 @@ export enum TradeType {
22
22
  YearnDeposit,
23
23
  YearnWithdraw,
24
24
  LidoStake,
25
- ConvexDeposit,
25
+ ConvexDepositLP,
26
26
  ConvexStake,
27
- ConvexDepositAndStake
27
+ ConvexDepositLPAndStake,
28
+ ConvexWithdrawLP,
29
+ ConvexWithdraw,
30
+ ConvexWithdrawAndUnwrap
28
31
  }
29
32
 
30
33
  export type TradeAction =
@@ -67,8 +70,8 @@ export type TradeAction =
67
70
  tokenOut: NormalToken;
68
71
  }
69
72
  | {
70
- type: TradeType.ConvexDeposit;
71
- contract: ConvexPoolContract;
73
+ type: TradeType.ConvexDepositLP;
74
+ contract: "CONVEX_BOOSTER";
72
75
  tokenOut: ConvexLPToken;
73
76
  }
74
77
  | {
@@ -77,7 +80,22 @@ export type TradeAction =
77
80
  tokenOut: ConvexStakedPhantomToken;
78
81
  }
79
82
  | {
80
- type: TradeType.ConvexDepositAndStake;
81
- contract: ConvexPoolContract;
83
+ type: TradeType.ConvexDepositLPAndStake;
84
+ contract: "CONVEX_BOOSTER";
82
85
  tokenOut: ConvexStakedPhantomToken;
86
+ }
87
+ | {
88
+ type: TradeType.ConvexWithdrawLP;
89
+ contract: "CONVEX_BOOSTER";
90
+ tokenOut: CurveLPToken;
91
+ }
92
+ | {
93
+ type: TradeType.ConvexWithdraw;
94
+ contract: ConvexPoolContract;
95
+ tokenOut: ConvexLPToken;
96
+ }
97
+ | {
98
+ type: TradeType.ConvexWithdrawAndUnwrap;
99
+ contract: ConvexPoolContract;
100
+ tokenOut: CurveLPToken;
83
101
  };