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.
* feat: Gnosis update * fix: osGNO pricefeed * implement Part 1 without OsGNO --------- Co-authored-by: Marc Zeller <[email protected]> Co-authored-by: marczeller <[email protected]>
- Loading branch information
1 parent
d312140
commit 0ddae1e
Showing
6 changed files
with
403 additions
and
0 deletions.
There are no files selected for viewing
70 changes: 70 additions & 0 deletions
70
...ates_20241224_before_AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224_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,70 @@ | ||
## Reserve changes | ||
|
||
### Reserve altered | ||
|
||
#### GNO ([0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb](https://gnosisscan.io/address/0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| debtCeiling | 2,000,000 $ [200000000] | 0 $ [0] | | ||
|
||
|
||
#### EURe ([0xcB444e90D8198415266c6a2724b7900fb12FC56E](https://gnosisscan.io/address/0xcB444e90D8198415266c6a2724b7900fb12FC56E)) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| reserveFactor | 20 % [2000] | 10 % [1000] | | ||
|
||
|
||
## Emodes changed | ||
|
||
### EMode: ETH correlated(id: 1) | ||
|
||
|
||
|
||
### EMode: sDAI / EURe(id: 2) | ||
|
||
| description | value before | value after | | ||
| --- | --- | --- | | ||
| eMode.label | - | sDAI / EURe | | ||
| eMode.ltv | - | 85 % | | ||
| eMode.liquidationThreshold | - | 87.5 % | | ||
| eMode.liquidationBonus | - | 5 % | | ||
| eMode.borrowableBitmap | - | EURe | | ||
| eMode.collateralBitmap | - | sDAI | | ||
|
||
|
||
## Raw diff | ||
|
||
```json | ||
{ | ||
"eModes": { | ||
"2": { | ||
"from": null, | ||
"to": { | ||
"borrowableBitmap": "32", | ||
"collateralBitmap": "64", | ||
"eModeCategory": 2, | ||
"label": "sDAI / EURe", | ||
"liquidationBonus": 10500, | ||
"liquidationThreshold": 8750, | ||
"ltv": 8500 | ||
} | ||
} | ||
}, | ||
"reserves": { | ||
"0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb": { | ||
"debtCeiling": { | ||
"from": 200000000, | ||
"to": 0 | ||
} | ||
}, | ||
"0xcB444e90D8198415266c6a2724b7900fb12FC56E": { | ||
"reserveFactor": { | ||
"from": 2000, | ||
"to": 1000 | ||
} | ||
} | ||
} | ||
} | ||
``` |
49 changes: 49 additions & 0 deletions
49
...0241224_AaveV3Gnosis_AaveV3GnosisInstanceUpdates/AaveV3GnosisInstanceUpdates.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,49 @@ | ||
--- | ||
title: "Aave v3 Gnosis Instance Updates Part 1" | ||
author: "Aave-chan Initiative" | ||
discussions: "https://governance.aave.com/t/arfc-aave-v3-gnosis-instance-updates/20334" | ||
snapshot: "https://snapshot.box/#/s:aave.eth/proposal/0x2e93ddd01ba5ec415b0962907b7c65def947d1ed94f1e5b402c5578560b1dddb" | ||
--- | ||
|
||
## Simple Summary | ||
|
||
This AIP proposes several updates to the Aave v3 Gnosis instance to improve capital efficiency and add new use cases on the network. The key changes include removing GNO from isolation mode, adjusting the reserve factor for EURe, and creating a new relevant E-mode. | ||
|
||
## Motivation | ||
|
||
GNO has demonstrated strong stability and market presence on Gnosis Chain, making isolation mode unnecessarily restrictive and hindering network growth. Removing GNO from isolation mode will facilitate further expansion of the network. | ||
|
||
The reduction in the EURe reserve factor aligns with the asset's performance and incentivizes increased lending activity. | ||
|
||
introducing a new E-mode for sDAI & EURe will enhance capital efficiency and foster synergies between stable assets. The unique combination of EUR and USD borrowing opportunities is a distinct advantage for Gnosis Chain. | ||
|
||
## Specification | ||
|
||
### Rates and parameters updates | ||
|
||
- Remove GNO from isolation mode | ||
- change EURe Reserve Factor from 20% to 10% | ||
|
||
### E-Modes | ||
|
||
The followings E-mode will be created: | ||
|
||
| **Parameter** | **Value** | **Value** | | ||
| --------------------- | --------- | --------- | | ||
| Asset | sDAI | EURe | | ||
| Collateral | Yes | No | | ||
| Borrowable | No | Yes | | ||
| Max LTV | 85% | 85% | | ||
| Liquidation Threshold | 87.5% | 87.5% | | ||
| Liquidation Bonus | 5% | 5% | | ||
|
||
## References | ||
|
||
- Implementation: [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241224_AaveV3Gnosis_AaveV3GnosisInstanceUpdates/AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224.sol) | ||
- Tests: [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20241224_AaveV3Gnosis_AaveV3GnosisInstanceUpdates/AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224.t.sol) | ||
- [Snapshot](https://snapshot.box/#/s:aave.eth/proposal/0x2e93ddd01ba5ec415b0962907b7c65def947d1ed94f1e5b402c5578560b1dddb) | ||
- [Discussion](https://governance.aave.com/t/arfc-aave-v3-gnosis-instance-updates/20334) | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
60 changes: 60 additions & 0 deletions
60
...41224_AaveV3Gnosis_AaveV3GnosisInstanceUpdates/AaveV3GnosisInstanceUpdates_20241224.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,60 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/src/GovV3Helpers.sol'; | ||
import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; | ||
import {EthereumScript, GnosisScript} from 'solidity-utils/contracts/utils/ScriptUtils.sol'; | ||
import {AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224} from './AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224.sol'; | ||
|
||
/** | ||
* @dev Deploy Gnosis | ||
* deploy-command: make deploy-ledger contract=src/20241224_AaveV3Gnosis_AaveV3GnosisInstanceUpdates/AaveV3GnosisInstanceUpdates_20241224.s.sol:DeployGnosis chain=gnosis | ||
* verify-command: FOUNDRY_PROFILE=gnosis npx catapulta-verify -b broadcast/AaveV3GnosisInstanceUpdates_20241224.s.sol/100/run-latest.json | ||
*/ | ||
contract DeployGnosis is GnosisScript { | ||
function run() external broadcast { | ||
// deploy payloads | ||
address payload0 = GovV3Helpers.deployDeterministic( | ||
type(AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224).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/20241224_AaveV3Gnosis_AaveV3GnosisInstanceUpdates/AaveV3GnosisInstanceUpdates_20241224.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 actionsGnosis = new IPayloadsControllerCore.ExecutionAction[](1); | ||
actionsGnosis[0] = GovV3Helpers.buildAction( | ||
type(AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224).creationCode | ||
); | ||
payloads[0] = GovV3Helpers.buildGnosisPayload(vm, actionsGnosis); | ||
|
||
// create proposal | ||
vm.startBroadcast(); | ||
GovV3Helpers.createProposal( | ||
vm, | ||
payloads, | ||
GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL, | ||
GovV3Helpers.ipfsHashFile( | ||
vm, | ||
'src/20241224_AaveV3Gnosis_AaveV3GnosisInstanceUpdates/AaveV3GnosisInstanceUpdates.md' | ||
) | ||
); | ||
} | ||
} |
103 changes: 103 additions & 0 deletions
103
...3Gnosis_AaveV3GnosisInstanceUpdates/AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224.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,103 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {AaveV3Gnosis, AaveV3GnosisAssets} from 'aave-address-book/AaveV3Gnosis.sol'; | ||
import {AaveV3PayloadGnosis} from 'aave-helpers/src/v3-config-engine/AaveV3PayloadGnosis.sol'; | ||
import {EngineFlags} from 'aave-v3-origin/contracts/extensions/v3-config-engine/EngineFlags.sol'; | ||
import {IAaveV3ConfigEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol'; | ||
import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; | ||
import {SafeERC20} from 'solidity-utils/contracts/oz-common/SafeERC20.sol'; | ||
import {IEmissionManager} from 'aave-v3-origin/contracts/rewards/interfaces/IEmissionManager.sol'; | ||
/** | ||
* @title Aave v3 Gnosis Instance Updates | ||
* @author Aave-chan Initiative | ||
* - Snapshot: https://snapshot.box/#/s:aave.eth/proposal/0x2e93ddd01ba5ec415b0962907b7c65def947d1ed94f1e5b402c5578560b1dddb | ||
* - Discussion: https://governance.aave.com/t/arfc-aave-v3-gnosis-instance-updates/20334 | ||
*/ | ||
contract AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224 is AaveV3PayloadGnosis { | ||
using SafeERC20 for IERC20; | ||
|
||
function collateralsUpdates() | ||
public | ||
pure | ||
override | ||
returns (IAaveV3ConfigEngine.CollateralUpdate[] memory) | ||
{ | ||
IAaveV3ConfigEngine.CollateralUpdate[] | ||
memory collateralUpdate = new IAaveV3ConfigEngine.CollateralUpdate[](1); | ||
|
||
collateralUpdate[0] = IAaveV3ConfigEngine.CollateralUpdate({ | ||
asset: AaveV3GnosisAssets.GNO_UNDERLYING, | ||
ltv: EngineFlags.KEEP_CURRENT, | ||
liqThreshold: EngineFlags.KEEP_CURRENT, | ||
liqBonus: EngineFlags.KEEP_CURRENT, | ||
debtCeiling: 0, | ||
liqProtocolFee: EngineFlags.KEEP_CURRENT | ||
}); | ||
|
||
return collateralUpdate; | ||
} | ||
function borrowsUpdates() | ||
public | ||
pure | ||
override | ||
returns (IAaveV3ConfigEngine.BorrowUpdate[] memory) | ||
{ | ||
IAaveV3ConfigEngine.BorrowUpdate[] | ||
memory borrowUpdates = new IAaveV3ConfigEngine.BorrowUpdate[](1); | ||
|
||
borrowUpdates[0] = IAaveV3ConfigEngine.BorrowUpdate({ | ||
asset: AaveV3GnosisAssets.EURe_UNDERLYING, | ||
enabledToBorrow: EngineFlags.KEEP_CURRENT, | ||
flashloanable: EngineFlags.KEEP_CURRENT, | ||
borrowableInIsolation: EngineFlags.KEEP_CURRENT, | ||
withSiloedBorrowing: EngineFlags.KEEP_CURRENT, | ||
reserveFactor: 10_00 | ||
}); | ||
|
||
return borrowUpdates; | ||
} | ||
function eModeCategoriesUpdates() | ||
public | ||
pure | ||
override | ||
returns (IAaveV3ConfigEngine.EModeCategoryUpdate[] memory) | ||
{ | ||
IAaveV3ConfigEngine.EModeCategoryUpdate[] | ||
memory eModeUpdates = new IAaveV3ConfigEngine.EModeCategoryUpdate[](1); | ||
|
||
eModeUpdates[0] = IAaveV3ConfigEngine.EModeCategoryUpdate({ | ||
eModeCategory: 2, | ||
ltv: 85_00, | ||
liqThreshold: 87_50, | ||
liqBonus: 5_00, | ||
label: 'sDAI / EURe' | ||
}); | ||
|
||
return eModeUpdates; | ||
} | ||
function assetsEModeUpdates() | ||
public | ||
pure | ||
override | ||
returns (IAaveV3ConfigEngine.AssetEModeUpdate[] memory) | ||
{ | ||
IAaveV3ConfigEngine.AssetEModeUpdate[] | ||
memory assetEModeUpdates = new IAaveV3ConfigEngine.AssetEModeUpdate[](2); | ||
|
||
assetEModeUpdates[0] = IAaveV3ConfigEngine.AssetEModeUpdate({ | ||
asset: AaveV3GnosisAssets.EURe_UNDERLYING, | ||
eModeCategory: 2, | ||
borrowable: EngineFlags.ENABLED, | ||
collateral: EngineFlags.DISABLED | ||
}); | ||
assetEModeUpdates[1] = IAaveV3ConfigEngine.AssetEModeUpdate({ | ||
asset: AaveV3GnosisAssets.sDAI_UNDERLYING, | ||
eModeCategory: 2, | ||
borrowable: EngineFlags.DISABLED, | ||
collateral: EngineFlags.ENABLED | ||
}); | ||
|
||
return assetEModeUpdates; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...nosis_AaveV3GnosisInstanceUpdates/AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224.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,35 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {GovV3Helpers} from 'aave-helpers/src/GovV3Helpers.sol'; | ||
import {AaveV3Gnosis} from 'aave-address-book/AaveV3Gnosis.sol'; | ||
import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; | ||
import {IEmissionManager} from 'aave-v3-origin/contracts/rewards/interfaces/IEmissionManager.sol'; | ||
|
||
import 'forge-std/Test.sol'; | ||
import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; | ||
import {AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224} from './AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224.sol'; | ||
|
||
/** | ||
* @dev Test for AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224 | ||
* command: FOUNDRY_PROFILE=gnosis forge test --match-path=src/20241224_AaveV3Gnosis_AaveV3GnosisInstanceUpdates/AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224.t.sol -vv | ||
*/ | ||
contract AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224_Test is ProtocolV3TestBase { | ||
AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224 internal proposal; | ||
|
||
function setUp() public { | ||
vm.createSelectFork(vm.rpcUrl('gnosis'), 37810182); | ||
proposal = new AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224(); | ||
} | ||
|
||
/** | ||
* @dev executes the generic test suite including e2e and config snapshots | ||
*/ | ||
function test_defaultProposalExecution() public { | ||
defaultTest( | ||
'AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224', | ||
AaveV3Gnosis.POOL, | ||
address(proposal) | ||
); | ||
} | ||
} |
Oops, something went wrong.
0ddae1e
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.
🔧 Build logs
🔧 Build logs zksync
0ddae1e
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.
🌈Test Results
No files changed, compilation skipped 2025-01-03T16:28:43.698912Z ERROR cheatcodes: non-empty stderr input=["npx", "@bgd-labs/aave-cli@^1.1.12", "diff-snapshots", "./reports/AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224_before.json", "./reports/AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224_after.json", "-o", "./diffs/AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224_before_AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224_after.md"] stderr="npm warn exec The following package was not found and will be installed: @bgd-labs/[email protected]\n"Ran 1 test for src/20241224_AaveV3Gnosis_AaveV3GnosisInstanceUpdates/AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224.t.sol:AaveV3Gnosis_AaveV3GnosisInstanceUpdates_20241224_Test
[PASS] test_defaultProposalExecution() (gas: 16555725)
Logs:
0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1
0x6C76971f98945AE98dD7d4DFcA8711ebea946eA6
0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb
0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83
0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d
0xcB444e90D8198415266c6a2724b7900fb12FC56E
0x2a22f9c3b484c3629090FeED35F17Ff8F88f76F0
E2E: Collateral WETH, TestAsset WETH
SUPPLY: WETH, Amount: 29900550768145149233
SUPPLY: WETH, Amount: 299005507681451492
WITHDRAW: WETH, Amount: 149502753840725746
WITHDRAW: WETH, Amount: 149502753840725745
BORROW: WETH, Amount 299005507681451492
REPAY: WETH, Amount: 299005507681451492
E2E: Collateral WETH, TestAsset wstETH
SUPPLY: WETH, Amount: 29900550768145149233
SUPPLY: wstETH, Amount: 251407805207072429
WITHDRAW: wstETH, Amount: 125703902603536214
WITHDRAW: wstETH, Amount: 125703902603536216
BORROW: wstETH, Amount 251407805207072429
REPAY: wstETH, Amount: 251407805207072429
E2E: Collateral WETH, TestAsset GNO
SUPPLY: WETH, Amount: 29900550768145149233
SUPPLY: GNO, Amount: 3715698542973746094
WITHDRAW: GNO, Amount: 1857849271486873047
WITHDRAW: GNO, Amount: 1857849271486873048
BORROW: GNO, Amount 3715698542973746094
REPAY: GNO, Amount: 3715698542973746094
E2E: Collateral WETH, TestAsset USDC
SUPPLY: WETH, Amount: 29900550768145149233
SUPPLY: USDC, Amount: 1000050002
WITHDRAW: USDC, Amount: 500025001
WITHDRAW: USDC, Amount: 500025001
BORROW: USDC, Amount 1000050002
REPAY: USDC, Amount: 1000050002
E2E: Collateral WETH, TestAsset WXDAI
SUPPLY: WETH, Amount: 29900550768145149233
SUPPLY: WXDAI, Amount: 999812005348634296293
WITHDRAW: WXDAI, Amount: 499906002674317148146
WITHDRAW: WXDAI, Amount: 499906002674317148148
BORROW: WXDAI, Amount 999812005348634296293
REPAY: WXDAI, Amount: 999812005348634296293
E2E: Collateral WETH, TestAsset EURe
SUPPLY: WETH, Amount: 29900550768145149233
SUPPLY: EURe, Amount: 965502592374460525426
WITHDRAW: EURe, Amount: 482751296187230262713
WITHDRAW: EURe, Amount: 482751296187230262713
BORROW: EURe, Amount 965502592374460525426
REPAY: EURe, Amount: 965502592374460525426
E2E: Collateral WETH, TestAsset sDAI
SUPPLY: WETH, Amount: 29900550768145149233
SUPPLY: sDAI, Amount: 876755788951063928245
WITHDRAW: sDAI, Amount: 438377894475531964122
WITHDRAW: sDAI, Amount: 438377894475531964124
E2E: Collateral WETH, TestAsset USDC.e
SUPPLY: WETH, Amount: 29900550768145149233
SUPPLY: USDC.e, Amount: 1000050002
WITHDRAW: USDC.e, Amount: 500025001
WITHDRAW: USDC.e, Amount: 500025002
BORROW: USDC.e, Amount 1000050002
REPAY: USDC.e, Amount: 1000050002
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 90.65s (89.23s CPU time)
Ran 1 test suite in 90.66s (90.65s CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)