forked from bgd-labs/aave-proposals
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chaos Labs - Polygon V3 CRV Risk Parameters Update (bgd-labs#198)
- Loading branch information
Showing
5 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...eV3PolCRVRiskParams_20230702Change_postAaveV3PolCRVRiskParams_20230702Change.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## Reserve changes | ||
|
||
### Reserves altered | ||
|
||
#### CRV ([0x172370d5Cd63279eFa6d502DAB29171933a610AF](https://polygonscan.com/address/0x172370d5Cd63279eFa6d502DAB29171933a610AF)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| ltv | 75 % | 70 % | | ||
| liquidationThreshold | 80 % | 75 % | | ||
|
||
|
||
## Raw diff | ||
|
||
```json | ||
{ | ||
"reserves": { | ||
"0x172370d5Cd63279eFa6d502DAB29171933a610AF": { | ||
"liquidationThreshold": { | ||
"from": 8000, | ||
"to": 7500 | ||
}, | ||
"ltv": { | ||
"from": 7500, | ||
"to": 7000 | ||
} | ||
} | ||
} | ||
} | ||
``` |
29 changes: 29 additions & 0 deletions
29
src/AaveV3PolCRVRiskParams_20230702/AaveV3PolCRVRiskParams_20230702.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.16; | ||
|
||
import {AaveV3PayloadPolygon, IEngine, EngineFlags} from 'aave-helpers/v3-config-engine/AaveV3PayloadPolygon.sol'; | ||
import {AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygon.sol'; | ||
|
||
/** | ||
* @title Update Risk Parameters for CRV on Aave V3 Polygon | ||
* @author @ChaosLabsInc | ||
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x0b04533e8d9ab0f259bd19874ef5b66008a53f55313116cc054e0aa705fa01b6 | ||
* - Discussion: https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-update-crv-aave-v3-polygon-2023-06-20/13767 | ||
*/ | ||
contract AaveV3PolCRVRiskParams_20230702 is AaveV3PayloadPolygon { | ||
function collateralsUpdates() public pure override returns (IEngine.CollateralUpdate[] memory) { | ||
IEngine.CollateralUpdate[] memory collateralUpdate = new IEngine.CollateralUpdate[](1); | ||
|
||
collateralUpdate[0] = IEngine.CollateralUpdate({ | ||
asset: AaveV3PolygonAssets.CRV_UNDERLYING, | ||
ltv: 70_00, | ||
liqThreshold: 75_00, | ||
liqBonus: EngineFlags.KEEP_CURRENT, | ||
debtCeiling: EngineFlags.KEEP_CURRENT, | ||
liqProtocolFee: EngineFlags.KEEP_CURRENT, | ||
eModeCategory: EngineFlags.KEEP_CURRENT | ||
}); | ||
|
||
return collateralUpdate; | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
src/AaveV3PolCRVRiskParams_20230702/AaveV3PolCRVRiskParams_20230702_Test.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.16; | ||
|
||
import {AaveV3Polygon, AaveV3PolygonAssets} from 'aave-address-book/AaveV3Polygon.sol'; | ||
import {AaveV3PolCRVRiskParams_20230702} from './AaveV3PolCRVRiskParams_20230702.sol'; | ||
import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; | ||
import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; | ||
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; | ||
|
||
contract AaveV3PolCRVRiskParams_20230702_Test is ProtocolV3TestBase { | ||
uint256 public constant CRV_UNDERLYING_LIQ_THRESHOLD = 75_00; | ||
uint256 public constant CRV_UNDERLYING_LTV = 70_00; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('polygon'), 44593763); | ||
} | ||
|
||
function testPayload() public { | ||
AaveV3PolCRVRiskParams_20230702 proposalPayload = new AaveV3PolCRVRiskParams_20230702(); | ||
|
||
// 1. create snapshot before payload execution | ||
ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( | ||
'preAaveV3PolCRVRiskParams_20230702Change', | ||
AaveV3Polygon.POOL | ||
); | ||
|
||
// 2. execute payload | ||
GovHelpers.executePayload( | ||
vm, | ||
address(proposalPayload), | ||
AaveGovernanceV2.POLYGON_BRIDGE_EXECUTOR | ||
); | ||
|
||
// 3. create snapshot after payload execution | ||
ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( | ||
'postAaveV3PolCRVRiskParams_20230702Change', | ||
AaveV3Polygon.POOL | ||
); | ||
|
||
// 4. Verify payload: | ||
ReserveConfig memory CRV_UNDERLYING_CONFIG = _findReserveConfig( | ||
allConfigsBefore, | ||
AaveV3PolygonAssets.CRV_UNDERLYING | ||
); | ||
|
||
CRV_UNDERLYING_CONFIG.liquidationThreshold = CRV_UNDERLYING_LIQ_THRESHOLD; | ||
CRV_UNDERLYING_CONFIG.ltv = CRV_UNDERLYING_LTV; | ||
|
||
_validateReserveConfig(CRV_UNDERLYING_CONFIG, allConfigsAfter); | ||
|
||
// 5. compare snapshots | ||
diffReports( | ||
'preAaveV3PolCRVRiskParams_20230702Change', | ||
'postAaveV3PolCRVRiskParams_20230702Change' | ||
); | ||
|
||
_noReservesConfigsChangesApartFrom( | ||
allConfigsBefore, | ||
allConfigsAfter, | ||
AaveV3PolygonAssets.CRV_UNDERLYING | ||
); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...CRVRiskParams_20230702/CHAOS-LABS-RISK-PARAMETERS-UPDATE-CRV-AAVE-V3-POLYGON.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
title: Chaos Labs Risk Parameter Update - CRV Aave V3 Polygon | ||
author: Chaos Labs (@ori-chaoslabs, @yonikesel) | ||
discussions: https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-update-crv-aave-v3-polygon-2023-06-20/13767 | ||
--- | ||
|
||
## Simple Summary | ||
|
||
A proposal to reduce Liquidation Threshold (LT) and Loan-To-Value (LTV) for CRV on Aave V3 Polygon. | ||
|
||
## Motivation | ||
|
||
As the market liquidity of CRV has seen a substantial decline following the initial Polygon V3 listing, this proposal seeks to address this by decreasing the liquidation threshold (LT) and loan-to-value ratio (LTV). The objective is to mitigate the risk exposure associated with CRV and diminish its borrowing power, thereby aligning it more accurately with the existing market climate. | ||
|
||
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. We suggest reaching the desired settings with a series of incremental decreases to minimize this impact. This proposal recommends a slightly more aggressive reduction than the one discussed in the [Risk-Off Framework](https://snapshot.org/#/aave.eth/proposal/bafkreigdmcfmwvnxfolpds4xkdicgrszgmknig7pz2r2t37tltupdpyfu4) previously approved by the community, reducing the LT by 5%. | ||
|
||
Chaos Labs will publicly communicate the planned amendments and list of affected accounts leading to the on-chain execution. | ||
|
||
In the graph below, we share data to quantify and visualize the effect of the recommended reductions on protocol users. At the time of writing this post, zero (0) accounts will be affected by the proposed decrease. | ||
|
||
## Specification | ||
|
||
| Asset | Parameter | Current Value | Recommendation | | ||
| ----- | --------- | ------------- | -------------- | | ||
| CRV | LT | 80 | 75 | | ||
| CRV | LTV | 75 | 70 | | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
25 changes: 25 additions & 0 deletions
25
src/AaveV3PolCRVRiskParams_20230702/DeployAaveV3PolCRVRiskParams_20230702.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
pragma solidity ^0.8.16; | ||
|
||
import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; | ||
import {PolygonScript, EthereumScript} from 'aave-helpers/ScriptUtils.sol'; | ||
import {AaveV3PolCRVRiskParams_20230702} from './AaveV3PolCRVRiskParams_20230702.sol'; | ||
|
||
contract CreateProposal is EthereumScript { | ||
function run() external broadcast { | ||
GovHelpers.Payload[] memory payloads = new GovHelpers.Payload[](1); | ||
payloads[0] = GovHelpers.buildPolygon(address(0)); | ||
GovHelpers.createProposal( | ||
payloads, | ||
GovHelpers.ipfsHashFile( | ||
vm, | ||
'src/AaveV3PolCRVRiskParams_20230702/CHAOS-LABS-RISK-PARAMETERS-UPDATE-CRV-AAVE-V3-POLYGON.md' | ||
) | ||
); | ||
} | ||
} | ||
|
||
contract DeployPayloadPolygon is PolygonScript { | ||
function run() external broadcast { | ||
new AaveV3PolCRVRiskParams_20230702(); | ||
} | ||
} |