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.
Merge branch 'bgd-labs:main' into main
- Loading branch information
Showing
22 changed files
with
720 additions
and
6 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -44,6 +44,15 @@ jobs: | |
run: | | ||
cat .github/outputs/all_changed_files.json | ||
- name: replace main with hash | ||
if: github.event_name != 'pull_request' && steps.changed-files.outputs.any_changed == 'true' | ||
run: | | ||
json_array=($(jq -r '.[]' ".github/outputs/all_changed_files.json")) | ||
for i in "${json_array[@]}" | ||
do | ||
sed -i 's@https://github.com/bgd-labs/aave-proposals/blob/main/@https://github.com/bgd-labs/aave-proposals/blob/${{ github.sha }}/@g' $i | ||
done | ||
- name: Upload | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
env: | ||
|
@@ -55,3 +64,12 @@ jobs: | |
do | ||
npx aave-cli ipfs $i -u ${{ github.event_name != 'pull_request'}} | ||
done | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@712add83f26c1e359c046a6ca3dd677fb7017626 | ||
if: github.event_name != 'pull_request' && steps.changed-files.outputs.any_changed == 'true' | ||
with: | ||
committer: Ipfs-bot <[email protected]> | ||
commit-message: "chore(ipfs): automated branch/hash replacement [skip ci]" | ||
title: "chore(ipfs): automated branch/hash replacement" | ||
base: "main" |
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 |
---|---|---|
|
@@ -19,3 +19,6 @@ broadcast | |
reports/* | ||
src/etherscan | ||
!reports/.empty | ||
|
||
# ci artifacts | ||
.github/outputs/ |
25 changes: 25 additions & 0 deletions
25
...Reduction_20230919_postAaveV2_Ethereum_CRVAaveV2EthereumLTReduction_20230919.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,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 | ||
} | ||
} | ||
} | ||
} | ||
``` |
61 changes: 61 additions & 0 deletions
61
...8_postAaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918.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,61 @@ | ||
## Reserve changes | ||
|
||
### Reserve altered | ||
|
||
#### sAVAX ([0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE](https://snowtrace.io/address/0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| ltv | 20 % | 30 % | | ||
| liquidationThreshold | 30 % | 40 % | | ||
|
||
|
||
#### LINK.e ([0x5947BB275c521040051D82396192181b413227A3](https://snowtrace.io/address/0x5947BB275c521040051D82396192181b413227A3)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| ltv | 53 % | 56 % | | ||
| liquidationThreshold | 68 % | 71 % | | ||
|
||
|
||
#### WAVAX ([0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7](https://snowtrace.io/address/0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| liquidationBonus | 10 % | 9 % | | ||
|
||
|
||
## Raw diff | ||
|
||
```json | ||
{ | ||
"reserves": { | ||
"0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE": { | ||
"liquidationThreshold": { | ||
"from": 3000, | ||
"to": 4000 | ||
}, | ||
"ltv": { | ||
"from": 2000, | ||
"to": 3000 | ||
} | ||
}, | ||
"0x5947BB275c521040051D82396192181b413227A3": { | ||
"liquidationThreshold": { | ||
"from": 6800, | ||
"to": 7100 | ||
}, | ||
"ltv": { | ||
"from": 5300, | ||
"to": 5600 | ||
} | ||
}, | ||
"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7": { | ||
"liquidationBonus": { | ||
"from": 11000, | ||
"to": 10900 | ||
} | ||
} | ||
} | ||
} | ||
``` |
5 changes: 5 additions & 0 deletions
5
...unefiActivation_20230920_postAaveV3_Ethereum_AaveImmunefiActivation_20230920.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,5 @@ | ||
## Raw diff | ||
|
||
```json | ||
{} | ||
``` |
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
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
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
49 changes: 49 additions & 0 deletions
49
...aveV3Avalanche/AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918.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,49 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {AaveV3PayloadAvalanche, IEngine, EngineFlags} from 'aave-helpers/v3-config-engine/AaveV3PayloadAvalanche.sol'; | ||
import {AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Avalanche.sol'; | ||
|
||
/** | ||
* @title Chaos Labs Risk Parameter Updates Aave V3 Avalanche | ||
* @author Chaos Labs | ||
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0x0c7fc4246c5795a9d9901c08a9a8279e7e6ed1069f2155fe48239c92e4e43193 | ||
* - Discussion: https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-updates-aave-v3-avalanche-2023-09-06/14774/1 | ||
*/ | ||
contract AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918 is | ||
AaveV3PayloadAvalanche | ||
{ | ||
function collateralsUpdates() public pure override returns (IEngine.CollateralUpdate[] memory) { | ||
IEngine.CollateralUpdate[] memory collateralUpdate = new IEngine.CollateralUpdate[](3); | ||
|
||
collateralUpdate[0] = IEngine.CollateralUpdate({ | ||
asset: AaveV3AvalancheAssets.WAVAX_UNDERLYING, | ||
ltv: EngineFlags.KEEP_CURRENT, | ||
liqThreshold: EngineFlags.KEEP_CURRENT, | ||
liqBonus: 9_00, | ||
debtCeiling: EngineFlags.KEEP_CURRENT, | ||
liqProtocolFee: EngineFlags.KEEP_CURRENT, | ||
eModeCategory: EngineFlags.KEEP_CURRENT | ||
}); | ||
collateralUpdate[1] = IEngine.CollateralUpdate({ | ||
asset: AaveV3AvalancheAssets.sAVAX_UNDERLYING, | ||
ltv: 30_00, | ||
liqThreshold: 40_00, | ||
liqBonus: EngineFlags.KEEP_CURRENT, | ||
debtCeiling: EngineFlags.KEEP_CURRENT, | ||
liqProtocolFee: EngineFlags.KEEP_CURRENT, | ||
eModeCategory: EngineFlags.KEEP_CURRENT | ||
}); | ||
collateralUpdate[2] = IEngine.CollateralUpdate({ | ||
asset: AaveV3AvalancheAssets.LINKe_UNDERLYING, | ||
ltv: 56_00, | ||
liqThreshold: 71_00, | ||
liqBonus: EngineFlags.KEEP_CURRENT, | ||
debtCeiling: EngineFlags.KEEP_CURRENT, | ||
liqProtocolFee: EngineFlags.KEEP_CURRENT, | ||
eModeCategory: EngineFlags.KEEP_CURRENT | ||
}); | ||
|
||
return collateralUpdate; | ||
} | ||
} |
86 changes: 86 additions & 0 deletions
86
...eV3Avalanche/AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918.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,86 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import 'forge-std/Test.sol'; | ||
import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; | ||
import {AaveV3Avalanche, AaveV3AvalancheAssets} from 'aave-address-book/AaveV3Avalanche.sol'; | ||
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; | ||
import {AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918} from './AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918.sol'; | ||
|
||
/** | ||
* @dev Test for AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918 | ||
* command: make test-contract filter=AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918 | ||
*/ | ||
contract AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918_Test is | ||
ProtocolV3TestBase | ||
{ | ||
AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918 internal proposal; | ||
|
||
uint256 public constant WAVAX_LIQUIDATION_BONUS = 109_00; // 10% => 9% | ||
uint256 public constant SAVAX_LIQUIDATION_THRESHOLD = 40_00; // 30% => 40% | ||
uint256 public constant SAVAX_LOAN_TO_VALUE = 30_00; // 20% => 30% | ||
uint256 public constant LINK_E_LIQUIDATION_THRESHOLD = 71_00; // 68% => 71% | ||
uint256 public constant LINK_E_LOAN_TO_VALUE = 56_00; // 53% => 56% | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('avalanche'), 35348781); | ||
proposal = new AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918(); | ||
} | ||
|
||
function testProposalExecution() public { | ||
// 1. create snapshot before payload execution | ||
ReserveConfig[] memory allConfigsBefore = createConfigurationSnapshot( | ||
'preAaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918', | ||
AaveV3Avalanche.POOL | ||
); | ||
|
||
// 2. execute payload | ||
GovHelpers.executePayload( | ||
vm, | ||
address(proposal), | ||
0xa35b76E4935449E33C56aB24b23fcd3246f13470 // avalanche guardian | ||
); | ||
|
||
// 3. create snapshot after payload execution | ||
ReserveConfig[] memory allConfigsAfter = createConfigurationSnapshot( | ||
'postAaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918', | ||
AaveV3Avalanche.POOL | ||
); | ||
|
||
// 4. Verify payloads | ||
// WAVAX | ||
ReserveConfig memory WAVAX_UNDERLYING_CONFIG = _findReserveConfig( | ||
allConfigsBefore, | ||
AaveV3AvalancheAssets.WAVAX_UNDERLYING | ||
); | ||
WAVAX_UNDERLYING_CONFIG.liquidationBonus = WAVAX_LIQUIDATION_BONUS; | ||
_validateReserveConfig(WAVAX_UNDERLYING_CONFIG, allConfigsAfter); | ||
|
||
// sAVAX | ||
ReserveConfig memory SAVAX_UNDERLYING_CONFIG = _findReserveConfig( | ||
allConfigsBefore, | ||
AaveV3AvalancheAssets.sAVAX_UNDERLYING | ||
); | ||
SAVAX_UNDERLYING_CONFIG.liquidationThreshold = SAVAX_LIQUIDATION_THRESHOLD; | ||
SAVAX_UNDERLYING_CONFIG.ltv = SAVAX_LOAN_TO_VALUE; | ||
_validateReserveConfig(SAVAX_UNDERLYING_CONFIG, allConfigsAfter); | ||
|
||
// LINKe | ||
ReserveConfig memory LINK_E_UNDERLYING_CONFIG = _findReserveConfig( | ||
allConfigsBefore, | ||
AaveV3AvalancheAssets.LINKe_UNDERLYING | ||
); | ||
LINK_E_UNDERLYING_CONFIG.liquidationThreshold = LINK_E_LIQUIDATION_THRESHOLD; | ||
LINK_E_UNDERLYING_CONFIG.ltv = LINK_E_LOAN_TO_VALUE; | ||
_validateReserveConfig(LINK_E_UNDERLYING_CONFIG, allConfigsAfter); | ||
|
||
// 5. compare snapshots | ||
diffReports( | ||
'preAaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918', | ||
'postAaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918' | ||
); | ||
|
||
// 6. E2E test | ||
e2eTest(AaveV3Avalanche.POOL); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...UpdatesAaveV3Avalanche/AaveV3_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918.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,34 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovHelpers} from 'aave-helpers/GovHelpers.sol'; | ||
import {EthereumScript, AvalancheScript} from 'aave-helpers/ScriptUtils.sol'; | ||
import {AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918} from './AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918.sol'; | ||
|
||
/** | ||
* @dev Deploy AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918 | ||
* command: make deploy-ledger contract=src/20230918_AaveV3_Ava_ChaosLabsRiskParameterUpdatesAaveV3Avalanche/AaveV3_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918.s.sol:DeployAvalanche chain=avalanche | ||
*/ | ||
contract DeployAvalanche is AvalancheScript { | ||
function run() external broadcast { | ||
new AaveV3_Avalanche_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918(); | ||
} | ||
} | ||
|
||
/** | ||
* @dev Create Proposal | ||
* command: make deploy-ledger contract=src/20230918_AaveV3_Ava_ChaosLabsRiskParameterUpdatesAaveV3Avalanche/AaveV3_ChaosLabsRiskParameterUpdatesAaveV3Avalanche_20230918.s.sol:CreateProposal chain=mainnet | ||
*/ | ||
contract CreateProposal is EthereumScript { | ||
function run() external broadcast { | ||
GovHelpers.Payload[] memory payloads = new GovHelpers.Payload[](0); | ||
|
||
GovHelpers.createProposal( | ||
payloads, | ||
GovHelpers.ipfsHashFile( | ||
vm, | ||
'src/20230918_AaveV3_Ava_ChaosLabsRiskParameterUpdatesAaveV3Avalanche/ChaosLabsRiskParameterUpdatesAaveV3Avalanche.md' | ||
) | ||
); | ||
} | ||
} |
Oops, something went wrong.