fix: increase max block age for l2s (#2333)

* fix: increase max block age and refresh fee tier more often

* similar for tick data
This commit is contained in:
Justin Domingue 2021-09-13 12:22:44 -04:00 committed by GitHub
parent 540ec24e21
commit f7ac87fa85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

@ -11,7 +11,7 @@ import ms from 'ms.macro'
import { PoolState, usePool } from './usePools'
// maximum number of blocks past which we consider the data stale
const MAX_DATA_BLOCK_AGE = 10
const MAX_DATA_BLOCK_AGE = 20
interface FeeTierDistribution {
isLoading: boolean
@ -85,7 +85,7 @@ function usePoolTVL(token0: Token | undefined, token1: Token | undefined) {
const { isLoading, isFetching, isUninitialized, isError, data } = useFeeTierDistributionQuery(
token0 && token1 ? { token0: token0.address.toLowerCase(), token1: token1.address.toLowerCase() } : skipToken,
{
pollingInterval: ms`2m`,
pollingInterval: ms`30s`,
}
)

@ -31,11 +31,10 @@ export function useAllV3Ticks(
const poolAddress =
currencyA && currencyB && feeAmount ? Pool.getAddress(currencyA?.wrapped, currencyB?.wrapped, feeAmount) : undefined
//TODO(judo): determine if pagination is necessary for this query
const { isLoading, isError, error, isUninitialized, data } = useAllV3TicksQuery(
poolAddress ? { poolAddress: poolAddress?.toLowerCase(), skip: 0 } : skipToken,
{
pollingInterval: ms`2m`,
pollingInterval: ms`30s`,
}
)