From 59d4eaa6a0c8f4065de53002f70075505922a168 Mon Sep 17 00:00:00 2001 From: jbamlee Date: Fri, 23 Feb 2024 15:35:53 +0900 Subject: [PATCH] fix: add exception list for BASE-uluna pair --- src/collector/indexer/common.ts | 6 ++++++ src/lib/terraswap/classic.consts.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/collector/indexer/common.ts b/src/collector/indexer/common.ts index d8f899d..eb20b98 100644 --- a/src/collector/indexer/common.ts +++ b/src/collector/indexer/common.ts @@ -6,6 +6,7 @@ import { PairDataEntity, PairDayDataEntity, PairHourDataEntity, PairInfoEntity, import { ExchangeRate } from 'types' import { num } from 'lib/num' import { lcd } from 'lib/terra/lcd' +import { ClassicOddTokenAppliedPair } from 'lib/terraswap/classic.consts' // get token's UST price from token-UST pair that have the largest liquidity export async function getTokenPriceAsUST( @@ -171,6 +172,9 @@ export async function comparePairReserve(height: number, em: EntityManager): Pro const compare = async (pds: PairDataEntity[]) => { const pdPromises = pds.map(async (pd) => { + if (validationExceptionSet.has(pd.pair)) { + return + } let poolInfo; try { poolInfo = await lcd.getPoolInfo(pd.pair, height) @@ -241,6 +245,8 @@ export async function getTokenList(manager: EntityManager): Promise = new Set(ClassicOddTokenAppliedPair) + interface Asset { token: string reserve: string diff --git a/src/lib/terraswap/classic.consts.ts b/src/lib/terraswap/classic.consts.ts index 9654367..4c83e08 100644 --- a/src/lib/terraswap/classic.consts.ts +++ b/src/lib/terraswap/classic.consts.ts @@ -16,7 +16,7 @@ interface OddTokenHandlingInfo { pair: (p: string) => boolean } -const oddTokenAppliedPair: Set = new Set([ +export const ClassicOddTokenAppliedPair: Set = new Set([ "terra1ggjadsdn285f4ae9wykle5lnawna7gdk32g6dfgpev8j0hx5jkpsc7u4gn", // uluna - BASE ]) @@ -26,5 +26,5 @@ export const ClassicOddTokenHandlerMap: Map = new feeRate: "0.048", appliedHeight: APPLIED_HEIGHT, action: (a: string) => a === "send", - pair: (p: string) => oddTokenAppliedPair.has(p) + pair: (p: string) => ClassicOddTokenAppliedPair.has(p) }]])