Skip to content

Commit

Permalink
fix: allow null from getOrCreate because BIFI is ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Dec 16, 2024
1 parent 0699539 commit 854091b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions subgraphs/isolated-pools/src/operations/getOrCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 854091b

Please sign in to comment.