Skip to content

Commit

Permalink
Aave 3.2 temporary fix (#4043)
Browse files Browse the repository at this point in the history
* Refactor getAaveV3ProtocolData, removed getReserveEModeCategory and hardcoded a value

Updated packages (more to come)

* Update @oasisdex/addresses and @oasisdex/dma-library versions
  • Loading branch information
marcinciarka authored Oct 8, 2024
1 parent 2f2c9a3 commit ff3c5a6
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 420 deletions.
20 changes: 5 additions & 15 deletions blockchain/aave-v3/aave-v3-pool-data-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import BigNumber from 'bignumber.js'
import { NetworkIds } from 'blockchain/networks'
import { amountFromRay, amountFromWei } from 'blockchain/utils'
import { warnIfAddressIsZero } from 'helpers/warnIfAddressIsZero'
import { zero } from 'helpers/zero'
import { AaveV3PoolDataProvider__factory } from 'types/ethers-contracts'

import type { BaseParameters } from './utils'
Expand Down Expand Up @@ -194,21 +195,10 @@ export interface AaveV3EModeForAssetParameters extends BaseParameters {
token: string
}

export function getAaveV3EModeCategoryForAsset({
token,
networkId,
}: AaveV3EModeForAssetParameters): Promise<BigNumber> {
const { contract, tokenMappings } = networkMappings[networkId]()
const address = wethToEthAddress(tokenMappings, token)
warnIfAddressIsZero(
address,
networkId,
'aaveV3PoolDataProvider',
'getAaveV3EModeCategoryForAsset',
)
return contract.getReserveEModeCategory(address).then((result) => {
return new BigNumber(result.toString())
})
export function getAaveV3EModeCategoryForAsset(
_props: AaveV3EModeForAssetParameters,
): Promise<BigNumber> {
return Promise.resolve(zero)
}

export interface AaveV3ReserveCapParameters extends BaseParameters {
Expand Down
Loading

0 comments on commit ff3c5a6

Please sign in to comment.