@gearbox-protocol/sdk 0.0.52 → 0.0.55

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.
package/src/core/token.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { objectEntries, keyToLowercase, swapKeyValue } from "../utils/mappers";
1
2
  import { NetworkType } from "./constants";
2
3
  import { ConvexPoolContract } from "./contracts";
3
4
  import { TradeAction, TradeType } from "./tradeTypes";
@@ -11,7 +12,8 @@ export enum TokenType {
11
12
  YEARN_VAULT_OF_CURVE_LP,
12
13
  YEARN_VAULT_OF_META_CURVE_LP,
13
14
  CONVEX_LP_TOKEN,
14
- CONVEX_STAKED_PHANTOM_TOKEN
15
+ CONVEX_STAKED_PHANTOM_TOKEN,
16
+ DIESEL_LP_TOKEN
15
17
  }
16
18
 
17
19
  export const priority: Record<TokenType, number> = {
@@ -23,7 +25,8 @@ export const priority: Record<TokenType, number> = {
23
25
  [TokenType.YEARN_VAULT_OF_CURVE_LP]: 4,
24
26
  [TokenType.CONVEX_LP_TOKEN]: 5,
25
27
  [TokenType.YEARN_VAULT_OF_META_CURVE_LP]: 5,
26
- [TokenType.CONVEX_STAKED_PHANTOM_TOKEN]: 5
28
+ [TokenType.CONVEX_STAKED_PHANTOM_TOKEN]: 5,
29
+ [TokenType.DIESEL_LP_TOKEN]: 6
27
30
  };
28
31
 
29
32
  export type NormalToken =
@@ -88,74 +91,118 @@ export type ConvexStakedPhantomToken =
88
91
  | "stkcvxcrvPlain3andSUSD"
89
92
  | "stkcvxgusd3CRV";
90
93
 
94
+ export type DieselTokenTypes = "dDAI" | "dUSDC" | "dWBTC" | "dWETH";
95
+ export type GearboxToken = "GEAR";
96
+
91
97
  export type SupportedToken =
92
98
  | NormalToken
93
99
  | YearnLPToken
94
100
  | CurveLPToken
95
101
  | ConvexLPToken
96
- | ConvexStakedPhantomToken;
102
+ | ConvexStakedPhantomToken
103
+ | DieselTokenTypes
104
+ | GearboxToken;
105
+
106
+ export interface TokenBase {
107
+ name: string;
108
+ symbol: string;
109
+ decimals: number;
110
+ }
111
+
112
+ type NormalConnectorTokenData = {
113
+ symbol: NormalToken;
114
+ type: TokenType.CONNECTOR;
115
+ swapActions: Array<TradeAction>;
116
+ lpActions?: Array<TradeAction>;
117
+ } & TokenBase;
118
+
119
+ type NormalTokenData = {
120
+ symbol: NormalToken;
121
+ type: TokenType.NORMAL_TOKEN;
122
+ swapActions: Array<TradeAction>;
123
+ lpActions?: Array<TradeAction>;
124
+ } & TokenBase;
125
+
126
+ type CurveLPTokenData = {
127
+ symbol: CurveLPToken;
128
+ type: TokenType.CURVE_LP;
129
+ swapActions?: Array<TradeAction>;
130
+ lpActions: Array<TradeAction>;
131
+ } & TokenBase;
132
+
133
+ type MetaCurveLPTokenData = {
134
+ symbol: CurveLPToken;
135
+ type: TokenType.META_CURVE_LP;
136
+ lpActions: Array<TradeAction>;
137
+ } & TokenBase;
138
+
139
+ type YearnVaultTokenData = {
140
+ symbol: YearnLPToken;
141
+ type: TokenType.YEARN_VAULT;
142
+ underlying: NormalToken;
143
+ lpActions: Array<TradeAction>;
144
+ } & TokenBase;
145
+
146
+ type YearnVaultOfCurveLPTokenData = {
147
+ symbol: YearnLPToken;
148
+ type: TokenType.YEARN_VAULT_OF_CURVE_LP;
149
+ underlying: CurveLPToken;
150
+ lpActions: Array<TradeAction>;
151
+ } & TokenBase;
152
+
153
+ type YearnVaultOfMetaCurveLPTokenData = {
154
+ symbol: YearnLPToken;
155
+ type: TokenType.YEARN_VAULT_OF_META_CURVE_LP;
156
+ underlying: CurveLPToken;
157
+ lpActions: Array<TradeAction>;
158
+ } & TokenBase;
159
+
160
+ type ConvexLPTokenData = {
161
+ symbol: ConvexLPToken;
162
+ type: TokenType.CONVEX_LP_TOKEN;
163
+ pool: ConvexPoolContract;
164
+ underlying: CurveLPToken;
165
+ stakedToken: ConvexStakedPhantomToken;
166
+ lpActions: Array<TradeAction>;
167
+ } & TokenBase;
168
+
169
+ type ConvexPhantomTokenData = {
170
+ symbol: ConvexStakedPhantomToken;
171
+ type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN;
172
+ pool: ConvexPoolContract;
173
+ underlying: CurveLPToken;
174
+ lpToken: ConvexLPToken;
175
+ lpActions: Array<TradeAction>;
176
+ } & TokenBase;
177
+
178
+ type DieselTokenData = {
179
+ symbol: DieselTokenTypes;
180
+ type: TokenType.DIESEL_LP_TOKEN;
181
+ } & TokenBase;
182
+
183
+ type GearboxTokenData = {
184
+ symbol: GearboxToken;
185
+ type: TokenType.NORMAL_TOKEN;
186
+ } & TokenBase;
97
187
 
98
188
  export type TokenDataI =
99
- | {
100
- symbol: NormalToken;
101
- type: TokenType.CONNECTOR;
102
- swapActions: Array<TradeAction>;
103
- lpActions?: Array<TradeAction>;
104
- }
105
- | {
106
- symbol: NormalToken;
107
- type: TokenType.NORMAL_TOKEN;
108
- swapActions: Array<TradeAction>;
109
- lpActions?: Array<TradeAction>;
110
- }
111
- | {
112
- symbol: CurveLPToken;
113
- type: TokenType.CURVE_LP;
114
- swapActions?: Array<TradeAction>;
115
- lpActions: Array<TradeAction>;
116
- }
117
- | {
118
- symbol: YearnLPToken;
119
- type: TokenType.YEARN_VAULT;
120
- underlying: NormalToken;
121
- lpActions: Array<TradeAction>;
122
- }
123
- | {
124
- symbol: CurveLPToken;
125
- type: TokenType.META_CURVE_LP;
126
- lpActions: Array<TradeAction>;
127
- }
128
- | {
129
- symbol: YearnLPToken;
130
- type: TokenType.YEARN_VAULT_OF_CURVE_LP;
131
- underlying: CurveLPToken;
132
- lpActions: Array<TradeAction>;
133
- }
134
- | {
135
- symbol: YearnLPToken;
136
- type: TokenType.YEARN_VAULT_OF_META_CURVE_LP;
137
- underlying: CurveLPToken;
138
- lpActions: Array<TradeAction>;
139
- }
140
- | {
141
- symbol: ConvexLPToken;
142
- type: TokenType.CONVEX_LP_TOKEN;
143
- pool: ConvexPoolContract;
144
- underlying: CurveLPToken;
145
- stakedToken: ConvexStakedPhantomToken;
146
- lpActions: Array<TradeAction>;
147
- }
148
- | {
149
- symbol: ConvexStakedPhantomToken;
150
- type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN;
151
- pool: ConvexPoolContract;
152
- underlying: CurveLPToken;
153
- lpToken: ConvexLPToken;
154
- lpActions: Array<TradeAction>;
155
- };
189
+ | NormalConnectorTokenData
190
+ | NormalTokenData
191
+ | CurveLPTokenData
192
+ | MetaCurveLPTokenData
193
+ | YearnVaultTokenData
194
+ | YearnVaultOfCurveLPTokenData
195
+ | YearnVaultOfMetaCurveLPTokenData
196
+ | ConvexLPTokenData
197
+ | ConvexPhantomTokenData
198
+ | DieselTokenData
199
+ | GearboxTokenData;
156
200
 
157
201
  export const supportedTokens: Record<SupportedToken, TokenDataI> = {
158
202
  "1INCH": {
203
+ name: "1INCH",
204
+ decimals: 18,
205
+
159
206
  symbol: "1INCH",
160
207
  type: TokenType.NORMAL_TOKEN,
161
208
  swapActions: [
@@ -170,11 +217,14 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
170
217
  {
171
218
  type: TradeType.UniswapV2Swap,
172
219
  contract: "SUSHISWAP_ROUTER"
173
- },
220
+ }
174
221
  ]
175
222
  },
176
223
 
177
224
  AAVE: {
225
+ name: "AAVE",
226
+ decimals: 18,
227
+
178
228
  symbol: "AAVE",
179
229
  type: TokenType.NORMAL_TOKEN,
180
230
  swapActions: [
@@ -189,11 +239,14 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
189
239
  {
190
240
  type: TradeType.UniswapV2Swap,
191
241
  contract: "SUSHISWAP_ROUTER"
192
- },
242
+ }
193
243
  ]
194
244
  },
