Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

WIP: Add mai deprecation proposal #346

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions .assets/4422a290bbbd57f615385e22c6be99ae91417cb5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .assets/ea5b7a01297938e46e8a311bf8a452b147d325a3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## Reserve changes

### Reserves altered

#### MAI ([0x3F56e0c36d275367b8C502090EDF38289b3dEa0d](https://arbiscan.io/address/0x3F56e0c36d275367b8C502090EDF38289b3dEa0d))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 20 % | 95 % |
| interestRateStrategy | [0xA6459195d60A797D278f58Ffbd2BA62Fb3F7FA1E](https://arbiscan.io/address/0xA6459195d60A797D278f58Ffbd2BA62Fb3F7FA1E) | [0xb02381b1d27aA9845e5012083CA288c1818884f0](https://arbiscan.io/address/0xb02381b1d27aA9845e5012083CA288c1818884f0) |
| optimalUsageRatio | 80 % | 45 % |
| maxExcessUsageRatio | 20 % | 55 % |
| variableRateSlope2 | 75 % | 300 % |
| interestRate | ![before](/.assets/6328b8017499aaa1d67053e893c4dc04fca7def7.svg) | ![after](/.assets/ea5b7a01297938e46e8a311bf8a452b147d325a3.svg) |

## Raw diff

```json
{
"reserves": {
"0x3F56e0c36d275367b8C502090EDF38289b3dEa0d": {
"interestRateStrategy": {
"from": "0xA6459195d60A797D278f58Ffbd2BA62Fb3F7FA1E",
"to": "0xb02381b1d27aA9845e5012083CA288c1818884f0"
},
"reserveFactor": {
"from": 2000,
"to": 9500
}
}
},
"strategies": {
"0xb02381b1d27aA9845e5012083CA288c1818884f0": {
"from": null,
"to": {
"baseStableBorrowRate": "50000000000000000000000000",
"baseVariableBorrowRate": 0,
"maxExcessStableToTotalDebtRatio": "800000000000000000000000000",
"maxExcessUsageRatio": "550000000000000000000000000",
"optimalStableToTotalDebtRatio": "200000000000000000000000000",
"optimalUsageRatio": "450000000000000000000000000",
"stableRateSlope1": "40000000000000000000000000",
"stableRateSlope2": "750000000000000000000000000",
"variableRateSlope1": "40000000000000000000000000",
"variableRateSlope2": "3000000000000000000000000000"
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## Reserve changes

### Reserves altered

#### MAI ([0x5c49b268c9841AFF1Cc3B0a418ff5c3442eE3F3b](https://snowtrace.io/address/0x5c49b268c9841AFF1Cc3B0a418ff5c3442eE3F3b))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 20 % | 95 % |
| interestRateStrategy | [0xfab05a6aF585da2F96e21452F91E812452996BD3](https://snowtrace.io/address/0xfab05a6aF585da2F96e21452F91E812452996BD3) | [0x04daBC3C1c052AB94AA2ca80140f2b978d2F6E17](https://snowtrace.io/address/0x04daBC3C1c052AB94AA2ca80140f2b978d2F6E17) |
| optimalUsageRatio | 80 % | 45 % |
| maxExcessUsageRatio | 20 % | 55 % |
| variableRateSlope2 | 75 % | 300 % |
| interestRate | ![before](/.assets/8d9de32bf30b1c9dcf71f07a13b228c69a71a4ce.svg) | ![after](/.assets/4422a290bbbd57f615385e22c6be99ae91417cb5.svg) |

## Raw diff

```json
{
"reserves": {
"0x5c49b268c9841AFF1Cc3B0a418ff5c3442eE3F3b": {
"interestRateStrategy": {
"from": "0xfab05a6aF585da2F96e21452F91E812452996BD3",
"to": "0x04daBC3C1c052AB94AA2ca80140f2b978d2F6E17"
},
"reserveFactor": {
"from": 2000,
"to": 9500
}
}
},
"strategies": {
"0x04daBC3C1c052AB94AA2ca80140f2b978d2F6E17": {
"from": null,
"to": {
"baseStableBorrowRate": "50000000000000000000000000",
"baseVariableBorrowRate": 0,
"maxExcessStableToTotalDebtRatio": "800000000000000000000000000",
"maxExcessUsageRatio": "550000000000000000000000000",
"optimalStableToTotalDebtRatio": "200000000000000000000000000",
"optimalUsageRatio": "450000000000000000000000000",
"stableRateSlope1": "5000000000000000000000000",
"stableRateSlope2": "750000000000000000000000000",
"variableRateSlope1": "40000000000000000000000000",
"variableRateSlope2": "3000000000000000000000000000"
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Reserve changes

### Reserves altered

#### MAI ([0xdFA46478F9e5EA86d57387849598dbFB2e964b02](https://optimistic.etherscan.io/address/0xdFA46478F9e5EA86d57387849598dbFB2e964b02))

| description | value before | value after |
| --- | --- | --- |
| liquidationThreshold | 80 % | 65 % |
| reserveFactor | 20 % | 95 % |
| interestRateStrategy | [0xD624AFA34614B4fe7FEe7e1751a2E5E04fb47398](https://optimistic.etherscan.io/address/0xD624AFA34614B4fe7FEe7e1751a2E5E04fb47398) | [0x6D6D3b7FC50999bf20dE5CC8e0F63AFD18B95f0e](https://optimistic.etherscan.io/address/0x6D6D3b7FC50999bf20dE5CC8e0F63AFD18B95f0e) |
| optimalUsageRatio | 80 % | 45 % |
| maxExcessUsageRatio | 20 % | 55 % |
| variableRateSlope2 | 75 % | 300 % |
| interestRate | ![before](/.assets/6328b8017499aaa1d67053e893c4dc04fca7def7.svg) | ![after](/.assets/ea5b7a01297938e46e8a311bf8a452b147d325a3.svg) |

## Raw diff

```json
{
"reserves": {
"0xdFA46478F9e5EA86d57387849598dbFB2e964b02": {
"interestRateStrategy": {
"from": "0xD624AFA34614B4fe7FEe7e1751a2E5E04fb47398",
"to": "0x6D6D3b7FC50999bf20dE5CC8e0F63AFD18B95f0e"
},
"liquidationThreshold": {
"from": 8000,
"to": 6500
},
"reserveFactor": {
"from": 2000,
"to": 9500
}
}
},
"strategies": {
"0x6D6D3b7FC50999bf20dE5CC8e0F63AFD18B95f0e": {
"from": null,
"to": {
"baseStableBorrowRate": "50000000000000000000000000",
"baseVariableBorrowRate": 0,
"maxExcessStableToTotalDebtRatio": "800000000000000000000000000",
"maxExcessUsageRatio": "550000000000000000000000000",
"optimalStableToTotalDebtRatio": "200000000000000000000000000",
"optimalUsageRatio": "450000000000000000000000000",
"stableRateSlope1": "40000000000000000000000000",
"stableRateSlope2": "750000000000000000000000000",
"variableRateSlope1": "40000000000000000000000000",
"variableRateSlope2": "3000000000000000000000000000"
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## Reserve changes

### Reserves altered

#### miMATIC ([0xa3Fa99A148fA48D14Ed51d610c367C61876997F1](https://polygonscan.com/address/0xa3Fa99A148fA48D14Ed51d610c367C61876997F1))

| description | value before | value after |
| --- | --- | --- |
| reserveFactor | 20 % | 95 % |
| interestRateStrategy | [0xA9F3C3caE095527061e6d270DBE163693e6fda9D](https://polygonscan.com/address/0xA9F3C3caE095527061e6d270DBE163693e6fda9D) | [0xD87974E8ED49AB16d5053ba793F4e17078Be0426](https://polygonscan.com/address/0xD87974E8ED49AB16d5053ba793F4e17078Be0426) |
| optimalUsageRatio | 80 % | 45 % |
| maxExcessUsageRatio | 20 % | 55 % |
| variableRateSlope2 | 75 % | 300 % |
| interestRate | ![before](/.assets/8d9de32bf30b1c9dcf71f07a13b228c69a71a4ce.svg) | ![after](/.assets/4422a290bbbd57f615385e22c6be99ae91417cb5.svg) |

## Raw diff

```json
{
"reserves": {
"0xa3Fa99A148fA48D14Ed51d610c367C61876997F1": {
"interestRateStrategy": {
"from": "0xA9F3C3caE095527061e6d270DBE163693e6fda9D",
"to": "0xD87974E8ED49AB16d5053ba793F4e17078Be0426"
},
"reserveFactor": {
"from": 2000,
"to": 9500
}
}
},
"strategies": {
"0xD87974E8ED49AB16d5053ba793F4e17078Be0426": {
"from": null,
"to": {
"baseStableBorrowRate": "50000000000000000000000000",
"baseVariableBorrowRate": 0,
"maxExcessStableToTotalDebtRatio": "800000000000000000000000000",
"maxExcessUsageRatio": "550000000000000000000000000",
"optimalStableToTotalDebtRatio": "200000000000000000000000000",
"optimalUsageRatio": "450000000000000000000000000",
"stableRateSlope1": "5000000000000000000000000",
"stableRateSlope2": "750000000000000000000000000",
"variableRateSlope1": "40000000000000000000000000",
"variableRateSlope2": "3000000000000000000000000000"
}
}
}
}
```
72 changes: 72 additions & 0 deletions src/AaveV3Update_20231024mai/AaveV3Arbitrum_20231024mai.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IEngine, EngineFlags, Rates} from 'aave-helpers/v3-config-engine/AaveV3PayloadBase.sol';
import {AaveV3PayloadArbitrum, AaveV3ArbitrumAssets} from 'aave-helpers/v3-config-engine/AaveV3PayloadArbitrum.sol';

/**
* @title MAI/MIMATIC deprecation, 2023.10.23
* @author Gauntlet
* - Discussion: https://governance.aave.com/t/arfc-gauntlet-recommendation-for-mai-mimatic-deprecation/15119
*/
contract AaveV3ArbitrumUpdate20231024maiPayload is AaveV3PayloadArbitrum {
function collateralsUpdates() public pure override returns (IEngine.CollateralUpdate[] memory) {
IEngine.CollateralUpdate[] memory collateralUpdates = new IEngine.CollateralUpdate[](1);

collateralUpdates[0] = IEngine.CollateralUpdate({
asset: AaveV3ArbitrumAssets.MAI_UNDERLYING,
ltv: EngineFlags.KEEP_CURRENT,
liqThreshold: 0,
liqBonus: EngineFlags.KEEP_CURRENT,
debtCeiling: EngineFlags.KEEP_CURRENT,
liqProtocolFee: EngineFlags.KEEP_CURRENT,
eModeCategory: EngineFlags.KEEP_CURRENT
});

return collateralUpdates;
}

function borrowsUpdates() public pure override returns (IEngine.BorrowUpdate[] memory) {
IEngine.BorrowUpdate[] memory borrowUpdates = new IEngine.BorrowUpdate[](1);

borrowUpdates[0] = IEngine.BorrowUpdate({
asset: AaveV3ArbitrumAssets.MAI_UNDERLYING,
enabledToBorrow: EngineFlags.KEEP_CURRENT,
flashloanable: EngineFlags.KEEP_CURRENT,
stableRateModeEnabled: EngineFlags.KEEP_CURRENT,
borrowableInIsolation: EngineFlags.KEEP_CURRENT,
withSiloedBorrowing: EngineFlags.KEEP_CURRENT,
reserveFactor: 9500
});

return borrowUpdates;
}

function rateStrategiesUpdates()
public
pure
override
returns (IEngine.RateStrategyUpdate[] memory)
{
IEngine.RateStrategyUpdate[] memory rateStrategyUpdates = new IEngine.RateStrategyUpdate[](1);

Rates.RateStrategyParams memory paramsMAI_UNDERLYING = Rates.RateStrategyParams({
optimalUsageRatio: _bpsToRay(4500),
baseVariableBorrowRate: EngineFlags.KEEP_CURRENT,
variableRateSlope1: EngineFlags.KEEP_CURRENT,
variableRateSlope2: _bpsToRay(30000),
stableRateSlope1: EngineFlags.KEEP_CURRENT,
stableRateSlope2: EngineFlags.KEEP_CURRENT,
baseStableRateOffset: EngineFlags.KEEP_CURRENT,
stableRateExcessOffset: EngineFlags.KEEP_CURRENT,
optimalStableToTotalDebtRatio: EngineFlags.KEEP_CURRENT
});

rateStrategyUpdates[0] = IEngine.RateStrategyUpdate({
asset: AaveV3ArbitrumAssets.MAI_UNDERLYING,
params: paramsMAI_UNDERLYING
});

return rateStrategyUpdates;
}
}
72 changes: 72 additions & 0 deletions src/AaveV3Update_20231024mai/AaveV3Avalanche_20231024mai.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IEngine, EngineFlags, Rates} from 'aave-helpers/v3-config-engine/AaveV3PayloadBase.sol';
import {AaveV3PayloadAvalanche, AaveV3AvalancheAssets} from 'aave-helpers/v3-config-engine/AaveV3PayloadAvalanche.sol';

/**
* @title MAI/MIMATIC deprecation, 2023.10.23
* @author Gauntlet
* - Discussion: https://governance.aave.com/t/arfc-gauntlet-recommendation-for-mai-mimatic-deprecation/15119
*/
contract AaveV3AvalancheUpdate20231024maiPayload is AaveV3PayloadAvalanche {
function collateralsUpdates() public pure override returns (IEngine.CollateralUpdate[] memory) {
IEngine.CollateralUpdate[] memory collateralUpdates = new IEngine.CollateralUpdate[](1);

collateralUpdates[0] = IEngine.CollateralUpdate({
asset: AaveV3AvalancheAssets.MAI_UNDERLYING,
ltv: EngineFlags.KEEP_CURRENT,
liqThreshold: 0,
liqBonus: EngineFlags.KEEP_CURRENT,
debtCeiling: EngineFlags.KEEP_CURRENT,
liqProtocolFee: EngineFlags.KEEP_CURRENT,
eModeCategory: EngineFlags.KEEP_CURRENT
});

return collateralUpdates;
}

function borrowsUpdates() public pure override returns (IEngine.BorrowUpdate[] memory) {
IEngine.BorrowUpdate[] memory borrowUpdates = new IEngine.BorrowUpdate[](1);

borrowUpdates[0] = IEngine.BorrowUpdate({
asset: AaveV3AvalancheAssets.MAI_UNDERLYING,
enabledToBorrow: EngineFlags.KEEP_CURRENT,
flashloanable: EngineFlags.KEEP_CURRENT,
stableRateModeEnabled: EngineFlags.KEEP_CURRENT,
borrowableInIsolation: EngineFlags.KEEP_CURRENT,
withSiloedBorrowing: EngineFlags.KEEP_CURRENT,
reserveFactor: 9500
});

return borrowUpdates;
}

function rateStrategiesUpdates()
public
pure
override
returns (IEngine.RateStrategyUpdate[] memory)
{
IEngine.RateStrategyUpdate[] memory rateStrategyUpdates = new IEngine.RateStrategyUpdate[](1);

Rates.RateStrategyParams memory paramsMAI_UNDERLYING = Rates.RateStrategyParams({
optimalUsageRatio: _bpsToRay(4500),
baseVariableBorrowRate: EngineFlags.KEEP_CURRENT,
variableRateSlope1: EngineFlags.KEEP_CURRENT,
variableRateSlope2: _bpsToRay(30000),
stableRateSlope1: EngineFlags.KEEP_CURRENT,
stableRateSlope2: EngineFlags.KEEP_CURRENT,
baseStableRateOffset: EngineFlags.KEEP_CURRENT,
stableRateExcessOffset: EngineFlags.KEEP_CURRENT,
optimalStableToTotalDebtRatio: EngineFlags.KEEP_CURRENT
});

rateStrategyUpdates[0] = IEngine.RateStrategyUpdate({
asset: AaveV3AvalancheAssets.MAI_UNDERLYING,
params: paramsMAI_UNDERLYING
});

return rateStrategyUpdates;
}
}
Loading