Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom entity queries to optimize frontend app GQL requests #383

Merged
merged 14 commits into from
Nov 8, 2022
Merged
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
49 changes: 49 additions & 0 deletions packages/uni-info-watcher/docs/analysis/queries/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
volumeUSD
tvlUSD
feesUSD
pool {
feeTier
}
}
}
```
Expand Down Expand Up @@ -50,6 +53,12 @@
totalValueLockedToken0
totalValueLockedToken1
totalValueLockedUSD
volumeToken0
volumeToken1
}

bundles (where: {id: "1"}) {
ethPriceUSD
}
}
```
Expand Down Expand Up @@ -560,6 +569,46 @@
}
```

* https://github.com/Uniswap/uniswap-v3-info/blob/master/src/data/combined/pools.ts
```
query pools {
pools(
where: {id_in: ${poolString}},` +
(block ? `block: {number: ${block}} ,` : ``) +
` orderBy: totalValueLockedUSD,
orderDirection: desc,
subgraphError: allow
) {
id
feeTier
liquidity
sqrtPrice
tick
token0 {
id
symbol
name
decimals
derivedETH
}
token1 {
id
symbol
name
decimals
derivedETH
}
token0Price
token1Price
volumeUSD
txCount
totalValueLockedToken0
totalValueLockedToken1
totalValueLockedUSD
}
}
```

- ethereum-blocks endpoint (https://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks)

https://github.com/Uniswap/uniswap-v3-info/blob/master/src/hooks/useBlocksFromTimestamps.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ type Pool {
totalValueLockedUSD: BigDecimal!
txCount: BigInt!
volumeUSD: BigDecimal!
volumeToken0
volumeToken1
}

type PoolDayData {
Expand Down
Loading