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

Gauntlet - Aave V2 Ethereum AMM IR Deprecation #204

Merged
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
1 change: 1 addition & 0 deletions .assets/856903063d3cc6003230aea391bcdd7080ae884e.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/ae40eb9e5a19ec740fbcf7618e1a89e287803ba7.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/b2e6e45c0df35c14497c2de70f69481e8b9f59b2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/ed92e8398b27ac9c7c1d23461804e0a36d9ba830.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
## Reserve changes

### Reserve altered

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

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 20 % | 99 % |
| interestRateStrategy | [0x8d02bac65cd84343eF8239d277794bad455cE889](https://etherscan.io/address/0x8d02bac65cd84343eF8239d277794bad455cE889) | [0xd102F58BF7B2509A2d8664be7C4A90102526B5c6](https://etherscan.io/address/0xd102F58BF7B2509A2d8664be7C4A90102526B5c6) |
| baseVariableBorrowRate | 0 % | 5 % |
| interestRate | ![before](/.assets/9ec14174f670884ad26c4e60158597a3ea46106e.svg) | ![after](/.assets/ae40eb9e5a19ec740fbcf7618e1a89e287803ba7.svg) |

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

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 10 % | 99 % |
| interestRateStrategy | [0x79F40CDF9f491f148E522D7845c3fBF61E56c33F](https://etherscan.io/address/0x79F40CDF9f491f148E522D7845c3fBF61E56c33F) | [0xA57cDBfE9FA29Ad842f53100d68789999c04AA36](https://etherscan.io/address/0xA57cDBfE9FA29Ad842f53100d68789999c04AA36) |
| baseVariableBorrowRate | 0 % | 4 % |
| variableRateSlope1 | 4 % | 10 % |
| interestRate | ![before](/.assets/fb6c6adb04bffc12e5b75a6e30c81de7f9ea04a1.svg) | ![after](/.assets/856903063d3cc6003230aea391bcdd7080ae884e.svg) |

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

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 10 % | 99 % |
| interestRateStrategy | [0x79F40CDF9f491f148E522D7845c3fBF61E56c33F](https://etherscan.io/address/0x79F40CDF9f491f148E522D7845c3fBF61E56c33F) | [0xA57cDBfE9FA29Ad842f53100d68789999c04AA36](https://etherscan.io/address/0xA57cDBfE9FA29Ad842f53100d68789999c04AA36) |
| baseVariableBorrowRate | 0 % | 4 % |
| variableRateSlope1 | 4 % | 10 % |
| interestRate | ![before](/.assets/fb6c6adb04bffc12e5b75a6e30c81de7f9ea04a1.svg) | ![after](/.assets/856903063d3cc6003230aea391bcdd7080ae884e.svg) |

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

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 10 % | 99 % |
| interestRateStrategy | [0x8d02bac65cd84343eF8239d277794bad455cE889](https://etherscan.io/address/0x8d02bac65cd84343eF8239d277794bad455cE889) | [0xdb838A27f91b112D722c854636F2c23720ea007E](https://etherscan.io/address/0xdb838A27f91b112D722c854636F2c23720ea007E) |
| baseVariableBorrowRate | 0 % | 6 % |
| interestRate | ![before](/.assets/9ec14174f670884ad26c4e60158597a3ea46106e.svg) | ![after](/.assets/ed92e8398b27ac9c7c1d23461804e0a36d9ba830.svg) |

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

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 10 % | 99 % |
| interestRateStrategy | [0x79F40CDF9f491f148E522D7845c3fBF61E56c33F](https://etherscan.io/address/0x79F40CDF9f491f148E522D7845c3fBF61E56c33F) | [0x2223cd25f60F3e4035fcEfE44612773AFEbFd8ab](https://etherscan.io/address/0x2223cd25f60F3e4035fcEfE44612773AFEbFd8ab) |
| baseVariableBorrowRate | 0 % | 6 % |
| variableRateSlope1 | 4 % | 10 % |
| interestRate | ![before](/.assets/fb6c6adb04bffc12e5b75a6e30c81de7f9ea04a1.svg) | ![after](/.assets/b2e6e45c0df35c14497c2de70f69481e8b9f59b2.svg) |

## Raw diff

```json
{
"reserves": {
"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599": {
"interestRateStrategy": {
"from": "0x8d02bac65cd84343eF8239d277794bad455cE889",
"to": "0xd102F58BF7B2509A2d8664be7C4A90102526B5c6"
},
"reserveFactor": {
"from": 2000,
"to": 9900
}
},
"0x6B175474E89094C44Da98b954EedeAC495271d0F": {
"interestRateStrategy": {
"from": "0x79F40CDF9f491f148E522D7845c3fBF61E56c33F",
"to": "0xA57cDBfE9FA29Ad842f53100d68789999c04AA36"
},
"reserveFactor": {
"from": 1000,
"to": 9900
}
},
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": {
"interestRateStrategy": {
"from": "0x79F40CDF9f491f148E522D7845c3fBF61E56c33F",
"to": "0xA57cDBfE9FA29Ad842f53100d68789999c04AA36"
},
"reserveFactor": {
"from": 1000,
"to": 9900
}
},
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2": {
"interestRateStrategy": {
"from": "0x8d02bac65cd84343eF8239d277794bad455cE889",
"to": "0xdb838A27f91b112D722c854636F2c23720ea007E"
},
"reserveFactor": {
"from": 1000,
"to": 9900
}
},
"0xdAC17F958D2ee523a2206206994597C13D831ec7": {
"interestRateStrategy": {
"from": "0x79F40CDF9f491f148E522D7845c3fBF61E56c33F",
"to": "0x2223cd25f60F3e4035fcEfE44612773AFEbFd8ab"
},
"reserveFactor": {
"from": 1000,
"to": 9900
}
}
},
"strategies": {
"0x2223cd25f60F3e4035fcEfE44612773AFEbFd8ab": {
"from": null,
"to": {
"baseVariableBorrowRate": "60000000000000000000000000",
"maxExcessUsageRatio": "200000000000000000000000000",
"optimalUsageRatio": "800000000000000000000000000",
"stableRateSlope1": "20000000000000000000000000",
"stableRateSlope2": "600000000000000000000000000",
"variableRateSlope1": "100000000000000000000000000",
"variableRateSlope2": "750000000000000000000000000"
}
},
"0xA57cDBfE9FA29Ad842f53100d68789999c04AA36": {
"from": null,
"to": {
"baseVariableBorrowRate": "40000000000000000000000000",
"maxExcessUsageRatio": "200000000000000000000000000",
"optimalUsageRatio": "800000000000000000000000000",
"stableRateSlope1": "20000000000000000000000000",
"stableRateSlope2": "600000000000000000000000000",
"variableRateSlope1": "100000000000000000000000000",
"variableRateSlope2": "750000000000000000000000000"
}
},
"0xd102F58BF7B2509A2d8664be7C4A90102526B5c6": {
"from": null,
"to": {
"baseVariableBorrowRate": "50000000000000000000000000",
"maxExcessUsageRatio": "350000000000000000000000000",
"optimalUsageRatio": "650000000000000000000000000",
"stableRateSlope1": "100000000000000000000000000",
"stableRateSlope2": "1000000000000000000000000000",
"variableRateSlope1": "80000000000000000000000000",
"variableRateSlope2": "1000000000000000000000000000"
}
},
"0xdb838A27f91b112D722c854636F2c23720ea007E": {
"from": null,
"to": {
"baseVariableBorrowRate": "60000000000000000000000000",
"maxExcessUsageRatio": "350000000000000000000000000",
"optimalUsageRatio": "650000000000000000000000000",
"stableRateSlope1": "100000000000000000000000000",
"stableRateSlope2": "1000000000000000000000000000",
"variableRateSlope1": "80000000000000000000000000",
"variableRateSlope2": "1000000000000000000000000000"
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: "[ARFC] Deprecate Aave V2 AMM Market - Step 2"
author: "Gauntlet"
discussions: "https://governance.aave.com/t/arfc-deprecate-aave-v2-amm-market-step-2/16408/1"
snapshot: "https://snapshot.org/#/aave.eth/proposal/0x0ade316f52d5f763160ea15538a71a4682ae1b708864e8d33497d8de40ad9973"
---

## Simple Summary

A proposal for further deprecation recommendations on Aave AMM v2. For more details, see the full forum post [here](https://governance.aave.com/t/arfc-deprecate-aave-v2-amm-market-step-2/16408/2).

## Motivation

Gauntlet aims to reduce the remaining $94k borrow position and migrate users off the AMM market. Further analysis and information can be found in our forum [post](https://governance.aave.com/t/arfc-deprecate-aave-v2-amm-market-step-2/16408).

## Specification

Gauntlet recommends to increase reserve factor to 99% for the following assets:

| Asset | Current RF | Recommended RF |
| ----- | ---------- | -------------- |
| WETH | 0.1 | 0.99 |
| DAI | 0.1 | 0.99 |
| USDC | 0.1 | 0.99 |
| WBTC | 0.2 | 0.99 |
| USDT | 0.1 | 0.99 |

Gauntlet recommends to adjust the IR params for the following assets:
| Asset | Current Variable Base | Recommended Variable Base | Current Variable Slope1 | Recommended Variable Slope1 |
| ----- | --------------------- | ------------------------- | ----------------------- | --------------------------- |
| WETH | 0 | 0.06 | 0.08 | No Change |
| DAI | 0 | 0.04 | 0.04 | 0.1 |
| USDC | 0 | 0.04 | 0.04 | 0.1 |
| WBTC | 0 | 0.05 | 0.08 | No Change |
| USDT | 0 | 0.06 | 0.04 | 0.1 |

## References

- Implementation: [AaveV2EthereumAMM](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240205_AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2/AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2_20240205.sol)
- Tests: [AaveV2EthereumAMM](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240205_AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2/AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2_20240205.t.sol)
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x0ade316f52d5f763160ea15538a71a4682ae1b708864e8d33497d8de40ad9973)
- [Discussion](https://governance.aave.com/t/arfc-deprecate-aave-v2-amm-market-step-2/16408/1)

## Disclaimer

Gauntlet has not been compensated by any third party for publishing this ARFC.

## Copyright

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

_By approving this proposal, you agree that any services provided by Gauntlet shall be governed by the terms of service available at gauntlet.network/tos._
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} from 'aave-helpers/ScriptUtils.sol';
import {AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2_20240205} from './AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2_20240205.sol';

/**
* @dev Deploy Ethereum
* deploy-command: make deploy-ledger contract=src/20240205_AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2/ARFCDeprecateAaveV2AMMMarketStep2_20240205.s.sol:DeployEthereum chain=mainnet
* verify-command: npx catapulta-verify -b broadcast/ARFCDeprecateAaveV2AMMMarketStep2_20240205.s.sol/1/run-latest.json
*/
contract DeployEthereum is EthereumScript {
function run() external broadcast {
// deploy payloads
address payload0 = GovV3Helpers.deployDeterministic(
type(AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2_20240205).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/20240205_AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2/ARFCDeprecateAaveV2AMMMarketStep2_20240205.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 actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1);
actionsEthereum[0] = GovV3Helpers.buildAction(
type(AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2_20240205).creationCode
);
payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum);

// create proposal
vm.startBroadcast();
GovV3Helpers.createProposal(
vm,
payloads,
GovV3Helpers.ipfsHashFile(
vm,
'src/20240205_AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2/ARFCDeprecateAaveV2AMMMarketStep2.md'
)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {AaveV2EthereumAMM, AaveV2EthereumAMMAssets, ILendingPoolConfigurator} from 'aave-address-book/AaveV2EthereumAMM.sol';
import {AaveV2PayloadEthereumAMM} from 'aave-helpers/v2-config-engine/AaveV2PayloadEthereumAMM.sol';
import {EngineFlags} from 'aave-helpers/v3-config-engine/EngineFlags.sol';
import {IAaveV2ConfigEngine} from 'aave-helpers/v2-config-engine/IAaveV2ConfigEngine.sol';
import {IV2RateStrategyFactory} from 'aave-helpers/v2-config-engine/IV2RateStrategyFactory.sol';

/**
* @title [ARFC] Deprecate Aave V2 AMM Market - Step 2
* @author Gauntlet
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x0ade316f52d5f763160ea15538a71a4682ae1b708864e8d33497d8de40ad9973
* - Discussion: https://governance.aave.com/t/arfc-deprecate-aave-v2-amm-market-step-2/16408/1
*/
contract AaveV2EthereumAMM_ARFCDeprecateAaveV2AMMMarketStep2_20240205 is AaveV2PayloadEthereumAMM {
function _postExecute() internal override {
ILendingPoolConfigurator(AaveV2EthereumAMM.POOL_CONFIGURATOR).setReserveFactor(
AaveV2EthereumAMMAssets.WETH_UNDERLYING,
99_00
);
ILendingPoolConfigurator(AaveV2EthereumAMM.POOL_CONFIGURATOR).setReserveFactor(
AaveV2EthereumAMMAssets.DAI_UNDERLYING,
99_00
);
ILendingPoolConfigurator(AaveV2EthereumAMM.POOL_CONFIGURATOR).setReserveFactor(
AaveV2EthereumAMMAssets.USDC_UNDERLYING,
99_00
);
ILendingPoolConfigurator(AaveV2EthereumAMM.POOL_CONFIGURATOR).setReserveFactor(
AaveV2EthereumAMMAssets.WBTC_UNDERLYING,
99_00
);
ILendingPoolConfigurator(AaveV2EthereumAMM.POOL_CONFIGURATOR).setReserveFactor(
AaveV2EthereumAMMAssets.USDT_UNDERLYING,
99_00
);
}

function rateStrategiesUpdates()
public
pure
override
returns (IAaveV2ConfigEngine.RateStrategyUpdate[] memory)
{
IAaveV2ConfigEngine.RateStrategyUpdate[]
memory rateStrategies = new IAaveV2ConfigEngine.RateStrategyUpdate[](5);
rateStrategies[0] = IAaveV2ConfigEngine.RateStrategyUpdate({
asset: AaveV2EthereumAMMAssets.WETH_UNDERLYING,
params: IV2RateStrategyFactory.RateStrategyParams({
optimalUtilizationRate: EngineFlags.KEEP_CURRENT,
baseVariableBorrowRate: _bpsToRay(6_00),
variableRateSlope1: EngineFlags.KEEP_CURRENT,
variableRateSlope2: EngineFlags.KEEP_CURRENT,
stableRateSlope1: EngineFlags.KEEP_CURRENT,
stableRateSlope2: EngineFlags.KEEP_CURRENT
})
});
rateStrategies[1] = IAaveV2ConfigEngine.RateStrategyUpdate({
asset: AaveV2EthereumAMMAssets.DAI_UNDERLYING,
params: IV2RateStrategyFactory.RateStrategyParams({
optimalUtilizationRate: EngineFlags.KEEP_CURRENT,
baseVariableBorrowRate: _bpsToRay(4_00),
variableRateSlope1: _bpsToRay(10_00),
variableRateSlope2: EngineFlags.KEEP_CURRENT,
stableRateSlope1: EngineFlags.KEEP_CURRENT,
stableRateSlope2: EngineFlags.KEEP_CURRENT
})
});
rateStrategies[2] = IAaveV2ConfigEngine.RateStrategyUpdate({
asset: AaveV2EthereumAMMAssets.USDC_UNDERLYING,
params: IV2RateStrategyFactory.RateStrategyParams({
optimalUtilizationRate: EngineFlags.KEEP_CURRENT,
baseVariableBorrowRate: _bpsToRay(4_00),
variableRateSlope1: _bpsToRay(10_00),
variableRateSlope2: EngineFlags.KEEP_CURRENT,
stableRateSlope1: EngineFlags.KEEP_CURRENT,
stableRateSlope2: EngineFlags.KEEP_CURRENT
})
});
rateStrategies[3] = IAaveV2ConfigEngine.RateStrategyUpdate({
asset: AaveV2EthereumAMMAssets.USDT_UNDERLYING,
params: IV2RateStrategyFactory.RateStrategyParams({
optimalUtilizationRate: EngineFlags.KEEP_CURRENT,
baseVariableBorrowRate: _bpsToRay(6_00),
variableRateSlope1: _bpsToRay(10_00),
variableRateSlope2: EngineFlags.KEEP_CURRENT,
stableRateSlope1: EngineFlags.KEEP_CURRENT,
stableRateSlope2: EngineFlags.KEEP_CURRENT
})
});
rateStrategies[4] = IAaveV2ConfigEngine.RateStrategyUpdate({
asset: AaveV2EthereumAMMAssets.WBTC_UNDERLYING,
params: IV2RateStrategyFactory.RateStrategyParams({
optimalUtilizationRate: EngineFlags.KEEP_CURRENT,
baseVariableBorrowRate: _bpsToRay(5_00),
variableRateSlope1: EngineFlags.KEEP_CURRENT,
variableRateSlope2: EngineFlags.KEEP_CURRENT,
stableRateSlope1: EngineFlags.KEEP_CURRENT,
stableRateSlope2: EngineFlags.KEEP_CURRENT
})
});

return rateStrategies;
}
}
Loading
Loading