@gearbox-protocol/sdk 0.0.53 → 0.0.56

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.
Files changed (63) hide show
  1. package/lib/core/contracts.d.ts +29 -16
  2. package/lib/core/contracts.js +45 -4
  3. package/lib/core/contractsRegister.js +24 -6
  4. package/lib/core/creditAccount.js +26 -20
  5. package/lib/core/events.d.ts +10 -10
  6. package/lib/core/events.js +22 -22
  7. package/lib/core/pathfinder.d.ts +35 -5
  8. package/lib/core/pathfinder.js +547 -67
  9. package/lib/core/priceFeeds.js +61 -0
  10. package/lib/core/token.d.ts +47 -15
  11. package/lib/core/token.js +204 -36
  12. package/lib/core/tradeTypes.d.ts +2 -0
  13. package/lib/core/transactions.d.ts +2 -2
  14. package/lib/core/transactions.js +10 -10
  15. package/lib/index.d.ts +2 -0
  16. package/lib/index.js +6 -1
  17. package/lib/pathfinder/connectorPathAsset.d.ts +7 -0
  18. package/lib/pathfinder/connectorPathAsset.js +144 -0
  19. package/lib/pathfinder/convexLPTokenPathAsset.d.ts +5 -0
  20. package/lib/pathfinder/convexLPTokenPathAsset.js +77 -0
  21. package/lib/pathfinder/curveLPPathAsset.d.ts +5 -0
  22. package/lib/pathfinder/curveLPPathAsset.js +72 -0
  23. package/lib/pathfinder/metaCurveLPPathAsset.d.ts +5 -0
  24. package/lib/pathfinder/metaCurveLPPathAsset.js +72 -0
  25. package/lib/pathfinder/normalTokenPathAsset.d.ts +5 -0
  26. package/lib/pathfinder/normalTokenPathAsset.js +136 -0
  27. package/lib/pathfinder/path.d.ts +41 -0
  28. package/lib/pathfinder/path.js +302 -0
  29. package/lib/pathfinder/pathfinder.d.ts +28 -0
  30. package/lib/pathfinder/pathfinder.js +519 -0
  31. package/lib/pathfinder/yearnVaultOfCurveLPPathAsset.d.ts +5 -0
  32. package/lib/pathfinder/yearnVaultOfCurveLPPathAsset.js +87 -0
  33. package/lib/pathfinder/yearnVaultOfMetaCurveLPPathAsset.d.ts +5 -0
  34. package/lib/pathfinder/yearnVaultOfMetaCurveLPPathAsset.js +87 -0
  35. package/lib/pathfinder/yearnVaultPathAsset.d.ts +5 -0
  36. package/lib/pathfinder/yearnVaultPathAsset.js +87 -0
  37. package/lib/utils/mappers.d.ts +6 -0
  38. package/lib/utils/mappers.js +33 -0
  39. package/lib/utils/types.d.ts +3 -0
  40. package/lib/utils/types.js +2 -0
  41. package/package.json +1 -1
  42. package/src/core/adapters.ts +13 -15
  43. package/src/core/contracts.ts +111 -44
  44. package/src/core/contractsRegister.ts +16 -8
  45. package/src/core/creditAccount.ts +33 -19
  46. package/src/core/events.ts +30 -22
  47. package/src/core/priceFeeds.ts +66 -0
  48. package/src/core/token.ts +645 -370
  49. package/src/core/tradeTypes.ts +2 -0
  50. package/src/core/transactions.ts +10 -10
  51. package/src/index.ts +2 -0
  52. package/src/pathfinder/connectorPathAsset.ts +69 -0
  53. package/src/pathfinder/convexLPTokenPathAsset.ts +33 -0
  54. package/src/pathfinder/curveLPPathAsset.ts +10 -0
  55. package/src/pathfinder/metaCurveLPPathAsset.ts +12 -0
  56. package/src/pathfinder/normalTokenPathAsset.ts +68 -0
  57. package/src/pathfinder/path.ts +259 -0
  58. package/src/pathfinder/yearnVaultOfCurveLPPathAsset.ts +22 -0
  59. package/src/pathfinder/yearnVaultOfMetaCurveLPPathAsset.ts +22 -0
  60. package/src/pathfinder/yearnVaultPathAsset.ts +27 -0
  61. package/src/utils/mappers.ts +23 -0
  62. package/src/utils/types.ts +3 -0
  63. package/src/core/pathfinder.ts +0 -115
package/src/core/token.ts CHANGED
@@ -1,6 +1,9 @@
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";
5
+ import { PartialRecord } from "../utils/types";
6
+ import { BigNumber } from "ethers";
4
7
 
