Skip to content

Commit

Permalink
fix: hardchade underlying ankrstakedbnb token to avoid errors queryin…
Browse files Browse the repository at this point in the history
…g before existence
  • Loading branch information
coreyar committed Jan 4, 2025
1 parent 0994701 commit d59ff7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 6 additions & 0 deletions subgraphs/isolated-pools/src/operations/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import {
vagEURAddress,
vankrBNBDeFiAddress,
vankrBNBLiquidStakedBNBAddress,
vWETHLiquidStakedETHAddress,
vWETHCoreAddress,
} from '../constants/addresses';
import {
getOrCreateMarketReward,
Expand Down Expand Up @@ -194,6 +196,10 @@ export function createMarket(
market.symbol = 'vslisBNB_LiquidStakedBNB';
}

if (vTokenAddress.equals(vWETHLiquidStakedETHAddress) || vTokenAddress.equals(vWETHCoreAddress)) {
market.underlyingToken = getOrCreateWrappedEthToken().id;
}

market.save();
return market;
}
Expand Down
4 changes: 0 additions & 4 deletions subgraphs/isolated-pools/src/operations/getOrCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
createPool,
createRewardDistributor,
} from './create';
import { vWETHLiquidStakedETHAddress, vWETHCoreAddress } from '../constants/addresses';
import { getMarketPosition, getMarket } from './get';
import { vBifiAddress } from '../constants/addresses';

Expand Down Expand Up @@ -189,9 +188,6 @@ export function getOrCreateWrappedEthToken(): Token {
*/
export function getOrCreateToken(asset: Address): Token {
let tokenEntity = Token.load(getTokenId(asset));
if (asset.equals(vWETHCoreAddress) || asset.equals(vWETHLiquidStakedETHAddress)) {
return getOrCreateWrappedEthToken();
}

if (!tokenEntity) {
const erc20 = BEP20.bind(asset);
Expand Down

0 comments on commit d59ff7b

Please sign in to comment.