@gearbox-protocol/sdk 2.1.32 → 2.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/contracts/protocols.d.ts +0 -5
- package/lib/contracts/protocols.js +1 -43
- package/lib/core/creditManager.d.ts +3 -0
- package/lib/core/creditManager.js +22 -0
- package/lib/core/pool/index.d.ts +0 -1
- package/lib/core/pool/index.js +0 -1
- package/lib/core/trade.d.ts +29 -16
- package/lib/core/trade.js +67 -10
- package/lib/index.d.ts +0 -11
- package/lib/index.js +1 -14
- package/lib/parsers/txParser.js +1 -1
- package/lib/tokens/aave.d.ts +0 -3
- package/lib/tokens/aave.js +0 -57
- package/lib/tokens/balancer.d.ts +1 -11
- package/lib/tokens/balancer.js +3 -32
- package/lib/tokens/compound.d.ts +0 -2
- package/lib/tokens/compound.js +0 -36
- package/lib/tokens/convex.d.ts +2 -2
- package/lib/tokens/convex.js +9 -322
- package/lib/tokens/curveLP.d.ts +3 -4
- package/lib/tokens/curveLP.js +17 -240
- package/lib/tokens/decimals.js +1 -1
- package/lib/tokens/gear.d.ts +0 -2
- package/lib/tokens/normal.d.ts +0 -3
- package/lib/tokens/normal.js +0 -718
- package/lib/tokens/token.js +2 -2
- package/lib/tokens/tokens.spec.js +25 -4
- package/lib/tokens/yearn.d.ts +0 -4
- package/lib/tokens/yearn.js +0 -43
- package/lib/utils/multicall.d.ts +1 -1
- package/lib/utils/multicall.js +21 -6
- package/package.json +1 -1
- package/lib/core/adapter.d.ts +0 -20
- package/lib/core/adapter.js +0 -20
- package/lib/core/creditOperation.d.ts +0 -9
- package/lib/core/creditOperation.js +0 -2
- package/lib/core/operations.d.ts +0 -22
- package/lib/core/operations.js +0 -26
- package/lib/core/pool/operation.d.ts +0 -28
- package/lib/core/pool/operation.js +0 -36
- package/lib/pathfinder/tradeTypes.d.ts +0 -113
- package/lib/pathfinder/tradeTypes.js +0 -28
- package/lib/strategies/convex.d.ts +0 -57
- package/lib/strategies/convex.js +0 -220
- package/lib/strategies/creditFacade.d.ts +0 -21
- package/lib/strategies/creditFacade.js +0 -71
- package/lib/strategies/curve.d.ts +0 -45
- package/lib/strategies/curve.js +0 -207
- package/lib/strategies/lido.d.ts +0 -18
- package/lib/strategies/lido.js +0 -51
- package/lib/strategies/uniswapV2.d.ts +0 -15
- package/lib/strategies/uniswapV2.js +0 -44
- package/lib/strategies/uniswapV3.d.ts +0 -21
- package/lib/strategies/uniswapV3.js +0 -71
- package/lib/strategies/yearn.d.ts +0 -20
- package/lib/strategies/yearn.js +0 -128
- package/lib/utils/extracter.d.ts +0 -11
- package/lib/utils/extracter.js +0 -19
package/lib/tokens/compound.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isCompoundV2LPToken = exports.compoundV2Tokens = void 0;
|
|
4
|
-
const tradeTypes_1 = require("../pathfinder/tradeTypes");
|
|
5
4
|
const tokenType_1 = require("./tokenType");
|
|
6
5
|
exports.compoundV2Tokens = {
|
|
7
6
|
cDAI: {
|
|
@@ -9,65 +8,30 @@ exports.compoundV2Tokens = {
|
|
|
9
8
|
symbol: "cDAI",
|
|
10
9
|
type: tokenType_1.TokenType.COMPOUND_V2_C_TOKEN,
|
|
11
10
|
underlying: "DAI",
|
|
12
|
-
lpActions: [
|
|
13
|
-
{
|
|
14
|
-
type: tradeTypes_1.TradeType.CompoundV2Withdraw,
|
|
15
|
-
contract: "COMPOUND_V2_DAI_POOL",
|
|
16
|
-
tokenOut: "DAI",
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
11
|
},
|
|
20
12
|
cUSDC: {
|
|
21
13
|
name: "CompoundV2 cUSDC",
|
|
22
14
|
symbol: "cUSDC",
|
|
23
15
|
type: tokenType_1.TokenType.COMPOUND_V2_C_TOKEN,
|
|
24
16
|
underlying: "USDC",
|
|
25
|
-
lpActions: [
|
|
26
|
-
{
|
|
27
|
-
type: tradeTypes_1.TradeType.CompoundV2Withdraw,
|
|
28
|
-
contract: "COMPOUND_V2_USDC_POOL",
|
|
29
|
-
tokenOut: "USDC",
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
17
|
},
|
|
33
18
|
cUSDT: {
|
|
34
19
|
name: "CompoundV2 cUSDT",
|
|
35
20
|
symbol: "cUSDT",
|
|
36
21
|
type: tokenType_1.TokenType.COMPOUND_V2_C_TOKEN,
|
|
37
22
|
underlying: "USDT",
|
|
38
|
-
lpActions: [
|
|
39
|
-
{
|
|
40
|
-
type: tradeTypes_1.TradeType.CompoundV2Withdraw,
|
|
41
|
-
contract: "COMPOUND_V2_USDT_POOL",
|
|
42
|
-
tokenOut: "USDT",
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
23
|
},
|
|
46
24
|
cETH: {
|
|
47
25
|
name: "CompoundV2 cETH",
|
|
48
26
|
symbol: "cETH",
|
|
49
27
|
type: tokenType_1.TokenType.COMPOUND_V2_C_TOKEN,
|
|
50
28
|
underlying: "WETH",
|
|
51
|
-
lpActions: [
|
|
52
|
-
{
|
|
53
|
-
type: tradeTypes_1.TradeType.CompoundV2Withdraw,
|
|
54
|
-
contract: "COMPOUND_V2_ETH_POOL",
|
|
55
|
-
tokenOut: "WETH",
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
29
|
},
|
|
59
30
|
cLINK: {
|
|
60
31
|
name: "CompoundV2 cLINK",
|
|
61
32
|
symbol: "cLINK",
|
|
62
33
|
type: tokenType_1.TokenType.COMPOUND_V2_C_TOKEN,
|
|
63
34
|
underlying: "LINK",
|
|
64
|
-
lpActions: [
|
|
65
|
-
{
|
|
66
|
-
type: tradeTypes_1.TradeType.CompoundV2Withdraw,
|
|
67
|
-
contract: "COMPOUND_V2_LINK_POOL",
|
|
68
|
-
tokenOut: "LINK",
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
35
|
},
|
|
72
36
|
};
|
|
73
37
|
const isCompoundV2LPToken = (t) => typeof t === "string" && !!exports.compoundV2Tokens[t];
|
package/lib/tokens/convex.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ConvexPoolContract, SupportedContract } from "../contracts/contracts";
|
|
2
|
-
import { TradeAction } from "../pathfinder/tradeTypes";
|
|
3
2
|
import type { CurveLPToken } from "./curveLP";
|
|
4
3
|
import type { SupportedToken, TokenBase } from "./token";
|
|
5
4
|
import { TokenType } from "./tokenType";
|
|
@@ -9,7 +8,6 @@ type BaseConvexToken = {
|
|
|
9
8
|
pool: ConvexPoolContract;
|
|
10
9
|
pid: number;
|
|
11
10
|
underlying: CurveLPToken;
|
|
12
|
-
lpActions: Array<TradeAction>;
|
|
13
11
|
} & TokenBase;
|
|
14
12
|
export type ConvexLPTokenData = {
|
|
15
13
|
symbol: ConvexLPToken;
|
|
@@ -21,6 +19,8 @@ export type ConvexPhantomTokenData = {
|
|
|
21
19
|
type: TokenType.CONVEX_STAKED_TOKEN;
|
|
22
20
|
lpToken: ConvexLPToken;
|
|
23
21
|
} & BaseConvexToken;
|
|
22
|
+
export declare const convexLpTokens: Record<ConvexLPToken, ConvexLPTokenData>;
|
|
23
|
+
export declare const convexStakedPhantomTokens: Record<ConvexStakedPhantomToken, ConvexPhantomTokenData>;
|
|
24
24
|
export declare const convexTokens: Record<ConvexLPToken | ConvexStakedPhantomToken, ConvexLPTokenData | ConvexPhantomTokenData>;
|
|
25
25
|
export declare const isConvexToken: (t: unknown) => t is ConvexLPToken | ConvexStakedPhantomToken;
|
|
26
26
|
export declare const isConvexLPToken: (t: unknown) => t is ConvexLPToken;
|
package/lib/tokens/convex.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convexLpTokenByPid = exports.convexPoolByPid = exports.isConvexStakedPhantomToken = exports.isConvexLPToken = exports.isConvexToken = exports.convexTokens = void 0;
|
|
4
|
-
const tradeTypes_1 = require("../pathfinder/tradeTypes");
|
|
3
|
+
exports.convexLpTokenByPid = exports.convexPoolByPid = exports.isConvexStakedPhantomToken = exports.isConvexLPToken = exports.isConvexToken = exports.convexTokens = exports.convexStakedPhantomTokens = exports.convexLpTokens = void 0;
|
|
5
4
|
const tokenType_1 = require("./tokenType");
|
|
6
|
-
|
|
5
|
+
exports.convexLpTokens = {
|
|
7
6
|
cvx3Crv: {
|
|
8
7
|
name: "Convex cvx3Crv",
|
|
9
8
|
symbol: "cvx3Crv",
|
|
@@ -12,18 +11,6 @@ const convexLpTokens = {
|
|
|
12
11
|
pid: 9,
|
|
13
12
|
underlying: "3Crv",
|
|
14
13
|
stakedToken: "stkcvx3Crv",
|
|
15
|
-
lpActions: [
|
|
16
|
-
{
|
|
17
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
18
|
-
contract: "CONVEX_BOOSTER",
|
|
19
|
-
tokenOut: "3Crv",
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
23
|
-
contract: "CONVEX_3CRV_POOL",
|
|
24
|
-
tokenOut: "stkcvx3Crv",
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
14
|
},
|
|
28
15
|
cvxcrvFRAX: {
|
|
29
16
|
name: "Convex cvxcrvFRAX",
|
|
@@ -33,18 +20,6 @@ const convexLpTokens = {
|
|
|
33
20
|
pid: 100,
|
|
34
21
|
underlying: "crvFRAX",
|
|
35
22
|
stakedToken: "stkcvxcrvFRAX",
|
|
36
|
-
lpActions: [
|
|
37
|
-
{
|
|
38
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
39
|
-
contract: "CONVEX_BOOSTER",
|
|
40
|
-
tokenOut: "crvFRAX",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
44
|
-
contract: "CONVEX_3CRV_POOL",
|
|
45
|
-
tokenOut: "stkcvxcrvFRAX",
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
23
|
},
|
|
49
24
|
cvxsteCRV: {
|
|
50
25
|
name: "Convex cvxsteCRV",
|
|
@@ -54,18 +29,6 @@ const convexLpTokens = {
|
|
|
54
29
|
pid: 25,
|
|
55
30
|
underlying: "steCRV",
|
|
56
31
|
stakedToken: "stkcvxsteCRV",
|
|
57
|
-
lpActions: [
|
|
58
|
-
{
|
|
59
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
60
|
-
contract: "CONVEX_BOOSTER",
|
|
61
|
-
tokenOut: "steCRV",
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
65
|
-
contract: "CONVEX_STECRV_POOL",
|
|
66
|
-
tokenOut: "stkcvxsteCRV",
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
32
|
},
|
|
70
33
|
cvxFRAX3CRV: {
|
|
71
34
|
name: "Convex cvxFRAX3CRV-f",
|
|
@@ -75,18 +38,6 @@ const convexLpTokens = {
|
|
|
75
38
|
pid: 32,
|
|
76
39
|
underlying: "FRAX3CRV",
|
|
77
40
|
stakedToken: "stkcvxFRAX3CRV",
|
|
78
|
-
lpActions: [
|
|
79
|
-
{
|
|
80
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
81
|
-
contract: "CONVEX_BOOSTER",
|
|
82
|
-
tokenOut: "FRAX3CRV",
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
86
|
-
contract: "CONVEX_FRAX3CRV_POOL",
|
|
87
|
-
tokenOut: "stkcvxFRAX3CRV",
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
41
|
},
|
|
91
42
|
cvxLUSD3CRV: {
|
|
92
43
|
name: "Convex cvxLUSD3CRV-f",
|
|
@@ -96,18 +47,6 @@ const convexLpTokens = {
|
|
|
96
47
|
pid: 33,
|
|
97
48
|
underlying: "LUSD3CRV",
|
|
98
49
|
stakedToken: "stkcvxLUSD3CRV",
|
|
99
|
-
lpActions: [
|
|
100
|
-
{
|
|
101
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
102
|
-
contract: "CONVEX_BOOSTER",
|
|
103
|
-
tokenOut: "LUSD3CRV",
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
107
|
-
contract: "CONVEX_LUSD3CRV_POOL",
|
|
108
|
-
tokenOut: "stkcvxLUSD3CRV",
|
|
109
|
-
},
|
|
110
|
-
],
|
|
111
50
|
},
|
|
112
51
|
cvxcrvPlain3andSUSD: {
|
|
113
52
|
name: "Convex cvxcrvPlain3andSUSD",
|
|
@@ -117,18 +56,6 @@ const convexLpTokens = {
|
|
|
117
56
|
pid: 4,
|
|
118
57
|
underlying: "crvPlain3andSUSD",
|
|
119
58
|
stakedToken: "stkcvxcrvPlain3andSUSD",
|
|
120
|
-
lpActions: [
|
|
121
|
-
{
|
|
122
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
123
|
-
contract: "CONVEX_BOOSTER",
|
|
124
|
-
tokenOut: "crvPlain3andSUSD",
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
128
|
-
contract: "CONVEX_SUSD_POOL",
|
|
129
|
-
tokenOut: "stkcvxcrvPlain3andSUSD",
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
59
|
},
|
|
133
60
|
cvxgusd3CRV: {
|
|
134
61
|
name: "Convex cvxgusd3CRV",
|
|
@@ -138,18 +65,6 @@ const convexLpTokens = {
|
|
|
138
65
|
pid: 10,
|
|
139
66
|
underlying: "gusd3CRV",
|
|
140
67
|
stakedToken: "stkcvxgusd3CRV",
|
|
141
|
-
lpActions: [
|
|
142
|
-
{
|
|
143
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
144
|
-
contract: "CONVEX_BOOSTER",
|
|
145
|
-
tokenOut: "gusd3CRV",
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
149
|
-
contract: "CONVEX_GUSD_POOL",
|
|
150
|
-
tokenOut: "stkcvxgusd3CRV",
|
|
151
|
-
},
|
|
152
|
-
],
|
|
153
68
|
},
|
|
154
69
|
cvxOHMFRAXBP: {
|
|
155
70
|
name: "Convex cvxOHMFRAXBP",
|
|
@@ -159,18 +74,6 @@ const convexLpTokens = {
|
|
|
159
74
|
pid: 138,
|
|
160
75
|
underlying: "OHMFRAXBP",
|
|
161
76
|
stakedToken: "stkcvxOHMFRAXBP",
|
|
162
|
-
lpActions: [
|
|
163
|
-
{
|
|
164
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
165
|
-
contract: "CONVEX_BOOSTER",
|
|
166
|
-
tokenOut: "OHMFRAXBP",
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
170
|
-
contract: "CONVEX_OHMFRAXBP_POOL",
|
|
171
|
-
tokenOut: "stkcvxOHMFRAXBP",
|
|
172
|
-
},
|
|
173
|
-
],
|
|
174
77
|
},
|
|
175
78
|
cvxMIM_3LP3CRV: {
|
|
176
79
|
name: "Convex cvxMIM-3LP3CRV-f",
|
|
@@ -180,18 +83,6 @@ const convexLpTokens = {
|
|
|
180
83
|
pid: 40,
|
|
181
84
|
underlying: "MIM_3LP3CRV",
|
|
182
85
|
stakedToken: "stkcvxMIM_3LP3CRV",
|
|
183
|
-
lpActions: [
|
|
184
|
-
{
|
|
185
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
186
|
-
contract: "CONVEX_BOOSTER",
|
|
187
|
-
tokenOut: "MIM_3LP3CRV",
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
191
|
-
contract: "CONVEX_MIM3CRV_POOL",
|
|
192
|
-
tokenOut: "stkcvxMIM_3LP3CRV",
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
86
|
},
|
|
196
87
|
cvxcrvCRVETH: {
|
|
197
88
|
name: "Convex cvxcrvCRVETH",
|
|
@@ -201,18 +92,6 @@ const convexLpTokens = {
|
|
|
201
92
|
pid: 61,
|
|
202
93
|
underlying: "crvCRVETH",
|
|
203
94
|
stakedToken: "stkcvxcrvCRVETH",
|
|
204
|
-
lpActions: [
|
|
205
|
-
{
|
|
206
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
207
|
-
contract: "CONVEX_BOOSTER",
|
|
208
|
-
tokenOut: "crvCRVETH",
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
212
|
-
contract: "CONVEX_OHMFRAXBP_POOL",
|
|
213
|
-
tokenOut: "stkcvxcrvCRVETH",
|
|
214
|
-
},
|
|
215
|
-
],
|
|
216
95
|
},
|
|
217
96
|
cvxcrvCVXETH: {
|
|
218
97
|
name: "Convex cvxcrvCVXETH",
|
|
@@ -222,18 +101,6 @@ const convexLpTokens = {
|
|
|
222
101
|
pid: 64,
|
|
223
102
|
underlying: "crvCVXETH",
|
|
224
103
|
stakedToken: "stkcvxcrvCVXETH",
|
|
225
|
-
lpActions: [
|
|
226
|
-
{
|
|
227
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
228
|
-
contract: "CONVEX_BOOSTER",
|
|
229
|
-
tokenOut: "crvCVXETH",
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
233
|
-
contract: "CONVEX_CVXETH_POOL",
|
|
234
|
-
tokenOut: "stkcvxcrvCVXETH",
|
|
235
|
-
},
|
|
236
|
-
],
|
|
237
104
|
},
|
|
238
105
|
cvxcrvUSDTWBTCWETH: {
|
|
239
106
|
name: "Convex cvxcrvUSDTWBTCWETH",
|
|
@@ -243,18 +110,6 @@ const convexLpTokens = {
|
|
|
243
110
|
pid: 188,
|
|
244
111
|
underlying: "crvUSDTWBTCWETH",
|
|
245
112
|
stakedToken: "stkcvxcrvUSDTWBTCWETH",
|
|
246
|
-
lpActions: [
|
|
247
|
-
{
|
|
248
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
249
|
-
contract: "CONVEX_BOOSTER",
|
|
250
|
-
tokenOut: "crvUSDTWBTCWETH",
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
254
|
-
contract: "CONVEX_3CRYPTO_POOL",
|
|
255
|
-
tokenOut: "stkcvxcrvUSDTWBTCWETH",
|
|
256
|
-
},
|
|
257
|
-
],
|
|
258
113
|
},
|
|
259
114
|
cvxLDOETH: {
|
|
260
115
|
name: "Convex cvxLDOETH",
|
|
@@ -264,21 +119,9 @@ const convexLpTokens = {
|
|
|
264
119
|
pid: 149,
|
|
265
120
|
underlying: "LDOETH",
|
|
266
121
|
stakedToken: "stkcvxLDOETH",
|
|
267
|
-
lpActions: [
|
|
268
|
-
{
|
|
269
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawLP,
|
|
270
|
-
contract: "CONVEX_BOOSTER",
|
|
271
|
-
tokenOut: "LDOETH",
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
type: tradeTypes_1.TradeType.ConvexStake,
|
|
275
|
-
contract: "CONVEX_3CRYPTO_POOL",
|
|
276
|
-
tokenOut: "stkcvxLDOETH",
|
|
277
|
-
},
|
|
278
|
-
],
|
|
279
122
|
},
|
|
280
123
|
};
|
|
281
|
-
|
|
124
|
+
exports.convexStakedPhantomTokens = {
|
|
282
125
|
stkcvx3Crv: {
|
|
283
126
|
name: "Convex stkcvx3Crv",
|
|
284
127
|
symbol: "stkcvx3Crv",
|
|
@@ -287,18 +130,6 @@ const convexStakedPhantomTokens = {
|
|
|
287
130
|
pid: 9,
|
|
288
131
|
underlying: "3Crv",
|
|
289
132
|
lpToken: "cvx3Crv",
|
|
290
|
-
lpActions: [
|
|
291
|
-
{
|
|
292
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
293
|
-
contract: "CONVEX_3CRV_POOL",
|
|
294
|
-
tokenOut: "cvx3Crv",
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
298
|
-
contract: "CONVEX_3CRV_POOL",
|
|
299
|
-
tokenOut: "3Crv",
|
|
300
|
-
},
|
|
301
|
-
],
|
|
302
133
|
},
|
|
303
134
|
stkcvxcrvFRAX: {
|
|
304
135
|
name: "Convex stkcvxcrvFRAX",
|
|
@@ -308,18 +139,6 @@ const convexStakedPhantomTokens = {
|
|
|
308
139
|
pid: 100,
|
|
309
140
|
underlying: "crvFRAX",
|
|
310
141
|
lpToken: "cvxcrvFRAX",
|
|
311
|
-
lpActions: [
|
|
312
|
-
{
|
|
313
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
314
|
-
contract: "CONVEX_FRAX_USDC_POOL",
|
|
315
|
-
tokenOut: "cvxcrvFRAX",
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
319
|
-
contract: "CONVEX_FRAX_USDC_POOL",
|
|
320
|
-
tokenOut: "crvFRAX",
|
|
321
|
-
},
|
|
322
|
-
],
|
|
323
142
|
},
|
|
324
143
|
stkcvxsteCRV: {
|
|
325
144
|
name: "Convex stkcvxsteCRV",
|
|
@@ -329,18 +148,6 @@ const convexStakedPhantomTokens = {
|
|
|
329
148
|
pid: 25,
|
|
330
149
|
underlying: "steCRV",
|
|
331
150
|
lpToken: "cvxsteCRV",
|
|
332
|
-
lpActions: [
|
|
333
|
-
{
|
|
334
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
335
|
-
contract: "CONVEX_STECRV_POOL",
|
|
336
|
-
tokenOut: "cvxsteCRV",
|
|
337
|
-
},
|
|
338
|
-
{
|
|
339
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
340
|
-
contract: "CONVEX_STECRV_POOL",
|
|
341
|
-
tokenOut: "steCRV",
|
|
342
|
-
},
|
|
343
|
-
],
|
|
344
151
|
},
|
|
345
152
|
stkcvxFRAX3CRV: {
|
|
346
153
|
name: "Convex stkcvxFRAX3CRV-f",
|
|
@@ -350,18 +157,6 @@ const convexStakedPhantomTokens = {
|
|
|
350
157
|
pid: 32,
|
|
351
158
|
underlying: "FRAX3CRV",
|
|
352
159
|
lpToken: "cvxFRAX3CRV",
|
|
353
|
-
lpActions: [
|
|
354
|
-
{
|
|
355
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
356
|
-
contract: "CONVEX_FRAX3CRV_POOL",
|
|
357
|
-
tokenOut: "cvxFRAX3CRV",
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
361
|
-
contract: "CONVEX_FRAX3CRV_POOL",
|
|
362
|
-
tokenOut: "FRAX3CRV",
|
|
363
|
-
},
|
|
364
|
-
],
|
|
365
160
|
},
|
|
366
161
|
stkcvxLUSD3CRV: {
|
|
367
162
|
name: "Convex stkcvxLUSD3CRV-f",
|
|
@@ -371,18 +166,6 @@ const convexStakedPhantomTokens = {
|
|
|
371
166
|
pid: 33,
|
|
372
167
|
underlying: "LUSD3CRV",
|
|
373
168
|
lpToken: "cvxLUSD3CRV",
|
|
374
|
-
lpActions: [
|
|
375
|
-
{
|
|
376
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
377
|
-
contract: "CONVEX_LUSD3CRV_POOL",
|
|
378
|
-
tokenOut: "cvxLUSD3CRV",
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
382
|
-
contract: "CONVEX_LUSD3CRV_POOL",
|
|
383
|
-
tokenOut: "LUSD3CRV",
|
|
384
|
-
},
|
|
385
|
-
],
|
|
386
169
|
},
|
|
387
170
|
stkcvxcrvPlain3andSUSD: {
|
|
388
171
|
name: "Convex stkcvxcrvPlain3andSUSD",
|
|
@@ -392,18 +175,6 @@ const convexStakedPhantomTokens = {
|
|
|
392
175
|
pid: 4,
|
|
393
176
|
underlying: "crvPlain3andSUSD",
|
|
394
177
|
lpToken: "cvxcrvPlain3andSUSD",
|
|
395
|
-
lpActions: [
|
|
396
|
-
{
|
|
397
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
398
|
-
contract: "CONVEX_SUSD_POOL",
|
|
399
|
-
tokenOut: "cvxcrvPlain3andSUSD",
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
403
|
-
contract: "CONVEX_SUSD_POOL",
|
|
404
|
-
tokenOut: "crvPlain3andSUSD",
|
|
405
|
-
},
|
|
406
|
-
],
|
|
407
178
|
},
|
|
408
179
|
stkcvxgusd3CRV: {
|
|
409
180
|
name: "Convex stkcvxgusd3CRV",
|
|
@@ -413,18 +184,6 @@ const convexStakedPhantomTokens = {
|
|
|
413
184
|
pid: 10,
|
|
414
185
|
underlying: "gusd3CRV",
|
|
415
186
|
lpToken: "cvxgusd3CRV",
|
|
416
|
-
lpActions: [
|
|
417
|
-
{
|
|
418
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
419
|
-
contract: "CONVEX_GUSD_POOL",
|
|
420
|
-
tokenOut: "cvxgusd3CRV",
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
424
|
-
contract: "CONVEX_GUSD_POOL",
|
|
425
|
-
tokenOut: "gusd3CRV",
|
|
426
|
-
},
|
|
427
|
-
],
|
|
428
187
|
},
|
|
429
188
|
stkcvxOHMFRAXBP: {
|
|
430
189
|
name: "Convex stkcvxOHMFRAXBP",
|
|
@@ -434,18 +193,6 @@ const convexStakedPhantomTokens = {
|
|
|
434
193
|
pid: 138,
|
|
435
194
|
underlying: "OHMFRAXBP",
|
|
436
195
|
lpToken: "cvxOHMFRAXBP",
|
|
437
|
-
lpActions: [
|
|
438
|
-
{
|
|
439
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
440
|
-
contract: "CONVEX_OHMFRAXBP_POOL",
|
|
441
|
-
tokenOut: "cvxOHMFRAXBP",
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
445
|
-
contract: "CONVEX_OHMFRAXBP_POOL",
|
|
446
|
-
tokenOut: "OHMFRAXBP",
|
|
447
|
-
},
|
|
448
|
-
],
|
|
449
196
|
},
|
|
450
197
|
stkcvxMIM_3LP3CRV: {
|
|
451
198
|
name: "Convex stkcvxMIM_3LP3CRV-f",
|
|
@@ -455,18 +202,6 @@ const convexStakedPhantomTokens = {
|
|
|
455
202
|
pid: 40,
|
|
456
203
|
underlying: "MIM_3LP3CRV",
|
|
457
204
|
lpToken: "cvxMIM_3LP3CRV",
|
|
458
|
-
lpActions: [
|
|
459
|
-
{
|
|
460
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
461
|
-
contract: "CONVEX_MIM3CRV_POOL",
|
|
462
|
-
tokenOut: "cvxMIM_3LP3CRV",
|
|
463
|
-
},
|
|
464
|
-
{
|
|
465
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
466
|
-
contract: "CONVEX_MIM3CRV_POOL",
|
|
467
|
-
tokenOut: "MIM_3LP3CRV",
|
|
468
|
-
},
|
|
469
|
-
],
|
|
470
205
|
},
|
|
471
206
|
stkcvxcrvCRVETH: {
|
|
472
207
|
name: "Convex stkcvxcrvCRVETH",
|
|
@@ -476,18 +211,6 @@ const convexStakedPhantomTokens = {
|
|
|
476
211
|
pid: 61,
|
|
477
212
|
underlying: "crvCRVETH",
|
|
478
213
|
lpToken: "cvxcrvCRVETH",
|
|
479
|
-
lpActions: [
|
|
480
|
-
{
|
|
481
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
482
|
-
contract: "CONVEX_CRVETH_POOL",
|
|
483
|
-
tokenOut: "cvxcrvCRVETH",
|
|
484
|
-
},
|
|
485
|
-
{
|
|
486
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
487
|
-
contract: "CONVEX_CRVETH_POOL",
|
|
488
|
-
tokenOut: "crvCRVETH",
|
|
489
|
-
},
|
|
490
|
-
],
|
|
491
214
|
},
|
|
492
215
|
stkcvxcrvCVXETH: {
|
|
493
216
|
name: "Convex stkcvxcrvCVXETH",
|
|
@@ -497,18 +220,6 @@ const convexStakedPhantomTokens = {
|
|
|
497
220
|
pid: 64,
|
|
498
221
|
underlying: "crvCVXETH",
|
|
499
222
|
lpToken: "cvxcrvCVXETH",
|
|
500
|
-
lpActions: [
|
|
501
|
-
{
|
|
502
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
503
|
-
contract: "CONVEX_CVXETH_POOL",
|
|
504
|
-
tokenOut: "cvxcrvCVXETH",
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
508
|
-
contract: "CONVEX_CVXETH_POOL",
|
|
509
|
-
tokenOut: "crvCVXETH",
|
|
510
|
-
},
|
|
511
|
-
],
|
|
512
223
|
},
|
|
513
224
|
stkcvxcrvUSDTWBTCWETH: {
|
|
514
225
|
name: "Convex stkcvxcrv3crypto",
|
|
@@ -518,18 +229,6 @@ const convexStakedPhantomTokens = {
|
|
|
518
229
|
pid: 188,
|
|
519
230
|
underlying: "crvUSDTWBTCWETH",
|
|
520
231
|
lpToken: "cvxcrvUSDTWBTCWETH",
|
|
521
|
-
lpActions: [
|
|
522
|
-
{
|
|
523
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
524
|
-
contract: "CONVEX_3CRYPTO_POOL",
|
|
525
|
-
tokenOut: "cvxcrvUSDTWBTCWETH",
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
529
|
-
contract: "CONVEX_3CRYPTO_POOL",
|
|
530
|
-
tokenOut: "crvUSDTWBTCWETH",
|
|
531
|
-
},
|
|
532
|
-
],
|
|
533
232
|
},
|
|
534
233
|
stkcvxLDOETH: {
|
|
535
234
|
name: "Convex stkcvxLDOETH",
|
|
@@ -539,37 +238,25 @@ const convexStakedPhantomTokens = {
|
|
|
539
238
|
pid: 149,
|
|
540
239
|
underlying: "LDOETH",
|
|
541
240
|
lpToken: "cvxLDOETH",
|
|
542
|
-
lpActions: [
|
|
543
|
-
{
|
|
544
|
-
type: tradeTypes_1.TradeType.ConvexWithdraw,
|
|
545
|
-
contract: "CONVEX_3CRYPTO_POOL",
|
|
546
|
-
tokenOut: "cvxLDOETH",
|
|
547
|
-
},
|
|
548
|
-
{
|
|
549
|
-
type: tradeTypes_1.TradeType.ConvexWithdrawAndUnwrap,
|
|
550
|
-
contract: "CONVEX_3CRYPTO_POOL",
|
|
551
|
-
tokenOut: "LDOETH",
|
|
552
|
-
},
|
|
553
|
-
],
|
|
554
241
|
},
|
|
555
242
|
};
|
|
556
243
|
exports.convexTokens = {
|
|
557
|
-
...convexLpTokens,
|
|
558
|
-
...convexStakedPhantomTokens,
|
|
244
|
+
...exports.convexLpTokens,
|
|
245
|
+
...exports.convexStakedPhantomTokens,
|
|
559
246
|
};
|
|
560
247
|
const isConvexToken = (t) => typeof t === "string" &&
|
|
561
248
|
!!exports.convexTokens[t];
|
|
562
249
|
exports.isConvexToken = isConvexToken;
|
|
563
|
-
const isConvexLPToken = (t) => typeof t === "string" && !!convexLpTokens[t];
|
|
250
|
+
const isConvexLPToken = (t) => typeof t === "string" && !!exports.convexLpTokens[t];
|
|
564
251
|
exports.isConvexLPToken = isConvexLPToken;
|
|
565
252
|
const isConvexStakedPhantomToken = (t) => typeof t === "string" &&
|
|
566
|
-
!!convexStakedPhantomTokens[t];
|
|
253
|
+
!!exports.convexStakedPhantomTokens[t];
|
|
567
254
|
exports.isConvexStakedPhantomToken = isConvexStakedPhantomToken;
|
|
568
|
-
exports.convexPoolByPid = Object.values(convexLpTokens).reduce((acc, value) => {
|
|
255
|
+
exports.convexPoolByPid = Object.values(exports.convexLpTokens).reduce((acc, value) => {
|
|
569
256
|
acc[value.pid] = value.pool;
|
|
570
257
|
return acc;
|
|
571
258
|
}, {});
|
|
572
|
-
exports.convexLpTokenByPid = Object.entries(convexLpTokens).reduce((acc, [token, data]) => {
|
|
259
|
+
exports.convexLpTokenByPid = Object.entries(exports.convexLpTokens).reduce((acc, [token, data]) => {
|
|
573
260
|
acc[data.pid] = token;
|
|
574
261
|
return acc;
|
|
575
262
|
}, {});
|
package/lib/tokens/curveLP.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BigNumber } from "ethers";
|
|
2
2
|
import type { CurvePoolContract } from "../contracts/contracts";
|
|
3
|
-
import { TradeAction } from "../pathfinder/tradeTypes";
|
|
4
3
|
import { PartialRecord } from "../utils/types";
|
|
4
|
+
import { NormalToken } from "./normal";
|
|
5
5
|
import type { SupportedToken, TokenBase } from "./token";
|
|
6
6
|
import { TokenType } from "./tokenType";
|
|
7
7
|
export type CurveMetaTokens = "FRAX3CRV" | "LUSD3CRV" | "gusd3CRV" | "MIM_3LP3CRV" | "OHMFRAXBP";
|
|
@@ -9,15 +9,14 @@ export type CurveLPToken = "3Crv" | "steCRV" | "crvPlain3andSUSD" | "crvFRAX" |
|
|
|
9
9
|
export type CurveLPTokenData = {
|
|
10
10
|
symbol: CurveLPToken;
|
|
11
11
|
type: TokenType.CURVE_LP_TOKEN;
|
|
12
|
-
|
|
13
|
-
lpActions: Array<TradeAction>;
|
|
12
|
+
tokenOut: Array<CurveLPToken | NormalToken>;
|
|
14
13
|
pool: CurvePoolContract;
|
|
15
14
|
wrapper?: CurvePoolContract;
|
|
16
15
|
} & TokenBase;
|
|
17
16
|
export type MetaCurveLPTokenData = {
|
|
18
17
|
symbol: CurveLPToken;
|
|
19
18
|
type: TokenType.CURVE_LP_TOKEN;
|
|
20
|
-
|
|
19
|
+
tokenOut: Array<CurveLPToken | NormalToken>;
|
|
21
20
|
pool: CurvePoolContract;
|
|
22
21
|
wrapper?: CurvePoolContract;
|
|
23
22
|
} & TokenBase;
|