From f2aa4baf55eef3e64a41b3a27353a9df54d99e76 Mon Sep 17 00:00:00 2001 From: Corey Rice Date: Wed, 27 Nov 2024 18:28:16 -0300 Subject: [PATCH] refactor: update values changed by unparsable events --- subgraphs/isolated-pools/config/index.ts | 8 ++++ .../isolated-pools/src/constants/addresses.ts | 12 ++++++ .../src/constants/config-template | 10 +++++ .../isolated-pools/src/operations/create.ts | 37 ++++++++++++++++++- 4 files changed, 66 insertions(+), 1 deletion(-) diff --git a/subgraphs/isolated-pools/config/index.ts b/subgraphs/isolated-pools/config/index.ts index 0971e098..0052876a 100644 --- a/subgraphs/isolated-pools/config/index.ts +++ b/subgraphs/isolated-pools/config/index.ts @@ -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: { diff --git a/subgraphs/isolated-pools/src/constants/addresses.ts b/subgraphs/isolated-pools/src/constants/addresses.ts index 9b2921fc..5c8001b6 100644 --- a/subgraphs/isolated-pools/src/constants/addresses.ts +++ b/subgraphs/isolated-pools/src/constants/addresses.ts @@ -3,6 +3,11 @@ 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); @@ -10,3 +15,10 @@ 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); diff --git a/subgraphs/isolated-pools/src/constants/config-template b/subgraphs/isolated-pools/src/constants/config-template index c20a4da7..90c6af44 100644 --- a/subgraphs/isolated-pools/src/constants/config-template +++ b/subgraphs/isolated-pools/src/constants/config-template @@ -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' diff --git a/subgraphs/isolated-pools/src/operations/create.ts b/subgraphs/isolated-pools/src/operations/create.ts index 556c5d03..5e051e33 100644 --- a/subgraphs/isolated-pools/src/operations/create.ts +++ b/subgraphs/isolated-pools/src/operations/create.ts @@ -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, @@ -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; }