Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/base leverage #190

Merged
merged 10 commits into from
Sep 30, 2024
Merged
20 changes: 12 additions & 8 deletions script/deploy/lido/WstETHLooper.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma solidity ^0.8.25;
import {Script, console} from "forge-std/Script.sol";
import {stdJson} from "forge-std/StdJson.sol";

import {WstETHLooper, LooperInitValues, IERC20} from "../../../src/strategies/lido/WstETHLooper.sol";
import {WstETHLooper, LooperValues, LooperBaseValues, IERC20} from "../../../src/strategies/lido/WstETHLooper.sol";

contract Deploy is Script {
using stdJson for string;
Expand All @@ -25,7 +25,15 @@ contract Deploy is Script {
// Deploy Strategy
strategy = new WstETHLooper();

LooperInitValues memory looperValues = abi.decode(json.parseRaw(".strategyInit"), (LooperInitValues));
LooperBaseValues memory baseValues = abi.decode(
json.parseRaw(".baseLeverage"),
(LooperBaseValues)
);

LooperValues memory looperInitValues = abi.decode(
json.parseRaw(".strategy"),
(LooperValues)
);

address asset = json.readAddress(".baseInit.asset");

Expand All @@ -34,12 +42,8 @@ contract Deploy is Script {
json.readAddress(".baseInit.owner"),
json.readBool(".baseInit.autoDeposit"),
abi.encode(
looperValues.aaveDataProvider,
looperValues.curvePool,
looperValues.maxLTV,
looperValues.poolAddressesProvider,
looperValues.slippage,
looperValues.targetLTV
baseValues,
looperInitValues
)
);

Expand Down
9 changes: 6 additions & 3 deletions script/deploy/lido/WstETHLooperDeployConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
"owner": "",
"autoDeposit": false
},
"strategyInit": {
"baseLeverage": {
"aaveDataProvider": "0x7B4EB56E7CD4b454BA8ff71E4518426369a138a3",
"curvePool": "0xDC24316b9AE028F1497c275EB9192a3Ea0f67022",
"borrowAsset": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
"maxLTV": 850000000000000000,
"maxSlippage": 10000000000000000,
"poolAddressesProvider": "0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e",
"slippage": 10000000000000000,
"targetLTV": 800000000000000000
},
"strategy": {
"curvePool": "0xDC24316b9AE028F1497c275EB9192a3Ea0f67022"
}
}
22 changes: 11 additions & 11 deletions script/deploy/stader/EthXLooper.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma solidity ^0.8.25;
import {Script, console} from "forge-std/Script.sol";
import {stdJson} from "forge-std/StdJson.sol";

import {ETHXLooper, LooperInitValues, IERC20} from "../../../src/strategies/stader/ETHxLooper.sol";
import {ETHXLooper, LooperValues, LooperBaseValues, IERC20} from "../../../src/strategies/stader/ETHxLooper.sol";

contract DeployStrategy is Script {
using stdJson for string;
Expand All @@ -25,9 +25,14 @@ contract DeployStrategy is Script {
// Deploy Strategy
strategy = new ETHXLooper();

LooperInitValues memory looperValues = abi.decode(
json.parseRaw(".strategyInit"),
(LooperInitValues)
LooperBaseValues memory baseValues = abi.decode(
json.parseRaw(".baseLeverage"),
(LooperBaseValues)
);

LooperValues memory looperInitValues = abi.decode(
json.parseRaw(".strategy"),
(LooperValues)
);

address asset = json.readAddress(".baseInit.asset");
Expand All @@ -37,13 +42,8 @@ contract DeployStrategy is Script {
json.readAddress(".baseInit.owner"),
json.readBool(".baseInit.autoDeposit"),
abi.encode(
looperValues.aaveDataProvider,
looperValues.curvePool,
looperValues.maxLTV,
looperValues.poolAddressesProvider,
looperValues.slippage,
looperValues.stakingPool,
looperValues.targetLTV
baseValues,
looperInitValues
)
);

Expand Down
13 changes: 8 additions & 5 deletions script/deploy/stader/EthXLooperDeployConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
"owner": "",
"autoDeposit": false
},
"strategyInit": {
"baseLeverage": {
"aaveDataProvider": "0x7B4EB56E7CD4b454BA8ff71E4518426369a138a3",
"curvePool": "0x59ab5a5b5d617e478a2479b0cad80da7e2831492",
"maxLTV": 850000000000000000,
"borrowAsset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"maxLTV": 900000000000000000,
"maxSlippage": 5000000000000000,
"poolAddressesProvider": "0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e",
"slippage": 10000000000000000,
"stakingPool": "0xcf5ea1b38380f6af39068375516daf40ed70d299",
"targetLTV": 800000000000000000
},
"strategy": {
"curvePool": "0x59ab5a5b5d617e478a2479b0cad80da7e2831492",
"stakingPool": "0xcf5ea1b38380f6af39068375516daf40ed70d299"
}
}

23 changes: 11 additions & 12 deletions script/deploy/stader/MaticXLooper.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pragma solidity ^0.8.25;
import {Script, console} from "forge-std/Script.sol";
import {stdJson} from "forge-std/StdJson.sol";

import {MaticXLooper, LooperInitValues, IERC20} from "../../../src/strategies/stader/MaticXLooper.sol";
import {MaticXLooper, LooperValues, LooperBaseValues, IERC20} from "../../../src/strategies/stader/MaticXLooper.sol";

contract DeployStrategy is Script {
using stdJson for string;
Expand All @@ -25,9 +25,14 @@ contract DeployStrategy is Script {
// Deploy Strategy
strategy = new MaticXLooper();

LooperInitValues memory looperValues = abi.decode(
json.parseRaw(".strategyInit"),
(LooperInitValues)
LooperBaseValues memory baseValues = abi.decode(
json.parseRaw(".baseLeverage"),
(LooperBaseValues)
);

LooperValues memory looperInitValues = abi.decode(
json.parseRaw(".strategy"),
(LooperValues)
);

address asset = json.readAddress(".baseInit.asset");
Expand All @@ -37,14 +42,8 @@ contract DeployStrategy is Script {
json.readAddress(".baseInit.owner"),
json.readBool(".baseInit.autoDeposit"),
abi.encode(
looperValues.aaveDataProvider,
looperValues.balancerVault,
looperValues.maticXPool,
looperValues.maxLTV,
looperValues.poolAddressesProvider,
looperValues.poolId,
looperValues.slippage,
looperValues.targetLTV
baseValues,
looperInitValues
)
);

Expand Down
17 changes: 10 additions & 7 deletions script/deploy/stader/MaticXLooperDeployConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
"owner": "",
"autoDeposit": false
},
"strategyInit": {
"baseLeverage": {
"aaveDataProvider": "0x7deEB8aCE4220643D8edeC871a23807E4d006eE5",
"balancerVault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8",
"maticXPool": "0xfd225C9e6601C9d38d8F98d8731BF59eFcF8C0E3",
"maxLTV": 850000000000000000,
"borrowAsset": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
"maxLTV": 900000000000000000,
"maxSlippage": 5000000000000000,
"poolAddressesProvider": "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb",
"poolId": "0xcd78a20c597e367a4e478a2411ceb790604d7c8f000000000000000000000c22",
"slippage": 10000000000000000,
"targetLTV": 800000000000000000
},
"strategy": {
"balancerVault": "0xBA12222222228d8Ba445958a75a0704d566BF2C8",
"maticXPool": "0xfd225C9e6601C9d38d8F98d8731BF59eFcF8C0E3",
"poolId": "0xcd78a20c597e367a4e478a2411ceb790604d7c8f000000000000000000000c22"
}
}
}

Loading
Loading