Skip to content

Commit

Permalink
Merge branch 'main' into feat/v1-offboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Jan 30, 2024
2 parents 5bf05b9 + 484e923 commit b8940c5
Show file tree
Hide file tree
Showing 32 changed files with 2,384 additions and 561 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## Reserve changes

### Reserves altered

#### WETH ([0x82aF49447D8a07e3bd95BD0d56f35241523fBab1](https://arbiscan.io/address/0x82aF49447D8a07e3bd95BD0d56f35241523fBab1))

| description | value before | value after |
| --- | --- | --- |
| interestRateStrategy | [0x9a158802cD924747EF336cA3F9DE3bdb60Cf43D3](https://arbiscan.io/address/0x9a158802cD924747EF336cA3F9DE3bdb60Cf43D3) | [0xAC4f9019608f3A359Ba6a576DC4deC9561D2e514](https://arbiscan.io/address/0xAC4f9019608f3A359Ba6a576DC4deC9561D2e514) |
| optimalUsageRatio | 80 % | 90 % |
| maxExcessUsageRatio | 20 % | 10 % |
| interestRate | ![before](/.assets/715cbb89cad22db0c20f074df5ed4b41cd5a2327.svg) | ![after](/.assets/ca6b2aa74895f1fc2926cdd88b0b86033580d616.svg) |

## Raw diff

```json
{
"eModes": {
"2": {
"liquidationBonus": {
"from": 10200,
"to": 10100
},
"liquidationThreshold": {
"from": 9300,
"to": 9500
},
"ltv": {
"from": 9000,
"to": 9300
}
}
},
"reserves": {
"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1": {
"interestRateStrategy": {
"from": "0x9a158802cD924747EF336cA3F9DE3bdb60Cf43D3",
"to": "0xAC4f9019608f3A359Ba6a576DC4deC9561D2e514"
}
}
},
"strategies": {
"0xAC4f9019608f3A359Ba6a576DC4deC9561D2e514": {
"from": null,
"to": {
"baseStableBorrowRate": "63000000000000000000000000",
"baseVariableBorrowRate": 0,
"maxExcessStableToTotalDebtRatio": "800000000000000000000000000",
"maxExcessUsageRatio": "100000000000000000000000000",
"optimalStableToTotalDebtRatio": "200000000000000000000000000",
"optimalUsageRatio": "900000000000000000000000000",
"stableRateSlope1": "40000000000000000000000000",
"stableRateSlope2": "800000000000000000000000000",
"variableRateSlope1": "33000000000000000000000000",
"variableRateSlope2": "800000000000000000000000000"
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## Reserve changes

### Reserves altered

#### WETH ([0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2](https://etherscan.io/address/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2))

| description | value before | value after |
| --- | --- | --- |
| interestRateStrategy | [0xA901Bf68Bebde17ba382e499C3e9EbAe649DF276](https://etherscan.io/address/0xA901Bf68Bebde17ba382e499C3e9EbAe649DF276) | [0x06B1Ec378618EA736a65395eA5CAB69A2410493B](https://etherscan.io/address/0x06B1Ec378618EA736a65395eA5CAB69A2410493B) |
| optimalUsageRatio | 80 % | 90 % |
| maxExcessUsageRatio | 20 % | 10 % |
| interestRate | ![before](/.assets/cf503516adca0ef2b3e859f702e54d27d132edf2.svg) | ![after](/.assets/266cb15d48681d72fe262fbf1e9a82effed54078.svg) |

## Raw diff

```json
{
"eModes": {
"1": {
"liquidationThreshold": {
"from": 9300,
"to": 9500
},
"ltv": {
"from": 9000,
"to": 9300
}
}
},
"reserves": {
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2": {
"interestRateStrategy": {
"from": "0xA901Bf68Bebde17ba382e499C3e9EbAe649DF276",
"to": "0x06B1Ec378618EA736a65395eA5CAB69A2410493B"
}
}
},
"strategies": {
"0x06B1Ec378618EA736a65395eA5CAB69A2410493B": {
"from": null,
"to": {
"baseStableBorrowRate": "58000000000000000000000000",
"baseVariableBorrowRate": 0,
"maxExcessStableToTotalDebtRatio": "800000000000000000000000000",
"maxExcessUsageRatio": "100000000000000000000000000",
"optimalStableToTotalDebtRatio": "200000000000000000000000000",
"optimalUsageRatio": "900000000000000000000000000",
"stableRateSlope1": "40000000000000000000000000",
"stableRateSlope2": "800000000000000000000000000",
"variableRateSlope1": "28000000000000000000000000",
"variableRateSlope2": "800000000000000000000000000"
}
}
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## Reserve changes

### Reserves altered

#### WETH ([0x4200000000000000000000000000000000000006](https://explorer.optimism.io/address/0x4200000000000000000000000000000000000006))

| description | value before | value after |
| --- | --- | --- |
| interestRateStrategy | [0x5f58C25D17C09c9e1892F45DE6dA45ed973A5326](https://explorer.optimism.io/address/0x5f58C25D17C09c9e1892F45DE6dA45ed973A5326) | [0xd00655ED65edE44354F54A23d46DCbd7ba0727dD](https://explorer.optimism.io/address/0xd00655ED65edE44354F54A23d46DCbd7ba0727dD) |
| optimalUsageRatio | 80 % | 90 % |
| maxExcessUsageRatio | 20 % | 10 % |
| interestRate | ![before](/.assets/715cbb89cad22db0c20f074df5ed4b41cd5a2327.svg) | ![after](/.assets/ca6b2aa74895f1fc2926cdd88b0b86033580d616.svg) |

## Raw diff

```json
{
"eModes": {
"2": {
"liquidationThreshold": {
"from": 9300,
"to": 9500
},
"ltv": {
"from": 9000,
"to": 9300
}
}
},
"reserves": {
"0x4200000000000000000000000000000000000006": {
"interestRateStrategy": {
"from": "0x5f58C25D17C09c9e1892F45DE6dA45ed973A5326",
"to": "0xd00655ED65edE44354F54A23d46DCbd7ba0727dD"
}
}
},
"strategies": {
"0xd00655ED65edE44354F54A23d46DCbd7ba0727dD": {
"from": null,
"to": {
"baseStableBorrowRate": "63000000000000000000000000",
"baseVariableBorrowRate": 0,
"maxExcessStableToTotalDebtRatio": "800000000000000000000000000",
"maxExcessUsageRatio": "100000000000000000000000000",
"optimalStableToTotalDebtRatio": "200000000000000000000000000",
"optimalUsageRatio": "900000000000000000000000000",
"stableRateSlope1": "40000000000000000000000000",
"stableRateSlope2": "800000000000000000000000000",
"variableRateSlope1": "33000000000000000000000000",
"variableRateSlope2": "800000000000000000000000000"
}
}
}
}
```
8 changes: 4 additions & 4 deletions generator/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import {priceFeedsUpdates} from './features/priceFeedsUpdates';
import {freezeUpdates} from './features/freeze';
import {assetListing, assetListingCustom} from './features/assetListing';
import {generateFiles, writeFiles} from './generator';
import {PublicClient} from 'viem';
import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/aave-cli';
import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/js-utils';
import {getBlockNumber} from 'viem/actions';

const program = new Command();

Expand Down Expand Up @@ -146,8 +146,8 @@ if (options.configFile) {

async function generateDeterministicPoolCache(pool: PoolIdentifier): Promise<PoolCache> {
const chain = getPoolChain(pool);
const client = CHAIN_ID_CLIENT_MAP[CHAIN_TO_CHAIN_ID[chain]] as PublicClient;
return {blockNumber: Number(await client.getBlockNumber())};
const client = CHAIN_ID_CLIENT_MAP[CHAIN_TO_CHAIN_ID[chain]];
return {blockNumber: Number(await getBlockNumber(client))};
}

for (const pool of options.pools) {
Expand Down
1 change: 1 addition & 0 deletions generator/features/__snapshots__/assetListing.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ exports[`feature: assetListing > should properly generate files 1`] = `
title: "test"
author: "test"
discussions: "test"
snapshot: "test"
---
## Simple Summary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ exports[`feature: priceFeedsUpdates > should properly generate files 1`] = `
title: "test"
author: "test"
discussions: "test"
snapshot: "test"
---
## Simple Summary
Expand Down
6 changes: 3 additions & 3 deletions generator/features/assetListing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import {fetchCollateralUpdate} from './collateralsUpdates';
import {fetchCapsUpdate} from './capsUpdates';
import {Listing, ListingWithCustomImpl, TokenImplementations} from './types';
import {CHAIN_TO_CHAIN_ID, getPoolChain} from '../common';
import {PublicClient, getContract} from 'viem';
import {getContract} from 'viem';
import {confirm} from '@inquirer/prompts';
import {TEST_EXECUTE_PROPOSAL} from '../utils/constants';
import {addressPrompt, translateJsAddressToSol} from '../prompts/addressPrompt';
import {stringPrompt} from '../prompts/stringPrompt';
import {translateJsBoolToSol} from '../prompts/boolPrompt';
import {transformNumberToPercent, translateJsPercentToSol} from '../prompts/percentPrompt';
import {transformNumberToHumanReadable, translateJsNumberToSol} from '../prompts/numberPrompt';
import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/aave-cli';
import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/js-utils';

async function fetchListing(pool: PoolIdentifier): Promise<Listing> {
const asset = await addressPrompt({
Expand Down Expand Up @@ -49,7 +49,7 @@ async function fetchListing(pool: PoolIdentifier): Promise<Listing> {
type: 'function',
},
],
publicClient: CHAIN_ID_CLIENT_MAP[CHAIN_TO_CHAIN_ID[chain]] as PublicClient,
client: CHAIN_ID_CLIENT_MAP[CHAIN_TO_CHAIN_ID[chain]],
address: asset,
});
let symbol = '';
Expand Down
4 changes: 3 additions & 1 deletion generator/templates/aip.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ export function generateAIP(options: Options, configs: PoolConfigs) {
return `---
title: ${`"${options.title}"` || 'TODO'}
author: ${`"${options.author}"` || 'TODO'}
discussions: ${`"${options.discussion}"` || 'TODO'}
discussions: ${`"${options.discussion}"` || 'TODO'}${
options.snapshot ? `\nsnapshot: "${options.snapshot}"\n` : ''
}
---
## Simple Summary
Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "bgd-forge-template",
"name": "aave-proposals-v3",
"version": "1.0.0",
"scripts": {
"test": "vitest generator",
Expand All @@ -25,22 +25,23 @@
},
"homepage": "https://github.com/bgd-labs/aave-proposals-v3#readme",
"devDependencies": {
"@types/node": "^20.10.5",
"@types/node": "^20.11.10",
"prettier": "2.8.7",
"prettier-plugin-solidity": "1.1.3",
"vitest": "^1.0.4"
"vitest": "^1.2.2"
},
"dependencies": {
"@bgd-labs/aave-address-book": "^2.17.0",
"@bgd-labs/aave-cli": "0.2.1",
"@bgd-labs/aave-address-book": "^2.18.1",
"@bgd-labs/aave-cli": "0.6.4",
"@bgd-labs/js-utils": "^1.1.1",
"@inquirer/prompts": "^3.3.0",
"@inquirer/testing": "^2.1.9",
"catapulta-verify": "^0.1.11",
"catapulta-verify": "^0.1.12",
"commander": "^11.1.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"tsx": "^4.6.2",
"viem": "^1.20.1"
"tsx": "^4.7.0",
"viem": "^2.6.1"
},
"lint-staged": {
"*": "prettier --ignore-unknown --write"
Expand Down
Loading

0 comments on commit b8940c5

Please sign in to comment.