mirror of
https://github.com/cerc-io/watcher-ts
synced 2024-11-20 04:46:20 +00:00
a9d411c6df
* Smoke test for uni-info-watcher and refactor token deployment code. * Test for Token entity after PoolCreated event. * Test for Pool entity after PoolCreated event. * Tests for entities after InitializeEvent. Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
55 lines
1.1 KiB
TypeScript
55 lines
1.1 KiB
TypeScript
import { gql } from 'graphql-request';
|
|
|
|
export const queryToken = gql`
|
|
query queryToken($id: ID!) {
|
|
token(id: $id) {
|
|
id
|
|
}
|
|
}`;
|
|
|
|
// Getting the first Factory entity.
|
|
export const queryFactory = gql`
|
|
{
|
|
factories(first: 1) {
|
|
id
|
|
}
|
|
}`;
|
|
|
|
// Getting the first Bundle entity.
|
|
export const queryBundle = gql`
|
|
{
|
|
bundles(first: 1) {
|
|
id
|
|
}
|
|
}`;
|
|
|
|
// Getting Pool by id.
|
|
export const queryPoolById = gql`
|
|
query queryPoolById($id: ID!) {
|
|
pool(id: $id) {
|
|
id,
|
|
sqrtPrice,
|
|
tick,
|
|
totalValueLockedUSD
|
|
}
|
|
}`;
|
|
|
|
// Getting Pool(s) filtered by tokens.
|
|
export const queryPoolsByTokens = gql`
|
|
query queryPoolsByTokens($tokens: [String!]) {
|
|
pools(where: { token0_in: $tokens, token1_in: $tokens }) {
|
|
id,
|
|
feeTier
|
|
}
|
|
}`;
|
|
|
|
// Getting PoolDayData(s) filtered by pool and ordered by date.
|
|
export const queryPoolDayData = gql`
|
|
query queryPoolDayData($first: Int, $orderBy: PoolDayData_orderBy, $orderDirection: OrderDirection, $pool: String) {
|
|
poolDayDatas(first: $first, orderBy: $orderBy, orderDirection: $orderDirection, where: { pool: $pool }) {
|
|
id,
|
|
date,
|
|
tvlUSD
|
|
}
|
|
}`;
|