Skip to content

Commit

Permalink
Merge pull request #213 from Uniswap/refactor-update
Browse files Browse the repository at this point in the history
fix: update global data metric
  • Loading branch information
ianlapham authored Mar 22, 2022
2 parents beb23a2 + d6491dc commit 936316b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/data/protocol/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useDeltaTimestamps } from 'utils/queries'
import { useBlocksFromTimestamps } from 'hooks/useBlocksFromTimestamps'
import { useMemo } from 'react'
import { useClients } from 'state/application/hooks'
import { client } from 'apollo/client'

export const GLOBAL_DATA = (block?: string) => {
const queryString = ` query uniswapFactories {
Expand Down Expand Up @@ -44,8 +43,6 @@ export function useFetchProtocolData(
const activeDataClient = dataClientOverride ?? dataClient
const activeBlockClient = blockClientOverride ?? blockClient

const onEthereum = dataClient && dataClient == client ? true : false

// get blocks from historic timestamps
const [t24, t48] = useDeltaTimestamps()
const { blocks, error: blockError } = useBlocksFromTimestamps([t24, t48], activeBlockClient)
Expand Down Expand Up @@ -117,14 +114,14 @@ export function useFetchProtocolData(
return {
volumeUSD,
volumeUSDChange: typeof volumeUSDChange === 'number' ? volumeUSDChange : 0,
tvlUSD: onEthereum ? 4_430_000_000 : parseFloat(parsed?.totalValueLockedUSD),
tvlUSD: parseFloat(parsed?.totalValueLockedUSD),
tvlUSDChange,
feesUSD,
feeChange,
txCount,
txCountChange,
}
}, [anyError, anyLoading, blocks, onEthereum, parsed, parsed24, parsed48])
}, [anyError, anyLoading, blocks, parsed, parsed24, parsed48])

return {
loading: anyLoading,
Expand Down

1 comment on commit 936316b

@vercel
Copy link

@vercel vercel bot commented on 936316b Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.