Skip to content

Commit

Permalink
Merge pull request #699 from Fujicracy/protocol/feat/aave-v3-efficien…
Browse files Browse the repository at this point in the history
…cy-mode

Aave v3 efficiency mode
  • Loading branch information
0xdcota committed Aug 14, 2023
2 parents 2619873 + ac290f8 commit 8d7691f
Show file tree
Hide file tree
Showing 30 changed files with 634 additions and 503 deletions.
48 changes: 48 additions & 0 deletions packages/protocol/deploy-configs/arbitrum.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"USDT": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
"WSTETH": "0x5979D7b546E38E414F7E9822514be443A4800529",
"RETH": "0xEC70Dcb4A1EFa46b8F2D97C310C9c4790ba5ffA8",
"EURS": "0xD22a58f79e9481D1a88e00c343885A588b34b68B",
"ConnextCore": "0xEE9deC2712cCE65174B561151701Bf54b99C24C8",
"Balancer": "0xBA12222222228d8Ba445958a75a0704d566BF2C8",
"FujiRelayer": "0x65e0ef5d35ccdc55fac1d4e2c6d9e9a196bf5076",
Expand Down Expand Up @@ -184,5 +185,52 @@
"providers": ["DForce_Arbitrum", "Radiant_Arbitrum", "Aave_V3_Arbitrum"],
"rating": 80
}
],
"aavev3-emodes": [
{
"asset" : "USDC",
"debtAsset": "DAI",
"id": 1
},
{
"asset" : "USDC",
"debtAsset": "USDT",
"id": 1
},
{
"asset" : "DAI",
"debtAsset": "USDC",
"id": 1
},
{
"asset" : "DAI",
"debtAsset": "USDT",
"id": 1
},
{
"asset" : "USDT",
"debtAsset": "USDC",
"id": 1
},
{
"asset" : "USDT",
"debtAsset": "DAI",
"id": 1
},
{
"asset" : "USDC",
"debtAsset": "EURS",
"id": 1
},
{
"asset" : "EURS",
"debtAsset": "USDC",
"id": 1
},
{
"asset" : "WSTETH",
"debtAsset": "WETH",
"id": 2
}
]
}
47 changes: 47 additions & 0 deletions packages/protocol/deploy-configs/ethereum.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,5 +268,52 @@
"providers": ["Aave_V3", "Compound_V2", "Aave_V2"],
"rating": 90
}
],
"aavev3-emodes": [
{
"asset" : "WSTETH",
"debtAsset": "WETH",
"id": 1
},
{
"asset" : "CBETH",
"debtAsset": "WETH",
"id": 1
},
{
"asset" : "RETH",
"debtAsset": "WETH",
"id": 1
},
{
"asset" : "WSTETH",
"debtAsset": "CBETH",
"id": 1
},
{
"asset" : "WSTETH",
"debtAsset": "RETH",
"id": 1
},
{
"asset" : "CBETH",
"debtAsset": "WSTETH",
"id": 1
},
{
"asset" : "CBETH",
"debtAsset": "RETH",
"id": 1
},
{
"asset" : "RETH",
"debtAsset": "WSTETH",
"id": 1
},
{
"asset" : "RETH",
"debtAsset": "CBETH",
"id": 1
}
]
}
13 changes: 13 additions & 0 deletions packages/protocol/deploy-configs/goerli.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"WETH": "0xCCB14936C2E000ED8393A571D15A2672537838Ad",
"USDC": "0x65aFADD39029741B3b8f0756952C74678c9cEC93",
"DAI": "0xBa8DCeD3512925e52FE67b1b5329187589072A55",
"ConnextCore": "0xFCa08024A6D4bCc87275b1E4A1E22B71fAD7f649",
"Balancer": "0xBA12222222228d8Ba445958a75a0704d566BF2C8",
"FujiRelayer": "0x4325018916b082B91e277C7165FD8Da6467b71F8",
Expand Down Expand Up @@ -34,6 +35,18 @@
"providers": ["Aave_V3_Goerli"],
"rating": 90
}
],
"aavev3-emodes": [
{
"asset" : "USDC",
"debtAsset": "DAI",
"id": 1
},
{
"asset" : "DAI",
"debtAsset": "USDC",
"id": 1
}
]
}