5
8
  export enum TokenType {
6
9
  CONNECTOR,
@@ -11,7 +14,8 @@ export enum TokenType {
11
14
  YEARN_VAULT_OF_CURVE_LP,
12
15
  YEARN_VAULT_OF_META_CURVE_LP,
13
16
  CONVEX_LP_TOKEN,
14
- CONVEX_STAKED_PHANTOM_TOKEN
17
+ CONVEX_STAKED_PHANTOM_TOKEN,
18
+ DIESEL_LP_TOKEN
15
19
  }
16
20
 
17
21
  export const priority: Record<TokenType, number> = {
@@ -23,9 +27,18 @@ export const priority: Record<TokenType, number> = {
23
27
  [TokenType.YEARN_VAULT_OF_CURVE_LP]: 4,
24
28
  [TokenType.CONVEX_LP_TOKEN]: 5,
25
29
  [TokenType.YEARN_VAULT_OF_META_CURVE_LP]: 5,
26
- [TokenType.CONVEX_STAKED_PHANTOM_TOKEN]: 5
30
+ [TokenType.CONVEX_STAKED_PHANTOM_TOKEN]: 5,
31
+ [TokenType.DIESEL_LP_TOKEN]: 6
27
32
  };
28
33
 
34
+ export const Curve3CrvUnderlyingTokenIndex: PartialRecord<SupportedToken, BigNumber> = {
35
+ DAI: BigNumber.from(0),
36
+ USDC: BigNumber.from(1),
37
+ USDT: BigNumber.from(2)
38
+ }
39
+
40
+ export const ConnectorTokens: Array<SupportedToken> = ["DAI", "USDC", "WETH", "WBTC"];
41
+
29
42
  export type NormalToken =
30
43
  | "1INCH"
31
44
  | "AAVE"
@@ -88,74 +101,120 @@ export type ConvexStakedPhantomToken =
88
101
  | "stkcvxcrvPlain3andSUSD"
89
102
  | "stkcvxgusd3CRV";
90
103
 
104
+ export type DieselTokenTypes = "dDAI" | "dUSDC" | "dWBTC" | "dWETH";
105
+ export type GearboxToken = "GEAR";
106
+
91
107
  export type SupportedToken =
92
108
  | NormalToken
93
109
  | YearnLPToken
94
110
  | CurveLPToken
95
111
  | ConvexLPToken
96
- | ConvexStakedPhantomToken;
112
+ | ConvexStakedPhantomToken
113
+ | DieselTokenTypes
114
+ | GearboxToken;
115
+
116
+ export interface TokenBase {
117
+ name: string;
118
+ symbol: string;
119
+ decimals: number;
120
+ }
121
+
122
+ type NormalConnectorTokenData = {
123
+ symbol: NormalToken;
124
+ type: TokenType.CONNECTOR;
125
+ swapActions: Array<TradeAction>;
126
+ lpActions?: Array<TradeAction>;
127
+ } & TokenBase;
128
+
129
+ type NormalTokenData = {
130
+ symbol: NormalToken;
131
+ type: TokenType.NORMAL_TOKEN;
132
+ swapActions: Array<TradeAction>;
133
+ lpActions?: Array<TradeAction>;
134
+ } & TokenBase;
135
+
136
+ type CurveLPTokenData = {
137
+ symbol: CurveLPToken;
138
+ type: TokenType.CURVE_LP;
139
+ swapActions?: Array<TradeAction>;
140
+ lpActions: Array<TradeAction>;
141
+ } & TokenBase;
142
+
143
+ type MetaCurveLPTokenData = {
144
+ symbol: CurveLPToken;
145
+ type: TokenType.META_CURVE_LP;
146
+ lpActions: Array<TradeAction>;
147
+ } & TokenBase;
148
+
149
+ type YearnVaultTokenData = {
150
+ symbol: YearnLPToken;
151
+ type: TokenType.YEARN_VAULT;
152
+ underlying: NormalToken;
153
+ lpActions: Array<TradeAction>;
154
+ } & TokenBase;
155
+
156
+ type YearnVaultOfCurveLPTokenData = {
157
+ symbol: YearnLPToken;
158
+ type: TokenType.YEARN_VAULT_OF_CURVE_LP;
159
+ underlying: CurveLPToken;
160
+ lpActions: Array<TradeAction>;
161
+ } & TokenBase;
162
+
163
+ type YearnVaultOfMetaCurveLPTokenData = {
164
+ symbol: YearnLPToken;
165
+ type: TokenType.YEARN_VAULT_OF_META_CURVE_LP;
166
+ underlying: CurveLPToken;
167
+ lpActions: Array<TradeAction>;
168
+ } & TokenBase;
169
+
170
+ type ConvexLPTokenData = {
171
+ symbol: ConvexLPToken;
172
+ type: TokenType.CONVEX_LP_TOKEN;
173
+ pool: ConvexPoolContract;
174
+ underlying: CurveLPToken;
175
+ stakedToken: ConvexStakedPhantomToken;
176
+ lpActions: Array<TradeAction>;
177
+ } & TokenBase;
178
+
179
+ type ConvexPhantomTokenData = {
180
+ symbol: ConvexStakedPhantomToken;
181
+ type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN;
182
+ pool: ConvexPoolContract;
183
+ underlying: CurveLPToken;
184
+ lpToken: ConvexLPToken;
185
+ lpActions: Array<TradeAction>;
186
+ } & TokenBase;
187
+
188
+ type DieselTokenData = {
189
+ symbol: DieselTokenTypes;
190
+ type: TokenType.DIESEL_LP_TOKEN;
191
+ } & TokenBase;
192
+
193
+ type GearboxTokenData = {
194
+ symbol: GearboxToken;
195
+ swapActions?: Array<TradeAction>;
196
+ type: TokenType.NORMAL_TOKEN;
197
+ } & TokenBase;
97
198
 
98
199
  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
- };
200
+ | NormalConnectorTokenData
201
+ | NormalTokenData
202
+ | CurveLPTokenData
203
+ | MetaCurveLPTokenData
204
+ | YearnVaultTokenData
205
+ | YearnVaultOfCurveLPTokenData
206
+ | YearnVaultOfMetaCurveLPTokenData
207
+ | ConvexLPTokenData
208
+ | ConvexPhantomTokenData
209
+ | DieselTokenData
210
+ | GearboxTokenData;
156
211
 
157
212
  export const supportedTokens: Record<SupportedToken, TokenDataI> = {
213
+
158
214
  "1INCH": {
215
+ name: "1INCH",
216
+ decimals: 18,
217
+
159
218
  symbol: "1INCH",
160
219
  type: TokenType.NORMAL_TOKEN,
161
220
  swapActions: [
@@ -170,11 +229,14 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
170
229
  {
171
230
  type: TradeType.UniswapV2Swap,
172
231
  contract: "SUSHISWAP_ROUTER"
173
- },
232
+ }
174
233
  ]
175
234
  },
176
235
 
177
236
  AAVE: {
237
+ name: "AAVE",
238
+ decimals: 18,
239
+
178
240
  symbol: "AAVE",
179
241
  type: TokenType.NORMAL_TOKEN,
180
242
  swapActions: [
@@ -189,11 +251,14 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
189
251
  {
190
252
  type: TradeType.UniswapV2Swap,
191
253
  contract: "SUSHISWAP_ROUTER"
192
- },
254
+ }
193
255
  ]
194
256
  },
195
257
 
196
258
  COMP: {
259
+ name: "COMP",
260
+ decimals: 18,
261
+
197
262
  symbol: "COMP",
198
263
  type: TokenType.NORMAL_TOKEN,
199
264
  swapActions: [
@@ -208,11 +273,14 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
208
273
  {
209
274
  type: TradeType.UniswapV2Swap,
210
275
  contract: "SUSHISWAP_ROUTER"
211
- },
276
+ }
212
277
  ]
