diff --git a/subgraphs/venus/src/mappings/vtoken.ts b/subgraphs/venus/src/mappings/vToken.ts similarity index 97% rename from subgraphs/venus/src/mappings/vtoken.ts rename to subgraphs/venus/src/mappings/vToken.ts index a48035b9..72d64e2e 100644 --- a/subgraphs/venus/src/mappings/vtoken.ts +++ b/subgraphs/venus/src/mappings/vToken.ts @@ -362,9 +362,7 @@ export const handleTransfer = (event: Transfer): void => { market = updateMarket(event.address, event.block.number.toI32(), event.block.timestamp.toI32()); } let vTokenDecimals = market.vTokenDecimals; - let amountUnderlying = market.exchangeRateMantissa.times( - event.params.amount, - ); + let amountUnderlying = market.exchangeRateMantissa.times(event.params.amount); // const exchangeRateBigDecimal = getExchangeRateBigDecimal(exchangeRate, underlyingDecimals); // const amountUnderlyingMantissa = exchangeRateBigDecimal // .times(exponentToBigDecimal(underlyingDecimals)) @@ -392,7 +390,10 @@ export const handleTransfer = (event: Transfer): void => { ); vTokenStatsFrom.vTokenBalance = vTokenStatsFrom.vTokenBalance.minus( - event.params.amount.toBigDecimal().div(exponentToBigDecimal(vTokenDecimals)).truncate(vTokenDecimals), + event.params.amount + .toBigDecimal() + .div(exponentToBigDecimal(vTokenDecimals)) + .truncate(vTokenDecimals), ); vTokenStatsFrom.totalUnderlyingRedeemedMantissa = @@ -424,7 +425,10 @@ export const handleTransfer = (event: Transfer): void => { ); vTokenStatsTo.vTokenBalance = vTokenStatsTo.vTokenBalance.plus( - event.params.amount.toBigDecimal().div(exponentToBigDecimal(vTokenDecimals)).truncate(vTokenDecimals), + event.params.amount + .toBigDecimal() + .div(exponentToBigDecimal(vTokenDecimals)) + .truncate(vTokenDecimals), ); vTokenStatsTo.totalUnderlyingSuppliedMantissa = diff --git a/subgraphs/venus/template.yaml b/subgraphs/venus/template.yaml index f61b09a4..02b90ef3 100644 --- a/subgraphs/venus/template.yaml +++ b/subgraphs/venus/template.yaml @@ -57,7 +57,7 @@ templates: kind: ethereum/events apiVersion: 0.0.5 language: wasm/assemblyscript - file: ./src/mappings/vtoken.ts + file: ./src/mappings/vToken.ts entities: - User - Market diff --git a/subgraphs/venus/tests/VToken/index.test.ts b/subgraphs/venus/tests/VToken/index.test.ts index 952f1618..a35a156f 100644 --- a/subgraphs/venus/tests/VToken/index.test.ts +++ b/subgraphs/venus/tests/VToken/index.test.ts @@ -23,7 +23,7 @@ import { handleRedeem, handleRepayBorrow, handleTransfer, -} from '../../src/mappings/vtoken'; +} from '../../src/mappings/vToken'; import { getMarket } from '../../src/operations/get'; import { getAccountVTokenId } from '../../src/utilities/ids'; import {