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

AMPL Interest Rate Updates on V2 Ethereum #13

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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/f3e4c54fb5d844c997b8b4b37ce42b85783857eb.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,45 @@
## Reserve changes

### Reserves altered

#### AMPL ([0xD46bA6D942050d489DBd938a2C909A5d5039A161](https://etherscan.io/address/0xD46bA6D942050d489DBd938a2C909A5d5039A161))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 99 % | 99.9 % |
| interestRateStrategy | [0xB2D822cAdb9040F3164829BC34e41a93cA3E01e5](https://etherscan.io/address/0xB2D822cAdb9040F3164829BC34e41a93cA3E01e5) | [0xa324C768Bdd002b3387CE1c691A549268f63250b](https://etherscan.io/address/0xa324C768Bdd002b3387CE1c691A549268f63250b) |
| variableRateSlope2 | 300 % | 0 % |
| interestRate | ![before](/.assets/476ff20939889da0d22c72400271f9f8e240b721.svg) | ![after](/.assets/f3e4c54fb5d844c997b8b4b37ce42b85783857eb.svg) |

## Raw diff

```json
{
"reserves": {
"0xD46bA6D942050d489DBd938a2C909A5d5039A161": {
"interestRateStrategy": {
"from": "0xB2D822cAdb9040F3164829BC34e41a93cA3E01e5",
"to": "0xa324C768Bdd002b3387CE1c691A549268f63250b"
},
"reserveFactor": {
"from": 9900,
"to": 9990
}
}
},
"strategies": {
"0xa324C768Bdd002b3387CE1c691A549268f63250b": {
"from": null,
"to": {
"baseVariableBorrowRate": "200000000000000000000000000",
"maxExcessUsageRatio": "200000000000000000000000000",
"optimalUsageRatio": "800000000000000000000000000",
"stableRateSlope1": 0,
"stableRateSlope2": 0,
"variableRateSlope1": 0,
"variableRateSlope2": 0
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: "AMPL Interest Rate Updates on V2 Ethereum"
author: "Chaos Labs"
discussions: "https://governance.aave.com/t/arfc-ampl-interest-rate-updates-on-v2-ethereum/16189"
---

## Simple Summary

A proposal to reduce the interest rate curves for AMPL on Aave V2 Ethereum.

## Motivation

As per the initial forum post by BGD a few weeks ago 2, over the past few weeks, we have seen an abnormal exponential deviation within the AMPL market, particularly in the context of aAMPL/total supplied liquidity/vAMPL supply values. Although the exact cause of this shift is still under investigation, it appears linked to the unique aAMPL implementation. Specifically, the scaled total supply of the underlying AMPL in the market, and thus by proxy aAMPL supply, seems to rebase irrespective of the utilization rate, in addition to the high interest rates realized by the aAMPL. In the expected implementation however, suppliers and/or borrowers will proportionately receive daily AMPL rebases in accordance with the utilization of the underlying market (where utilization of 100% = zero to AMPL suppliers and 0% = only to AMPL suppliers).

With minimal withdrawals and 100% utilization rate over the last month and a half, it seems as though the correlation has only gotten stronger. Given the rampant growth in aAMPL supply whilst total supplied liquidity has stayed constant, & aAMPL withdrawals are naturally credited 1:1 with underlying AMPL, there is currently a predicament whereby current aAMPL holders cannot be paid out their effective claims on the market. The development of a fair method for distributing these claims, or any potential reimbursement strategy, will be formulated in the upcoming days and weeks, once we have a clearer understanding of the core issue. As such, given the AMPL market’s frozen status since Nov 27th, 2022, and the ongoing deprecation of the market (including setting the RF to 99% on Dec 17th, 2023), suggesting a decrease in slope2 from 300% to 0% could alleviate the interest rate’s impact on aAMPL supply growth, even if primarily realized by the Aave collector. This adjustment seeks to analyze the influence on the relative exponentiation within the current aAMPL supply, and would leave the 20% base rate intact.

## Specification

| Parameter | Current | Recommended |
| -------------- | ------- | ----------- |
| Base | 20% | No Change |
| Slope1 | 0% | No Change |
| Slope2 | 300% | 0% |
| Uoptimal | 80% | No Change |
| Reserve Factor | 99.00% | 99.90% |

## References

- Implementation: [AaveV2Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240121_AaveV2Ethereum_AMPLInterestRateUpdatesOnV2Ethereum/AaveV2Ethereum_AMPLInterestRateUpdatesOnV2Ethereum_20240121.sol)
- Tests: [AaveV2Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240121_AaveV2Ethereum_AMPLInterestRateUpdatesOnV2Ethereum/AaveV2Ethereum_AMPLInterestRateUpdatesOnV2Ethereum_20240121.t.sol)
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xc5373ecc51b9ce6a568f2bb99181cf34efb3f317a4bd340719bc10c864fd1332)
- [Discussion](https://governance.aave.com/t/arfc-ampl-interest-rate-updates-on-v2-ethereum/16189)

## 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} from 'aave-helpers/ScriptUtils.sol';
import {AaveV2Ethereum_AMPLInterestRateUpdatesOnV2Ethereum_20240121} from './AaveV2Ethereum_AMPLInterestRateUpdatesOnV2Ethereum_20240121.sol';

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

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

import {AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol';
import {AaveV2PayloadEthereum} from 'aave-helpers/v2-config-engine/AaveV2PayloadEthereum.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';
import {AaveV2Ethereum, AaveV2EthereumAssets, ILendingPoolConfigurator} from 'aave-address-book/AaveV2Ethereum.sol';

/**
* @title AMPL Interest Rate Updates on V2 Ethereum
* @author Chaos Labs - Eyal Ovadya
* - Snapshot: https://snapshot.org/\#/aave.eth/proposal/0xc5373ecc51b9ce6a568f2bb99181cf34efb3f317a4bd340719bc10c864fd1332
* - Discussion: https://governance.aave.com/t/arfc-ampl-interest-rate-updates-on-v2-ethereum/16189
*/
contract AaveV2Ethereum_AMPLInterestRateUpdatesOnV2Ethereum_20240121 is AaveV2PayloadEthereum {
function _preExecute() internal override {
ILendingPoolConfigurator(AaveV2Ethereum.POOL_CONFIGURATOR).setReserveFactor(
AaveV2EthereumAssets.AMPL_UNDERLYING,
99_90
);
}

function rateStrategiesUpdates()
public
pure
override
returns (IAaveV2ConfigEngine.RateStrategyUpdate[] memory)
{
IAaveV2ConfigEngine.RateStrategyUpdate[]
memory rateStrategies = new IAaveV2ConfigEngine.RateStrategyUpdate[](1);
rateStrategies[0] = IAaveV2ConfigEngine.RateStrategyUpdate({
asset: AaveV2EthereumAssets.AMPL_UNDERLYING,
params: IV2RateStrategyFactory.RateStrategyParams({
optimalUtilizationRate: EngineFlags.KEEP_CURRENT,
baseVariableBorrowRate: EngineFlags.KEEP_CURRENT,
variableRateSlope1: EngineFlags.KEEP_CURRENT,
variableRateSlope2: _bpsToRay(0),
stableRateSlope1: EngineFlags.KEEP_CURRENT,
stableRateSlope2: EngineFlags.KEEP_CURRENT
})
});

return rateStrategies;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol';
import {IDefaultInterestRateStrategy} from 'aave-address-book/AaveV2.sol';

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

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

function setUp() public {
vm.createSelectFork(vm.rpcUrl('mainnet'), 19055881);
proposal = new AaveV2Ethereum_AMPLInterestRateUpdatesOnV2Ethereum_20240121();
}

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

address[] memory assetsChanged = new address[](1);
assetsChanged[0] = AaveV2EthereumAssets.AMPL_UNDERLYING;

_noReservesConfigsChangesApartFrom(allConfigsBefore, allConfigsAfter, assetsChanged);

ReserveConfig memory reserveConfigAfter = _findReserveConfig(allConfigsAfter, assetsChanged[0]);

ReserveConfig memory reserveConfigBefore = _findReserveConfig(
allConfigsBefore,
assetsChanged[0]
);

IDefaultInterestRateStrategy strategy = IDefaultInterestRateStrategy(
reserveConfigBefore.interestRateStrategy
);

InterestStrategyValues memory expectedStrategyValues = InterestStrategyValues({
addressesProvider: address(AaveV2Ethereum.POOL_ADDRESSES_PROVIDER),
optimalUsageRatio: strategy.OPTIMAL_UTILIZATION_RATE(),
baseVariableBorrowRate: strategy.baseVariableBorrowRate(),
variableRateSlope1: strategy.variableRateSlope1(),
variableRateSlope2: 0,
stableRateSlope1: strategy.stableRateSlope1(),
stableRateSlope2: strategy.stableRateSlope2()
});

_validateInterestRateStrategy(
reserveConfigAfter.interestRateStrategy,
reserveConfigAfter.interestRateStrategy,
expectedStrategyValues
);

reserveConfigBefore.reserveFactor = 99_90;
reserveConfigBefore.interestRateStrategy = reserveConfigAfter.interestRateStrategy;
_validateReserveConfig(reserveConfigBefore, allConfigsAfter);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import {ConfigFile} from '../../generator/types';
export const config: ConfigFile = {
rootOptions: {
author: 'Chaos Labs',
pools: ['AaveV2Ethereum'],
title: 'AMPL Interest Rate Updates on V2 Ethereum',
discussion:
'https://governance.aave.com/t/arfc-ampl-interest-rate-updates-on-v2-ethereum/16189',
snapshot:
'https://snapshot.org/\\#/aave.eth/proposal/0xc5373ecc51b9ce6a568f2bb99181cf34efb3f317a4bd340719bc10c864fd1332',
shortName: 'AMPLInterestRateUpdatesOnV2Ethereum',
date: '20240121',
},
poolOptions: {
AaveV2Ethereum: {
configs: {
RATE_UPDATE_V2: [
{
asset: 'AMPL',
params: {
optimalUtilizationRate: '',
baseVariableBorrowRate: '',
variableRateSlope1: '',
variableRateSlope2: '0',
stableRateSlope1: '',
stableRateSlope2: '',
},
},
],
},
cache: {blockNumber: 19055881},
},
},
};