213
278
  },
214
279
 
215
280
  CRV: {
281
+ name: "CRV",
282
+ decimals: 18,
283
+
216
284
  symbol: "CRV",
217
285
  type: TokenType.NORMAL_TOKEN,
218
286
  swapActions: [
@@ -227,11 +295,14 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
227
295
  {
228
296
  type: TradeType.UniswapV2Swap,
229
297
  contract: "SUSHISWAP_ROUTER"
230
- },
298
+ }
231
299
  ]
232
300
  },
233
301
 
234
302
  DAI: {
303
+ name: "DAI",
304
+ decimals: 18,
305
+
235
306
  symbol: "DAI",
236
307
  type: TokenType.CONNECTOR,
237
308
  swapActions: [
@@ -256,7 +327,7 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
256
327
  type: TradeType.CurveExchange,
257
328
  contract: "CURVE_SUSD_POOL",
258
329
  tokenOut: ["USDC", "USDT", "sUSD"]
259
- },
330
+ }
260
331
  ],
261
332
  lpActions: [
262
333
  {
@@ -278,6 +349,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
278
349
  },
279
350
 
280
351
  DPI: {
352
+ name: "DPI",
353
+ decimals: 18,
354
+
281
355
  symbol: "DPI",
282
356
  type: TokenType.NORMAL_TOKEN,
283
357
  swapActions: [
@@ -297,6 +371,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
297
371
  },
298
372
 
299
373
  FEI: {
374
+ name: "FEI",
375
+ decimals: 18,
376
+
300
377
  symbol: "FEI",
301
378
  type: TokenType.NORMAL_TOKEN,
302
379
  swapActions: [
@@ -316,6 +393,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
316
393
  },
317
394
 
318
395
  LINK: {
396
+ name: "LINK",
397
+ decimals: 18,
398
+
319
399
  symbol: "LINK",
320
400
  type: TokenType.NORMAL_TOKEN,
321
401
  swapActions: [
@@ -335,6 +415,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
335
415
  },
336
416
 
337
417
  SNX: {
418
+ name: "SNX",
419
+ decimals: 18,
420
+
338
421
  symbol: "SNX",
339
422
  type: TokenType.NORMAL_TOKEN,
340
423
  swapActions: [
@@ -354,6 +437,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
354
437
  },
355
438
 
356
439
  SUSHI: {
440
+ name: "SUSHI",
441
+ decimals: 18,
442
+
357
443
  symbol: "SUSHI",
358
444
  type: TokenType.NORMAL_TOKEN,
359
445
  swapActions: [
@@ -365,6 +451,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
365
451
  },
366
452
 
367
453
  UNI: {
454
+ name: "UNI",
455
+ decimals: 18,
456
+
368
457
  symbol: "UNI",
369
458
  type: TokenType.NORMAL_TOKEN,
370
459
  swapActions: [
@@ -380,6 +469,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
380
469
  },
381
470
 
382
471
  USDC: {
472
+ name: "USDC",
473
+ decimals: 6,
474
+
383
475
  symbol: "USDC",
384
476
  type: TokenType.CONNECTOR,
385
477
  swapActions: [
@@ -407,25 +499,28 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
407
499
  }
408
500
  ],
409
501
  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
- }
502
+ {
503
+ type: TradeType.CurveDepositLP,
504
+ contract: "CURVE_3CRV_POOL",
505
+ tokenOut: "3Crv"
506
+ },
507
+ {
508
+ type: TradeType.CurveDepositLP,
509
+ contract: "CURVE_SUSD_POOL",
510
+ tokenOut: "crvPlain3andSUSD"
511
+ },
512
+ {
513
+ type: TradeType.YearnDeposit,
514
+ contract: "YEARN_USDC_VAULT",
515
+ tokenOut: "yvUSDC"
516
+ }
425
517
  ]
426
518
  },
427
519
 
428
520
  USDT: {
521
+ name: "USDT",
522
+ decimals: 6,
523
+
429
524
  symbol: "USDT",
430
525
  type: TokenType.NORMAL_TOKEN,
431
526
  swapActions: [
@@ -450,23 +545,26 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
450
545
  type: TradeType.CurveExchange,
451
546
  contract: "CURVE_SUSD_POOL",
452
547
  tokenOut: ["DAI", "USDC", "sUSD"]
453
- },
548
+ }
454
549
  ],
455
550
  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
- }
551
+ {
552
+ type: TradeType.CurveDepositLP,
553
+ contract: "CURVE_3CRV_POOL",
554
+ tokenOut: "3Crv"
555
+ },
556
+ {
557
+ type: TradeType.CurveDepositLP,
558
+ contract: "CURVE_SUSD_POOL",
559
+ tokenOut: "crvPlain3andSUSD"
560
+ }
466
561
  ]
467
562
  },
468
563
 
469
564
  WBTC: {
565
+ name: "WBTC",
566
+ decimals: 8,
567
+
470
568
  symbol: "WBTC",
471
569
  type: TokenType.CONNECTOR,
472
570
  swapActions: [
@@ -484,15 +582,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
484
582
  }
485
583
  ],
486
584
  lpActions: [
487
- {
488
- type: TradeType.YearnDeposit,
489
- contract: "YEARN_WBTC_VAULT",
490
- tokenOut: "yvWBTC"
491
- }
585
+ {
586
+ type: TradeType.YearnDeposit,
587
+ contract: "YEARN_WBTC_VAULT",
588
+ tokenOut: "yvWBTC"
589
+ }
492
590
  ]
493
591
  },
494
592
 
495
593
  WETH: {
594
+ name: "WETH",
595
+ decimals: 18,
596
+
496
597
  symbol: "WETH",
497
598
  type: TokenType.CONNECTOR,
498
599
  swapActions: [
@@ -513,22 +614,25 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
513
614
  contract: "CURVE_STETH_GATEWAY",
514
615
  tokenOut: ["STETH"]
515
616
  }
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
- ]
617
+ ],
618
+ lpActions: [
619
+ {
620
+ type: TradeType.YearnDeposit,
621
+ contract: "YEARN_WETH_VAULT",
622
+ tokenOut: "yvWETH"
623
+ },
624
+ {
625
+ type: TradeType.CurveDepositLP,
626
+ contract: "CURVE_STETH_GATEWAY",
627
+ tokenOut: "steCRV"
628
+ }
629
+ ]
529
630
  },
