Skip to content

Commit

Permalink
fix: properly render virtual balance fields
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra committed Jul 24, 2024
1 parent 0da1663 commit 4530357
Show file tree
Hide file tree
Showing 14 changed files with 871 additions and 7 deletions.
1 change: 1 addition & 0 deletions .assets/25f9cbdfc80fe1053a3498957e9ebcc43204ca2e.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/c95444425ee9452f419610e3fd51b1682c09f4e7.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@
"access": "public"
},
"dependencies": {
"@bgd-labs/aave-address-book": "^2.25.1",
"@bgd-labs/aave-v3-governance-cache": "^0.0.13",
"@bgd-labs/js-utils": "^1.3.0",
"@bgd-labs/aave-address-book": "^3.0.0",
"@bgd-labs/aave-v3-governance-cache": "^1.0.6",
"@bgd-labs/js-utils": "^1.4.2",
"@commander-js/extra-typings": "^11.1.0",
"@inquirer/prompts": "^3.3.2",
"chalk": "^4.1.2",
"commander": "^11.1.0",
"deepmerge": "^4.3.1",
"dotenv": "^16.4.1",
"find-object-paths": "^1.0.2",
"find-object-paths": "^1.1.0",
"gray-matter": "^4.0.3",
"ipfs-only-hash": "^4.0.0",
"json-bigint": "^1.0.0",
"object-hash": "^3.0.0",
"viem": "^2.9.20",
"zod": "^3.22.4"
"viem": "^2.17.11",
"zod": "^3.23.8"
}
}
30 changes: 30 additions & 0 deletions src/reports/__snapshots__/adi-diff-report.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`adi report > should generate a well formatted adi report 1`] = `
"## Raw diff
\`\`\`json
{
"forwarderAdaptersByChain": {
"1": {
"destination_3": {
"from": "0xb13712De579E1f9943502FFCf72eab6ec348cF79",
"to": "0x1562F1b2487F892BBA8Ef325aF054Fd157510a71"
},
"origin_3": {
"from": "0xb13712De579E1f9943502FFCf72eab6ec348cF79",
"to": "0x853649f897383f89d8441346Cf26a9ed02720B02"
}
}
},
"receiverAdaptersByChain": {
"1": {
"receiver_3": {
"from": "0xb13712De579E1f9943502FFCf72eab6ec348cF79",
"to": "0x853649f897383f89d8441346Cf26a9ed02720B02"
}
}
}
}
\`\`\`"
`;
301 changes: 301 additions & 0 deletions src/reports/__snapshots__/diff.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,301 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`diff > should find all the changes 1`] = `
{
"reserves": {
"0x0b3F868E0BE5597D5DB7fEB59E1CADBb0fdDa50a": {
"currentLiquidityRate": {
"from": 1.3415266124935912e+22,
"to": 1.3515266124935913e+22,
},
"currentVariableBorrowRate": {
"from": 1.6150925573283835e+24,
"to": 1.7150925573283834e+24,
},
"liquidityIndex": {
"from": 1.0030723628446084e+27,
"to": 1.1020723628446084e+27,
},
"variableBorrowIndex": {
"from": 1.0191200042968116e+27,
"to": 1.0211200042968116e+27,
},
},
"0x385Eeac5cB85A38A9a07A70c73e0a3271CfB54A7": {
"reserveFactor": {
"from": 2000,
"to": 3500,
},
},
"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619": {
"interestRateStrategy": {
"from": "0x03733F4E008d36f2e37F0080fF1c8DF756622E6F",
"to": "0x27eFE5db315b71753b2a38ED3d5dd7E9362ba93F",
},
"reserveFactor": {
"from": 1000,
"to": 1500,
},
},
"0x85955046DF4668e1DD369D2DE9f3AEB98DD2A369": {
"reserveFactor": {
"from": 2000,
"to": 3500,
},
},
"0xE0B52e49357Fd4DAf2c15e02058DCE6BC0057db4": {
"interestRateStrategy": {
"from": "0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4",
"to": "0xA9F3C3caE095527061e6d270DBE163693e6fda9D",
},
},
"0xE111178A87A3BFf0c8d18DECBa5798827539Ae99": {
"interestRateStrategy": {
"from": "0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4",
"to": "0xA9F3C3caE095527061e6d270DBE163693e6fda9D",
},
},
"0xa3Fa99A148fA48D14Ed51d610c367C61876997F1": {
"interestRateStrategy": {
"from": "0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4",
"to": "0xA9F3C3caE095527061e6d270DBE163693e6fda9D",
},
"reserveFactor": {
"from": 1000,
"to": 2000,
},
},
"0xc2132D05D31c914a87C6611C10748AEb04B58e8F": {
"interestRateStrategy": {
"from": "0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4",
"to": "0xA9F3C3caE095527061e6d270DBE163693e6fda9D",
},
},
},
"strategies": {
"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619": {
"address": {
"from": "0x03733F4E008d36f2e37F0080fF1c8DF756622E6F",
"to": "0x27eFE5db315b71753b2a38ED3d5dd7E9362ba93F",
},
"baseStableBorrowRate": {
"from": 9e+25,
"to": 6.8e+25,
},
"baseVariableBorrowRate": {
"from": 0,
"to": 1e+25,
},
"maxExcessUsageRatio": {
"from": 5.5e+26,
"to": 2e+26,
},
"optimalUsageRatio": {
"from": 4.5e+26,
"to": 8e+26,
},
"stableRateSlope1": {
"from": 0,
"to": 4e+25,
},
"stableRateSlope2": {
"from": 0,
"to": 8e+26,
},
"variableRateSlope1": {
"from": 7e+25,
"to": 3.8e+25,
},
"variableRateSlope2": {
"from": 3e+27,
"to": 8e+26,
},
},
"0xE0B52e49357Fd4DAf2c15e02058DCE6BC0057db4": {
"address": {
"from": "0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4",
"to": "0xA9F3C3caE095527061e6d270DBE163693e6fda9D",
},
"maxExcessUsageRatio": {
"from": 1e+26,
"to": 2e+26,
},
"optimalUsageRatio": {
"from": 9e+26,
"to": 8e+26,
},
"stableRateSlope2": {
"from": 6e+26,
"to": 7.5e+26,
},
"variableRateSlope2": {
"from": 6e+26,
"to": 7.5e+26,
},
},
"0xE111178A87A3BFf0c8d18DECBa5798827539Ae99": {
"address": {
"from": "0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4",
"to": "0xA9F3C3caE095527061e6d270DBE163693e6fda9D",
},
"maxExcessUsageRatio": {
"from": 1e+26,
"to": 2e+26,
},
"optimalUsageRatio": {
"from": 9e+26,
"to": 8e+26,
},
"stableRateSlope2": {
"from": 6e+26,
"to": 7.5e+26,
},
"variableRateSlope2": {
"from": 6e+26,
"to": 7.5e+26,
},
},
"0xa3Fa99A148fA48D14Ed51d610c367C61876997F1": {
"address": {
"from": "0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4",
"to": "0xA9F3C3caE095527061e6d270DBE163693e6fda9D",
},
"maxExcessUsageRatio": {
"from": 1e+26,
"to": 2e+26,
},
"optimalUsageRatio": {
"from": 9e+26,
"to": 8e+26,
},
"stableRateSlope2": {
"from": 6e+26,
"to": 7.5e+26,
},
"variableRateSlope2": {
"from": 6e+26,
"to": 7.5e+26,
},
},
"0xc2132D05D31c914a87C6611C10748AEb04B58e8F": {
"address": {
"from": "0x41B66b4b6b4c9dab039d96528D1b88f7BAF8C5A4",
"to": "0xA9F3C3caE095527061e6d270DBE163693e6fda9D",
},
"maxExcessUsageRatio": {
"from": 1e+26,
"to": 2e+26,
},
"optimalUsageRatio": {
"from": 9e+26,
"to": 8e+26,
},
"stableRateSlope2": {
"from": 6e+26,
"to": 7.5e+26,
},
"variableRateSlope2": {
"from": 6e+26,
"to": 7.5e+26,
},
},
},
}
`;