83 changes: 83 additions & 0 deletions packages/protocol/deploy-configs/optimism.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"USDC": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607",
"DAI": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
"USDT": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
"SUSD": "0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9",
"WSTETH": "0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb",
"RETH": "0x9Bcef72be871e61ED4fBbc7630889beE758eb81D",
"ConnextCore": "0x8f7492DE823025b4CfaAB1D34c58963F2af5DEDA",
Expand Down Expand Up @@ -171,6 +172,88 @@
"providers": ["Aave_V3_Optimism", "DForce_Optimism"],
"rating": 90
}
],
"aavev3-emodes": [
{
"asset" : "USDC",
"debtAsset": "DAI",
"id": 1
},
{
"asset" : "USDC",
"debtAsset": "USDT",
"id": 1
},
{
"asset" : "USDC",
"debtAsset": "SUSD",
"id": 1
},
{
"asset" : "DAI",
"debtAsset": "USDC",
"id": 1
},
{
"asset" : "DAI",
"debtAsset": "USDT",
"id": 1
},
{
"asset" : "DAI",
"debtAsset": "SUSD",
"id": 1
},
{
"asset" : "USDT",
"debtAsset": "USDC",
"id": 1
},
{
"asset" : "USDT",
"debtAsset": "DAI",
"id": 1
},
{
"asset" : "USDT",
"debtAsset": "SUSD",
"id": 1
},
{
"asset" : "SUSD",
"debtAsset": "USDC",
"id": 1
},
{
"asset" : "SUSD",
"debtAsset": "DAI",
"id": 1
},
{
"asset" : "SUSD",
"debtAsset": "USDT",
"id": 1
},
{
"asset" : "WSTETH",
"debtAsset": "WETH",
"id": 2
},
{
"asset" : "RETH",
"debtAsset": "WETH",
"id": 2
},
{
"asset" : "WSTETH",
"debtAsset": "RETH",
"id": 2
},
{
"asset" : "RETH",
"debtAsset": "WSTETH",
"id": 2
}
]

}
Expand Down
53 changes: 53 additions & 0 deletions packages/protocol/deploy-configs/polygon.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"USDT": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
"MATICX": "0xfa68FB4628DFF1028CFEc22b4162FCcd0d45efb6",
"WMATIC": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
"STMATIC": "0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4",
"WSTETH": "0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD",
"ConnextCore": "0x11984dc4465481512eb5b777E44061C158CF2259",
"Balancer": "0xBA12222222228d8Ba445958a75a0704d566BF2C8",
Expand Down Expand Up @@ -162,5 +163,57 @@
"providers": ["DForce_Polygon", "Aave_V2_Polygon", "Aave_V3_Polygon"],
"rating": 85
}
],
"aavev3-emodes": [
{
"asset" : "USDC",
"debtAsset": "DAI",
"id": 1
},
{
"asset" : "USDC",
"debtAsset": "USDT",
"id": 1
},
{
"asset" : "DAI",
"debtAsset": "USDC",
"id": 1
},
{
"asset" : "DAI",
"debtAsset": "USDT",
"id": 1
},
{
"asset" : "USDT",
"debtAsset": "USDC",
"id": 1
},
{
"asset" : "USDT",
"debtAsset": "DAI",
"id": 1
},
{
"asset" : "WSTETH",
"debtAsset": "WETH",
"id": 2
},
{
"asset" : "MATICX",
"debtAsset": "WMATIC",
"id": 3
},
{
"asset" : "STMATIC",
"debtAsset": "WMATIC",
"id": 3
},
{
"asset" : "STMATIC",
"debtAsset": "MATICX",
"id": 3
}
]
}
1 change: 1 addition & 0 deletions packages/protocol/deployments/arbitrum/AaveEModeHelper
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x79Cb8Bc3035e5328498BE0d6CA93A6A56F27a2aE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xa34D2B93ffC304E7D99B1b6bdC28CC2d4F0a58E8
1 change: 1 addition & 0 deletions packages/protocol/deployments/ethereum/AaveEModeHelper
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xb71073364B78Debe996d041Bb340ff4F03Ff23D9
1 change: 1 addition & 0 deletions packages/protocol/deployments/ethereum/Aave_V3_Emode
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xed0A749345BF88bf1b5E706cA51F72b4b784CA93
1 change: 1 addition & 0 deletions packages/protocol/deployments/goerli/AaveEModeHelper
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xA169a53E5C8c36dD1CfeD0Ceb2BcD15026091272
2 changes: 1 addition & 1 deletion packages/protocol/deployments/goerli/Aave_V3_Goerli
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0xfCeb53C781df5451dbfFc4C8E3A95bF289E2Bdb3
0x1fa4f8dcbff685434e221e1ea22744f52c521231
1 change: 1 addition & 0 deletions packages/protocol/deployments/optimism/AaveEModeHelper
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x1085BAa80b2BfB2f0E55822Ce2F547D95aeAe7a4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x0965D634a98BD702A9b7e40DFed7eAbbEea41b0B
1 change: 1 addition & 0 deletions packages/protocol/deployments/polygon/AaveEModeHelper
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x7C5f6331572350DBB4126591c74df9FAC2429fa0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x8D4FF0BA361a9360cAEeba55F10a08F32775587c
5 changes: 3 additions & 2 deletions packages/protocol/script/RunArbitrum.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ contract RunArbitrum is ScriptPlus {
}

