@gearbox-protocol/sdk 0.0.40 → 0.0.43

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 { BigNumber } from "ethers";
2
2
  import { TokenDataPayload } from "../payload/token";
3
3
  import { NetworkType } from "./constants";
4
- import { SupportedTokens } from "./token";
4
+ import { SupportedToken } from "./token";
5
5
  export declare class TokenData {
6
6
  readonly id: string;
7
7
  readonly symbol: string;
@@ -24,5 +24,5 @@ export interface TokenSavedData {
24
24
  type: TokenType;
25
25
  }
26
26
  export declare const WETHToken: Record<NetworkType, string>;
27
- export declare const connectors: Record<NetworkType, Array<SupportedTokens>>;
27
+ export declare const connectors: Record<NetworkType, Array<SupportedToken>>;
28
28
  export declare function getConnectors(networkType: NetworkType): string[];
@@ -0,0 +1,59 @@
1
+ import { ConvexPoolContract, CurvePoolContract, UniswapV2Contract, YearnVaultContract } from "./contracts";
2
+ import { NormalToken, CurveLPToken, YearnLPToken, ConvexLPToken, ConvexStakedPhantomToken } from "./token";
3
+ export declare enum TradeType {
4
+ UniswapV2Swap = 0,
5
+ UniswapV3Swap = 1,
6
+ CurveExchange = 2,
7
+ CurveExchangeUnderlying = 3,
8
+ CurveDepositLP = 4,
9
+ CurveWithdrawLP = 5,
10
+ YearnDeposit = 6,
11
+ YearnWithdraw = 7,
12
+ LidoStake = 8,
13
+ ConvexDeposit = 9,
14
+ ConvexStake = 10,
15
+ ConvexDepositAndStake = 11
16
+ }
17
+ export declare type TradeAction = {
18
+ type: TradeType.UniswapV2Swap;
19
+ contract: UniswapV2Contract;
20
+ } | {
21
+ type: TradeType.UniswapV3Swap;
22
+ contract: "UNISWAP_V3_ROUTER";
23
+ } | {
24
+ type: TradeType.CurveExchange;
25
+ contract: CurvePoolContract;
26
+ tokenOut: Array<NormalToken | CurveLPToken>;
27
+ } | {
28
+ type: TradeType.CurveDepositLP;
29
+ contract: CurvePoolContract;
30
+ tokenOut: CurveLPToken;
31
+ } | {
32
+ type: TradeType.CurveWithdrawLP;
33
+ contract: CurvePoolContract;
34
+ tokenOut: Array<CurveLPToken | NormalToken>;
35
+ } | {
36
+ type: TradeType.YearnDeposit;
37
+ contract: YearnVaultContract;
38
+ tokenOut: YearnLPToken;
39
+ } | {
40
+ type: TradeType.YearnWithdraw;
41
+ contract: YearnVaultContract;
42
+ tokenOut: NormalToken | CurveLPToken;
43
+ } | {
44
+ type: TradeType.LidoStake;
45
+ contract: "LIDO_STETH_GATEWAY";
46
+ tokenOut: NormalToken;
47
+ } | {
48
+ type: TradeType.ConvexDeposit;
49
+ contract: ConvexPoolContract;
50
+ tokenOut: ConvexLPToken;
51
+ } | {
52
+ type: TradeType.ConvexStake;
53
+ contract: ConvexPoolContract;
54
+ tokenOut: ConvexStakedPhantomToken;
55
+ } | {
56
+ type: TradeType.ConvexDepositAndStake;
57
+ contract: ConvexPoolContract;
58
+ tokenOut: ConvexStakedPhantomToken;
59
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TradeType = void 0;
4
+ var TradeType;
5
+ (function (TradeType) {
6
+ TradeType[TradeType["UniswapV2Swap"] = 0] = "UniswapV2Swap";
7
+ TradeType[TradeType["UniswapV3Swap"] = 1] = "UniswapV3Swap";
8
+ TradeType[TradeType["CurveExchange"] = 2] = "CurveExchange";
9
+ TradeType[TradeType["CurveExchangeUnderlying"] = 3] = "CurveExchangeUnderlying";
10
+ TradeType[TradeType["CurveDepositLP"] = 4] = "CurveDepositLP";
11
+ TradeType[TradeType["CurveWithdrawLP"] = 5] = "CurveWithdrawLP";
12
+ TradeType[TradeType["YearnDeposit"] = 6] = "YearnDeposit";
13
+ TradeType[TradeType["YearnWithdraw"] = 7] = "YearnWithdraw";
14
+ TradeType[TradeType["LidoStake"] = 8] = "LidoStake";
15
+ TradeType[TradeType["ConvexDeposit"] = 9] = "ConvexDeposit";
16
+ TradeType[TradeType["ConvexStake"] = 10] = "ConvexStake";
17
+ TradeType[TradeType["ConvexDepositAndStake"] = 11] = "ConvexDepositAndStake";
18
+ })(TradeType = exports.TradeType || (exports.TradeType = {}));
package/lib/index.d.ts CHANGED
@@ -28,10 +28,9 @@ export * from "./utils/math";
28
28
  export * from "./core/creditCard";
29
29
  export * from "./payload/graphPayload";
30
30
  export * from "./types/index";
31
- export * from "./devops/verifierDeployer";
32
31
  export type { IAppPoolService, IAppCreditManager, IAppERC20, IAppAddressProvider, IDataCompressor, IWETHGateway } from "./types";
33
32
  export * from "./core/history";
34
33
  export { MultiCallContract } from "./utils/multicall";
35
34
  export { callRepeater } from "./utils/repeater";
36
35
  export { getContractName } from "./core/contractsRegister";
37
- export { AdapterInterface } from "./core/contracts";
36
+ export { AdapterInterface } from "./core/adapters";
package/lib/index.js CHANGED
@@ -45,7 +45,6 @@ __exportStar(require("./utils/math"), exports);
45
45
  __exportStar(require("./core/creditCard"), exports);
46
46
  __exportStar(require("./payload/graphPayload"), exports);
47
47
  __exportStar(require("./types/index"), exports);
48
- __exportStar(require("./devops/verifierDeployer"), exports);
49
48
  __exportStar(require("./core/history"), exports);
50
49
  var multicall_1 = require("./utils/multicall");
51
50
  Object.defineProperty(exports, "MultiCallContract", { enumerable: true, get: function () { return multicall_1.MultiCallContract; } });
@@ -53,5 +52,5 @@ var repeater_1 = require("./utils/repeater");
53
52
  Object.defineProperty(exports, "callRepeater", { enumerable: true, get: function () { return repeater_1.callRepeater; } });
54
53
  var contractsRegister_1 = require("./core/contractsRegister");
55
54
  Object.defineProperty(exports, "getContractName", { enumerable: true, get: function () { return contractsRegister_1.getContractName; } });
56
- var contracts_1 = require("./core/contracts");
57
- Object.defineProperty(exports, "AdapterInterface", { enumerable: true, get: function () { return contracts_1.AdapterInterface; } });
55
+ var adapters_1 = require("./core/adapters");
56
+ Object.defineProperty(exports, "AdapterInterface", { enumerable: true, get: function () { return adapters_1.AdapterInterface; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "0.0.40",
3
+ "version": "0.0.43",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -0,0 +1,16 @@
1
+ export enum AdapterInterface {
2
+ NO_SWAP, // 0 - 1
3
+ UNISWAP_V2_ROUTER, // 1 - 2
4
+ UNISWAP_V3_ROUTER, // 2 - 4
5
+ CURVE_V1_2ASSETS, // 3 - 8
6
+ CURVE_V1_3ASSETS, // 4 - 16
7
+ CURVE_V1_4ASSETS, // 5 - 32
8
+ CURVE_V1_STECRV_POOL, // 6 - 64
9
+ YEARN_V2, // 7 - 128
10
+ CONVEX_V1_BASE_REWARD_POOL, // 8 - 256
11
+ CONVEX_V1_BOOSTER, // 9 - 512
12
+ CONVEX_V1_CLAIM_ZAP, // 10 - 1024
13
+ LIDO_V1 // 11 - 2048
14
+ }
15
+
16
+
@@ -4,171 +4,269 @@
4
4
  * (c) Gearbox.fi, 2021
5
5
  */
6
6
 
7
- import { tokenDataByNetwork } from "./token";
7
+ import { AdapterInterface } from "./adapters";
8
+ import { NetworkType } from "./constants";
9
+ import { Protocols } from "./protocols";
10
+ import { CurveLPToken, NormalToken, tokenDataByNetwork } from "./token";
11
+
12
+ export type UniswapV2Contract = "UNISWAP_V2_ROUTER" | "SUSHISWAP_ROUTER";
13
+
14
+ export type CurvePoolContract =
15
+ | "CURVE_3POOL"
16
+ | "CURVE_STETH_GATEWAY"
17
+ | "CURVE_FRAX"
18
+ | "CURVE_LUSD"
19
+ | "CURVE_GUSD"
20
+ | "CURVE_SUSD";
21
+
22
+ export type YearnVaultContract =
23
+ | "YEARN_DAI"
24
+ | "YEARN_USDC"
25
+ | "YEARN_WETH"
26
+ | "YEARN_WBTC"
27
+ | "YEARN_CURVE_FRAX"
28
+ | "YEARN_CURVE_STETH";
29
+
30
+ export type ConvexPoolContract =
31
+ | "CONVEX_3CRV"
32
+ | "CONVEX_GUSD"
33
+ | "CONVEX_SUSD"
34
+ | "CONVEX_STECRV"
35
+ | "CONVEX_FRAX3CRV";
36
+
37
+ export type SupportedContract =
38
+ | UniswapV2Contract
39
+ | "UNISWAP_V3_ROUTER"
40
+ | CurvePoolContract
41
+ | YearnVaultContract
42
+ | "CONVEX_BOOSTER"
43
+ | ConvexPoolContract
44
+ | "CONVEX_CLAIM_ZAP"
45
+ | "LIDO_STETH_GATEWAY";
46
+
47
+ export const contractsByNetwork: Record<
48
+ NetworkType,
49
+ Record<SupportedContract, string>
50
+ > = {
51
+ Mainnet: {
52
+ UNISWAP_V2_ROUTER: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
53
+ UNISWAP_V3_ROUTER: "0xE592427A0AEce92De3Edee1F18E0157C05861564",
54
+ SUSHISWAP_ROUTER: "0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F",
55
+
56
+ // CURVE
57
+ CURVE_3POOL: "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7", // SEPARATE TOKEN
58
+ CURVE_STETH_GATEWAY: "0xDC24316b9AE028F1497c275EB9192a3Ea0f67022", // SEPARATE TOKEN
59
+ CURVE_FRAX: tokenDataByNetwork.Mainnet.FRAX3CRV,
60
+ CURVE_LUSD: tokenDataByNetwork.Mainnet.LUSD3CRV,
61
+ CURVE_SUSD: "0xA5407eAE9Ba41422680e2e00537571bcC53efBfD", // SEPARATE TOKEN
62
+ CURVE_GUSD: "0x4f062658EaAF2C1ccf8C8e36D6824CDf41167956", // SEPARATE TOKEN
63
+
64
+ // YEARN
65
+ YEARN_DAI: tokenDataByNetwork.Mainnet.yvDAI,
66
+ YEARN_USDC: tokenDataByNetwork.Mainnet.yvUSDC,
67
+ YEARN_WETH: tokenDataByNetwork.Mainnet.yvWETH,
68
+ YEARN_WBTC: tokenDataByNetwork.Mainnet.yvWBTC,
69
+ YEARN_CURVE_FRAX: tokenDataByNetwork.Mainnet.yvCurve_FRAX,
70
+ YEARN_CURVE_STETH: tokenDataByNetwork.Mainnet.yvCurve_stETH,
71
+
72
+ // CONVEX
73
+ CONVEX_BOOSTER: "0xF403C135812408BFbE8713b5A23a04b3D48AAE31",
74
+ CONVEX_3CRV: "0x689440f2Ff927E1f24c72F1087E1FAF471eCe1c8",
75
+ CONVEX_GUSD: "0x7A7bBf95C44b144979360C3300B54A7D34b44985",
76
+ CONVEX_SUSD: "0x22eE18aca7F3Ee920D01F25dA85840D12d98E8Ca",
77
+ CONVEX_STECRV: "0x0A760466E1B4621579a82a39CB56Dda2F4E70f03",
78
+ CONVEX_FRAX3CRV: "0xB900EF131301B307dB5eFcbed9DBb50A3e209B2e",
79
+ CONVEX_CLAIM_ZAP: "0x92Cf9E5e4D1Dfbf7dA0d2BB3e884a68416a65070",
80
+
81
+ // LIDO
82
+ LIDO_STETH_GATEWAY: "0xae7ab96520de3a18e5e111b5eaab095312d7fe84"
83
+ },
84
+ Kovan: {
85
+ UNISWAP_V2_ROUTER: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
86
+ UNISWAP_V3_ROUTER: "0xE592427A0AEce92De3Edee1F18E0157C05861564",
87
+ SUSHISWAP_ROUTER: "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506",
88
+
89
+ // CURVE
90
+ CURVE_3POOL: "0x769C784D1e958672bDef04cf12Fd5399b3db0f27",
91
+ CURVE_STETH_GATEWAY: "0xF695d3aa358D5087A0C157DBb9449d4f0d8E534a",
92
+ CURVE_FRAX: "",
93
+ CURVE_LUSD: tokenDataByNetwork.Kovan.LUSD3CRV,
94
+ CURVE_SUSD: "0x032f1cE00865F3499C0052ceBA5F2348842416DB", // SEPARATE TOKEN
95
+ CURVE_GUSD: "",
96
+
97
+ // YEARN
98
+ YEARN_DAI: tokenDataByNetwork.Kovan.yvDAI,
99
+ YEARN_USDC: tokenDataByNetwork.Kovan.yvUSDC,
100
+ YEARN_WETH: tokenDataByNetwork.Kovan.yvWETH,
101
+ YEARN_WBTC: tokenDataByNetwork.Kovan.yvWBTC,
102
+ YEARN_CURVE_FRAX: tokenDataByNetwork.Kovan.yvCurve_FRAX,
103
+ YEARN_CURVE_STETH: tokenDataByNetwork.Kovan.yvCurve_stETH,
104
+
105
+ // CONVEX
106
+ CONVEX_BOOSTER: "0x78A9261965F048b9FF055699569be4400EEC7005",
107
+ CONVEX_3CRV: "0x90D9E8ecc406cd7363C08fAdb4ac0f3994b4cA71",
108
+ CONVEX_GUSD: "",
109
+ CONVEX_SUSD: "",
110
+ CONVEX_STECRV: "0x0f64e188BFF97e09C71FF85f30509f5596D420dD",
111
+ CONVEX_FRAX3CRV: "",
112
+ CONVEX_CLAIM_ZAP: "",
113
+
114
+ // LIDO
115
+ LIDO_STETH_GATEWAY: ""
116
+ }
117
+ };
8
118
 
9
- export const UNISWAP_V2_ROUTER = "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D";
10
- export const UNISWAP_V3_ROUTER = "0xE592427A0AEce92De3Edee1F18E0157C05861564";
11
119
  export const UNISWAP_V3_QUOTER = "0xb27308f9f90d607463bb33ea1bebb41c27ce5ab6";
12
120
 
13
- export const CURVE_3POOL_ADDRESS = "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7";
14
- export const CURVE_STETH_ADDRESS = "0xDC24316b9AE028F1497c275EB9192a3Ea0f67022";
15
- export const CURVE_STETH_GATEWAY_ADDRESS = "";
16
- export const CURVE_FRAX_ADDRESS = "0xd632f22692FaC7611d2AA1C0D552930D43CAEd3B";
17
- export const CURVE_LUSD_ADDRESS = "0x5a6a4d54456819380173272a5e8e9b9904bdf41b";
18
- export const CURVE_SUSD_ADDRESS = "0x5a6a4d54456819380173272a5e8e9b9904bdf41b";
19
- export const CURVE_GUSD_ADDRESS = "0x5a6a4d54456819380173272a5e8e9b9904bdf41b";
20
-
21
- export const CURVE_3POOL_KOVAN_MOCK =
22
- "0x769C784D1e958672bDef04cf12Fd5399b3db0f27";
23
- export const CURVE_STE_CRV_KOVAN_MOCK =
24
- "0xF695d3aa358D5087A0C157DBb9449d4f0d8E534a";
25
- export const CURVE_SUSD_KOVAN_MOCK =
26
- "0x032f1cE00865F3499C0052ceBA5F2348842416DB";
27
-
28
- export const YEARN_DAI_ADDRESS = "0xdA816459F1AB5631232FE5e97a05BBBb94970c95";
29
- export const YEARN_USDC_ADDRESS = "0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE";
30
- export const YEARN_WETH_ADDRESS = "0xa258C4606Ca8206D8aA700cE2143D7db854D168c";
31
- export const YEARN_WBTC_ADDRESS = "0xA696a63cc78DfFa1a63E9E50587C197387FF6C7E";
32
-
33
- export const YEARN_CURVE_FRAX_ADDRESS =
34
- "0xB4AdA607B9d6b2c9Ee07A275e9616B84AC560139";
35
-
36
- export const YEARN_CURVE_STETH_ADDRESS =
37
- "0xdCD90C7f6324cfa40d7169ef80b12031770B4325";
38
-
39
- // KOVAN
40
- export const YEARN_DAI_KOVAN_MOCK = tokenDataByNetwork.Kovan.yvDAI;
41
- export const YEARN_USDC_KOVAN_MOCK = tokenDataByNetwork.Kovan.yvUSDC;
42
- export const YEARN_WETH_KOVAN_MOCK = tokenDataByNetwork.Kovan.yvWETH;
43
- export const YEARN_WBTC_KOVAN_MOCK = tokenDataByNetwork.Kovan.yvWBTC;
44
- export const YEARN_3POOL_KOVAN_MOCK = tokenDataByNetwork.Kovan.yvCurve_stETH;
45
-
46
- export const SUSHISWAP_MAINNET = "0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F";
47
- export const SUSHISWAP_KOVAN = "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506";
48
-
49
- export const CONVEX_BOOSTER_KOVAN_ADDRESS =
50
- "0x78A9261965F048b9FF055699569be4400EEC7005";
51
-
52
- export const CONVEX_3CRV_KOVAN_POOL_ADDRESS =
53
- "0x90D9E8ecc406cd7363C08fAdb4ac0f3994b4cA71";
54
-
55
- export const CONVEX_STECRV_POOL_ADDRESS =
56
- "0x0A760466E1B4621579a82a39CB56Dda2F4E70f03";
57
-
58
- export const CONVEX_STECRV_KOVAN_POOL_ADDRESS =
59
- "0x0f64e188BFF97e09C71FF85f30509f5596D420dD";
60
-
61
- export const CONVEX_BOOSTER_ADDRESS =
62
- "0xF403C135812408BFbE8713b5A23a04b3D48AAE31";
63
-
64
- export const CONVEX_3POOL_REWARD_POOL_ADDRESS =
65
- "0x689440f2Ff927E1f24c72F1087E1FAF471eCe1c8";
66
-
67
- export const CONVEX_FRAX3CRV_REWARD_POOL_ADDRESS =
68
- "0xB900EF131301B307dB5eFcbed9DBb50A3e209B2e";
69
-
70
- export const CONVEX_CLAIM_ZAP_ADDRESS =
71
- "0x92Cf9E5e4D1Dfbf7dA0d2BB3e884a68416a65070";
72
-
73
- export const LIDO_STETH_ADDRESS = "0xae7ab96520de3a18e5e111b5eaab095312d7fe84";
74
-
75
- export enum AdapterInterface {
76
- NO_SWAP, // 0 - 1
77
- UNISWAP_V2, // 1 - 2
78
- UNISWAP_V3, // 2 - 4
79
- CURVE_V1_2ASSETS, // 3 - 8
80
- CURVE_V1_3ASSETS, // 4 - 16
81
- CURVE_V1_4ASSETS, // 5 - 32
82
- CURVE_V1_STETH, // 6 - 64
83
- YEARN_V2, // 7 - 128
84
- CONVEX_V1_BASE_REWARD_POOL, // 8 - 256
85
- CONVEX_V1_BOOSTER, // 9 - 512
86
- CONVEX_V1_CLAIM_ZAP, // 10 - 1024
87
- LIDO_V1 // 11 - 2048
88
- }
89
-
90
- export type AdapterParams =
121
+ export type ContractParams =
91
122
  | {
92
- name: string;
93
- type: AdapterInterface.UNISWAP_V2;
94
- icon: string;
123
+ protocol: Protocols.Uniswap | Protocols.Sushiswap;
124
+ type: AdapterInterface.UNISWAP_V2_ROUTER;
95
125
  }
96
126
  | {
97
- name: string;
98
- type: AdapterInterface.UNISWAP_V3;
127
+ protocol: Protocols.Uniswap;
128
+ type: AdapterInterface.UNISWAP_V3_ROUTER;
99
129
  quoter: string;
100
- icon: string;
101
130
  }
102
131
  | {
103
- name: string;
104
- type: AdapterInterface.CURVE_V1_2ASSETS;
105
- nCoins: number;
106
- icon: string;
132
+ protocol: Protocols.Curve;
133
+ type:
134
+ | AdapterInterface.CURVE_V1_2ASSETS
135
+ | AdapterInterface.CURVE_V1_3ASSETS
136
+ | AdapterInterface.CURVE_V1_4ASSETS;
137
+ lpToken: CurveLPToken;
138
+ tokens: Array<NormalToken | CurveLPToken>;
107
139
  }
108
140
  | {
109
- name: string;
110
- type: AdapterInterface.CURVE_V1_3ASSETS;
111
- nCoins: number;
112
- icon: string;
141
+ protocol: Protocols.Curve;
142
+ type: AdapterInterface.CURVE_V1_STECRV_POOL;
143
+ pool: string;
144
+ poolKovan?: string;
113
145
  }
114
146
  | {
115
- name: string;
147
+ protocol: Protocols.Yearn;
116
148
  type: AdapterInterface.YEARN_V2;
117
- icon: string;
149
+ }
150
+ | {
151
+ protocol: Protocols.Convex;
152
+ type:
153
+ | AdapterInterface.CONVEX_V1_BOOSTER
154
+ | AdapterInterface.CONVEX_V1_CLAIM_ZAP;
155
+ }
156
+ | {
157
+ protocol: Protocols.Convex;
158
+ type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL;
159
+ }
160
+ | {
161
+ protocol: Protocols.Lido;
162
+ type: AdapterInterface.LIDO_V1;
118
163
  };
119
164
 
120
- export const knownContracts: Record<string, AdapterParams> = {
121
- [UNISWAP_V2_ROUTER]: {
122
- name: "UniswapV2",
123
- type: AdapterInterface.UNISWAP_V2,
124
- icon: "/protocols/uniswap.png"
165
+ export const contractParams: Record<SupportedContract, ContractParams> = {
166
+ UNISWAP_V2_ROUTER: {
167
+ protocol: Protocols.Uniswap,
168
+ type: AdapterInterface.UNISWAP_V2_ROUTER
125
169
  },
126
- [UNISWAP_V3_ROUTER]: {
127
- name: "UniswapV3",
170
+ UNISWAP_V3_ROUTER: {
171
+ protocol: Protocols.Uniswap,
128
172
  quoter: UNISWAP_V3_QUOTER,
129
- type: AdapterInterface.UNISWAP_V3,
130
- icon: "/protocols/uniswap.png"
173
+ type: AdapterInterface.UNISWAP_V3_ROUTER
131
174
  },
132
- [SUSHISWAP_MAINNET]: {
133
- name: "Sushiswap",
134
- type: AdapterInterface.UNISWAP_V2,
135
- icon: "/protocols/sushi.svg"
175
+ SUSHISWAP_ROUTER: {
176
+ protocol: Protocols.Sushiswap,
177
+ type: AdapterInterface.UNISWAP_V2_ROUTER
136
178
  },
137
- [CURVE_3POOL_ADDRESS]: {
138
- name: "Curve 3pool",
179
+ CURVE_3POOL: {
180
+ protocol: Protocols.Curve,
139
181
  type: AdapterInterface.CURVE_V1_3ASSETS,
140
- nCoins: 3,
141
- icon: "/protocols/curve.svg"
182
+ lpToken: "3Crv",
183
+ tokens: ["DAI", "USDC", "USDT"]
142
184
  },
143
- [CURVE_STETH_ADDRESS]: {
144
- name: "Curve stETH",
185
+ CURVE_STETH_GATEWAY: {
186
+ protocol: Protocols.Curve,
187
+ type: AdapterInterface.CURVE_V1_STECRV_POOL,
188
+ pool: "",
189
+ poolKovan: ""
190
+ },
191
+ CURVE_FRAX: {
192
+ protocol: Protocols.Curve,
193
+ type: AdapterInterface.CURVE_V1_2ASSETS,
194
+ lpToken: "FRAX3CRV",
195
+ tokens: ["3Crv", "FRAX"]
196
+ },
197
+ CURVE_LUSD: {
198
+ protocol: Protocols.Curve,
145
199
  type: AdapterInterface.CURVE_V1_2ASSETS,
146
- nCoins: 2,
147
- icon: "/protocols/curve.svg"
148
- },
149
- [YEARN_DAI_ADDRESS]: {
150
- name: "Yearn DAI",
151
- type: AdapterInterface.YEARN_V2,
152
- icon: "/protocols/yearn.svg"
153
- },
154
- [YEARN_DAI_KOVAN_MOCK]: {
155
- name: "Yearn DAI",
156
- type: AdapterInterface.YEARN_V2,
157
- icon: "/protocols/yearn.svg"
158
- },
159
- [YEARN_USDC_ADDRESS]: {
160
- name: "Yearn USDC",
161
- type: AdapterInterface.YEARN_V2,
162
- icon: "/protocols/yearn.svg"
163
- },
164
- [YEARN_USDC_KOVAN_MOCK]: {
165
- name: "Yearn USDC",
166
- type: AdapterInterface.YEARN_V2,
167
- icon: "/protocols/yearn.svg"
168
- },
169
- [SUSHISWAP_KOVAN]: {
170
- name: "Sushiswap",
171
- type: AdapterInterface.UNISWAP_V2,
172
- icon: "/protocols/sushi.svg"
200
+ lpToken: "LUSD3CRV",
201
+ tokens: ["3Crv", "FRAX"]
202
+ },
203
+ CURVE_SUSD: {
204
+ protocol: Protocols.Curve,
205
+ type: AdapterInterface.CURVE_V1_2ASSETS,
206
+ lpToken: "crvPlain3andSUSD",
207
+ tokens: ["3Crv", "FRAX"]
208
+ },
209
+ CURVE_GUSD: {
210
+ protocol: Protocols.Curve,
211
+ type: AdapterInterface.CURVE_V1_2ASSETS,
212
+ lpToken: "gusd3CRV",
213
+ tokens: ["3Crv", "FRAX"]
214
+ },
215
+ YEARN_DAI: {
216
+ protocol: Protocols.Yearn,
217
+ type: AdapterInterface.YEARN_V2
218
+ },
219
+
220
+ YEARN_USDC: {
221
+ protocol: Protocols.Yearn,
222
+ type: AdapterInterface.YEARN_V2
223
+ },
224
+ YEARN_WETH: {
225
+ protocol: Protocols.Yearn,
226
+ type: AdapterInterface.YEARN_V2
227
+ },
228
+ YEARN_WBTC: {
229
+ protocol: Protocols.Yearn,
230
+ type: AdapterInterface.YEARN_V2
231
+ },
232
+ YEARN_CURVE_FRAX: {
233
+ protocol: Protocols.Yearn,
234
+ type: AdapterInterface.YEARN_V2
235
+ },
236
+ YEARN_CURVE_STETH: {
237
+ protocol: Protocols.Yearn,
238
+ type: AdapterInterface.YEARN_V2
239
+ },
240
+ CONVEX_BOOSTER: {
241
+ protocol: Protocols.Convex,
242
+ type: AdapterInterface.CONVEX_V1_BOOSTER
243
+ },
244
+ CONVEX_3CRV: {
245
+ protocol: Protocols.Convex,
246
+ type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL
247
+ },
248
+ CONVEX_GUSD: {
249
+ protocol: Protocols.Convex,
250
+ type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL
251
+ },
252
+ CONVEX_SUSD: {
253
+ protocol: Protocols.Convex,
254
+ type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL
255
+ },
256
+ CONVEX_STECRV: {
257
+ protocol: Protocols.Convex,
258
+ type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL
259
+ },
260
+ CONVEX_FRAX3CRV: {
261
+ protocol: Protocols.Convex,
262
+ type: AdapterInterface.CONVEX_V1_BASE_REWARD_POOL
263
+ },
264
+ CONVEX_CLAIM_ZAP: {
265
+ protocol: Protocols.Convex,
266
+ type: AdapterInterface.CONVEX_V1_CLAIM_ZAP
267
+ },
268
+ LIDO_STETH_GATEWAY: {
269
+ protocol: Protocols.Lido,
270
+ type: AdapterInterface.LIDO_V1
173
271
  }
174
272
  };
@@ -1,11 +1,4 @@
1
- import {
2
- CURVE_3POOL_ADDRESS, SUSHISWAP_KOVAN,
3
- SUSHISWAP_MAINNET,
4
- UNISWAP_V2_ROUTER,
5
- UNISWAP_V3_ROUTER,
6
- YEARN_DAI_ADDRESS, YEARN_DAI_KOVAN_MOCK,
7
- YEARN_USDC_ADDRESS, YEARN_USDC_KOVAN_MOCK,
8
- } from "./contracts";
1
+
9
2
 
10
3
  export const deployedContracts: Record<string, string> = {
11
4
  // MAINNET
@@ -20,12 +13,12 @@ export const deployedContracts: Record<string, string> = {
20
13
 
21
14
 
22
15
 
23
- [UNISWAP_V2_ROUTER]: "Uniswap V2",
24
- [UNISWAP_V3_ROUTER]: "Uniswap V3",
25
- [CURVE_3POOL_ADDRESS]: "Curve 3Pool",
26
- [SUSHISWAP_MAINNET]: "Sushiswap",
27
- [YEARN_DAI_ADDRESS]: "Yearn DAI",
28
- [YEARN_USDC_ADDRESS]: "Yearn USDC",
16
+ // [UNISWAP_V2_ROUTER]: "Uniswap V2",
17
+ // [UNISWAP_V3_ROUTER]: "Uniswap V3",
18
+ // [CURVE_3POOL_ADDRESS]: "Curve 3Pool",
19
+ // [SUSHISWAP_MAINNET]: "Sushiswap",
20
+ // [YEARN_DAI_ADDRESS]: "Yearn DAI",
21
+ // [YEARN_USDC_ADDRESS]: "Yearn USDC",
29
22
 
30
23
  // KOVAN
31
24
  "0xc40B71BCcb749D91923654571f715Bf1FC464E66": "DAI",
@@ -36,9 +29,9 @@ export const deployedContracts: Record<string, string> = {
36
29
  "0x600073357c29d169aAF3E543A4519749830553F1": "WETH",
37
30
  "0xdBAd1361d9A03B81Be8D3a54Ef0dc9e39a1bA5b3": "USDC",
38
31
  "0x50d1fA47b0D88BA0D108148B8481b4A762eFB99e": "DAI",
39
- [YEARN_DAI_KOVAN_MOCK]: "Yearn DAI",
40
- [YEARN_USDC_KOVAN_MOCK]: "Yearn USDC",
41
- [SUSHISWAP_KOVAN]: "Sushiswap"
32
+ // [YEARN_DAI_KOVAN_MOCK]: "Yearn DAI",
33
+ // [YEARN_USDC_KOVAN_MOCK]: "Yearn USDC",
34
+ // [SUSHISWAP_KOVAN]: "Sushiswap"
42
35
  };
43
36
 
44
37
 
@@ -1,4 +1,4 @@
1
- import { SupportedTokens } from "./token";
1
+ import { SupportedToken } from "./token";
2
2
 
3
3
  export interface PriceFeed {
4
4
  token: string;
@@ -22,24 +22,24 @@ export type PriceFeedData =
22
22
  }
23
23
  | {
24
24
  type: OracleType.YEARN_TOKEN_ORACLE;
25
- token: SupportedTokens;
25
+ token: SupportedToken;
26
26
  deployed?: string;
27
27
  deployedKovan?: string;
28
28
  }
29
29
  | {
30
30
  type: OracleType.CURVE_LP_ORACLE;
31
- assets: Array<SupportedTokens>;
31
+ assets: Array<SupportedToken>;
32
32
  }
33
33
  | {
34
34
  type: OracleType.YEARN_CURVE_LP_ORACLE;
35
- curveSymbol: SupportedTokens;
35
+ curveSymbol: SupportedToken;
36
36
  }
37
37
  | {
38
38
  type: OracleType.ZERO_ORACLE;
39
39
  }
40
40
  | {
41
41
  type: OracleType.LIKE_CURVE_LP_ORACLE;
42
- curveSymbol: SupportedTokens;
42
+ curveSymbol: SupportedToken;
43
43
  };
44
44
 
45
45
  export type TokenPriceFeedData = {
@@ -1,7 +1,7 @@
1
1
  import { BigNumber } from "ethers";
2
2
  import { CreditManagerData } from "./creditManager";
3
3
  import { MultiCall } from "./multicall";
4
- import { SupportedTokens } from "./token";
4
+ import { SupportedToken } from "./token";
5
5
 
6
6
  // const path = new Path({gasUsed:0, balances: creditAccount.balances, })
7
7
  // const closurePath = await path.getBestPath();
@@ -15,16 +15,16 @@ import { SupportedTokens } from "./token";
15
15
 
16
16
  export class Path {
17
17
  public readonly calls: Array<MultiCall> = [];
18
- public readonly balances: Record<SupportedTokens, BigNumber>;
18
+ public readonly balances: Record<SupportedToken, BigNumber>;
19
19
  // usedTokens: Array<SupportedTokens>;
20
20
  protected _gasUsed: number;
21
- public readonly pool: SupportedTokens;
21
+ public readonly pool: SupportedToken;
22
22
  public readonly creditManager: CreditManagerData;
23
23
 
24
24
  constructor(opts: {
25
25
  gasUsed: number;
26
- balances: Record<SupportedTokens, BigNumber>;
27
- pool: SupportedTokens;
26
+ balances: Record<SupportedToken, BigNumber>;
27
+ pool: SupportedToken;
28
28
  creditManager: CreditManagerData;
29
29
  }) {
30
30
  this._gasUsed = opts.gasUsed;