exports[`diff > should find all the changes 2`] = `
{
"reserves": {
"0x3C8Ca53ee5661D29d3d3C0732689a4b86947EAF0": {
"address": {
"from": null,
"to": "0xF9514C867b37D36a5affB003582b1818dA3870eb",
},
"baseVariableBorrowRate": {
"from": null,
"to": "0",
},
"maxVariableBorrowRate": {
"from": null,
"to": "640000000000000000000000000",
},
"optimalUsageRatio": {
"from": null,
"to": "450000000000000000000000000",
},
"variableRateSlope1": {
"from": null,
"to": "40000000000000000000000000",
},
"variableRateSlope2": {
"from": null,
"to": "600000000000000000000000000",
},
},
"0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f": {
"address": {
"from": null,
"to": "0xF9514C867b37D36a5affB003582b1818dA3870eb",
},
"baseVariableBorrowRate": {
"from": null,
"to": "0",
},
"maxVariableBorrowRate": {
"from": null,
"to": "640000000000000000000000000",
},
"optimalUsageRatio": {
"from": null,
"to": "450000000000000000000000000",
},
"variableRateSlope1": {
"from": null,
"to": "40000000000000000000000000",
},
"variableRateSlope2": {
"from": null,
"to": "600000000000000000000000000",
},
},
"0xffD4505B3452Dc22f8473616d50503bA9E1710Ac": {
"address": {
"from": null,
"to": "0xF9514C867b37D36a5affB003582b1818dA3870eb",
},
"baseVariableBorrowRate": {
"from": null,
"to": "0",
},
"liquidationBonus": {
"from": 10500,
"to": 11100,
},
"liquidationThreshold": {
"from": 8600,
"to": 9000,
},
"ltv": {
"from": 8250,
"to": 6200,
},
"maxVariableBorrowRate": {
"from": null,
"to": "640000000000000000000000000",
},
"optimalUsageRatio": {
"from": null,
"to": "450000000000000000000000000",
},
"variableRateSlope1": {
"from": null,
"to": "40000000000000000000000000",
},
"variableRateSlope2": {
"from": null,
"to": "600000000000000000000000000",
},
},
},
}
`;
Loading

0 comments on commit 4530357

Please sign in to comment.