function _setLendingProviders() internal {
aaveV3 = AaveV3Arbitrum(getAddress("Aave_V3_Arbitrum"));
aaveV3 = AaveV3Arbitrum(getAddress("Aave_V3_Arbitrum_Emode"));
/*aaveV3 = new AaveV3Arbitrum();*/
/*saveAddress("Aave_V3_Arbitrum", address(aaveV3));*/
/*saveAddress("Aave_V3_Arbitrum_Emode", address(aaveV3));*/
setOrdeployAaveEModeHelper(false);

radiant = RadiantArbitrum(getAddress("Radiant_Arbitrum"));
/*radiant = new RadiantArbitrum();*/
Expand Down
5 changes: 3 additions & 2 deletions packages/protocol/script/RunEthereum.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ contract RunEthereum is ScriptPlus {
/*aaveV2 = new AaveV2();*/
/*saveAddress("Aave_V2", address(aaveV2));*/

aaveV3 = AaveV3(getAddress("Aave_V3"));
aaveV3 = AaveV3(getAddress("Aave_V3_Emode"));
/*aaveV3 = new AaveV3();*/
/*saveAddress("Aave_V3", address(aaveV3));*/
/*saveAddress("Aave_V3_Emode", address(aaveV3));*/
setOrdeployAaveEModeHelper(false);

dforce = DForce(getAddress("DForce"));
/*dforce = new DForce();*/
Expand Down
2 changes: 2 additions & 0 deletions packages/protocol/script/RunGoerli.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ contract RunGoerli is ScriptPlus {
// If setting all routers at once, call after deploying all chians
/*setRouters();*/

// setOrdeployAaveEModeHelper(false);

vm.stopBroadcast();
}

Expand Down
5 changes: 3 additions & 2 deletions packages/protocol/script/RunOptimism.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ contract RunOptimism is ScriptPlus {
}

function _setLendingProviders() internal {
aaveV3 = AaveV3Optimism(getAddress("Aave_V3_Optimism"));
aaveV3 = AaveV3Optimism(getAddress("Aave_V3_Optimism_Emode"));
/*aaveV3 = new AaveV3Optimism();*/
/*saveAddress("Aave_V3_Optimism", address(aaveV3));*/
/*saveAddress("Aave_V3_Optimism_Emode", address(aaveV3));*/
setOrdeployAaveEModeHelper(false);

dforce = DForceOptimism(getAddress("DForce_Optimism"));
/*dforce = new DForceOptimism();*/
Expand Down
5 changes: 3 additions & 2 deletions packages/protocol/script/RunPolygon.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ contract RunPolygon is ScriptPlus {
}

function _setLendingProviders() internal {
aaveV3 = AaveV3Polygon(getAddress("Aave_V3_Polygon"));
aaveV3 = AaveV3Polygon(getAddress("Aave_V3_Polygon_Emode"));
/*aaveV3 = new AaveV3Polygon();*/
/*saveAddress("Aave_V3_Polygon", address(aaveV3));*/
/*saveAddress("Aave_V3_Polygon_Emode", address(aaveV3));*/
setOrdeployAaveEModeHelper(false);

aaveV2 = AaveV2Polygon(getAddress("Aave_V2_Polygon"));
/*aaveV2 = new AaveV2Polygon();*/
Expand Down
Loading

0 comments on commit 8d7691f

Please sign in to comment.