530
631
 
531
632
  YFI: {
633
+ name: "YFI",
634
+ decimals: 18,
635
+
532
636
  symbol: "YFI",
533
637
  type: TokenType.NORMAL_TOKEN,
534
638
  swapActions: [
@@ -549,37 +653,43 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
549
653
 
550
654
  /// UPDATE
551
655
  STETH: {
656
+ name: "stETH",
657
+ decimals: 18,
658
+
552
659
  symbol: "STETH",
553
660
  type: TokenType.NORMAL_TOKEN,
554
661
  swapActions: [
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
- {
662
+ {
663
+ type: TradeType.UniswapV3Swap,
664
+ contract: "UNISWAP_V3_ROUTER"
665
+ },
666
+ {
667
+ type: TradeType.UniswapV2Swap,
668
+ contract: "UNISWAP_V2_ROUTER"
669
+ },
670
+ {
671
+ type: TradeType.UniswapV2Swap,
672
+ contract: "SUSHISWAP_ROUTER"
673
+ },
674
+ {
568
675
  type: TradeType.CurveExchange,
569
676
  contract: "CURVE_STETH_GATEWAY",
570
677
  tokenOut: ["WETH"]
571
- }
678
+ }
572
679
  ],
573
680
  lpActions: [
574
- {
575
- type: TradeType.CurveDepositLP,
576
- contract: "CURVE_STETH_GATEWAY",
577
- tokenOut: "steCRV"
578
- },
681
+ {
682
+ type: TradeType.CurveDepositLP,
683
+ contract: "CURVE_STETH_GATEWAY",
684
+ tokenOut: "steCRV"
685
+ }
579
686
  ]
580
687
  },
581
688
 
582
689
  FTM: {
690
+ name: "FTM",
691
+ decimals: 18,
692
+
583
693
  symbol: "FTM",
584
694
  type: TokenType.NORMAL_TOKEN,
585
695
  swapActions: [
@@ -599,6 +709,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
599
709
  },
600
710
 
601
711
  CVX: {
712
+ name: "CVX",
713
+ decimals: 18,
714
+
602
715
  symbol: "CVX",
603
716
  type: TokenType.NORMAL_TOKEN,
604
717
  swapActions: [
@@ -618,6 +731,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
618
731
  },
619
732
 
620
733
  FRAX: {
734
+ name: "FRAX",
735
+ decimals: 18,
736
+
621
737
  symbol: "FRAX",
622
738
  type: TokenType.NORMAL_TOKEN,
623
739
  swapActions: [
@@ -640,15 +756,18 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
640
756
  }
641
757
  ],
642
758
  lpActions: [
643
- {
644
- type: TradeType.CurveDepositLP,
645
- contract: "CURVE_FRAX_POOL",
646
- tokenOut: "FRAX3CRV"
647
- }
759
+ {
760
+ type: TradeType.CurveDepositLP,
761
+ contract: "CURVE_FRAX_POOL",
762
+ tokenOut: "FRAX3CRV"
763
+ }
648
764
  ]
649
765
  },
650
766
 
651
767
  FXS: {
768
+ name: "FXS",
769
+ decimals: 18,
770
+
652
771
  symbol: "FXS",
653
772
  type: TokenType.NORMAL_TOKEN,
654
773
  swapActions: [
@@ -668,6 +787,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
668
787
  },
669
788
 
670
789
  LDO: {
790
+ name: "LDO",
791
+ decimals: 18,
792
+
671
793
  symbol: "LDO",
672
794
  type: TokenType.NORMAL_TOKEN,
673
795
  swapActions: [
@@ -687,6 +809,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
687
809
  },
688
810
 
689
811
  SPELL: {
812
+ name: "SPELL",
813
+ decimals: 18,
814
+
690
815
  symbol: "SPELL",
691
816
  type: TokenType.NORMAL_TOKEN,
692
817
  swapActions: [
@@ -706,99 +831,111 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
706
831
  },
707
832
 
708
833
  LUSD: {
834
+ name: "LUSD",
835
+ decimals: 18,
836
+
709
837
  symbol: "LUSD",
710
838
  type: TokenType.NORMAL_TOKEN,
711
839
  swapActions: [
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
- }
840
+ {
841
+ type: TradeType.UniswapV3Swap,
842
+ contract: "UNISWAP_V3_ROUTER"
843
+ },
844
+ {
845
+ type: TradeType.UniswapV2Swap,
846
+ contract: "UNISWAP_V2_ROUTER"
847
+ },
848
+ {
849
+ type: TradeType.UniswapV2Swap,
850
+ contract: "SUSHISWAP_ROUTER"
851
+ },
852
+ {
853
+ type: TradeType.CurveExchange,
854
+ contract: "CURVE_LUSD_POOL",
855
+ tokenOut: ["3Crv"]
856
+ }
729
857
  ],
730
858
  lpActions: [
731
- {
732
- type: TradeType.CurveDepositLP,
733
- contract: "CURVE_LUSD_POOL",
734
- tokenOut: "LUSD3CRV"
735
- }
859
+ {
860
+ type: TradeType.CurveDepositLP,
861
+ contract: "CURVE_LUSD_POOL",
862
+ tokenOut: "LUSD3CRV"
863
+ }
736
864
  ]
737
865
  },
738
866
 
739
867
  sUSD: {
868
+ name: "sUSD",
869
+ decimals: 18,
870
+
740
871
  symbol: "sUSD",
741
872
  type: TokenType.NORMAL_TOKEN,
742
873
  swapActions: [
743
874
  {
744
875
  type: TradeType.UniswapV3Swap,
745
876
  contract: "UNISWAP_V3_ROUTER"
746
- },
747
- {
877
+ },
878
+ {
748
879
  type: TradeType.UniswapV2Swap,
749
880
  contract: "UNISWAP_V2_ROUTER"
750
- },
751
- {
881
+ },
882
+ {
752
883
  type: TradeType.UniswapV2Swap,
753
884
  contract: "SUSHISWAP_ROUTER"
754
- },
755
- {
756
- type: TradeType.CurveExchange,
757
- contract: "CURVE_SUSD_POOL",
758
- tokenOut: ["DAI", "USDT", "USDC"]
759
- }
885
+ },
886
+ {
887
+ type: TradeType.CurveExchange,
888
+ contract: "CURVE_SUSD_POOL",
889
+ tokenOut: ["DAI", "USDT", "USDC"]
890
+ }
760
891
  ],
761
892
  lpActions: [
762
- {
763
- type: TradeType.CurveDepositLP,
764
- contract: "CURVE_SUSD_POOL",
765
- tokenOut: "crvPlain3andSUSD"
766
- }
893
+ {
894
+ type: TradeType.CurveDepositLP,
895
+ contract: "CURVE_SUSD_POOL",
896
+ tokenOut: "crvPlain3andSUSD"
897
+ }
767
898
  ]
768
899
  },
769
900
 
770
901
  GUSD: {
902
+ name: "GUSD",
903
+ decimals: 18,
904
+
771
905
  symbol: "GUSD",
772
906
  type: TokenType.NORMAL_TOKEN,
773
907
  swapActions: [
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
- }
908
+ {
909
+ type: TradeType.UniswapV3Swap,
910
+ contract: "UNISWAP_V3_ROUTER"
911
+ },
912
+ {
913
+ type: TradeType.UniswapV2Swap,
914
+ contract: "UNISWAP_V2_ROUTER"
915
+ },
916
+ {
917
+ type: TradeType.UniswapV2Swap,
918
+ contract: "SUSHISWAP_ROUTER"
919
+ },
920
+ {
921
+ type: TradeType.CurveExchange,
922
+ contract: "CURVE_GUSD_POOL",
923
+ tokenOut: ["3Crv"]
924
+ }
791
925
  ],
792
926
  lpActions: [
793
- {
794
- type: TradeType.CurveDepositLP,
795
- contract: "CURVE_GUSD_POOL",
796
- tokenOut: "gusd3CRV"
797
- }
927
+ {
928
+ type: TradeType.CurveDepositLP,
929
+ contract: "CURVE_GUSD_POOL",
930
+ tokenOut: "gusd3CRV"
931
+ }
798
932
  ]
799
933
  },
800
934
 
801
935
  LUNA: {
936
+ name: "LUNA",
937
+ decimals: 18,
938
+
802
939
  symbol: "LUNA",
803
940
  type: TokenType.NORMAL_TOKEN,
804
941
  swapActions: [
@@ -816,7 +953,11 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
816
953
  }
817
954
  ]
818
955
  },
956
+
819
957
  LQTY: {
958
+ name: "LQTY",
959
+ decimals: 18,
960
+
820
961
  symbol: "LQTY",
821
962
  type: TokenType.NORMAL_TOKEN,
822
963
  swapActions: [
@@ -837,6 +978,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
837
978
 
838
979
  // YEARN TOKENS
839
980
  yvDAI: {
981
+ name: "yvDAI",
982
+ decimals: 18,
983
+
840
984
  symbol: "yvDAI",
841
985
  type: TokenType.YEARN_VAULT,
842
986
  underlying: "DAI",
@@ -850,6 +994,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
850
994
  },
851
995
 
852
996
  yvUSDC: {
997
+ name: "yvUSDC",
998
+ decimals: 6,
999
+
853
1000
  symbol: "yvUSDC",
854
1001
  type: TokenType.YEARN_VAULT,
855
1002
  underlying: "USDC",
@@ -863,6 +1010,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
863
1010
  },
864
1011
 
865
1012
  yvWETH: {
1013
+ name: "yvWETH",
1014
+ decimals: 18,
1015
+
866
1016
  symbol: "yvWETH",
867
1017
  type: TokenType.YEARN_VAULT,
868
1018
  underlying: "WETH",
@@ -876,6 +1026,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
876
1026
  },
877
1027
 
878
1028
  yvWBTC: {
1029
+ name: "yvWBTC",
1030
+ decimals: 8,
1031
+
879
1032
  symbol: "yvWBTC",
880
1033
  type: TokenType.YEARN_VAULT,
881
1034
  underlying: "WBTC",
@@ -890,6 +1043,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
890
1043
 
891
1044
  // CURVE LP TOKENS
892
1045
  "3Crv": {
1046
+ name: "3Crv",
1047
+ decimals: 18,
1048
+
893
1049
  symbol: "3Crv",
894
1050
  type: TokenType.CURVE_LP,
895
1051
  lpActions: [
@@ -912,6 +1068,9 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
912
1068
  },
913
1069
 
914
1070
  steCRV: {
1071
+ name: "steCRV",
1072
+ decimals: 18,
1073
+
915
1074
  symbol: "steCRV",
916
1075
  type: TokenType.CURVE_LP,
917
1076
  lpActions: [
@@ -934,306 +1093,400 @@ export const supportedTokens: Record<SupportedToken, TokenDataI> = {
934
1093
  },
935
1094
 
936
1095
  crvPlain3andSUSD: {
1096
+ name: "crvPlain3andSUSD",
1097
+ decimals: 18,
1098
+
937
1099
  symbol: "crvPlain3andSUSD",
938
1100
  type: TokenType.CURVE_LP,
939
1101
  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
- }
1102
+ {
1103
+ type: TradeType.CurveWithdrawLP,
1104
+ contract: "CURVE_SUSD_POOL",
1105
+ tokenOut: ["DAI", "USDC", "USDT", "sUSD"]
1106
+ },
1107
+ {
1108
+ type: TradeType.ConvexDepositLP,
1109
+ contract: "CONVEX_BOOSTER",
1110
+ tokenOut: "cvxcrvPlain3andSUSD"
1111
+ },
1112
+ {
1113
+ type: TradeType.ConvexDepositLPAndStake,
1114
+ contract: "CONVEX_BOOSTER",
1115
+ tokenOut: "stkcvxcrvPlain3andSUSD"
1116
+ }
955
1117
  ]
956
1118
  },
957
1119
 
958
1120
  // META CURVE LP TOKENS
959
1121
  FRAX3CRV: {
1122
+ name: "FRAX3CRV-f",
1123
+ decimals: 18,
1124
+
960
1125
  symbol: "FRAX3CRV",
961
1126
  type: TokenType.META_CURVE_LP,
962
1127
  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
- }
1128
+ {
1129
+ type: TradeType.CurveWithdrawLP,
1130
+ contract: "CURVE_FRAX_POOL",
1131
+ tokenOut: ["FRAX", "3Crv"]
1132
+ },
1133
+ {
1134
+ type: TradeType.ConvexDepositLP,
1135
+ contract: "CONVEX_BOOSTER",
1136
+ tokenOut: "cvxFRAX3CRV"
1137
+ },
1138
+ {
1139
+ type: TradeType.ConvexDepositLPAndStake,
1140
+ contract: "CONVEX_BOOSTER",
1141
+ tokenOut: "stkcvxFRAX3CRV"
1142
+ }
978
1143
  ]
979
1144
  },
980
1145
 
981
1146
  LUSD3CRV: {
1147
+ name: "LUSD3CRV-f",
1148
+ decimals: 18,
1149
+
982
1150
  symbol: "LUSD3CRV",
983
1151
  type: TokenType.META_CURVE_LP,
984
1152
  lpActions: [
985
- {
986
- type: TradeType.CurveWithdrawLP,
987
- contract: "CURVE_LUSD_POOL",
988
- tokenOut: ["LUSD", "3Crv"]
989
- }
1153
+ {
1154
+ type: TradeType.CurveWithdrawLP,
1155
+ contract: "CURVE_LUSD_POOL",
1156
+ tokenOut: ["LUSD", "3Crv"]
1157
+ }
990
1158
  ]
991
1159
  },
992
1160
 
993
1161
  gusd3CRV: {
1162
+ name: "gusd3CRV",
1163
+ decimals: 18,
1164
+
994
1165
  symbol: "gusd3CRV",
995
1166
  type: TokenType.META_CURVE_LP,
996
1167
  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
- }
1168
+ {
1169
+ type: TradeType.CurveWithdrawLP,
1170
+ contract: "CURVE_GUSD_POOL",
1171
+ tokenOut: ["GUSD", "3Crv"]
1172
+ },
1173
+ {
1174
+ type: TradeType.ConvexDepositLP,
1175
+ contract: "CONVEX_BOOSTER",
1176
+ tokenOut: "cvxgusd3CRV"
1177
+ },
1178
+ {
1179
+ type: TradeType.ConvexDepositLPAndStake,
1180
+ contract: "CONVEX_BOOSTER",
1181
+ tokenOut: "stkcvxgusd3CRV"
1182
+ }
1012
1183
  ]
1013
1184
  },
1014
1185
 
1015
1186
  // CONVEX LP TOKENS
1016
1187
  cvx3Crv: {
1188
+ name: "cvx3Crv",
1189
+ decimals: 18,
1190
+
1017
1191
  symbol: "cvx3Crv",
1018
1192
  type: TokenType.CONVEX_LP_TOKEN,
1019
1193
  pool: "CONVEX_3CRV_POOL",
1020
1194
  underlying: "3Crv",
1021
1195
  stakedToken: "stkcvx3Crv",
1022
1196
  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
- }
1197
+ {
1198
+ type: TradeType.ConvexWithdrawLP,
1199
+ contract: "CONVEX_BOOSTER",
1200
+ tokenOut: "3Crv"
1201
+ },
1202
+ {
1203
+ type: TradeType.ConvexStake,
1204
+ contract: "CONVEX_3CRV_POOL",
1205
+ tokenOut: "stkcvx3Crv"
1206
+ }
1033
1207
  ]
1034
1208
  },
