diff --git a/subgraphs/isolated-pools/src/operations/getOrCreate.ts b/subgraphs/isolated-pools/src/operations/getOrCreate.ts index 6522216b..fb8eb455 100644 --- a/subgraphs/isolated-pools/src/operations/getOrCreate.ts +++ b/subgraphs/isolated-pools/src/operations/getOrCreate.ts @@ -30,16 +30,17 @@ import { } from './create'; import { getMarketPosition, getMarket } from './get'; +// BIFI was delisted before it was listed. Creation ignores this market. export const getOrCreateMarket = ( vTokenAddress: Address, comptrollerAddress: Address, blockNumber: BigInt, -): Market => { +): Market | null => { let market = getMarket(vTokenAddress); if (!market) { market = createMarket(vTokenAddress, comptrollerAddress, blockNumber); } - return market as Market; + return market; }; export const getOrCreatePool = (comptroller: Address): Pool => { diff --git a/subgraphs/isolated-pools/tests/scripts/rewardsDistributors.ts b/subgraphs/isolated-pools/tests/scripts/rewardsDistributors.ts index da6600b8..2c32a72e 100644 --- a/subgraphs/isolated-pools/tests/scripts/rewardsDistributors.ts +++ b/subgraphs/isolated-pools/tests/scripts/rewardsDistributors.ts @@ -20,7 +20,7 @@ const checkRewardsDistributors = async ( console.log('failed to query isTimeBased'); } assertEqual(rd, isTimeBased, 'isTimeBased'); - assertEqual(rd, await rewardDistributor.rewardToken(), 'rewardTokenAddress', getAddress); + assertEqual(rd.rewardToken, await rewardDistributor.rewardToken(), 'address', getAddress); for (const marketReward of rd.marketRewards) { const [borrowSpeedPerBlockMantissa, supplySpeedPerBlockMantissa] = await Promise.all([ diff --git a/subgraphs/venus/src/operations/getOrCreate.ts b/subgraphs/venus/src/operations/getOrCreate.ts index b8a3ce50..e7cc440e 100644 --- a/subgraphs/venus/src/operations/getOrCreate.ts +++ b/subgraphs/venus/src/operations/getOrCreate.ts @@ -61,6 +61,10 @@ export function getOrCreateMarket(marketAddress: Address, event: ethereum.Event) tokenEntity.decimals = 18; tokenEntity.save(); market.underlyingToken = tokenEntity.id; + } else if (marketAddress.equals(vwbETHAddress)) { + market.underlyingToken = getOrCreateToken( + Address.fromBytes(Bytes.fromHexString('0x9c37E59Ba22c4320547F00D4f1857AF1abd1Dd6f')), + ).id; } else { market.underlyingToken = getOrCreateToken(vTokenContract.underlying()).id; } @@ -93,12 +97,6 @@ export function getOrCreateMarket(marketAddress: Address, event: ethereum.Event) market.totalBorrowsMantissa = zeroBigInt32; market.reservesMantissa = zeroBigInt32; - if (marketAddress.equals(vwbETHAddress)) { - market.underlyingToken = getOrCreateToken( - Address.fromBytes(Bytes.fromHexString('0x9c37E59Ba22c4320547F00D4f1857AF1abd1Dd6f')), - ).id; - } - if (marketAddress.equals(vTRXAddressAddress)) { market.symbol = 'vTRXOLD'; market.name = 'Venus TRXOLD';