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

ETH & AVAX V2 Reserve Factor Updates April 22 #297

Merged
merged 4 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
## Reserve changes

### Reserve altered

#### WETH.e ([0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB](https://snowscan.xyz/address/0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 35 % | 40 % |


#### WBTC.e ([0x50b7545627a5162F82A992c33b87aDc75187B218](https://snowscan.xyz/address/0x50b7545627a5162F82A992c33b87aDc75187B218))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 40 % | 45 % |


#### USDC.e ([0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664](https://snowscan.xyz/address/0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 35 % | 40 % |


#### WAVAX ([0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7](https://snowscan.xyz/address/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 35 % | 40 % |


#### USDT.e ([0xc7198437980c041c805A1EDcbA50c1Ce5db95118](https://snowscan.xyz/address/0xc7198437980c041c805A1EDcbA50c1Ce5db95118))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 35 % | 40 % |


#### DAI.e ([0xd586E7F844cEa2F87f50152665BCbc2C279D8d70](https://snowscan.xyz/address/0xd586E7F844cEa2F87f50152665BCbc2C279D8d70))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 35 % | 40 % |


## Raw diff

```json
{
"reserves": {
"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB": {
"reserveFactor": {
"from": 3500,
"to": 4000
}
},
"0x50b7545627a5162F82A992c33b87aDc75187B218": {
"reserveFactor": {
"from": 4000,
"to": 4500
}
},
"0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664": {
"reserveFactor": {
"from": 3500,
"to": 4000
}
},
"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7": {
"reserveFactor": {
"from": 3500,
"to": 4000
}
},
"0xc7198437980c041c805A1EDcbA50c1Ce5db95118": {
"reserveFactor": {
"from": 3500,
"to": 4000
}
},
"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70": {
"reserveFactor": {
"from": 3500,
"to": 4000
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
## Reserve changes

### Reserve altered

#### GUSD ([0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd](https://etherscan.io/address/0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 35 % | 40 % |


#### WBTC ([0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599](https://etherscan.io/address/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 45 % | 50 % |


#### LINK ([0x514910771AF9Ca656af840dff83E8264EcF986CA](https://etherscan.io/address/0x514910771AF9Ca656af840dff83E8264EcF986CA))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 45 % | 50 % |


#### sUSD ([0x57Ab1ec28D129707052df4dF418D58a2D46d5f51](https://etherscan.io/address/0x57Ab1ec28D129707052df4dF418D58a2D46d5f51))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 45 % | 50 % |


#### LUSD ([0x5f98805A4E8be255a32880FDeC7F6728C6568bA0](https://etherscan.io/address/0x5f98805A4E8be255a32880FDeC7F6728C6568bA0))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 40 % | 45 % |


#### DAI ([0x6B175474E89094C44Da98b954EedeAC495271d0F](https://etherscan.io/address/0x6B175474E89094C44Da98b954EedeAC495271d0F))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 40 % | 45 % |


#### FRAX ([0x853d955aCEf822Db058eb8505911ED77F175b99e](https://etherscan.io/address/0x853d955aCEf822Db058eb8505911ED77F175b99e))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 45 % | 50 % |


#### USDP ([0x8E870D67F660D95d5be530380D0eC0bd388289E1](https://etherscan.io/address/0x8E870D67F660D95d5be530380D0eC0bd388289E1))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 35 % | 40 % |


#### USDC ([0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 40 % | 45 % |


#### WETH ([0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2](https://etherscan.io/address/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 40 % | 45 % |


#### USDT ([0xdAC17F958D2ee523a2206206994597C13D831ec7](https://etherscan.io/address/0xdAC17F958D2ee523a2206206994597C13D831ec7))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 40 % | 45 % |


## Raw diff

```json
{
"reserves": {
"0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd": {
"reserveFactor": {
"from": 3500,
"to": 4000
}
},
"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599": {
"reserveFactor": {
"from": 4500,
"to": 5000
}
},
"0x514910771AF9Ca656af840dff83E8264EcF986CA": {
"reserveFactor": {
"from": 4500,
"to": 5000
}
},
"0x57Ab1ec28D129707052df4dF418D58a2D46d5f51": {
"reserveFactor": {
"from": 4500,
"to": 5000
}
},
"0x5f98805A4E8be255a32880FDeC7F6728C6568bA0": {
"reserveFactor": {
"from": 4000,
"to": 4500
}
},
"0x6B175474E89094C44Da98b954EedeAC495271d0F": {
"reserveFactor": {
"from": 4000,
"to": 4500
}
},
"0x853d955aCEf822Db058eb8505911ED77F175b99e": {
"reserveFactor": {
"from": 4500,
"to": 5000
}
},
"0x8E870D67F660D95d5be530380D0eC0bd388289E1": {
"reserveFactor": {
"from": 3500,
"to": 4000
}
},
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": {
"reserveFactor": {
"from": 4000,
"to": 4500
}
},
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2": {
"reserveFactor": {
"from": 4000,
"to": 4500
}
},
"0xdAC17F958D2ee523a2206206994597C13D831ec7": {
"reserveFactor": {
"from": 4000,
"to": 4500
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// SPDX-License-Identifier: MIT
/*
_ ΞΞΞΞ _
/_;-.__ / _\ _.-;_\
`-._`'`_/'`.-'
`\ /`
| /
/-.(
\_._\
\ \`;
> |/
/ //
|//
\(\
``
defijesus.eth
*/
pragma solidity ^0.8.0;

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

/**
* @title Reserve Factor Upgrades
* @author karpatkey_TokenLogic
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x770ff4e02634c77aaa09952345551168920f7878b32ab03fcef92763a5fb70ab
* - Discussion: https://governance.aave.com/t/arfc-avalanche-v2-reserve-factor-adjustment/17040/2
*/
contract AaveV2Avalanche_ReserveFactorUpgrades_20240411 is IProposalGenericExecutor {
ILendingPoolConfigurator public constant POOL_CONFIGURATOR =
ILendingPoolConfigurator(AaveV2Avalanche.POOL_CONFIGURATOR);

uint256 public constant DAIe_RF = 40_00;
uint256 public constant USDCe_RF = 40_00;
uint256 public constant USDTe_RF = 40_00;
uint256 public constant WAVAX_RF = 40_00;
uint256 public constant WBTCe_RF = 45_00;
uint256 public constant WETHe_RF = 40_00;

function execute() external {
POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.DAIe_UNDERLYING, DAIe_RF);
POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.USDCe_UNDERLYING, USDCe_RF);
POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.USDTe_UNDERLYING, USDTe_RF);
POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.WAVAX_UNDERLYING, WAVAX_RF);
POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.WBTCe_UNDERLYING, WBTCe_RF);
POOL_CONFIGURATOR.setReserveFactor(AaveV2AvalancheAssets.WETHe_UNDERLYING, WETHe_RF);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {AaveV2Avalanche, AaveV2AvalancheAssets} from 'aave-address-book/AaveV2Avalanche.sol';