1035
1209
 
1036
1210
  cvxsteCRV: {
1211
+ name: "cvxsteCRV",
1212
+ decimals: 18,
1213
+
1037
1214
  symbol: "cvxsteCRV",
1038
1215
  type: TokenType.CONVEX_LP_TOKEN,
1039
1216
  pool: "CONVEX_STECRV_POOL",
1040
1217
  underlying: "steCRV",
1041
1218
  stakedToken: "stkcvxsteCRV",
1042
1219
  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
- }
1220
+ {
1221
+ type: TradeType.ConvexWithdrawLP,
1222
+ contract: "CONVEX_BOOSTER",
1223
+ tokenOut: "steCRV"
1224
+ },
1225
+ {
1226
+ type: TradeType.ConvexStake,
1227
+ contract: "CONVEX_STECRV_POOL",
1228
+ tokenOut: "stkcvxsteCRV"
1229
+ }
1053
1230
  ]
1054
1231
  },
1055
1232
 
1056
1233
  cvxFRAX3CRV: {
1234
+ name: "cvxFRAX3CRV-f",
1235
+ decimals: 18,
1236
+
1057
1237
  symbol: "cvxFRAX3CRV",
1058
1238
  type: TokenType.CONVEX_LP_TOKEN,
1059
1239
  pool: "CONVEX_FRAX3CRV_POOL",
1060
1240
  underlying: "FRAX3CRV",
1061
1241
  stakedToken: "stkcvxFRAX3CRV",
1062
1242
  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
- }
1243
+ {
1244
+ type: TradeType.ConvexWithdrawLP,
1245
+ contract: "CONVEX_BOOSTER",
1246
+ tokenOut: "FRAX3CRV"
1247
+ },
1248
+ {
1249
+ type: TradeType.ConvexStake,
1250
+ contract: "CONVEX_FRAX3CRV_POOL",
1251
+ tokenOut: "stkcvxFRAX3CRV"
1252
+ }
1073
1253
  ]
