Skip to content

Commit

Permalink
Aave 3.2 temporary fix (#704)
Browse files Browse the repository at this point in the history
* Bump dma-lib version to 0.6.73 and update getAaveV3ProtocolData

* bump version

---------

Co-authored-by: piekczyk <[email protected]>
Co-authored-by: sebastianPiekarczyk <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent 39b8acf commit 9a29165
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/dma-library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oasisdex/dma-library",
"version": "0.6.74",
"version": "0.6.75",
"typings": "lib/index.d.ts",
"types": "lib/index.d.ts",
"main": "lib/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export async function getAaveV3ProtocolData({
'AAVE_V3',
)

const networkData = await provider.getNetwork()

const [
flashloanPrice,
debtPrice,
Expand All @@ -120,7 +122,15 @@ export async function getAaveV3ProtocolData({
})
const isCollateralEthCorrelated = collateralTokenSymbol?.toUpperCase().includes('ETH') || false
const isDebtEthCorrelated = debtTokenSymbol?.toUpperCase().includes('ETH') || false
const reserveEModeCategory = isCollateralEthCorrelated && isDebtEthCorrelated ? 1 : 0
const reserveEModeCategory =
isCollateralEthCorrelated && isDebtEthCorrelated
? {
1: 1, // MAINNET
42161: 2, // ARBITRUM
10: 2, // OPTIMISM
8453: 1, // BASE
}[networkData.chainId]
: 0

let eModeCategoryData
if (pool && reserveEModeCategory !== 0) {
Expand Down

0 comments on commit 9a29165

Please sign in to comment.