195
245
 
196
246
  COMP: {
247
+ name: "COMP",
248
+ decimals: 18,
249
+
197
250
  symbol: "COMP",
198
251
  type: TokenType.NORMAL_TOKEN,
199
252
  swapActions: [
@@ -208,11 +261,14 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
208
261
  {
209
262
  type: TradeType.UniswapV2Swap,
210
263
  contract: "SUSHISWAP_ROUTER"
211
- },
264
+ }
212
265
  ]
213
266
  },
214
267
 
215
268
  CRV: {
269
+ name: "CRV",
270
+ decimals: 18,
271
+
216
272
  symbol: "CRV",
217
273
  type: TokenType.NORMAL_TOKEN,
218
274
  swapActions: [
@@ -227,11 +283,14 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
227
283
  {
228
284
  type: TradeType.UniswapV2Swap,
229
285
  contract: "SUSHISWAP_ROUTER"
230
- },
286
+ }
231
287
  ]
232
288
  },
233
289
 
234
290
  DAI: {
291
+ name: "DAI",
292
+ decimals: 18,
293
+
235
294
  symbol: "DAI",
236
295
  type: TokenType.CONNECTOR,
237
296
  swapActions: [
@@ -251,6 +310,11 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
251
310
  type: TradeType.CurveExchange,
252
311
  contract: "CURVE_3CRV_POOL",
253
312
  tokenOut: ["USDC", "USDT"]
313
+ },
314
+ {
315
+ type: TradeType.CurveExchange,
316
+ contract: "CURVE_SUSD_POOL",
317
+ tokenOut: ["USDC", "USDT", "sUSD"]
254
318
  }
255
319
  ],
256
320
  lpActions: [
@@ -259,6 +323,11 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
259
323
  contract: "CURVE_3CRV_POOL",
260
324
  tokenOut: "3Crv"
261
325
  },
326
+ {
327
+ type: TradeType.CurveDepositLP,
328
+ contract: "CURVE_SUSD_POOL",
329
+ tokenOut: "crvPlain3andSUSD"
330
+ },
262
331
  {
263
332
  type: TradeType.YearnDeposit,
264
333
  contract: "YEARN_DAI_VAULT",
@@ -268,6 +337,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
268
337
  },
269
338
 
