generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update OP LTV and LT on V3 Optimism (#301)
* Update OP LTV and LT on V3 Optimism * Update src/20240415_AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism/AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415.sol Co-authored-by: Lukas <lukasstrassel@googlemail.com> * Update src/20240415_AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism/RiskParameterUpdatesOPOnV3Optimism.md Co-authored-by: Lukas <lukasstrassel@googlemail.com> * Update src/20240415_AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism/RiskParameterUpdatesOPOnV3Optimism.md Co-authored-by: Lukas <lukasstrassel@googlemail.com> * Update src/20240415_AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism/RiskParameterUpdatesOPOnV3Optimism.md Co-authored-by: Lukas <lukasstrassel@googlemail.com> * Fix --------- Co-authored-by: Lukas <lukasstrassel@googlemail.com>
- Loading branch information
1 parent
cef229a
commit 90b7908
Showing
6 changed files
with
238 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...0415_before_AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415_after.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 | ||
|
||
#### OP ([0x4200000000000000000000000000000000000042](https://optimistic.etherscan.io/address/0x4200000000000000000000000000000000000042)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| ltv | 30 % | 50 % | | ||
| liquidationThreshold | 40 % | 60 % | | ||
|
||
|
||
## Raw diff | ||
|
||
```json | ||
{ | ||
"reserves": { | ||
"0x4200000000000000000000000000000000000042": { | ||
"liquidationThreshold": { | ||
"from": 4000, | ||
"to": 6000 | ||
}, | ||
"ltv": { | ||
"from": 3000, | ||
"to": 5000 | ||
} | ||
} | ||
} | ||
} | ||
``` |
35 changes: 35 additions & 0 deletions
35
...meterUpdatesOPOnV3Optimism/AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415.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,35 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {AaveV3OptimismAssets} from 'aave-address-book/AaveV3Optimism.sol'; | ||
import {AaveV3PayloadOptimism} from 'aave-helpers/v3-config-engine/AaveV3PayloadOptimism.sol'; | ||
import {EngineFlags} from 'aave-helpers/v3-config-engine/EngineFlags.sol'; | ||
import {IAaveV3ConfigEngine} from 'aave-helpers/v3-config-engine/IAaveV3ConfigEngine.sol'; | ||
/** | ||
* @title Risk Parameter Updates - OP on V3 Optimism | ||
* @author Chaos Labs | ||
* - Snapshot: https://snapshot.org/#/aave.eth/proposal/0xbaaf99c1e738da5755166fc6b1429265243507fdb9638a31ca177dd81a8b7313 | ||
* - Discussion: https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-updates-op-on-v3-optimism/17326 | ||
*/ | ||
contract AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415 is AaveV3PayloadOptimism { | ||
function collateralsUpdates() | ||
public | ||
pure | ||
override | ||
returns (IAaveV3ConfigEngine.CollateralUpdate[] memory) | ||
{ | ||
IAaveV3ConfigEngine.CollateralUpdate[] | ||
memory collateralUpdate = new IAaveV3ConfigEngine.CollateralUpdate[](1); | ||
|
||
collateralUpdate[0] = IAaveV3ConfigEngine.CollateralUpdate({ | ||
asset: AaveV3OptimismAssets.OP_UNDERLYING, | ||
ltv: 50_00, | ||
liqThreshold: 60_00, | ||
liqBonus: EngineFlags.KEEP_CURRENT, | ||
debtCeiling: EngineFlags.KEEP_CURRENT, | ||
liqProtocolFee: EngineFlags.KEEP_CURRENT | ||
}); | ||
|
||
return collateralUpdate; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...terUpdatesOPOnV3Optimism/AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415.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,44 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {AaveV3Optimism, AaveV3OptimismAssets} from 'aave-address-book/AaveV3Optimism.sol'; | ||
|
||
import 'forge-std/Test.sol'; | ||
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/ProtocolV3TestBase.sol'; | ||
import {AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415} from './AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415.sol'; | ||
|
||
/** | ||
* @dev Test for AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415 | ||
* command: make test-contract filter=AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415 | ||
*/ | ||
contract AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415_Test is ProtocolV3TestBase { | ||
AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415 internal proposal; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('optimism'), 118786899); | ||
proposal = new AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415(); | ||
} | ||
|
||
/** | ||
* @dev executes the generic test suite including e2e and config snapshots | ||
*/ | ||
function test_defaultProposalExecution() public { | ||
(ReserveConfig[] memory allConfigsBefore, ReserveConfig[] memory allConfigsAfter) = defaultTest( | ||
'AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415', | ||
AaveV3Optimism.POOL, | ||
address(proposal) | ||
); | ||
|
||
address[] memory assetsChanged = new address[](1); | ||
assetsChanged[0] = AaveV3OptimismAssets.OP_UNDERLYING; | ||
|
||
_noReservesConfigsChangesApartFrom(allConfigsBefore, allConfigsAfter, assetsChanged); | ||
|
||
ReserveConfig memory config = _findReserveConfig( | ||
allConfigsAfter, | ||
AaveV3OptimismAssets.OP_UNDERLYING | ||
); | ||
assertEq(config.ltv, 50_00); | ||
assertEq(config.liquidationThreshold, 60_00); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...timism_RiskParameterUpdatesOPOnV3Optimism/RiskParameterUpdatesOPOnV3Optimism.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,40 @@ | ||
--- | ||
title: "Risk Parameter Updates - OP on V3 Optimism" | ||
author: "Chaos Labs" | ||
discussions: "https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-updates-op-on-v3-optimism/17326" | ||
snapshot: "https://snapshot.org/#/aave.eth/proposal/0xbaaf99c1e738da5755166fc6b1429265243507fdb9638a31ca177dd81a8b7313" | ||
--- | ||
|
||
## Simple Summary | ||
|
||
A proposal to increase OP’s liquidation threshold and LTV on Aave V3 Optimism. | ||
|
||
## Motivation | ||
|
||
OP is currently configured with a liquidation threshold (LT) of 40% and max loan-to-value (LTV) of 30%. These parameters were intentionally set conservatively and in isolation mode, when the asset was first listed to ensure mechanisms were working as intended. In October 2023, OP was removed from isolation mode. Following our observations, we believe it prudent to increase the LT and LTV for OP. | ||
|
||
OP’s average market cap over the past 180 days is $1.78BN, and its daily average volume is $192M. | ||
It has registered a daily annualized volatility of 98.53%, a 30-day annualized volatility of 92.6%, and its largest single-day price drop was 17.7%. | ||
3.7M of the 7.4M OP supplied is supplied by a single user, who also maintains large positions on Arbitrum and Ethereum. Their last deposit on Optimism was 252K OP on March 12; they repaid $1M USDT on April 6 and currently hold a health score of 2.02. | ||
In general, supply has been trending steadily upwards. | ||
The majority of assets borrowed against OP collateral are stablecoins. That puts these positions at risk of liquidation in the event OP’s price moves falls. | ||
However, collateral at risk does not exceed $100K until OP’s price falls to $2.13, a 35% drop from current levels. | ||
|
||
Given these observations, we recommend first aligning OP’s parameters with ARB’s on Arbitrum (50% LTV and 60% LT), an asset with a similar supply distribution and liquidity profile. Following observations at these levels and utilizing our simulation platform, these parameters may be further optimized. | ||
|
||
## Specification | ||
|
||
| Chain | Asset | Current LTV | Recommended LTV | Current LT | Recommended LT | | ||
| -------- | ----- | ----------- | --------------- | ---------- | -------------- | | ||
| Optimism | OP | 30.00% | 50.00% | 40.00% | 60.00% | | ||
|
||
## References | ||
|
||
- Implementation: [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240415_AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism/AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415.sol) | ||
- Tests: [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240415_AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism/AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415.t.sol) | ||
- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0xbaaf99c1e738da5755166fc6b1429265243507fdb9638a31ca177dd81a8b7313) | ||
- [Discussion](https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-updates-op-on-v3-optimism/17326) | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
58 changes: 58 additions & 0 deletions
58
...mism_RiskParameterUpdatesOPOnV3Optimism/RiskParameterUpdatesOPOnV3Optimism_20240415.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,58 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; | ||
import {EthereumScript, OptimismScript} from 'aave-helpers/ScriptUtils.sol'; | ||
import {AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415} from './AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415.sol'; | ||
|
||
/** | ||
* @dev Deploy Optimism | ||
* deploy-command: make deploy-ledger contract=src/20240415_AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism/RiskParameterUpdatesOPOnV3Optimism_20240415.s.sol:DeployOptimism chain=optimism | ||
* verify-command: npx catapulta-verify -b broadcast/RiskParameterUpdatesOPOnV3Optimism_20240415.s.sol/10/run-latest.json | ||
*/ | ||
contract DeployOptimism is OptimismScript { | ||
function run() external broadcast { | ||
// deploy payloads | ||
address payload0 = GovV3Helpers.deployDeterministic( | ||
type(AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415).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/20240415_AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism/RiskParameterUpdatesOPOnV3Optimism_20240415.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 actionsOptimism = new IPayloadsControllerCore.ExecutionAction[](1); | ||
actionsOptimism[0] = GovV3Helpers.buildAction( | ||
type(AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism_20240415).creationCode | ||
); | ||
payloads[0] = GovV3Helpers.buildOptimismPayload(vm, actionsOptimism); | ||
|
||
// create proposal | ||
vm.startBroadcast(); | ||
GovV3Helpers.createProposal( | ||
vm, | ||
payloads, | ||
GovV3Helpers.ipfsHashFile( | ||
vm, | ||
'src/20240415_AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism/RiskParameterUpdatesOPOnV3Optimism.md' | ||
) | ||
); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/20240415_AaveV3Optimism_RiskParameterUpdatesOPOnV3Optimism/config.ts
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,31 @@ | ||
import {ConfigFile} from '../../generator/types'; | ||
export const config: ConfigFile = { | ||
rootOptions: { | ||
pools: ['AaveV3Optimism'], | ||
title: 'Risk Parameter Updates - OP on V3 Optimism', | ||
shortName: 'RiskParameterUpdatesOPOnV3Optimism', | ||
date: '20240415', | ||
author: 'Chaos Labs', | ||
discussion: | ||
'https://governance.aave.com/t/arfc-chaos-labs-risk-parameter-updates-op-on-v3-optimism/17326', | ||
snapshot: | ||
'https://snapshot.org/#/aave.eth/proposal/0xbaaf99c1e738da5755166fc6b1429265243507fdb9638a31ca177dd81a8b7313', | ||
}, | ||
poolOptions: { | ||
AaveV3Optimism: { | ||
configs: { | ||
COLLATERALS_UPDATE: [ | ||
{ | ||
asset: 'OP', | ||
ltv: '50', | ||
liqThreshold: '60', | ||
liqBonus: '', | ||
debtCeiling: '', | ||
liqProtocolFee: '', | ||
}, | ||
], | ||
}, | ||
cache: {blockNumber: 118786899}, | ||
}, | ||
}, | ||
}; |
90b7908
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Foundry report
Build log
Test success 🌈