Skip to content

Commit

Permalink
refactor: update values changed by unparsable events
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Dec 4, 2024
1 parent c6bccb8 commit f2aa4ba
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
8 changes: 8 additions & 0 deletions subgraphs/isolated-pools/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,20 @@ const main = () => {
network: 'chapel',
poolRegistryAddress: chapelDeployments.addresses.PoolRegistry,
vBifiAddress: '0xEF949287834Be010C1A5EDd757c385FB9b644E4A',
vLisUsdAddress: chapelDeployments.addresses.VToken_vHAY_StableCoins,
vagEURAddress: chapelDeployments.addresses.VToken_vagEUR_Stablecoins,
vankrBNBLiquidStakedBNBAddress: chapelDeployments.addresses.VToken_vankrBNB_LiquidStakedBNB,
vankrBNBDeFiAddress: chapelDeployments.addresses.VToken_vankrBNB_DeFi,
vSnBNBAddress: chapelDeployments.addresses.VToken_vSnBNB_LiquidStakedBNB,
startBlock: '30870000',
},
bsc: {
network: 'bsc',
poolRegistryAddress: bscMainnetDeployments.addresses.PoolRegistry,
vBifiAddress: '0xC718c51958d3fd44f5F9580c9fFAC2F89815C909',
vLisUsdAddress: bscMainnetDeployments.addresses.VToken_vHAY_Stablecoins,
vagEURAddress: bscMainnetDeployments.addresses.VToken_vagEUR_Stablecoins,
vSnBNBAddress: bscMainnetDeployments.addresses.VToken_vSnBNB_LiquidStakedBNB,
startBlock: '29300000',
},
opbnbMainnet: {
Expand Down
12 changes: 12 additions & 0 deletions subgraphs/isolated-pools/src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ import { Address } from '@graphprotocol/graph-ts';
import {
poolRegistryAddress as poolRegistryAddressString,
vBifiAddress as vBifiAddressString,
vLisUsdAddress as vLisUsdAddressString,
vagEURAddress as vagEURAddressString,
vankrBNBLiquidStakedBNBAddress as vankrBNBLiquidStakedBNBAddressString,
vankrBNBDeFiAddress as vankrBNBDeFiAddressString,
vSnBNBAddress as vSnBNBAddressString,
} from './config';

export const poolRegistryAddress = Address.fromString(poolRegistryAddressString);

export const nullAddress = Address.fromString('0x0000000000000000000000000000000000000000');

export const vBifiAddress = Address.fromString(vBifiAddressString);
export const vLisUsdAddress = Address.fromString(vLisUsdAddressString);
export const vagEURAddress = Address.fromString(vagEURAddressString);
export const vankrBNBLiquidStakedBNBAddress = Address.fromString(
vankrBNBLiquidStakedBNBAddressString,
);
export const vankrBNBDeFiAddress = Address.fromString(vankrBNBDeFiAddressString);
export const vSnBNBAddress = Address.fromString(vSnBNBAddressString);
10 changes: 10 additions & 0 deletions subgraphs/isolated-pools/src/constants/config-template
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
export const poolRegistryAddress = '{{ poolRegistryAddress }}';
// @ts-ignore When the template is created this will fallback to a null string
export const vBifiAddress = '{{ vBifiAddress }}' || '0x0000000000000000000000000000000000000000'
// @ts-ignore When the template is created this will fallback to a null string
export const vLisUsdAddress = '{{ vLisUsdAddress }}' || '0x0000000000000000000000000000000000000000'
// @ts-ignore When the template is created this will fallback to a null string
export const vagEURAddress = '{{ vagEURAddress }}' || '0x0000000000000000000000000000000000000000'
// @ts-ignore When the template is created this will fallback to a null string
export const vankrBNBLiquidStakedBNBAddress = '{{ vankrBNBLiquidStakedBNBAddress }}' || '0x0000000000000000000000000000000000000000'
// @ts-ignore When the template is created this will fallback to a null string
export const vankrBNBDeFiAddress = '{{ vankrBNBDeFiAddress }}' || '0x0000000000000000000000000000000000000000'
// @ts-ignore When the template is created this will fallback to a null string
export const vSnBNBAddress = '{{ vSnBNBAddress }}' || '0x0000000000000000000000000000000000000000'
37 changes: 36 additions & 1 deletion subgraphs/isolated-pools/src/operations/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ import { RewardsDistributor as RewardDistributorContract } from '../../generated
import { BEP20 as BEP20Contract } from '../../generated/templates/VToken/BEP20';
import { VToken as VTokenContract } from '../../generated/templates/VToken/VToken';
import { BORROW, LIQUIDATE, MINT, REDEEM, REPAY, TRANSFER, zeroBigInt32 } from '../constants';
import { poolRegistryAddress, vBifiAddress } from '../constants/addresses';
import {
poolRegistryAddress,
vBifiAddress,
vLisUsdAddress,
vSnBNBAddress,
vagEURAddress,
vankrBNBDeFiAddress,
vankrBNBLiquidStakedBNBAddress,
} from '../constants/addresses';
import { getTokenPriceInCents, valueOrNotAvailableIntIfReverted } from '../utilities';
import {
getAccountId,
Expand Down Expand Up @@ -153,6 +161,33 @@ export function createMarket(
.markets(vTokenAddress)
.getLiquidationThresholdMantissa();

if (vTokenAddress.equals(vLisUsdAddress)) {
market.name = 'Venus lisUSD (Stablecoins)';
market.symbol = 'vlisUSD_Stablecoins';
}

if (vTokenAddress.equals(vagEURAddress)) {
market.name = 'Venus EURA (Stablecoins)';
market.symbol = 'vEURA_Stablecoins';
}

if (vTokenAddress.equals(vankrBNBLiquidStakedBNBAddress)) {
market.underlyingAddress = Address.fromHexString('0x5269b7558D3d5E113010Ef1cFF0901c367849CC9');
market.symbol = 'vankrBNB_LiquidStakedBNB';
market.underlyingName = 'Ankr Staked BNB ';
}

if (vTokenAddress.equals(vankrBNBDeFiAddress)) {
market.underlyingAddress = Address.fromHexString('0x5269b7558D3d5E113010Ef1cFF0901c367849CC9');
market.symbol = 'vankrBNB_DeFi';
market.underlyingName = 'Ankr Staked BNB ';
}

if (vTokenAddress.equals(vSnBNBAddress)) {
market.name = 'Venus slisBNB (Liquid Staked BNB)';
market.symbol = 'vslisBNB_LiquidStakedBNB';
}

market.save();
return market;
}
Expand Down

0 comments on commit f2aa4ba

Please sign in to comment.