270
339
  DPI: {
340
+ name: "DPI",
341
+ decimals: 18,
342
+
271
343
  symbol: "DPI",
272
344
  type: TokenType.NORMAL_TOKEN,
273
345
  swapActions: [
@@ -287,6 +359,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
287
359
  },
288
360
 
289
361
  FEI: {
362
+ name: "FEI",
363
+ decimals: 18,
364
+
290
365
  symbol: "FEI",
291
366
  type: TokenType.NORMAL_TOKEN,
292
367
  swapActions: [
@@ -306,6 +381,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
306
381
  },
307
382
 
308
383
  LINK: {
384
+ name: "LINK",
385
+ decimals: 18,
386
+
309
387
  symbol: "LINK",
310
388
  type: TokenType.NORMAL_TOKEN,
311
389
  swapActions: [
@@ -325,6 +403,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
325
403
  },
326
404
 
327
405
  SNX: {
406
+ name: "SNX",
407
+ decimals: 18,
408
+
328
409
  symbol: "SNX",
329
410
  type: TokenType.NORMAL_TOKEN,
330
411
  swapActions: [
@@ -344,6 +425,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
344
425
  },
345
426
 
346
427
  SUSHI: {
428
+ name: "SUSHI",
429
+ decimals: 18,
430
+
347
431
  symbol: "SUSHI",
348
432
  type: TokenType.NORMAL_TOKEN,
349
433
  swapActions: [
@@ -355,6 +439,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
355
439
  },
356
440
 
357
441
  UNI: {
442
+ name: "UNI",
443
+ decimals: 18,
444
+
358
445
  symbol: "UNI",
359
446
  type: TokenType.NORMAL_TOKEN,
360
447
  swapActions: [
@@ -370,6 +457,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
370
457
  },
371
458
 
372
459
  USDC: {
460
+ name: "USDC",
461
+ decimals: 6,
462
+
373
463
  symbol: "USDC",
374
464
  type: TokenType.CONNECTOR,
375
465
  swapActions: [
@@ -389,11 +479,36 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
389
479
  type: TradeType.CurveExchange,
390
480
  contract: "CURVE_3CRV_POOL",
391
481
  tokenOut: ["DAI", "USDT"]
482
+ },
483
+ {
484
+ type: TradeType.CurveExchange,
485
+ contract: "CURVE_SUSD_POOL",
486
+ tokenOut: ["DAI", "USDT", "sUSD"]
487
+ }
488
+ ],
489
+ lpActions: [
490
+ {
491
+ type: TradeType.CurveDepositLP,
492
+ contract: "CURVE_3CRV_POOL",
493
+ tokenOut: "3Crv"
494
+ },
495
+ {
496
+ type: TradeType.CurveDepositLP,
497
+ contract: "CURVE_SUSD_POOL",
498
+ tokenOut: "crvPlain3andSUSD"
499
+ },
500
+ {
501
+ type: TradeType.YearnDeposit,
502
+ contract: "YEARN_USDC_VAULT",
503
+ tokenOut: "yvUSDC"
392
504
  }
393
505
  ]
394
506
  },
395
507
 
396
508
  USDT: {
509
+ name: "USDT",
510
+ decimals: 6,
511
+
397
512
  symbol: "USDT",
398
513
  type: TokenType.NORMAL_TOKEN,
399
514
  swapActions: [
@@ -413,11 +528,31 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
413
528
  type: TradeType.CurveExchange,
414
529
  contract: "CURVE_3CRV_POOL",
415
530
  tokenOut: ["USDC", "DAI"]
531
+ },
532
+ {
533
+ type: TradeType.CurveExchange,
534
+ contract: "CURVE_SUSD_POOL",
535
+ tokenOut: ["DAI", "USDC", "sUSD"]
536
+ }
537
+ ],
538
+ lpActions: [
539
+ {
540
+ type: TradeType.CurveDepositLP,
541
+ contract: "CURVE_3CRV_POOL",
542
+ tokenOut: "3Crv"
543
+ },
544
+ {
545
+ type: TradeType.CurveDepositLP,
546
+ contract: "CURVE_SUSD_POOL",
547
+ tokenOut: "crvPlain3andSUSD"
416
548
  }
417
549
  ]
418
550
  },
419
551
 
420
552
  WBTC: {
553
+ name: "WBTC",
554
+ decimals: 8,
555
+
421
556
  symbol: "WBTC",
422
557
  type: TokenType.CONNECTOR,
423
558
  swapActions: [
@@ -433,10 +568,20 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
433
568
  type: TradeType.UniswapV2Swap,
434
569
  contract: "SUSHISWAP_ROUTER"
435
570
  }
571
+ ],
572
+ lpActions: [
573
+ {
574
+ type: TradeType.YearnDeposit,
575
+ contract: "YEARN_WBTC_VAULT",
576
+ tokenOut: "yvWBTC"
577
+ }
436
578
  ]
437
579
  },
438
580
 
439
581
  WETH: {
582
+ name: "WETH",
583
+ decimals: 18,
584
+
440
585
  symbol: "WETH",
441
586
  type: TokenType.CONNECTOR,
442
587
  swapActions: [
@@ -457,10 +602,25 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
457
602
  contract: "CURVE_STETH_GATEWAY",
458
603
  tokenOut: ["STETH"]
459
604
  }
605
+ ],
606
+ lpActions: [
607
+ {
608
+ type: TradeType.YearnDeposit,
609
+ contract: "YEARN_WETH_VAULT",
610
+ tokenOut: "yvWETH"
611
+ },
612
+ {
613
+ type: TradeType.CurveDepositLP,
614
+ contract: "CURVE_STETH_GATEWAY",
615
+ tokenOut: "steCRV"
616
+ }
460
617
  ]
461
618
  },
462
619
 
463
620
  YFI: {
621
+ name: "YFI",
622
+ decimals: 18,
623
+
464
624
  symbol: "YFI",
465
625
  type: TokenType.NORMAL_TOKEN,
466
626
  swapActions: [
@@ -481,18 +641,43 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
481
641
 
482
642
  /// UPDATE
483
643
  STETH: {
644
+ name: "stETH",
645
+ decimals: 18,
646
+
484
647
  symbol: "STETH",
485
648
  type: TokenType.NORMAL_TOKEN,
486
649
  swapActions: [
650
+ {
651
+ type: TradeType.UniswapV3Swap,
652
+ contract: "UNISWAP_V3_ROUTER"
653
+ },
654
+ {
655
+ type: TradeType.UniswapV2Swap,
656
+ contract: "UNISWAP_V2_ROUTER"
657
+ },
658
+ {
659
+ type: TradeType.UniswapV2Swap,
660
+ contract: "SUSHISWAP_ROUTER"
661
+ },
487
662
  {
488
663
  type: TradeType.CurveExchange,
489
664
  contract: "CURVE_STETH_GATEWAY",
490
- tokenOut: ["STETH"]
665
+ tokenOut: ["WETH"]
666
+ }
667
+ ],
668
+ lpActions: [
669
+ {
670
+ type: TradeType.CurveDepositLP,
671
+ contract: "CURVE_STETH_GATEWAY",
672
+ tokenOut: "steCRV"
491
673
  }
492
674
  ]
493
675
  },
494
676
 
495
677
  FTM: {
678
+ name: "FTM",
679
+ decimals: 18,
680
+
496
681
  symbol: "FTM",
497
682
  type: TokenType.NORMAL_TOKEN,
498
683
  swapActions: [
@@ -507,16 +692,14 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
507
692
  {
508
693
  type: TradeType.UniswapV2Swap,
509
694
  contract: "SUSHISWAP_ROUTER"
510
- },
511
- {
512
- type: TradeType.CurveExchange,
513
- contract: "CURVE_STETH_GATEWAY",
514
- tokenOut: ["STETH"]
515
695
  }
516
696
  ]
517
697
  },
518
698
 
519
699
  CVX: {
700
+ name: "CVX",
701
+ decimals: 18,
702
+
520
703
  symbol: "CVX",
521
704
  type: TokenType.NORMAL_TOKEN,
522
705
  swapActions: [
@@ -531,16 +714,14 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
531
714
  {
532
715
  type: TradeType.UniswapV2Swap,
533
716
  contract: "SUSHISWAP_ROUTER"
534
- },
535
- {
536
- type: TradeType.CurveExchange,
537
- contract: "CURVE_STETH_GATEWAY",
538
- tokenOut: ["STETH"]
539
717
  }
540
718
  ]
541
719
  },
542
720
 
543
721
  FRAX: {
722
+ name: "FRAX",
723
+ decimals: 18,
724
+
544
725
  symbol: "FRAX",
545
726
  type: TokenType.NORMAL_TOKEN,
546
727
  swapActions: [
@@ -561,10 +742,20 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
561
742
  contract: "CURVE_FRAX_POOL",
562
743
  tokenOut: ["3Crv"]
563
744
  }
745
+ ],
746
+ lpActions: [
747
+ {
748
+ type: TradeType.CurveDepositLP,
749
+ contract: "CURVE_FRAX_POOL",
750
+ tokenOut: "FRAX3CRV"
751
+ }
564
752
  ]
565
753
  },
566
754
 
567
755
  FXS: {
756
+ name: "FXS",
757
+ decimals: 18,
758
+
568
759
  symbol: "FXS",
569
760
  type: TokenType.NORMAL_TOKEN,
570
761
  swapActions: [
@@ -584,6 +775,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
584
775
  },
585
776
 
586
777
  LDO: {
778
+ name: "LDO",
779
+ decimals: 18,
780
+
587
781
  symbol: "LDO",
588
782
  type: TokenType.NORMAL_TOKEN,
589
783
  swapActions: [
@@ -603,6 +797,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
603
797
  },
604
798
 
605
799
  SPELL: {
800
+ name: "SPELL",
801
+ decimals: 18,
802
+
606
803
  symbol: "SPELL",
607
804
  type: TokenType.NORMAL_TOKEN,
608
805
  swapActions: [
@@ -622,6 +819,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
622
819
  },
623
820
 
624
821
  LUSD: {
822
+ name: "LUSD",
823
+ decimals: 18,
824
+
625
825
  symbol: "LUSD",
626
826
  type: TokenType.NORMAL_TOKEN,
627
827
  swapActions: [
@@ -636,11 +836,26 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
636
836
  {
637
837
  type: TradeType.UniswapV2Swap,
638
838
  contract: "SUSHISWAP_ROUTER"
839
+ },
840
+ {
841
+ type: TradeType.CurveExchange,
842
+ contract: "CURVE_LUSD_POOL",
843
+ tokenOut: ["3Crv"]
844
+ }
845
+ ],
846
+ lpActions: [
847
+ {
848
+ type: TradeType.CurveDepositLP,
849
+ contract: "CURVE_LUSD_POOL",
850
+ tokenOut: "LUSD3CRV"
639
851
  }
640
852
  ]
641
853
  },
642
854
 
643
855
  sUSD: {
856
+ name: "sUSD",
857
+ decimals: 18,
858
+
644
859
  symbol: "sUSD",
645
860
  type: TokenType.NORMAL_TOKEN,
646
861
  swapActions: [
@@ -655,11 +870,26 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
655
870
  {
656
871
  type: TradeType.UniswapV2Swap,
657
872
  contract: "SUSHISWAP_ROUTER"
873
+ },
874
+ {
875
+ type: TradeType.CurveExchange,
876
+ contract: "CURVE_SUSD_POOL",
877
+ tokenOut: ["DAI", "USDT", "USDC"]
878
+ }
879
+ ],
880
+ lpActions: [
881
+ {
882
+ type: TradeType.CurveDepositLP,
883
+ contract: "CURVE_SUSD_POOL",
884
+ tokenOut: "crvPlain3andSUSD"
658
885
  }
659
886
  ]
660
887
  },
661
888
 
662
889
  GUSD: {
890
+ name: "GUSD",
891
+ decimals: 18,
892
+
663
893
  symbol: "GUSD",
664
894
  type: TokenType.NORMAL_TOKEN,
665
895
  swapActions: [
@@ -674,11 +904,26 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
674
904
  {
675
905
  type: TradeType.UniswapV2Swap,
676
906
  contract: "SUSHISWAP_ROUTER"
907
+ },
908
+ {
909
+ type: TradeType.CurveExchange,
910
+ contract: "CURVE_GUSD_POOL",
911
+ tokenOut: ["3Crv"]
912
+ }
913
+ ],
914
+ lpActions: [
915
+ {
916
+ type: TradeType.CurveDepositLP,
917
+ contract: "CURVE_GUSD_POOL",
918
+ tokenOut: "gusd3CRV"
677
919
  }
678
920
  ]
679
921
  },
680
922
 
681
923
  LUNA: {
924
+ name: "LUNA",
925
+ decimals: 18,
926
+
682
927
  symbol: "LUNA",
683
928
  type: TokenType.NORMAL_TOKEN,
684
929
  swapActions: [
@@ -696,7 +941,11 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
696
941
  }
697
942
  ]
698
943
  },
944
+
699
945
  LQTY: {
946
+ name: "LQTY",
947
+ decimals: 18,
948
+
700
949
  symbol: "LQTY",
701
950
  type: TokenType.NORMAL_TOKEN,
702
951
  swapActions: [
@@ -717,6 +966,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
717
966
 
718
967
  // YEARN TOKENS
719
968
  yvDAI: {
969
+ name: "yvDAI",
970
+ decimals: 18,
971
+
720
972
  symbol: "yvDAI",
721
973
  type: TokenType.YEARN_VAULT,
722
974
  underlying: "DAI",
@@ -730,6 +982,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
730
982
  },
731
983
 
732
984
  yvUSDC: {
985
+ name: "yvUSDC",
986
+ decimals: 6,
987
+
733
988
  symbol: "yvUSDC",
734
989
  type: TokenType.YEARN_VAULT,
735
990
  underlying: "USDC",
@@ -743,6 +998,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
743
998
  },
744
999
 
745
1000
  yvWETH: {
1001
+ name: "yvWETH",
1002
+ decimals: 18,
1003
+
746
1004
  symbol: "yvWETH",
747
1005
  type: TokenType.YEARN_VAULT,
748
1006
  underlying: "WETH",
@@ -756,6 +1014,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
756
1014
  },
757
1015
 
758
1016
  yvWBTC: {
1017
+ name: "yvWBTC",
1018
+ decimals: 8,
1019
+
759
1020
  symbol: "yvWBTC",
760
1021
  type: TokenType.YEARN_VAULT,
761
1022
  underlying: "WBTC",
@@ -770,6 +1031,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
770
1031
 
771
1032
  // CURVE LP TOKENS
772
1033
  "3Crv": {
1034
+ name: "3Crv",
1035
+ decimals: 18,
1036
+
773
1037
  symbol: "3Crv",
774
1038
  type: TokenType.CURVE_LP,
775
1039
  lpActions: [
@@ -777,147 +1041,440 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
777
1041
  type: TradeType.CurveWithdrawLP,
778
1042
  contract: "CURVE_3CRV_POOL",
779
1043
  tokenOut: ["DAI", "USDC", "USDT"]
1044
+ },
1045
+ {
1046
+ type: TradeType.ConvexDepositLP,
1047
+ contract: "CONVEX_BOOSTER",
1048
+ tokenOut: "cvx3Crv"
1049
+ },
1050
+ {
1051
+ type: TradeType.ConvexDepositLPAndStake,
1052
+ contract: "CONVEX_BOOSTER",
1053
+ tokenOut: "stkcvx3Crv"
780
1054
  }
781
1055
  ]
782
1056
  },
783
1057
 
784
1058
  steCRV: {
1059
+ name: "steCRV",
1060
+ decimals: 18,
1061
+
785
1062
  symbol: "steCRV",
786
1063
  type: TokenType.CURVE_LP,
787
1064
  lpActions: [
788
1065
  {
789
1066
  type: TradeType.CurveWithdrawLP,
790
1067
  contract: "CURVE_STETH_GATEWAY",
791
- tokenOut: ["STETH"]
1068
+ tokenOut: ["STETH", "WETH"]
1069
+ },
1070
+ {
1071
+ type: TradeType.ConvexDepositLP,
1072
+ contract: "CONVEX_BOOSTER",
1073
+ tokenOut: "cvxsteCRV"
1074
+ },
1075
+ {
1076
+ type: TradeType.ConvexDepositLPAndStake,
1077
+ contract: "CONVEX_BOOSTER",
1078
+ tokenOut: "stkcvxsteCRV"
792
1079
  }
793
1080
  ]
794
1081
  },
795
1082
 
796
1083
  crvPlain3andSUSD: {
1084
+ name: "crvPlain3andSUSD",
1085
+ decimals: 18,
1086
+
797
1087
  symbol: "crvPlain3andSUSD",
798
1088
  type: TokenType.CURVE_LP,
799
- lpActions: []
1089
+ lpActions: [
1090
+ {
1091
+ type: TradeType.CurveWithdrawLP,
1092
+ contract: "CURVE_SUSD_POOL",
1093
+ tokenOut: ["DAI", "USDC", "USDT", "sUSD"]
1094
+ },
1095
+ {
1096
+ type: TradeType.ConvexDepositLP,
1097
+ contract: "CONVEX_BOOSTER",
1098
+ tokenOut: "cvxcrvPlain3andSUSD"
1099
+ },
1100
+ {
1101
+ type: TradeType.ConvexDepositLPAndStake,
1102
+ contract: "CONVEX_BOOSTER",
1103
+ tokenOut: "stkcvxcrvPlain3andSUSD"
1104
+ }
1105
+ ]
800
1106
  },
801
1107
 
802
1108
  // META CURVE LP TOKENS
803
1109
  FRAX3CRV: {
1110
+ name: "FRAX3CRV-f",
1111
+ decimals: 18,
1112
+
804
1113
  symbol: "FRAX3CRV",
805
1114
  type: TokenType.META_CURVE_LP,
806
- lpActions: []
1115
+ lpActions: [
1116
+ {
1117
+ type: TradeType.CurveWithdrawLP,
1118
+ contract: "CURVE_FRAX_POOL",
1119
+ tokenOut: ["FRAX", "3Crv"]
1120
+ },
1121
+ {
1122
+ type: TradeType.ConvexDepositLP,
1123
+ contract: "CONVEX_BOOSTER",
1124
+ tokenOut: "cvxFRAX3CRV"
1125
+ },
1126
+ {
1127
+ type: TradeType.ConvexDepositLPAndStake,
1128
+ contract: "CONVEX_BOOSTER",
1129
+ tokenOut: "stkcvxFRAX3CRV"
1130
+ }
1131
+ ]
807
1132
  },
808
1133
 
809
1134
  LUSD3CRV: {
1135
+ name: "LUSD3CRV-f",
1136
+ decimals: 18,
1137
+
810
1138
  symbol: "LUSD3CRV",
811
1139
  type: TokenType.META_CURVE_LP,
812
- lpActions: []
1140
+ lpActions: [
1141
+ {
1142
+ type: TradeType.CurveWithdrawLP,
1143
+ contract: "CURVE_LUSD_POOL",
1144
+ tokenOut: ["LUSD", "3Crv"]
1145
+ }
1146
+ ]
813
1147
  },
814
1148
 
815
1149
  gusd3CRV: {
1150
+ name: "gusd3CRV",
1151
+ decimals: 18,
1152
+
816
1153
  symbol: "gusd3CRV",
817
1154
  type: TokenType.META_CURVE_LP,
818
- lpActions: []
1155
+ lpActions: [
1156
+ {
1157
+ type: TradeType.CurveWithdrawLP,
1158
+ contract: "CURVE_GUSD_POOL",
1159
+ tokenOut: ["GUSD", "3Crv"]
1160
+ },
1161
+ {
1162
+ type: TradeType.ConvexDepositLP,
1163
+ contract: "CONVEX_BOOSTER",
1164
+ tokenOut: "cvxgusd3CRV"
1165
+ },
1166
+ {
1167
+ type: TradeType.ConvexDepositLPAndStake,
1168
+ contract: "CONVEX_BOOSTER",
1169
+ tokenOut: "stkcvxgusd3CRV"
1170
+ }
1171
+ ]
819
1172
  },
820
1173
 
821
1174
  // CONVEX LP TOKENS
822
1175
  cvx3Crv: {
1176
+ name: "cvx3Crv",
1177
+ decimals: 18,
1178
+
823
1179
  symbol: "cvx3Crv",
824
1180
  type: TokenType.CONVEX_LP_TOKEN,
825
1181
  pool: "CONVEX_3CRV_POOL",
826
1182
  underlying: "3Crv",
827
1183
  stakedToken: "stkcvx3Crv",
828
- lpActions: []
1184
+ lpActions: [
1185
+ {
1186
+ type: TradeType.ConvexWithdrawLP,
1187
+ contract: "CONVEX_BOOSTER",
1188
+ tokenOut: "3Crv"
1189
+ },
1190
+ {
1191
+ type: TradeType.ConvexStake,
1192
+ contract: "CONVEX_3CRV_POOL",
1193
+ tokenOut: "stkcvx3Crv"
1194
+ }
1195
+ ]
829
1196
  },
830
1197
 
831
1198
  cvxsteCRV: {
1199
+ name: "cvxsteCRV",
1200
+ decimals: 18,
1201
+
832
1202
  symbol: "cvxsteCRV",
833
1203
  type: TokenType.CONVEX_LP_TOKEN,
834
1204
  pool: "CONVEX_STECRV_POOL",
835
1205
  underlying: "steCRV",
836
1206
  stakedToken: "stkcvxsteCRV",
837
- lpActions: []
1207
+ lpActions: [
1208
+ {
1209
+ type: TradeType.ConvexWithdrawLP,
1210
+ contract: "CONVEX_BOOSTER",
1211
+ tokenOut: "steCRV"
1212
+ },
1213
+ {
1214
+ type: TradeType.ConvexStake,
1215
+ contract: "CONVEX_STECRV_POOL",
1216
+ tokenOut: "stkcvxsteCRV"
1217
+ }
1218
+ ]
838
1219
  },
839
1220
 
840
1221
  cvxFRAX3CRV: {
1222
+ name: "cvxFRAX3CRV-f",
1223
+ decimals: 18,
1224
+
841
1225
  symbol: "cvxFRAX3CRV",
842
1226
  type: TokenType.CONVEX_LP_TOKEN,
843
1227
  pool: "CONVEX_FRAX3CRV_POOL",
844
1228
  underlying: "FRAX3CRV",
845
1229
  stakedToken: "stkcvxFRAX3CRV",
846
- lpActions: []
1230
+ lpActions: [
1231
+ {
1232
+ type: TradeType.ConvexWithdrawLP,
1233
+ contract: "CONVEX_BOOSTER",
1234
+ tokenOut: "FRAX3CRV"
1235
+ },
1236
+ {
1237
+ type: TradeType.ConvexStake,
1238
+ contract: "CONVEX_FRAX3CRV_POOL",
1239
+ tokenOut: "stkcvxFRAX3CRV"
1240
+ }
1241
+ ]
847
1242
  },
848
1243
 
849
1244
  cvxcrvPlain3andSUSD: {
1245
+ name: "cvxcrvPlain3andSUSD",
1246
+ decimals: 18,
1247
+
850
1248
  symbol: "cvxcrvPlain3andSUSD",
851
1249
  type: TokenType.CONVEX_LP_TOKEN,
852
1250
  pool: "CONVEX_SUSD_POOL",
853
1251
  underlying: "crvPlain3andSUSD",
854
1252
  stakedToken: "stkcvxcrvPlain3andSUSD",
855
- lpActions: []
1253
+ lpActions: [
1254
+ {
1255
+ type: TradeType.ConvexWithdrawLP,
1256
+ contract: "CONVEX_BOOSTER",
1257
+ tokenOut: "crvPlain3andSUSD"
1258
+ },
1259
+ {
1260
+ type: TradeType.ConvexStake,
1261
+ contract: "CONVEX_SUSD_POOL",
1262
+ tokenOut: "stkcvxcrvPlain3andSUSD"
1263
+ }
1264
+ ]
856
1265
  },
857
1266
 
858
1267
  cvxgusd3CRV: {
1268
+ name: "cvxgusd3CRV",
1269
+ decimals: 18,
1270
+
859
1271
  symbol: "cvxgusd3CRV",
860
1272
  type: TokenType.CONVEX_LP_TOKEN,
861
1273
  pool: "CONVEX_GUSD_POOL",
862
1274
  underlying: "gusd3CRV",
863
1275
  stakedToken: "stkcvxgusd3CRV",
864
- lpActions: []
865
- },
866
-
867
- // YEARN- CURVE TOKENS
868
- yvCurve_stETH: {
869
- symbol: "yvCurve_stETH",
870
- type: TokenType.YEARN_VAULT_OF_CURVE_LP,
871
- underlying: "steCRV",
872
- lpActions: []
873
- },
874
- yvCURVE_FRAX_POOL: {
875
- symbol: "yvCURVE_FRAX_POOL",
876
- type: TokenType.YEARN_VAULT_OF_META_CURVE_LP,
877
- underlying: "FRAX3CRV",
878
- lpActions: []
1276
+ lpActions: [
1277
+ {
1278
+ type: TradeType.ConvexWithdrawLP,
1279
+ contract: "CONVEX_BOOSTER",
1280
+ tokenOut: "gusd3CRV"
1281
+ },
1282
+ {
1283
+ type: TradeType.ConvexStake,
1284
+ contract: "CONVEX_GUSD_POOL",
1285
+ tokenOut: "stkcvxgusd3CRV"
1286
+ }
1287
+ ]
879
1288
  },
880
1289
 
881
1290
  // STAKED CONVEX
882
1291
  stkcvx3Crv: {
1292
+ name: "stkcvx3Crv",
1293
+ decimals: 18,
1294
+
883
1295
  symbol: "stkcvx3Crv",
884
1296
  type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN,
885
1297
  pool: "CONVEX_3CRV_POOL",
886
1298
  underlying: "3Crv",
887
1299
  lpToken: "cvx3Crv",
888
- lpActions: []
1300
+ lpActions: [
1301
+ {
1302
+ type: TradeType.ConvexWithdraw,
1303
+ contract: "CONVEX_3CRV_POOL",
1304
+ tokenOut: "cvx3Crv"
1305
+ },
1306
+ {
1307
+ type: TradeType.ConvexWithdrawAndUnwrap,
1308
+ contract: "CONVEX_3CRV_POOL",
1309
+ tokenOut: "3Crv"
1310
+ }
1311
+ ]
889
1312
  },
1313
+
890
1314
  stkcvxsteCRV: {
1315
+ name: "stkcvxsteCRV",
1316
+ decimals: 18,
1317
+
891
1318
  symbol: "stkcvxsteCRV",
892
1319
  type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN,
893
1320
  pool: "CONVEX_STECRV_POOL",
894
1321
  underlying: "steCRV",
895
1322
  lpToken: "cvxsteCRV",
896
- lpActions: []
1323
+ lpActions: [
1324
+ {
1325
+ type: TradeType.ConvexWithdraw,
1326
+ contract: "CONVEX_STECRV_POOL",
1327
+ tokenOut: "cvxsteCRV"
1328
+ },
1329
+ {
1330
+ type: TradeType.ConvexWithdrawAndUnwrap,
1331
+ contract: "CONVEX_STECRV_POOL",
1332
+ tokenOut: "steCRV"
1333
+ }
1334
+ ]
897
1335
  },
1336
+
898
1337
  stkcvxFRAX3CRV: {
1338
+ name: "stkcvxFRAX3CRV-f",
1339
+ decimals: 18,
1340
+
899
1341
  symbol: "stkcvxFRAX3CRV",
900
1342
  type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN,
901
1343
  pool: "CONVEX_FRAX3CRV_POOL",
902
1344
  underlying: "FRAX3CRV",
903
1345
  lpToken: "cvxFRAX3CRV",
904
- lpActions: []
1346
+ lpActions: [
1347
+ {
1348
+ type: TradeType.ConvexWithdraw,
1349
+ contract: "CONVEX_FRAX3CRV_POOL",
1350
+ tokenOut: "cvxFRAX3CRV"
1351
+ },
1352
+ {
1353
+ type: TradeType.ConvexWithdrawAndUnwrap,
1354
+ contract: "CONVEX_FRAX3CRV_POOL",
1355
+ tokenOut: "FRAX3CRV"
1356
+ }
1357
+ ]
905
1358
  },
1359
+
906
1360
  stkcvxcrvPlain3andSUSD: {
1361
+ name: "stkcvxcrvPlain3andSUSD",
1362
+ decimals: 18,
1363
+
907
1364
  symbol: "stkcvxcrvPlain3andSUSD",
908
1365
  type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN,
909
1366
  pool: "CONVEX_SUSD_POOL",
910
1367
  underlying: "crvPlain3andSUSD",
911
1368
  lpToken: "cvxcrvPlain3andSUSD",
912
- lpActions: []
1369
+ lpActions: [
1370
+ {
1371
+ type: TradeType.ConvexWithdraw,
1372
+ contract: "CONVEX_SUSD_POOL",
1373
+ tokenOut: "cvxcrvPlain3andSUSD"
1374
+ },
1375
+ {
1376
+ type: TradeType.ConvexWithdrawAndUnwrap,
1377
+ contract: "CONVEX_SUSD_POOL",
1378
+ tokenOut: "crvPlain3andSUSD"
1379
+ }
1380
+ ]
913
1381
  },
1382
+
914
1383
  stkcvxgusd3CRV: {
1384
+ name: "stkcvxgusd3CRV",
1385
+ decimals: 18,
1386
+
915
1387
  symbol: "stkcvxgusd3CRV",
916
1388
  type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN,
917
1389
  pool: "CONVEX_GUSD_POOL",
918
1390
  underlying: "gusd3CRV",
919
1391
  lpToken: "cvxgusd3CRV",
920
- lpActions: []
1392
+ lpActions: [
1393
+ {
1394
+ type: TradeType.ConvexWithdraw,
1395
+ contract: "CONVEX_GUSD_POOL",
1396
+ tokenOut: "cvxgusd3CRV"
1397
+ },
1398
+ {
1399
+ type: TradeType.ConvexWithdrawAndUnwrap,
1400
+ contract: "CONVEX_GUSD_POOL",
1401
+ tokenOut: "gusd3CRV"
1402
+ }
1403
+ ]
1404
+ },
1405
+
1406
+ // YEARN- CURVE TOKENS
1407
+ yvCurve_stETH: {
1408
+ name: "yvCurve-stETH",
1409
+ decimals: 18,
1410
+
1411
+ symbol: "yvCurve_stETH",
1412
+ type: TokenType.YEARN_VAULT_OF_CURVE_LP,
1413
+ underlying: "steCRV",
1414
+ lpActions: [
1415
+ {
1416
+ type: TradeType.YearnWithdraw,
1417
+ contract: "YEARN_CURVE_STETH_VAULT",
1418
+ tokenOut: "steCRV"
1419
+ }
1420
+ ]
1421
+ },
1422
+
1423
+ yvCURVE_FRAX_POOL: {
1424
+ name: "yvCurve-FRAX",
1425
+ decimals: 18,
1426
+
1427
+ symbol: "yvCURVE_FRAX_POOL",
1428
+ type: TokenType.YEARN_VAULT_OF_META_CURVE_LP,
1429
+ underlying: "FRAX3CRV",
1430
+ lpActions: [
1431
+ {
1432
+ type: TradeType.YearnWithdraw,
1433
+ contract: "YEARN_CURVE_FRAX_VAULT",
1434
+ tokenOut: "FRAX3CRV"
1435
+ }
1436
+ ]
1437
+ },
1438
+
1439
+ //GEARBOX
1440
+ dDAI: {
1441
+ name: "dDAI",
1442
+ decimals: 18,
1443
+
1444
+ symbol: "dDAI",
1445
+ type: TokenType.DIESEL_LP_TOKEN
1446
+ },
1447
+
1448
+ dUSDC: {
1449
+ name: "dUSDC",
1450
+ decimals: 6,
1451
+
1452
+ symbol: "dUSDC",
1453
+ type: TokenType.DIESEL_LP_TOKEN
1454
+ },
1455
+
1456
+ dWBTC: {
1457
+ name: "dWBTC",
1458
+ decimals: 8,
1459
+
1460
+ symbol: "dWBTC",
1461
+ type: TokenType.DIESEL_LP_TOKEN
1462
+ },
1463
+
1464
+ dWETH: {
1465
+ name: "dWETH",
1466
+ decimals: 18,
1467
+
1468
+ symbol: "dWETH",
1469
+ type: TokenType.DIESEL_LP_TOKEN
1470
+ },
1471
+
1472
+ GEAR: {
1473
+ name: "GEAR",
1474
+ decimals: 18,
1475
+
1476
+ symbol: "GEAR",
1477
+ type: TokenType.NORMAL_TOKEN
921
1478
  }
922
1479
  };
923
1480
 
@@ -989,7 +1546,15 @@ export const tokenDataByNetwork: Record<
989
1546
 
990
1547
  // YEARN- CURVE TOKENS
991
1548
  yvCurve_stETH: "0xdCD90C7f6324cfa40d7169ef80b12031770B4325",
992
- yvCURVE_FRAX_POOL: "0xB4AdA607B9d6b2c9Ee07A275e9616B84AC560139"
1549
+ yvCURVE_FRAX_POOL: "0xB4AdA607B9d6b2c9Ee07A275e9616B84AC560139",
1550
+
1551
+ //GEARBOX
1552
+ dDAI: "0x6CFaF95457d7688022FC53e7AbE052ef8DFBbdBA",
1553
+ dUSDC: "0xc411dB5f5Eb3f7d552F9B8454B2D74097ccdE6E3",
1554
+ dWBTC: "0xe753260F1955e8678DCeA8887759e07aa57E8c54",
1555
+ dWETH: "0xF21fc650C1B34eb0FDE786D52d23dA99Db3D6278",
1556
+
1557
+ GEAR: "0xBa3335588D9403515223F109EdC4eB7269a9Ab5D"
993
1558
  },
994
1559
 
995
1560
  //
@@ -1058,6 +1623,20 @@ export const tokenDataByNetwork: Record<
1058
1623
 
1059
1624
  // YEARN- CURVE TOKENS
1060
1625
  yvCurve_stETH: "0xdDc2FA328321573Bc2647C0135D75012c522CDAC",
1061
- yvCURVE_FRAX_POOL: ""
1626
+ yvCURVE_FRAX_POOL: "",
1627
+
1628
+ //GEARBOX
1629
+ dDAI: "0x6CFaF95457d7688022FC53e7AbE052ef8DFBbdBA",
1630
+ dUSDC: "0xc411dB5f5Eb3f7d552F9B8454B2D74097ccdE6E3",
1631
+ dWBTC: "0xe753260F1955e8678DCeA8887759e07aa57E8c54",
1632
+ dWETH: "0xF21fc650C1B34eb0FDE786D52d23dA99Db3D6278",
1633
+
1634
+ GEAR: "0xBa3335588D9403515223F109EdC4eB7269a9Ab5D"
1062
1635
  }
1063
1636
  };
1637
+
1638
+ export const tokenDataByAddress = objectEntries(tokenDataByNetwork).reduce<
1639
+ Record<string, SupportedToken>
1640
+ >((sum, [_, tokens]) => {
1641
+ return { ...sum, ...keyToLowercase(swapKeyValue(tokens)) };
1642
+ }, {});