Skip to content

Commit

Permalink
Merge pull request #28 from terraswap/fix/skip-BASE-uluna-validation
Browse files Browse the repository at this point in the history
Skip BASE-uluna validation
  • Loading branch information
jbamlee authored Feb 23, 2024
2 parents d5b2a85 + 59d4eaa commit 1936602
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/collector/indexer/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -241,6 +245,8 @@ export async function getTokenList(manager: EntityManager): Promise<Record<strin
return tokenList
}

const validationExceptionSet: Set<string> = new Set(ClassicOddTokenAppliedPair)

interface Asset {
token: string
reserve: string
Expand Down
4 changes: 2 additions & 2 deletions src/lib/terraswap/classic.consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface OddTokenHandlingInfo {
pair: (p: string) => boolean
}

const oddTokenAppliedPair: Set<string> = new Set([
export const ClassicOddTokenAppliedPair: Set<string> = new Set([
"terra1ggjadsdn285f4ae9wykle5lnawna7gdk32g6dfgpev8j0hx5jkpsc7u4gn", // uluna - BASE
])

Expand All @@ -26,5 +26,5 @@ export const ClassicOddTokenHandlerMap: Map<string, OddTokenHandlingInfo> = new
feeRate: "0.048",
appliedHeight: APPLIED_HEIGHT,
action: (a: string) => a === "send",
pair: (p: string) => oddTokenAppliedPair.has(p)
pair: (p: string) => ClassicOddTokenAppliedPair.has(p)
}]])

0 comments on commit 1936602

Please sign in to comment.