Skip to content

Commit

Permalink
Chaos Labs Risk Parameter Updates - CRV Aave V2 Ethereum (bgd-labs#226)
Browse files Browse the repository at this point in the history
* CRV Aave V2 Ethereum Risk Parameters Update

* fix links

* fix author
  • Loading branch information
yonikesel authored Jul 26, 2023
1 parent 9aeb302 commit 7bdd8a4
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Reserve changes

### Reserves altered

#### CRV ([0xD533a949740bb3306d119CC777fa900bA034cd52](https://etherscan.io/address/0xD533a949740bb3306d119CC777fa900bA034cd52))

| description | value before | value after |
| --- | --- | --- |
| ltv | 49 % | 43 % |
| liquidationThreshold | 55 % | 49 % |


## Raw diff

```json
{
"reserves": {
"0xD533a949740bb3306d119CC777fa900bA034cd52": {
"liquidationThreshold": {
"from": 5500,
"to": 4900
},
"ltv": {
"from": 4900,
"to": 4300
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Chaos Labs Risk Parameter Updates - CRV Aave V2 Ethereum
author: Chaos Labs (@ori-chaoslabs, @yonikesel)
discussions: https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-updates-crv-aave-v2-ethereum-2023-07-10/13952
---

## Simple Summary

A proposal to reduce Liquidation Threshold (LT) and Loan-To-Value (LTV), for CRV on Aave V2 Ethereum.

## Motivation

Following our recommendations to decrease Aave’s exposure to CRV on V2 Ethereum [here](https://governance.aave.com/t/gauntlet-recommendation-to-freeze-crv-and-set-crv-ltv-0-on-aave-v2/13644/31), we propose a series of LT and LTV reductions. The [first reduction](https://app.aave.com/governance/proposal/255/) in this cycle of LT updates was executed on July 3rd, 2023. Since the initial post proposing to reduce the LTs for CRV, we’ve observed over 12M CRV withdrawn from V2 Ethereum.

In the Snapshot for this proposal , the community has voted on the "Aggressive" option:

1. “Aggressive” (Chaos recommended) - 6% reduction. This option suggests an LT configuration that optimizes the reduction without significantly increasing the number of accounts eligible for liquidation.

_As Liquidation Threshold reductions may lead to user accounts being eligible for liquidations upon their approval, we want to clarify the full implications to the community at each step. Chaos Labs will publicly communicate the planned amendments and list of affected accounts leading to the on-chain execution._

## Specification

| Asset | Parameter | Current Value | Recommendation | Change |
| ----- | --------- | ------------- | -------------- | ------ |
| CRV | LT | 55 | 49 | -6% |
| CRV | LTV | 49 | 43 | -6% |

## References

- Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/AaveV2_Eth_CRVRiskParamsUpdate_20232507/AaveV2_Eth_CRVRiskParamsUpdate_20232507.sol)
- Tests: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/AaveV2_Eth_CRVRiskParamsUpdate_20232507/AaveV2_Eth_CRVRiskParamsUpdate_20232507.t.sol)
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x8b992ee05d9e87ef0dab2cb7178c24f7b4b6f5d79561ad33298550b3c8d9fe89)
- [Discussion](https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-updates-crv-aave-v2-ethereum-2023-07-10/13952)

## 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,34 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {GovHelpers} from 'aave-helpers/GovHelpers.sol';
import {EthereumScript} from 'aave-helpers/ScriptUtils.sol';
import {AaveV2_Eth_CRVRiskParamsUpdate_20232507} from './AaveV2_Eth_CRVRiskParamsUpdate_20232507.sol';

/**
* @dev Deploy AaveV2_Eth_CRVRiskParamsUpdate_20232507
* command: make deploy-ledger contract=src/AaveV2_Eth_CRVRiskParamsUpdate_20232507/AaveV2_Eth_CRVRiskParamsUpdate_20232507.s.sol:DeployEthereum chain=mainnet
*/
contract DeployEthereum is EthereumScript {
function run() external broadcast {
new AaveV2_Eth_CRVRiskParamsUpdate_20232507();
}
}

/**
* @dev Create Proposal
* command: make deploy-ledger contract=src/AaveV2_Eth_CRVRiskParamsUpdate_20232507/AaveV2_Eth_CRVRiskParamsUpdate_20232507.s.sol:CreateProposal chain=mainnet
*/
contract CreateProposal is EthereumScript {
function run() external broadcast {
GovHelpers.Payload[] memory payloads = new GovHelpers.Payload[](1);
payloads[0] = GovHelpers.buildMainnet(address(0));
GovHelpers.createProposal(
payloads,
GovHelpers.ipfsHashFile(
vm,
'src/AaveV2_Eth_CRVRiskParamsUpdate_20232507/AAVE-V2-CRV-RISK-PARAMS-20232507.md'
)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {AaveV2PayloadEthereum, IEngine, EngineFlags} from 'aave-helpers/v2-config-engine/AaveV2PayloadEthereum.sol';
import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol';

/**
* @title Chaos Labs Risk Parameter Updates - CRV Aave V2 Ethereum
* @author @yonikesel - ChaosLabsInc
* - Snapshot: https://snapshot.org/\#/aave.eth/proposal/0x8b992ee05d9e87ef0dab2cb7178c24f7b4b6f5d79561ad33298550b3c8d9fe89
* - Discussion: https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-updates-crv-aave-v2-ethereum-2023-07-10/13952
*/
contract AaveV2_Eth_CRVRiskParamsUpdate_20232507 is AaveV2PayloadEthereum {
uint256 public constant CRV_LTV = 43_00; /// 49 -> 43
uint256 public constant CRV_LIQUIDATION_THRESHOLD = 49_00; // 55 -> 49
uint256 public constant CRV_LIQUIDATION_BONUS = 10800; //unchanged

function _postExecute() internal override {
AaveV2Ethereum.POOL_CONFIGURATOR.configureReserveAsCollateral(
AaveV2EthereumAssets.CRV_UNDERLYING,
CRV_LTV,
CRV_LIQUIDATION_THRESHOLD,
CRV_LIQUIDATION_BONUS
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// 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 {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol';
import {ProtocolV2TestBase, ReserveConfig} from 'aave-helpers/ProtocolV2TestBase.sol';
import {AaveV2_Eth_CRVRiskParamsUpdate_20232507} from './AaveV2_Eth_CRVRiskParamsUpdate_20232507.sol';

/**
* @dev Test for AaveV2_Eth_CRVRiskParamsUpdate_20232507
* command: make test-contract filter=AaveV2_Eth_CRVRiskParamsUpdate_20232507
*/
contract AaveV2_Eth_CRVRiskParamsUpdate_20232507_Test is ProtocolV2TestBase {
uint256 public constant CRV_LTV = 43_00; // 43%
uint256 public constant CRV_LIQUIDATION_THRESHOLD = 49_00; // 49%

function setUp() public {
vm.createSelectFork(vm.rpcUrl('mainnet'), 17768749);
}

function testProposalExecution() public {
AaveV2_Eth_CRVRiskParamsUpdate_20232507 proposal = new AaveV2_Eth_CRVRiskParamsUpdate_20232507();

ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot(
'preAaveV2_Eth_CRVRiskParamsUpdate_20232507',
AaveV2Ethereum.POOL
);

GovHelpers.executePayload(vm, address(proposal), AaveGovernanceV2.SHORT_EXECUTOR);

ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot(
'postAaveV2_Eth_CRVRiskParamsUpdate_20232507',
AaveV2Ethereum.POOL
);

ReserveConfig memory CRV_UNDERLYING_CONFIG = _findReserveConfig(
allConfigsBefore,
AaveV2EthereumAssets.CRV_UNDERLYING
);
CRV_UNDERLYING_CONFIG.liquidationThreshold = CRV_LIQUIDATION_THRESHOLD;
CRV_UNDERLYING_CONFIG.ltv = CRV_LTV;
_validateReserveConfig(CRV_UNDERLYING_CONFIG, allConfigsAfter);

diffReports(
'preAaveV2_Eth_CRVRiskParamsUpdate_20232507',
'postAaveV2_Eth_CRVRiskParamsUpdate_20232507'
);

e2eTest(AaveV2Ethereum.POOL);
}
}

0 comments on commit 7bdd8a4

Please sign in to comment.