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

Chaos Labs CRV LT Reduction Aave V2 Ethereum #16

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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,25 @@
## Reserve changes

### Reserves altered

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

| description | value before | value after |
| --- | --- | --- |
| liquidationThreshold | 47 % | 45 % |


## Raw diff

```json
{
"reserves": {
"0xD533a949740bb3306d119CC777fa900bA034cd52": {
"liquidationThreshold": {
"from": 4700,
"to": 4500
}
}
}
}
```
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_Ethereum_CRVAaveV2EthereumLTReduction_20230919} from './AaveV2_Ethereum_CRVAaveV2EthereumLTReduction_20230919.sol';

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

/**
* @dev Create Proposal
* command: make deploy-ledger contract=src/20230919_AaveV2_Eth_CRVAaveV2EthereumLTReduction/AaveV2_CRVAaveV2EthereumLTReduction_20230919.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(0x77CD8AC33C5cCdaE345C223BCbD0e2d45cb430aF));
GovHelpers.createProposal(
payloads,
GovHelpers.ipfsHashFile(
vm,
'src/20230919_AaveV2_Eth_CRVAaveV2EthereumLTReduction/CRVAaveV2EthereumLTReduction.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 {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol';
import {AaveV2Ethereum, AaveV2EthereumAssets} from 'aave-address-book/AaveV2Ethereum.sol';

/**
* @title CRV Aave V2 Ethereum - LT Reduction
* @author @yonikesel - ChaosLabsInc
* - Snapshot: Direct to AIP
* - Discussion: https://governance.aave.com/t/arfc-crv-aave-v2-ethereum-lt-reduction-09-19-2023/14890
*/
contract AaveV2_Ethereum_CRVAaveV2EthereumLTReduction_20230919 is IProposalGenericExecutor {
uint256 public constant CRV_LIQUIDATION_THRESHOLD = 45_00; // 47 -> 45
uint256 public constant CRV_LTV = 0; // unchanged
uint256 public constant CRV_LIQUIDATION_BONUS = 10800; // unchanged

function execute() external {
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,52 @@
// 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_Ethereum_CRVAaveV2EthereumLTReduction_20230919} from './AaveV2_Ethereum_CRVAaveV2EthereumLTReduction_20230919.sol';

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

uint256 public constant CRV_LIQUIDATION_THRESHOLD = 45_00; // 45%

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

function testProposalExecution() public {
ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot(
'preAaveV2_Ethereum_CRVAaveV2EthereumLTReduction_20230919',
AaveV2Ethereum.POOL
);

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

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

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

diffReports(
'preAaveV2_Ethereum_CRVAaveV2EthereumLTReduction_20230919',
'postAaveV2_Ethereum_CRVAaveV2EthereumLTReduction_20230919'
);

e2eTest(AaveV2Ethereum.POOL);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: "CRV Aave V2 Ethereum LT Reduction"
author: "Chaos Labs"
discussions: "https://governance.aave.com/t/arfc-crv-aave-v2-ethereum-lt-reduction-09-19-2023/14890"
---

## Simple Summary

A proposal to reduce Liquidation Threshold (LT) for CRV on Aave V2 Ethereum.

## Motivation

Following the **[CRV V2 Ethereum Deprecation Plan](https://governance.aave.com/t/arfc-chaos-labs-crv-v2-ethereum-deprecation-plan/14364)** approved by the community and given the current market conditions and protocol usage, Chaos Labs and Gauntlet aligned on a 2% LT reduction.

The individual analyses and considerations can be found in the forum [discussion](https://governance.aave.com/t/arfc-crv-aave-v2-ethereum-lt-reduction-09-19-2023/14890).

## Specification

| Asset | Parameter | Current Value | Recommendation | Change |
| ----- | --------- | ------------- | -------------- | ------ |
| CRV | LT | 47 | 45 | -2% |

## References

- Implementation: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230919_AaveV2_Eth_CRVAaveV2EthereumLTReduction/AaveV2_Ethereum_CRVAaveV2EthereumLTReduction_20230919.sol)
- Tests: [Ethereum](https://github.com/bgd-labs/aave-proposals/blob/main/src/20230919_AaveV2_Eth_CRVAaveV2EthereumLTReduction/AaveV2_Ethereum_CRVAaveV2EthereumLTReduction_20230919.t.sol)
- [Snapshot](Direct to AIP)
- [Discussion](https://governance.aave.com/t/arfc-crv-aave-v2-ethereum-lt-reduction-09-19-2023/14890)

## Copyright

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