diff --git a/subgraphs/uniswap-forks-swap/src/common/constants.ts b/subgraphs/uniswap-forks-swap/src/common/constants.ts index 223704f5f4..92816bc2a9 100644 --- a/subgraphs/uniswap-forks-swap/src/common/constants.ts +++ b/subgraphs/uniswap-forks-swap/src/common/constants.ts @@ -105,3 +105,6 @@ export const MS_PER_YEAR = DAYS_PER_YEAR.times( ); export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"; + +export const EXPONENT_MIN = -6143; +export const EXPONENT_MAX = 6144; diff --git a/subgraphs/uniswap-forks-swap/src/common/creators.ts b/subgraphs/uniswap-forks-swap/src/common/creators.ts index 1c9dad783c..13c7fbf50b 100644 --- a/subgraphs/uniswap-forks-swap/src/common/creators.ts +++ b/subgraphs/uniswap-forks-swap/src/common/creators.ts @@ -11,6 +11,8 @@ import { BIGDECIMAL_FIFTY_PERCENT, BIGINT_NEG_ONE, BIGINT_ZERO, + EXPONENT_MIN, + EXPONENT_MAX, } from "./constants"; import { getLiquidityPool, @@ -96,10 +98,10 @@ export function createSwap( const token1 = getOrCreateToken(pool.inputTokens[1]); if ( - token0.decimals < -6143 || - token0.decimals > 6144 || - token0.decimals < -6143 || - token1.decimals > 6144 + token0.decimals < EXPONENT_MIN || + token0.decimals > EXPONENT_MAX || + token0.decimals < EXPONENT_MIN || + token1.decimals > EXPONENT_MAX ) { // If decimals for any of the input tokens are not in range [-6143, 6144]. Ignore it. // https://github.com/messari/subgraphs/issues/2375