This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reserve Factor Update October 2023 (#338)
* ready for review, a small TODO left in the .md * remove unneeded line from .md * valdate reserve factors * smol fix in .md * deploy payload. update test & script * remove extra ')' --------- Co-authored-by: defijesus.eth <[email protected]>
- Loading branch information
Showing
5 changed files
with
278 additions
and
0 deletions.
There are no files selected for viewing
103 changes: 103 additions & 0 deletions
103
...ober2023_20231019_postAaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
## Reserve changes | ||
|
||
### Reserve altered | ||
|
||
#### WMATIC ([0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270](https://polygonscan.com/address/0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| reserveFactor | 56 % | 61 % | | ||
|
||
|
||
#### WBTC ([0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6](https://polygonscan.com/address/0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| reserveFactor | 70 % | 75 % | | ||
|
||
|
||
#### USDC ([0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174](https://polygonscan.com/address/0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| reserveFactor | 38 % | 43 % | | ||
|
||
|
||
#### WETH ([0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619](https://polygonscan.com/address/0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| reserveFactor | 60 % | 65 % | | ||
|
||
|
||
#### DAI ([0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063](https://polygonscan.com/address/0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| reserveFactor | 36 % | 41 % | | ||
|
||
|
||
#### BAL ([0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3](https://polygonscan.com/address/0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| reserveFactor | 47 % | 52 % | | ||
|
||
|
||
#### USDT ([0xc2132D05D31c914a87C6611C10748AEb04B58e8F](https://polygonscan.com/address/0xc2132D05D31c914a87C6611C10748AEb04B58e8F)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| reserveFactor | 37 % | 42 % | | ||
|
||
|
||
## Raw diff | ||
|
||
```json | ||
{ | ||
"reserves": { | ||
"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270": { | ||
"reserveFactor": { | ||
"from": 5600, | ||
"to": 6100 | ||
} | ||
}, | ||
"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6": { | ||
"reserveFactor": { | ||
"from": 7000, | ||
"to": 7500 | ||
} | ||
}, | ||
"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174": { | ||
"reserveFactor": { | ||
"from": 3800, | ||
"to": 4300 | ||
} | ||
}, | ||
"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619": { | ||
"reserveFactor": { | ||
"from": 6000, | ||
"to": 6500 | ||
} | ||
}, | ||
"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063": { | ||
"reserveFactor": { | ||
"from": 3600, | ||
"to": 4100 | ||
} | ||
}, | ||
"0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3": { | ||
"reserveFactor": { | ||
"from": 4700, | ||
"to": 5200 | ||
} | ||
}, | ||
"0xc2132D05D31c914a87C6611C10748AEb04B58e8F": { | ||
"reserveFactor": { | ||
"from": 3700, | ||
"to": 4200 | ||
} | ||
} | ||
} | ||
} | ||
``` |
23 changes: 23 additions & 0 deletions
23
...ReserveFactorUpdateOctober2023/AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; | ||
import {AaveV2Polygon, AaveV2PolygonAssets, ILendingPoolConfigurator} from 'aave-address-book/AaveV2Polygon.sol'; | ||
|
||
/** | ||
* @title Reserve Factor Update October 2023 | ||
* @author TokenLogic | ||
* - Snapshot: No snapshot for Direct-to-AIP | ||
* - Discussion: https://governance.aave.com/t/arfc-reserve-factor-updates-polygon-aave-v2/13937/8 | ||
*/ | ||
contract AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019 is IProposalGenericExecutor { | ||
function execute() external { | ||
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(AaveV2PolygonAssets.DAI_UNDERLYING, 41_00); | ||
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(AaveV2PolygonAssets.USDC_UNDERLYING, 43_00); | ||
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(AaveV2PolygonAssets.USDT_UNDERLYING, 42_00); | ||
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(AaveV2PolygonAssets.WBTC_UNDERLYING, 75_00); | ||
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(AaveV2PolygonAssets.WETH_UNDERLYING, 65_00); | ||
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(AaveV2PolygonAssets.WMATIC_UNDERLYING, 61_00); | ||
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(AaveV2PolygonAssets.BAL_UNDERLYING, 52_00); | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
...serveFactorUpdateOctober2023/AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import 'forge-std/Test.sol'; | ||
import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; | ||
import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; | ||
import {AaveV2Polygon, AaveV2PolygonAssets} from 'aave-address-book/AaveV2Polygon.sol'; | ||
import {ProtocolV2TestBase, ReserveConfig} from 'aave-helpers/ProtocolV2TestBase.sol'; | ||
import {AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019} from './AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019.sol'; | ||
|
||
/** | ||
* @dev Test for AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019 | ||
* command: make test-contract filter=AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019 | ||
*/ | ||
contract AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019_Test is ProtocolV2TestBase { | ||
AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019 internal proposal; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('polygon'), 49059890); | ||
proposal = AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019(0x53Af3E66dfd8182f1084d8f36d4c1085a3962B7a); | ||
} | ||
|
||
function testProposalExecution() public { | ||
ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( | ||
'preAaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019', | ||
AaveV2Polygon.POOL | ||
); | ||
|
||
GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.POLYGON_BRIDGE_EXECUTOR); | ||
|
||
ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( | ||
'postAaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019', | ||
AaveV2Polygon.POOL | ||
); | ||
|
||
diffReports( | ||
'preAaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019', | ||
'postAaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019' | ||
); | ||
|
||
address[] memory assetsChanged = new address[](7); | ||
assetsChanged[0] = AaveV2PolygonAssets.DAI_UNDERLYING; | ||
assetsChanged[1] = AaveV2PolygonAssets.USDC_UNDERLYING; | ||
assetsChanged[2] = AaveV2PolygonAssets.USDT_UNDERLYING; | ||
assetsChanged[3] = AaveV2PolygonAssets.WBTC_UNDERLYING; | ||
assetsChanged[4] = AaveV2PolygonAssets.WETH_UNDERLYING; | ||
assetsChanged[5] = AaveV2PolygonAssets.WMATIC_UNDERLYING; | ||
assetsChanged[6] = AaveV2PolygonAssets.BAL_UNDERLYING; | ||
|
||
uint256[] memory reserveFactors = new uint256[](7); | ||
reserveFactors[0] = 41_00; | ||
reserveFactors[1] = 43_00; | ||
reserveFactors[2] = 42_00; | ||
reserveFactors[3] = 75_00; | ||
reserveFactors[4] = 65_00; | ||
reserveFactors[5] = 61_00; | ||
reserveFactors[6] = 52_00; | ||
|
||
_noReservesConfigsChangesApartFrom(allConfigsBefore, allConfigsAfter, assetsChanged); | ||
|
||
for (uint i = 0; i < assetsChanged.length; i++) { | ||
ReserveConfig memory cfg = _findReserveConfig(allConfigsAfter, assetsChanged[i]); | ||
assertEq(cfg.reserveFactor, reserveFactors[i]); | ||
if ( | ||
assetsChanged[i] == AaveV2PolygonAssets.BAL_UNDERLYING | ||
) { | ||
continue; | ||
} | ||
_deposit(cfg, AaveV2Polygon.POOL, address(42), 100); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...2_Pol_ReserveFactorUpdateOctober2023/AaveV2_ReserveFactorUpdateOctober2023_20231019.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; | ||
import {EthereumScript, PolygonScript} from 'aave-helpers/ScriptUtils.sol'; | ||
import {AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019} from './AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019.sol'; | ||
|
||
/** | ||
* @dev Deploy AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019 | ||
* command: make deploy-ledger contract=src/20231019_AaveV2_Pol_ReserveFactorUpdateOctober2023/AaveV2_ReserveFactorUpdateOctober2023_20231019.s.sol:DeployPolygon chain=polygon | ||
*/ | ||
contract DeployPolygon is PolygonScript { | ||
function run() external broadcast { | ||
new AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019(); | ||
} | ||
} | ||
|
||
/** | ||
* @dev Create Proposal | ||
* command: make deploy-ledger contract=src/20231019_AaveV2_Pol_ReserveFactorUpdateOctober2023/AaveV2_ReserveFactorUpdateOctober2023_20231019.s.sol:CreateProposal chain=mainnet | ||
*/ | ||
contract CreateProposal is EthereumScript { | ||
function run() external broadcast { | ||
GovHelpers.Payload[] memory payloads = new GovHelpers.Payload[](1); | ||
payloads[0] = GovHelpers.buildPolygon(0x53Af3E66dfd8182f1084d8f36d4c1085a3962B7a); | ||
GovHelpers.createProposal( | ||
payloads, | ||
GovHelpers.ipfsHashFile( | ||
vm, | ||
'src/20231019_AaveV2_Pol_ReserveFactorUpdateOctober2023/ReserveFactorUpdateOctober2023.md' | ||
) | ||
); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...019_AaveV2_Pol_ReserveFactorUpdateOctober2023/ReserveFactorUpdateOctober2023.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: "Reserve Factor Update October 2023" | ||
author: "TokenLogic" | ||
discussions: "https://governance.aave.com/t/arfc-reserve-factor-updates-polygon-aave-v2/13937/8" | ||
--- | ||
|
||
## Simple Summary | ||
|
||
This AIP is a continuation of [AIP 284](https://app.aave.com/governance/proposal/284/) and increases the Reserve Factor (RF) for assets on Polygon v2 by 5%, up to a maximum of 99.99%. | ||
|
||
## Motivation | ||
|
||
This AIP will reduce deposit yield for assets on Polygon v2 by increasing the RF. With this upgrade being passed, users will be further encouraged to migrate from Polygon v2 to v3. | ||
|
||
Increasing the RF routes a larger portion of the interest paid by users to Aave DAO's Treasury. User's funds are not at risk of liquidation and the borrowing rate remains unchanged. | ||
|
||
Of the assets with an RF set at 99.99%, there is no change. All other asset reserves will have the RF increased by 5%. | ||
|
||
## Specification | ||
|
||
The following parameters are to be updated as follows: | ||
|
||
| Asset | Reserve Factor | | ||
| ----- | -------------- | | ||
| DAI | 41.00% | | ||
| USDC | 43.00% | | ||
| USDT | 42.00% | | ||
| wBTC | 75.00% | | ||
| wETH | 65.00% | | ||
| MATIC | 61.00% | | ||
| BAL | 52.00% | | ||
|
||
## References | ||
|
||
- Implementation: [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20231019_AaveV2_Pol_ReserveFactorUpdateOctober2023/AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019.sol) | ||
- Tests: [Polygon](https://github.com/bgd-labs/aave-proposals/blob/main/src/20231019_AaveV2_Pol_ReserveFactorUpdateOctober2023/AaveV2_Polygon_ReserveFactorUpdateOctober2023_20231019.t.sol) | ||
- Snapshot: No snapshot for Direct-to-AIP | ||
- [Discussion](https://governance.aave.com/t/arfc-reserve-factor-updates-polygon-aave-v2/13937/8) | ||
|
||
# Disclaimer | ||
|
||
The author, TokenLogic, receives no payment from anyone, including Aave DAO, for this proposal. TokenLogic is a delegate within the Aave community. | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
9348d50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Foundry report
Build log
Test success 🌈