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