import 'forge-std/Test.sol';
import {ProtocolV2TestBase, ReserveConfig} from 'aave-helpers/ProtocolV2TestBase.sol';
import {AaveV2Avalanche_ReserveFactorUpgrades_20240411} from './AaveV2Avalanche_ReserveFactorUpgrades_20240411.sol';

/**
* @dev Test for AaveV2Avalanche_ReserveFactorUpgrades_20240411
* command: make test-contract filter=AaveV2Avalanche_ReserveFactorUpgrades_20240411
*/
contract AaveV2Avalanche_ReserveFactorUpgrades_20240411_Test is ProtocolV2TestBase {
AaveV2Avalanche_ReserveFactorUpgrades_20240411 internal proposal;

struct Changes {
address asset;
uint256 reserveFactor;
}

function setUp() public {
vm.createSelectFork(vm.rpcUrl('avalanche'), 44280713);
proposal = new AaveV2Avalanche_ReserveFactorUpgrades_20240411();
}

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

address[] memory assetsChanged = new address[](6);
assetsChanged[0] = AaveV2AvalancheAssets.DAIe_UNDERLYING;
assetsChanged[1] = AaveV2AvalancheAssets.USDCe_UNDERLYING;
assetsChanged[2] = AaveV2AvalancheAssets.USDTe_UNDERLYING;
assetsChanged[3] = AaveV2AvalancheAssets.WAVAX_UNDERLYING;
assetsChanged[4] = AaveV2AvalancheAssets.WBTCe_UNDERLYING;
assetsChanged[5] = AaveV2AvalancheAssets.WETHe_UNDERLYING;

Changes[] memory assetChanges = new Changes[](6);
assetChanges[0] = Changes({
asset: AaveV2AvalancheAssets.DAIe_UNDERLYING,
reserveFactor: proposal.DAIe_RF()
});
assetChanges[1] = Changes({
asset: AaveV2AvalancheAssets.USDCe_UNDERLYING,
reserveFactor: proposal.USDCe_RF()
});
assetChanges[2] = Changes({
asset: AaveV2AvalancheAssets.USDTe_UNDERLYING,
reserveFactor: proposal.USDTe_RF()
});
assetChanges[3] = Changes({
asset: AaveV2AvalancheAssets.WAVAX_UNDERLYING,
reserveFactor: proposal.WAVAX_RF()
});
assetChanges[4] = Changes({
asset: AaveV2AvalancheAssets.WBTCe_UNDERLYING,
reserveFactor: proposal.WBTCe_RF()
});
assetChanges[5] = Changes({
asset: AaveV2AvalancheAssets.WETHe_UNDERLYING,
reserveFactor: proposal.WETHe_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);
}
}
}
Loading
Loading