Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/apollo/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { HttpLink } from 'apollo-link-http'

export const client = new ApolloClient({
link: new HttpLink({
uri: 'https://api.thegraph.com/subgraphs/name/ianlapham/uniswapv2',
uri: 'https://api.thegraph.com/subgraphs/name/ianlapham/uniswap-v2-dev',
}),
cache: new InMemoryCache(),
shouldBatch: true,
Expand Down
4 changes: 2 additions & 2 deletions src/apollo/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,10 @@ const TokenFields = `
}
`

// used for getting top tokens by total liquidity
// used for getting top tokens by daily volume
export const TOKEN_TOP_DAY_DATAS = gql`
query tokenDayDatas($date: Int) {
tokenDayDatas(first: 50, orderBy: dailyVolumeUSD, orderDirection: desc, where: { date_gt: $date }) {
tokenDayDatas(first: 50, orderBy: totalLiquidityUSD, orderDirection: desc, where: { date_gt: $date }) {
id
date
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/GlobalChart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const GlobalChart = ({ display }) => {
if (item.date > utcStartTime) {
return item
} else {
return
return true
}
})
.filter((item) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/TokenList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function TopTokenList({ tokens, itemMax = 10, useTracked = false }) {

// sorting
const [sortDirection, setSortDirection] = useState(true)
const [sortedColumn, setSortedColumn] = useState(SORT_FIELD.LIQ)
const [sortedColumn, setSortedColumn] = useState(SORT_FIELD.VOL)

const below1080 = useMedia('(max-width: 1080px)')
const below680 = useMedia('(max-width: 680px)')
Expand Down
5 changes: 1 addition & 4 deletions src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ export const timeframeOptions = {
}

// token list urls to fetch tokens from - use for warnings on tokens and pairs
export const SUPPORTED_LIST_URLS__NO_ENS = [
'https://gateway.ipfs.io/ipns/tokens.uniswap.org',
'https://www.coingecko.com/tokens_list/uniswap/defi_100/v_0_0_0.json',
]
export const SUPPORTED_LIST_URLS__NO_ENS = ['https://tokens.coingecko.com/uniswap/all.json']

// hide from overview list
export const TOKEN_BLACKLIST = [
Expand Down
8 changes: 6 additions & 2 deletions src/contexts/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,12 @@ export function useListedTokens() {
async function fetchList() {
const allFetched = await SUPPORTED_LIST_URLS__NO_ENS.reduce(async (fetchedTokens, url) => {
const tokensSoFar = await fetchedTokens
const newTokens = await getTokenList(url)
return Promise.resolve([...tokensSoFar, ...newTokens.tokens])
try {
const newTokens = await getTokenList(url)
return Promise.resolve([...tokensSoFar, ...newTokens.tokens])
} catch (e) {
return Promise.resolve([...tokensSoFar])
}
}, Promise.resolve([]))
let formatted = allFetched?.map((t) => t.address.toLowerCase())
updateSupportedTokens(formatted)
Expand Down
9 changes: 5 additions & 4 deletions src/contexts/TokenData.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,19 @@ const getTopTokens = async (ethPrice, ethPriceOld) => {

try {
// need to get the top tokens by liquidity by need token day datas
const currentDate = parseInt(Date.now() / 86400 / 1000) * 86400 - 86400
const currentDate = parseInt(Date.now() / 86400 / 1000) * 86400 - 86400 - 86400

let tokenids = await client.query({
query: TOKEN_TOP_DAY_DATAS,
fetchPolicy: 'network-only',
variables: { date: currentDate },
})

console.log(tokenids)

const ids = tokenids?.data?.tokenDayDatas?.reduce((accum, entry) => {
const newMap = accum
newMap.push(entry.id.slice(0, 42))
return newMap
accum.push(entry.id.slice(0, 42))
return accum
}, [])

let current = await client.query({
Expand Down