@enzymefinance/testutils 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +11 -0
- package/dist/declarations/src/assertions.d.ts +4 -0
- package/dist/declarations/src/deployment.d.ts +81 -0
- package/dist/declarations/src/helpers.d.ts +2 -0
- package/dist/declarations/src/index.d.ts +5 -0
- package/dist/declarations/src/scaffolding/assets.d.ts +12 -0
- package/dist/declarations/src/scaffolding/chainlink.d.ts +3 -0
- package/dist/declarations/src/scaffolding/common.d.ts +6 -0
- package/dist/declarations/src/scaffolding/core.d.ts +19 -0
- package/dist/declarations/src/scaffolding/extensions/common.d.ts +11 -0
- package/dist/declarations/src/scaffolding/extensions/fees.d.ts +14 -0
- package/dist/declarations/src/scaffolding/extensions/index.d.ts +4 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/aave.d.ts +19 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/alpha.d.ts +36 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/compound.d.ts +27 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/curve.d.ts +331 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/idle.d.ts +57 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/index.d.ts +14 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/kyber.d.ts +23 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/mock.d.ts +32 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV4.d.ts +22 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/synthetix.d.ts +25 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/trackedAssets.d.ts +17 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV2.d.ts +46 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV3.d.ts +15 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/yearn.d.ts +22 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/zeroExV2.d.ts +12 -0
- package/dist/declarations/src/scaffolding/extensions/policies.d.ts +15 -0
- package/dist/declarations/src/scaffolding/index.d.ts +9 -0
- package/dist/declarations/src/scaffolding/peripheral/index.d.ts +1 -0
- package/dist/declarations/src/scaffolding/peripheral/sharesRequestors.d.ts +19 -0
- package/dist/declarations/src/scaffolding/setup.d.ts +46 -0
- package/dist/declarations/src/scaffolding/shares.d.ts +30 -0
- package/dist/declarations/src/scaffolding/vaultCalls.d.ts +17 -0
- package/dist/declarations/src/whales.d.ts +43 -0
- package/dist/enzymefinance-testutils.browser.cjs.js +3160 -0
- package/dist/enzymefinance-testutils.browser.esm.js +3045 -0
- package/dist/enzymefinance-testutils.cjs.d.ts +1 -0
- package/dist/enzymefinance-testutils.cjs.dev.js +3160 -0
- package/dist/enzymefinance-testutils.cjs.js +7 -0
- package/dist/enzymefinance-testutils.cjs.prod.js +3160 -0
- package/dist/enzymefinance-testutils.esm.js +3045 -0
- package/package.json +18 -0
- package/src/assertions.ts +20 -0
- package/src/deployment.ts +169 -0
- package/src/helpers.ts +6 -0
- package/src/index.ts +5 -0
- package/src/scaffolding/assets.ts +39 -0
- package/src/scaffolding/chainlink.ts +8 -0
- package/src/scaffolding/common.ts +6 -0
- package/src/scaffolding/core.ts +77 -0
- package/src/scaffolding/extensions/common.ts +30 -0
- package/src/scaffolding/extensions/fees.ts +87 -0
- package/src/scaffolding/extensions/index.ts +4 -0
- package/src/scaffolding/extensions/integrations/aave.ts +80 -0
- package/src/scaffolding/extensions/integrations/alpha.ts +119 -0
- package/src/scaffolding/extensions/integrations/compound.ts +97 -0
- package/src/scaffolding/extensions/integrations/curve.ts +1207 -0
- package/src/scaffolding/extensions/integrations/idle.ts +215 -0
- package/src/scaffolding/extensions/integrations/index.ts +14 -0
- package/src/scaffolding/extensions/integrations/kyber.ts +69 -0
- package/src/scaffolding/extensions/integrations/mock.ts +118 -0
- package/src/scaffolding/extensions/integrations/paraSwapV4.ts +65 -0
- package/src/scaffolding/extensions/integrations/synthetix.ts +97 -0
- package/src/scaffolding/extensions/integrations/trackedAssets.ts +66 -0
- package/src/scaffolding/extensions/integrations/uniswapV2.ts +171 -0
- package/src/scaffolding/extensions/integrations/uniswapV3.ts +56 -0
- package/src/scaffolding/extensions/integrations/yearn.ts +81 -0
- package/src/scaffolding/extensions/integrations/zeroExV2.ts +45 -0
- package/src/scaffolding/extensions/policies.ts +85 -0
- package/src/scaffolding/index.ts +9 -0
- package/src/scaffolding/peripheral/index.ts +1 -0
- package/src/scaffolding/peripheral/sharesRequestors.ts +53 -0
- package/src/scaffolding/setup.ts +135 -0
- package/src/scaffolding/shares.ts +63 -0
- package/src/scaffolding/vaultCalls.ts +58 -0
- package/src/types.d.ts +1 -0
- package/src/whales.ts +63 -0
- package/tsconfig.json +4 -0
@@ -0,0 +1,80 @@
|
|
1
|
+
import { SignerWithAddress } from '@enzymefinance/hardhat';
|
2
|
+
import {
|
3
|
+
AaveAdapter,
|
4
|
+
aaveLendArgs,
|
5
|
+
aaveRedeemArgs,
|
6
|
+
callOnIntegrationArgs,
|
7
|
+
ComptrollerLib,
|
8
|
+
IntegrationManager,
|
9
|
+
IntegrationManagerActionId,
|
10
|
+
lendSelector,
|
11
|
+
redeemSelector,
|
12
|
+
StandardToken,
|
13
|
+
} from '@enzymefinance/protocol';
|
14
|
+
import { BigNumberish, utils } from 'ethers';
|
15
|
+
|
16
|
+
export async function aaveLend({
|
17
|
+
comptrollerProxy,
|
18
|
+
integrationManager,
|
19
|
+
fundOwner,
|
20
|
+
aaveAdapter,
|
21
|
+
aToken,
|
22
|
+
amount = utils.parseEther('1'),
|
23
|
+
}: {
|
24
|
+
comptrollerProxy: ComptrollerLib;
|
25
|
+
integrationManager: IntegrationManager;
|
26
|
+
fundOwner: SignerWithAddress;
|
27
|
+
aaveAdapter: AaveAdapter;
|
28
|
+
aToken: StandardToken;
|
29
|
+
amount?: BigNumberish;
|
30
|
+
}) {
|
31
|
+
const lendArgs = aaveLendArgs({
|
32
|
+
aToken,
|
33
|
+
amount,
|
34
|
+
});
|
35
|
+
|
36
|
+
const callArgs = callOnIntegrationArgs({
|
37
|
+
adapter: aaveAdapter,
|
38
|
+
selector: lendSelector,
|
39
|
+
encodedCallArgs: lendArgs,
|
40
|
+
});
|
41
|
+
|
42
|
+
const lendTx = comptrollerProxy
|
43
|
+
.connect(fundOwner)
|
44
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
45
|
+
|
46
|
+
return lendTx;
|
47
|
+
}
|
48
|
+
|
49
|
+
export async function aaveRedeem({
|
50
|
+
comptrollerProxy,
|
51
|
+
integrationManager,
|
52
|
+
fundOwner,
|
53
|
+
aaveAdapter,
|
54
|
+
aToken,
|
55
|
+
amount = utils.parseEther('1'),
|
56
|
+
}: {
|
57
|
+
comptrollerProxy: ComptrollerLib;
|
58
|
+
integrationManager: IntegrationManager;
|
59
|
+
fundOwner: SignerWithAddress;
|
60
|
+
aaveAdapter: AaveAdapter;
|
61
|
+
aToken: StandardToken;
|
62
|
+
amount?: BigNumberish;
|
63
|
+
}) {
|
64
|
+
const redeemArgs = aaveRedeemArgs({
|
65
|
+
aToken,
|
66
|
+
amount,
|
67
|
+
});
|
68
|
+
|
69
|
+
const callArgs = callOnIntegrationArgs({
|
70
|
+
adapter: aaveAdapter,
|
71
|
+
selector: redeemSelector,
|
72
|
+
encodedCallArgs: redeemArgs,
|
73
|
+
});
|
74
|
+
|
75
|
+
const redeemTx = comptrollerProxy
|
76
|
+
.connect(fundOwner)
|
77
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
78
|
+
|
79
|
+
return redeemTx;
|
80
|
+
}
|
@@ -0,0 +1,119 @@
|
|
1
|
+
import { Call, Contract, contract } from '@enzymefinance/ethers';
|
2
|
+
import { SignerWithAddress } from '@enzymefinance/hardhat';
|
3
|
+
import {
|
4
|
+
callOnIntegrationArgs,
|
5
|
+
AlphaHomoraV1Adapter,
|
6
|
+
alphaHomoraV1LendArgs,
|
7
|
+
alphaHomoraV1RedeemArgs,
|
8
|
+
ComptrollerLib,
|
9
|
+
IntegrationManager,
|
10
|
+
IntegrationManagerActionId,
|
11
|
+
lendSelector,
|
12
|
+
redeemSelector,
|
13
|
+
} from '@enzymefinance/protocol';
|
14
|
+
import { BigNumber, BigNumberish, providers, utils } from 'ethers';
|
15
|
+
|
16
|
+
export interface AlphaHomoraV1BankConfig extends Contract<AlphaHomoraV1BankConfig> {
|
17
|
+
getReservePoolBps: Call<() => BigNumber, Contract<any>>;
|
18
|
+
}
|
19
|
+
|
20
|
+
export const AlphaHomoraV1BankConfig = contract<AlphaHomoraV1BankConfig>()`
|
21
|
+
function getReservePoolBps() view returns (uint256)
|
22
|
+
`;
|
23
|
+
|
24
|
+
export interface AlphaHomoraV1Bank extends Contract<AlphaHomoraV1Bank> {
|
25
|
+
config: Call<() => string, Contract<any>>;
|
26
|
+
glbDebtVal: Call<() => BigNumber, Contract<any>>;
|
27
|
+
pendingInterest: Call<(msgValue: BigNumberish) => BigNumber, Contract<any>>;
|
28
|
+
reservePool: Call<() => BigNumber, Contract<any>>;
|
29
|
+
totalEth: Call<() => BigNumber, Contract<any>>;
|
30
|
+
}
|
31
|
+
|
32
|
+
export const AlphaHomoraV1Bank = contract<AlphaHomoraV1Bank>()`
|
33
|
+
function config() view returns (address)
|
34
|
+
function glbDebtVal() view returns (uint256)
|
35
|
+
function pendingInterest(uint256) view returns (uint256)
|
36
|
+
function reservePool() view returns (uint256)
|
37
|
+
function totalEth() view returns (uint256)
|
38
|
+
`;
|
39
|
+
|
40
|
+
export async function alphaHomoraV1Lend({
|
41
|
+
comptrollerProxy,
|
42
|
+
integrationManager,
|
43
|
+
fundOwner,
|
44
|
+
alphaHomoraV1Adapter,
|
45
|
+
wethAmount = utils.parseEther('1'),
|
46
|
+
minibethAmount = 1,
|
47
|
+
}: {
|
48
|
+
comptrollerProxy: ComptrollerLib;
|
49
|
+
integrationManager: IntegrationManager;
|
50
|
+
fundOwner: SignerWithAddress;
|
51
|
+
alphaHomoraV1Adapter: AlphaHomoraV1Adapter;
|
52
|
+
wethAmount?: BigNumberish;
|
53
|
+
minibethAmount?: BigNumberish;
|
54
|
+
}) {
|
55
|
+
const lendArgs = alphaHomoraV1LendArgs({
|
56
|
+
outgoingWethAmount: wethAmount,
|
57
|
+
minIncomingIbethAmount: minibethAmount,
|
58
|
+
});
|
59
|
+
|
60
|
+
const callArgs = callOnIntegrationArgs({
|
61
|
+
adapter: alphaHomoraV1Adapter,
|
62
|
+
selector: lendSelector,
|
63
|
+
encodedCallArgs: lendArgs,
|
64
|
+
});
|
65
|
+
|
66
|
+
return comptrollerProxy
|
67
|
+
.connect(fundOwner)
|
68
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
69
|
+
}
|
70
|
+
|
71
|
+
export async function alphaHomoraV1Redeem({
|
72
|
+
comptrollerProxy,
|
73
|
+
integrationManager,
|
74
|
+
fundOwner,
|
75
|
+
alphaHomoraV1Adapter,
|
76
|
+
ibethAmount = utils.parseEther('1'),
|
77
|
+
minWethAmount = 1,
|
78
|
+
}: {
|
79
|
+
comptrollerProxy: ComptrollerLib;
|
80
|
+
integrationManager: IntegrationManager;
|
81
|
+
fundOwner: SignerWithAddress;
|
82
|
+
alphaHomoraV1Adapter: AlphaHomoraV1Adapter;
|
83
|
+
ibethAmount?: BigNumberish;
|
84
|
+
minWethAmount?: BigNumberish;
|
85
|
+
}) {
|
86
|
+
const redeemArgs = alphaHomoraV1RedeemArgs({
|
87
|
+
outgoingIbethAmount: ibethAmount,
|
88
|
+
minIncomingWethAmount: minWethAmount,
|
89
|
+
});
|
90
|
+
|
91
|
+
const callArgs = callOnIntegrationArgs({
|
92
|
+
adapter: alphaHomoraV1Adapter,
|
93
|
+
selector: redeemSelector,
|
94
|
+
encodedCallArgs: redeemArgs,
|
95
|
+
});
|
96
|
+
|
97
|
+
return comptrollerProxy
|
98
|
+
.connect(fundOwner)
|
99
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
100
|
+
}
|
101
|
+
|
102
|
+
export async function calcAlphaBankLiveTotalEth({
|
103
|
+
provider,
|
104
|
+
alphaHomoraBank,
|
105
|
+
}: {
|
106
|
+
provider: providers.Provider;
|
107
|
+
alphaHomoraBank: AlphaHomoraV1Bank;
|
108
|
+
}) {
|
109
|
+
const pendingInterest = await alphaHomoraBank.pendingInterest(0);
|
110
|
+
const glbDebtVal = (await alphaHomoraBank.glbDebtVal()).add(pendingInterest);
|
111
|
+
|
112
|
+
const bankConfig = new AlphaHomoraV1BankConfig(await alphaHomoraBank.config(), provider);
|
113
|
+
const toReserveAmount = pendingInterest.mul(await bankConfig.getReservePoolBps()).div(10000);
|
114
|
+
const reservePool = (await alphaHomoraBank.reservePool()).add(toReserveAmount);
|
115
|
+
|
116
|
+
const bankEthBalance = await provider.getBalance(alphaHomoraBank.address);
|
117
|
+
|
118
|
+
return bankEthBalance.add(glbDebtVal).sub(reservePool);
|
119
|
+
}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
import { AddressLike, Contract, contract, resolveAddress, Send } from '@enzymefinance/ethers';
|
2
|
+
import { SignerWithAddress } from '@enzymefinance/hardhat';
|
3
|
+
import {
|
4
|
+
callOnIntegrationArgs,
|
5
|
+
CompoundAdapter,
|
6
|
+
compoundArgs,
|
7
|
+
ComptrollerLib,
|
8
|
+
ICERC20,
|
9
|
+
IntegrationManager,
|
10
|
+
IntegrationManagerActionId,
|
11
|
+
lendSelector,
|
12
|
+
redeemSelector,
|
13
|
+
VaultLib,
|
14
|
+
} from '@enzymefinance/protocol';
|
15
|
+
import { BigNumberish, utils } from 'ethers';
|
16
|
+
|
17
|
+
// prettier-ignore
|
18
|
+
export interface ICompoundComptroller extends Contract<ICompoundComptroller> {
|
19
|
+
claimComp: Send<(_account: AddressLike) => void>;
|
20
|
+
}
|
21
|
+
|
22
|
+
export const ICompoundComptroller = contract<ICompoundComptroller>()`
|
23
|
+
function claimComp(address)
|
24
|
+
`;
|
25
|
+
|
26
|
+
export async function compoundLend({
|
27
|
+
comptrollerProxy,
|
28
|
+
integrationManager,
|
29
|
+
fundOwner,
|
30
|
+
compoundAdapter,
|
31
|
+
cToken,
|
32
|
+
tokenAmount = utils.parseEther('1'),
|
33
|
+
cTokenAmount = utils.parseEther('1'),
|
34
|
+
}: {
|
35
|
+
comptrollerProxy: ComptrollerLib;
|
36
|
+
integrationManager: IntegrationManager;
|
37
|
+
fundOwner: SignerWithAddress;
|
38
|
+
compoundAdapter: CompoundAdapter;
|
39
|
+
cToken: ICERC20;
|
40
|
+
tokenAmount?: BigNumberish;
|
41
|
+
cTokenAmount?: BigNumberish;
|
42
|
+
}) {
|
43
|
+
const lendArgs = await compoundArgs({
|
44
|
+
cToken: resolveAddress(cToken),
|
45
|
+
outgoingAssetAmount: tokenAmount,
|
46
|
+
minIncomingAssetAmount: cTokenAmount,
|
47
|
+
});
|
48
|
+
|
49
|
+
const callArgs = callOnIntegrationArgs({
|
50
|
+
adapter: compoundAdapter,
|
51
|
+
selector: lendSelector,
|
52
|
+
encodedCallArgs: lendArgs,
|
53
|
+
});
|
54
|
+
|
55
|
+
const lendTx = comptrollerProxy
|
56
|
+
.connect(fundOwner)
|
57
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
58
|
+
|
59
|
+
return lendTx;
|
60
|
+
}
|
61
|
+
|
62
|
+
export async function compoundRedeem({
|
63
|
+
comptrollerProxy,
|
64
|
+
integrationManager,
|
65
|
+
fundOwner,
|
66
|
+
compoundAdapter,
|
67
|
+
cToken,
|
68
|
+
tokenAmount = utils.parseEther('1'),
|
69
|
+
cTokenAmount = utils.parseEther('1'),
|
70
|
+
}: {
|
71
|
+
comptrollerProxy: ComptrollerLib;
|
72
|
+
vaultProxy: VaultLib;
|
73
|
+
integrationManager: IntegrationManager;
|
74
|
+
fundOwner: SignerWithAddress;
|
75
|
+
compoundAdapter: CompoundAdapter;
|
76
|
+
cToken: ICERC20;
|
77
|
+
tokenAmount?: BigNumberish;
|
78
|
+
cTokenAmount?: BigNumberish;
|
79
|
+
}) {
|
80
|
+
const redeemArgs = await compoundArgs({
|
81
|
+
cToken: resolveAddress(cToken),
|
82
|
+
outgoingAssetAmount: cTokenAmount,
|
83
|
+
minIncomingAssetAmount: tokenAmount,
|
84
|
+
});
|
85
|
+
|
86
|
+
const callArgs = await callOnIntegrationArgs({
|
87
|
+
adapter: compoundAdapter,
|
88
|
+
selector: redeemSelector,
|
89
|
+
encodedCallArgs: redeemArgs,
|
90
|
+
});
|
91
|
+
|
92
|
+
const redeemTx = comptrollerProxy
|
93
|
+
.connect(fundOwner)
|
94
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
95
|
+
|
96
|
+
return redeemTx;
|
97
|
+
}
|
@@ -0,0 +1,1207 @@
|
|
1
|
+
import { AddressLike, Call, Contract, contract, Send } from '@enzymefinance/ethers';
|
2
|
+
import { SignerWithAddress } from '@enzymefinance/hardhat';
|
3
|
+
import {
|
4
|
+
approveAssetsSelector,
|
5
|
+
callOnIntegrationArgs,
|
6
|
+
claimRewardsAndReinvestSelector,
|
7
|
+
claimRewardsAndSwapSelector,
|
8
|
+
claimRewardsSelector,
|
9
|
+
ComptrollerLib,
|
10
|
+
curveAaveClaimRewardsAndReinvestArgs,
|
11
|
+
curveAaveClaimRewardsAndSwapArgs,
|
12
|
+
curveAaveLendAndStakeArgs,
|
13
|
+
curveAaveLendArgs,
|
14
|
+
CurveAavePoolAssetIndex,
|
15
|
+
curveAaveRedeemArgs,
|
16
|
+
curveAaveStakeArgs,
|
17
|
+
curveAaveUnstakeAndRedeemArgs,
|
18
|
+
curveAaveUnstakeArgs,
|
19
|
+
curveApproveAssetsArgs,
|
20
|
+
curveEursLendAndStakeArgs,
|
21
|
+
curveEursLendArgs,
|
22
|
+
curveEursRedeemArgs,
|
23
|
+
curveEursStakeArgs,
|
24
|
+
curveEursUnstakeAndRedeemArgs,
|
25
|
+
curveEursUnstakeArgs,
|
26
|
+
CurveExchangeAdapter,
|
27
|
+
CurveLiquidityAaveAdapter,
|
28
|
+
CurveLiquidityEursAdapter,
|
29
|
+
CurveLiquiditySethAdapter,
|
30
|
+
CurveLiquidityStethAdapter,
|
31
|
+
curveSethClaimRewardsAndReinvestArgs,
|
32
|
+
curveSethClaimRewardsAndSwapArgs,
|
33
|
+
curveSethLendAndStakeArgs,
|
34
|
+
curveSethLendArgs,
|
35
|
+
curveSethRedeemArgs,
|
36
|
+
curveSethStakeArgs,
|
37
|
+
curveSethUnstakeAndRedeemArgs,
|
38
|
+
curveSethUnstakeArgs,
|
39
|
+
curveStethClaimRewardsAndReinvestArgs,
|
40
|
+
curveStethClaimRewardsAndSwapArgs,
|
41
|
+
curveStethLendAndStakeArgs,
|
42
|
+
curveStethLendArgs,
|
43
|
+
curveStethRedeemArgs,
|
44
|
+
curveStethStakeArgs,
|
45
|
+
curveStethUnstakeAndRedeemArgs,
|
46
|
+
curveStethUnstakeArgs,
|
47
|
+
curveTakeOrderArgs,
|
48
|
+
IntegrationManager,
|
49
|
+
IntegrationManagerActionId,
|
50
|
+
lendAndStakeSelector,
|
51
|
+
lendSelector,
|
52
|
+
redeemSelector,
|
53
|
+
stakeSelector,
|
54
|
+
StandardToken,
|
55
|
+
takeOrderSelector,
|
56
|
+
unstakeAndRedeemSelector,
|
57
|
+
unstakeSelector,
|
58
|
+
} from '@enzymefinance/protocol';
|
59
|
+
import { BigNumber, BigNumberish, constants, utils } from 'ethers';
|
60
|
+
|
61
|
+
export interface CurveLiquidityGaugeV2 extends Contract<CurveLiquidityGaugeV2> {
|
62
|
+
claim_rewards: Send<(_addr: AddressLike) => void>;
|
63
|
+
integrate_fraction: Call<(_for: AddressLike) => BigNumber, Contract<any>>;
|
64
|
+
}
|
65
|
+
|
66
|
+
export const CurveLiquidityGaugeV2 = contract<CurveLiquidityGaugeV2>()`
|
67
|
+
function claim_rewards(address)
|
68
|
+
function integrate_fraction(address) view returns (uint256)
|
69
|
+
`;
|
70
|
+
|
71
|
+
// prettier-ignore
|
72
|
+
export interface CurveSwaps extends Contract<CurveSwaps> {
|
73
|
+
get_best_rate: Call<(_from: AddressLike, to: AddressLike, amount: BigNumberish) => { bestPool: AddressLike, amountReceived: BigNumber }, CurveSwaps>
|
74
|
+
}
|
75
|
+
|
76
|
+
export const CurveSwaps = contract<CurveSwaps>()`
|
77
|
+
function get_best_rate(address _from, address to, uint256 amount) view returns (address bestPool, uint256 amountReceived)
|
78
|
+
`;
|
79
|
+
|
80
|
+
export interface CurveMinter extends Contract<CurveMinter> {
|
81
|
+
mint_for: Send<(_gauge_address: AddressLike, _for: AddressLike) => void>;
|
82
|
+
}
|
83
|
+
|
84
|
+
export const CurveMinter = contract<CurveMinter>()`
|
85
|
+
function mint_for(address,address)
|
86
|
+
`;
|
87
|
+
|
88
|
+
export async function curveApproveAssets({
|
89
|
+
comptrollerProxy,
|
90
|
+
integrationManager,
|
91
|
+
fundOwner,
|
92
|
+
adapter,
|
93
|
+
assets,
|
94
|
+
amounts = new Array(assets.length).fill(constants.MaxUint256),
|
95
|
+
}: {
|
96
|
+
comptrollerProxy: ComptrollerLib;
|
97
|
+
integrationManager: IntegrationManager;
|
98
|
+
fundOwner: SignerWithAddress;
|
99
|
+
adapter: AddressLike;
|
100
|
+
assets: AddressLike[];
|
101
|
+
amounts?: BigNumberish[];
|
102
|
+
}) {
|
103
|
+
const callArgs = callOnIntegrationArgs({
|
104
|
+
adapter: adapter,
|
105
|
+
selector: approveAssetsSelector,
|
106
|
+
encodedCallArgs: curveApproveAssetsArgs({
|
107
|
+
assets,
|
108
|
+
amounts,
|
109
|
+
}),
|
110
|
+
});
|
111
|
+
|
112
|
+
return comptrollerProxy
|
113
|
+
.connect(fundOwner)
|
114
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
115
|
+
}
|
116
|
+
|
117
|
+
// exchanges
|
118
|
+
|
119
|
+
export async function curveTakeOrder({
|
120
|
+
comptrollerProxy,
|
121
|
+
integrationManager,
|
122
|
+
fundOwner,
|
123
|
+
curveExchangeAdapter,
|
124
|
+
pool,
|
125
|
+
outgoingAsset,
|
126
|
+
outgoingAssetAmount = utils.parseEther('1'),
|
127
|
+
incomingAsset,
|
128
|
+
minIncomingAssetAmount = utils.parseEther('1'),
|
129
|
+
}: {
|
130
|
+
comptrollerProxy: ComptrollerLib;
|
131
|
+
integrationManager: IntegrationManager;
|
132
|
+
fundOwner: SignerWithAddress;
|
133
|
+
curveExchangeAdapter: CurveExchangeAdapter;
|
134
|
+
pool: AddressLike;
|
135
|
+
outgoingAsset: StandardToken;
|
136
|
+
outgoingAssetAmount?: BigNumberish;
|
137
|
+
incomingAsset: StandardToken;
|
138
|
+
minIncomingAssetAmount?: BigNumberish;
|
139
|
+
}) {
|
140
|
+
const takeOrderArgs = curveTakeOrderArgs({
|
141
|
+
pool,
|
142
|
+
outgoingAsset: outgoingAsset,
|
143
|
+
outgoingAssetAmount: outgoingAssetAmount,
|
144
|
+
incomingAsset: incomingAsset,
|
145
|
+
minIncomingAssetAmount: minIncomingAssetAmount,
|
146
|
+
});
|
147
|
+
|
148
|
+
const callArgs = callOnIntegrationArgs({
|
149
|
+
adapter: curveExchangeAdapter,
|
150
|
+
selector: takeOrderSelector,
|
151
|
+
encodedCallArgs: takeOrderArgs,
|
152
|
+
});
|
153
|
+
|
154
|
+
return comptrollerProxy
|
155
|
+
.connect(fundOwner)
|
156
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
157
|
+
}
|
158
|
+
|
159
|
+
// aave pool
|
160
|
+
|
161
|
+
export function curveAaveClaimRewards({
|
162
|
+
comptrollerProxy,
|
163
|
+
integrationManager,
|
164
|
+
fundOwner,
|
165
|
+
curveLiquidityAaveAdapter,
|
166
|
+
}: {
|
167
|
+
comptrollerProxy: ComptrollerLib;
|
168
|
+
integrationManager: IntegrationManager;
|
169
|
+
fundOwner: SignerWithAddress;
|
170
|
+
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
171
|
+
}) {
|
172
|
+
const callArgs = callOnIntegrationArgs({
|
173
|
+
adapter: curveLiquidityAaveAdapter,
|
174
|
+
selector: claimRewardsSelector,
|
175
|
+
encodedCallArgs: constants.HashZero,
|
176
|
+
});
|
177
|
+
|
178
|
+
return comptrollerProxy
|
179
|
+
.connect(fundOwner)
|
180
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
181
|
+
}
|
182
|
+
|
183
|
+
export function curveAaveClaimRewardsAndReinvest({
|
184
|
+
comptrollerProxy,
|
185
|
+
integrationManager,
|
186
|
+
fundOwner,
|
187
|
+
curveLiquidityAaveAdapter,
|
188
|
+
useFullBalances,
|
189
|
+
minIncomingLiquidityGaugeTokenAmount = BigNumber.from(1),
|
190
|
+
intermediaryUnderlyingAssetIndex = CurveAavePoolAssetIndex.AaveDai,
|
191
|
+
}: {
|
192
|
+
comptrollerProxy: ComptrollerLib;
|
193
|
+
integrationManager: IntegrationManager;
|
194
|
+
fundOwner: SignerWithAddress;
|
195
|
+
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
196
|
+
useFullBalances: boolean;
|
197
|
+
minIncomingLiquidityGaugeTokenAmount?: BigNumberish;
|
198
|
+
intermediaryUnderlyingAssetIndex?: CurveAavePoolAssetIndex;
|
199
|
+
}) {
|
200
|
+
const callArgs = callOnIntegrationArgs({
|
201
|
+
adapter: curveLiquidityAaveAdapter,
|
202
|
+
selector: claimRewardsAndReinvestSelector,
|
203
|
+
encodedCallArgs: curveAaveClaimRewardsAndReinvestArgs({
|
204
|
+
useFullBalances,
|
205
|
+
minIncomingLiquidityGaugeTokenAmount,
|
206
|
+
intermediaryUnderlyingAssetIndex,
|
207
|
+
}),
|
208
|
+
});
|
209
|
+
|
210
|
+
return comptrollerProxy
|
211
|
+
.connect(fundOwner)
|
212
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
213
|
+
}
|
214
|
+
|
215
|
+
export function curveAaveClaimRewardsAndSwap({
|
216
|
+
comptrollerProxy,
|
217
|
+
integrationManager,
|
218
|
+
fundOwner,
|
219
|
+
curveLiquidityAaveAdapter,
|
220
|
+
useFullBalances,
|
221
|
+
incomingAsset,
|
222
|
+
minIncomingAssetAmount = BigNumber.from(1),
|
223
|
+
}: {
|
224
|
+
comptrollerProxy: ComptrollerLib;
|
225
|
+
integrationManager: IntegrationManager;
|
226
|
+
fundOwner: SignerWithAddress;
|
227
|
+
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
228
|
+
useFullBalances: boolean;
|
229
|
+
incomingAsset: AddressLike;
|
230
|
+
minIncomingAssetAmount?: BigNumberish;
|
231
|
+
}) {
|
232
|
+
const callArgs = callOnIntegrationArgs({
|
233
|
+
adapter: curveLiquidityAaveAdapter,
|
234
|
+
selector: claimRewardsAndSwapSelector,
|
235
|
+
encodedCallArgs: curveAaveClaimRewardsAndSwapArgs({
|
236
|
+
useFullBalances,
|
237
|
+
incomingAsset,
|
238
|
+
minIncomingAssetAmount,
|
239
|
+
}),
|
240
|
+
});
|
241
|
+
|
242
|
+
return comptrollerProxy
|
243
|
+
.connect(fundOwner)
|
244
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
245
|
+
}
|
246
|
+
|
247
|
+
export function curveAaveLend({
|
248
|
+
comptrollerProxy,
|
249
|
+
integrationManager,
|
250
|
+
fundOwner,
|
251
|
+
curveLiquidityAaveAdapter,
|
252
|
+
outgoingAaveDaiAmount = BigNumber.from(0),
|
253
|
+
outgoingAaveUsdcAmount = BigNumber.from(0),
|
254
|
+
outgoingAaveUsdtAmount = BigNumber.from(0),
|
255
|
+
minIncomingLPTokenAmount = BigNumber.from(1),
|
256
|
+
useUnderlyings = false,
|
257
|
+
}: {
|
258
|
+
comptrollerProxy: ComptrollerLib;
|
259
|
+
integrationManager: IntegrationManager;
|
260
|
+
fundOwner: SignerWithAddress;
|
261
|
+
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
262
|
+
outgoingAaveDaiAmount?: BigNumberish;
|
263
|
+
outgoingAaveUsdcAmount?: BigNumberish;
|
264
|
+
outgoingAaveUsdtAmount?: BigNumberish;
|
265
|
+
minIncomingLPTokenAmount?: BigNumberish;
|
266
|
+
useUnderlyings?: boolean;
|
267
|
+
}) {
|
268
|
+
const callArgs = callOnIntegrationArgs({
|
269
|
+
adapter: curveLiquidityAaveAdapter,
|
270
|
+
selector: lendSelector,
|
271
|
+
encodedCallArgs: curveAaveLendArgs({
|
272
|
+
outgoingAaveDaiAmount,
|
273
|
+
outgoingAaveUsdcAmount,
|
274
|
+
outgoingAaveUsdtAmount,
|
275
|
+
minIncomingLPTokenAmount,
|
276
|
+
useUnderlyings,
|
277
|
+
}),
|
278
|
+
});
|
279
|
+
|
280
|
+
return comptrollerProxy
|
281
|
+
.connect(fundOwner)
|
282
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
283
|
+
}
|
284
|
+
|
285
|
+
export function curveAaveLendAndStake({
|
286
|
+
comptrollerProxy,
|
287
|
+
integrationManager,
|
288
|
+
fundOwner,
|
289
|
+
curveLiquidityAaveAdapter,
|
290
|
+
outgoingAaveDaiAmount = BigNumber.from(0),
|
291
|
+
outgoingAaveUsdcAmount = BigNumber.from(0),
|
292
|
+
outgoingAaveUsdtAmount = BigNumber.from(0),
|
293
|
+
minIncomingLiquidityGaugeTokenAmount = BigNumber.from(1),
|
294
|
+
useUnderlyings = false,
|
295
|
+
}: {
|
296
|
+
comptrollerProxy: ComptrollerLib;
|
297
|
+
integrationManager: IntegrationManager;
|
298
|
+
fundOwner: SignerWithAddress;
|
299
|
+
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
300
|
+
outgoingAaveDaiAmount?: BigNumberish;
|
301
|
+
outgoingAaveUsdcAmount?: BigNumberish;
|
302
|
+
outgoingAaveUsdtAmount?: BigNumberish;
|
303
|
+
minIncomingLiquidityGaugeTokenAmount?: BigNumberish;
|
304
|
+
useUnderlyings?: boolean;
|
305
|
+
}) {
|
306
|
+
const callArgs = callOnIntegrationArgs({
|
307
|
+
adapter: curveLiquidityAaveAdapter,
|
308
|
+
selector: lendAndStakeSelector,
|
309
|
+
encodedCallArgs: curveAaveLendAndStakeArgs({
|
310
|
+
outgoingAaveDaiAmount,
|
311
|
+
outgoingAaveUsdcAmount,
|
312
|
+
outgoingAaveUsdtAmount,
|
313
|
+
minIncomingLiquidityGaugeTokenAmount,
|
314
|
+
useUnderlyings,
|
315
|
+
}),
|
316
|
+
});
|
317
|
+
|
318
|
+
return comptrollerProxy
|
319
|
+
.connect(fundOwner)
|
320
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
321
|
+
}
|
322
|
+
|
323
|
+
export function curveAaveRedeem({
|
324
|
+
comptrollerProxy,
|
325
|
+
integrationManager,
|
326
|
+
fundOwner,
|
327
|
+
curveLiquidityAaveAdapter,
|
328
|
+
outgoingLPTokenAmount,
|
329
|
+
minIncomingAaveDaiAmount = BigNumber.from(1),
|
330
|
+
minIncomingAaveUsdcAmount = BigNumber.from(1),
|
331
|
+
minIncomingAaveUsdtAmount = BigNumber.from(1),
|
332
|
+
receiveSingleAsset = false,
|
333
|
+
useUnderlyings = false,
|
334
|
+
}: {
|
335
|
+
comptrollerProxy: ComptrollerLib;
|
336
|
+
integrationManager: IntegrationManager;
|
337
|
+
fundOwner: SignerWithAddress;
|
338
|
+
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
339
|
+
outgoingLPTokenAmount: BigNumberish;
|
340
|
+
minIncomingAaveDaiAmount?: BigNumberish;
|
341
|
+
minIncomingAaveUsdcAmount?: BigNumberish;
|
342
|
+
minIncomingAaveUsdtAmount?: BigNumberish;
|
343
|
+
receiveSingleAsset?: boolean;
|
344
|
+
useUnderlyings?: boolean;
|
345
|
+
}) {
|
346
|
+
const callArgs = callOnIntegrationArgs({
|
347
|
+
adapter: curveLiquidityAaveAdapter,
|
348
|
+
selector: redeemSelector,
|
349
|
+
encodedCallArgs: curveAaveRedeemArgs({
|
350
|
+
outgoingLPTokenAmount,
|
351
|
+
minIncomingAaveDaiAmount,
|
352
|
+
minIncomingAaveUsdcAmount,
|
353
|
+
minIncomingAaveUsdtAmount,
|
354
|
+
receiveSingleAsset,
|
355
|
+
useUnderlyings,
|
356
|
+
}),
|
357
|
+
});
|
358
|
+
|
359
|
+
return comptrollerProxy
|
360
|
+
.connect(fundOwner)
|
361
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
362
|
+
}
|
363
|
+
|
364
|
+
export function curveAaveStake({
|
365
|
+
comptrollerProxy,
|
366
|
+
integrationManager,
|
367
|
+
fundOwner,
|
368
|
+
curveLiquidityAaveAdapter,
|
369
|
+
outgoingLPTokenAmount,
|
370
|
+
}: {
|
371
|
+
comptrollerProxy: ComptrollerLib;
|
372
|
+
integrationManager: IntegrationManager;
|
373
|
+
fundOwner: SignerWithAddress;
|
374
|
+
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
375
|
+
outgoingLPTokenAmount: BigNumberish;
|
376
|
+
}) {
|
377
|
+
const callArgs = callOnIntegrationArgs({
|
378
|
+
adapter: curveLiquidityAaveAdapter,
|
379
|
+
selector: stakeSelector,
|
380
|
+
encodedCallArgs: curveAaveStakeArgs({
|
381
|
+
outgoingLPTokenAmount,
|
382
|
+
}),
|
383
|
+
});
|
384
|
+
|
385
|
+
return comptrollerProxy
|
386
|
+
.connect(fundOwner)
|
387
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
388
|
+
}
|
389
|
+
|
390
|
+
export function curveAaveUnstakeAndRedeem({
|
391
|
+
comptrollerProxy,
|
392
|
+
integrationManager,
|
393
|
+
fundOwner,
|
394
|
+
curveLiquidityAaveAdapter,
|
395
|
+
outgoingLiquidityGaugeTokenAmount,
|
396
|
+
minIncomingAaveDaiAmount = BigNumber.from(1),
|
397
|
+
minIncomingAaveUsdcAmount = BigNumber.from(1),
|
398
|
+
minIncomingAaveUsdtAmount = BigNumber.from(1),
|
399
|
+
receiveSingleAsset = false,
|
400
|
+
useUnderlyings = false,
|
401
|
+
}: {
|
402
|
+
comptrollerProxy: ComptrollerLib;
|
403
|
+
integrationManager: IntegrationManager;
|
404
|
+
fundOwner: SignerWithAddress;
|
405
|
+
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
406
|
+
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
407
|
+
minIncomingAaveDaiAmount?: BigNumberish;
|
408
|
+
minIncomingAaveUsdcAmount?: BigNumberish;
|
409
|
+
minIncomingAaveUsdtAmount?: BigNumberish;
|
410
|
+
receiveSingleAsset?: boolean;
|
411
|
+
useUnderlyings?: boolean;
|
412
|
+
}) {
|
413
|
+
const callArgs = callOnIntegrationArgs({
|
414
|
+
adapter: curveLiquidityAaveAdapter,
|
415
|
+
selector: unstakeAndRedeemSelector,
|
416
|
+
encodedCallArgs: curveAaveUnstakeAndRedeemArgs({
|
417
|
+
outgoingLiquidityGaugeTokenAmount,
|
418
|
+
minIncomingAaveDaiAmount,
|
419
|
+
minIncomingAaveUsdcAmount,
|
420
|
+
minIncomingAaveUsdtAmount,
|
421
|
+
receiveSingleAsset,
|
422
|
+
useUnderlyings,
|
423
|
+
}),
|
424
|
+
});
|
425
|
+
|
426
|
+
return comptrollerProxy
|
427
|
+
.connect(fundOwner)
|
428
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
429
|
+
}
|
430
|
+
|
431
|
+
export function curveAaveUnstake({
|
432
|
+
comptrollerProxy,
|
433
|
+
integrationManager,
|
434
|
+
fundOwner,
|
435
|
+
curveLiquidityAaveAdapter,
|
436
|
+
outgoingLiquidityGaugeTokenAmount,
|
437
|
+
}: {
|
438
|
+
comptrollerProxy: ComptrollerLib;
|
439
|
+
integrationManager: IntegrationManager;
|
440
|
+
fundOwner: SignerWithAddress;
|
441
|
+
curveLiquidityAaveAdapter: CurveLiquidityAaveAdapter;
|
442
|
+
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
443
|
+
}) {
|
444
|
+
const callArgs = callOnIntegrationArgs({
|
445
|
+
adapter: curveLiquidityAaveAdapter,
|
446
|
+
selector: unstakeSelector,
|
447
|
+
encodedCallArgs: curveAaveUnstakeArgs({
|
448
|
+
outgoingLiquidityGaugeTokenAmount,
|
449
|
+
}),
|
450
|
+
});
|
451
|
+
|
452
|
+
return comptrollerProxy
|
453
|
+
.connect(fundOwner)
|
454
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
455
|
+
}
|
456
|
+
|
457
|
+
// eurs pool
|
458
|
+
|
459
|
+
export function curveEursClaimRewards({
|
460
|
+
comptrollerProxy,
|
461
|
+
integrationManager,
|
462
|
+
fundOwner,
|
463
|
+
curveLiquidityEursAdapter,
|
464
|
+
}: {
|
465
|
+
comptrollerProxy: ComptrollerLib;
|
466
|
+
integrationManager: IntegrationManager;
|
467
|
+
fundOwner: SignerWithAddress;
|
468
|
+
curveLiquidityEursAdapter: CurveLiquidityEursAdapter;
|
469
|
+
}) {
|
470
|
+
const callArgs = callOnIntegrationArgs({
|
471
|
+
adapter: curveLiquidityEursAdapter,
|
472
|
+
selector: claimRewardsSelector,
|
473
|
+
encodedCallArgs: constants.HashZero,
|
474
|
+
});
|
475
|
+
|
476
|
+
return comptrollerProxy
|
477
|
+
.connect(fundOwner)
|
478
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
479
|
+
}
|
480
|
+
|
481
|
+
export function curveEursLend({
|
482
|
+
comptrollerProxy,
|
483
|
+
integrationManager,
|
484
|
+
fundOwner,
|
485
|
+
curveLiquidityEursAdapter,
|
486
|
+
outgoingEursAmount,
|
487
|
+
outgoingSeurAmount,
|
488
|
+
minIncomingLPTokenAmount,
|
489
|
+
}: {
|
490
|
+
comptrollerProxy: ComptrollerLib;
|
491
|
+
integrationManager: IntegrationManager;
|
492
|
+
fundOwner: SignerWithAddress;
|
493
|
+
curveLiquidityEursAdapter: CurveLiquidityEursAdapter;
|
494
|
+
outgoingEursAmount: BigNumberish;
|
495
|
+
outgoingSeurAmount: BigNumberish;
|
496
|
+
minIncomingLPTokenAmount: BigNumberish;
|
497
|
+
}) {
|
498
|
+
const callArgs = callOnIntegrationArgs({
|
499
|
+
adapter: curveLiquidityEursAdapter,
|
500
|
+
selector: lendSelector,
|
501
|
+
encodedCallArgs: curveEursLendArgs({
|
502
|
+
outgoingEursAmount,
|
503
|
+
outgoingSeurAmount,
|
504
|
+
minIncomingLPTokenAmount,
|
505
|
+
}),
|
506
|
+
});
|
507
|
+
|
508
|
+
return comptrollerProxy
|
509
|
+
.connect(fundOwner)
|
510
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
511
|
+
}
|
512
|
+
|
513
|
+
export function curveEursLendAndStake({
|
514
|
+
comptrollerProxy,
|
515
|
+
integrationManager,
|
516
|
+
fundOwner,
|
517
|
+
curveLiquidityEursAdapter,
|
518
|
+
outgoingEursAmount,
|
519
|
+
outgoingSeurAmount,
|
520
|
+
minIncomingLiquidityGaugeTokenAmount,
|
521
|
+
}: {
|
522
|
+
comptrollerProxy: ComptrollerLib;
|
523
|
+
integrationManager: IntegrationManager;
|
524
|
+
fundOwner: SignerWithAddress;
|
525
|
+
curveLiquidityEursAdapter: CurveLiquidityEursAdapter;
|
526
|
+
outgoingEursAmount: BigNumberish;
|
527
|
+
outgoingSeurAmount: BigNumberish;
|
528
|
+
minIncomingLiquidityGaugeTokenAmount: BigNumberish;
|
529
|
+
}) {
|
530
|
+
const callArgs = callOnIntegrationArgs({
|
531
|
+
adapter: curveLiquidityEursAdapter,
|
532
|
+
selector: lendAndStakeSelector,
|
533
|
+
encodedCallArgs: curveEursLendAndStakeArgs({
|
534
|
+
outgoingEursAmount,
|
535
|
+
outgoingSeurAmount,
|
536
|
+
minIncomingLiquidityGaugeTokenAmount,
|
537
|
+
}),
|
538
|
+
});
|
539
|
+
|
540
|
+
return comptrollerProxy
|
541
|
+
.connect(fundOwner)
|
542
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
543
|
+
}
|
544
|
+
|
545
|
+
export function curveEursRedeem({
|
546
|
+
comptrollerProxy,
|
547
|
+
integrationManager,
|
548
|
+
fundOwner,
|
549
|
+
curveLiquidityEursAdapter,
|
550
|
+
outgoingLPTokenAmount,
|
551
|
+
minIncomingEursAmount,
|
552
|
+
minIncomingSeurAmount,
|
553
|
+
receiveSingleAsset,
|
554
|
+
}: {
|
555
|
+
comptrollerProxy: ComptrollerLib;
|
556
|
+
integrationManager: IntegrationManager;
|
557
|
+
fundOwner: SignerWithAddress;
|
558
|
+
curveLiquidityEursAdapter: CurveLiquidityEursAdapter;
|
559
|
+
outgoingLPTokenAmount: BigNumberish;
|
560
|
+
minIncomingEursAmount: BigNumberish;
|
561
|
+
minIncomingSeurAmount: BigNumberish;
|
562
|
+
receiveSingleAsset: boolean;
|
563
|
+
}) {
|
564
|
+
const callArgs = callOnIntegrationArgs({
|
565
|
+
adapter: curveLiquidityEursAdapter,
|
566
|
+
selector: redeemSelector,
|
567
|
+
encodedCallArgs: curveEursRedeemArgs({
|
568
|
+
outgoingLPTokenAmount,
|
569
|
+
minIncomingEursAmount,
|
570
|
+
minIncomingSeurAmount,
|
571
|
+
receiveSingleAsset,
|
572
|
+
}),
|
573
|
+
});
|
574
|
+
|
575
|
+
return comptrollerProxy
|
576
|
+
.connect(fundOwner)
|
577
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
578
|
+
}
|
579
|
+
|
580
|
+
export function curveEursStake({
|
581
|
+
comptrollerProxy,
|
582
|
+
integrationManager,
|
583
|
+
fundOwner,
|
584
|
+
curveLiquidityEursAdapter,
|
585
|
+
outgoingLPTokenAmount,
|
586
|
+
}: {
|
587
|
+
comptrollerProxy: ComptrollerLib;
|
588
|
+
integrationManager: IntegrationManager;
|
589
|
+
fundOwner: SignerWithAddress;
|
590
|
+
curveLiquidityEursAdapter: CurveLiquidityEursAdapter;
|
591
|
+
outgoingLPTokenAmount: BigNumberish;
|
592
|
+
}) {
|
593
|
+
const callArgs = callOnIntegrationArgs({
|
594
|
+
adapter: curveLiquidityEursAdapter,
|
595
|
+
selector: stakeSelector,
|
596
|
+
encodedCallArgs: curveEursStakeArgs({
|
597
|
+
outgoingLPTokenAmount,
|
598
|
+
}),
|
599
|
+
});
|
600
|
+
|
601
|
+
return comptrollerProxy
|
602
|
+
.connect(fundOwner)
|
603
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
604
|
+
}
|
605
|
+
|
606
|
+
export function curveEursUnstakeAndRedeem({
|
607
|
+
comptrollerProxy,
|
608
|
+
integrationManager,
|
609
|
+
fundOwner,
|
610
|
+
curveLiquidityEursAdapter,
|
611
|
+
outgoingLiquidityGaugeTokenAmount,
|
612
|
+
minIncomingEursAmount,
|
613
|
+
minIncomingSeurAmount,
|
614
|
+
receiveSingleAsset,
|
615
|
+
}: {
|
616
|
+
comptrollerProxy: ComptrollerLib;
|
617
|
+
integrationManager: IntegrationManager;
|
618
|
+
fundOwner: SignerWithAddress;
|
619
|
+
curveLiquidityEursAdapter: CurveLiquidityEursAdapter;
|
620
|
+
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
621
|
+
minIncomingEursAmount: BigNumberish;
|
622
|
+
minIncomingSeurAmount: BigNumberish;
|
623
|
+
receiveSingleAsset: boolean;
|
624
|
+
}) {
|
625
|
+
const callArgs = callOnIntegrationArgs({
|
626
|
+
adapter: curveLiquidityEursAdapter,
|
627
|
+
selector: unstakeAndRedeemSelector,
|
628
|
+
encodedCallArgs: curveEursUnstakeAndRedeemArgs({
|
629
|
+
outgoingLiquidityGaugeTokenAmount,
|
630
|
+
minIncomingEursAmount,
|
631
|
+
minIncomingSeurAmount,
|
632
|
+
receiveSingleAsset,
|
633
|
+
}),
|
634
|
+
});
|
635
|
+
|
636
|
+
return comptrollerProxy
|
637
|
+
.connect(fundOwner)
|
638
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
639
|
+
}
|
640
|
+
|
641
|
+
export function curveEursUnstake({
|
642
|
+
comptrollerProxy,
|
643
|
+
integrationManager,
|
644
|
+
fundOwner,
|
645
|
+
curveLiquidityEursAdapter,
|
646
|
+
outgoingLiquidityGaugeTokenAmount,
|
647
|
+
}: {
|
648
|
+
comptrollerProxy: ComptrollerLib;
|
649
|
+
integrationManager: IntegrationManager;
|
650
|
+
fundOwner: SignerWithAddress;
|
651
|
+
curveLiquidityEursAdapter: CurveLiquidityEursAdapter;
|
652
|
+
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
653
|
+
}) {
|
654
|
+
const callArgs = callOnIntegrationArgs({
|
655
|
+
adapter: curveLiquidityEursAdapter,
|
656
|
+
selector: unstakeSelector,
|
657
|
+
encodedCallArgs: curveEursUnstakeArgs({
|
658
|
+
outgoingLiquidityGaugeTokenAmount,
|
659
|
+
}),
|
660
|
+
});
|
661
|
+
|
662
|
+
return comptrollerProxy
|
663
|
+
.connect(fundOwner)
|
664
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
665
|
+
}
|
666
|
+
|
667
|
+
// sETH pool
|
668
|
+
|
669
|
+
export function curveSethClaimRewards({
|
670
|
+
comptrollerProxy,
|
671
|
+
integrationManager,
|
672
|
+
fundOwner,
|
673
|
+
curveLiquiditySethAdapter,
|
674
|
+
}: {
|
675
|
+
comptrollerProxy: ComptrollerLib;
|
676
|
+
integrationManager: IntegrationManager;
|
677
|
+
fundOwner: SignerWithAddress;
|
678
|
+
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
679
|
+
}) {
|
680
|
+
const callArgs = callOnIntegrationArgs({
|
681
|
+
adapter: curveLiquiditySethAdapter,
|
682
|
+
selector: claimRewardsSelector,
|
683
|
+
encodedCallArgs: constants.HashZero,
|
684
|
+
});
|
685
|
+
|
686
|
+
return comptrollerProxy
|
687
|
+
.connect(fundOwner)
|
688
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
689
|
+
}
|
690
|
+
|
691
|
+
export function curveSethClaimRewardsAndReinvest({
|
692
|
+
comptrollerProxy,
|
693
|
+
integrationManager,
|
694
|
+
fundOwner,
|
695
|
+
curveLiquiditySethAdapter,
|
696
|
+
useFullBalances,
|
697
|
+
minIncomingLiquidityGaugeTokenAmount = BigNumber.from(1),
|
698
|
+
}: {
|
699
|
+
comptrollerProxy: ComptrollerLib;
|
700
|
+
integrationManager: IntegrationManager;
|
701
|
+
fundOwner: SignerWithAddress;
|
702
|
+
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
703
|
+
useFullBalances: boolean;
|
704
|
+
minIncomingLiquidityGaugeTokenAmount?: BigNumberish;
|
705
|
+
}) {
|
706
|
+
const callArgs = callOnIntegrationArgs({
|
707
|
+
adapter: curveLiquiditySethAdapter,
|
708
|
+
selector: claimRewardsAndReinvestSelector,
|
709
|
+
encodedCallArgs: curveSethClaimRewardsAndReinvestArgs({
|
710
|
+
useFullBalances,
|
711
|
+
minIncomingLiquidityGaugeTokenAmount,
|
712
|
+
}),
|
713
|
+
});
|
714
|
+
|
715
|
+
return comptrollerProxy
|
716
|
+
.connect(fundOwner)
|
717
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
718
|
+
}
|
719
|
+
|
720
|
+
export function curveSethClaimRewardsAndSwap({
|
721
|
+
comptrollerProxy,
|
722
|
+
integrationManager,
|
723
|
+
fundOwner,
|
724
|
+
curveLiquiditySethAdapter,
|
725
|
+
useFullBalances,
|
726
|
+
incomingAsset,
|
727
|
+
minIncomingAssetAmount = BigNumber.from(1),
|
728
|
+
}: {
|
729
|
+
comptrollerProxy: ComptrollerLib;
|
730
|
+
integrationManager: IntegrationManager;
|
731
|
+
fundOwner: SignerWithAddress;
|
732
|
+
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
733
|
+
useFullBalances: boolean;
|
734
|
+
incomingAsset: AddressLike;
|
735
|
+
minIncomingAssetAmount?: BigNumberish;
|
736
|
+
}) {
|
737
|
+
const callArgs = callOnIntegrationArgs({
|
738
|
+
adapter: curveLiquiditySethAdapter,
|
739
|
+
selector: claimRewardsAndSwapSelector,
|
740
|
+
encodedCallArgs: curveSethClaimRewardsAndSwapArgs({
|
741
|
+
useFullBalances,
|
742
|
+
incomingAsset,
|
743
|
+
minIncomingAssetAmount,
|
744
|
+
}),
|
745
|
+
});
|
746
|
+
|
747
|
+
return comptrollerProxy
|
748
|
+
.connect(fundOwner)
|
749
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
750
|
+
}
|
751
|
+
|
752
|
+
export function curveSethLend({
|
753
|
+
comptrollerProxy,
|
754
|
+
integrationManager,
|
755
|
+
fundOwner,
|
756
|
+
curveLiquiditySethAdapter,
|
757
|
+
outgoingWethAmount,
|
758
|
+
outgoingSethAmount,
|
759
|
+
minIncomingLPTokenAmount,
|
760
|
+
}: {
|
761
|
+
comptrollerProxy: ComptrollerLib;
|
762
|
+
integrationManager: IntegrationManager;
|
763
|
+
fundOwner: SignerWithAddress;
|
764
|
+
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
765
|
+
outgoingWethAmount: BigNumberish;
|
766
|
+
outgoingSethAmount: BigNumberish;
|
767
|
+
minIncomingLPTokenAmount: BigNumberish;
|
768
|
+
}) {
|
769
|
+
const callArgs = callOnIntegrationArgs({
|
770
|
+
adapter: curveLiquiditySethAdapter,
|
771
|
+
selector: lendSelector,
|
772
|
+
encodedCallArgs: curveSethLendArgs({
|
773
|
+
outgoingWethAmount,
|
774
|
+
outgoingSethAmount,
|
775
|
+
minIncomingLPTokenAmount,
|
776
|
+
}),
|
777
|
+
});
|
778
|
+
|
779
|
+
return comptrollerProxy
|
780
|
+
.connect(fundOwner)
|
781
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
782
|
+
}
|
783
|
+
|
784
|
+
export function curveSethLendAndStake({
|
785
|
+
comptrollerProxy,
|
786
|
+
integrationManager,
|
787
|
+
fundOwner,
|
788
|
+
curveLiquiditySethAdapter,
|
789
|
+
outgoingWethAmount,
|
790
|
+
outgoingSethAmount,
|
791
|
+
minIncomingLiquidityGaugeTokenAmount,
|
792
|
+
}: {
|
793
|
+
comptrollerProxy: ComptrollerLib;
|
794
|
+
integrationManager: IntegrationManager;
|
795
|
+
fundOwner: SignerWithAddress;
|
796
|
+
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
797
|
+
outgoingWethAmount: BigNumberish;
|
798
|
+
outgoingSethAmount: BigNumberish;
|
799
|
+
minIncomingLiquidityGaugeTokenAmount: BigNumberish;
|
800
|
+
}) {
|
801
|
+
const callArgs = callOnIntegrationArgs({
|
802
|
+
adapter: curveLiquiditySethAdapter,
|
803
|
+
selector: lendAndStakeSelector,
|
804
|
+
encodedCallArgs: curveSethLendAndStakeArgs({
|
805
|
+
outgoingWethAmount,
|
806
|
+
outgoingSethAmount,
|
807
|
+
minIncomingLiquidityGaugeTokenAmount,
|
808
|
+
}),
|
809
|
+
});
|
810
|
+
|
811
|
+
return comptrollerProxy
|
812
|
+
.connect(fundOwner)
|
813
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
814
|
+
}
|
815
|
+
|
816
|
+
export function curveSethRedeem({
|
817
|
+
comptrollerProxy,
|
818
|
+
integrationManager,
|
819
|
+
fundOwner,
|
820
|
+
curveLiquiditySethAdapter,
|
821
|
+
outgoingLPTokenAmount,
|
822
|
+
minIncomingWethAmount,
|
823
|
+
minIncomingSethAmount,
|
824
|
+
receiveSingleAsset,
|
825
|
+
}: {
|
826
|
+
comptrollerProxy: ComptrollerLib;
|
827
|
+
integrationManager: IntegrationManager;
|
828
|
+
fundOwner: SignerWithAddress;
|
829
|
+
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
830
|
+
outgoingLPTokenAmount: BigNumberish;
|
831
|
+
minIncomingWethAmount: BigNumberish;
|
832
|
+
minIncomingSethAmount: BigNumberish;
|
833
|
+
receiveSingleAsset: boolean;
|
834
|
+
}) {
|
835
|
+
const callArgs = callOnIntegrationArgs({
|
836
|
+
adapter: curveLiquiditySethAdapter,
|
837
|
+
selector: redeemSelector,
|
838
|
+
encodedCallArgs: curveSethRedeemArgs({
|
839
|
+
outgoingLPTokenAmount,
|
840
|
+
minIncomingWethAmount,
|
841
|
+
minIncomingSethAmount,
|
842
|
+
receiveSingleAsset,
|
843
|
+
}),
|
844
|
+
});
|
845
|
+
|
846
|
+
return comptrollerProxy
|
847
|
+
.connect(fundOwner)
|
848
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
849
|
+
}
|
850
|
+
|
851
|
+
export function curveSethStake({
|
852
|
+
comptrollerProxy,
|
853
|
+
integrationManager,
|
854
|
+
fundOwner,
|
855
|
+
curveLiquiditySethAdapter,
|
856
|
+
outgoingLPTokenAmount,
|
857
|
+
}: {
|
858
|
+
comptrollerProxy: ComptrollerLib;
|
859
|
+
integrationManager: IntegrationManager;
|
860
|
+
fundOwner: SignerWithAddress;
|
861
|
+
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
862
|
+
outgoingLPTokenAmount: BigNumberish;
|
863
|
+
}) {
|
864
|
+
const callArgs = callOnIntegrationArgs({
|
865
|
+
adapter: curveLiquiditySethAdapter,
|
866
|
+
selector: stakeSelector,
|
867
|
+
encodedCallArgs: curveSethStakeArgs({
|
868
|
+
outgoingLPTokenAmount,
|
869
|
+
}),
|
870
|
+
});
|
871
|
+
|
872
|
+
return comptrollerProxy
|
873
|
+
.connect(fundOwner)
|
874
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
875
|
+
}
|
876
|
+
|
877
|
+
export function curveSethUnstakeAndRedeem({
|
878
|
+
comptrollerProxy,
|
879
|
+
integrationManager,
|
880
|
+
fundOwner,
|
881
|
+
curveLiquiditySethAdapter,
|
882
|
+
outgoingLiquidityGaugeTokenAmount,
|
883
|
+
minIncomingWethAmount,
|
884
|
+
minIncomingSethAmount,
|
885
|
+
receiveSingleAsset,
|
886
|
+
}: {
|
887
|
+
comptrollerProxy: ComptrollerLib;
|
888
|
+
integrationManager: IntegrationManager;
|
889
|
+
fundOwner: SignerWithAddress;
|
890
|
+
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
891
|
+
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
892
|
+
minIncomingWethAmount: BigNumberish;
|
893
|
+
minIncomingSethAmount: BigNumberish;
|
894
|
+
receiveSingleAsset: boolean;
|
895
|
+
}) {
|
896
|
+
const callArgs = callOnIntegrationArgs({
|
897
|
+
adapter: curveLiquiditySethAdapter,
|
898
|
+
selector: unstakeAndRedeemSelector,
|
899
|
+
encodedCallArgs: curveSethUnstakeAndRedeemArgs({
|
900
|
+
outgoingLiquidityGaugeTokenAmount,
|
901
|
+
minIncomingWethAmount,
|
902
|
+
minIncomingSethAmount,
|
903
|
+
receiveSingleAsset,
|
904
|
+
}),
|
905
|
+
});
|
906
|
+
|
907
|
+
return comptrollerProxy
|
908
|
+
.connect(fundOwner)
|
909
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
910
|
+
}
|
911
|
+
|
912
|
+
export function curveSethUnstake({
|
913
|
+
comptrollerProxy,
|
914
|
+
integrationManager,
|
915
|
+
fundOwner,
|
916
|
+
curveLiquiditySethAdapter,
|
917
|
+
outgoingLiquidityGaugeTokenAmount,
|
918
|
+
}: {
|
919
|
+
comptrollerProxy: ComptrollerLib;
|
920
|
+
integrationManager: IntegrationManager;
|
921
|
+
fundOwner: SignerWithAddress;
|
922
|
+
curveLiquiditySethAdapter: CurveLiquiditySethAdapter;
|
923
|
+
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
924
|
+
}) {
|
925
|
+
const callArgs = callOnIntegrationArgs({
|
926
|
+
adapter: curveLiquiditySethAdapter,
|
927
|
+
selector: unstakeSelector,
|
928
|
+
encodedCallArgs: curveSethUnstakeArgs({
|
929
|
+
outgoingLiquidityGaugeTokenAmount,
|
930
|
+
}),
|
931
|
+
});
|
932
|
+
|
933
|
+
return comptrollerProxy
|
934
|
+
.connect(fundOwner)
|
935
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
936
|
+
}
|
937
|
+
|
938
|
+
// stETH pool
|
939
|
+
|
940
|
+
export function curveStethClaimRewards({
|
941
|
+
comptrollerProxy,
|
942
|
+
integrationManager,
|
943
|
+
fundOwner,
|
944
|
+
curveLiquidityStethAdapter,
|
945
|
+
}: {
|
946
|
+
comptrollerProxy: ComptrollerLib;
|
947
|
+
integrationManager: IntegrationManager;
|
948
|
+
fundOwner: SignerWithAddress;
|
949
|
+
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
950
|
+
}) {
|
951
|
+
const callArgs = callOnIntegrationArgs({
|
952
|
+
adapter: curveLiquidityStethAdapter,
|
953
|
+
selector: claimRewardsSelector,
|
954
|
+
encodedCallArgs: constants.HashZero,
|
955
|
+
});
|
956
|
+
|
957
|
+
return comptrollerProxy
|
958
|
+
.connect(fundOwner)
|
959
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
960
|
+
}
|
961
|
+
|
962
|
+
export function curveStethClaimRewardsAndReinvest({
|
963
|
+
comptrollerProxy,
|
964
|
+
integrationManager,
|
965
|
+
fundOwner,
|
966
|
+
curveLiquidityStethAdapter,
|
967
|
+
useFullBalances,
|
968
|
+
minIncomingLiquidityGaugeTokenAmount = BigNumber.from(1),
|
969
|
+
}: {
|
970
|
+
comptrollerProxy: ComptrollerLib;
|
971
|
+
integrationManager: IntegrationManager;
|
972
|
+
fundOwner: SignerWithAddress;
|
973
|
+
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
974
|
+
useFullBalances: boolean;
|
975
|
+
minIncomingLiquidityGaugeTokenAmount?: BigNumberish;
|
976
|
+
}) {
|
977
|
+
const callArgs = callOnIntegrationArgs({
|
978
|
+
adapter: curveLiquidityStethAdapter,
|
979
|
+
selector: claimRewardsAndReinvestSelector,
|
980
|
+
encodedCallArgs: curveStethClaimRewardsAndReinvestArgs({
|
981
|
+
useFullBalances,
|
982
|
+
minIncomingLiquidityGaugeTokenAmount,
|
983
|
+
}),
|
984
|
+
});
|
985
|
+
|
986
|
+
return comptrollerProxy
|
987
|
+
.connect(fundOwner)
|
988
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
989
|
+
}
|
990
|
+
|
991
|
+
export function curveStethClaimRewardsAndSwap({
|
992
|
+
comptrollerProxy,
|
993
|
+
integrationManager,
|
994
|
+
fundOwner,
|
995
|
+
curveLiquidityStethAdapter,
|
996
|
+
useFullBalances,
|
997
|
+
incomingAsset,
|
998
|
+
minIncomingAssetAmount = BigNumber.from(1),
|
999
|
+
}: {
|
1000
|
+
comptrollerProxy: ComptrollerLib;
|
1001
|
+
integrationManager: IntegrationManager;
|
1002
|
+
fundOwner: SignerWithAddress;
|
1003
|
+
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
1004
|
+
useFullBalances: boolean;
|
1005
|
+
incomingAsset: AddressLike;
|
1006
|
+
minIncomingAssetAmount?: BigNumberish;
|
1007
|
+
}) {
|
1008
|
+
const callArgs = callOnIntegrationArgs({
|
1009
|
+
adapter: curveLiquidityStethAdapter,
|
1010
|
+
selector: claimRewardsAndSwapSelector,
|
1011
|
+
encodedCallArgs: curveStethClaimRewardsAndSwapArgs({
|
1012
|
+
useFullBalances,
|
1013
|
+
incomingAsset,
|
1014
|
+
minIncomingAssetAmount,
|
1015
|
+
}),
|
1016
|
+
});
|
1017
|
+
|
1018
|
+
return comptrollerProxy
|
1019
|
+
.connect(fundOwner)
|
1020
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1021
|
+
}
|
1022
|
+
|
1023
|
+
export function curveStethLend({
|
1024
|
+
comptrollerProxy,
|
1025
|
+
integrationManager,
|
1026
|
+
fundOwner,
|
1027
|
+
curveLiquidityStethAdapter,
|
1028
|
+
outgoingWethAmount,
|
1029
|
+
outgoingStethAmount,
|
1030
|
+
minIncomingLPTokenAmount,
|
1031
|
+
}: {
|
1032
|
+
comptrollerProxy: ComptrollerLib;
|
1033
|
+
integrationManager: IntegrationManager;
|
1034
|
+
fundOwner: SignerWithAddress;
|
1035
|
+
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
1036
|
+
outgoingWethAmount: BigNumberish;
|
1037
|
+
outgoingStethAmount: BigNumberish;
|
1038
|
+
minIncomingLPTokenAmount: BigNumberish;
|
1039
|
+
}) {
|
1040
|
+
const callArgs = callOnIntegrationArgs({
|
1041
|
+
adapter: curveLiquidityStethAdapter,
|
1042
|
+
selector: lendSelector,
|
1043
|
+
encodedCallArgs: curveStethLendArgs({
|
1044
|
+
outgoingWethAmount,
|
1045
|
+
outgoingStethAmount,
|
1046
|
+
minIncomingLPTokenAmount,
|
1047
|
+
}),
|
1048
|
+
});
|
1049
|
+
|
1050
|
+
return comptrollerProxy
|
1051
|
+
.connect(fundOwner)
|
1052
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1053
|
+
}
|
1054
|
+
|
1055
|
+
export function curveStethLendAndStake({
|
1056
|
+
comptrollerProxy,
|
1057
|
+
integrationManager,
|
1058
|
+
fundOwner,
|
1059
|
+
curveLiquidityStethAdapter,
|
1060
|
+
outgoingWethAmount,
|
1061
|
+
outgoingStethAmount,
|
1062
|
+
minIncomingLiquidityGaugeTokenAmount,
|
1063
|
+
}: {
|
1064
|
+
comptrollerProxy: ComptrollerLib;
|
1065
|
+
integrationManager: IntegrationManager;
|
1066
|
+
fundOwner: SignerWithAddress;
|
1067
|
+
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
1068
|
+
outgoingWethAmount: BigNumberish;
|
1069
|
+
outgoingStethAmount: BigNumberish;
|
1070
|
+
minIncomingLiquidityGaugeTokenAmount: BigNumberish;
|
1071
|
+
}) {
|
1072
|
+
const callArgs = callOnIntegrationArgs({
|
1073
|
+
adapter: curveLiquidityStethAdapter,
|
1074
|
+
selector: lendAndStakeSelector,
|
1075
|
+
encodedCallArgs: curveStethLendAndStakeArgs({
|
1076
|
+
outgoingWethAmount,
|
1077
|
+
outgoingStethAmount,
|
1078
|
+
minIncomingLiquidityGaugeTokenAmount,
|
1079
|
+
}),
|
1080
|
+
});
|
1081
|
+
|
1082
|
+
return comptrollerProxy
|
1083
|
+
.connect(fundOwner)
|
1084
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1085
|
+
}
|
1086
|
+
|
1087
|
+
export function curveStethRedeem({
|
1088
|
+
comptrollerProxy,
|
1089
|
+
integrationManager,
|
1090
|
+
fundOwner,
|
1091
|
+
curveLiquidityStethAdapter,
|
1092
|
+
outgoingLPTokenAmount,
|
1093
|
+
minIncomingWethAmount,
|
1094
|
+
minIncomingStethAmount,
|
1095
|
+
receiveSingleAsset,
|
1096
|
+
}: {
|
1097
|
+
comptrollerProxy: ComptrollerLib;
|
1098
|
+
integrationManager: IntegrationManager;
|
1099
|
+
fundOwner: SignerWithAddress;
|
1100
|
+
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
1101
|
+
outgoingLPTokenAmount: BigNumberish;
|
1102
|
+
minIncomingWethAmount: BigNumberish;
|
1103
|
+
minIncomingStethAmount: BigNumberish;
|
1104
|
+
receiveSingleAsset: boolean;
|
1105
|
+
}) {
|
1106
|
+
const callArgs = callOnIntegrationArgs({
|
1107
|
+
adapter: curveLiquidityStethAdapter,
|
1108
|
+
selector: redeemSelector,
|
1109
|
+
encodedCallArgs: curveStethRedeemArgs({
|
1110
|
+
outgoingLPTokenAmount,
|
1111
|
+
minIncomingWethAmount,
|
1112
|
+
minIncomingStethAmount,
|
1113
|
+
receiveSingleAsset,
|
1114
|
+
}),
|
1115
|
+
});
|
1116
|
+
|
1117
|
+
return comptrollerProxy
|
1118
|
+
.connect(fundOwner)
|
1119
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
export function curveStethStake({
|
1123
|
+
comptrollerProxy,
|
1124
|
+
integrationManager,
|
1125
|
+
fundOwner,
|
1126
|
+
curveLiquidityStethAdapter,
|
1127
|
+
outgoingLPTokenAmount,
|
1128
|
+
}: {
|
1129
|
+
comptrollerProxy: ComptrollerLib;
|
1130
|
+
integrationManager: IntegrationManager;
|
1131
|
+
fundOwner: SignerWithAddress;
|
1132
|
+
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
1133
|
+
outgoingLPTokenAmount: BigNumberish;
|
1134
|
+
}) {
|
1135
|
+
const callArgs = callOnIntegrationArgs({
|
1136
|
+
adapter: curveLiquidityStethAdapter,
|
1137
|
+
selector: stakeSelector,
|
1138
|
+
encodedCallArgs: curveStethStakeArgs({
|
1139
|
+
outgoingLPTokenAmount,
|
1140
|
+
}),
|
1141
|
+
});
|
1142
|
+
|
1143
|
+
return comptrollerProxy
|
1144
|
+
.connect(fundOwner)
|
1145
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1146
|
+
}
|
1147
|
+
|
1148
|
+
export function curveStethUnstakeAndRedeem({
|
1149
|
+
comptrollerProxy,
|
1150
|
+
integrationManager,
|
1151
|
+
fundOwner,
|
1152
|
+
curveLiquidityStethAdapter,
|
1153
|
+
outgoingLiquidityGaugeTokenAmount,
|
1154
|
+
minIncomingWethAmount,
|
1155
|
+
minIncomingStethAmount,
|
1156
|
+
receiveSingleAsset,
|
1157
|
+
}: {
|
1158
|
+
comptrollerProxy: ComptrollerLib;
|
1159
|
+
integrationManager: IntegrationManager;
|
1160
|
+
fundOwner: SignerWithAddress;
|
1161
|
+
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
1162
|
+
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
1163
|
+
minIncomingWethAmount: BigNumberish;
|
1164
|
+
minIncomingStethAmount: BigNumberish;
|
1165
|
+
receiveSingleAsset: boolean;
|
1166
|
+
}) {
|
1167
|
+
const callArgs = callOnIntegrationArgs({
|
1168
|
+
adapter: curveLiquidityStethAdapter,
|
1169
|
+
selector: unstakeAndRedeemSelector,
|
1170
|
+
encodedCallArgs: curveStethUnstakeAndRedeemArgs({
|
1171
|
+
outgoingLiquidityGaugeTokenAmount,
|
1172
|
+
minIncomingWethAmount,
|
1173
|
+
minIncomingStethAmount,
|
1174
|
+
receiveSingleAsset,
|
1175
|
+
}),
|
1176
|
+
});
|
1177
|
+
|
1178
|
+
return comptrollerProxy
|
1179
|
+
.connect(fundOwner)
|
1180
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1181
|
+
}
|
1182
|
+
|
1183
|
+
export function curveStethUnstake({
|
1184
|
+
comptrollerProxy,
|
1185
|
+
integrationManager,
|
1186
|
+
fundOwner,
|
1187
|
+
curveLiquidityStethAdapter,
|
1188
|
+
outgoingLiquidityGaugeTokenAmount,
|
1189
|
+
}: {
|
1190
|
+
comptrollerProxy: ComptrollerLib;
|
1191
|
+
integrationManager: IntegrationManager;
|
1192
|
+
fundOwner: SignerWithAddress;
|
1193
|
+
curveLiquidityStethAdapter: CurveLiquidityStethAdapter;
|
1194
|
+
outgoingLiquidityGaugeTokenAmount: BigNumberish;
|
1195
|
+
}) {
|
1196
|
+
const callArgs = callOnIntegrationArgs({
|
1197
|
+
adapter: curveLiquidityStethAdapter,
|
1198
|
+
selector: unstakeSelector,
|
1199
|
+
encodedCallArgs: curveStethUnstakeArgs({
|
1200
|
+
outgoingLiquidityGaugeTokenAmount,
|
1201
|
+
}),
|
1202
|
+
});
|
1203
|
+
|
1204
|
+
return comptrollerProxy
|
1205
|
+
.connect(fundOwner)
|
1206
|
+
.callOnExtension(integrationManager, IntegrationManagerActionId.CallOnIntegration, callArgs);
|
1207
|
+
}
|