1074
1254
  },
1075
1255
 
1076
1256
  cvxcrvPlain3andSUSD: {
1257
+ name: "cvxcrvPlain3andSUSD",
1258
+ decimals: 18,
1259
+
1077
1260
  symbol: "cvxcrvPlain3andSUSD",
1078
1261
  type: TokenType.CONVEX_LP_TOKEN,
1079
1262
  pool: "CONVEX_SUSD_POOL",
1080
1263
  underlying: "crvPlain3andSUSD",
1081
1264
  stakedToken: "stkcvxcrvPlain3andSUSD",
1082
1265
  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
- }
1266
+ {
1267
+ type: TradeType.ConvexWithdrawLP,
1268
+ contract: "CONVEX_BOOSTER",
1269
+ tokenOut: "crvPlain3andSUSD"
1270
+ },
1271
+ {
1272
+ type: TradeType.ConvexStake,
1273
+ contract: "CONVEX_SUSD_POOL",
1274
+ tokenOut: "stkcvxcrvPlain3andSUSD"
1275
+ }
1093
1276
  ]
1094
1277
  },
1095
1278
 
1096
1279
  cvxgusd3CRV: {
1280
+ name: "cvxgusd3CRV",
1281
+ decimals: 18,
1282
+
1097
1283
  symbol: "cvxgusd3CRV",
1098
1284
  type: TokenType.CONVEX_LP_TOKEN,
1099
1285
  pool: "CONVEX_GUSD_POOL",
1100
1286
  underlying: "gusd3CRV",
1101
1287
  stakedToken: "stkcvxgusd3CRV",
1102
1288
  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
- ]
1114
- },
1115
-
1116
- // YEARN- CURVE TOKENS
1117
- yvCurve_stETH: {
1118
- symbol: "yvCurve_stETH",
1119
- type: TokenType.YEARN_VAULT_OF_CURVE_LP,
1120
- underlying: "steCRV",
1121
- lpActions: [
1122
- {
1123
- type: TradeType.YearnWithdraw,
1124
- contract: "YEARN_CURVE_STETH_VAULT",
1125
- tokenOut: "steCRV"
1126
- }
1127
- ]
1128
- },
1129
- yvCURVE_FRAX_POOL: {
1130
- symbol: "yvCURVE_FRAX_POOL",
1131
- type: TokenType.YEARN_VAULT_OF_META_CURVE_LP,
1132
- underlying: "FRAX3CRV",
1133
- lpActions: [
1134
- {
1135
- type: TradeType.YearnWithdraw,
1136
- contract: "YEARN_CURVE_FRAX_VAULT",
1137
- tokenOut: "FRAX3CRV"
1138
- }
1289
+ {
1290
+ type: TradeType.ConvexWithdrawLP,
1291
+ contract: "CONVEX_BOOSTER",
1292
+ tokenOut: "gusd3CRV"
1293
+ },
1294
+ {
1295
+ type: TradeType.ConvexStake,
1296
+ contract: "CONVEX_GUSD_POOL",
1297
+ tokenOut: "stkcvxgusd3CRV"
1298
+ }
1139
1299
  ]
1140
1300
  },
