@gearbox-protocol/sdk 2.1.33 → 3.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/lib/apy/convexAPY.d.ts +4 -6
  2. package/lib/apy/convexAPY.js +15 -16
  3. package/lib/apy/curveAPY.d.ts +2 -2
  4. package/lib/apy/curveAPY.js +3 -4
  5. package/lib/apy/index.d.ts +1 -1
  6. package/lib/apy/index.js +2 -2
  7. package/lib/apy/lidoAPY.js +2 -2
  8. package/lib/apy/yearnAPY.d.ts +1 -1
  9. package/lib/apy/yearnAPY.js +3 -5
  10. package/lib/contracts/contractsRegister.d.ts +1 -1
  11. package/lib/contracts/contractsRegister.js +6 -7
  12. package/lib/core/creditAccount.js +20 -22
  13. package/lib/core/creditAccount.spec.js +32 -34
  14. package/lib/core/creditManager.d.ts +3 -0
  15. package/lib/core/creditManager.js +38 -17
  16. package/lib/core/creditSession.js +12 -13
  17. package/lib/core/events.js +34 -35
  18. package/lib/core/pool/data.js +22 -23
  19. package/lib/core/pool/index.d.ts +0 -1
  20. package/lib/core/pool/index.js +0 -1
  21. package/lib/core/priceOracle.js +3 -3
  22. package/lib/core/rewardClaimer.d.ts +1 -3
  23. package/lib/core/rewardConvex.d.ts +1 -4
  24. package/lib/core/rewardConvex.js +7 -10
  25. package/lib/core/rewardConvex.spec.js +15 -16
  26. package/lib/core/strategy.js +14 -16
  27. package/lib/core/strategy.spec.js +20 -22
  28. package/lib/core/trade.d.ts +29 -16
  29. package/lib/core/trade.js +76 -22
  30. package/lib/core/transactions.d.ts +1 -1
  31. package/lib/core/transactions.js +18 -20
  32. package/lib/index.d.ts +0 -31
  33. package/lib/index.js +1 -37
  34. package/lib/parsers/ERC20Parser.d.ts +1 -1
  35. package/lib/parsers/abstractParser.d.ts +1 -1
  36. package/lib/parsers/abstractParser.js +3 -4
  37. package/lib/parsers/convexBaseRewardPoolAdapterParser.d.ts +1 -1
  38. package/lib/parsers/convexBaseRewardPoolAdapterParser.js +2 -2
  39. package/lib/parsers/convexBaseRewardPoolAdapterParser.spec.js +4 -4
  40. package/lib/parsers/convexBoosterAdapterParser.d.ts +1 -1
  41. package/lib/parsers/convexBoosterAdapterParser.js +3 -3
  42. package/lib/parsers/convexBoosterAdapterParser.spec.js +3 -3
  43. package/lib/parsers/convextRewardPoolParser.d.ts +1 -1
  44. package/lib/parsers/creditFacadeParser.d.ts +1 -1
  45. package/lib/parsers/creditFacadeParser.spec.js +8 -9
  46. package/lib/parsers/curveAdapterParser.d.ts +1 -2
  47. package/lib/parsers/curveAdapterParser.js +5 -5
  48. package/lib/parsers/curveAdapterParser.spec.js +13 -13
  49. package/lib/parsers/lidoAdapterParser.d.ts +1 -1
  50. package/lib/parsers/lidoAdapterParser.spec.js +2 -2
  51. package/lib/parsers/lidoSTETHParser.d.ts +1 -1
  52. package/lib/parsers/txParser.d.ts +1 -3
  53. package/lib/parsers/txParser.js +13 -16
  54. package/lib/parsers/uniV2AdapterParser.d.ts +1 -1
  55. package/lib/parsers/uniV2AdapterParser.spec.js +15 -16
  56. package/lib/parsers/uniV3AdapterParser.d.ts +1 -1
  57. package/lib/parsers/uniV3AdapterParser.spec.js +15 -16
  58. package/lib/parsers/wstETHAdapterParser.d.ts +1 -1
  59. package/lib/parsers/wstETHAdapterParser.spec.js +3 -3
  60. package/lib/parsers/yearnAdapterParser.spec.js +12 -12
  61. package/lib/parsers/yearnV2AdapterParser.d.ts +1 -1
  62. package/lib/parsers/yearnV2AdapterParser.js +2 -2
  63. package/lib/pathfinder/pathOptions.d.ts +1 -2
  64. package/lib/pathfinder/pathOptions.js +12 -16
  65. package/lib/pathfinder/pathOptions.spec.js +36 -36
  66. package/lib/pathfinder/pathfinder.d.ts +1 -2
  67. package/lib/pathfinder/pathfinder.js +9 -10
  68. package/lib/pathfinder/pathfinder.spec.js +11 -12
  69. package/lib/payload/creditAccount.d.ts +1 -1
  70. package/lib/payload/creditManager.d.ts +1 -1
  71. package/lib/payload/pool.d.ts +1 -1
  72. package/lib/tokens/tokenData.d.ts +0 -4
  73. package/lib/tokens/tokenData.js +1 -16
  74. package/lib/utils/formatter.js +3 -3
  75. package/lib/utils/math.js +5 -5
  76. package/lib/utils/price.js +4 -4
  77. package/lib/watchers/creditAccountWatcher.js +2 -2
  78. package/lib/watchers/creditAccountWatcher.spec.js +18 -18
  79. package/lib/watchers/creditManagerWatcher.spec.js +19 -19
  80. package/package.json +2 -1
  81. package/lib/contracts/adapters.d.ts +0 -24
  82. package/lib/contracts/adapters.js +0 -28
  83. package/lib/contracts/contracts.d.ts +0 -112
  84. package/lib/contracts/contracts.js +0 -654
  85. package/lib/contracts/protocols.d.ts +0 -17
  86. package/lib/contracts/protocols.js +0 -58
  87. package/lib/contracts/utilsContracts.d.ts +0 -7
  88. package/lib/contracts/utilsContracts.js +0 -28
  89. package/lib/core/adapter.d.ts +0 -20
  90. package/lib/core/adapter.js +0 -20
  91. package/lib/core/chains.d.ts +0 -23
  92. package/lib/core/chains.js +0 -63
  93. package/lib/core/constants.d.ts +0 -21
  94. package/lib/core/constants.js +0 -31
  95. package/lib/core/creditOperation.d.ts +0 -9
  96. package/lib/core/creditOperation.js +0 -2
  97. package/lib/core/operations.d.ts +0 -22
  98. package/lib/core/operations.js +0 -26
  99. package/lib/core/pool/operation.d.ts +0 -28
  100. package/lib/core/pool/operation.js +0 -36
  101. package/lib/pathfinder/tradeTypes.d.ts +0 -113
  102. package/lib/pathfinder/tradeTypes.js +0 -28
  103. package/lib/strategies/convex.d.ts +0 -57
  104. package/lib/strategies/convex.js +0 -220
  105. package/lib/strategies/creditFacade.d.ts +0 -21
  106. package/lib/strategies/creditFacade.js +0 -71
  107. package/lib/strategies/curve.d.ts +0 -45
  108. package/lib/strategies/curve.js +0 -207
  109. package/lib/strategies/lido.d.ts +0 -18
  110. package/lib/strategies/lido.js +0 -51
  111. package/lib/strategies/uniswapV2.d.ts +0 -15
  112. package/lib/strategies/uniswapV2.js +0 -44
  113. package/lib/strategies/uniswapV3.d.ts +0 -21
  114. package/lib/strategies/uniswapV3.js +0 -71
  115. package/lib/strategies/yearn.d.ts +0 -20
  116. package/lib/strategies/yearn.js +0 -128
  117. package/lib/tokens/aave.d.ts +0 -23
  118. package/lib/tokens/aave.js +0 -119
  119. package/lib/tokens/balancer.d.ts +0 -22
  120. package/lib/tokens/balancer.js +0 -65
  121. package/lib/tokens/compound.d.ts +0 -13
  122. package/lib/tokens/compound.js +0 -74
  123. package/lib/tokens/convex.d.ts +0 -30
  124. package/lib/tokens/convex.js +0 -575
  125. package/lib/tokens/curveLP.d.ts +0 -28
  126. package/lib/tokens/curveLP.js +0 -364
  127. package/lib/tokens/decimals.d.ts +0 -2
  128. package/lib/tokens/decimals.js +0 -115
  129. package/lib/tokens/gear.d.ts +0 -16
  130. package/lib/tokens/gear.js +0 -47
  131. package/lib/tokens/normal.d.ts +0 -12
  132. package/lib/tokens/normal.js +0 -912
  133. package/lib/tokens/quoted.d.ts +0 -3
  134. package/lib/tokens/quoted.js +0 -7
  135. package/lib/tokens/token.d.ts +0 -25
  136. package/lib/tokens/token.js +0 -305
  137. package/lib/tokens/tokenType.d.ts +0 -15
  138. package/lib/tokens/tokenType.js +0 -19
  139. package/lib/tokens/tokens.spec.d.ts +0 -1
  140. package/lib/tokens/tokens.spec.js +0 -151
  141. package/lib/tokens/yearn.d.ts +0 -30
  142. package/lib/tokens/yearn.js +0 -95
  143. package/lib/utils/extracter.d.ts +0 -11
  144. package/lib/utils/extracter.js +0 -19
  145. package/lib/utils/mappers.d.ts +0 -8
  146. package/lib/utils/mappers.js +0 -13
  147. package/lib/utils/multicall.d.ts +0 -36
  148. package/lib/utils/multicall.js +0 -90
  149. package/lib/utils/safeEnum.d.ts +0 -1
  150. package/lib/utils/safeEnum.js +0 -10
  151. package/lib/utils/types.d.ts +0 -10
  152. package/lib/utils/types.js +0 -2
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UniswapV2Multicaller = exports.UniswapV2Calls = void 0;
4
- const types_1 = require("../types");
5
- class UniswapV2Calls {
6
- static swapExactTokensForTokens(amountIn, amountOutMin, path, to, deadline) {
7
- return types_1.IUniswapV2Adapter__factory.createInterface().encodeFunctionData("swapExactTokensForTokens", [amountIn, amountOutMin, path, to, deadline]);
8
- }
9
- static swapTokensForExactTokens(amountOut, amountInMax, path, to, deadline) {
10
- return types_1.IUniswapV2Adapter__factory.createInterface().encodeFunctionData("swapTokensForExactTokens", [amountOut, amountInMax, path, to, deadline]);
11
- }
12
- static swapAllTokensForTokens(rateMinRAY, path, deadline) {
13
- return types_1.IUniswapV2Adapter__factory.createInterface().encodeFunctionData("swapAllTokensForTokens", [rateMinRAY, path, deadline]);
14
- }
15
- }
16
- exports.UniswapV2Calls = UniswapV2Calls;
17
- class UniswapV2Multicaller {
18
- _address;
19
- constructor(address) {
20
- this._address = address;
21
- }
22
- static connect(address) {
23
- return new UniswapV2Multicaller(address);
24
- }
25
- swapExactTokensForTokens(amountIn, amountOutMin, path, to, deadline) {
26
- return {
27
- target: this._address,
28
- callData: UniswapV2Calls.swapExactTokensForTokens(amountIn, amountOutMin, path, to, deadline),
29
- };
30
- }
31
- swapTokensForExactTokens(amountOut, amountInMax, path, to, deadline) {
32
- return {
33
- target: this._address,
34
- callData: UniswapV2Calls.swapExactTokensForTokens(amountOut, amountInMax, path, to, deadline),
35
- };
36
- }
37
- swapAllTokensForTokens(rateMinRAY, path, deadline) {
38
- return {
39
- target: this._address,
40
- callData: UniswapV2Calls.swapAllTokensForTokens(rateMinRAY, path, deadline),
41
- };
42
- }
43
- }
44
- exports.UniswapV2Multicaller = UniswapV2Multicaller;
@@ -1,21 +0,0 @@
1
- import { ISwapRouter, IUniswapV3Adapter } from "../types";
2
- import { MultiCallStruct } from "../types/@gearbox-protocol/router/contracts/interfaces/IClosePathResolver";
3
- export declare class UniswapV3Calls {
4
- static exactInputSingle(params: ISwapRouter.ExactInputSingleParamsStructOutput): string;
5
- static exactAllInputSingle(params: IUniswapV3Adapter.ExactAllInputSingleParamsStructOutput): string;
6
- static exactInput(params: ISwapRouter.ExactInputParamsStructOutput): string;
7
- static exactAllInput(params: IUniswapV3Adapter.ExactAllInputParamsStructOutput): string;
8
- static exactOutputSingle(params: ISwapRouter.ExactOutputSingleParamsStructOutput): string;
9
- static exactOutput(params: ISwapRouter.ExactOutputParamsStructOutput): string;
10
- }
11
- export declare class UniswapV3Multicaller {
12
- private readonly _address;
13
- constructor(address: string);
14
- static connect(address: string): UniswapV3Multicaller;
15
- exactInputSingle(params: ISwapRouter.ExactInputSingleParamsStructOutput): MultiCallStruct;
16
- exactAllInputSingle(params: IUniswapV3Adapter.ExactAllInputSingleParamsStructOutput): MultiCallStruct;
17
- exactInput(params: ISwapRouter.ExactInputParamsStructOutput): MultiCallStruct;
18
- exactAllInput(params: IUniswapV3Adapter.ExactAllInputParamsStructOutput): MultiCallStruct;
19
- exactOutputSingle(params: ISwapRouter.ExactOutputSingleParamsStructOutput): MultiCallStruct;
20
- exactOutput(params: ISwapRouter.ExactOutputParamsStructOutput): MultiCallStruct;
21
- }
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UniswapV3Multicaller = exports.UniswapV3Calls = void 0;
4
- const types_1 = require("../types");
5
- class UniswapV3Calls {
6
- static exactInputSingle(params) {
7
- return types_1.IUniswapV3Adapter__factory.createInterface().encodeFunctionData("exactInputSingle", [params]);
8
- }
9
- static exactAllInputSingle(params) {
10
- return types_1.IUniswapV3Adapter__factory.createInterface().encodeFunctionData("exactAllInputSingle", [params]);
11
- }
12
- static exactInput(params) {
13
- return types_1.IUniswapV3Adapter__factory.createInterface().encodeFunctionData("exactInput", [params]);
14
- }
15
- static exactAllInput(params) {
16
- return types_1.IUniswapV3Adapter__factory.createInterface().encodeFunctionData("exactAllInput", [params]);
17
- }
18
- static exactOutputSingle(params) {
19
- return types_1.IUniswapV3Adapter__factory.createInterface().encodeFunctionData("exactOutputSingle", [params]);
20
- }
21
- static exactOutput(params) {
22
- return types_1.IUniswapV3Adapter__factory.createInterface().encodeFunctionData("exactOutput", [params]);
23
- }
24
- }
25
- exports.UniswapV3Calls = UniswapV3Calls;
26
- class UniswapV3Multicaller {
27
- _address;
28
- constructor(address) {
29
- this._address = address;
30
- }
31
- static connect(address) {
32
- return new UniswapV3Multicaller(address);
33
- }
34
- exactInputSingle(params) {
35
- return {
36
- target: this._address,
37
- callData: UniswapV3Calls.exactInputSingle(params),
38
- };
39
- }
40
- exactAllInputSingle(params) {
41
- return {
42
- target: this._address,
43
- callData: UniswapV3Calls.exactAllInputSingle(params),
44
- };
45
- }
46
- exactInput(params) {
47
- return {
48
- target: this._address,
49
- callData: UniswapV3Calls.exactInput(params),
50
- };
51
- }
52
- exactAllInput(params) {
53
- return {
54
- target: this._address,
55
- callData: UniswapV3Calls.exactAllInput(params),
56
- };
57
- }
58
- exactOutputSingle(params) {
59
- return {
60
- target: this._address,
61
- callData: UniswapV3Calls.exactOutputSingle(params),
62
- };
63
- }
64
- exactOutput(params) {
65
- return {
66
- target: this._address,
67
- callData: UniswapV3Calls.exactOutput(params),
68
- };
69
- }
70
- }
71
- exports.UniswapV3Multicaller = UniswapV3Multicaller;
@@ -1,20 +0,0 @@
1
- import { BigNumberish } from "ethers";
2
- import { YearnVaultContract } from "../contracts/contracts";
3
- import { NetworkType } from "../core/chains";
4
- import { CreditManagerData } from "../core/creditManager";
5
- import { MultiCallStruct } from "../types/@gearbox-protocol/router/contracts/interfaces/IClosePathResolver";
6
- export declare class YearnV2Calls {
7
- static deposit(amount?: BigNumberish, recipient?: string): string;
8
- static withdraw(maxShares?: BigNumberish, recipient?: string, maxLoss?: BigNumberish): string;
9
- }
10
- export declare class YearnV2Multicaller {
11
- private readonly _address;
12
- constructor(address: string);
13
- static connect(address: string): YearnV2Multicaller;
14
- deposit(amount?: BigNumberish, recipient?: string): MultiCallStruct;
15
- withdraw(maxShares?: BigNumberish, recipient?: string, maxLoss?: BigNumberish): MultiCallStruct;
16
- }
17
- export declare class YearnV2Strategies {
18
- static underlyingToYearn(data: CreditManagerData, network: NetworkType, yearnVault: YearnVaultContract, underlyingAmount: BigNumberish): MultiCallStruct[];
19
- static yearnToUnderlying(data: CreditManagerData, network: NetworkType, yearnVault: YearnVaultContract, yearnSharesAmount: BigNumberish): MultiCallStruct[];
20
- }
@@ -1,128 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.YearnV2Strategies = exports.YearnV2Multicaller = exports.YearnV2Calls = void 0;
4
- const contracts_1 = require("../contracts/contracts");
5
- const constants_1 = require("../core/constants");
6
- const token_1 = require("../tokens/token");
7
- const tokenType_1 = require("../tokens/tokenType");
8
- const types_1 = require("../types");
9
- const curve_1 = require("./curve");
10
- const uniswapV2_1 = require("./uniswapV2");
11
- class YearnV2Calls {
12
- static deposit(amount, recipient) {
13
- const contractInterface = types_1.IYVault__factory.createInterface();
14
- if (amount && recipient) {
15
- return contractInterface.encodeFunctionData("deposit(uint256,address)", [
16
- amount,
17
- recipient,
18
- ]);
19
- }
20
- if (amount) {
21
- return contractInterface.encodeFunctionData("deposit(uint256)", [amount]);
22
- }
23
- return contractInterface.encodeFunctionData("deposit()");
24
- }
25
- static withdraw(maxShares, recipient, maxLoss) {
26
- const contractInterface = types_1.IYVault__factory.createInterface();
27
- if (maxShares && recipient && maxLoss) {
28
- return contractInterface.encodeFunctionData("withdraw(uint256,address,uint256)", [maxShares, recipient, maxLoss]);
29
- }
30
- if (maxShares && recipient) {
31
- return contractInterface.encodeFunctionData("withdraw(uint256,address)", [
32
- maxShares,
33
- recipient,
34
- ]);
35
- }
36
- if (maxShares) {
37
- return contractInterface.encodeFunctionData("withdraw(uint256)", [
38
- maxShares,
39
- ]);
40
- }
41
- return contractInterface.encodeFunctionData("withdraw()");
42
- }
43
- }
44
- exports.YearnV2Calls = YearnV2Calls;
45
- class YearnV2Multicaller {
46
- _address;
47
- constructor(address) {
48
- this._address = address;
49
- }
50
- static connect(address) {
51
- return new YearnV2Multicaller(address);
52
- }
53
- deposit(amount, recipient) {
54
- return {
55
- target: this._address,
56
- callData: YearnV2Calls.deposit(amount, recipient),
57
- };
58
- }
59
- withdraw(maxShares, recipient, maxLoss) {
60
- return {
61
- target: this._address,
62
- callData: YearnV2Calls.withdraw(maxShares, recipient, maxLoss),
63
- };
64
- }
65
- }
66
- exports.YearnV2Multicaller = YearnV2Multicaller;
67
- class YearnV2Strategies {
68
- static underlyingToYearn(data, network, yearnVault, underlyingAmount) {
69
- let calls = [];
70
- const vaultParams = contracts_1.contractParams[yearnVault];
71
- const yearnToken = vaultParams.shareToken;
72
- const yearnParams = token_1.supportedTokens[yearnToken];
73
- if (yearnParams.type === tokenType_1.TokenType.YEARN_ON_NORMAL_TOKEN) {
74
- if (data.underlyingToken.toLowerCase() !==
75
- token_1.tokenDataByNetwork[network][yearnParams.underlying].toLowerCase()) {
76
- // This should be a pathfinder call
77
- calls.push(uniswapV2_1.UniswapV2Multicaller.connect(data.adapters[contracts_1.contractsByNetwork[network].UNISWAP_V2_ROUTER.toLowerCase()]).swapExactTokensForTokens(underlyingAmount, 0, [
78
- data.underlyingToken,
79
- token_1.tokenDataByNetwork[network][yearnParams.underlying],
80
- ], constants_1.ADDRESS_0X0, Math.floor(new Date().getTime() / 1000) + 3600));
81
- }
82
- else {
83
- calls.push(YearnV2Multicaller.connect(data.adapters[contracts_1.contractsByNetwork[network][yearnVault].toLowerCase()]).deposit(underlyingAmount));
84
- return calls;
85
- }
86
- }
87
- else if (yearnParams.type === tokenType_1.TokenType.YEARN_ON_CURVE_TOKEN) {
88
- const curveTokenParams = token_1.supportedTokens[yearnParams.underlying];
89
- const curvePool = curveTokenParams.pool;
90
- calls = curve_1.CurveStrategies.underlyingToCurveLP(data, network, curvePool, underlyingAmount);
91
- }
92
- else {
93
- throw new Error("Yearn vault type unknown");
94
- }
95
- calls.push(YearnV2Multicaller.connect(data.adapters[contracts_1.contractsByNetwork[network][yearnVault].toLowerCase()]).deposit());
96
- return calls;
97
- }
98
- static yearnToUnderlying(data, network, yearnVault, yearnSharesAmount) {
99
- let calls = [];
100
- const vaultParams = contracts_1.contractParams[yearnVault];
101
- const yearnToken = vaultParams.shareToken;
102
- const yearnParams = token_1.supportedTokens[yearnToken];
103
- calls.push(YearnV2Multicaller.connect(data.adapters[contracts_1.contractsByNetwork[network][yearnVault].toLowerCase()]).withdraw(yearnSharesAmount));
104
- if (yearnParams.type === tokenType_1.TokenType.YEARN_ON_NORMAL_TOKEN) {
105
- if (data.underlyingToken.toLowerCase() !==
106
- token_1.tokenDataByNetwork[network][yearnParams.underlying].toLowerCase()) {
107
- // This should be a pathfinder call
108
- calls.push(uniswapV2_1.UniswapV2Multicaller.connect(data.adapters[contracts_1.contractsByNetwork[network].UNISWAP_V2_ROUTER.toLowerCase()]).swapAllTokensForTokens(0, [
109
- token_1.tokenDataByNetwork[network][yearnParams.underlying],
110
- data.underlyingToken,
111
- ], Math.floor(new Date().getTime() / 1000) + 3600));
112
- }
113
- }
114
- else if (yearnParams.type === tokenType_1.TokenType.YEARN_ON_CURVE_TOKEN) {
115
- const curveTokenParams = token_1.supportedTokens[yearnParams.underlying];
116
- const curvePool = curveTokenParams.pool;
117
- calls = [
118
- ...calls,
119
- ...curve_1.CurveStrategies.allCurveLPToUnderlying(data, network, curvePool),
120
- ];
121
- }
122
- else {
123
- throw new Error("Yearn vault type unknown");
124
- }
125
- return calls;
126
- }
127
- }
128
- exports.YearnV2Strategies = YearnV2Strategies;
@@ -1,23 +0,0 @@
1
- import type { AaveV2PoolContract } from "../contracts/contracts";
2
- import { TradeAction } from "../pathfinder/tradeTypes";
3
- import { NormalToken } from "./normal";
4
- import type { TokenBase } from "./token";
5
- import { TokenType } from "./tokenType";
6
- export type AaveV2LPToken = "aDAI" | "aUSDC" | "aWETH" | "aUSDT";
7
- export type WrappedAaveV2LPToken = "waDAI" | "waUSDC" | "waWETH" | "waUSDT";
8
- export type AaveV2PoolTokenData = {
9
- symbol: AaveV2LPToken;
10
- type: TokenType.AAVE_V2_A_TOKEN;
11
- underlying: NormalToken;
12
- lpActions: Array<TradeAction>;
13
- pool: AaveV2PoolContract;
14
- } & TokenBase;
15
- export type WrappedAaveV2PoolTokenData = {
16
- symbol: WrappedAaveV2LPToken;
17
- type: TokenType.WRAPPED_AAVE_V2_TOKEN;
18
- underlying: AaveV2LPToken;
19
- lpActions: Array<TradeAction>;
20
- } & TokenBase;
21
- export declare const aaveV2Tokens: Record<AaveV2LPToken, AaveV2PoolTokenData>;
22
- export declare const wrappedAaveV2Tokens: Record<WrappedAaveV2LPToken, WrappedAaveV2PoolTokenData>;
23
- export declare const isAaveV2LPToken: (t: unknown) => t is AaveV2LPToken;
@@ -1,119 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isAaveV2LPToken = exports.wrappedAaveV2Tokens = exports.aaveV2Tokens = void 0;
4
- const tradeTypes_1 = require("../pathfinder/tradeTypes");
5
- const tokenType_1 = require("./tokenType");
6
- exports.aaveV2Tokens = {
7
- aDAI: {
8
- name: "AaveV2 aDAI",
9
- symbol: "aDAI",
10
- type: tokenType_1.TokenType.AAVE_V2_A_TOKEN,
11
- underlying: "DAI",
12
- pool: "AAVE_V2_DAI_POOL",
13
- lpActions: [
14
- {
15
- type: tradeTypes_1.TradeType.AaveV2Withdraw,
16
- contract: "AAVE_V2_DAI_POOL",
17
- tokenOut: "DAI",
18
- },
19
- ],
20
- },
21
- aUSDC: {
22
- name: "AaveV2 aUSDC",
23
- symbol: "aUSDC",
24
- type: tokenType_1.TokenType.AAVE_V2_A_TOKEN,
25
- underlying: "USDC",
26
- pool: "AAVE_V2_USDC_POOL",
27
- lpActions: [
28
- {
29
- type: tradeTypes_1.TradeType.AaveV2Withdraw,
30
- contract: "AAVE_V2_USDC_POOL",
31
- tokenOut: "USDC",
32
- },
33
- ],
34
- },
35
- aUSDT: {
36
- name: "AaveV2 aUSDT",
37
- symbol: "aUSDT",
38
- type: tokenType_1.TokenType.AAVE_V2_A_TOKEN,
39
- underlying: "USDT",
40
- pool: "AAVE_V2_USDT_POOL",
41
- lpActions: [
42
- {
43
- type: tradeTypes_1.TradeType.AaveV2Withdraw,
44
- contract: "AAVE_V2_USDT_POOL",
45
- tokenOut: "USDT",
46
- },
47
- ],
48
- },
49
- aWETH: {
50
- name: "AaveV2 aWETH",
51
- symbol: "aWETH",
52
- type: tokenType_1.TokenType.AAVE_V2_A_TOKEN,
53
- underlying: "WETH",
54
- pool: "AAVE_V2_WETH_POOL",
55
- lpActions: [
56
- {
57
- type: tradeTypes_1.TradeType.AaveV2Withdraw,
58
- contract: "AAVE_V2_WETH_POOL",
59
- tokenOut: "WETH",
60
- },
61
- ],
62
- },
63
- };
64
- exports.wrappedAaveV2Tokens = {
65
- waDAI: {
66
- name: "Wrapped AaveV2 aDAI",
67
- symbol: "waDAI",
68
- type: tokenType_1.TokenType.WRAPPED_AAVE_V2_TOKEN,
69
- underlying: "aDAI",
70
- lpActions: [
71
- {
72
- type: tradeTypes_1.TradeType.AaveV2Withdraw,
73
- contract: "AAVE_V2_DAI_POOL",
74
- tokenOut: "DAI",
75
- },
76
- ],
77
- },
78
- waUSDC: {
79
- name: "Wrapped AaveV2 aUSDC",
80
- symbol: "waUSDC",
81
- type: tokenType_1.TokenType.WRAPPED_AAVE_V2_TOKEN,
82
- underlying: "aUSDC",
83
- lpActions: [
84
- {
85
- type: tradeTypes_1.TradeType.AaveV2Withdraw,
86
- contract: "AAVE_V2_USDC_POOL",
87
- tokenOut: "USDC",
88
- },
89
- ],
90
- },
91
- waUSDT: {
92
- name: "Wrapped AaveV2 aUSDT",
93
- symbol: "waUSDT",
94
- type: tokenType_1.TokenType.WRAPPED_AAVE_V2_TOKEN,
95
- underlying: "aUSDT",
96
- lpActions: [
97
- {
98
- type: tradeTypes_1.TradeType.AaveV2Withdraw,
99
- contract: "AAVE_V2_USDT_POOL",
100
- tokenOut: "USDT",
101
- },
102
- ],
103
- },
104
- waWETH: {
105
- name: "Wrapped AaveV2 aWETH",
106
- symbol: "waWETH",
107
- type: tokenType_1.TokenType.WRAPPED_AAVE_V2_TOKEN,
108
- underlying: "aWETH",
109
- lpActions: [
110
- {
111
- type: tradeTypes_1.TradeType.AaveV2Withdraw,
112
- contract: "AAVE_V2_WETH_POOL",
113
- tokenOut: "WETH",
114
- },
115
- ],
116
- },
117
- };
118
- const isAaveV2LPToken = (t) => typeof t === "string" && !!exports.aaveV2Tokens[t];
119
- exports.isAaveV2LPToken = isAaveV2LPToken;
@@ -1,22 +0,0 @@
1
- import { TradeType } from "../pathfinder/tradeTypes";
2
- import { NormalToken } from "./normal";
3
- import type { TokenBase } from "./token";
4
- import { TokenType } from "./tokenType";
5
- export type BalancerLPToken = "50OHM_50DAI" | "50OHM_50WETH" | "OHM_wstETH" | "USDC_DAI_USDT";
6
- export type BalancerLpTokenData = {
7
- symbol: BalancerLPToken;
8
- type: TokenType.BALANCER_LP_TOKEN;
9
- underlying: Array<NormalToken | BalancerLPToken>;
10
- lpActions: Array<{
11
- type: TradeType.BalancerJoin;
12
- contract: "BALANCER_VAULT";
13
- tokenOut: BalancerLPToken;
14
- } | {
15
- type: TradeType.BalancerExit;
16
- contract: "BALANCER_VAULT";
17
- tokenOut: Array<NormalToken | BalancerLPToken>;
18
- }>;
19
- poolId: string;
20
- } & TokenBase;
21
- export declare const balancerLpTokens: Record<BalancerLPToken, BalancerLpTokenData>;
22
- export declare const isBalancerLPToken: (t: unknown) => t is BalancerLPToken;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isBalancerLPToken = exports.balancerLpTokens = void 0;
4
- const tradeTypes_1 = require("../pathfinder/tradeTypes");
5
- const tokenType_1 = require("./tokenType");
6
- exports.balancerLpTokens = {
7
- "50OHM_50DAI": {
8
- name: "Balancer 50OHM_50DAI",
9
- symbol: "50OHM_50DAI",
10
- type: tokenType_1.TokenType.BALANCER_LP_TOKEN,
11
- underlying: ["OHM", "DAI"],
12
- poolId: "0x76fcf0e8c7ff37a47a799fa2cd4c13cde0d981c90002000000000000000003d2",
13
- lpActions: [
14
- {
15
- type: tradeTypes_1.TradeType.BalancerExit,
16
- contract: "BALANCER_VAULT",
17
- tokenOut: ["OHM", "DAI"],
18
- },
19
- ],
20
- },
21
- "50OHM_50WETH": {
22
- name: "Balancer 50OHM_50WETH",
23
- symbol: "50OHM_50WETH",
24
- type: tokenType_1.TokenType.BALANCER_LP_TOKEN,
25
- underlying: ["OHM", "WETH"],
26
- poolId: "0xd1ec5e215e8148d76f4460e4097fd3d5ae0a35580002000000000000000003d3",
27
- lpActions: [
28
- {
29
- type: tradeTypes_1.TradeType.BalancerExit,
30
- contract: "BALANCER_VAULT",
31
- tokenOut: ["OHM", "WETH"],
32
- },
33
- ],
34
- },
35
- OHM_wstETH: {
36
- name: "Balancer OHM_wstETH",
37
- symbol: "OHM_wstETH",
38
- type: tokenType_1.TokenType.BALANCER_LP_TOKEN,
39
- underlying: ["OHM", "wstETH"],
40
- poolId: "0xd4f79ca0ac83192693bce4699d0c10c66aa6cf0f00020000000000000000047e",
41
- lpActions: [
42
- {
43
- type: tradeTypes_1.TradeType.BalancerExit,
44
- contract: "BALANCER_VAULT",
45
- tokenOut: ["OHM", "wstETH"],
46
- },
47
- ],
48
- },
49
- USDC_DAI_USDT: {
50
- name: "Balancer USDC_DAI_USDT",
51
- symbol: "USDC_DAI_USDT",
52
- type: tokenType_1.TokenType.BALANCER_LP_TOKEN,
53
- underlying: ["USDC", "DAI", "USDT"],
54
- poolId: "0x79c58f70905f734641735bc61e45c19dd9ad60bc0000000000000000000004e7",
55
- lpActions: [
56
- {
57
- type: tradeTypes_1.TradeType.BalancerExit,
58
- contract: "BALANCER_VAULT",
59
- tokenOut: ["USDC", "DAI", "USDT"],
60
- },
61
- ],
62
- },
63
- };
64
- const isBalancerLPToken = (t) => typeof t === "string" && !!exports.balancerLpTokens[t];
65
- exports.isBalancerLPToken = isBalancerLPToken;
@@ -1,13 +0,0 @@
1
- import { TradeAction } from "../pathfinder/tradeTypes";
2
- import { NormalToken } from "./normal";
3
- import type { TokenBase } from "./token";
4
- import { TokenType } from "./tokenType";
5
- export type CompoundV2LPToken = "cDAI" | "cUSDC" | "cETH" | "cUSDT" | "cLINK";
6
- export type CompoundV2PoolTokenData = {
7
- symbol: CompoundV2LPToken;
8
- type: TokenType.COMPOUND_V2_C_TOKEN;
9
- underlying: NormalToken;
10
- lpActions: Array<TradeAction>;
11
- } & TokenBase;
12
- export declare const compoundV2Tokens: Record<CompoundV2LPToken, CompoundV2PoolTokenData>;
13
- export declare const isCompoundV2LPToken: (t: unknown) => t is CompoundV2LPToken;
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isCompoundV2LPToken = exports.compoundV2Tokens = void 0;
4
- const tradeTypes_1 = require("../pathfinder/tradeTypes");
5
- const tokenType_1 = require("./tokenType");
6
- exports.compoundV2Tokens = {
7
- cDAI: {
8
- name: "CompoundV2 cDAI",
9
- symbol: "cDAI",
10
- type: tokenType_1.TokenType.COMPOUND_V2_C_TOKEN,
11
- underlying: "DAI",
12
- lpActions: [
13
- {
14
- type: tradeTypes_1.TradeType.CompoundV2Withdraw,
15
- contract: "COMPOUND_V2_DAI_POOL",
16
- tokenOut: "DAI",
17
- },
18
- ],
19
- },
20
- cUSDC: {
21
- name: "CompoundV2 cUSDC",
22
- symbol: "cUSDC",
23
- type: tokenType_1.TokenType.COMPOUND_V2_C_TOKEN,
24
- underlying: "USDC",
25
- lpActions: [
26
- {
27
- type: tradeTypes_1.TradeType.CompoundV2Withdraw,
28
- contract: "COMPOUND_V2_USDC_POOL",
29
- tokenOut: "USDC",
30
- },
31
- ],
32
- },
33
- cUSDT: {
34
- name: "CompoundV2 cUSDT",
35
- symbol: "cUSDT",
36
- type: tokenType_1.TokenType.COMPOUND_V2_C_TOKEN,
37
- underlying: "USDT",
38
- lpActions: [
39
- {
40
- type: tradeTypes_1.TradeType.CompoundV2Withdraw,
41
- contract: "COMPOUND_V2_USDT_POOL",
42
- tokenOut: "USDT",
43
- },
44
- ],
45
- },
46
- cETH: {
47
- name: "CompoundV2 cETH",
48
- symbol: "cETH",
49
- type: tokenType_1.TokenType.COMPOUND_V2_C_TOKEN,
50
- underlying: "WETH",
51
- lpActions: [
52
- {
53
- type: tradeTypes_1.TradeType.CompoundV2Withdraw,
54
- contract: "COMPOUND_V2_ETH_POOL",
55
- tokenOut: "WETH",
56
- },
57
- ],
58
- },
59
- cLINK: {
60
- name: "CompoundV2 cLINK",
61
- symbol: "cLINK",
62
- type: tokenType_1.TokenType.COMPOUND_V2_C_TOKEN,
63
- underlying: "LINK",
64
- lpActions: [
65
- {
66
- type: tradeTypes_1.TradeType.CompoundV2Withdraw,
67
- contract: "COMPOUND_V2_LINK_POOL",
68
- tokenOut: "LINK",
69
- },
70
- ],
71
- },
72
- };
73
- const isCompoundV2LPToken = (t) => typeof t === "string" && !!exports.compoundV2Tokens[t];
74
- exports.isCompoundV2LPToken = isCompoundV2LPToken;
@@ -1,30 +0,0 @@
1
- import type { ConvexPoolContract, SupportedContract } from "../contracts/contracts";
2
- import { TradeAction } from "../pathfinder/tradeTypes";
3
- import type { CurveLPToken } from "./curveLP";
4
- import type { SupportedToken, TokenBase } from "./token";
5
- import { TokenType } from "./tokenType";
6
- export type ConvexLPToken = "cvx3Crv" | "cvxcrvFRAX" | "cvxsteCRV" | "cvxFRAX3CRV" | "cvxLUSD3CRV" | "cvxcrvPlain3andSUSD" | "cvxgusd3CRV" | "cvxOHMFRAXBP" | "cvxMIM_3LP3CRV" | "cvxcrvCRVETH" | "cvxcrvCVXETH" | "cvxcrvUSDTWBTCWETH" | "cvxLDOETH";
7
- export type ConvexStakedPhantomToken = "stkcvx3Crv" | "stkcvxcrvFRAX" | "stkcvxsteCRV" | "stkcvxFRAX3CRV" | "stkcvxLUSD3CRV" | "stkcvxcrvPlain3andSUSD" | "stkcvxgusd3CRV" | "stkcvxOHMFRAXBP" | "stkcvxMIM_3LP3CRV" | "stkcvxcrvCRVETH" | "stkcvxcrvCVXETH" | "stkcvxcrvUSDTWBTCWETH" | "stkcvxLDOETH";
8
- type BaseConvexToken = {
9
- pool: ConvexPoolContract;
10
- pid: number;
11
- underlying: CurveLPToken;
12
- lpActions: Array<TradeAction>;
13
- } & TokenBase;
14
- export type ConvexLPTokenData = {
15
- symbol: ConvexLPToken;
16
- type: TokenType.CONVEX_LP_TOKEN;
17
- stakedToken: ConvexStakedPhantomToken;
18
- } & BaseConvexToken;
19
- export type ConvexPhantomTokenData = {
20
- symbol: ConvexStakedPhantomToken;
21
- type: TokenType.CONVEX_STAKED_TOKEN;
22
- lpToken: ConvexLPToken;
23
- } & BaseConvexToken;
24
- export declare const convexTokens: Record<ConvexLPToken | ConvexStakedPhantomToken, ConvexLPTokenData | ConvexPhantomTokenData>;
25
- export declare const isConvexToken: (t: unknown) => t is ConvexLPToken | ConvexStakedPhantomToken;
26
- export declare const isConvexLPToken: (t: unknown) => t is ConvexLPToken;
27
- export declare const isConvexStakedPhantomToken: (t: unknown) => t is ConvexStakedPhantomToken;
28
- export declare const convexPoolByPid: Record<number, SupportedContract>;
29
- export declare const convexLpTokenByPid: Record<number, SupportedToken>;
30
- export {};