Skip to content

Commit

Permalink
Merge branch 'main' into feat/gsm-launch
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Jan 24, 2024
2 parents ecf22dc + b5521d3 commit 2458f31
Show file tree
Hide file tree
Showing 15 changed files with 803 additions and 6 deletions.
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 | 81 % | 86 % |


#### WBTC ([0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6](https://polygonscan.com/address/0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 95 % | 99.99 % |


#### USDC ([0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174](https://polygonscan.com/address/0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 63 % | 68 % |


#### WETH ([0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619](https://polygonscan.com/address/0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 85 % | 90 % |


#### DAI ([0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063](https://polygonscan.com/address/0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 61 % | 66 % |


#### BAL ([0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3](https://polygonscan.com/address/0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 99 % | 99.99 % |


#### USDT ([0xc2132D05D31c914a87C6611C10748AEb04B58e8F](https://polygonscan.com/address/0xc2132D05D31c914a87C6611C10748AEb04B58e8F))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 62 % | 67 % |


## Raw diff

```json
{
"reserves": {
"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270": {
"reserveFactor": {
"from": 8100,
"to": 8600
}
},
"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6": {
"reserveFactor": {
"from": 9500,
"to": 9999
}
},
"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174": {
"reserveFactor": {
"from": 6300,
"to": 6800
}
},
"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619": {
"reserveFactor": {
"from": 8500,
"to": 9000
}
},
"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063": {
"reserveFactor": {
"from": 6100,
"to": 6600
}
},
"0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3": {
"reserveFactor": {
"from": 9900,
"to": 9999
}
},
"0xc2132D05D31c914a87C6611C10748AEb04B58e8F": {
"reserveFactor": {
"from": 6200,
"to": 6700
}
}
}
}
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"vitest": "^1.0.4"
},
"dependencies": {
"@bgd-labs/aave-address-book": "^2.14.0",
"@bgd-labs/aave-address-book": "^2.17.0",
"@bgd-labs/aave-cli": "0.2.1",
"@inquirer/prompts": "^3.3.0",
"@inquirer/testing": "^2.1.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.0;

import 'forge-std/Test.sol';
import {AaveV3EthereumAssets, AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol';
import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol';
import {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol';
import {IPoolConfigurator} from 'aave-address-book/AaveV3.sol';
import {AaveV3Ethereum_GhoIncidentReport_20231113} from './AaveV3Ethereum_GhoIncidentReport_20231113.sol';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import {AaveV2Polygon, AaveV2PolygonAssets, ILendingPoolConfigurator} from 'aave-address-book/AaveV2Polygon.sol';
import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol';

/**
* @title Reserve Factor Updates (Jan 15, 2024)
* @author karpatkey_TokenLogic
* - Snapshot: No snapshot for Direct-to-AIP
* - Discussion: https://governance.aave.com/t/arfc-reserve-factor-updates-polygon-aave-v2/13937/14
*/
contract AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108 is IProposalGenericExecutor {
uint256 public constant DAI_RF = 66_00;
uint256 public constant USDC_RF = 68_00;
uint256 public constant USDT_RF = 67_00;
uint256 public constant WBTC_RF = 99_99;
uint256 public constant WETH_RF = 90_00;
uint256 public constant WMATIC_RF = 86_00;
uint256 public constant BAL_RF = 99_99;

function execute() external {
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(
AaveV2PolygonAssets.DAI_UNDERLYING,
DAI_RF
);
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(
AaveV2PolygonAssets.USDC_UNDERLYING,
USDC_RF
);
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(
AaveV2PolygonAssets.USDT_UNDERLYING,
USDT_RF
);
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(
AaveV2PolygonAssets.WBTC_UNDERLYING,
WBTC_RF
);
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(
AaveV2PolygonAssets.WETH_UNDERLYING,
WETH_RF
);
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(
AaveV2PolygonAssets.WMATIC_UNDERLYING,
WMATIC_RF
);
ILendingPoolConfigurator(AaveV2Polygon.POOL_CONFIGURATOR).setReserveFactor(
AaveV2PolygonAssets.BAL_UNDERLYING,
BAL_RF
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import {AaveV2Polygon, AaveV2PolygonAssets} from 'aave-address-book/AaveV2Polygon.sol';
import {ProtocolV2TestBase, ReserveConfig} from 'aave-helpers/ProtocolV2TestBase.sol';

import {AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108} from './AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108.sol';

/**
* @dev Test for AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108
* command: make test-contract filter=AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108
*/
contract AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108_Test is ProtocolV2TestBase {
struct Changes {
address asset;
uint256 reserveFactor;
}

AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108 internal proposal;

function setUp() public {
vm.createSelectFork(vm.rpcUrl('polygon'), 52316752);
proposal = new AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108();
}

/**
* @dev executes the generic test suite including e2e and config snapshots
*/
function test_defaultProposalExecution() public {
(ReserveConfig[] memory allConfigsBefore, ReserveConfig[] memory allConfigsAfter) = defaultTest(
'AaveV2Polygon_ReserveFactorUpdates_20240108',
AaveV2Polygon.POOL,
address(proposal)
);

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;

Changes[] memory assetChanges = new Changes[](7);
assetChanges[0] = Changes({
asset: AaveV2PolygonAssets.DAI_UNDERLYING,
reserveFactor: proposal.DAI_RF()
});
assetChanges[1] = Changes({
asset: AaveV2PolygonAssets.USDC_UNDERLYING,
reserveFactor: proposal.USDC_RF()
});
assetChanges[2] = Changes({
asset: AaveV2PolygonAssets.USDT_UNDERLYING,
reserveFactor: proposal.USDT_RF()
});
assetChanges[3] = Changes({
asset: AaveV2PolygonAssets.WBTC_UNDERLYING,
reserveFactor: proposal.WBTC_RF()
});
assetChanges[4] = Changes({
asset: AaveV2PolygonAssets.WETH_UNDERLYING,
reserveFactor: proposal.WETH_RF()
});
assetChanges[5] = Changes({
asset: AaveV2PolygonAssets.WMATIC_UNDERLYING,
reserveFactor: proposal.WMATIC_RF()
});
assetChanges[6] = Changes({
asset: AaveV2PolygonAssets.BAL_UNDERLYING,
reserveFactor: proposal.BAL_RF()
});

_noReservesConfigsChangesApartFrom(allConfigsBefore, allConfigsAfter, assetsChanged);

for (uint i = 0; i < assetChanges.length; i++) {
ReserveConfig memory cfg = _findReserveConfig(allConfigsAfter, assetChanges[i].asset);
assertEq(cfg.reserveFactor, assetChanges[i].reserveFactor);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "Reserve Factor Updates (Jan 15, 2024)"
author: "karpatkey_TokenLogic"
discussions: "https://governance.aave.com/t/arfc-reserve-factor-updates-polygon-aave-v2/13937"
---

## Simple Summary

This AIP is a continuation of Governace V3 ProposalID 1 and increases the Reserve Factor (RF) for assets on Polygon v2 by 5.00%, 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 | 66.00% |
| USDC | 68.00% |
| USDT | 67.00% |
| wBTC | 99.99% |
| wETH | 90.00% |
| MATIC | 86.00% |
| BAL | 99.99% |

## References

- Implementation: [AaveV2Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/13b98e06705455c7299a2b38814c4e370f6f48ad/src/20240108_AaveV2Polygon_ReserveFactorUpdatesJan152024/AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108.sol)
- Tests: [AaveV2Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/13b98e06705455c7299a2b38814c4e370f6f48ad/src/20240108_AaveV2Polygon_ReserveFactorUpdatesJan152024/AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108.t.sol)
- [Snapshot](No snapshot for Direct-to-AIP)
- [Discussion](https://governance.aave.com/t/arfc-reserve-factor-updates-polygon-aave-v2/13937/14)

## Disclaimer

TokenLogic and karpatkey receive no compensation beyond Aave protocol for the creation of this proposal. TokenLogic and karpatkey are both delegates within the Aave ecosystem.

## Copyright

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol';
import {EthereumScript, PolygonScript} from 'aave-helpers/ScriptUtils.sol';
import {AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108} from './AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108.sol';

/**
* @dev Deploy Polygon
* deploy-command: make deploy-ledger contract=src/20240108_AaveV2Polygon_ReserveFactorUpdatesJan152024/ReserveFactorUpdatesJan152024_20240108.s.sol:DeployPolygon chain=polygon
* verify-command: npx catapulta-verify -b broadcast/ReserveFactorUpdatesJan152024_20240108.s.sol/137/run-latest.json
*/
contract DeployPolygon is PolygonScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108).creationCode
);

// compose action
IPayloadsControllerCore.ExecutionAction[]
memory actions = new IPayloadsControllerCore.ExecutionAction[](1);
actions[0] = GovV3Helpers.buildAction(payload0);

// register action at payloadsController
GovV3Helpers.createPayload(actions);
}
}

/**
* @dev Create Proposal
* command: make deploy-ledger contract=src/20240108_AaveV2Polygon_ReserveFactorUpdatesJan152024/ReserveFactorUpdatesJan152024_20240108.s.sol:CreateProposal chain=mainnet
*/
contract CreateProposal is EthereumScript {
function run() external {
// create payloads
PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](1);

// compose actions for validation
IPayloadsControllerCore.ExecutionAction[]
memory actionsPolygon = new IPayloadsControllerCore.ExecutionAction[](1);
actionsPolygon[0] = GovV3Helpers.buildAction(
type(AaveV2Polygon_ReserveFactorUpdatesJan152024_20240108).creationCode
);
payloads[0] = GovV3Helpers.buildPolygonPayload(vm, actionsPolygon);

// create proposal
vm.startBroadcast();
GovV3Helpers.createProposal(
vm,
payloads,
GovV3Helpers.ipfsHashFile(
vm,
'src/20240108_AaveV2Polygon_ReserveFactorUpdatesJan152024/ReserveFactorUpdatesJan152024.md'
)
);
}
}
13 changes: 13 additions & 0 deletions src/20240108_AaveV2Polygon_ReserveFactorUpdatesJan152024/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {ConfigFile} from '../../generator/types';
export const config: ConfigFile = {
rootOptions: {
pools: ['AaveV2Polygon'],
title: 'Reserve Factor Updates (Jan 15, 2024)',
shortName: 'ReserveFactorUpdatesJan152024',
date: '20240108',
author: 'karpatkey_TokenLogic',
discussion: 'https://governance.aave.com/t/arfc-reserve-factor-updates-polygon-aave-v2/13937',
snapshot: 'No snapshot for Direct-to-AIP',
},
poolOptions: {AaveV2Polygon: {configs: {OTHERS: {}}, cache: {blockNumber: 52093827}}},
};
Loading

0 comments on commit 2458f31

Please sign in to comment.