1141
1301
 
1142
1302
  // STAKED CONVEX
1143
1303
  stkcvx3Crv: {
1304
+ name: "stkcvx3Crv",
1305
+ decimals: 18,
1306
+
1144
1307
  symbol: "stkcvx3Crv",
1145
1308
  type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN,
1146
1309
  pool: "CONVEX_3CRV_POOL",
1147
1310
  underlying: "3Crv",
1148
1311
  lpToken: "cvx3Crv",
1149
1312
  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
- }
1313
+ {
1314
+ type: TradeType.ConvexWithdraw,
1315
+ contract: "CONVEX_3CRV_POOL",
1316
+ tokenOut: "cvx3Crv"
1317
+ },
1318
+ {
1319
+ type: TradeType.ConvexWithdrawAndUnwrap,
1320
+ contract: "CONVEX_3CRV_POOL",
1321
+ tokenOut: "3Crv"
1322
+ }
1160
1323
  ]
1161
1324
  },
1325
+
1162
1326
  stkcvxsteCRV: {
1327
+ name: "stkcvxsteCRV",
1328
+ decimals: 18,
1329
+
1163
1330
  symbol: "stkcvxsteCRV",
1164
1331
  type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN,
1165
1332
  pool: "CONVEX_STECRV_POOL",
1166
1333
  underlying: "steCRV",
1167
1334
  lpToken: "cvxsteCRV",
1168
1335
  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
- }
1336
+ {
1337
+ type: TradeType.ConvexWithdraw,
1338
+ contract: "CONVEX_STECRV_POOL",
1339
+ tokenOut: "cvxsteCRV"
1340
+ },
1341
+ {
1342
+ type: TradeType.ConvexWithdrawAndUnwrap,
1343
+ contract: "CONVEX_STECRV_POOL",
1344
+ tokenOut: "steCRV"
1345
+ }
1179
1346
  ]
1180
1347
  },
1348
+
1181
1349
  stkcvxFRAX3CRV: {
1350
+ name: "stkcvxFRAX3CRV-f",
1351
+ decimals: 18,
1352
+
1182
1353
  symbol: "stkcvxFRAX3CRV",
1183
1354
  type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN,
1184
1355
  pool: "CONVEX_FRAX3CRV_POOL",
1185
1356
  underlying: "FRAX3CRV",
1186
1357
  lpToken: "cvxFRAX3CRV",
1187
1358
  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
- }
1359
+ {
1360
+ type: TradeType.ConvexWithdraw,
1361
+ contract: "CONVEX_FRAX3CRV_POOL",
1362
+ tokenOut: "cvxFRAX3CRV"
1363
+ },
1364
+ {
1365
+ type: TradeType.ConvexWithdrawAndUnwrap,
1366
+ contract: "CONVEX_FRAX3CRV_POOL",
1367
+ tokenOut: "FRAX3CRV"
1368
+ }
1198
1369
  ]
1199
1370
  },
1371
+
1200
1372
  stkcvxcrvPlain3andSUSD: {
1373
+ name: "stkcvxcrvPlain3andSUSD",
1374
+ decimals: 18,
1375
+
1201
1376
  symbol: "stkcvxcrvPlain3andSUSD",
1202
1377
  type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN,
1203
1378
  pool: "CONVEX_SUSD_POOL",
1204
1379
  underlying: "crvPlain3andSUSD",
1205
1380
  lpToken: "cvxcrvPlain3andSUSD",
1206
1381
  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
- }
1382
+ {
1383
+ type: TradeType.ConvexWithdraw,
1384
+ contract: "CONVEX_SUSD_POOL",
1385
+ tokenOut: "cvxcrvPlain3andSUSD"
1386
+ },
1387
+ {
1388
+ type: TradeType.ConvexWithdrawAndUnwrap,
1389
+ contract: "CONVEX_SUSD_POOL",
1390
+ tokenOut: "crvPlain3andSUSD"
1391
+ }
1217
1392
  ]
1218
1393
  },
