diff --git a/subgraphs/venus/src/utilities/getBnbPriceInUsd.ts b/subgraphs/venus/src/utilities/getBnbPriceInUsd.ts index 90622d01..d9d51242 100644 --- a/subgraphs/venus/src/utilities/getBnbPriceInUsd.ts +++ b/subgraphs/venus/src/utilities/getBnbPriceInUsd.ts @@ -1,15 +1,18 @@ import { Address, BigDecimal } from '@graphprotocol/graph-ts'; import { PriceOracle } from '../../generated/templates/VToken/PriceOracle'; +import { mantissaFactorBigDecimal } from '../constants'; import { vBnbAddress } from '../constants/addresses'; import { getOrCreateComptroller } from '../operations/getOrCreate'; -import { mantissaFactorBigDecimal } from '../constants'; export function getBnbPriceInUsd(): BigDecimal { const comptroller = getOrCreateComptroller(); const oracleAddress = Address.fromBytes(comptroller.priceOracle); -const oracle = PriceOracle.bind(oracleAddress); - const bnbPriceInUSD = oracle.getUnderlyingPrice(vBnbAddress).toBigDecimal().div(mantissaFactorBigDecimal); + const oracle = PriceOracle.bind(oracleAddress); + const bnbPriceInUSD = oracle + .getUnderlyingPrice(vBnbAddress) + .toBigDecimal() + .div(mantissaFactorBigDecimal); return bnbPriceInUSD; }