@enzymefinance/testutils 4.0.0-next.7 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +1553 -0
- package/dist/index.js +3352 -0
- package/dist/index.mjs +3352 -0
- package/package.json +74 -11
- package/CHANGELOG.md +0 -60
- package/dist/declarations/src/assertions.d.ts +0 -4
- package/dist/declarations/src/deployment.d.ts +0 -195
- package/dist/declarations/src/gasRelayer.d.ts +0 -56
- package/dist/declarations/src/helpers.d.ts +0 -16
- package/dist/declarations/src/index.d.ts +0 -6
- package/dist/declarations/src/scaffolding/assets.d.ts +0 -10
- package/dist/declarations/src/scaffolding/chainlink.d.ts +0 -3
- package/dist/declarations/src/scaffolding/common.d.ts +0 -7
- package/dist/declarations/src/scaffolding/core.d.ts +0 -16
- package/dist/declarations/src/scaffolding/extensions/common.d.ts +0 -11
- package/dist/declarations/src/scaffolding/extensions/external-positions/actions.d.ts +0 -36
- package/dist/declarations/src/scaffolding/extensions/external-positions/compound.d.ts +0 -56
- package/dist/declarations/src/scaffolding/extensions/external-positions/index.d.ts +0 -4
- package/dist/declarations/src/scaffolding/extensions/external-positions/mocks.d.ts +0 -56
- package/dist/declarations/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.d.ts +0 -100
- package/dist/declarations/src/scaffolding/extensions/fees.d.ts +0 -12
- package/dist/declarations/src/scaffolding/extensions/index.d.ts +0 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/aave.d.ts +0 -20
- package/dist/declarations/src/scaffolding/extensions/integrations/compound.d.ts +0 -56
- package/dist/declarations/src/scaffolding/extensions/integrations/curve.d.ts +0 -288
- package/dist/declarations/src/scaffolding/extensions/integrations/idle.d.ts +0 -28
- package/dist/declarations/src/scaffolding/extensions/integrations/index.d.ts +0 -15
- package/dist/declarations/src/scaffolding/extensions/integrations/mock.d.ts +0 -32
- package/dist/declarations/src/scaffolding/extensions/integrations/olympusV2.d.ts +0 -17
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV4.d.ts +0 -23
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV5.d.ts +0 -23
- package/dist/declarations/src/scaffolding/extensions/integrations/poolTogetherV4.d.ts +0 -29
- package/dist/declarations/src/scaffolding/extensions/integrations/synthetix.d.ts +0 -28
- package/dist/declarations/src/scaffolding/extensions/integrations/trackedAssets.d.ts +0 -15
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV2.d.ts +0 -46
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV3.d.ts +0 -15
- package/dist/declarations/src/scaffolding/extensions/integrations/yearn.d.ts +0 -22
- package/dist/declarations/src/scaffolding/extensions/integrations/zeroExV2.d.ts +0 -12
- package/dist/declarations/src/scaffolding/extensions/policies.d.ts +0 -17
- package/dist/declarations/src/scaffolding/index.d.ts +0 -8
- package/dist/declarations/src/scaffolding/setup.d.ts +0 -77
- package/dist/declarations/src/scaffolding/shares.d.ts +0 -35
- package/dist/declarations/src/scaffolding/vaultCalls.d.ts +0 -32
- package/dist/declarations/src/whales.d.ts +0 -49
- package/dist/enzymefinance-testutils.browser.cjs.js +0 -4428
- package/dist/enzymefinance-testutils.browser.esm.js +0 -4281
- package/dist/enzymefinance-testutils.cjs.d.ts +0 -1
- package/dist/enzymefinance-testutils.cjs.dev.js +0 -4428
- package/dist/enzymefinance-testutils.cjs.js +0 -7
- package/dist/enzymefinance-testutils.cjs.prod.js +0 -4428
- package/dist/enzymefinance-testutils.esm.js +0 -4281
- package/src/assertions.ts +0 -23
- package/src/deployment.ts +0 -289
- package/src/gasRelayer.ts +0 -95
- package/src/helpers.ts +0 -39
- package/src/index.ts +0 -6
- package/src/scaffolding/assets.ts +0 -37
- package/src/scaffolding/chainlink.ts +0 -8
- package/src/scaffolding/common.ts +0 -11
- package/src/scaffolding/core.ts +0 -103
- package/src/scaffolding/extensions/common.ts +0 -30
- package/src/scaffolding/extensions/external-positions/actions.ts +0 -108
- package/src/scaffolding/extensions/external-positions/compound.ts +0 -190
- package/src/scaffolding/extensions/external-positions/index.ts +0 -4
- package/src/scaffolding/extensions/external-positions/mocks.ts +0 -191
- package/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.ts +0 -284
- package/src/scaffolding/extensions/fees.ts +0 -70
- package/src/scaffolding/extensions/index.ts +0 -5
- package/src/scaffolding/extensions/integrations/aave.ts +0 -78
- package/src/scaffolding/extensions/integrations/compound.ts +0 -255
- package/src/scaffolding/extensions/integrations/curve.ts +0 -1029
- package/src/scaffolding/extensions/integrations/idle.ts +0 -104
- package/src/scaffolding/extensions/integrations/index.ts +0 -15
- package/src/scaffolding/extensions/integrations/mock.ts +0 -116
- package/src/scaffolding/extensions/integrations/olympusV2.ts +0 -71
- package/src/scaffolding/extensions/integrations/paraSwapV4.ts +0 -70
- package/src/scaffolding/extensions/integrations/paraSwapV5.ts +0 -73
- package/src/scaffolding/extensions/integrations/poolTogetherV4.ts +0 -117
- package/src/scaffolding/extensions/integrations/synthetix.ts +0 -111
- package/src/scaffolding/extensions/integrations/trackedAssets.ts +0 -48
- package/src/scaffolding/extensions/integrations/uniswapV2.ts +0 -175
- package/src/scaffolding/extensions/integrations/uniswapV3.ts +0 -55
- package/src/scaffolding/extensions/integrations/yearn.ts +0 -79
- package/src/scaffolding/extensions/integrations/zeroExV2.ts +0 -47
- package/src/scaffolding/extensions/policies.ts +0 -112
- package/src/scaffolding/index.ts +0 -8
- package/src/scaffolding/setup.ts +0 -243
- package/src/scaffolding/shares.ts +0 -80
- package/src/scaffolding/vaultCalls.ts +0 -105
- package/src/types.d.ts +0 -2
- package/src/whales.ts +0 -82
- package/tsconfig.json +0 -5
@@ -1,1029 +0,0 @@
|
|
1
|
-
import type { AddressLike, Call, Contract, Send } from '@enzymefinance/ethers';
|
2
|
-
import { contract } from '@enzymefinance/ethers';
|
3
|
-
import type { SignerWithAddress } from '@enzymefinance/hardhat';
|
4
|
-
import type {
|
5
|
-
ComptrollerLib,
|
6
|
-
CurveExchangeAdapter,
|
7
|
-
CurveLiquidityAaveAdapter,
|
8
|
-
CurveLiquidityAdapter,
|
9
|
-
CurveLiquiditySethAdapter,
|
10
|
-
CurveLiquidityStethAdapter,
|
11
|
-
CurveRedeemType,
|
12
|
-
IntegrationManager,
|
13
|
-
StandardToken,
|
14
|
-
} from '@enzymefinance/protocol';
|
15
|
-
import {
|
16
|
-
callOnIntegrationArgs,
|
17
|
-
claimRewardsSelector,
|
18
|
-
curveAaveLendAndStakeArgs,
|
19
|
-
curveAaveLendArgs,
|
20
|
-
curveAaveRedeemArgs,
|
21
|
-
curveAaveStakeArgs,
|
22
|
-
curveAaveUnstakeAndRedeemArgs,
|
23
|
-
curveAaveUnstakeArgs,
|
24
|
-
curveClaimRewardsArgs,
|
25
|
-
curveLendAndStakeArgs,
|
26
|
-
curveLendArgs,
|
27
|
-
curveRedeemArgs,
|
28
|
-
curveSethLendAndStakeArgs,
|
29
|
-
curveSethLendArgs,
|
30
|
-
curveSethRedeemArgs,
|
31
|
-
curveSethStakeArgs,
|
32
|
-
curveSethUnstakeAndRedeemArgs,
|
33
|
-
curveSethUnstakeArgs,
|
34
|
-
curveStakeArgs,
|
35
|
-
curveStethLendAndStakeArgs,
|
36
|
-
curveStethLendArgs,
|
37
|
-
curveStethRedeemArgs,
|
38
|
-
curveStethStakeArgs,
|
39
|
-
curveStethUnstakeAndRedeemArgs,
|
40
|
-
curveStethUnstakeArgs,
|
41
|
-
curveTakeOrderArgs,
|
42
|
-
curveUnstakeAndRedeemArgs,
|
43
|
-
curveUnstakeArgs,
|
44
|
-
IntegrationManagerActionId,
|
45
|
-
lendAndStakeSelector,
|
46
|
-
lendSelector,
|
47
|
-
redeemSelector,
|
48
|
-
stakeSelector,
|
49
|
-
takeOrderSelector,
|
50
|
-
unstakeAndRedeemSelector,
|
51
|
-
unstakeSelector,
|
52
|
-
} from '@enzymefinance/protocol';
|
53
|
-
import type { BigNumberish, BytesLike } from 'ethers';
|
54
|
-
import { BigNumber, constants, utils } from 'ethers';
|
55
|
-
|
56
|
-
export interface CurveLiquidityGaugeV2 extends Contract<CurveLiquidityGaugeV2> {
|
57
|
-
claim_rewards: Send<(_addr: AddressLike) => void>;
|
58
|
-
integrate_fraction: Call<(_for: AddressLike) => BigNumber, Contract<any>>;
|
59
|
-
}
|
60
|
-
|
61
|
-
export const CurveLiquidityGaugeV2 = contract<CurveLiquidityGaugeV2>()`
|
62
|
-
function claim_rewards(address)
|
63
|
-
function integrate_fraction(address) view returns (uint256)
|
64
|
-
`;
|
65
|
-
|
66
|
-
export interface CurveRegistry extends Contract<CurveRegistry> {
|
67
|
-
get_coins: Call<(_pool: AddressLike) => AddressLike[], Contract<any>>;
|
68
|
-
get_lp_token: Call<(_pool: AddressLike) => AddressLike, Contract<any>>;
|
69
|
-
}
|
70
|
-
|
71
|
-
export const CurveRegistry = contract<CurveRegistry>()`
|
72
|
-
function get_coins(address) view returns (address[8])
|
73
|
-
function get_lp_token(address) view returns (address)
|
74
|
-
`;
|
75
|
-
|
76
|
-
// prettier-ignore
|
77
|
-
export interface CurveSwaps extends Contract<CurveSwaps> {
|
78
|
-
get_best_rate: Call<(_from: AddressLike, to: AddressLike, amount: BigNumberish) => { bestPool: AddressLike, amountReceived: BigNumber }, CurveSwaps>
|
79
|
-
}
|
80
|
-
|
81
|
-
export const CurveSwaps = contract<CurveSwaps>()`
|
82
|
-
function get_best_rate(address _from, address to, uint256 amount) view returns (address bestPool, uint256 amountReceived)
|
83
|
-
`;
|
84
|
-
|
85
|
-
export interface CurveMinter extends Contract<CurveMinter> {
|
86
|
-
mint_for: Send<(_gauge_address: AddressLike, _for: AddressLike) => void>;
|
87
|
-
}
|
88
|
-
|
89
|
-
export const CurveMinter = contract<CurveMinter>()`
|
90
|
-
function mint_for(address,address)
|
91
|
-
`;
|
92
|
-
|
93
|
-
// exchanges
|
94
|
-
|
95
|
-
export async function curveTakeOrder({
|
96
|
-
comptrollerProxy,
|
97
|
-
integrationManager,
|
98
|
-
fundOwner,
|
99
|
-
curveExchangeAdapter,
|
100
|
-
pool,
|
101
|
-
outgoingAsset,
|
102
|
-
outgoingAssetAmount = utils.parseEther('1'),
|
103
|
-
incomingAsset,
|
104
|
-
minIncomingAssetAmount = utils.parseEther('1'),
|
105
|
-
}: {
|
106
|
-
comptrollerProxy: ComptrollerLib;
|
107
|
-
integrationManager: IntegrationManager;
|
108
|
-
fundOwner: SignerWithAddress;
|
109
|
-
curveExchangeAdapter: CurveExchangeAdapter;
|
110
|
-
pool: AddressLike;
|
111
|
-
outgoingAsset: StandardToken;
|
112
|
-
outgoingAssetAmount?: BigNumberish;
|
113
|
-
incomingAsset: StandardToken;
|
114
|
-
minIncomingAssetAmount?: BigNumberish;
|
115
|
-
}) {
|
116
|
-
const takeOrderArgs = curveTakeOrderArgs({
|
117
|
-
incomingAsset,
|
118
|
-
minIncomingAssetAmount,
|
119
|
-
outgoingAsset,
|
120
|
-
outgoingAssetAmount,
|
121
|
-
pool,
|
122
|
-
});
|
123
|
-
|
124
|
-
const callArgs = callOnIntegrationArgs({
|
125
|
-
adapter: curveExchangeAdapter,
|
126
|
-
encodedCallArgs: takeOrderArgs,
|
127
|
-
selector: takeOrderSelector,
|
128
|
-
});
|
129
|
-
|
130
|
-
return comptrollerProxy
|
131
|
-
.connect(fundOwner)
|
132
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
133
|
-
}
|
134
|
-
|
135
|
-
// combined liquidity
|
136
|
-
|
137
|
-
export function curveClaimRewards({
|
138
|
-
comptrollerProxy,
|
139
|
-
integrationManager,
|
140
|
-
fundOwner,
|
141
|
-
curveLiquidityAdapter,
|
142
|
-
stakingToken,
|
143
|
-
}: {
|
144
|
-
comptrollerProxy: ComptrollerLib;
|
145
|
-
integrationManager: IntegrationManager;
|
146
|
-
fundOwner: SignerWithAddress;
|
147
|
-
curveLiquidityAdapter: CurveLiquidityAdapter;
|
148
|
-
stakingToken: AddressLike;
|
149
|
-
}) {
|
150
|
-
const callArgs = callOnIntegrationArgs({
|
151
|
-
adapter: curveLiquidityAdapter,
|
152
|
-
encodedCallArgs: curveClaimRewardsArgs({ stakingToken }),
|
153
|
-
selector: claimRewardsSelector,
|
154
|
-
});
|
155
|
-
|
156
|
-
return comptrollerProxy
|
157
|
-
.connect(fundOwner)
|
158
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
159
|
-
}
|
160
|
-
|
161
|
-
export async function curveLend({
|
162
|
-
comptrollerProxy,
|
163
|
-
integrationManager,
|
164
|
-
signer,
|
165
|
-
curveLiquidityAdapter,
|
166
|
-
pool,
|
167
|
-
orderedOutgoingAssetAmounts,
|
168
|
-
minIncomingLpTokenAmount = BigNumber.from(1),
|
169
|
-
useUnderlyings,
|
170
|
-
}: {
|
171
|
-
comptrollerProxy: ComptrollerLib;
|
172
|
-
integrationManager: IntegrationManager;
|
173
|
-
signer: SignerWithAddress;
|
174
|
-
curveLiquidityAdapter: CurveLiquidityAdapter;
|
175
|
-
pool: AddressLike;
|
176
|
-
orderedOutgoingAssetAmounts: BigNumberish[];
|
177
|
-
minIncomingLpTokenAmount?: BigNumberish;
|
178
|
-
useUnderlyings: boolean;
|
179
|
-
}) {
|
180
|
-
const callArgs = callOnIntegrationArgs({
|
181
|
-
adapter: curveLiquidityAdapter,
|
182
|
-
encodedCallArgs: curveLendArgs({
|
183
|
-
minIncomingLpTokenAmount,
|
184
|
-
orderedOutgoingAssetAmounts,
|
185
|
-
pool,
|
186
|
-
useUnderlyings,
|
187
|
-
}),
|
188
|
-
selector: lendSelector,
|
189
|
-
});
|
190
|
-
|
191
|
-
return comptrollerProxy
|
192
|
-
.connect(signer)
|
193
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
194
|
-
}
|
195
|
-
|
196
|
-
export async function curveLendAndStake({
|
197
|
-
comptrollerProxy,
|
198
|
-
integrationManager,
|
199
|
-
signer,
|
200
|
-
curveLiquidityAdapter,
|
201
|
-
pool,
|
202
|
-
orderedOutgoingAssetAmounts,
|
203
|
-
incomingStakingToken,
|
204
|
-
minIncomingStakingTokenAmount = BigNumber.from(1),
|
205
|
-
useUnderlyings,
|
206
|
-
}: {
|
207
|
-
comptrollerProxy: ComptrollerLib;
|
208
|
-
integrationManager: IntegrationManager;
|
209
|
-
signer: SignerWithAddress;
|
210
|
-
curveLiquidityAdapter: CurveLiquidityAdapter;
|
211
|
-
pool: AddressLike;
|
212
|
-
orderedOutgoingAssetAmounts: BigNumberish[];
|
213
|
-
incomingStakingToken: AddressLike;
|
214
|
-
minIncomingStakingTokenAmount?: BigNumberish;
|
215
|
-
useUnderlyings: boolean;
|
216
|
-
}) {
|
217
|
-
const callArgs = callOnIntegrationArgs({
|
218
|
-
adapter: curveLiquidityAdapter,
|
219
|
-
encodedCallArgs: curveLendAndStakeArgs({
|
220
|
-
incomingStakingToken,
|
221
|
-
minIncomingStakingTokenAmount,
|
222
|
-
orderedOutgoingAssetAmounts,
|
223
|
-
pool,
|
224
|
-
useUnderlyings,
|
225
|
-
}),
|
226
|
-
selector: lendAndStakeSelector,
|
227
|
-
});
|
228
|
-
|
229
|
-
return comptrollerProxy
|
230
|
-
.connect(signer)
|
231
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
232
|
-
}
|
233
|
-
|
234
|
-
export async function curveRedeem({
|
235
|
-
comptrollerProxy,
|
236
|
-
integrationManager,
|
237
|
-
signer,
|
238
|
-
curveLiquidityAdapter,
|
239
|
-
pool,
|
240
|
-
outgoingLpTokenAmount,
|
241
|
-
useUnderlyings,
|
242
|
-
redeemType,
|
243
|
-
incomingAssetData,
|
244
|
-
}: {
|
245
|
-
comptrollerProxy: ComptrollerLib;
|
246
|
-
integrationManager: IntegrationManager;
|
247
|
-
signer: SignerWithAddress;
|
248
|
-
curveLiquidityAdapter: CurveLiquidityAdapter;
|
249
|
-
pool: AddressLike;
|
250
|
-
outgoingLpTokenAmount: BigNumberish;
|
251
|
-
useUnderlyings: boolean;
|
252
|
-
redeemType: CurveRedeemType;
|
253
|
-
incomingAssetData: BytesLike;
|
254
|
-
}) {
|
255
|
-
const callArgs = callOnIntegrationArgs({
|
256
|
-
adapter: curveLiquidityAdapter,
|
257
|
-
encodedCallArgs: curveRedeemArgs({
|
258
|
-
incomingAssetData,
|
259
|
-
outgoingLpTokenAmount,
|
260
|
-
pool,
|
261
|
-
redeemType,
|
262
|
-
useUnderlyings,
|
263
|
-
}),
|
264
|
-
selector: redeemSelector,
|
265
|
-
});
|
266
|
-
|
267
|
-
return comptrollerProxy
|
268
|
-
.connect(signer)
|
269
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
270
|
-
}
|
271
|
-
|
272
|
-
export async function curveStake({
|
273
|
-
comptrollerProxy,
|
274
|
-
integrationManager,
|
275
|
-
signer,
|
276
|
-
curveLiquidityAdapter,
|
277
|
-
pool,
|
278
|
-
incomingStakingToken,
|
279
|
-
amount,
|
280
|
-
}: {
|
281
|
-
comptrollerProxy: ComptrollerLib;
|
282
|
-
integrationManager: IntegrationManager;
|
283
|
-
signer: SignerWithAddress;
|
284
|
-
curveLiquidityAdapter: CurveLiquidityAdapter;
|
285
|
-
pool: AddressLike;
|
286
|
-
incomingStakingToken: AddressLike;
|
287
|
-
amount: BigNumberish;
|
288
|
-
}) {
|
289
|
-
const callArgs = callOnIntegrationArgs({
|
290
|
-
adapter: curveLiquidityAdapter,
|
291
|
-
encodedCallArgs: curveStakeArgs({
|
292
|
-
amount,
|
293
|
-
incomingStakingToken,
|
294
|
-
pool,
|
295
|
-
}),
|
296
|
-
selector: stakeSelector,
|
297
|
-
});
|
298
|
-
|
299
|
-
return comptrollerProxy
|
300
|
-
.connect(signer)
|
301
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
302
|
-
}
|
303
|
-
|
304
|
-
export async function curveUnstake({
|
305
|
-
comptrollerProxy,
|
306
|
-
integrationManager,
|
307
|
-
signer,
|
308
|
-
curveLiquidityAdapter,
|
309
|
-
pool,
|
310
|
-
outgoingStakingToken,
|
311
|
-
amount,
|
312
|
-
}: {
|
313
|
-
comptrollerProxy: ComptrollerLib;
|
314
|
-
integrationManager: IntegrationManager;
|
315
|
-
signer: SignerWithAddress;
|
316
|
-
curveLiquidityAdapter: CurveLiquidityAdapter;
|
317
|
-
pool: AddressLike;
|
318
|
-
outgoingStakingToken: AddressLike;
|
319
|
-
amount: BigNumberish;
|
320
|
-
}) {
|
321
|
-
const callArgs = callOnIntegrationArgs({
|
322
|
-
adapter: curveLiquidityAdapter,
|
323
|
-
encodedCallArgs: curveUnstakeArgs({
|
324
|
-
amount,
|
325
|
-
outgoingStakingToken,
|
326
|
-
pool,
|
327
|
-
}),
|
328
|
-
selector: unstakeSelector,
|
329
|
-
});
|
330
|
-
|
331
|
-
return comptrollerProxy
|
332
|
-
.connect(signer)
|
333
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
334
|
-
}
|
335
|
-
|
336
|
-
export async function curveUnstakeAndRedeem({
|
337
|
-
comptrollerProxy,
|
338
|
-
integrationManager,
|
339
|
-
signer,
|
340
|
-
curveLiquidityAdapter,
|
341
|
-
pool,
|
342
|
-
outgoingStakingToken,
|
343
|
-
outgoingStakingTokenAmount,
|
344
|
-
useUnderlyings,
|
345
|
-
redeemType,
|
346
|
-
incomingAssetData,
|
347
|
-
}: {
|
348
|
-
comptrollerProxy: ComptrollerLib;
|
349
|
-
integrationManager: IntegrationManager;
|
350
|
-
signer: SignerWithAddress;
|
351
|
-
curveLiquidityAdapter: CurveLiquidityAdapter;
|
352
|
-
pool: AddressLike;
|
353
|
-
outgoingStakingToken: StandardToken;
|
354
|
-
outgoingStakingTokenAmount: BigNumberish;
|
355
|
-
useUnderlyings: boolean;
|
356
|
-
redeemType: CurveRedeemType;
|
357
|
-
incomingAssetData: BytesLike;
|
358
|
-
}) {
|
359
|
-
const callArgs = callOnIntegrationArgs({
|
360
|
-
adapter: curveLiquidityAdapter,
|
361
|
-
encodedCallArgs: curveUnstakeAndRedeemArgs({
|
362
|
-
incomingAssetData,
|
363
|
-
outgoingStakingToken,
|
364
|
-
outgoingStakingTokenAmount,
|
365
|
-
pool,
|
366
|
-
redeemType,
|
367
|
-
useUnderlyings,
|
368
|
-
}),
|
369
|
-
selector: unstakeAndRedeemSelector,
|
370
|
-
});
|
371
|
-
|
372
|
-
return comptrollerProxy
|
373
|
-
.connect(signer)
|
374
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
375
|
-
}
|
376
|
-
|
377
|
-
// aave pool
|
378
|
-
|
379
|
-
export function curveAaveClaimRewards({
|
380
|
-
comptrollerProxy,
|
381
|
-
integrationManager,
|
382
|
-
fundOwner,
|
383
|
-
curveLiquidityAaveAdapter,
|
384
|
-
}: {
|
385
|
-
comptrollerProxy: ComptrollerLib;
|
386
|
-
integrationManager: IntegrationManager;
|
387
|
-
fundOwner: SignerWithAddress;
|
388
|
-
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
389
|
-
}) {
|
390
|
-
const callArgs = callOnIntegrationArgs({
|
391
|
-
adapter: curveLiquidityAaveAdapter,
|
392
|
-
encodedCallArgs: constants.HashZero,
|
393
|
-
selector: claimRewardsSelector,
|
394
|
-
});
|
395
|
-
|
396
|
-
return comptrollerProxy
|
397
|
-
.connect(fundOwner)
|
398
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
399
|
-
}
|
400
|
-
|
401
|
-
export function curveAaveLend({
|
402
|
-
comptrollerProxy,
|
403
|
-
integrationManager,
|
404
|
-
fundOwner,
|
405
|
-
curveLiquidityAaveAdapter,
|
406
|
-
outgoingAaveDaiAmount = BigNumber.from(0),
|
407
|
-
outgoingAaveUsdcAmount = BigNumber.from(0),
|
408
|
-
outgoingAaveUsdtAmount = BigNumber.from(0),
|
409
|
-
minIncomingLPTokenAmount = BigNumber.from(1),
|
410
|
-
useUnderlyings = false,
|
411
|
-
}: {
|
412
|
-
comptrollerProxy: ComptrollerLib;
|
413
|
-
integrationManager: IntegrationManager;
|
414
|
-
fundOwner: SignerWithAddress;
|
415
|
-
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
416
|
-
outgoingAaveDaiAmount?: BigNumberish;
|
417
|
-
outgoingAaveUsdcAmount?: BigNumberish;
|
418
|
-
outgoingAaveUsdtAmount?: BigNumberish;
|
419
|
-
minIncomingLPTokenAmount?: BigNumberish;
|
420
|
-
useUnderlyings?: boolean;
|
421
|
-
}) {
|
422
|
-
const callArgs = callOnIntegrationArgs({
|
423
|
-
adapter: curveLiquidityAaveAdapter,
|
424
|
-
encodedCallArgs: curveAaveLendArgs({
|
425
|
-
minIncomingLPTokenAmount,
|
426
|
-
outgoingAaveDaiAmount,
|
427
|
-
outgoingAaveUsdcAmount,
|
428
|
-
outgoingAaveUsdtAmount,
|
429
|
-
useUnderlyings,
|
430
|
-
}),
|
431
|
-
selector: lendSelector,
|
432
|
-
});
|
433
|
-
|
434
|
-
return comptrollerProxy
|
435
|
-
.connect(fundOwner)
|
436
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
437
|
-
}
|
438
|
-
|
439
|
-
export function curveAaveLendAndStake({
|
440
|
-
comptrollerProxy,
|
441
|
-
integrationManager,
|
442
|
-
fundOwner,
|
443
|
-
curveLiquidityAaveAdapter,
|
444
|
-
outgoingAaveDaiAmount = BigNumber.from(0),
|
445
|
-
outgoingAaveUsdcAmount = BigNumber.from(0),
|
446
|
-
outgoingAaveUsdtAmount = BigNumber.from(0),
|
447
|
-
minIncomingLiquidityGaugeTokenAmount = BigNumber.from(1),
|
448
|
-
useUnderlyings = false,
|
449
|
-
}: {
|
450
|
-
comptrollerProxy: ComptrollerLib;
|
451
|
-
integrationManager: IntegrationManager;
|
452
|
-
fundOwner: SignerWithAddress;
|
453
|
-
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
454
|
-
outgoingAaveDaiAmount?: BigNumberish;
|
455
|
-
outgoingAaveUsdcAmount?: BigNumberish;
|
456
|
-
outgoingAaveUsdtAmount?: BigNumberish;
|
457
|
-
minIncomingLiquidityGaugeTokenAmount?: BigNumberish;
|
458
|
-
useUnderlyings?: boolean;
|
459
|
-
}) {
|
460
|
-
const callArgs = callOnIntegrationArgs({
|
461
|
-
adapter: curveLiquidityAaveAdapter,
|
462
|
-
encodedCallArgs: curveAaveLendAndStakeArgs({
|
463
|
-
minIncomingLiquidityGaugeTokenAmount,
|
464
|
-
outgoingAaveDaiAmount,
|
465
|
-
outgoingAaveUsdcAmount,
|
466
|
-
outgoingAaveUsdtAmount,
|
467
|
-
useUnderlyings,
|
468
|
-
}),
|
469
|
-
selector: lendAndStakeSelector,
|
470
|
-
});
|
471
|
-
|
472
|
-
return comptrollerProxy
|
473
|
-
.connect(fundOwner)
|
474
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
475
|
-
}
|
476
|
-
|
477
|
-
export function curveAaveRedeem({
|
478
|
-
comptrollerProxy,
|
479
|
-
integrationManager,
|
480
|
-
fundOwner,
|
481
|
-
curveLiquidityAaveAdapter,
|
482
|
-
outgoingLPTokenAmount,
|
483
|
-
minIncomingAaveDaiAmount = BigNumber.from(1),
|
484
|
-
minIncomingAaveUsdcAmount = BigNumber.from(1),
|
485
|
-
minIncomingAaveUsdtAmount = BigNumber.from(1),
|
486
|
-
receiveSingleAsset = false,
|
487
|
-
useUnderlyings = false,
|
488
|
-
}: {
|
489
|
-
comptrollerProxy: ComptrollerLib;
|
490
|
-
integrationManager: IntegrationManager;
|
491
|
-
fundOwner: SignerWithAddress;
|
492
|
-
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
493
|
-
outgoingLPTokenAmount: BigNumberish;
|
494
|
-
minIncomingAaveDaiAmount?: BigNumberish;
|
495
|
-
minIncomingAaveUsdcAmount?: BigNumberish;
|
496
|
-
minIncomingAaveUsdtAmount?: BigNumberish;
|
497
|
-
receiveSingleAsset?: boolean;
|
498
|
-
useUnderlyings?: boolean;
|
499
|
-
}) {
|
500
|
-
const callArgs = callOnIntegrationArgs({
|
501
|
-
adapter: curveLiquidityAaveAdapter,
|
502
|
-
encodedCallArgs: curveAaveRedeemArgs({
|
503
|
-
minIncomingAaveDaiAmount,
|
504
|
-
minIncomingAaveUsdcAmount,
|
505
|
-
minIncomingAaveUsdtAmount,
|
506
|
-
outgoingLPTokenAmount,
|
507
|
-
receiveSingleAsset,
|
508
|
-
useUnderlyings,
|
509
|
-
}),
|
510
|
-
selector: redeemSelector,
|
511
|
-
});
|
512
|
-
|
513
|
-
return comptrollerProxy
|
514
|
-
.connect(fundOwner)
|
515
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
516
|
-
}
|
517
|
-
|
518
|
-
export function curveAaveStake({
|
519
|
-
comptrollerProxy,
|
520
|
-
integrationManager,
|
521
|
-
fundOwner,
|
522
|
-
curveLiquidityAaveAdapter,
|
523
|
-
outgoingLPTokenAmount,
|
524
|
-
}: {
|
525
|
-
comptrollerProxy: ComptrollerLib;
|
526
|
-
integrationManager: IntegrationManager;
|
527
|
-
fundOwner: SignerWithAddress;
|
528
|
-
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
529
|
-
outgoingLPTokenAmount: BigNumberish;
|
530
|
-
}) {
|
531
|
-
const callArgs = callOnIntegrationArgs({
|
532
|
-
adapter: curveLiquidityAaveAdapter,
|
533
|
-
encodedCallArgs: curveAaveStakeArgs({
|
534
|
-
outgoingLPTokenAmount,
|
535
|
-
}),
|
536
|
-
selector: stakeSelector,
|
537
|
-
});
|
538
|
-
|
539
|
-
return comptrollerProxy
|
540
|
-
.connect(fundOwner)
|
541
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
542
|
-
}
|
543
|
-
|
544
|
-
export function curveAaveUnstakeAndRedeem({
|
545
|
-
comptrollerProxy,
|
546
|
-
integrationManager,
|
547
|
-
fundOwner,
|
548
|
-
curveLiquidityAaveAdapter,
|
549
|
-
outgoingLiquidityGaugeTokenAmount,
|
550
|
-
minIncomingAaveDaiAmount = BigNumber.from(1),
|
551
|
-
minIncomingAaveUsdcAmount = BigNumber.from(1),
|
552
|
-
minIncomingAaveUsdtAmount = BigNumber.from(1),
|
553
|
-
receiveSingleAsset = false,
|
554
|
-
useUnderlyings = false,
|
555
|
-
}: {
|
556
|
-
comptrollerProxy: ComptrollerLib;
|
557
|
-
integrationManager: IntegrationManager;
|
558
|
-
fundOwner: SignerWithAddress;
|
559
|
-
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
560
|
-
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
561
|
-
minIncomingAaveDaiAmount?: BigNumberish;
|
562
|
-
minIncomingAaveUsdcAmount?: BigNumberish;
|
563
|
-
minIncomingAaveUsdtAmount?: BigNumberish;
|
564
|
-
receiveSingleAsset?: boolean;
|
565
|
-
useUnderlyings?: boolean;
|
566
|
-
}) {
|
567
|
-
const callArgs = callOnIntegrationArgs({
|
568
|
-
adapter: curveLiquidityAaveAdapter,
|
569
|
-
encodedCallArgs: curveAaveUnstakeAndRedeemArgs({
|
570
|
-
minIncomingAaveDaiAmount,
|
571
|
-
minIncomingAaveUsdcAmount,
|
572
|
-
minIncomingAaveUsdtAmount,
|
573
|
-
outgoingLiquidityGaugeTokenAmount,
|
574
|
-
receiveSingleAsset,
|
575
|
-
useUnderlyings,
|
576
|
-
}),
|
577
|
-
selector: unstakeAndRedeemSelector,
|
578
|
-
});
|
579
|
-
|
580
|
-
return comptrollerProxy
|
581
|
-
.connect(fundOwner)
|
582
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
583
|
-
}
|
584
|
-
|
585
|
-
export function curveAaveUnstake({
|
586
|
-
comptrollerProxy,
|
587
|
-
integrationManager,
|
588
|
-
fundOwner,
|
589
|
-
curveLiquidityAaveAdapter,
|
590
|
-
outgoingLiquidityGaugeTokenAmount,
|
591
|
-
}: {
|
592
|
-
comptrollerProxy: ComptrollerLib;
|
593
|
-
integrationManager: IntegrationManager;
|
594
|
-
fundOwner: SignerWithAddress;
|
595
|
-
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
596
|
-
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
597
|
-
}) {
|
598
|
-
const callArgs = callOnIntegrationArgs({
|
599
|
-
adapter: curveLiquidityAaveAdapter,
|
600
|
-
encodedCallArgs: curveAaveUnstakeArgs({
|
601
|
-
outgoingLiquidityGaugeTokenAmount,
|
602
|
-
}),
|
603
|
-
selector: unstakeSelector,
|
604
|
-
});
|
605
|
-
|
606
|
-
return comptrollerProxy
|
607
|
-
.connect(fundOwner)
|
608
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
609
|
-
}
|
610
|
-
|
611
|
-
// sETH pool
|
612
|
-
|
613
|
-
export function curveSethClaimRewards({
|
614
|
-
comptrollerProxy,
|
615
|
-
integrationManager,
|
616
|
-
fundOwner,
|
617
|
-
curveLiquiditySethAdapter,
|
618
|
-
}: {
|
619
|
-
comptrollerProxy: ComptrollerLib;
|
620
|
-
integrationManager: IntegrationManager;
|
621
|
-
fundOwner: SignerWithAddress;
|
622
|
-
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
623
|
-
}) {
|
624
|
-
const callArgs = callOnIntegrationArgs({
|
625
|
-
adapter: curveLiquiditySethAdapter,
|
626
|
-
encodedCallArgs: constants.HashZero,
|
627
|
-
selector: claimRewardsSelector,
|
628
|
-
});
|
629
|
-
|
630
|
-
return comptrollerProxy
|
631
|
-
.connect(fundOwner)
|
632
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
633
|
-
}
|
634
|
-
|
635
|
-
export function curveSethLend({
|
636
|
-
comptrollerProxy,
|
637
|
-
integrationManager,
|
638
|
-
fundOwner,
|
639
|
-
curveLiquiditySethAdapter,
|
640
|
-
outgoingWethAmount,
|
641
|
-
outgoingSethAmount,
|
642
|
-
minIncomingLPTokenAmount,
|
643
|
-
}: {
|
644
|
-
comptrollerProxy: ComptrollerLib;
|
645
|
-
integrationManager: IntegrationManager;
|
646
|
-
fundOwner: SignerWithAddress;
|
647
|
-
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
648
|
-
outgoingWethAmount: BigNumberish;
|
649
|
-
outgoingSethAmount: BigNumberish;
|
650
|
-
minIncomingLPTokenAmount: BigNumberish;
|
651
|
-
}) {
|
652
|
-
const callArgs = callOnIntegrationArgs({
|
653
|
-
adapter: curveLiquiditySethAdapter,
|
654
|
-
encodedCallArgs: curveSethLendArgs({
|
655
|
-
minIncomingLPTokenAmount,
|
656
|
-
outgoingSethAmount,
|
657
|
-
outgoingWethAmount,
|
658
|
-
}),
|
659
|
-
selector: lendSelector,
|
660
|
-
});
|
661
|
-
|
662
|
-
return comptrollerProxy
|
663
|
-
.connect(fundOwner)
|
664
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
665
|
-
}
|
666
|
-
|
667
|
-
export function curveSethLendAndStake({
|
668
|
-
comptrollerProxy,
|
669
|
-
integrationManager,
|
670
|
-
fundOwner,
|
671
|
-
curveLiquiditySethAdapter,
|
672
|
-
outgoingWethAmount,
|
673
|
-
outgoingSethAmount,
|
674
|
-
minIncomingLiquidityGaugeTokenAmount,
|
675
|
-
}: {
|
676
|
-
comptrollerProxy: ComptrollerLib;
|
677
|
-
integrationManager: IntegrationManager;
|
678
|
-
fundOwner: SignerWithAddress;
|
679
|
-
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
680
|
-
outgoingWethAmount: BigNumberish;
|
681
|
-
outgoingSethAmount: BigNumberish;
|
682
|
-
minIncomingLiquidityGaugeTokenAmount: BigNumberish;
|
683
|
-
}) {
|
684
|
-
const callArgs = callOnIntegrationArgs({
|
685
|
-
adapter: curveLiquiditySethAdapter,
|
686
|
-
encodedCallArgs: curveSethLendAndStakeArgs({
|
687
|
-
minIncomingLiquidityGaugeTokenAmount,
|
688
|
-
outgoingSethAmount,
|
689
|
-
outgoingWethAmount,
|
690
|
-
}),
|
691
|
-
selector: lendAndStakeSelector,
|
692
|
-
});
|
693
|
-
|
694
|
-
return comptrollerProxy
|
695
|
-
.connect(fundOwner)
|
696
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
697
|
-
}
|
698
|
-
|
699
|
-
export function curveSethRedeem({
|
700
|
-
comptrollerProxy,
|
701
|
-
integrationManager,
|
702
|
-
fundOwner,
|
703
|
-
curveLiquiditySethAdapter,
|
704
|
-
outgoingLPTokenAmount,
|
705
|
-
minIncomingWethAmount,
|
706
|
-
minIncomingSethAmount,
|
707
|
-
receiveSingleAsset,
|
708
|
-
}: {
|
709
|
-
comptrollerProxy: ComptrollerLib;
|
710
|
-
integrationManager: IntegrationManager;
|
711
|
-
fundOwner: SignerWithAddress;
|
712
|
-
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
713
|
-
outgoingLPTokenAmount: BigNumberish;
|
714
|
-
minIncomingWethAmount: BigNumberish;
|
715
|
-
minIncomingSethAmount: BigNumberish;
|
716
|
-
receiveSingleAsset: boolean;
|
717
|
-
}) {
|
718
|
-
const callArgs = callOnIntegrationArgs({
|
719
|
-
adapter: curveLiquiditySethAdapter,
|
720
|
-
encodedCallArgs: curveSethRedeemArgs({
|
721
|
-
minIncomingSethAmount,
|
722
|
-
minIncomingWethAmount,
|
723
|
-
outgoingLPTokenAmount,
|
724
|
-
receiveSingleAsset,
|
725
|
-
}),
|
726
|
-
selector: redeemSelector,
|
727
|
-
});
|
728
|
-
|
729
|
-
return comptrollerProxy
|
730
|
-
.connect(fundOwner)
|
731
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
732
|
-
}
|
733
|
-
|
734
|
-
export function curveSethStake({
|
735
|
-
comptrollerProxy,
|
736
|
-
integrationManager,
|
737
|
-
fundOwner,
|
738
|
-
curveLiquiditySethAdapter,
|
739
|
-
outgoingLPTokenAmount,
|
740
|
-
}: {
|
741
|
-
comptrollerProxy: ComptrollerLib;
|
742
|
-
integrationManager: IntegrationManager;
|
743
|
-
fundOwner: SignerWithAddress;
|
744
|
-
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
745
|
-
outgoingLPTokenAmount: BigNumberish;
|
746
|
-
}) {
|
747
|
-
const callArgs = callOnIntegrationArgs({
|
748
|
-
adapter: curveLiquiditySethAdapter,
|
749
|
-
encodedCallArgs: curveSethStakeArgs({
|
750
|
-
outgoingLPTokenAmount,
|
751
|
-
}),
|
752
|
-
selector: stakeSelector,
|
753
|
-
});
|
754
|
-
|
755
|
-
return comptrollerProxy
|
756
|
-
.connect(fundOwner)
|
757
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
758
|
-
}
|
759
|
-
|
760
|
-
export function curveSethUnstakeAndRedeem({
|
761
|
-
comptrollerProxy,
|
762
|
-
integrationManager,
|
763
|
-
fundOwner,
|
764
|
-
curveLiquiditySethAdapter,
|
765
|
-
outgoingLiquidityGaugeTokenAmount,
|
766
|
-
minIncomingWethAmount,
|
767
|
-
minIncomingSethAmount,
|
768
|
-
receiveSingleAsset,
|
769
|
-
}: {
|
770
|
-
comptrollerProxy: ComptrollerLib;
|
771
|
-
integrationManager: IntegrationManager;
|
772
|
-
fundOwner: SignerWithAddress;
|
773
|
-
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
774
|
-
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
775
|
-
minIncomingWethAmount: BigNumberish;
|
776
|
-
minIncomingSethAmount: BigNumberish;
|
777
|
-
receiveSingleAsset: boolean;
|
778
|
-
}) {
|
779
|
-
const callArgs = callOnIntegrationArgs({
|
780
|
-
adapter: curveLiquiditySethAdapter,
|
781
|
-
encodedCallArgs: curveSethUnstakeAndRedeemArgs({
|
782
|
-
minIncomingSethAmount,
|
783
|
-
minIncomingWethAmount,
|
784
|
-
outgoingLiquidityGaugeTokenAmount,
|
785
|
-
receiveSingleAsset,
|
786
|
-
}),
|
787
|
-
selector: unstakeAndRedeemSelector,
|
788
|
-
});
|
789
|
-
|
790
|
-
return comptrollerProxy
|
791
|
-
.connect(fundOwner)
|
792
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
793
|
-
}
|
794
|
-
|
795
|
-
export function curveSethUnstake({
|
796
|
-
comptrollerProxy,
|
797
|
-
integrationManager,
|
798
|
-
fundOwner,
|
799
|
-
curveLiquiditySethAdapter,
|
800
|
-
outgoingLiquidityGaugeTokenAmount,
|
801
|
-
}: {
|
802
|
-
comptrollerProxy: ComptrollerLib;
|
803
|
-
integrationManager: IntegrationManager;
|
804
|
-
fundOwner: SignerWithAddress;
|
805
|
-
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
806
|
-
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
807
|
-
}) {
|
808
|
-
const callArgs = callOnIntegrationArgs({
|
809
|
-
adapter: curveLiquiditySethAdapter,
|
810
|
-
encodedCallArgs: curveSethUnstakeArgs({
|
811
|
-
outgoingLiquidityGaugeTokenAmount,
|
812
|
-
}),
|
813
|
-
selector: unstakeSelector,
|
814
|
-
});
|
815
|
-
|
816
|
-
return comptrollerProxy
|
817
|
-
.connect(fundOwner)
|
818
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
819
|
-
}
|
820
|
-
|
821
|
-
// stETH pool
|
822
|
-
|
823
|
-
export function curveStethClaimRewards({
|
824
|
-
comptrollerProxy,
|
825
|
-
integrationManager,
|
826
|
-
fundOwner,
|
827
|
-
curveLiquidityStethAdapter,
|
828
|
-
}: {
|
829
|
-
comptrollerProxy: ComptrollerLib;
|
830
|
-
integrationManager: IntegrationManager;
|
831
|
-
fundOwner: SignerWithAddress;
|
832
|
-
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
833
|
-
}) {
|
834
|
-
const callArgs = callOnIntegrationArgs({
|
835
|
-
adapter: curveLiquidityStethAdapter,
|
836
|
-
encodedCallArgs: constants.HashZero,
|
837
|
-
selector: claimRewardsSelector,
|
838
|
-
});
|
839
|
-
|
840
|
-
return comptrollerProxy
|
841
|
-
.connect(fundOwner)
|
842
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
843
|
-
}
|
844
|
-
|
845
|
-
export function curveStethLend({
|
846
|
-
comptrollerProxy,
|
847
|
-
integrationManager,
|
848
|
-
fundOwner,
|
849
|
-
curveLiquidityStethAdapter,
|
850
|
-
outgoingWethAmount,
|
851
|
-
outgoingStethAmount,
|
852
|
-
minIncomingLPTokenAmount,
|
853
|
-
}: {
|
854
|
-
comptrollerProxy: ComptrollerLib;
|
855
|
-
integrationManager: IntegrationManager;
|
856
|
-
fundOwner: SignerWithAddress;
|
857
|
-
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
858
|
-
outgoingWethAmount: BigNumberish;
|
859
|
-
outgoingStethAmount: BigNumberish;
|
860
|
-
minIncomingLPTokenAmount: BigNumberish;
|
861
|
-
}) {
|
862
|
-
const callArgs = callOnIntegrationArgs({
|
863
|
-
adapter: curveLiquidityStethAdapter,
|
864
|
-
encodedCallArgs: curveStethLendArgs({
|
865
|
-
minIncomingLPTokenAmount,
|
866
|
-
outgoingStethAmount,
|
867
|
-
outgoingWethAmount,
|
868
|
-
}),
|
869
|
-
selector: lendSelector,
|
870
|
-
});
|
871
|
-
|
872
|
-
return comptrollerProxy
|
873
|
-
.connect(fundOwner)
|
874
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
875
|
-
}
|
876
|
-
|
877
|
-
export function curveStethLendAndStake({
|
878
|
-
comptrollerProxy,
|
879
|
-
integrationManager,
|
880
|
-
fundOwner,
|
881
|
-
curveLiquidityStethAdapter,
|
882
|
-
outgoingWethAmount,
|
883
|
-
outgoingStethAmount,
|
884
|
-
minIncomingLiquidityGaugeTokenAmount,
|
885
|
-
}: {
|
886
|
-
comptrollerProxy: ComptrollerLib;
|
887
|
-
integrationManager: IntegrationManager;
|
888
|
-
fundOwner: SignerWithAddress;
|
889
|
-
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
890
|
-
outgoingWethAmount: BigNumberish;
|
891
|
-
outgoingStethAmount: BigNumberish;
|
892
|
-
minIncomingLiquidityGaugeTokenAmount: BigNumberish;
|
893
|
-
}) {
|
894
|
-
const callArgs = callOnIntegrationArgs({
|
895
|
-
adapter: curveLiquidityStethAdapter,
|
896
|
-
encodedCallArgs: curveStethLendAndStakeArgs({
|
897
|
-
minIncomingLiquidityGaugeTokenAmount,
|
898
|
-
outgoingStethAmount,
|
899
|
-
outgoingWethAmount,
|
900
|
-
}),
|
901
|
-
selector: lendAndStakeSelector,
|
902
|
-
});
|
903
|
-
|
904
|
-
return comptrollerProxy
|
905
|
-
.connect(fundOwner)
|
906
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
907
|
-
}
|
908
|
-
|
909
|
-
export function curveStethRedeem({
|
910
|
-
comptrollerProxy,
|
911
|
-
integrationManager,
|
912
|
-
fundOwner,
|
913
|
-
curveLiquidityStethAdapter,
|
914
|
-
outgoingLPTokenAmount,
|
915
|
-
minIncomingWethAmount,
|
916
|
-
minIncomingStethAmount,
|
917
|
-
receiveSingleAsset,
|
918
|
-
}: {
|
919
|
-
comptrollerProxy: ComptrollerLib;
|
920
|
-
integrationManager: IntegrationManager;
|
921
|
-
fundOwner: SignerWithAddress;
|
922
|
-
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
923
|
-
outgoingLPTokenAmount: BigNumberish;
|
924
|
-
minIncomingWethAmount: BigNumberish;
|
925
|
-
minIncomingStethAmount: BigNumberish;
|
926
|
-
receiveSingleAsset: boolean;
|
927
|
-
}) {
|
928
|
-
const callArgs = callOnIntegrationArgs({
|
929
|
-
adapter: curveLiquidityStethAdapter,
|
930
|
-
encodedCallArgs: curveStethRedeemArgs({
|
931
|
-
minIncomingStethAmount,
|
932
|
-
minIncomingWethAmount,
|
933
|
-
outgoingLPTokenAmount,
|
934
|
-
receiveSingleAsset,
|
935
|
-
}),
|
936
|
-
selector: redeemSelector,
|
937
|
-
});
|
938
|
-
|
939
|
-
return comptrollerProxy
|
940
|
-
.connect(fundOwner)
|
941
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
942
|
-
}
|
943
|
-
|
944
|
-
export function curveStethStake({
|
945
|
-
comptrollerProxy,
|
946
|
-
integrationManager,
|
947
|
-
fundOwner,
|
948
|
-
curveLiquidityStethAdapter,
|
949
|
-
outgoingLPTokenAmount,
|
950
|
-
}: {
|
951
|
-
comptrollerProxy: ComptrollerLib;
|
952
|
-
integrationManager: IntegrationManager;
|
953
|
-
fundOwner: SignerWithAddress;
|
954
|
-
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
955
|
-
outgoingLPTokenAmount: BigNumberish;
|
956
|
-
}) {
|
957
|
-
const callArgs = callOnIntegrationArgs({
|
958
|
-
adapter: curveLiquidityStethAdapter,
|
959
|
-
encodedCallArgs: curveStethStakeArgs({
|
960
|
-
outgoingLPTokenAmount,
|
961
|
-
}),
|
962
|
-
selector: stakeSelector,
|
963
|
-
});
|
964
|
-
|
965
|
-
return comptrollerProxy
|
966
|
-
.connect(fundOwner)
|
967
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
968
|
-
}
|
969
|
-
|
970
|
-
export function curveStethUnstakeAndRedeem({
|
971
|
-
comptrollerProxy,
|
972
|
-
integrationManager,
|
973
|
-
fundOwner,
|
974
|
-
curveLiquidityStethAdapter,
|
975
|
-
outgoingLiquidityGaugeTokenAmount,
|
976
|
-
minIncomingWethAmount,
|
977
|
-
minIncomingStethAmount,
|
978
|
-
receiveSingleAsset,
|
979
|
-
}: {
|
980
|
-
comptrollerProxy: ComptrollerLib;
|
981
|
-
integrationManager: IntegrationManager;
|
982
|
-
fundOwner: SignerWithAddress;
|
983
|
-
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
984
|
-
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
985
|
-
minIncomingWethAmount: BigNumberish;
|
986
|
-
minIncomingStethAmount: BigNumberish;
|
987
|
-
receiveSingleAsset: boolean;
|
988
|
-
}) {
|
989
|
-
const callArgs = callOnIntegrationArgs({
|
990
|
-
adapter: curveLiquidityStethAdapter,
|
991
|
-
encodedCallArgs: curveStethUnstakeAndRedeemArgs({
|
992
|
-
minIncomingStethAmount,
|
993
|
-
minIncomingWethAmount,
|
994
|
-
outgoingLiquidityGaugeTokenAmount,
|
995
|
-
receiveSingleAsset,
|
996
|
-
}),
|
997
|
-
selector: unstakeAndRedeemSelector,
|
998
|
-
});
|
999
|
-
|
1000
|
-
return comptrollerProxy
|
1001
|
-
.connect(fundOwner)
|
1002
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1003
|
-
}
|
1004
|
-
|
1005
|
-
export function curveStethUnstake({
|
1006
|
-
comptrollerProxy,
|
1007
|
-
integrationManager,
|
1008
|
-
fundOwner,
|
1009
|
-
curveLiquidityStethAdapter,
|
1010
|
-
outgoingLiquidityGaugeTokenAmount,
|
1011
|
-
}: {
|
1012
|
-
comptrollerProxy: ComptrollerLib;
|
1013
|
-
integrationManager: IntegrationManager;
|
1014
|
-
fundOwner: SignerWithAddress;
|
1015
|
-
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
1016
|
-
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
1017
|
-
}) {
|
1018
|
-
const callArgs = callOnIntegrationArgs({
|
1019
|
-
adapter: curveLiquidityStethAdapter,
|
1020
|
-
encodedCallArgs: curveStethUnstakeArgs({
|
1021
|
-
outgoingLiquidityGaugeTokenAmount,
|
1022
|
-
}),
|
1023
|
-
selector: unstakeSelector,
|
1024
|
-
});
|
1025
|
-
|
1026
|
-
return comptrollerProxy
|
1027
|
-
.connect(fundOwner)
|
1028
|
-
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1029
|
-
}
|