1394
+
1219
1395
  stkcvxgusd3CRV: {
1396
+ name: "stkcvxgusd3CRV",
1397
+ decimals: 18,
1398
+
1220
1399
  symbol: "stkcvxgusd3CRV",
1221
1400
  type: TokenType.CONVEX_STAKED_PHANTOM_TOKEN,
1222
1401
  pool: "CONVEX_GUSD_POOL",
1223
1402
  underlying: "gusd3CRV",
1224
1403
  lpToken: "cvxgusd3CRV",
1225
1404
  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
- }
1405
+ {
1406
+ type: TradeType.ConvexWithdraw,
1407
+ contract: "CONVEX_GUSD_POOL",
1408
+ tokenOut: "cvxgusd3CRV"
1409
+ },
1410
+ {
1411
+ type: TradeType.ConvexWithdrawAndUnwrap,
1412
+ contract: "CONVEX_GUSD_POOL",
1413
+ tokenOut: "gusd3CRV"
1414
+ }
1415
+ ]
1416
+ },
1417
+
1418
+ // YEARN- CURVE TOKENS
1419
+ yvCurve_stETH: {
1420
+ name: "yvCurve-stETH",
1421
+ decimals: 18,
1422
+
1423
+ symbol: "yvCurve_stETH",
1424
+ type: TokenType.YEARN_VAULT_OF_CURVE_LP,
1425
+ underlying: "steCRV",
1426
+ lpActions: [
1427
+ {
1428
+ type: TradeType.YearnWithdraw,
1429
+ contract: "YEARN_CURVE_STETH_VAULT",
1430
+ tokenOut: "steCRV"
1431
+ }
1432
+ ]
1433
+ },
1434
+
1435
+ yvCURVE_FRAX_POOL: {
1436
+ name: "yvCurve-FRAX",
1437
+ decimals: 18,
1438
+
1439
+ symbol: "yvCURVE_FRAX_POOL",
1440
+ type: TokenType.YEARN_VAULT_OF_META_CURVE_LP,
1441
+ underlying: "FRAX3CRV",
1442
+ lpActions: [
1443
+ {
1444
+ type: TradeType.YearnWithdraw,
1445
+ contract: "YEARN_CURVE_FRAX_VAULT",
1446
+ tokenOut: "FRAX3CRV"
1447
+ }
1236
1448
  ]
1449
+ },
1450
+
1451
+ //GEARBOX
1452
+ dDAI: {
1453
+ name: "dDAI",
1454
+ decimals: 18,
1455
+
1456
+ symbol: "dDAI",
1457
+ type: TokenType.DIESEL_LP_TOKEN
1458
+ },
1459
+
1460
+ dUSDC: {
1461
+ name: "dUSDC",
1462
+ decimals: 6,
1463
+
1464
+ symbol: "dUSDC",
1465
+ type: TokenType.DIESEL_LP_TOKEN
1466
+ },
1467
+
1468
+ dWBTC: {
1469
+ name: "dWBTC",
1470
+ decimals: 8,
1471
+
1472
+ symbol: "dWBTC",
1473
+ type: TokenType.DIESEL_LP_TOKEN
1474
+ },
1475
+
1476
+ dWETH: {
1477
+ name: "dWETH",
1478
+ decimals: 18,
1479
+
1480
+ symbol: "dWETH",
1481
+ type: TokenType.DIESEL_LP_TOKEN
1482
+ },
1483
+
1484
+ GEAR: {
1485
+ name: "GEAR",
1486
+ decimals: 18,
1487
+
1488
+ symbol: "GEAR",
1489
+ type: TokenType.NORMAL_TOKEN
1237
1490
  }
1238
1491
  };
1239
1492
 
@@ -1305,7 +1558,15 @@ export const tokenDataByNetwork: Record<
1305
1558
 
1306
1559
  // YEARN- CURVE TOKENS
1307
1560
  yvCurve_stETH: "0xdCD90C7f6324cfa40d7169ef80b12031770B4325",
1308
- yvCURVE_FRAX_POOL: "0xB4AdA607B9d6b2c9Ee07A275e9616B84AC560139"
1561
+ yvCURVE_FRAX_POOL: "0xB4AdA607B9d6b2c9Ee07A275e9616B84AC560139",
1562
+
1563
+ //GEARBOX
1564
+ dDAI: "0x6CFaF95457d7688022FC53e7AbE052ef8DFBbdBA",
1565
+ dUSDC: "0xc411dB5f5Eb3f7d552F9B8454B2D74097ccdE6E3",
1566
+ dWBTC: "0xe753260F1955e8678DCeA8887759e07aa57E8c54",
1567
+ dWETH: "0xF21fc650C1B34eb0FDE786D52d23dA99Db3D6278",
1568
+
1569
+ GEAR: "0xBa3335588D9403515223F109EdC4eB7269a9Ab5D"
1309
1570
  },
1310
1571
 
1311
1572
  //
@@ -1374,6 +1635,20 @@ export const tokenDataByNetwork: Record<
1374
1635
 
1375
1636
  // YEARN- CURVE TOKENS
1376
1637
  yvCurve_stETH: "0xdDc2FA328321573Bc2647C0135D75012c522CDAC",
1377
- yvCURVE_FRAX_POOL: ""
1638
+ yvCURVE_FRAX_POOL: "",
1639
+
1640
+ //GEARBOX
1641
+ dDAI: "0x6CFaF95457d7688022FC53e7AbE052ef8DFBbdBA",
1642
+ dUSDC: "0xc411dB5f5Eb3f7d552F9B8454B2D74097ccdE6E3",
1643
+ dWBTC: "0xe753260F1955e8678DCeA8887759e07aa57E8c54",
1644
+ dWETH: "0xF21fc650C1B34eb0FDE786D52d23dA99Db3D6278",
1645
+
1646
+ GEAR: "0xBa3335588D9403515223F109EdC4eB7269a9Ab5D"
1378
1647
  }
1379
1648
  };
1649
+
1650
+ export const tokenDataByAddress = objectEntries(tokenDataByNetwork).reduce<
1651
+ Record<string, SupportedToken>
1652
+ >((sum, [_, tokens]) => {
1653
+ return { ...sum, ...keyToLowercase(swapKeyValue(tokens)) };
1654
+ }, {});