From 54845b11e877a2b81c87aaca91f97e0b141791f7 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Fri, 21 Jun 2024 14:42:35 +0200 Subject: [PATCH 001/139] feat: add data api to graph client --- packages/graph-client/scripts/t2.ts | 5 + .../graph-client/scripts/update-schemas.ts | 1 + .../src/subgraphs/data-api/graphql.ts | 8 ++ .../src/subgraphs/data-api/index.ts | 1 + .../src/subgraphs/data-api/queries/pools.ts | 54 ++++++++++ .../src/subgraphs/data-api/schema.graphql | 102 ++++++++++++++++++ packages/graph-client/tsconfig.json | 6 ++ packages/sushi/src/config/subgraph/hosts.ts | 2 + .../src/config/subgraph/subgraphs/data-api.ts | 3 + .../src/config/subgraph/subgraphs/index.ts | 1 + 10 files changed, 183 insertions(+) create mode 100644 packages/graph-client/scripts/t2.ts create mode 100644 packages/graph-client/src/subgraphs/data-api/graphql.ts create mode 100644 packages/graph-client/src/subgraphs/data-api/index.ts create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/pools.ts create mode 100644 packages/graph-client/src/subgraphs/data-api/schema.graphql create mode 100644 packages/sushi/src/config/subgraph/subgraphs/data-api.ts diff --git a/packages/graph-client/scripts/t2.ts b/packages/graph-client/scripts/t2.ts new file mode 100644 index 0000000000..2c89654a62 --- /dev/null +++ b/packages/graph-client/scripts/t2.ts @@ -0,0 +1,5 @@ +import { getPools } from '../src/subgraphs/data-api/queries/pools' + +const a = await getPools({ chainId: '42161' }) + +console.log('pools api:', a.length ) diff --git a/packages/graph-client/scripts/update-schemas.ts b/packages/graph-client/scripts/update-schemas.ts index 24a55dd8b4..04a71a0b37 100644 --- a/packages/graph-client/scripts/update-schemas.ts +++ b/packages/graph-client/scripts/update-schemas.ts @@ -16,6 +16,7 @@ const schemas = { 'sushi-bar': 'api.studio.thegraph.com/query/32073/xsushi/v0.0.1', 'sushi-v2': 'api.studio.thegraph.com/query/32073/v2-arbitrum/v0.0.5', 'sushi-v3': 'api.studio.thegraph.com/query/32073/v3-arbitrum/v0.0.1', + 'data-api': 'data-api-production-acb1.up.railway.app/graphql', } as const satisfies Record async function updateSchema(schema: keyof typeof schemas) { diff --git a/packages/graph-client/src/subgraphs/data-api/graphql.ts b/packages/graph-client/src/subgraphs/data-api/graphql.ts new file mode 100644 index 0000000000..15e7e1e7da --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/graphql.ts @@ -0,0 +1,8 @@ +import { initGraphQLTada } from 'gql.tada' +import type { Scalars } from 'src/lib/types/scalars.js' +import type { introspection } from './data-api-env.js' + +export const graphql = initGraphQLTada<{ + introspection: introspection + scalars: Scalars +}>() diff --git a/packages/graph-client/src/subgraphs/data-api/index.ts b/packages/graph-client/src/subgraphs/data-api/index.ts new file mode 100644 index 0000000000..bc9fe0ce80 --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/index.ts @@ -0,0 +1 @@ +export * from './queries/pools' \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pools.ts new file mode 100644 index 0000000000..76cb22d752 --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/pools.ts @@ -0,0 +1,54 @@ +import type { VariablesOf } from 'gql.tada' + +import { FetchError } from 'src/lib/fetch-error' +import { type RequestOptions, request } from 'src/lib/request' +// import { SUSHI_DATA_API_V0_URL } from 'sushi/config/subgraph' +import { graphql } from '../graphql' + +export const PoolsQuery = graphql( + ` +query Pools($chainId: ID!) { + pools(chainId: $chainId) { + id + name + address + createdAt + swapFee + protocol + token0Price + token1Price + token0Address + token1Address + token0PriceUSD + token1PriceUSD + liquidityUSD + txCount1h + txCount1d + feeUSD1h + feeUSD1d + volumeUSD1h + volumeUSD1d + feeApr1d + source + } + } +`, +) + +export type GetPools = VariablesOf + +export async function getPools(variables: GetPools, options?: RequestOptions) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + + const result = await request( + { url, document: PoolsQuery, variables }, + options, + ) + if (result) { + return result.pools + } + + throw new FetchError(1, 'No bar') +} + +export type PoolsV1 = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql new file mode 100644 index 0000000000..5dbdcc202f --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -0,0 +1,102 @@ +type Change { + absolute1D: Float! + percent1D: Float! +} + +type BalanceByChain { + id: ID! + networkName: String! + balance: Float! +} + +type Portfolio { + id: ID! + balance: Float! + balanceByChains: [BalanceByChain]! + changes: Change! +} + +type PortfolioPositions { + id: ID! + liquidityPositions: [PortfolioLiquidityPosition] + wallet: [PortfolioTokenPosition] +} + +type TokenStatus { + verified: Boolean + isTrash: Boolean +} + +type Token { + address: String! + name: String! + symbol: String! + decimals: Int! + status: TokenStatus + logoUrl: String +} + +type PortfolioLiquidityPosition { + id: ID! + chainId: Int! + protocol: String! + name: String! + source: String! + assets: [PortfolioLiquidityPositionAsset]! +} + +type PortfolioLiquidityPositionAsset { + type: String! + amount: Float! + amountUSD: Float! + price: Float! + change: Change + token: Token! + updatedAt: String + updatedAtBlock: Float +} + +type PortfolioTokenPosition { + id: ID! + chainId: Int! + balance: Float! + decimals: Int! + amount: Float! + amountUSD: Float! + price: Float! + change: Change! + token: Token! + updatedAt: String + updatedAtBlock: Float +} + +type Pool { + id: ID! + name: String! + address: String! + createdAt: String! + swapFee: Float! + protocol: String! + token0Price: Float! + token1Price: Float! + token0Address: String! + token1Address: String! + token0PriceUSD: Float! + token1PriceUSD: Float! + liquidityUSD: Float! + txCount1h: Int! + txCount1d: Int! + feeUSD1h: Float! + feeUSD1d: Float! + volumeUSD1h: Float! + volumeUSD1d: Float! + feeApr1d: Float! + source: String! +} + +type Query { + portfolio(id: ID!): Portfolio + portfolioLiquidityPositions(id: ID!): PortfolioPositions + portfolioWallet(id: ID!): PortfolioPositions + pools(chainId: ID!): [Pool] +} \ No newline at end of file diff --git a/packages/graph-client/tsconfig.json b/packages/graph-client/tsconfig.json index b166e0a6b4..e944e3d024 100644 --- a/packages/graph-client/tsconfig.json +++ b/packages/graph-client/tsconfig.json @@ -83,6 +83,12 @@ "tadaOutputLocation": "./src/subgraphs/sushi-v3/sushi-v3-env.d.ts", "tadaTurboLocation": "./src/subgraphs/sushi-v3/sushi-v3-cache.d.ts" }, + { + "name": "data-api", + "schema": "./src/subgraphs/data-api/schema.graphql", + "tadaOutputLocation": "./src/subgraphs/data-api/data-api-env.d.ts", + "tadaTurboLocation": "./src/subgraphs/data-api/data-api-cache.d.ts" + } ] } ] diff --git a/packages/sushi/src/config/subgraph/hosts.ts b/packages/sushi/src/config/subgraph/hosts.ts index 5ce4587f2a..d8f2a77be5 100644 --- a/packages/sushi/src/config/subgraph/hosts.ts +++ b/packages/sushi/src/config/subgraph/hosts.ts @@ -32,3 +32,5 @@ const DECENTRALIZED_NETWORK_KEY = SUSHI_DOMAIN_RESTRICTED_API_KEY export const DECENTRALIZED_HOST_BY_SUBGRAPH_ID = `gateway-arbitrum.network.thegraph.com/api/${DECENTRALIZED_NETWORK_KEY}/subgraphs/id` export const DECENTRALIZED_HOST_BY_DEPLOYMENT_ID = `gateway-arbitrum.network.thegraph.com/api/${DECENTRALIZED_NETWORK_KEY}/deployments/id` + +export const SUSHI_DATA_API_HOST = 'data-api-production-acb1.up.railway.app' \ No newline at end of file diff --git a/packages/sushi/src/config/subgraph/subgraphs/data-api.ts b/packages/sushi/src/config/subgraph/subgraphs/data-api.ts new file mode 100644 index 0000000000..4be9d61298 --- /dev/null +++ b/packages/sushi/src/config/subgraph/subgraphs/data-api.ts @@ -0,0 +1,3 @@ +import { SUSHI_DATA_API_HOST } from '../hosts.js' + +export const SUSHI_DATA_API_V0_URL = `${SUSHI_DATA_API_HOST}/graphql` diff --git a/packages/sushi/src/config/subgraph/subgraphs/index.ts b/packages/sushi/src/config/subgraph/subgraphs/index.ts index 515aaa4ad4..9e0743d9f4 100644 --- a/packages/sushi/src/config/subgraph/subgraphs/index.ts +++ b/packages/sushi/src/config/subgraph/subgraphs/index.ts @@ -7,3 +7,4 @@ export * from './mini-chef' export * from './sushi-bar' export * from './sushiswap-v2' export * from './sushiswap-v3' +export * from './data-api' From 0a5df2679764fb75e9cbd637622d67895d6a0884 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 21 Jun 2024 22:42:25 +0800 Subject: [PATCH 002/139] feat: add test table --- apps/evm/src/app/[chainId]/header.tsx | 17 ++ apps/evm/src/app/[chainId]/layout.tsx | 22 ++ apps/evm/src/app/[chainId]/pool/layout.tsx | 20 ++ apps/evm/src/app/[chainId]/pool/page.tsx | 26 ++ apps/evm/src/app/[chainId]/providers.tsx | 11 + apps/evm/src/ui/pool/NewPoolsTable.tsx | 262 ++++++++++++++++++ .../src/subgraphs/data-api/queries/pools.ts | 5 + .../src/subgraphs/data-api/schema.graphql | 6 + 8 files changed, 369 insertions(+) create mode 100644 apps/evm/src/app/[chainId]/header.tsx create mode 100644 apps/evm/src/app/[chainId]/layout.tsx create mode 100644 apps/evm/src/app/[chainId]/pool/layout.tsx create mode 100644 apps/evm/src/app/[chainId]/pool/page.tsx create mode 100644 apps/evm/src/app/[chainId]/providers.tsx create mode 100644 apps/evm/src/ui/pool/NewPoolsTable.tsx diff --git a/apps/evm/src/app/[chainId]/header.tsx b/apps/evm/src/app/[chainId]/header.tsx new file mode 100644 index 0000000000..6c93565318 --- /dev/null +++ b/apps/evm/src/app/[chainId]/header.tsx @@ -0,0 +1,17 @@ +'use client' + +import { Navigation } from '@sushiswap/ui' +import React, { FC } from 'react' +import { SUPPORTED_CHAIN_IDS } from 'src/config' +import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' +import { useChainId } from 'wagmi' + +export const Header: FC = () => { + const chainId = useChainId() + return ( + } + chainId={chainId} + /> + ) +} diff --git a/apps/evm/src/app/[chainId]/layout.tsx b/apps/evm/src/app/[chainId]/layout.tsx new file mode 100644 index 0000000000..bd46e1474f --- /dev/null +++ b/apps/evm/src/app/[chainId]/layout.tsx @@ -0,0 +1,22 @@ +import { HotJar } from '@sushiswap/ui' + +import { Header } from './header' +import { Providers } from './providers' + +export const metadata = { + title: 'Pool 💦', +} + +export default function PoolLayout({ + children, +}: { children: React.ReactNode }) { + return ( + <> + +
+
{children}
+ + + + ) +} diff --git a/apps/evm/src/app/[chainId]/pool/layout.tsx b/apps/evm/src/app/[chainId]/pool/layout.tsx new file mode 100644 index 0000000000..b877084cc5 --- /dev/null +++ b/apps/evm/src/app/[chainId]/pool/layout.tsx @@ -0,0 +1,20 @@ +import { Container } from '@sushiswap/ui' + +import { Hero } from '../../pool/hero' + +export default async function PoolsLayout({ + children, +}: { children: React.ReactNode }) { + return ( + <> + + + +
+
+ {children} +
+
+ + ) +} diff --git a/apps/evm/src/app/[chainId]/pool/page.tsx b/apps/evm/src/app/[chainId]/pool/page.tsx new file mode 100644 index 0000000000..249aabc209 --- /dev/null +++ b/apps/evm/src/app/[chainId]/pool/page.tsx @@ -0,0 +1,26 @@ +import { getPools } from '@sushiswap/graph-client/data-api' +import { Container } from '@sushiswap/ui' +import { unstable_cache } from 'next/cache' +import React from 'react' + +import { NewPoolsTable } from 'src/ui/pool/NewPoolsTable' + +export default async function PoolPage({ + params, +}: { + params: { chainId: string } +}) { + const pools = await unstable_cache( + async () => getPools({ chainId: params.chainId }), + ['pools', params.chainId], + { + revalidate: 60 * 15, + }, + )() + + return ( + + + + ) +} diff --git a/apps/evm/src/app/[chainId]/providers.tsx b/apps/evm/src/app/[chainId]/providers.tsx new file mode 100644 index 0000000000..a214b84ba7 --- /dev/null +++ b/apps/evm/src/app/[chainId]/providers.tsx @@ -0,0 +1,11 @@ +'use client' + +import { SplashController, ThemeProvider } from '@sushiswap/ui' + +export function Providers({ children }: { children: React.ReactNode }) { + return ( + + {children} + + ) +} diff --git a/apps/evm/src/ui/pool/NewPoolsTable.tsx b/apps/evm/src/ui/pool/NewPoolsTable.tsx new file mode 100644 index 0000000000..796ee0bb2a --- /dev/null +++ b/apps/evm/src/ui/pool/NewPoolsTable.tsx @@ -0,0 +1,262 @@ +'use client' + +import { Slot } from '@radix-ui/react-slot' +import { PoolsV1 } from '@sushiswap/graph-client/data-api' + +import { + Badge, + Card, + CardHeader, + CardTitle, + Currency, + DataTable, + NetworkIcon, + SkeletonCircle, + SkeletonText, + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from '@sushiswap/ui' +import { ColumnDef, Row, SortingState, TableState } from '@tanstack/react-table' +import React, { FC, ReactNode, useCallback, useMemo, useState } from 'react' +import { useTokenWithCache } from 'src/lib/wagmi/hooks/tokens/useTokenWithCache' +import { ChainId } from 'sushi/chain' +import { formatNumber, formatUSD } from 'sushi/format' +import { SushiSwapProtocol } from 'sushi/types' +import { ProtocolBadge } from './PoolNameCell' +import { + APR_COLUMN, + FEES_COLUMN, + TVL_COLUMN, + VOLUME_1D_COLUMN, + VOLUME_1M_COLUMN, + VOLUME_1W_COLUMN, +} from './columns' + +const COLUMNS = [ + { + id: 'name', + header: 'Name', + + cell: (props) => { + const { data: token0, isLoading: isToken0Loading } = useTokenWithCache({ + chainId: props.row.original.chainId as ChainId, + address: props.row.original.token0Address, + }) + + const { data: token1, isLoading: isToken1Loading } = useTokenWithCache({ + chainId: props.row.original.chainId as ChainId, + address: props.row.original.token1Address, + }) + + return isToken0Loading || isToken1Loading ? ( +
+
+ + +
+
+ +
+
+ ) : ( +
+
+ {token0 && token1 ? ( + + } + > + + + + + + ) : null} +
+
+ + {token0?.symbol}{' '} + + / + {' '} + {token1?.symbol}{' '} +
+ +
+ + + + { + ProtocolBadge[ + props.row.original.protocol as SushiSwapProtocol + ] + } + + +

Protocol version

+
+
+
+ + + +
+ {formatNumber(props.row.original.swapFee * 100)}% +
+
+ +

Swap fee

+
+
+
+ {props.row.original.isIncentivized && ( + + + +
+ 🧑‍🌾{' '} +
+
+ +

Farm rewards available

+
+
+
+ )} + {props.row.original.isSmartPool && ( + + + +
+ 💡 +
+
+ +

Smart Pool available

+
+
+
+ )} +
+
+
+ ) + }, + size: 300, + }, + TVL_COLUMN, + { + id: 'volumeUSD1h', + header: 'Volume (60min)', + accessorFn: (row) => row.volumeUSD1h, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.volumeUSD1h - rowB.volumeUSD1h, + cell: (props) => + formatUSD(props.row.original.volumeUSD1h).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.volumeUSD1h), + }, + VOLUME_1D_COLUMN, + { + id: 'feeUSD1h', + header: 'Fees (60min)', + accessorFn: (row) => row.feeUSD1h, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.feeUSD1h - rowB.feeUSD1h, + cell: (props) => + formatUSD(props.row.original.feeUSD1h).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.feeUSD1h), + }, + { + id: 'feeUSD1d', + header: 'Fees (24h)', + accessorFn: (row) => row.feeUSD1d, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.feeUSD1d - rowB.feeUSD1d, + cell: (props) => + formatUSD(props.row.original.feeUSD1d).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.feeUSD1d), + }, + APR_COLUMN, +] as ColumnDef[] + +interface PositionsTableProps { + pools: PoolsV1 + onRowClick?(row: PoolsV1[number]): void +} + +export const NewPoolsTable: FC = ({ + pools, + onRowClick, +}) => { + const [sorting, setSorting] = useState([ + { id: 'liquidityUSD', desc: true }, + ]) + + const data = useMemo(() => pools?.flat() || [], [pools]) + + const state: Partial = useMemo(() => { + return { + sorting, + pagination: { + pageIndex: 0, + pageSize: data?.length, + }, + } + }, [data?.length, sorting]) + + const rowRenderer = useCallback( + (row: Row, rowNode: ReactNode) => { + if (onRowClick) + return ( + onRowClick?.(row.original)} + > + {rowNode} + + ) + return rowNode + }, + [onRowClick], + ) + + return ( + + + + Pools{' '} + {pools.length ? ( + + ({pools.length}) + + ) : null} + + + `/pool/${row.chainId}%3A${row.address}`} + rowRenderer={rowRenderer} + columns={COLUMNS} + data={data} + /> + + ) +} diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pools.ts index 76cb22d752..5f29753173 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pools.ts @@ -9,6 +9,7 @@ export const PoolsQuery = graphql( ` query Pools($chainId: ID!) { pools(chainId: $chainId) { + chainId id name address @@ -29,7 +30,11 @@ query Pools($chainId: ID!) { volumeUSD1h volumeUSD1d feeApr1d + totalApr1d + incentiveApr source + isIncentivized + isSmartPool } } `, diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index 5dbdcc202f..2c39c6483a 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -72,6 +72,7 @@ type PortfolioTokenPosition { type Pool { id: ID! + chainId: Int! name: String! address: String! createdAt: String! @@ -91,6 +92,11 @@ type Pool { volumeUSD1h: Float! volumeUSD1d: Float! feeApr1d: Float! + totalApr1d: Float! + incentiveApr: Float! + isSmartPool: Boolean! + isIncentivized: Boolean! + wasIncentivized: Boolean! source: String! } From cfb0a45d16cdf30324a71fdf13ccceffd3f16b60 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 22 Jun 2024 01:11:17 +0800 Subject: [PATCH 003/139] fix: pool name column --- apps/evm/src/ui/pool/NewPoolsTable.tsx | 54 ++++++++++---------------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/apps/evm/src/ui/pool/NewPoolsTable.tsx b/apps/evm/src/ui/pool/NewPoolsTable.tsx index 796ee0bb2a..523e60dfed 100644 --- a/apps/evm/src/ui/pool/NewPoolsTable.tsx +++ b/apps/evm/src/ui/pool/NewPoolsTable.tsx @@ -11,8 +11,6 @@ import { Currency, DataTable, NetworkIcon, - SkeletonCircle, - SkeletonText, Tooltip, TooltipContent, TooltipProvider, @@ -20,19 +18,12 @@ import { } from '@sushiswap/ui' import { ColumnDef, Row, SortingState, TableState } from '@tanstack/react-table' import React, { FC, ReactNode, useCallback, useMemo, useState } from 'react' -import { useTokenWithCache } from 'src/lib/wagmi/hooks/tokens/useTokenWithCache' import { ChainId } from 'sushi/chain' +import { Token } from 'sushi/currency' import { formatNumber, formatUSD } from 'sushi/format' import { SushiSwapProtocol } from 'sushi/types' import { ProtocolBadge } from './PoolNameCell' -import { - APR_COLUMN, - FEES_COLUMN, - TVL_COLUMN, - VOLUME_1D_COLUMN, - VOLUME_1M_COLUMN, - VOLUME_1W_COLUMN, -} from './columns' +import { APR_COLUMN, TVL_COLUMN, VOLUME_1D_COLUMN } from './columns' const COLUMNS = [ { @@ -40,27 +31,23 @@ const COLUMNS = [ header: 'Name', cell: (props) => { - const { data: token0, isLoading: isToken0Loading } = useTokenWithCache({ - chainId: props.row.original.chainId as ChainId, - address: props.row.original.token0Address, - }) - - const { data: token1, isLoading: isToken1Loading } = useTokenWithCache({ - chainId: props.row.original.chainId as ChainId, - address: props.row.original.token1Address, - }) + const [token0, token1] = useMemo( + () => [ + new Token({ + chainId: props.row.original.chainId, + address: props.row.original.token0Address, + decimals: 0, + }), + new Token({ + chainId: props.row.original.chainId, + address: props.row.original.token1Address, + decimals: 0, + }), + ], + [props.row.original], + ) - return isToken0Loading || isToken1Loading ? ( -
-
- - -
-
- -
-
- ) : ( + return (
{token0 && token1 ? ( @@ -84,11 +71,12 @@ const COLUMNS = [
- {token0?.symbol}{' '} + {props.row.original.name} + {/* {token0?.symbol}{' '} / {' '} - {token1?.symbol}{' '} + {token1?.symbol}{' '} */}
Date: Fri, 21 Jun 2024 20:38:54 +0200 Subject: [PATCH 004/139] feat(apps/evm): revalidate after 3m --- apps/evm/src/app/[chainId]/pool/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/evm/src/app/[chainId]/pool/page.tsx b/apps/evm/src/app/[chainId]/pool/page.tsx index 249aabc209..2aef03c8ce 100644 --- a/apps/evm/src/app/[chainId]/pool/page.tsx +++ b/apps/evm/src/app/[chainId]/pool/page.tsx @@ -14,7 +14,7 @@ export default async function PoolPage({ async () => getPools({ chainId: params.chainId }), ['pools', params.chainId], { - revalidate: 60 * 15, + revalidate: 60 * 3, }, )() From bf738924f214ef21abe7616c3869b1951aee5d7e Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Sat, 29 Jun 2024 21:33:16 +0200 Subject: [PATCH 005/139] feat(packages/graph-client): portfolio queries --- .../data-api/queries/portfolio-positions.ts | 144 +++++++++++++++ .../data-api/queries/portfolio-wallet.ts | 53 ++++++ .../src/subgraphs/data-api/schema.graphql | 167 ++++++++++-------- 3 files changed, 289 insertions(+), 75 deletions(-) create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts new file mode 100644 index 0000000000..6ae1ad8b3c --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts @@ -0,0 +1,144 @@ +import type { VariablesOf } from 'gql.tada' + +import { request, type RequestOptions } from 'src/lib/request' +import { graphql } from '../graphql' + +export const PortfolioPositionsQuery = graphql( + ` +query PortfolioPositions($id: ID!) { + portfolioLiquidityPositions(id: $id) { + totalUSD + v2Positions { + id + chainId + chain + protocol + protocolId + protocolLogoUrl + address + swapFee + token0 { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + token1 { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + + amountUSD + updatedAt + } + v3Positions { + id + chainId + chain + protocol + protocolId + protocolLogoUrl + address + positionId + range + swapFee + token0 { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + token1 { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + rewards { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + amountUSD + updatedAt + } + } +} +`, +) + +export type getPortfolioPositions = VariablesOf + +export async function getPortfolioPositions(variables: getPortfolioPositions, options?: RequestOptions) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + + const result = await request( + { url, document: PortfolioPositionsQuery, variables }, + options, + ) + if (result) { + return result.portfolioLiquidityPositions + } + + throw new Error('No portfolio positions') +} + +export type PortfolioPositions = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts new file mode 100644 index 0000000000..86a2e7fa8c --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts @@ -0,0 +1,53 @@ +import type { VariablesOf } from 'gql.tada' + +import { request, type RequestOptions } from 'src/lib/request' +import { graphql } from '../graphql' + +export const PortfolioWalletQuery = graphql( + ` + query PortfolioWallet($id: ID!) { + portfolioWallet(id: $id) { + totalUSD + amountUSD24Change + percentageChange24h + tokens { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + price24hChange + isVerified + isCore + isWallet + timeAt + amount + rawAmount + amountUSD + } + } + } +`, +) + +export type getPortfolioWallet = VariablesOf + +export async function getPortfolioWallet(variables: getPortfolioWallet, options?: RequestOptions) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + + const result = await request( + { url, document: PortfolioWalletQuery, variables }, + options, + ) + if (result) { + return result.portfolioWallet + } + + throw new Error('No portfolio wallet') +} + +export type PortfolioWallet = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index 2c39c6483a..aac4cdb5d2 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -1,75 +1,3 @@ -type Change { - absolute1D: Float! - percent1D: Float! -} - -type BalanceByChain { - id: ID! - networkName: String! - balance: Float! -} - -type Portfolio { - id: ID! - balance: Float! - balanceByChains: [BalanceByChain]! - changes: Change! -} - -type PortfolioPositions { - id: ID! - liquidityPositions: [PortfolioLiquidityPosition] - wallet: [PortfolioTokenPosition] -} - -type TokenStatus { - verified: Boolean - isTrash: Boolean -} - -type Token { - address: String! - name: String! - symbol: String! - decimals: Int! - status: TokenStatus - logoUrl: String -} - -type PortfolioLiquidityPosition { - id: ID! - chainId: Int! - protocol: String! - name: String! - source: String! - assets: [PortfolioLiquidityPositionAsset]! -} - -type PortfolioLiquidityPositionAsset { - type: String! - amount: Float! - amountUSD: Float! - price: Float! - change: Change - token: Token! - updatedAt: String - updatedAtBlock: Float -} - -type PortfolioTokenPosition { - id: ID! - chainId: Int! - balance: Float! - decimals: Int! - amount: Float! - amountUSD: Float! - price: Float! - change: Change! - token: Token! - updatedAt: String - updatedAtBlock: Float -} - type Pool { id: ID! chainId: Int! @@ -100,9 +28,98 @@ type Pool { source: String! } +type SimpleToken { + id: String! + chain: String! + chainId: Int! + name: String! + symbol: String + decimals: Int! + logoUrl: String + protocolId: String! + price: Float! + isVerified: Boolean! + isCore: Boolean! + isWallet: Boolean! + timeAt: Int + amount: Float! + amountUSD: Float! +} + +type PortfolioToken { + id: String! + chain: String! + chainId: Int! + name: String! + symbol: String + decimals: Int! + logoUrl: String + protocolId: String! + price: Float! + price24hChange: Float + isVerified: Boolean! + isCore: Boolean! + isWallet: Boolean! + timeAt: Int + amount: Float! + rawAmount: Float! + amountUSD: Float! +} + +type V2PortfolioPosition { + id: String! + chainId: Int! + chain: String! + protocol: String! + protocolId: String! + protocolLogoUrl: String! + address: String! + swapFee: Float! + token0: SimpleToken! + token1: SimpleToken! + amountUSD: Float! + updatedAt: Int +} + +enum RangeStatus { + IN_RANGE + OUT_OF_RANGE + UNKNOWN +} + +type V3PortfolioPosition { + id: String! + chainId: Int! + chain: String! + protocol: String! + protocolId: String! + protocolLogoUrl: String! + address: String! + swapFee: Float! + positionId: Int! + range: RangeStatus! + token0: SimpleToken! + token1: SimpleToken! + rewards: [SimpleToken]! + amountUSD: Float! + updatedAt: Int +} + +type PortfolioPositions { + totalUSD: Float! + v2Positions: [V2PortfolioPosition]! + v3Positions: [V3PortfolioPosition]! +} + +type PortfolioWallet { + totalUSD: Float! + amountUSD24Change: Float! + percentageChange24h: Float! + tokens: [PortfolioToken]! +} + type Query { - portfolio(id: ID!): Portfolio - portfolioLiquidityPositions(id: ID!): PortfolioPositions - portfolioWallet(id: ID!): PortfolioPositions + portfolioWallet(id: ID!): PortfolioWallet! + portfolioLiquidityPositions(id: ID!): PortfolioPositions! pools(chainId: ID!): [Pool] } \ No newline at end of file From 7cdaba1028eee49c4584a6c699a0a103a6e9b97b Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Sun, 30 Jun 2024 17:38:17 +0200 Subject: [PATCH 006/139] feat: init portfolio --- apps/evm/src/app/stake/header.tsx | 6 +- .../account/EnsToAddressResolver.tsx | 2 +- apps/evm/src/ui/portfolio/Portfolio.tsx | 57 +++++++++++ apps/evm/src/ui/portfolio/PortfolioTab.tsx | 96 +++++++++++++++++++ .../portfolio/WalletTable/PortfolioWallet.tsx | 40 ++++++++ .../WalletTable/PortfolioWalletTable.tsx | 72 ++++++++++++++ .../WalletTable/PortfolioWalletTotal.tsx | 41 ++++++++ .../src/ui/portfolio/WalletTable/columns.tsx | 93 ++++++++++++++++++ .../src/subgraphs/data-api/index.ts | 4 +- .../src/subgraphs/data-api/queries/pools.ts | 4 +- .../data-api/queries/portfolio-positions.ts | 4 +- .../data-api/queries/portfolio-wallet.ts | 8 +- packages/ui/src/components/index.ts | 1 + 13 files changed, 417 insertions(+), 11 deletions(-) create mode 100644 apps/evm/src/ui/portfolio/Portfolio.tsx create mode 100644 apps/evm/src/ui/portfolio/PortfolioTab.tsx create mode 100644 apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx create mode 100644 apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx create mode 100644 apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTotal.tsx create mode 100644 apps/evm/src/ui/portfolio/WalletTable/columns.tsx diff --git a/apps/evm/src/app/stake/header.tsx b/apps/evm/src/app/stake/header.tsx index d9062fdaeb..6e74ac3818 100644 --- a/apps/evm/src/app/stake/header.tsx +++ b/apps/evm/src/app/stake/header.tsx @@ -5,10 +5,14 @@ import React, { FC } from 'react' import { SUPPORTED_CHAIN_IDS } from 'src/config' import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' +import { Portfolio } from 'src/ui/portfolio/Portfolio' export const Header: FC = () => { return ( } + rightElement={<> + + + } /> ) } diff --git a/apps/evm/src/lib/wagmi/components/account/EnsToAddressResolver.tsx b/apps/evm/src/lib/wagmi/components/account/EnsToAddressResolver.tsx index 373ca4095b..6889927efd 100644 --- a/apps/evm/src/lib/wagmi/components/account/EnsToAddressResolver.tsx +++ b/apps/evm/src/lib/wagmi/components/account/EnsToAddressResolver.tsx @@ -22,7 +22,7 @@ export const EnsToAddressResolver = ({ if (result.data && props.query?.onSuccess) { props.query.onSuccess(result.data) } - }, [props.query?.onSuccess, result.data]) + }, [props.query, props.query?.onSuccess, result.data]) if (typeof children === 'function') { return children(result) diff --git a/apps/evm/src/ui/portfolio/Portfolio.tsx b/apps/evm/src/ui/portfolio/Portfolio.tsx new file mode 100644 index 0000000000..208712845e --- /dev/null +++ b/apps/evm/src/ui/portfolio/Portfolio.tsx @@ -0,0 +1,57 @@ +'use client' +import { + Sheet, + SheetContent, + SheetHeader, + SheetTitle, + SheetTrigger, + SkeletonBox, +} from '@sushiswap/ui' +import { PortfolioTab } from './PortfolioTab' +import { AddressToEnsResolver } from 'src/lib/wagmi/components/account/AddressToEnsResolver' +import { shortenAddress } from 'sushi' +import { useAccount } from 'wagmi' + +export const Portfolio = () => { + const account = useAccount() + return ( + + Portfolio + + + + + {({ isLoading, data }) => { + return ( + <> + {account.address ? ( + isLoading || !data ? ( + shortenAddress(account.address) + ) : ( +
+ + {`${data}`} + + + {shortenAddress(account.address)} + +
+ ) + ) : ( + + )} + + ) + }} +
+
+ {/* + This action cannot be undone. This will permanently delete your + account and remove your data from our servers. + */} +
+ +
+
+ ) +} diff --git a/apps/evm/src/ui/portfolio/PortfolioTab.tsx b/apps/evm/src/ui/portfolio/PortfolioTab.tsx new file mode 100644 index 0000000000..ae73e777b0 --- /dev/null +++ b/apps/evm/src/ui/portfolio/PortfolioTab.tsx @@ -0,0 +1,96 @@ +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, + Tabs, + TabsContent, + TabsList, + TabsTrigger, +} from '@sushiswap/ui'; +import React, { useState } from 'react'; +import { PortfolioWallet } from './WalletTable/PortfolioWallet'; + + + +const ITEMS: { id: string; value: string; children: React.ReactNode }[] = [ + { + id: 'wallet', + value: 'wallet', + children: ( +
+ + Wallet + +
+ ), + }, + { + id: 'positions', + value: 'Positions', + children: ( +
+ + Positions + +
+ ), + }, + { + id: 'activity', + value: 'Activity', + children: ( +
+ Activity +
+ ), + }, + ] + + export const PortfolioTab = () => { + const [tab, setTab] = useState('v3') + + return ( +
+ +
+
+ +
+ + {ITEMS.map((item) => ( + + {item.children} + + ))} + +
+ + + + + + + + +
+
+ ) + } + \ No newline at end of file diff --git a/apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx new file mode 100644 index 0000000000..321082ffb6 --- /dev/null +++ b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx @@ -0,0 +1,40 @@ +import { getPortfolioWallet } from '@sushiswap/graph-client/data-api' +import { useQuery } from '@tanstack/react-query' +import { Address } from 'viem' +import { useAccount } from 'wagmi' +import { PortfolioWalletTable } from './PortfolioWalletTable' +import { PortfolioWalletInfo } from './PortfolioWalletTotal' + +function usePortfolioWallet( + address: Address | undefined, + refetchInterval?: 600, +) { + return useQuery({ + queryKey: ['portfolio-wallet', address], + queryFn: async () => { + if (!address) return null + const id = address as string + const data = await getPortfolioWallet({ id }) + return data + }, + enabled: !!address, + refetchInterval, + }) +} + +export const PortfolioWallet = () => { + const id = useAccount() + const { data, isLoading } = usePortfolioWallet(id.address) + + return ( +
+ + +
+ ) +} diff --git a/apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx new file mode 100644 index 0000000000..f82409eba3 --- /dev/null +++ b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx @@ -0,0 +1,72 @@ +'use client' + +import { PortfolioWalletToken } from '@sushiswap/graph-client/data-api' +import { DataTable, Slot } from '@sushiswap/ui' +import { ColumnDef, Row } from '@tanstack/react-table' +import { FC, ReactNode, useCallback } from 'react' +import { + NAME_SYMBOL_AMOUNT_COLUMN, + TOKEN_ICON_COLUMN, + USD_COLUMN, +} from './columns' + + +const COLUMNS = [ + TOKEN_ICON_COLUMN, + NAME_SYMBOL_AMOUNT_COLUMN, + USD_COLUMN, +] satisfies ColumnDef[] + +// const tableState = { sorting: [{ id: 'amountUSD', desc: true }] } + +interface PortfolioWalletTableProps { + isLoading: boolean + data: PortfolioWalletToken[] + onRowClick?(row: PortfolioWalletToken): void +} + + +export const PortfolioWalletTable: FC = ({ + isLoading, + data, + onRowClick, +}) => { + // const [paginationState, setPaginationState] = useState({ + // pageIndex: 0, + // pageSize: 10, + // }) + + const rowRenderer = useCallback( + (row: Row, rowNode: ReactNode) => { + if (onRowClick) + return ( + onRowClick?.(row.original)} + > + {rowNode} + + ) + return rowNode + }, + [onRowClick], + ) + + if (isLoading) return
Loading...
+ if (!data) return
No data
+ + return ( + + // `/pool/${row.chainId}:${ + // row.address + // }/positions/${row.tokenId.toString()}` + // } + rowRenderer={rowRenderer} + columns={COLUMNS} + data={data.sort((a, b) => b.amountUSD - a.amountUSD)} + /> + ) +} diff --git a/apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTotal.tsx b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTotal.tsx new file mode 100644 index 0000000000..a3dfd14f10 --- /dev/null +++ b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTotal.tsx @@ -0,0 +1,41 @@ +import { classNames } from '@sushiswap/ui' +import { FC } from 'react' +import { formatPercent, formatUSD } from 'sushi' + +interface PortfolioWalletInfoProps { + isLoading: boolean + percentageChange24h: number | undefined + amountUSD24Change: number | undefined + totalUSD: number | undefined +} + +export const PortfolioWalletInfo: FC = ({ + isLoading, + percentageChange24h, + amountUSD24Change, + totalUSD, +}) => ( + <> + {isLoading ? ( +
+ ) : ( +
+ + {formatUSD(totalUSD ?? 0)} + + + {(percentageChange24h ?? 0) > 0 ? '+' : '-'} + {formatUSD(amountUSD24Change ?? 0)} + 0 ? 'text-green' : 'text-red', + )} + > + {` (${formatPercent(Math.abs(percentageChange24h ?? 0))})`} + + +
+ )} + +) diff --git a/apps/evm/src/ui/portfolio/WalletTable/columns.tsx b/apps/evm/src/ui/portfolio/WalletTable/columns.tsx new file mode 100644 index 0000000000..aeefcf0687 --- /dev/null +++ b/apps/evm/src/ui/portfolio/WalletTable/columns.tsx @@ -0,0 +1,93 @@ +import { SkeletonCircle, SkeletonText, classNames } from '@sushiswap/ui' +import { ColumnDef } from '@tanstack/react-table' +import { formatPercent, formatUSD } from 'sushi/format' + +import { QuestionMarkCircleIcon } from '@heroicons/react-v1/solid' +import { PortfolioWalletToken } from '@sushiswap/graph-client/data-api' + +export const TOKEN_ICON_COLUMN: ColumnDef = { + id: 'icon', + header: 'icon', + cell: (props) => + // get token + props.row.original.logoUrl ? ( + // render logo 64x64 + {props.row.original.name} + ) : ( + // render network icon + // question mark icon + + ), + meta: { + skeleton: , + }, +} + +export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef< + PortfolioWalletToken, + unknown +> = { + id: 'name', + header: 'Name', + cell: (props) => + ( +
+ + {props.row.original.name} + + + {props.row.original.amount.toFixed(6)} {props.row.original.symbol} + +
+ ), + meta: { + skeleton: ( +
+
+ + +
+
+ +
+
+ ), + }, + size: 300, +} + +export const USD_COLUMN: ColumnDef = { + id: 'usd', + header: '$', + cell: (props) => + formatUSD(props.row.original.amountUSD).includes('NaN') ? ( + '$0.00' + ) : ( + // `${formatUSD(props.row.original.amountUSD)} ${props.row.original.price24hChange}`) +
+ + {formatUSD(props.row.original.amountUSD)} + + 0 ? 'text-green' : 'text-red', + )} + > + {props.row.original.price24hChange > 0 ? '+' : '-'} + {formatPercent(Math.abs(props.row.original.price24hChange))} + +
+ ), + meta: { + skeleton: , + }, +} diff --git a/packages/graph-client/src/subgraphs/data-api/index.ts b/packages/graph-client/src/subgraphs/data-api/index.ts index bc9fe0ce80..feb3dcb4ee 100644 --- a/packages/graph-client/src/subgraphs/data-api/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/index.ts @@ -1 +1,3 @@ -export * from './queries/pools' \ No newline at end of file +export * from './queries/pools' +export * from './queries/portfolio-positions' +export * from './queries/portfolio-wallet' \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pools.ts index 5f29753173..063df0a4f7 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pools.ts @@ -1,6 +1,4 @@ import type { VariablesOf } from 'gql.tada' - -import { FetchError } from 'src/lib/fetch-error' import { type RequestOptions, request } from 'src/lib/request' // import { SUSHI_DATA_API_V0_URL } from 'sushi/config/subgraph' import { graphql } from '../graphql' @@ -53,7 +51,7 @@ export async function getPools(variables: GetPools, options?: RequestOptions) { return result.pools } - throw new FetchError(1, 'No bar') + throw new Error('No pools') } export type PoolsV1 = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts index 6ae1ad8b3c..890e3b3bc4 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts @@ -125,9 +125,9 @@ query PortfolioPositions($id: ID!) { `, ) -export type getPortfolioPositions = VariablesOf +export type GetPortfolioPositions = VariablesOf -export async function getPortfolioPositions(variables: getPortfolioPositions, options?: RequestOptions) { +export async function getPortfolioPositions(variables: GetPortfolioPositions, options?: RequestOptions) { const url = `https://data-api-production-acb1.up.railway.app/graphql/` const result = await request( diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts index 86a2e7fa8c..b75688785f 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts @@ -34,10 +34,11 @@ export const PortfolioWalletQuery = graphql( `, ) -export type getPortfolioWallet = VariablesOf +export type GetPortfolioWallet = VariablesOf -export async function getPortfolioWallet(variables: getPortfolioWallet, options?: RequestOptions) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` +export async function getPortfolioWallet(variables: GetPortfolioWallet, options?: RequestOptions) { + const url = `http://localhost:4000/graphql/` + // const url = `https://data-api-production-acb1.up.railway.app/graphql/` const result = await request( { url, document: PortfolioWalletQuery, variables }, @@ -51,3 +52,4 @@ export async function getPortfolioWallet(variables: getPortfolioWallet, options? } export type PortfolioWallet = Awaited> +export type PortfolioWalletToken = PortfolioWallet['tokens'][0] \ No newline at end of file diff --git a/packages/ui/src/components/index.ts b/packages/ui/src/components/index.ts index 3d32f89253..d1aee2518e 100644 --- a/packages/ui/src/components/index.ts +++ b/packages/ui/src/components/index.ts @@ -61,3 +61,4 @@ export * from './toggle' export * from './tooltip' export * from './typography' export * from './widget' +export * from './sheet' \ No newline at end of file From 1d4b53641c7d95caa656921072b90ea7b6e3e195 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Sun, 30 Jun 2024 21:00:20 +0200 Subject: [PATCH 007/139] feat: portfolio positions --- apps/evm/src/ui/portfolio/PortfolioTab.tsx | 9 +- .../PositionsTable/PortfolioPositionTable.tsx | 60 ++++++++ .../PositionsTable/PortfolioPositionTotal.tsx | 25 ++++ .../PositionsTable/PortfolioPositions.tsx | 38 +++++ .../ui/portfolio/PositionsTable/columns.tsx | 137 ++++++++++++++++++ .../portfolio/WalletTable/PortfolioWallet.tsx | 6 +- .../data-api/queries/portfolio-positions.ts | 8 +- 7 files changed, 275 insertions(+), 8 deletions(-) create mode 100644 apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTable.tsx create mode 100644 apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTotal.tsx create mode 100644 apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositions.tsx create mode 100644 apps/evm/src/ui/portfolio/PositionsTable/columns.tsx diff --git a/apps/evm/src/ui/portfolio/PortfolioTab.tsx b/apps/evm/src/ui/portfolio/PortfolioTab.tsx index ae73e777b0..4797b5e477 100644 --- a/apps/evm/src/ui/portfolio/PortfolioTab.tsx +++ b/apps/evm/src/ui/portfolio/PortfolioTab.tsx @@ -11,6 +11,7 @@ import { } from '@sushiswap/ui'; import React, { useState } from 'react'; import { PortfolioWallet } from './WalletTable/PortfolioWallet'; +import { PortfolioPositions } from './PositionsTable/PortfolioPositions'; @@ -28,7 +29,7 @@ const ITEMS: { id: string; value: string; children: React.ReactNode }[] = [ }, { id: 'positions', - value: 'Positions', + value: 'positions', children: (
@@ -39,7 +40,7 @@ const ITEMS: { id: string; value: string; children: React.ReactNode }[] = [ }, { id: 'activity', - value: 'Activity', + value: 'pctivity', children: (
Activity @@ -49,7 +50,7 @@ const ITEMS: { id: string; value: string; children: React.ReactNode }[] = [ ] export const PortfolioTab = () => { - const [tab, setTab] = useState('v3') + const [tab, setTab] = useState('wallet') return (
@@ -83,9 +84,9 @@ const ITEMS: { id: string; value: string; children: React.ReactNode }[] = [
- + diff --git a/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTable.tsx b/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTable.tsx new file mode 100644 index 0000000000..cad6e9d731 --- /dev/null +++ b/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTable.tsx @@ -0,0 +1,60 @@ +'use client' + +import { PortfolioPosition } from '@sushiswap/graph-client/data-api' +import { DataTable, Slot } from '@sushiswap/ui' +import { ColumnDef, Row } from '@tanstack/react-table' +import { FC, ReactNode, useCallback } from 'react' +import { ICON_COLUMN, NAME_SYMBOL_AMOUNT_COLUMN, USD_COLUMN } from './columns' + +const COLUMNS = [ + ICON_COLUMN, + NAME_SYMBOL_AMOUNT_COLUMN, + USD_COLUMN, +] satisfies ColumnDef[] + +interface PortfolioPositionTableProps { + isLoading: boolean + data: PortfolioPosition[] + onRowClick?(row: PortfolioPosition): void +} + +export const PortfolioPositionTable: FC = ({ + isLoading, + data, + onRowClick, +}) => { + + const rowRenderer = useCallback( + (row: Row, rowNode: ReactNode) => { + if (onRowClick) + return ( + onRowClick?.(row.original)} + > + {rowNode} + + ) + return rowNode + }, + [onRowClick], + ) + + if (isLoading) return
Loading...
+ if (!data) return
No data
+ + return ( + + // `/pool/${row.chainId}:${ + // row.address + // }/positions/${row.tokenId.toString()}` + // } + rowRenderer={rowRenderer} + columns={COLUMNS} + data={data.sort((a, b) => b.amountUSD - a.amountUSD)} + /> + ) +} diff --git a/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTotal.tsx b/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTotal.tsx new file mode 100644 index 0000000000..e9b24e40cb --- /dev/null +++ b/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTotal.tsx @@ -0,0 +1,25 @@ +import { classNames } from '@sushiswap/ui' +import { FC } from 'react' +import { formatUSD } from 'sushi' + +interface PortfolioPositionInfoProps { + isLoading: boolean + totalUSD: number | undefined +} + +export const PortfolioPositionInfo: FC = ({ + isLoading, + totalUSD, +}) => ( + <> + {isLoading ? ( +
+ ) : ( +
+ + {formatUSD(totalUSD ?? 0)} + +
+ )} + +) diff --git a/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositions.tsx b/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositions.tsx new file mode 100644 index 0000000000..a86af72507 --- /dev/null +++ b/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositions.tsx @@ -0,0 +1,38 @@ +import { getPortfolioPositions } from '@sushiswap/graph-client/data-api' +import { useQuery } from '@tanstack/react-query' +import { Address } from 'viem' +import { useAccount } from 'wagmi' +import { PortfolioPositionTable } from './PortfolioPositionTable' +import { PortfolioPositionInfo } from './PortfolioPositionTotal' + +function usePortfolioPositions( + address: Address | undefined, + refetchInterval?: 600_000, +) { + return useQuery({ + queryKey: ['portfolio-positions', address], + queryFn: async () => { + if (!address) return null + const id = address as string + const data = await getPortfolioPositions({ id }) + return data + }, + enabled: !!address, + refetchInterval, + }) +} + +export const PortfolioPositions = () => { + const id = useAccount() + const { data, isLoading } = usePortfolioPositions(id.address) + + return ( + <> + + + + ) +} diff --git a/apps/evm/src/ui/portfolio/PositionsTable/columns.tsx b/apps/evm/src/ui/portfolio/PositionsTable/columns.tsx new file mode 100644 index 0000000000..b7c75ac91a --- /dev/null +++ b/apps/evm/src/ui/portfolio/PositionsTable/columns.tsx @@ -0,0 +1,137 @@ +import { SkeletonCircle, SkeletonText, classNames } from '@sushiswap/ui' +import { ColumnDef } from '@tanstack/react-table' +import { formatUSD, formatPercent } from 'sushi/format' + +import { QuestionMarkCircleIcon } from '@heroicons/react-v1/solid' +import { PortfolioPosition } from '@sushiswap/graph-client/data-api' +import { SushiSwapProtocol } from 'sushi/types' + +export const ProtocolBadge: Record = { + // [Protocol.BENTOBOX_STABLE]: ( + //
+ // Trident Stable + //
+ // ), + // [Protocol.BENTOBOX_CLASSIC]: ( + //
+ // Trident Classic + //
+ // ), + [SushiSwapProtocol.SUSHISWAP_V2]: ( +
+ V2 +
+ ), + [SushiSwapProtocol.SUSHISWAP_V3]: ( +
+ V3 +
+ ), +} + +export const ICON_COLUMN: ColumnDef = { + id: 'icon', + header: 'icon', + cell: (props) => ( + // get token + +
+ {props.row.original.token0.logoUrl ? ( + {props.row.original.token0.name} + ) : ( + + )} + + {props.row.original.token1.logoUrl ? ( + {props.row.original.token1.name} + ) : ( + + )} +
+ ), + meta: { + skeleton: , + }, +} + +export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef = + { + id: 'name', + header: 'Name', + cell: (props) => ( + <> +
+ + {`${props.row.original.token0.symbol} / ${props.row.original.token1.symbol}`} + + + {ProtocolBadge[props.row.original.protocol]}{' '} + {formatPercent(props.row.original.swapFee)} + +
+ + ), + meta: { + skeleton: ( +
+
+ + +
+
+ +
+
+ ), + }, + size: 300, + } + +export const USD_COLUMN: ColumnDef = { + id: 'usd', + header: '$', + cell: (props) => + formatUSD(props.row.original.amountUSD).includes('NaN') ? ( + '$0.00' + ) : ( + // `${formatUSD(props.row.original.amountUSD)} ${props.row.original.price24hChange}`) +
+ + {formatUSD(props.row.original.amountUSD)} + + + { +
+ {props.row.original?.range === 'IN_RANGE' ? ( + // green dot + <> +
+ + In Range + + ) : props.row.original?.range === 'OUT_RANGE' ? ( + // red dot + <> +
+ + Out of Range + + ) : ( + <> + )} +
+ } +
+ ), + meta: { + skeleton: , + }, +} diff --git a/apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx index 321082ffb6..da0cee941c 100644 --- a/apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx +++ b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx @@ -7,7 +7,7 @@ import { PortfolioWalletInfo } from './PortfolioWalletTotal' function usePortfolioWallet( address: Address | undefined, - refetchInterval?: 600, + refetchInterval?: 600_000, ) { return useQuery({ queryKey: ['portfolio-wallet', address], @@ -27,7 +27,7 @@ export const PortfolioWallet = () => { const { data, isLoading } = usePortfolioWallet(id.address) return ( -
+ <> { percentageChange24h={data?.percentageChange24h} /> -
+ ) } diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts index 890e3b3bc4..df096361ea 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts @@ -128,7 +128,8 @@ query PortfolioPositions($id: ID!) { export type GetPortfolioPositions = VariablesOf export async function getPortfolioPositions(variables: GetPortfolioPositions, options?: RequestOptions) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + // const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `http://localhost:4000/graphql/` const result = await request( { url, document: PortfolioPositionsQuery, variables }, @@ -142,3 +143,8 @@ export async function getPortfolioPositions(variables: GetPortfolioPositions, op } export type PortfolioPositions = Awaited> + +export type PortfolioV2Position = PortfolioPositions['v2Positions'][0] +export type PortfolioV3Position = PortfolioPositions['v3Positions'][0] + +export type PortfolioPosition = PortfolioV2Position | PortfolioV3Position \ No newline at end of file From f963525f125283673c83c7237dbc980549c295e7 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Mon, 1 Jul 2024 09:50:40 +0200 Subject: [PATCH 008/139] fix: portfolio endpoints, hide header columns --- apps/evm/src/ui/portfolio/Portfolio.tsx | 4 -- apps/evm/src/ui/portfolio/PortfolioTab.tsx | 22 +++---- .../PositionsTable/PortfolioPositionTable.tsx | 1 + .../portfolio/WalletTable/PortfolioWallet.tsx | 5 +- .../WalletTable/PortfolioWalletTable.tsx | 1 + .../data-api/queries/portfolio-positions.ts | 3 +- .../data-api/queries/portfolio-wallet.ts | 3 +- .../src/components/data-table/data-table.tsx | 59 ++++++++++--------- 8 files changed, 51 insertions(+), 47 deletions(-) diff --git a/apps/evm/src/ui/portfolio/Portfolio.tsx b/apps/evm/src/ui/portfolio/Portfolio.tsx index 208712845e..8c76e481de 100644 --- a/apps/evm/src/ui/portfolio/Portfolio.tsx +++ b/apps/evm/src/ui/portfolio/Portfolio.tsx @@ -45,10 +45,6 @@ export const Portfolio = () => { }} - {/* - This action cannot be undone. This will permanently delete your - account and remove your data from our servers. - */} diff --git a/apps/evm/src/ui/portfolio/PortfolioTab.tsx b/apps/evm/src/ui/portfolio/PortfolioTab.tsx index 4797b5e477..b167e1840b 100644 --- a/apps/evm/src/ui/portfolio/PortfolioTab.tsx +++ b/apps/evm/src/ui/portfolio/PortfolioTab.tsx @@ -38,15 +38,15 @@ const ITEMS: { id: string; value: string; children: React.ReactNode }[] = [
), }, - { - id: 'activity', - value: 'pctivity', - children: ( -
- Activity -
- ), - }, + // { + // id: 'activity', + // value: 'activity', + // children: ( + //
+ // Activity + //
+ // ), + // }, ] export const PortfolioTab = () => { @@ -88,8 +88,8 @@ const ITEMS: { id: string; value: string; children: React.ReactNode }[] = [ - - + {/* + */}
) diff --git a/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTable.tsx b/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTable.tsx index cad6e9d731..b9cf773478 100644 --- a/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTable.tsx +++ b/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTable.tsx @@ -55,6 +55,7 @@ export const PortfolioPositionTable: FC = ({ rowRenderer={rowRenderer} columns={COLUMNS} data={data.sort((a, b) => b.amountUSD - a.amountUSD)} + showColumnHeaders={false} /> ) } diff --git a/apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx index da0cee941c..e1b0027c6f 100644 --- a/apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx +++ b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWallet.tsx @@ -34,7 +34,10 @@ export const PortfolioWallet = () => { totalUSD={data?.totalUSD} percentageChange24h={data?.percentageChange24h} /> - + ) } diff --git a/apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx index f82409eba3..4946fa0dc3 100644 --- a/apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx +++ b/apps/evm/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx @@ -67,6 +67,7 @@ export const PortfolioWalletTable: FC = ({ rowRenderer={rowRenderer} columns={COLUMNS} data={data.sort((a, b) => b.amountUSD - a.amountUSD)} + showColumnHeaders={false} /> ) } diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts index df096361ea..55b9b13d57 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts @@ -128,8 +128,7 @@ query PortfolioPositions($id: ID!) { export type GetPortfolioPositions = VariablesOf export async function getPortfolioPositions(variables: GetPortfolioPositions, options?: RequestOptions) { - // const url = `https://data-api-production-acb1.up.railway.app/graphql/` - const url = `http://localhost:4000/graphql/` + const url = `https://data-api-production-acb1.up.railway.app/graphql/` const result = await request( { url, document: PortfolioPositionsQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts index b75688785f..6cee28ed51 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-wallet.ts @@ -37,8 +37,7 @@ export const PortfolioWalletQuery = graphql( export type GetPortfolioWallet = VariablesOf export async function getPortfolioWallet(variables: GetPortfolioWallet, options?: RequestOptions) { - const url = `http://localhost:4000/graphql/` - // const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://data-api-production-acb1.up.railway.app/graphql/` const result = await request( { url, document: PortfolioWalletQuery, variables }, diff --git a/packages/ui/src/components/data-table/data-table.tsx b/packages/ui/src/components/data-table/data-table.tsx index f935f37758..2d350f64c3 100644 --- a/packages/ui/src/components/data-table/data-table.tsx +++ b/packages/ui/src/components/data-table/data-table.tsx @@ -58,6 +58,7 @@ interface DataTableProps { onSortingChange?: OnChangeFn onPaginationChange?: OnChangeFn rowRenderer?: (row: Row, value: ReactNode) => ReactNode + showColumnHeaders?: boolean } export function DataTable({ @@ -73,6 +74,7 @@ export function DataTable({ onSortingChange, onPaginationChange, rowRenderer, + showColumnHeaders = true, }: DataTableProps) { const [rowSelection, setRowSelection] = React.useState({}) const [columnVisibility, setColumnVisibility] = @@ -113,33 +115,36 @@ export function DataTable({
{toolbar ? toolbar(table) : null} - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => { - return ( - - {header.isPlaceholder ? null : ( - - )} - - ) - })} - - ))} - + {showColumnHeaders ? ( + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => { + return ( + + {header.isPlaceholder ? null : ( + + )} + + ) + })} + + ))} + + ) : null} + {loading ? ( Array.from({ length: 3 }) From 468a7e69a1347878757b0d1d50d8330e0034632c Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Mon, 1 Jul 2024 10:22:51 +0200 Subject: [PATCH 009/139] fix: portfolio tables --- .../PositionsTable/PortfolioPositions.tsx | 11 +- .../PortfolioV2PositionTable.tsx} | 11 +- .../PositionsTable/{ => v2}/columns.tsx | 58 ++------- .../v3/PortfolioV3PositionTable.tsx | 61 +++++++++ .../portfolio/PositionsTable/v3/columns.tsx | 117 ++++++++++++++++++ 5 files changed, 198 insertions(+), 60 deletions(-) rename apps/evm/src/ui/portfolio/PositionsTable/{PortfolioPositionTable.tsx => v2/PortfolioV2PositionTable.tsx} (84%) rename apps/evm/src/ui/portfolio/PositionsTable/{ => v2}/columns.tsx (55%) create mode 100644 apps/evm/src/ui/portfolio/PositionsTable/v3/PortfolioV3PositionTable.tsx create mode 100644 apps/evm/src/ui/portfolio/PositionsTable/v3/columns.tsx diff --git a/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositions.tsx b/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositions.tsx index a86af72507..b2c93d5d40 100644 --- a/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositions.tsx +++ b/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositions.tsx @@ -2,8 +2,9 @@ import { getPortfolioPositions } from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' import { Address } from 'viem' import { useAccount } from 'wagmi' -import { PortfolioPositionTable } from './PortfolioPositionTable' import { PortfolioPositionInfo } from './PortfolioPositionTotal' +import { PortfolioV2PositionTable } from './v2/PortfolioV2PositionTable' +import { PortfolioV3PositionTable } from './v3/PortfolioV3PositionTable' function usePortfolioPositions( address: Address | undefined, @@ -29,9 +30,13 @@ export const PortfolioPositions = () => { return ( <> - + ) diff --git a/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTable.tsx b/apps/evm/src/ui/portfolio/PositionsTable/v2/PortfolioV2PositionTable.tsx similarity index 84% rename from apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTable.tsx rename to apps/evm/src/ui/portfolio/PositionsTable/v2/PortfolioV2PositionTable.tsx index b9cf773478..a586f0f487 100644 --- a/apps/evm/src/ui/portfolio/PositionsTable/PortfolioPositionTable.tsx +++ b/apps/evm/src/ui/portfolio/PositionsTable/v2/PortfolioV2PositionTable.tsx @@ -12,18 +12,17 @@ const COLUMNS = [ USD_COLUMN, ] satisfies ColumnDef[] -interface PortfolioPositionTableProps { +interface PortfolioV2PositionTableProps { isLoading: boolean data: PortfolioPosition[] onRowClick?(row: PortfolioPosition): void } -export const PortfolioPositionTable: FC = ({ +export const PortfolioV2PositionTable: FC = ({ isLoading, data, onRowClick, }) => { - const rowRenderer = useCallback( (row: Row, rowNode: ReactNode) => { if (onRowClick) @@ -40,12 +39,12 @@ export const PortfolioPositionTable: FC = ({ [onRowClick], ) - if (isLoading) return
Loading...
- if (!data) return
No data
+ if (isLoading) return <> + if (!data) return <> return ( // `/pool/${row.chainId}:${ diff --git a/apps/evm/src/ui/portfolio/PositionsTable/columns.tsx b/apps/evm/src/ui/portfolio/PositionsTable/v2/columns.tsx similarity index 55% rename from apps/evm/src/ui/portfolio/PositionsTable/columns.tsx rename to apps/evm/src/ui/portfolio/PositionsTable/v2/columns.tsx index b7c75ac91a..906ed27b1f 100644 --- a/apps/evm/src/ui/portfolio/PositionsTable/columns.tsx +++ b/apps/evm/src/ui/portfolio/PositionsTable/v2/columns.tsx @@ -3,33 +3,9 @@ import { ColumnDef } from '@tanstack/react-table' import { formatUSD, formatPercent } from 'sushi/format' import { QuestionMarkCircleIcon } from '@heroicons/react-v1/solid' -import { PortfolioPosition } from '@sushiswap/graph-client/data-api' -import { SushiSwapProtocol } from 'sushi/types' +import { PortfolioV2Position } from '@sushiswap/graph-client/data-api' -export const ProtocolBadge: Record = { - // [Protocol.BENTOBOX_STABLE]: ( - //
- // Trident Stable - //
- // ), - // [Protocol.BENTOBOX_CLASSIC]: ( - //
- // Trident Classic - //
- // ), - [SushiSwapProtocol.SUSHISWAP_V2]: ( -
- V2 -
- ), - [SushiSwapProtocol.SUSHISWAP_V3]: ( -
- V3 -
- ), -} - -export const ICON_COLUMN: ColumnDef = { +export const ICON_COLUMN: ColumnDef = { id: 'icon', header: 'icon', cell: (props) => ( @@ -62,7 +38,7 @@ export const ICON_COLUMN: ColumnDef = { }, } -export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef = +export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef = { id: 'name', header: 'Name', @@ -73,7 +49,9 @@ export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef = {`${props.row.original.token0.symbol} / ${props.row.original.token1.symbol}`} - {ProtocolBadge[props.row.original.protocol]}{' '} +
+ V2 +
{' '} {formatPercent(props.row.original.swapFee)}
@@ -95,7 +73,7 @@ export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef = size: 300, } -export const USD_COLUMN: ColumnDef = { +export const USD_COLUMN: ColumnDef = { id: 'usd', header: '$', cell: (props) => @@ -107,28 +85,6 @@ export const USD_COLUMN: ColumnDef = { {formatUSD(props.row.original.amountUSD)} - - { -
- {props.row.original?.range === 'IN_RANGE' ? ( - // green dot - <> -
- - In Range - - ) : props.row.original?.range === 'OUT_RANGE' ? ( - // red dot - <> -
- - Out of Range - - ) : ( - <> - )} -
- }
), meta: { diff --git a/apps/evm/src/ui/portfolio/PositionsTable/v3/PortfolioV3PositionTable.tsx b/apps/evm/src/ui/portfolio/PositionsTable/v3/PortfolioV3PositionTable.tsx new file mode 100644 index 0000000000..69ebdcfe9c --- /dev/null +++ b/apps/evm/src/ui/portfolio/PositionsTable/v3/PortfolioV3PositionTable.tsx @@ -0,0 +1,61 @@ +'use client' + +import { PortfolioV3Position } from '@sushiswap/graph-client/data-api' +import { DataTable, Slot } from '@sushiswap/ui' +import { ColumnDef, Row } from '@tanstack/react-table' +import { FC, ReactNode, useCallback } from 'react' +import { ICON_COLUMN, NAME_SYMBOL_AMOUNT_COLUMN, USD_COLUMN } from './columns' + +const COLUMNS = [ + ICON_COLUMN, + NAME_SYMBOL_AMOUNT_COLUMN, + USD_COLUMN, +] satisfies ColumnDef[] + +interface PortfolioV3PositionTableProps { + isLoading: boolean + data: PortfolioV3Position[] + onRowClick?(row: PortfolioV3Position): void +} + +export const PortfolioV3PositionTable: FC = ({ + isLoading, + data, + onRowClick, +}) => { + + const rowRenderer = useCallback( + (row: Row, rowNode: ReactNode) => { + if (onRowClick) + return ( + onRowClick?.(row.original)} + > + {rowNode} + + ) + return rowNode + }, + [onRowClick], + ) + + if (isLoading) return <> + if (!data) return <> + + return ( + + // `/pool/${row.chainId}:${ + // row.address + // }/positions/${row.tokenId.toString()}` + // } + rowRenderer={rowRenderer} + columns={COLUMNS} + data={data.sort((a, b) => b.amountUSD - a.amountUSD)} + showColumnHeaders={false} + /> + ) +} diff --git a/apps/evm/src/ui/portfolio/PositionsTable/v3/columns.tsx b/apps/evm/src/ui/portfolio/PositionsTable/v3/columns.tsx new file mode 100644 index 0000000000..22906023b4 --- /dev/null +++ b/apps/evm/src/ui/portfolio/PositionsTable/v3/columns.tsx @@ -0,0 +1,117 @@ +import { SkeletonCircle, SkeletonText, classNames } from '@sushiswap/ui' +import { ColumnDef } from '@tanstack/react-table' +import { formatUSD, formatPercent } from 'sushi/format' + +import { QuestionMarkCircleIcon } from '@heroicons/react-v1/solid' +import { PortfolioV3Position } from '@sushiswap/graph-client/data-api' + +export const ICON_COLUMN: ColumnDef = { + id: 'icon', + header: 'icon', + cell: (props) => ( + // get token + +
+ {props.row.original.token0.logoUrl ? ( + {props.row.original.token0.name} + ) : ( + + )} + + {props.row.original.token1.logoUrl ? ( + {props.row.original.token1.name} + ) : ( + + )} +
+ ), + meta: { + skeleton: , + }, +} + +export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef< + PortfolioV3Position, + unknown +> = { + id: 'name', + header: 'Name', + cell: (props) => ( + <> +
+ + {`${props.row.original.token0.symbol} / ${props.row.original.token1.symbol}`} + + +
+ V3 +
{' '} + {formatPercent(props.row.original.swapFee)} +
+
+ + ), + meta: { + skeleton: ( +
+
+ + +
+
+ +
+
+ ), + }, + size: 300, +} + +export const USD_COLUMN: ColumnDef = { + id: 'usd', + header: '$', + cell: (props) => + formatUSD(props.row.original.amountUSD).includes('NaN') ? ( + '$0.00' + ) : ( + // `${formatUSD(props.row.original.amountUSD)} ${props.row.original.price24hChange}`) +
+ + {formatUSD(props.row.original.amountUSD)} + + + { +
+ {props.row.original.range === 'IN_RANGE' ? ( + // green dot + <> +
+ + In Range + + ) : props.row.original.range === 'OUT_OF_RANGE' ? ( + // red dot + <> +
+ + Out of Range + + ) : ( + <> + )} +
+ } +
+ ), + meta: { + skeleton: , + }, +} From 3e77eacf408fe85b60ca54492d2155d03a317dee Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Fri, 5 Jul 2024 10:38:51 +0200 Subject: [PATCH 010/139] feat(packages/graph-client): add portfolio claimables --- .../data-api/queries/portfolio-claimables.ts | 211 ++++++++++++++++++ .../data-api/queries/portfolio-positions.ts | 62 ++++- .../src/subgraphs/data-api/schema.graphql | 66 +++++- 3 files changed, 333 insertions(+), 6 deletions(-) create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/portfolio-claimables.ts diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-claimables.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-claimables.ts new file mode 100644 index 0000000000..e2f01dcfdc --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-claimables.ts @@ -0,0 +1,211 @@ +import type { VariablesOf } from 'gql.tada' + +import { request, type RequestOptions } from 'src/lib/request' +import { graphql } from '../graphql' + +export const PortfolioClaimablesQuery = graphql( + ` + query PortfolioClaimables($id: ID!) { + portfolioClaimables(id: $id) { + totalUSD + v2PositionClaimables { + position { + id + chainId + chain + protocol + protocolId + protocolLogoUrl + address + name + swapFee + token0 { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + token1 { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + amountUSD + updatedAt + } + token { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + } + v3PositionClaimables { + position { + id + chainId + chain + protocol + protocolId + protocolLogoUrl + address + name + swapFee + positionId + range + fees { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + amountUSD + updatedAt + } + } + smartPositionClaimables { + token { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + position { + id + chainId + chain + protocol + protocolId + protocolLogoUrl + address + name + vaultAddress + swapFee + strategy + amountUSD + updatedAt + } + } + furoClaimables { + position { + id + chainId + chain + protocol + protocolId + protocolLogoUrl + address + name + positionId + updatedAt + } + token { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + } + } + } +`, +) + +export type GetPortfolioClaimables = VariablesOf< + typeof PortfolioClaimablesQuery +> + +export async function getPortfolioClaimables( + variables: GetPortfolioClaimables, + options?: RequestOptions, +) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + + const result = await request( + { url, document: PortfolioClaimablesQuery, variables }, + options, + ) + if (result) { + return result.portfolioClaimables + } + + throw new Error('No portfolio positions') +} + +export type PortfolioPositions = Awaited< + ReturnType +> + +export type PortfolioV2Claim = PortfolioPositions['v2PositionClaimables'][0] +export type PortfolioV3Claim = PortfolioPositions['v3PositionClaimables'][0] +export type PortfolioSmartPositionClaim = PortfolioPositions['smartPositionClaimables'][0] +export type PortfolioFuroClaim = PortfolioPositions['furoClaimables'][0] + +export type PortfolioClaim = PortfolioV2Claim['position'] | PortfolioV3Claim['position'] | PortfolioSmartPositionClaim['position'] | PortfolioFuroClaim['position'] diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts index 55b9b13d57..98d5b29fd9 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts @@ -16,6 +16,7 @@ query PortfolioPositions($id: ID!) { protocolId protocolLogoUrl address + name swapFee token0 { id @@ -51,7 +52,6 @@ query PortfolioPositions($id: ID!) { amount amountUSD } - amountUSD updatedAt } @@ -63,9 +63,8 @@ query PortfolioPositions($id: ID!) { protocolId protocolLogoUrl address - positionId - range - swapFee + name + token0 { id chain @@ -100,7 +99,55 @@ query PortfolioPositions($id: ID!) { amount amountUSD } - rewards { + swapFee + positionId + range + fees { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + amountUSD + updatedAt + } + smartPositions { + id + chainId + chain + protocol + protocolId + protocolLogoUrl + + token0 { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } + token1 { id chain chainId @@ -117,6 +164,11 @@ query PortfolioPositions($id: ID!) { amount amountUSD } + address + name + vaultAddress + swapFee + strategy amountUSD updatedAt } diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index aac4cdb5d2..cafea6589b 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -74,6 +74,7 @@ type V2PortfolioPosition { protocolId: String! protocolLogoUrl: String! address: String! + name: String! swapFee: Float! token0: SimpleToken! token1: SimpleToken! @@ -95,20 +96,82 @@ type V3PortfolioPosition { protocolId: String! protocolLogoUrl: String! address: String! + name: String! swapFee: Float! positionId: Int! range: RangeStatus! token0: SimpleToken! token1: SimpleToken! - rewards: [SimpleToken]! + fees: [SimpleToken]! + amountUSD: Float! + updatedAt: Int +} + +type PortfolioSmartPosition { + id: String! + chainId: Int! + chain: String! + protocol: String! + protocolId: String! + protocolLogoUrl: String! + address: String! + name: String! + vaultAddress: String! + swapFee: Float! + token0: SimpleToken! + token1: SimpleToken! + strategy: String! amountUSD: Float! updatedAt: Int } +type FuroPosition { + id: String! + chainId: Int! + chain: String! + protocol: String! + protocolId: String! + protocolLogoUrl: String! + address: String! + name: String! + positionId: Int! + token: SimpleToken! + updatedAt: Int +} + type PortfolioPositions { totalUSD: Float! v2Positions: [V2PortfolioPosition]! v3Positions: [V3PortfolioPosition]! + smartPositions: [PortfolioSmartPosition]! +} + +type PortfolioClaimables { + totalUSD: Float! + v2PositionClaimables: [V2PoolClaim]! + v3PositionClaimables: [V3PoolClaim]! + smartPositionClaimables: [SmartPoolClaim]! + furoClaimables: [FuroClaim]! +} + +type V2PoolClaim { + position: V2PortfolioPosition! + token: SimpleToken! +} + +type V3PoolClaim { + position: V3PortfolioPosition! + token: SimpleToken! +} + +type SmartPoolClaim { + position: PortfolioSmartPosition! + token: SimpleToken! +} + +type FuroClaim { + position: FuroPosition! + token: SimpleToken! } type PortfolioWallet { @@ -121,5 +184,6 @@ type PortfolioWallet { type Query { portfolioWallet(id: ID!): PortfolioWallet! portfolioLiquidityPositions(id: ID!): PortfolioPositions! + portfolioClaimables(id: ID!): PortfolioClaimables! pools(chainId: ID!): [Pool] } \ No newline at end of file From 9dea2acfbcedcaca0d5b10db8d37c7ada706fa6e Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 9 Jul 2024 05:22:29 +0700 Subject: [PATCH 011/139] fix: build --- apps/evm/src/app/[chainId]/providers.tsx | 8 ++------ apps/evm/src/ui/pool/NewPoolsTable.tsx | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/evm/src/app/[chainId]/providers.tsx b/apps/evm/src/app/[chainId]/providers.tsx index a214b84ba7..f35d19144e 100644 --- a/apps/evm/src/app/[chainId]/providers.tsx +++ b/apps/evm/src/app/[chainId]/providers.tsx @@ -1,11 +1,7 @@ 'use client' -import { SplashController, ThemeProvider } from '@sushiswap/ui' +import { SplashController } from '@sushiswap/ui' export function Providers({ children }: { children: React.ReactNode }) { - return ( - - {children} - - ) + return {children} } diff --git a/apps/evm/src/ui/pool/NewPoolsTable.tsx b/apps/evm/src/ui/pool/NewPoolsTable.tsx index 523e60dfed..e48e6dd12a 100644 --- a/apps/evm/src/ui/pool/NewPoolsTable.tsx +++ b/apps/evm/src/ui/pool/NewPoolsTable.tsx @@ -10,12 +10,12 @@ import { CardTitle, Currency, DataTable, - NetworkIcon, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '@sushiswap/ui' +import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' import { ColumnDef, Row, SortingState, TableState } from '@tanstack/react-table' import React, { FC, ReactNode, useCallback, useMemo, useState } from 'react' import { ChainId } from 'sushi/chain' From 6b353f24d1fadd302ee5716a8a738d13dd864399 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 12 Jul 2024 02:08:20 +0700 Subject: [PATCH 012/139] feat: portfolio tokens tab --- apps/web/src/app/(evm)/bonds/header.tsx | 8 +- .../components/header-network-selector.tsx | 7 +- .../components/user-portfolio/DefaultView.tsx | 142 ++++++++++++++++++ .../PortfolioPositionsTotal.tsx} | 11 +- .../PortfolioPositions/index.tsx} | 22 +-- .../v2/PortfolioV2PositionsTable.tsx} | 9 +- .../PortfolioPositions}/v2/columns.tsx | 67 +++++---- .../v3/PortfolioV3PositionsTable.tsx} | 8 +- .../PortfolioPositions}/v3/columns.tsx | 3 +- .../PortfolioTokens/PortfolioTokensInfo.tsx} | 12 +- .../user-portfolio/PortfolioTokens/index.tsx | 122 +++++++++++++++ .../user-portfolio/SettingsView.tsx | 74 +++++++++ .../wagmi/components/user-portfolio/index.tsx | 76 ++++++++++ .../components/wagmi-header-components.tsx | 4 +- apps/web/src/ui/portfolio/Portfolio.tsx | 53 ------- apps/web/src/ui/portfolio/PortfolioTab.tsx | 97 ------------ .../portfolio/WalletTable/PortfolioWallet.tsx | 43 ------ .../WalletTable/PortfolioWalletTable.tsx | 73 --------- .../src/ui/portfolio/WalletTable/columns.tsx | 93 ------------ .../ui/src/components/network-selector.tsx | 1 + packages/ui/src/components/sheet.tsx | 41 +++-- 21 files changed, 518 insertions(+), 448 deletions(-) create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/DefaultView.tsx rename apps/web/src/{ui/portfolio/PositionsTable/PortfolioPositionTotal.tsx => lib/wagmi/components/user-portfolio/PortfolioPositions/PortfolioPositionsTotal.tsx} (51%) rename apps/web/src/{ui/portfolio/PositionsTable/PortfolioPositions.tsx => lib/wagmi/components/user-portfolio/PortfolioPositions/index.tsx} (60%) rename apps/web/src/{ui/portfolio/PositionsTable/v2/PortfolioV2PositionTable.tsx => lib/wagmi/components/user-portfolio/PortfolioPositions/v2/PortfolioV2PositionsTable.tsx} (85%) rename apps/web/src/{ui/portfolio/PositionsTable => lib/wagmi/components/user-portfolio/PortfolioPositions}/v2/columns.tsx (62%) rename apps/web/src/{ui/portfolio/PositionsTable/v3/PortfolioV3PositionTable.tsx => lib/wagmi/components/user-portfolio/PortfolioPositions/v3/PortfolioV3PositionsTable.tsx} (87%) rename apps/web/src/{ui/portfolio/PositionsTable => lib/wagmi/components/user-portfolio/PortfolioPositions}/v3/columns.tsx (97%) rename apps/web/src/{ui/portfolio/WalletTable/PortfolioWalletTotal.tsx => lib/wagmi/components/user-portfolio/PortfolioTokens/PortfolioTokensInfo.tsx} (78%) create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/index.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/SettingsView.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/index.tsx delete mode 100644 apps/web/src/ui/portfolio/Portfolio.tsx delete mode 100644 apps/web/src/ui/portfolio/PortfolioTab.tsx delete mode 100644 apps/web/src/ui/portfolio/WalletTable/PortfolioWallet.tsx delete mode 100644 apps/web/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx delete mode 100644 apps/web/src/ui/portfolio/WalletTable/columns.tsx diff --git a/apps/web/src/app/(evm)/bonds/header.tsx b/apps/web/src/app/(evm)/bonds/header.tsx index 501608afa8..d9062fdaeb 100644 --- a/apps/web/src/app/(evm)/bonds/header.tsx +++ b/apps/web/src/app/(evm)/bonds/header.tsx @@ -4,17 +4,11 @@ import { Navigation } from '@sushiswap/ui' import React, { FC } from 'react' import { SUPPORTED_CHAIN_IDS } from 'src/config' import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' -import { Portfolio } from 'src/ui/portfolio/Portfolio' export const Header: FC = () => { return ( - - - - } + rightElement={} /> ) } diff --git a/apps/web/src/lib/wagmi/components/header-network-selector.tsx b/apps/web/src/lib/wagmi/components/header-network-selector.tsx index a1dc4ad0a3..a2deb3a90d 100644 --- a/apps/web/src/lib/wagmi/components/header-network-selector.tsx +++ b/apps/web/src/lib/wagmi/components/header-network-selector.tsx @@ -12,7 +12,8 @@ export const HeaderNetworkSelector: FC<{ networks: ChainId[] selectedNetwork?: ChainId onChange?(chainId: ChainId): void -}> = ({ networks, selectedNetwork, onChange }) => { + hideNetworkName?: boolean +}> = ({ networks, selectedNetwork, onChange, hideNetworkName = false }) => { const isMounted = useIsMounted() const { switchChainAsync } = useSwitchChain() const chainId = useChainId() @@ -55,7 +56,9 @@ export const HeaderNetworkSelector: FC<{ diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/DefaultView.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/DefaultView.tsx new file mode 100644 index 0000000000..bd19cc1ffb --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/DefaultView.tsx @@ -0,0 +1,142 @@ +import { + ArrowLeftOnRectangleIcon, + Cog6ToothIcon, + DocumentDuplicateIcon, + LinkIcon, +} from '@heroicons/react/24/outline' +import { + Button, + ClipboardController, + IconButton, + LinkExternal, + SkeletonBox, + SkeletonCircle, +} from '@sushiswap/ui' +import Image from 'next/image' +import { Dispatch, FC, SetStateAction, useMemo, useState } from 'react' +import { SUPPORTED_CHAIN_IDS } from 'src/config' +import { HeaderNetworkSelector } from 'src/lib/wagmi/components/header-network-selector' +import { ChainId, chains, shortenAddress } from 'sushi' +import { useAccount, useDisconnect } from 'wagmi' +import { GetEnsNameReturnType } from 'wagmi/actions' +import { PortfolioView } from './' +import { PortfolioPositions } from './PortfolioPositions' +import { PortfolioTokens } from './PortfolioTokens' + +enum PortfolioTab { + Tokens = 'Tokens', + Positions = 'Positions', + Claimable = 'Claimable', +} + +interface DefaultProps { + ensName: GetEnsNameReturnType | undefined + isENSNameLoading: boolean + setView: Dispatch> +} + +export const DefaultView: FC = ({ + setView, + ensName, + isENSNameLoading, +}) => { + const { connector, address, chainId } = useAccount() + const { disconnect } = useDisconnect() + + const [tab, setTab] = useState(PortfolioTab.Tokens) + + const content = useMemo(() => { + switch (tab) { + case PortfolioTab.Tokens: + return + case PortfolioTab.Positions: + return + case PortfolioTab.Claimable: + return null + } + }, [tab]) + + return ( +
+
+
+
+ {connector ? ( + + ) : ( + + )} + {!address || isENSNameLoading ? ( + + ) : ensName ? ( +
+
{ensName}
+
+ {shortenAddress(address)} +
+
+ ) : ( + {shortenAddress(address)} + )} +
+
+ setView(PortfolioView.Settings)} + description="Settings" + name="Settings" + /> + + {({ setCopied, isCopied }) => ( + setCopied(address!)} + description={isCopied ? 'Copied!' : 'Copy Address'} + name="Copy" + /> + )} + + + + + disconnect()} + description="Disconnect" + name="Disconnect" + /> +
+
+ +
+
+ {Object.values(PortfolioTab).map((_tab) => ( + + ))} +
+ {content} +
+ ) +} diff --git a/apps/web/src/ui/portfolio/PositionsTable/PortfolioPositionTotal.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/PortfolioPositionsTotal.tsx similarity index 51% rename from apps/web/src/ui/portfolio/PositionsTable/PortfolioPositionTotal.tsx rename to apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/PortfolioPositionsTotal.tsx index e9b24e40cb..d67f212fb9 100644 --- a/apps/web/src/ui/portfolio/PositionsTable/PortfolioPositionTotal.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/PortfolioPositionsTotal.tsx @@ -1,13 +1,12 @@ -import { classNames } from '@sushiswap/ui' -import { FC } from 'react' -import { formatUSD } from 'sushi' +import React, { FC } from 'react' +import { formatUSD } from 'sushi/format' -interface PortfolioPositionInfoProps { +interface PortfolioPositionsInfoProps { isLoading: boolean totalUSD: number | undefined } -export const PortfolioPositionInfo: FC = ({ +export const PortfolioPositionsInfo: FC = ({ isLoading, totalUSD, }) => ( @@ -16,7 +15,7 @@ export const PortfolioPositionInfo: FC = ({
) : (
- + {formatUSD(totalUSD ?? 0)}
diff --git a/apps/web/src/ui/portfolio/PositionsTable/PortfolioPositions.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/index.tsx similarity index 60% rename from apps/web/src/ui/portfolio/PositionsTable/PortfolioPositions.tsx rename to apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/index.tsx index b2c93d5d40..80e5baa81e 100644 --- a/apps/web/src/ui/portfolio/PositionsTable/PortfolioPositions.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/index.tsx @@ -1,10 +1,11 @@ import { getPortfolioPositions } from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' +import React from 'react' import { Address } from 'viem' import { useAccount } from 'wagmi' -import { PortfolioPositionInfo } from './PortfolioPositionTotal' -import { PortfolioV2PositionTable } from './v2/PortfolioV2PositionTable' -import { PortfolioV3PositionTable } from './v3/PortfolioV3PositionTable' +import { PortfolioPositionsInfo } from './PortfolioPositionsTotal' +import { PortfolioV2PositionsTable } from './v2/PortfolioV2PositionsTable' +import { PortfolioV3PositionsTable } from './v3/PortfolioV3PositionsTable' function usePortfolioPositions( address: Address | undefined, @@ -13,7 +14,6 @@ function usePortfolioPositions( return useQuery({ queryKey: ['portfolio-positions', address], queryFn: async () => { - if (!address) return null const id = address as string const data = await getPortfolioPositions({ id }) return data @@ -28,16 +28,16 @@ export const PortfolioPositions = () => { const { data, isLoading } = usePortfolioPositions(id.address) return ( - <> - - + + - - +
) } diff --git a/apps/web/src/ui/portfolio/PositionsTable/v2/PortfolioV2PositionTable.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/PortfolioV2PositionsTable.tsx similarity index 85% rename from apps/web/src/ui/portfolio/PositionsTable/v2/PortfolioV2PositionTable.tsx rename to apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/PortfolioV2PositionsTable.tsx index a586f0f487..ac0d2b28af 100644 --- a/apps/web/src/ui/portfolio/PositionsTable/v2/PortfolioV2PositionTable.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/PortfolioV2PositionsTable.tsx @@ -4,6 +4,7 @@ import { PortfolioPosition } from '@sushiswap/graph-client/data-api' import { DataTable, Slot } from '@sushiswap/ui' import { ColumnDef, Row } from '@tanstack/react-table' import { FC, ReactNode, useCallback } from 'react' +import React from 'react' import { ICON_COLUMN, NAME_SYMBOL_AMOUNT_COLUMN, USD_COLUMN } from './columns' const COLUMNS = [ @@ -12,13 +13,13 @@ const COLUMNS = [ USD_COLUMN, ] satisfies ColumnDef[] -interface PortfolioV2PositionTableProps { +interface PortfolioV2PositionsTableProps { isLoading: boolean - data: PortfolioPosition[] + data: PortfolioPosition[] | undefined onRowClick?(row: PortfolioPosition): void } -export const PortfolioV2PositionTable: FC = ({ +export const PortfolioV2PositionsTable: FC = ({ isLoading, data, onRowClick, @@ -44,7 +45,7 @@ export const PortfolioV2PositionTable: FC = ({ return ( // `/pool/${row.chainId}:${ diff --git a/apps/web/src/ui/portfolio/PositionsTable/v2/columns.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/columns.tsx similarity index 62% rename from apps/web/src/ui/portfolio/PositionsTable/v2/columns.tsx rename to apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/columns.tsx index 906ed27b1f..b8fdc33dd3 100644 --- a/apps/web/src/ui/portfolio/PositionsTable/v2/columns.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/columns.tsx @@ -1,9 +1,10 @@ import { SkeletonCircle, SkeletonText, classNames } from '@sushiswap/ui' import { ColumnDef } from '@tanstack/react-table' -import { formatUSD, formatPercent } from 'sushi/format' +import { formatPercent, formatUSD } from 'sushi/format' import { QuestionMarkCircleIcon } from '@heroicons/react-v1/solid' import { PortfolioV2Position } from '@sushiswap/graph-client/data-api' +import React from 'react' export const ICON_COLUMN: ColumnDef = { id: 'icon', @@ -38,40 +39,42 @@ export const ICON_COLUMN: ColumnDef = { }, } -export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef = - { - id: 'name', - header: 'Name', - cell: (props) => ( - <> +export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef< + PortfolioV2Position, + unknown +> = { + id: 'name', + header: 'Name', + cell: (props) => ( + <> +
+ + {`${props.row.original.token0.symbol} / ${props.row.original.token1.symbol}`} + + +
+ V2 +
{' '} + {formatPercent(props.row.original.swapFee)} +
+
+ + ), + meta: { + skeleton: ( +
+
+ + +
- - {`${props.row.original.token0.symbol} / ${props.row.original.token1.symbol}`} - - -
- V2 -
{' '} - {formatPercent(props.row.original.swapFee)} -
+
- +
), - meta: { - skeleton: ( -
-
- - -
-
- -
-
- ), - }, - size: 300, - } + }, + size: 300, +} export const USD_COLUMN: ColumnDef = { id: 'usd', diff --git a/apps/web/src/ui/portfolio/PositionsTable/v3/PortfolioV3PositionTable.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/PortfolioV3PositionsTable.tsx similarity index 87% rename from apps/web/src/ui/portfolio/PositionsTable/v3/PortfolioV3PositionTable.tsx rename to apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/PortfolioV3PositionsTable.tsx index 69ebdcfe9c..c56c8e5f48 100644 --- a/apps/web/src/ui/portfolio/PositionsTable/v3/PortfolioV3PositionTable.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/PortfolioV3PositionsTable.tsx @@ -4,6 +4,7 @@ import { PortfolioV3Position } from '@sushiswap/graph-client/data-api' import { DataTable, Slot } from '@sushiswap/ui' import { ColumnDef, Row } from '@tanstack/react-table' import { FC, ReactNode, useCallback } from 'react' +import React from 'react' import { ICON_COLUMN, NAME_SYMBOL_AMOUNT_COLUMN, USD_COLUMN } from './columns' const COLUMNS = [ @@ -12,18 +13,17 @@ const COLUMNS = [ USD_COLUMN, ] satisfies ColumnDef[] -interface PortfolioV3PositionTableProps { +interface PortfolioV3PositionsTableProps { isLoading: boolean - data: PortfolioV3Position[] + data: PortfolioV3Position[] | undefined onRowClick?(row: PortfolioV3Position): void } -export const PortfolioV3PositionTable: FC = ({ +export const PortfolioV3PositionsTable: FC = ({ isLoading, data, onRowClick, }) => { - const rowRenderer = useCallback( (row: Row, rowNode: ReactNode) => { if (onRowClick) diff --git a/apps/web/src/ui/portfolio/PositionsTable/v3/columns.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/columns.tsx similarity index 97% rename from apps/web/src/ui/portfolio/PositionsTable/v3/columns.tsx rename to apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/columns.tsx index 22906023b4..22240b52b6 100644 --- a/apps/web/src/ui/portfolio/PositionsTable/v3/columns.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/columns.tsx @@ -1,9 +1,10 @@ import { SkeletonCircle, SkeletonText, classNames } from '@sushiswap/ui' import { ColumnDef } from '@tanstack/react-table' -import { formatUSD, formatPercent } from 'sushi/format' +import { formatPercent, formatUSD } from 'sushi/format' import { QuestionMarkCircleIcon } from '@heroicons/react-v1/solid' import { PortfolioV3Position } from '@sushiswap/graph-client/data-api' +import React from 'react' export const ICON_COLUMN: ColumnDef = { id: 'icon', diff --git a/apps/web/src/ui/portfolio/WalletTable/PortfolioWalletTotal.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/PortfolioTokensInfo.tsx similarity index 78% rename from apps/web/src/ui/portfolio/WalletTable/PortfolioWalletTotal.tsx rename to apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/PortfolioTokensInfo.tsx index a3dfd14f10..5b9f6c05aa 100644 --- a/apps/web/src/ui/portfolio/WalletTable/PortfolioWalletTotal.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/PortfolioTokensInfo.tsx @@ -1,15 +1,15 @@ import { classNames } from '@sushiswap/ui' -import { FC } from 'react' +import React, { FC } from 'react' import { formatPercent, formatUSD } from 'sushi' -interface PortfolioWalletInfoProps { +interface PortfolioTokensInfoProps { isLoading: boolean percentageChange24h: number | undefined amountUSD24Change: number | undefined totalUSD: number | undefined } -export const PortfolioWalletInfo: FC = ({ +export const PortfolioTokensInfo: FC = ({ isLoading, percentageChange24h, amountUSD24Change, @@ -23,7 +23,11 @@ export const PortfolioWalletInfo: FC = ({ {formatUSD(totalUSD ?? 0)} - + {(percentageChange24h ?? 0) > 0 ? '+' : '-'} {formatUSD(amountUSD24Change ?? 0)} { + const id = address as string + const data = await getPortfolioWallet({ id }) + return data + }, + enabled: !!address, + refetchInterval, + }) +} + +export const PortfolioTokens = () => { + const { address } = useAccount() + const { data, isLoading } = usePortfolioWallet(address) + + return ( +
+
+
+ Total Balance +
+ {isLoading ? ( + <> + + + + ) : ( + <> +
+ {formatUSD(data!.totalUSD)} +
+
0 + ? 'text-green' + : data!.amountUSD24Change < 0 + ? 'text-red' + : 'text-muted-foreground', + )} + > + {`${data!.amountUSD24Change > 0 ? '+' : ''}${formatUSD( + data!.amountUSD24Change, + )} (${formatPercent(data!.percentageChange24h)})`} +
+ + )} +
+
+
+
+ {data?.tokens.map((token) => { + return ( +
+
+
+
+ {token.symbol +
+ +
+
+
+ {token.name ?? token.symbol} +
+
+ {' '} + {token.symbol} +
+
+
+
+
+ {formatUSD(token.amountUSD)} +
+
0 + ? 'text-green' + : token.price24hChange < 0 + ? 'text-red' + : 'text-muted-foreground', + )} + > + {`${token.price24hChange > 0 ? '+' : ''}${formatPercent( + token.price24hChange, + )}`} +
+
+
+ ) + })} +
+
+ ) +} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/SettingsView.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/SettingsView.tsx new file mode 100644 index 0000000000..efcef9937e --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/SettingsView.tsx @@ -0,0 +1,74 @@ +import { RadioGroup } from '@headlessui/react' +import { ArrowLeftIcon } from '@heroicons/react/20/solid' +import { MoonIcon, SunIcon } from '@heroicons/react/24/outline' +import { useLocalStorage } from '@sushiswap/hooks' +import { List } from '@sushiswap/ui' +import { classNames } from '@sushiswap/ui' +import { IconButton } from '@sushiswap/ui' +import { Switch } from '@sushiswap/ui' +import { useTheme } from 'next-themes' +import React, { Dispatch, FC, Fragment, SetStateAction } from 'react' +import { PortfolioView } from './' + +interface SettingsViewProps { + setView: Dispatch> +} + +const map = { + system: Auto, + light: , + dark: , +} + +export const SettingsView: FC = ({ setView }) => { + const { theme, setTheme } = useTheme() + const [showTestnets, setShowTestnets] = useLocalStorage('showTestnets', false) + + return ( +
+
+
+ setView(PortfolioView.Default)} + icon={ArrowLeftIcon} + name="Back" + /> +
+ Settings +
+
+ + Preferences + + + +
+ {Object.entries(map).map(([k, v], i) => ( + + {({ checked }) => ( + + )} + + ))} +
+
+
+ + + +
+
+
+ ) +} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx new file mode 100644 index 0000000000..498451016d --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx @@ -0,0 +1,76 @@ +'use client' + +import { + Button, + Sheet, + SheetContent, + SheetTrigger, + useBreakpoint, +} from '@sushiswap/ui' +import Image from 'next/image' +import { useMemo, useState } from 'react' +import { ChainId, shortenAddress } from 'sushi' +import { useAccount, useEnsAvatar, useEnsName } from 'wagmi' +import { ConnectButton } from '../connect-button' +import { DefaultView } from './DefaultView' +import { SettingsView } from './SettingsView' + +export enum PortfolioView { + Default = 'Default', + Settings = 'Settings', +} + +export const UserPortfolio = () => { + const { isSm } = useBreakpoint('sm') + const { address } = useAccount() + const [view, setView] = useState(PortfolioView.Default) + + const { data: ensName, isLoading: isENSNameLoading } = useEnsName({ + chainId: ChainId.ETHEREUM, + address, + }) + + const { data: avatar } = useEnsAvatar({ + name: ensName || undefined, + chainId: ChainId.ETHEREUM, + }) + + const content = useMemo(() => { + switch (view) { + case PortfolioView.Settings: + return + default: + return ( + + ) + } + }, [view, ensName, isENSNameLoading]) + + if (!address) return + + return ( + + + + + + {content} + + + ) +} diff --git a/apps/web/src/lib/wagmi/components/wagmi-header-components.tsx b/apps/web/src/lib/wagmi/components/wagmi-header-components.tsx index af09219e6f..7fbf4b8c72 100644 --- a/apps/web/src/lib/wagmi/components/wagmi-header-components.tsx +++ b/apps/web/src/lib/wagmi/components/wagmi-header-components.tsx @@ -11,7 +11,7 @@ import { import { useEffect } from 'react' import { useAccount } from 'wagmi' import { HeaderNetworkSelector } from './header-network-selector' -import { UserProfile } from './user-profile' +import { UserPortfolio } from './user-portfolio' interface WagmiHeaderComponentsProps { chainIds: ChainId[] @@ -47,7 +47,7 @@ export const WagmiHeaderComponents: React.FC = ({ selectedNetwork={selectedNetwork} onChange={onChange} /> - + ) } diff --git a/apps/web/src/ui/portfolio/Portfolio.tsx b/apps/web/src/ui/portfolio/Portfolio.tsx deleted file mode 100644 index 8c76e481de..0000000000 --- a/apps/web/src/ui/portfolio/Portfolio.tsx +++ /dev/null @@ -1,53 +0,0 @@ -'use client' -import { - Sheet, - SheetContent, - SheetHeader, - SheetTitle, - SheetTrigger, - SkeletonBox, -} from '@sushiswap/ui' -import { PortfolioTab } from './PortfolioTab' -import { AddressToEnsResolver } from 'src/lib/wagmi/components/account/AddressToEnsResolver' -import { shortenAddress } from 'sushi' -import { useAccount } from 'wagmi' - -export const Portfolio = () => { - const account = useAccount() - return ( - - Portfolio - - - - - {({ isLoading, data }) => { - return ( - <> - {account.address ? ( - isLoading || !data ? ( - shortenAddress(account.address) - ) : ( -
- - {`${data}`} - - - {shortenAddress(account.address)} - -
- ) - ) : ( - - )} - - ) - }} -
-
-
- -
-
- ) -} diff --git a/apps/web/src/ui/portfolio/PortfolioTab.tsx b/apps/web/src/ui/portfolio/PortfolioTab.tsx deleted file mode 100644 index b167e1840b..0000000000 --- a/apps/web/src/ui/portfolio/PortfolioTab.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, - Tabs, - TabsContent, - TabsList, - TabsTrigger, -} from '@sushiswap/ui'; -import React, { useState } from 'react'; -import { PortfolioWallet } from './WalletTable/PortfolioWallet'; -import { PortfolioPositions } from './PositionsTable/PortfolioPositions'; - - - -const ITEMS: { id: string; value: string; children: React.ReactNode }[] = [ - { - id: 'wallet', - value: 'wallet', - children: ( -
- - Wallet - -
- ), - }, - { - id: 'positions', - value: 'positions', - children: ( -
- - Positions - -
- ), - }, - // { - // id: 'activity', - // value: 'activity', - // children: ( - //
- // Activity - //
- // ), - // }, - ] - - export const PortfolioTab = () => { - const [tab, setTab] = useState('wallet') - - return ( -
- -
-
- -
- - {ITEMS.map((item) => ( - - {item.children} - - ))} - -
- - - - - - - {/* - */} -
-
- ) - } - \ No newline at end of file diff --git a/apps/web/src/ui/portfolio/WalletTable/PortfolioWallet.tsx b/apps/web/src/ui/portfolio/WalletTable/PortfolioWallet.tsx deleted file mode 100644 index e1b0027c6f..0000000000 --- a/apps/web/src/ui/portfolio/WalletTable/PortfolioWallet.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { getPortfolioWallet } from '@sushiswap/graph-client/data-api' -import { useQuery } from '@tanstack/react-query' -import { Address } from 'viem' -import { useAccount } from 'wagmi' -import { PortfolioWalletTable } from './PortfolioWalletTable' -import { PortfolioWalletInfo } from './PortfolioWalletTotal' - -function usePortfolioWallet( - address: Address | undefined, - refetchInterval?: 600_000, -) { - return useQuery({ - queryKey: ['portfolio-wallet', address], - queryFn: async () => { - if (!address) return null - const id = address as string - const data = await getPortfolioWallet({ id }) - return data - }, - enabled: !!address, - refetchInterval, - }) -} - -export const PortfolioWallet = () => { - const id = useAccount() - const { data, isLoading } = usePortfolioWallet(id.address) - - return ( - <> - - - - ) -} diff --git a/apps/web/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx b/apps/web/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx deleted file mode 100644 index 4946fa0dc3..0000000000 --- a/apps/web/src/ui/portfolio/WalletTable/PortfolioWalletTable.tsx +++ /dev/null @@ -1,73 +0,0 @@ -'use client' - -import { PortfolioWalletToken } from '@sushiswap/graph-client/data-api' -import { DataTable, Slot } from '@sushiswap/ui' -import { ColumnDef, Row } from '@tanstack/react-table' -import { FC, ReactNode, useCallback } from 'react' -import { - NAME_SYMBOL_AMOUNT_COLUMN, - TOKEN_ICON_COLUMN, - USD_COLUMN, -} from './columns' - - -const COLUMNS = [ - TOKEN_ICON_COLUMN, - NAME_SYMBOL_AMOUNT_COLUMN, - USD_COLUMN, -] satisfies ColumnDef[] - -// const tableState = { sorting: [{ id: 'amountUSD', desc: true }] } - -interface PortfolioWalletTableProps { - isLoading: boolean - data: PortfolioWalletToken[] - onRowClick?(row: PortfolioWalletToken): void -} - - -export const PortfolioWalletTable: FC = ({ - isLoading, - data, - onRowClick, -}) => { - // const [paginationState, setPaginationState] = useState({ - // pageIndex: 0, - // pageSize: 10, - // }) - - const rowRenderer = useCallback( - (row: Row, rowNode: ReactNode) => { - if (onRowClick) - return ( - onRowClick?.(row.original)} - > - {rowNode} - - ) - return rowNode - }, - [onRowClick], - ) - - if (isLoading) return
Loading...
- if (!data) return
No data
- - return ( - - // `/pool/${row.chainId}:${ - // row.address - // }/positions/${row.tokenId.toString()}` - // } - rowRenderer={rowRenderer} - columns={COLUMNS} - data={data.sort((a, b) => b.amountUSD - a.amountUSD)} - showColumnHeaders={false} - /> - ) -} diff --git a/apps/web/src/ui/portfolio/WalletTable/columns.tsx b/apps/web/src/ui/portfolio/WalletTable/columns.tsx deleted file mode 100644 index aeefcf0687..0000000000 --- a/apps/web/src/ui/portfolio/WalletTable/columns.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import { SkeletonCircle, SkeletonText, classNames } from '@sushiswap/ui' -import { ColumnDef } from '@tanstack/react-table' -import { formatPercent, formatUSD } from 'sushi/format' - -import { QuestionMarkCircleIcon } from '@heroicons/react-v1/solid' -import { PortfolioWalletToken } from '@sushiswap/graph-client/data-api' - -export const TOKEN_ICON_COLUMN: ColumnDef = { - id: 'icon', - header: 'icon', - cell: (props) => - // get token - props.row.original.logoUrl ? ( - // render logo 64x64 - {props.row.original.name} - ) : ( - // render network icon - // question mark icon - - ), - meta: { - skeleton: , - }, -} - -export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef< - PortfolioWalletToken, - unknown -> = { - id: 'name', - header: 'Name', - cell: (props) => - ( -
- - {props.row.original.name} - - - {props.row.original.amount.toFixed(6)} {props.row.original.symbol} - -
- ), - meta: { - skeleton: ( -
-
- - -
-
- -
-
- ), - }, - size: 300, -} - -export const USD_COLUMN: ColumnDef = { - id: 'usd', - header: '$', - cell: (props) => - formatUSD(props.row.original.amountUSD).includes('NaN') ? ( - '$0.00' - ) : ( - // `${formatUSD(props.row.original.amountUSD)} ${props.row.original.price24hChange}`) -
- - {formatUSD(props.row.original.amountUSD)} - - 0 ? 'text-green' : 'text-red', - )} - > - {props.row.original.price24hChange > 0 ? '+' : '-'} - {formatPercent(Math.abs(props.row.original.price24hChange))} - -
- ), - meta: { - skeleton: , - }, -} diff --git a/packages/ui/src/components/network-selector.tsx b/packages/ui/src/components/network-selector.tsx index 3b4d3dab86..93354e231d 100644 --- a/packages/ui/src/components/network-selector.tsx +++ b/packages/ui/src/components/network-selector.tsx @@ -45,6 +45,7 @@ const PREFERRED_CHAINID_ORDER: ChainId[] = [ export interface NetworkSelectorProps { showAptos?: boolean + hideNetworkName?: boolean networks: readonly T[] selected: T onSelect: NetworkSelectorOnSelectCallback diff --git a/packages/ui/src/components/sheet.tsx b/packages/ui/src/components/sheet.tsx index 8d7df8ff03..81837181c3 100644 --- a/packages/ui/src/components/sheet.tsx +++ b/packages/ui/src/components/sheet.tsx @@ -56,26 +56,35 @@ const sheetVariants = cva( interface SheetContentProps extends React.ComponentPropsWithoutRef, - VariantProps {} + VariantProps { + hideClose?: boolean +} const SheetContent = React.forwardRef< React.ElementRef, SheetContentProps ->(({ side = 'right', className, children, ...props }, ref) => ( - - - - {children} - - - - - -)) +>( + ( + { side = 'right', hideClose = false, className, children, ...props }, + ref, + ) => ( + + + + {children} + {hideClose ? null : ( + + + + )} + + + ), +) SheetContent.displayName = SheetPrimitive.Content.displayName const SheetHeader = ({ From e4e2a9cc5d3460e31bc788836d80022b1529b61a Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 12 Jul 2024 17:18:12 +0700 Subject: [PATCH 013/139] feat: portfolio positions tab --- .../components/user-portfolio/DefaultView.tsx | 4 +- .../PortfolioPositionsTotal.tsx | 24 ---- .../PortfolioPositions/index.tsx | 43 ------ .../v2/PortfolioV2PositionsTable.tsx | 61 --------- .../PortfolioPositions/v2/columns.tsx | 96 -------------- .../v3/PortfolioV3PositionsTable.tsx | 61 --------- .../PortfolioPositions/v3/columns.tsx | 118 ----------------- .../PortfolioTokens/PortfolioTokensInfo.tsx | 45 ------- .../user-portfolio/PortfolioTokens/index.tsx | 122 ------------------ .../wagmi/components/user-portfolio/index.tsx | 2 +- .../PortfolioSmartPositions.tsx | 73 +++++++++++ .../PortfolioV2Positions.tsx | 71 ++++++++++ .../PortfolioV3Positions.tsx | 113 ++++++++++++++++ .../portfolio-positions/index.tsx | 65 ++++++++++ .../portfolio-tokens/PortfolioTokensList.tsx | 72 +++++++++++ .../user-portfolio/portfolio-tokens/index.tsx | 70 ++++++++++ .../data-api/queries/portfolio-positions.ts | 15 ++- packages/ui/src/icons/BagIcon.tsx | 27 ++++ 18 files changed, 506 insertions(+), 576 deletions(-) delete mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/PortfolioPositionsTotal.tsx delete mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/index.tsx delete mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/PortfolioV2PositionsTable.tsx delete mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/columns.tsx delete mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/PortfolioV3PositionsTable.tsx delete mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/columns.tsx delete mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/PortfolioTokensInfo.tsx delete mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/index.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioSmartPositions.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV2Positions.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV3Positions.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/index.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/PortfolioTokensList.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/index.tsx create mode 100644 packages/ui/src/icons/BagIcon.tsx diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/DefaultView.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/DefaultView.tsx index bd19cc1ffb..2c0c6d68f0 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/DefaultView.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/DefaultView.tsx @@ -20,8 +20,8 @@ import { ChainId, chains, shortenAddress } from 'sushi' import { useAccount, useDisconnect } from 'wagmi' import { GetEnsNameReturnType } from 'wagmi/actions' import { PortfolioView } from './' -import { PortfolioPositions } from './PortfolioPositions' -import { PortfolioTokens } from './PortfolioTokens' +import { PortfolioPositions } from './portfolio-positions' +import { PortfolioTokens } from './portfolio-tokens' enum PortfolioTab { Tokens = 'Tokens', diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/PortfolioPositionsTotal.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/PortfolioPositionsTotal.tsx deleted file mode 100644 index d67f212fb9..0000000000 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/PortfolioPositionsTotal.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React, { FC } from 'react' -import { formatUSD } from 'sushi/format' - -interface PortfolioPositionsInfoProps { - isLoading: boolean - totalUSD: number | undefined -} - -export const PortfolioPositionsInfo: FC = ({ - isLoading, - totalUSD, -}) => ( - <> - {isLoading ? ( -
- ) : ( -
- - {formatUSD(totalUSD ?? 0)} - -
- )} - -) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/index.tsx deleted file mode 100644 index 80e5baa81e..0000000000 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/index.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { getPortfolioPositions } from '@sushiswap/graph-client/data-api' -import { useQuery } from '@tanstack/react-query' -import React from 'react' -import { Address } from 'viem' -import { useAccount } from 'wagmi' -import { PortfolioPositionsInfo } from './PortfolioPositionsTotal' -import { PortfolioV2PositionsTable } from './v2/PortfolioV2PositionsTable' -import { PortfolioV3PositionsTable } from './v3/PortfolioV3PositionsTable' - -function usePortfolioPositions( - address: Address | undefined, - refetchInterval?: 600_000, -) { - return useQuery({ - queryKey: ['portfolio-positions', address], - queryFn: async () => { - const id = address as string - const data = await getPortfolioPositions({ id }) - return data - }, - enabled: !!address, - refetchInterval, - }) -} - -export const PortfolioPositions = () => { - const id = useAccount() - const { data, isLoading } = usePortfolioPositions(id.address) - - return ( -
- - - -
- ) -} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/PortfolioV2PositionsTable.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/PortfolioV2PositionsTable.tsx deleted file mode 100644 index ac0d2b28af..0000000000 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/PortfolioV2PositionsTable.tsx +++ /dev/null @@ -1,61 +0,0 @@ -'use client' - -import { PortfolioPosition } from '@sushiswap/graph-client/data-api' -import { DataTable, Slot } from '@sushiswap/ui' -import { ColumnDef, Row } from '@tanstack/react-table' -import { FC, ReactNode, useCallback } from 'react' -import React from 'react' -import { ICON_COLUMN, NAME_SYMBOL_AMOUNT_COLUMN, USD_COLUMN } from './columns' - -const COLUMNS = [ - ICON_COLUMN, - NAME_SYMBOL_AMOUNT_COLUMN, - USD_COLUMN, -] satisfies ColumnDef[] - -interface PortfolioV2PositionsTableProps { - isLoading: boolean - data: PortfolioPosition[] | undefined - onRowClick?(row: PortfolioPosition): void -} - -export const PortfolioV2PositionsTable: FC = ({ - isLoading, - data, - onRowClick, -}) => { - const rowRenderer = useCallback( - (row: Row, rowNode: ReactNode) => { - if (onRowClick) - return ( - onRowClick?.(row.original)} - > - {rowNode} - - ) - return rowNode - }, - [onRowClick], - ) - - if (isLoading) return <> - if (!data) return <> - - return ( - - // `/pool/${row.chainId}:${ - // row.address - // }/positions/${row.tokenId.toString()}` - // } - rowRenderer={rowRenderer} - columns={COLUMNS} - data={data.sort((a, b) => b.amountUSD - a.amountUSD)} - showColumnHeaders={false} - /> - ) -} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/columns.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/columns.tsx deleted file mode 100644 index b8fdc33dd3..0000000000 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v2/columns.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import { SkeletonCircle, SkeletonText, classNames } from '@sushiswap/ui' -import { ColumnDef } from '@tanstack/react-table' -import { formatPercent, formatUSD } from 'sushi/format' - -import { QuestionMarkCircleIcon } from '@heroicons/react-v1/solid' -import { PortfolioV2Position } from '@sushiswap/graph-client/data-api' -import React from 'react' - -export const ICON_COLUMN: ColumnDef = { - id: 'icon', - header: 'icon', - cell: (props) => ( - // get token - -
- {props.row.original.token0.logoUrl ? ( - {props.row.original.token0.name} - ) : ( - - )} - - {props.row.original.token1.logoUrl ? ( - {props.row.original.token1.name} - ) : ( - - )} -
- ), - meta: { - skeleton: , - }, -} - -export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef< - PortfolioV2Position, - unknown -> = { - id: 'name', - header: 'Name', - cell: (props) => ( - <> -
- - {`${props.row.original.token0.symbol} / ${props.row.original.token1.symbol}`} - - -
- V2 -
{' '} - {formatPercent(props.row.original.swapFee)} -
-
- - ), - meta: { - skeleton: ( -
-
- - -
-
- -
-
- ), - }, - size: 300, -} - -export const USD_COLUMN: ColumnDef = { - id: 'usd', - header: '$', - cell: (props) => - formatUSD(props.row.original.amountUSD).includes('NaN') ? ( - '$0.00' - ) : ( - // `${formatUSD(props.row.original.amountUSD)} ${props.row.original.price24hChange}`) -
- - {formatUSD(props.row.original.amountUSD)} - -
- ), - meta: { - skeleton: , - }, -} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/PortfolioV3PositionsTable.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/PortfolioV3PositionsTable.tsx deleted file mode 100644 index c56c8e5f48..0000000000 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/PortfolioV3PositionsTable.tsx +++ /dev/null @@ -1,61 +0,0 @@ -'use client' - -import { PortfolioV3Position } from '@sushiswap/graph-client/data-api' -import { DataTable, Slot } from '@sushiswap/ui' -import { ColumnDef, Row } from '@tanstack/react-table' -import { FC, ReactNode, useCallback } from 'react' -import React from 'react' -import { ICON_COLUMN, NAME_SYMBOL_AMOUNT_COLUMN, USD_COLUMN } from './columns' - -const COLUMNS = [ - ICON_COLUMN, - NAME_SYMBOL_AMOUNT_COLUMN, - USD_COLUMN, -] satisfies ColumnDef[] - -interface PortfolioV3PositionsTableProps { - isLoading: boolean - data: PortfolioV3Position[] | undefined - onRowClick?(row: PortfolioV3Position): void -} - -export const PortfolioV3PositionsTable: FC = ({ - isLoading, - data, - onRowClick, -}) => { - const rowRenderer = useCallback( - (row: Row, rowNode: ReactNode) => { - if (onRowClick) - return ( - onRowClick?.(row.original)} - > - {rowNode} - - ) - return rowNode - }, - [onRowClick], - ) - - if (isLoading) return <> - if (!data) return <> - - return ( - - // `/pool/${row.chainId}:${ - // row.address - // }/positions/${row.tokenId.toString()}` - // } - rowRenderer={rowRenderer} - columns={COLUMNS} - data={data.sort((a, b) => b.amountUSD - a.amountUSD)} - showColumnHeaders={false} - /> - ) -} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/columns.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/columns.tsx deleted file mode 100644 index 22240b52b6..0000000000 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioPositions/v3/columns.tsx +++ /dev/null @@ -1,118 +0,0 @@ -import { SkeletonCircle, SkeletonText, classNames } from '@sushiswap/ui' -import { ColumnDef } from '@tanstack/react-table' -import { formatPercent, formatUSD } from 'sushi/format' - -import { QuestionMarkCircleIcon } from '@heroicons/react-v1/solid' -import { PortfolioV3Position } from '@sushiswap/graph-client/data-api' -import React from 'react' - -export const ICON_COLUMN: ColumnDef = { - id: 'icon', - header: 'icon', - cell: (props) => ( - // get token - -
- {props.row.original.token0.logoUrl ? ( - {props.row.original.token0.name} - ) : ( - - )} - - {props.row.original.token1.logoUrl ? ( - {props.row.original.token1.name} - ) : ( - - )} -
- ), - meta: { - skeleton: , - }, -} - -export const NAME_SYMBOL_AMOUNT_COLUMN: ColumnDef< - PortfolioV3Position, - unknown -> = { - id: 'name', - header: 'Name', - cell: (props) => ( - <> -
- - {`${props.row.original.token0.symbol} / ${props.row.original.token1.symbol}`} - - -
- V3 -
{' '} - {formatPercent(props.row.original.swapFee)} -
-
- - ), - meta: { - skeleton: ( -
-
- - -
-
- -
-
- ), - }, - size: 300, -} - -export const USD_COLUMN: ColumnDef = { - id: 'usd', - header: '$', - cell: (props) => - formatUSD(props.row.original.amountUSD).includes('NaN') ? ( - '$0.00' - ) : ( - // `${formatUSD(props.row.original.amountUSD)} ${props.row.original.price24hChange}`) -
- - {formatUSD(props.row.original.amountUSD)} - - - { -
- {props.row.original.range === 'IN_RANGE' ? ( - // green dot - <> -
- - In Range - - ) : props.row.original.range === 'OUT_OF_RANGE' ? ( - // red dot - <> -
- - Out of Range - - ) : ( - <> - )} -
- } -
- ), - meta: { - skeleton: , - }, -} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/PortfolioTokensInfo.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/PortfolioTokensInfo.tsx deleted file mode 100644 index 5b9f6c05aa..0000000000 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/PortfolioTokensInfo.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { classNames } from '@sushiswap/ui' -import React, { FC } from 'react' -import { formatPercent, formatUSD } from 'sushi' - -interface PortfolioTokensInfoProps { - isLoading: boolean - percentageChange24h: number | undefined - amountUSD24Change: number | undefined - totalUSD: number | undefined -} - -export const PortfolioTokensInfo: FC = ({ - isLoading, - percentageChange24h, - amountUSD24Change, - totalUSD, -}) => ( - <> - {isLoading ? ( -
- ) : ( -
- - {formatUSD(totalUSD ?? 0)} - - - {(percentageChange24h ?? 0) > 0 ? '+' : '-'} - {formatUSD(amountUSD24Change ?? 0)} - 0 ? 'text-green' : 'text-red', - )} - > - {` (${formatPercent(Math.abs(percentageChange24h ?? 0))})`} - - -
- )} - -) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/index.tsx deleted file mode 100644 index eb117a79ac..0000000000 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioTokens/index.tsx +++ /dev/null @@ -1,122 +0,0 @@ -import { getPortfolioWallet } from '@sushiswap/graph-client/data-api' -import { FormattedNumber, SkeletonText, classNames } from '@sushiswap/ui' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' -import { useQuery } from '@tanstack/react-query' -import React from 'react' -import { formatPercent, formatUSD } from 'sushi/format' -import { Address } from 'viem' -import { useAccount } from 'wagmi' - -function usePortfolioWallet( - address: Address | undefined, - refetchInterval?: 600_000, -) { - return useQuery({ - queryKey: ['portfolio-wallet', address], - queryFn: async () => { - const id = address as string - const data = await getPortfolioWallet({ id }) - return data - }, - enabled: !!address, - refetchInterval, - }) -} - -export const PortfolioTokens = () => { - const { address } = useAccount() - const { data, isLoading } = usePortfolioWallet(address) - - return ( -
-
-
- Total Balance -
- {isLoading ? ( - <> - - - - ) : ( - <> -
- {formatUSD(data!.totalUSD)} -
-
0 - ? 'text-green' - : data!.amountUSD24Change < 0 - ? 'text-red' - : 'text-muted-foreground', - )} - > - {`${data!.amountUSD24Change > 0 ? '+' : ''}${formatUSD( - data!.amountUSD24Change, - )} (${formatPercent(data!.percentageChange24h)})`} -
- - )} -
-
-
-
- {data?.tokens.map((token) => { - return ( -
-
-
-
- {token.symbol -
- -
-
-
- {token.name ?? token.symbol} -
-
- {' '} - {token.symbol} -
-
-
-
-
- {formatUSD(token.amountUSD)} -
-
0 - ? 'text-green' - : token.price24hChange < 0 - ? 'text-red' - : 'text-muted-foreground', - )} - > - {`${token.price24hChange > 0 ? '+' : ''}${formatPercent( - token.price24hChange, - )}`} -
-
-
- ) - })} -
-
- ) -} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx index 498451016d..9720adb149 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx @@ -68,7 +68,7 @@ export const UserPortfolio = () => { {shortenAddress(address, isSm ? 3 : 2)} - + {content} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioSmartPositions.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioSmartPositions.tsx new file mode 100644 index 0000000000..d84affebf5 --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioSmartPositions.tsx @@ -0,0 +1,73 @@ +import { PortfolioSmartPosition } from '@sushiswap/graph-client/data-api' +import { + AccordionContent, + AccordionItem, + AccordionTrigger, + Badge, + Currency, +} from '@sushiswap/ui' +import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' +import React, { FC } from 'react' +import { formatUSD } from 'sushi/format' + +interface PortfolioSmartPositionsProps { + positions: PortfolioSmartPosition[] +} + +export const PortfolioSmartPositions: FC = ({ + positions, +}) => ( + + + {`Smart Positions (${positions.length})`} + + + {positions.map((position) => ( +
+
+
+ + } + > + + {position.token0.symbol} + {position.token1.symbol} + + +
+
+
+ {position.name} +
+
{`V3-${ + position.swapFee * 100 + }%-${position.strategy}`}
+
+
+
+ {formatUSD(position.amountUSD)} +
+
+ ))} +
+
+) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV2Positions.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV2Positions.tsx new file mode 100644 index 0000000000..97974671e4 --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV2Positions.tsx @@ -0,0 +1,71 @@ +import { PortfolioV2Position } from '@sushiswap/graph-client/data-api' +import { + AccordionContent, + AccordionItem, + AccordionTrigger, + Badge, + Currency, +} from '@sushiswap/ui' +import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' +import React, { FC } from 'react' +import { formatUSD } from 'sushi/format' + +interface PortfolioV2PositionssProps { + positions: PortfolioV2Position[] +} + +export const PortfolioV2Positions: FC = ({ + positions, +}) => ( + + + {`V2 Positions (${positions.length})`} + + + {positions.map((position) => ( +
+
+
+ + } + > + + {position.token0.symbol} + {position.token1.symbol} + + +
+
+
+ {position.name} +
+
V2-0.30%
+
+
+
+ {formatUSD(position.amountUSD)} +
+
+ ))} +
+
+) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV3Positions.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV3Positions.tsx new file mode 100644 index 0000000000..62a5312ca9 --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV3Positions.tsx @@ -0,0 +1,113 @@ +import { PortfolioV3Position } from '@sushiswap/graph-client/data-api' +import { + AccordionContent, + AccordionItem, + AccordionTrigger, + Badge, + Currency, + classNames, +} from '@sushiswap/ui' +import { BagIcon } from '@sushiswap/ui/icons/BagIcon' +import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' +import React, { FC } from 'react' +import { formatUSD } from 'sushi/format' + +interface PortfolioV3PositionsProps { + positions: PortfolioV3Position[] +} + +export const PortfolioV3Positions: FC = ({ + positions, +}) => ( + + + {`V3 Positions (${positions.length})`} + + + {positions.map((position) => ( +
+
+
+ + } + > + + {position.token0.symbol} + {position.token1.symbol} + + +
+
+
+ {position.name} +
+
+
{`V3-${ + position.swapFee * 100 + }%`}
+
+
+ + {position.range === 'OUT_OF_RANGE' + ? 'Out of Range' + : position.range === 'IN_RANGE' + ? 'In Range' + : 'Unknown'} + +
+
+
+
+
+
+ {formatUSD(position.amountUSD)} +
+
+ + {formatUSD( + position.fees.reduce((sum, fee) => sum + fee.amountUSD, 0), + )} +
+
+
+ ))} + + +) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/index.tsx new file mode 100644 index 0000000000..6e1407dcda --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/index.tsx @@ -0,0 +1,65 @@ +import { getPortfolioPositions } from '@sushiswap/graph-client/data-api' +import { Accordion, SkeletonText } from '@sushiswap/ui' +import { useQuery } from '@tanstack/react-query' +import React from 'react' +import { formatUSD } from 'sushi/format' +import { Address } from 'viem' +import { useAccount } from 'wagmi' +import { PortfolioSmartPositions } from './PortfolioSmartPositions' +import { PortfolioV2Positions } from './PortfolioV2Positions' +import { PortfolioV3Positions } from './PortfolioV3Positions' + +function usePortfolioPositions( + address: Address | undefined, + refetchInterval?: 600_000, +) { + return useQuery({ + queryKey: ['portfolio-positions', address], + queryFn: async () => { + const id = address as string + const data = await getPortfolioPositions({ id }) + return data + }, + enabled: !!address, + refetchInterval, + }) +} + +export const PortfolioPositions = () => { + const id = useAccount() + const { data, isLoading } = usePortfolioPositions(id.address) + + return ( +
+
+
+ Total Balance +
+ {isLoading ? ( + + ) : ( +
+ {formatUSD(data!.totalUSD)} +
+ )} +
+
+
+ + {data?.v2Positions.length ? ( + + ) : null} + {data?.v3Positions.length ? ( + + ) : null} + {data?.smartPositions.length ? ( + + ) : null} + +
+ ) +} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/PortfolioTokensList.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/PortfolioTokensList.tsx new file mode 100644 index 0000000000..6999e5b375 --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/PortfolioTokensList.tsx @@ -0,0 +1,72 @@ +import { PortfolioWalletToken } from '@sushiswap/graph-client/data-api' +import { Badge, FormattedNumber, classNames } from '@sushiswap/ui' +import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' +import React, { FC } from 'react' +import { formatPercent, formatUSD } from 'sushi/format' + +interface PortfolioTokensListProps { + tokens: PortfolioWalletToken[] +} + +export const PortfolioTokensList: FC = ({ + tokens, +}) => ( +
+ {tokens.map((token) => { + return ( +
+
+
+ + } + > + {token.symbol + +
+
+
+ {token.name ?? token.symbol} +
+
+ {' '} + {token.symbol} +
+
+
+
+
+ {formatUSD(token.amountUSD)} +
+
0 + ? 'text-green' + : token.price24hChange < 0 + ? 'text-red' + : 'text-muted-foreground', + )} + > + {`${token.price24hChange > 0 ? '+' : ''}${formatPercent( + token.price24hChange, + )}`} +
+
+
+ ) + })} +
+) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/index.tsx new file mode 100644 index 0000000000..df0372b2a5 --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/index.tsx @@ -0,0 +1,70 @@ +import { getPortfolioWallet } from '@sushiswap/graph-client/data-api' +import { SkeletonText, classNames } from '@sushiswap/ui' +import { useQuery } from '@tanstack/react-query' +import React from 'react' +import { formatPercent, formatUSD } from 'sushi/format' +import { Address } from 'viem' +import { useAccount } from 'wagmi' +import { PortfolioTokensList } from './PortfolioTokensList' + +function usePortfolioWallet( + address: Address | undefined, + refetchInterval?: 600_000, +) { + return useQuery({ + queryKey: ['portfolio-wallet', address], + queryFn: async () => { + const id = address as string + const data = await getPortfolioWallet({ id }) + return data + }, + enabled: !!address, + refetchInterval, + }) +} + +export const PortfolioTokens = () => { + const { address } = useAccount() + const { data, isLoading } = usePortfolioWallet(address) + + return ( +
+
+
+ Total Balance +
+ {isLoading ? ( + <> + + + + ) : ( + <> +
+ {formatUSD(data!.totalUSD)} +
+
0 + ? 'text-green' + : data!.amountUSD24Change < 0 + ? 'text-red' + : 'text-muted-foreground', + )} + > + {`${data!.amountUSD24Change > 0 ? '+' : ''}${formatUSD( + data!.amountUSD24Change, + )} (${formatPercent(data!.percentageChange24h)})`} +
+ + )} +
+
+
+ {data?.tokens.length ? ( + + ) : null} +
+ ) +} diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts index 98d5b29fd9..e8fe833a03 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-positions.ts @@ -179,7 +179,10 @@ query PortfolioPositions($id: ID!) { export type GetPortfolioPositions = VariablesOf -export async function getPortfolioPositions(variables: GetPortfolioPositions, options?: RequestOptions) { +export async function getPortfolioPositions( + variables: GetPortfolioPositions, + options?: RequestOptions, +) { const url = `https://data-api-production-acb1.up.railway.app/graphql/` const result = await request( @@ -193,9 +196,15 @@ export async function getPortfolioPositions(variables: GetPortfolioPositions, op throw new Error('No portfolio positions') } -export type PortfolioPositions = Awaited> +export type PortfolioPositions = Awaited< + ReturnType +> export type PortfolioV2Position = PortfolioPositions['v2Positions'][0] export type PortfolioV3Position = PortfolioPositions['v3Positions'][0] +export type PortfolioSmartPosition = PortfolioPositions['smartPositions'][0] -export type PortfolioPosition = PortfolioV2Position | PortfolioV3Position \ No newline at end of file +export type PortfolioPosition = + | PortfolioV2Position + | PortfolioV3Position + | PortfolioSmartPosition diff --git a/packages/ui/src/icons/BagIcon.tsx b/packages/ui/src/icons/BagIcon.tsx new file mode 100644 index 0000000000..231283a06d --- /dev/null +++ b/packages/ui/src/icons/BagIcon.tsx @@ -0,0 +1,27 @@ +import React from 'react' + +import { IconComponent } from '../types' + +export const BagIcon: IconComponent = (props) => { + return ( + + + + + ) +} From b36098824cf396beb88dfadd11b5054fe1f94255 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 12 Jul 2024 22:53:04 +0700 Subject: [PATCH 014/139] feat: portfolio claimables tab --- ...faultView.tsx => PortfolioDefaultView.tsx} | 9 +- ...ingsView.tsx => PortfolioSettingsView.tsx} | 8 +- .../wagmi/components/user-portfolio/index.tsx | 8 +- .../PortfolioFarmClaimables.tsx | 76 +++++++ .../PortfolioFuroClaimables.tsx | 63 ++++++ .../portfolio-claimables/index.tsx | 74 +++++++ ...ositions.tsx => PortfolioALMPositions.tsx} | 4 +- .../portfolio-positions/index.tsx | 4 +- .../src/subgraphs/data-api/index.ts | 3 +- .../data-api/queries/portfolio-claimables.ts | 37 +++- .../src/subgraphs/data-api/schema.graphql | 205 ++++++++++++++++++ 11 files changed, 468 insertions(+), 23 deletions(-) rename apps/web/src/lib/wagmi/components/user-portfolio/{DefaultView.tsx => PortfolioDefaultView.tsx} (94%) rename apps/web/src/lib/wagmi/components/user-portfolio/{SettingsView.tsx => PortfolioSettingsView.tsx} (94%) create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFarmClaimables.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/index.tsx rename apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/{PortfolioSmartPositions.tsx => PortfolioALMPositions.tsx} (95%) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/DefaultView.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx similarity index 94% rename from apps/web/src/lib/wagmi/components/user-portfolio/DefaultView.tsx rename to apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx index 2c0c6d68f0..b6f027de2c 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/DefaultView.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx @@ -19,7 +19,8 @@ import { HeaderNetworkSelector } from 'src/lib/wagmi/components/header-network-s import { ChainId, chains, shortenAddress } from 'sushi' import { useAccount, useDisconnect } from 'wagmi' import { GetEnsNameReturnType } from 'wagmi/actions' -import { PortfolioView } from './' +import { PortfolioView } from '.' +import { PortfolioClaimables } from './portfolio-claimables' import { PortfolioPositions } from './portfolio-positions' import { PortfolioTokens } from './portfolio-tokens' @@ -29,13 +30,13 @@ enum PortfolioTab { Claimable = 'Claimable', } -interface DefaultProps { +interface PortfolioDefaultProps { ensName: GetEnsNameReturnType | undefined isENSNameLoading: boolean setView: Dispatch> } -export const DefaultView: FC = ({ +export const PortfolioDefaultView: FC = ({ setView, ensName, isENSNameLoading, @@ -52,7 +53,7 @@ export const DefaultView: FC = ({ case PortfolioTab.Positions: return case PortfolioTab.Claimable: - return null + return } }, [tab]) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/SettingsView.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioSettingsView.tsx similarity index 94% rename from apps/web/src/lib/wagmi/components/user-portfolio/SettingsView.tsx rename to apps/web/src/lib/wagmi/components/user-portfolio/PortfolioSettingsView.tsx index efcef9937e..f2a0877799 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/SettingsView.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioSettingsView.tsx @@ -8,9 +8,9 @@ import { IconButton } from '@sushiswap/ui' import { Switch } from '@sushiswap/ui' import { useTheme } from 'next-themes' import React, { Dispatch, FC, Fragment, SetStateAction } from 'react' -import { PortfolioView } from './' +import { PortfolioView } from '.' -interface SettingsViewProps { +interface PortfolioSettingsViewProps { setView: Dispatch> } @@ -20,7 +20,9 @@ const map = { dark: , } -export const SettingsView: FC = ({ setView }) => { +export const PortfolioSettingsView: FC = ({ + setView, +}) => { const { theme, setTheme } = useTheme() const [showTestnets, setShowTestnets] = useLocalStorage('showTestnets', false) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx index 9720adb149..6c3cceb811 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx @@ -12,8 +12,8 @@ import { useMemo, useState } from 'react' import { ChainId, shortenAddress } from 'sushi' import { useAccount, useEnsAvatar, useEnsName } from 'wagmi' import { ConnectButton } from '../connect-button' -import { DefaultView } from './DefaultView' -import { SettingsView } from './SettingsView' +import { PortfolioDefaultView } from './PortfolioDefaultView' +import { PortfolioSettingsView } from './PortfolioSettingsView' export enum PortfolioView { Default = 'Default', @@ -38,10 +38,10 @@ export const UserPortfolio = () => { const content = useMemo(() => { switch (view) { case PortfolioView.Settings: - return + return default: return ( - = ({ + claimables, +}) => ( + + + {`Farms (${claimables.length})`} + + + {claimables.map(({ position, token }) => ( +
+
+
+ + } + > + {position.protocol} + +
+
+
+ {token.name} +
+
+ {`${ + position.protocol === 'SUSHISWAP_V2' + ? 'V2' + : position.protocol === 'SUSHISWAP_V3' + ? 'V3' + : position.protocol + }-${position.swapFee * 100}%-${position.name.replace( + ' / ', + '-', + )}`} +
+
+
+
+ {formatUSD(token.amountUSD)} +
+
+ ))} +
+
+) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx new file mode 100644 index 0000000000..64fe15cbfa --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx @@ -0,0 +1,63 @@ +import { PortfolioFuroClaim } from '@sushiswap/graph-client/data-api' +import { + AccordionContent, + AccordionItem, + AccordionTrigger, + Badge, +} from '@sushiswap/ui' +import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' +import { FC } from 'react' +import { formatUSD } from 'sushi/format' + +interface PortfolioFuroClaimablesProps { + claimables: PortfolioFuroClaim[] +} + +export const PortfolioFuroClaimables: FC = ({ + claimables, +}) => ( + + + {`Furo Streaming (${claimables.length})`} + + + {claimables.map(({ position, token }) => ( +
+
+
+ + } + > + {token.symbol + +
+
+
+ {token.name} +
+
+ {position.name.toUpperCase()} +
+
+
+
+ {formatUSD(token.amountUSD)} +
+
+ ))} +
+
+) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/index.tsx new file mode 100644 index 0000000000..ccad6ec357 --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/index.tsx @@ -0,0 +1,74 @@ +import { + PortfolioFarmClaim, + getPortfolioClaimables, +} from '@sushiswap/graph-client/data-api' +import { Accordion, SkeletonText } from '@sushiswap/ui' +import { useQuery } from '@tanstack/react-query' +import React, { useMemo } from 'react' +import { formatUSD } from 'sushi/format' +import { Address } from 'viem' +import { useAccount } from 'wagmi' +import { PortfolioFarmClaimables } from './PortfolioFarmClaimables' +import { PortfolioFuroClaimables } from './PortfolioFuroClaimables' + +function usePortfolioClaimables( + address: Address | undefined, + refetchInterval?: 600_000, +) { + return useQuery({ + queryKey: ['portfolio-claimables', address], + queryFn: async () => { + const id = address as string + const data = await getPortfolioClaimables({ id }) + return data + }, + enabled: !!address, + refetchInterval, + }) +} + +export const PortfolioClaimables = () => { + const { address } = useAccount() + const { data, isLoading } = usePortfolioClaimables(address) + + const farmClaimables: PortfolioFarmClaim[] = useMemo( + () => + data + ? [ + ...data.v2PositionClaimables, + ...data.v3PositionClaimables, + ...data.smartPositionClaimables, + ] + : [], + [data], + ) + + return ( +
+
+
+ Total Balance + {isLoading ? ( + + ) : ( +
+ {formatUSD(data!.totalUSD)} +
+ )} +
+
+ + {farmClaimables.length ? ( + + ) : null} + {data?.furoClaimables.length ? ( + + ) : null} + +
+ ) +} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioSmartPositions.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioALMPositions.tsx similarity index 95% rename from apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioSmartPositions.tsx rename to apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioALMPositions.tsx index d84affebf5..c2753afcbd 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioSmartPositions.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioALMPositions.tsx @@ -10,11 +10,11 @@ import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' import React, { FC } from 'react' import { formatUSD } from 'sushi/format' -interface PortfolioSmartPositionsProps { +interface PortfolioALMPositionsProps { positions: PortfolioSmartPosition[] } -export const PortfolioSmartPositions: FC = ({ +export const PortfolioALMPositions: FC = ({ positions, }) => ( diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/index.tsx index 6e1407dcda..b162db45ba 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/index.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/index.tsx @@ -5,7 +5,7 @@ import React from 'react' import { formatUSD } from 'sushi/format' import { Address } from 'viem' import { useAccount } from 'wagmi' -import { PortfolioSmartPositions } from './PortfolioSmartPositions' +import { PortfolioALMPositions } from './PortfolioALMPositions' import { PortfolioV2Positions } from './PortfolioV2Positions' import { PortfolioV3Positions } from './PortfolioV3Positions' @@ -57,7 +57,7 @@ export const PortfolioPositions = () => { ) : null} {data?.smartPositions.length ? ( - + ) : null}
diff --git a/packages/graph-client/src/subgraphs/data-api/index.ts b/packages/graph-client/src/subgraphs/data-api/index.ts index feb3dcb4ee..61884eb0e4 100644 --- a/packages/graph-client/src/subgraphs/data-api/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/index.ts @@ -1,3 +1,4 @@ export * from './queries/pools' +export * from './queries/portfolio-claimables' export * from './queries/portfolio-positions' -export * from './queries/portfolio-wallet' \ No newline at end of file +export * from './queries/portfolio-wallet' diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-claimables.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-claimables.ts index e2f01dcfdc..3972c27fa6 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-claimables.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-claimables.ts @@ -107,9 +107,26 @@ export const PortfolioClaimablesQuery = graphql( amountUSD updatedAt } + token { + id + chain + chainId + name + symbol + decimals + logoUrl + protocolId + price + isVerified + isCore + isWallet + timeAt + amount + amountUSD + } } smartPositionClaimables { - token { + token { id chain chainId @@ -199,13 +216,19 @@ export async function getPortfolioClaimables( throw new Error('No portfolio positions') } -export type PortfolioPositions = Awaited< +export type PortfolioClaimables = Awaited< ReturnType > -export type PortfolioV2Claim = PortfolioPositions['v2PositionClaimables'][0] -export type PortfolioV3Claim = PortfolioPositions['v3PositionClaimables'][0] -export type PortfolioSmartPositionClaim = PortfolioPositions['smartPositionClaimables'][0] -export type PortfolioFuroClaim = PortfolioPositions['furoClaimables'][0] +export type PortfolioV2Claim = PortfolioClaimables['v2PositionClaimables'][0] +export type PortfolioV3Claim = PortfolioClaimables['v3PositionClaimables'][0] +export type PortfolioSmartPositionClaim = + PortfolioClaimables['smartPositionClaimables'][0] +export type PortfolioFuroClaim = PortfolioClaimables['furoClaimables'][0] + +export type PortfolioFarmClaim = + | PortfolioV2Claim + | PortfolioV3Claim + | PortfolioSmartPositionClaim -export type PortfolioClaim = PortfolioV2Claim['position'] | PortfolioV3Claim['position'] | PortfolioSmartPositionClaim['position'] | PortfolioFuroClaim['position'] +export type PortfolioClaim = PortfolioFarmClaim | PortfolioFuroClaim diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index cafea6589b..b32d47eb83 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -1,3 +1,157 @@ +type Token { + id: ID! + address: String! + name: String! + symbol: String! + decimals: Int! +} + +type DetailedPool { + id: ID! + chainId: Int! + name: String! + address: String! + createdAt: String! + swapFee: Float! + protocol: String! + token0: Token! + token1: Token! + source: String! + reserve0: Float! + reserve1: Float! + liquidity: Float! + volumeUSD: Float! + liquidityUSD: Float! + token0Price: Float! + token1Price: Float! + volumeUSD1d: Float! + feeUSD1d: Float! + txCount1d: Int! + feeApr1d: Float! + totalApr1d: Float! + volumeUSD1dChange: Float! + feeUSD1dChange: Float! + txCount1dChange: Float! + liquidityUSD1dChange: Float! + incentiveApr: Float! + hadSmartPool: Boolean! + hasSmartPool: Boolean! + isIncentivized: Boolean! + wasIncentivized: Boolean! + hourBuckets: [PoolBucket]! + dayBuckets: [PoolBucket]! +} + +type PoolBucket { + id: ID! + date: Int! + volumeUSD: Float! + liquidityUSD: Float! + txCount: Int! + feesUSD: Float! +} + +type V2Transaction { + id: ID! + createdAtBlock: String! + createdAtTimestamp: String! + swaps: [V2Swap] + burns: [V2Burn] + mints: [V2Mint] +} + +type V2Burn { + id: ID! + logIndex: String + amountUSD: String + amount1: String + amount0: String + liquidity: String! + sender: ID + transaction: V2Transaction! +} + +type V2Mint { + id: ID! + logIndex: String + amountUSD: String + amount1: String + amount0: String + liquidity: String! + sender: ID + transaction: V2Transaction! +} + +type V2Swap { + id: ID! + logIndex: String + amountUSD: String! + amount1Out: String! + amount0Out: String! + amount1In: String! + amount0In: String! + to: ID! + sender: ID! + transaction: V2Transaction! +} + +type V3Burn { + id: ID! + logIndex: String + amountUSD: String + amount1: String! + amount0: String! + amount: String! + origin: ID! + owner: ID + transaction: V3Transaction! +} + +type V3Collect { + id: ID! + logIndex: String + amountUSD: String + amount1: String! + amount0: String! + owner: ID + transaction: V3Transaction! +} + +type V3Mint { + id: ID! + logIndex: String + amountUSD: String + amount1: String! + amount0: String! + amount: String! + origin: ID! + sender: ID + owner: ID! + transaction: V3Transaction! +} + +type V3Swap { + id: ID! + logIndex: String + amountUSD: String! + amount1: String! + amount0: String! + origin: ID! + recipient: ID! + sender: ID! + transaction: V3Transaction! +} + +type V3Transaction { + id: ID! + blockNumber: String! + timestamp: String! + collects: [V3Collect] + swaps: [V3Swap] + burns: [V3Burn] + mints: [V3Mint] +} + type Pool { id: ID! chainId: Int! @@ -181,9 +335,60 @@ type PortfolioWallet { tokens: [PortfolioToken]! } +enum TransactionTokenType { + ERC20 + NFT +} + +type PortfolioTransactionToken { + id: String! + name: String! + symbol: String! + type: TransactionTokenType! + logoUrl: String + amount: Float! + isVerified: Boolean! + isCore: Boolean! + isSuspicious: Boolean! + isScam: Boolean! +} + +enum PortfolioTransactionCategory { + SEND + RECEIVE + APPROVE + OTHER +} + +type PortfolioTransaction { + chainId: Int + chain: String! + txHash: String! + functionName: String! + projectName: String + protocolLogo: String + category: PortfolioTransactionCategory! + receives: [PortfolioTransactionToken]! + sends: [PortfolioTransactionToken]! + approve: PortfolioTransactionToken + gasFeeNative: Float! + gasFeeUSD: Float! +} + type Query { portfolioWallet(id: ID!): PortfolioWallet! portfolioLiquidityPositions(id: ID!): PortfolioPositions! portfolioClaimables(id: ID!): PortfolioClaimables! + portfolioHistory(id: ID!): [PortfolioTransaction]! pools(chainId: ID!): [Pool] + pool(address: String!, chainId: Int!, protocol: String!): DetailedPool + v2Swaps(address: String!, chainId: Int!): [V2Swap] + v2Burns(address: String!, chainId: Int!): [V2Burn] + v2Mints(address: String!, chainId: Int!): [V2Mint] + v2Transactions(address: String!, chainId: Int!): [V2Transaction] + v3Swaps(address: String!, chainId: Int!): [V3Swap] + v3Burns(address: String!, chainId: Int!): [V3Burn] + v3Mints(address: String!, chainId: Int!): [V3Mint] + v3Collects(address: String!, chainId: Int!): [V3Collect] + v3Transactions(address: String!, chainId: Int!): [V3Transaction] } \ No newline at end of file From c7944545e56a735408a8934abe5118aa5a7848b1 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 12 Jul 2024 23:15:20 +0700 Subject: [PATCH 015/139] fix: portfolio position rows --- .../portfolio-claimables/PortfolioFarmClaimables.tsx | 11 +++++++++-- .../portfolio-claimables/PortfolioFuroClaimables.tsx | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFarmClaimables.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFarmClaimables.tsx index c334506361..2e14cf8f84 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFarmClaimables.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFarmClaimables.tsx @@ -4,6 +4,7 @@ import { AccordionItem, AccordionTrigger, Badge, + FormattedNumber, } from '@sushiswap/ui' import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' import { FC } from 'react' @@ -66,8 +67,14 @@ export const PortfolioFarmClaimables: FC = ({
-
- {formatUSD(token.amountUSD)} +
+
+ {formatUSD(token.amountUSD)} +
+
+ {' '} + {token.symbol} +
))} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx index 64fe15cbfa..4f7b132e2d 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx @@ -4,6 +4,7 @@ import { AccordionItem, AccordionTrigger, Badge, + FormattedNumber, } from '@sushiswap/ui' import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' import { FC } from 'react' @@ -53,8 +54,14 @@ export const PortfolioFuroClaimables: FC = ({
-
- {formatUSD(token.amountUSD)} +
+
+ {formatUSD(token.amountUSD)} +
+
+ {' '} + {token.symbol} +
))} From d706e69e29c81877d5a4979405985185c5b8cc48 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Mon, 15 Jul 2024 19:30:32 +0700 Subject: [PATCH 016/139] feat: portfolio mobile view --- .../user-portfolio/PortfolioDefaultView.tsx | 2 +- .../wagmi/components/user-portfolio/index.tsx | 43 ++++++++++++++----- packages/ui/src/components/dialog.tsx | 14 +++--- 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx index b6f027de2c..fb40b76dbe 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx @@ -58,7 +58,7 @@ export const PortfolioDefaultView: FC = ({ }, [tab]) return ( -
+
diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx index 6c3cceb811..a785ac1758 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx @@ -2,13 +2,15 @@ import { Button, + Dialog, + DialogContent, + DialogTrigger, Sheet, SheetContent, SheetTrigger, useBreakpoint, } from '@sushiswap/ui' -import Image from 'next/image' -import { useMemo, useState } from 'react' +import { FC, ReactNode, useMemo, useState } from 'react' import { ChainId, shortenAddress } from 'sushi' import { useAccount, useEnsAvatar, useEnsName } from 'wagmi' import { ConnectButton } from '../connect-button' @@ -20,6 +22,28 @@ export enum PortfolioView { Settings = 'Settings', } +const ResponsivePortfolioWrapper: FC<{ + content: ReactNode + trigger: ReactNode + isSm: boolean +}> = ({ content, trigger, isSm }) => { + return isSm ? ( + + {trigger} + + {content} + + + ) : ( + + {trigger} + + {content} + + + ) +} + export const UserPortfolio = () => { const { isSm } = useBreakpoint('sm') const { address } = useAccount() @@ -53,11 +77,11 @@ export const UserPortfolio = () => { if (!address) return return ( - - + {avatar ? ( - { ) : null} {shortenAddress(address, isSm ? 3 : 2)} - - - {content} - - + } + content={content} + isSm={isSm} + /> ) } diff --git a/packages/ui/src/components/dialog.tsx b/packages/ui/src/components/dialog.tsx index cca8937e3a..7389a7d95f 100644 --- a/packages/ui/src/components/dialog.tsx +++ b/packages/ui/src/components/dialog.tsx @@ -126,12 +126,14 @@ const DialogContent = React.forwardRef< {...props} > {children} - - - + {_hideClose ? null : ( + + + + )} ), From 51afc3357224118b6ffcdd42e855306fb6283510 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 16 Jul 2024 01:33:55 +0700 Subject: [PATCH 017/139] feat: portfolio history tab --- .../user-portfolio/PortfolioDefaultView.tsx | 4 + .../user-portfolio/PortfolioInfoRow.tsx | 47 +++ .../PortfolioFarmClaimables.tsx | 74 ++--- .../PortfolioFuroClaimables.tsx | 70 ++-- .../PortfolioALMPositions.tsx | 71 ++-- .../PortfolioV2Positions.tsx | 71 ++-- .../PortfolioV3Positions.tsx | 85 +++-- .../portfolio-tokens/PortfolioTokensList.tsx | 90 +++-- .../PortfolioApproveTransaction.tsx | 69 ++++ .../PortfolioOtherTransaction.tsx | 100 ++++++ .../PortfolioReceiveTransaction.tsx | 115 +++++++ .../PortfolioSendTransaction.tsx | 118 +++++++ .../user-portfolio/portolio-history/index.tsx | 47 +++ .../src/subgraphs/data-api/index.ts | 1 + .../data-api/queries/portfolio-history.ts | 82 +++++ .../src/subgraphs/data-api/schema.graphql | 308 +++++++++++------- packages/sushi/src/format/hash.ts | 10 + packages/sushi/src/format/index.ts | 1 + 18 files changed, 986 insertions(+), 377 deletions(-) create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/PortfolioInfoRow.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioApproveTransaction.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioOtherTransaction.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioReceiveTransaction.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioSendTransaction.tsx create mode 100644 apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/index.tsx create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/portfolio-history.ts create mode 100644 packages/sushi/src/format/hash.ts diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx index fb40b76dbe..a241c42bfe 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx @@ -23,11 +23,13 @@ import { PortfolioView } from '.' import { PortfolioClaimables } from './portfolio-claimables' import { PortfolioPositions } from './portfolio-positions' import { PortfolioTokens } from './portfolio-tokens' +import { PortfolioHistory } from './portolio-history' enum PortfolioTab { Tokens = 'Tokens', Positions = 'Positions', Claimable = 'Claimable', + History = 'History', } interface PortfolioDefaultProps { @@ -54,6 +56,8 @@ export const PortfolioDefaultView: FC = ({ return case PortfolioTab.Claimable: return + case PortfolioTab.History: + return } }, [tab]) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioInfoRow.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioInfoRow.tsx new file mode 100644 index 0000000000..c7c9627ee9 --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioInfoRow.tsx @@ -0,0 +1,47 @@ +import { Badge } from '@sushiswap/ui' +import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' +import { FC, ReactElement } from 'react' +import { ChainId } from 'sushi/chain' + +interface PortfolioInfoRow { + id: string + chainId: ChainId + icon: ReactElement + leftContent: ReactElement + rightContent: ReactElement | null +} + +export const PortfolioInfoRow: FC = ({ + id, + chainId, + icon, + leftContent, + rightContent, +}) => { + return ( +
+
+ + } + > + {icon} + +
+
+
+ {leftContent} +
+
+ {rightContent} +
+
+
+ ) +} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFarmClaimables.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFarmClaimables.tsx index 2e14cf8f84..aa573bae70 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFarmClaimables.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFarmClaimables.tsx @@ -3,12 +3,13 @@ import { AccordionContent, AccordionItem, AccordionTrigger, - Badge, FormattedNumber, } from '@sushiswap/ui' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' import { FC } from 'react' +import React from 'react' +import { ChainId } from 'sushi/chain' import { formatUSD } from 'sushi/format' +import { PortfolioInfoRow } from '../PortfolioInfoRow' interface PortfolioFarmClaimablesProps { claimables: PortfolioFarmClaim[] @@ -23,37 +24,24 @@ export const PortfolioFarmClaimables: FC = ({ {claimables.map(({ position, token }) => ( -
-
-
- - } - > - {position.protocol} - -
-
-
+ chainId={token.chainId as ChainId} + icon={ + {token.symbol + } + leftContent={ + +
{token.name}
-
+
{`${ position.protocol === 'SUSHISWAP_V2' ? 'V2' @@ -65,18 +53,20 @@ export const PortfolioFarmClaimables: FC = ({ '-', )}`}
-
-
-
-
- {formatUSD(token.amountUSD)} -
-
- {' '} - {token.symbol} -
-
-
+ + } + rightContent={ + +
+ {formatUSD(token.amountUSD)} +
+
+ {' '} + {token.symbol} +
+
+ } + /> ))} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx index 4f7b132e2d..d11877f3bc 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-claimables/PortfolioFuroClaimables.tsx @@ -3,12 +3,13 @@ import { AccordionContent, AccordionItem, AccordionTrigger, - Badge, FormattedNumber, } from '@sushiswap/ui' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' import { FC } from 'react' +import React from 'react' +import { ChainId } from 'sushi/chain' import { formatUSD } from 'sushi/format' +import { PortfolioInfoRow } from '../PortfolioInfoRow' interface PortfolioFuroClaimablesProps { claimables: PortfolioFuroClaim[] @@ -23,47 +24,40 @@ export const PortfolioFuroClaimables: FC = ({ {claimables.map(({ position, token }) => ( -
-
-
- - } - > - {token.symbol - -
-
-
+ chainId={token.chainId as ChainId} + icon={ + {token.symbol + } + leftContent={ + +
{token.name}
-
+
{position.name.toUpperCase()}
-
-
-
-
- {formatUSD(token.amountUSD)} -
-
- {' '} - {token.symbol} -
-
-
+ + } + rightContent={ + +
+ {formatUSD(token.amountUSD)} +
+
+ {' '} + {token.symbol} +
+
+ } + /> ))} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioALMPositions.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioALMPositions.tsx index c2753afcbd..6016b98409 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioALMPositions.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioALMPositions.tsx @@ -3,12 +3,12 @@ import { AccordionContent, AccordionItem, AccordionTrigger, - Badge, Currency, } from '@sushiswap/ui' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' import React, { FC } from 'react' +import { ChainId } from 'sushi/chain' import { formatUSD } from 'sushi/format' +import { PortfolioInfoRow } from '../PortfolioInfoRow' interface PortfolioALMPositionsProps { positions: PortfolioSmartPosition[] @@ -23,50 +23,39 @@ export const PortfolioALMPositions: FC = ({ {positions.map((position) => ( -
-
-
- - } - > - - {position.token0.symbol} - {position.token1.symbol} - - -
-
-
+ chainId={position.chainId as ChainId} + icon={ + + {position.token0.symbol} + {position.token1.symbol} + + } + leftContent={ + +
{position.name}
-
{`V3-${ +
{`V3-${ position.swapFee * 100 }%-${position.strategy}`}
-
-
-
- {formatUSD(position.amountUSD)} -
-
+ + } + rightContent={ + + {formatUSD(position.amountUSD)} + + } + /> ))} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV2Positions.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV2Positions.tsx index 97974671e4..510e30fa98 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV2Positions.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV2Positions.tsx @@ -3,12 +3,12 @@ import { AccordionContent, AccordionItem, AccordionTrigger, - Badge, Currency, } from '@sushiswap/ui' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' import React, { FC } from 'react' +import { ChainId } from 'sushi/chain' import { formatUSD } from 'sushi/format' +import { PortfolioInfoRow } from '../PortfolioInfoRow' interface PortfolioV2PositionssProps { positions: PortfolioV2Position[] @@ -23,48 +23,37 @@ export const PortfolioV2Positions: FC = ({ {positions.map((position) => ( -
-
-
- - } - > - - {position.token0.symbol} - {position.token1.symbol} - - -
-
-
+ chainId={position.chainId as ChainId} + icon={ + + {position.token0.symbol} + {position.token1.symbol} + + } + leftContent={ + +
{position.name}
-
V2-0.30%
-
-
-
- {formatUSD(position.amountUSD)} -
-
+
V2-0.30%
+ + } + rightContent={ + + {formatUSD(position.amountUSD)} + + } + /> ))} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV3Positions.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV3Positions.tsx index 62a5312ca9..a79e7ee991 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV3Positions.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-positions/PortfolioV3Positions.tsx @@ -3,14 +3,14 @@ import { AccordionContent, AccordionItem, AccordionTrigger, - Badge, Currency, classNames, } from '@sushiswap/ui' import { BagIcon } from '@sushiswap/ui/icons/BagIcon' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' import React, { FC } from 'react' +import { ChainId } from 'sushi/chain' import { formatUSD } from 'sushi/format' +import { PortfolioInfoRow } from '../PortfolioInfoRow' interface PortfolioV3PositionsProps { positions: PortfolioV3Position[] @@ -25,39 +25,26 @@ export const PortfolioV3Positions: FC = ({ {positions.map((position) => ( -
-
-
- - } - > - - {position.token0.symbol} - {position.token1.symbol} - - -
-
-
+ chainId={position.chainId as ChainId} + icon={ + + {position.token0.symbol} + {position.token1.symbol} + + } + leftContent={ + +
{position.name}
@@ -93,20 +80,22 @@ export const PortfolioV3Positions: FC = ({
-
-
-
-
- {formatUSD(position.amountUSD)} -
-
- - {formatUSD( - position.fees.reduce((sum, fee) => sum + fee.amountUSD, 0), - )} -
-
-
+ + } + rightContent={ + +
+ {formatUSD(position.amountUSD)} +
+
+ + {formatUSD( + position.fees.reduce((sum, fee) => sum + fee.amountUSD, 0), + )} +
+
+ } + /> ))}
diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/PortfolioTokensList.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/PortfolioTokensList.tsx index 6999e5b375..5109f06d80 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/PortfolioTokensList.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/PortfolioTokensList.tsx @@ -1,8 +1,9 @@ import { PortfolioWalletToken } from '@sushiswap/graph-client/data-api' -import { Badge, FormattedNumber, classNames } from '@sushiswap/ui' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' +import { FormattedNumber, classNames } from '@sushiswap/ui' import React, { FC } from 'react' +import { ChainId } from 'sushi/chain' import { formatPercent, formatUSD } from 'sushi/format' +import { PortfolioInfoRow } from '../PortfolioInfoRow' interface PortfolioTokensListProps { tokens: PortfolioWalletToken[] @@ -14,58 +15,51 @@ export const PortfolioTokensList: FC = ({
{tokens.map((token) => { return ( -
-
-
- - } - > - {token.symbol - -
-
-
+ chainId={token.chainId as ChainId} + icon={ + {token.symbol + } + leftContent={ + +
{token.name ?? token.symbol}
-
+
{' '} {token.symbol}
-
-
-
-
- {formatUSD(token.amountUSD)} -
-
0 - ? 'text-green' - : token.price24hChange < 0 - ? 'text-red' - : 'text-muted-foreground', - )} - > - {`${token.price24hChange > 0 ? '+' : ''}${formatPercent( - token.price24hChange, - )}`} -
-
-
+ + } + rightContent={ + +
+ {formatUSD(token.amountUSD)} +
+
0 + ? 'text-green' + : token.price24hChange < 0 + ? 'text-red' + : 'text-muted-foreground', + )} + > + {`${token.price24hChange > 0 ? '+' : ''}${formatPercent( + token.price24hChange, + )}`} +
+
+ } + /> ) })}
diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioApproveTransaction.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioApproveTransaction.tsx new file mode 100644 index 0000000000..d9f29d12f1 --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioApproveTransaction.tsx @@ -0,0 +1,69 @@ +import { LockClosedIcon, Square2StackIcon } from '@heroicons/react/24/outline' +import { PortfolioTransaction } from '@sushiswap/graph-client/data-api' +import { ClipboardController, FormattedNumber } from '@sushiswap/ui' +import { format, fromUnixTime } from 'date-fns' +import { FC } from 'react' +import React from 'react' +import { ChainId } from 'sushi/chain' +import { shortenHash } from 'sushi/format' +import { PortfolioInfoRow } from '../PortfolioInfoRow' + +export const PortfolioApproveTransaction: FC<{ tx: PortfolioTransaction }> = ({ + tx, +}) => { + return ( + + +
+ } + leftContent={ + +
+ Approve +
+ + {({ setCopied }) => ( +
setCopied(tx.txHash)} + onKeyDown={() => setCopied(tx.txHash)} + className="flex items-center gap-x-1 text-xs text-muted-foreground cursor-pointer" + > + TxHash: {shortenHash(tx.txHash)} + +
+ )} +
+
+ } + rightContent={ + +
+ {tx.approve.logoUrl ? ( +
+ {tx.approve.symbol} +
+ ) : null} + + + {' '} + {tx.approve.symbol} + +
+
+ {format(fromUnixTime(tx.timestamp), 'yyyy/MM/dd HH:mm')} +
+
+ } + /> + ) +} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioOtherTransaction.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioOtherTransaction.tsx new file mode 100644 index 0000000000..c8304a2b7e --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioOtherTransaction.tsx @@ -0,0 +1,100 @@ +import { Square2StackIcon } from '@heroicons/react/24/outline' +import { PortfolioTransaction } from '@sushiswap/graph-client/data-api' +import { ClipboardController, FormattedNumber } from '@sushiswap/ui' +import { format, fromUnixTime } from 'date-fns' +import React from 'react' +import { FC } from 'react' +import { ChainId } from 'sushi/chain' +import { shortenHash } from 'sushi/format' +import { PortfolioInfoRow } from '../PortfolioInfoRow' + +export const PortfolioOtherTransaction: FC<{ tx: PortfolioTransaction }> = ({ + tx, +}) => { + return ( + + } + leftContent={ + +
+ {tx.functionName} +
+ + {({ setCopied }) => ( +
setCopied(tx.txHash)} + onKeyDown={() => setCopied(tx.txHash)} + className="flex items-center gap-x-1 text-xs text-muted-foreground cursor-pointer" + > + TxHash: {shortenHash(tx.txHash)} + +
+ )} +
+
+ } + rightContent={ + tx.sends.length ? ( + +
+ {tx.sends[0].logoUrl ? ( +
+ {tx.sends[0].symbol} +
+ ) : null} + + + {'-'} + {' '} + {tx.sends[0].symbol} + +
+
+ {format(fromUnixTime(tx.timestamp), 'yyyy/MM/dd HH:mm')} +
+
+ ) : tx.receives.length ? ( + +
+ {tx.receives[0].logoUrl ? ( +
+ {tx.receives[0].symbol} +
+ ) : null} + + + {' '} + {tx.receives[0].symbol} + +
+
+ {format(fromUnixTime(tx.timestamp), 'yyyy/MM/dd HH:mm')} +
+
+ ) : null + } + /> + ) +} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioReceiveTransaction.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioReceiveTransaction.tsx new file mode 100644 index 0000000000..83d299867d --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioReceiveTransaction.tsx @@ -0,0 +1,115 @@ +import { ArrowDownIcon, Square2StackIcon } from '@heroicons/react/24/outline' +import { PortfolioTransaction } from '@sushiswap/graph-client/data-api' +import { ClipboardController, FormattedNumber } from '@sushiswap/ui' +import { format, fromUnixTime } from 'date-fns' +import { FC } from 'react' +import React from 'react' +import { ChainId } from 'sushi/chain' +import { shortenHash } from 'sushi/format' +import { PortfolioInfoRow } from '../PortfolioInfoRow' + +export const PortfolioReceiveTransaction: FC<{ tx: PortfolioTransaction }> = ({ + tx, +}) => { + return ( + + +
+ } + leftContent={ + +
+ Receive +
+ + {({ setCopied }) => ( +
setCopied(tx.txHash)} + onKeyDown={() => setCopied(tx.txHash)} + className="flex items-center gap-x-1 text-xs text-muted-foreground cursor-pointer" + > + TxHash: {shortenHash(tx.txHash)} + +
+ )} +
+
+ } + rightContent={ + tx.receives.length ? ( + +
+ {tx.receives[0].logoUrl ? ( +
+ {tx.receives[0].symbol} +
+ ) : null} + + + {' '} + {tx.receives[0].symbol} + +
+
+ {format(fromUnixTime(tx.timestamp), 'yyyy/MM/dd HH:mm')} +
+
+ ) : null + } + /> + + //
+ //
+ //
+ // + // } + // > + // + // + //
+ //
+ //
+ // Receive + //
+ //
+ // TxHash: {shortenHash(tx.txHash)} + //
+ //
+ //
+ //
+ //
+ //
+ // {tx.receives[0].symbol} + //
+ // + // {' '} + // {tx.receives[0].symbol} + // + //
+ //
...
+ //
+ //
+ ) +} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioSendTransaction.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioSendTransaction.tsx new file mode 100644 index 0000000000..c237a76a4c --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioSendTransaction.tsx @@ -0,0 +1,118 @@ +import { ArrowUpIcon, Square2StackIcon } from '@heroicons/react/24/outline' +import { PortfolioTransaction } from '@sushiswap/graph-client/data-api' +import { ClipboardController, FormattedNumber } from '@sushiswap/ui' +import { format, fromUnixTime } from 'date-fns' +import { FC } from 'react' +import React from 'react' +import { ChainId } from 'sushi/chain' +import { shortenHash } from 'sushi/format' +import { PortfolioInfoRow } from '../PortfolioInfoRow' + +export const PortfolioSendTransaction: FC<{ tx: PortfolioTransaction }> = ({ + tx, +}) => { + return ( + + +
+ } + leftContent={ + +
+ Send +
+ + {({ setCopied }) => ( +
setCopied(tx.txHash)} + onKeyDown={() => setCopied(tx.txHash)} + className="flex items-center gap-x-1 text-xs text-muted-foreground cursor-pointer" + > + TxHash: {shortenHash(tx.txHash)} + +
+ )} +
+
+ } + rightContent={ + tx.sends.length ? ( + +
+ {tx.sends[0].logoUrl ? ( +
+ {tx.sends[0].symbol} +
+ ) : null} + + + {'-'} + {' '} + {tx.sends[0].symbol} + +
+
+ {format(fromUnixTime(tx.timestamp), 'yyyy/MM/dd HH:mm')} +
+
+ ) : null + } + /> + //
+ //
+ //
+ // + // } + // > + // + // + //
+ //
+ //
+ // Send + //
+ //
+ // TxHash: {shortenHash(tx.txHash)} + //
+ //
+ //
+ //
+ //
+ //
+ // {tx.sends[0].symbol} + //
+ // + // {'-'} + // {' '} + // {tx.sends[0].symbol} + // + //
+ //
+ // {format(fromUnixTime(tx.timestamp), 'yyyy/MM/dd HH:mm')} + //
+ //
+ //
+ ) +} diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/index.tsx new file mode 100644 index 0000000000..aa78ef5a89 --- /dev/null +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/index.tsx @@ -0,0 +1,47 @@ +import { getPortfolioHistory } from '@sushiswap/graph-client/data-api' +import { useQuery } from '@tanstack/react-query' +import { Address } from 'viem' +import { useAccount } from 'wagmi' +import { PortfolioApproveTransaction } from './PortfolioApproveTransaction' +import { PortfolioOtherTransaction } from './PortfolioOtherTransaction' +import { PortfolioReceiveTransaction } from './PortfolioReceiveTransaction' +import { PortfolioSendTransaction } from './PortfolioSendTransaction' + +function usePortfolioHistory( + address: Address | undefined, + refetchInterval?: 600_000, +) { + return useQuery({ + queryKey: ['portfolio-history', address], + queryFn: async () => { + const id = address as string + const data = await getPortfolioHistory({ id }) + return data + }, + enabled: !!address, + refetchInterval, + }) +} + +export const PortfolioHistory = () => { + const { address } = useAccount() + const { data } = usePortfolioHistory(address) + + return ( +
+
+ {data?.map((tx) => + tx.category === 'APPROVE' ? ( + + ) : tx.category === 'SEND' ? ( + + ) : tx.category === 'RECEIVE' ? ( + + ) : ( + + ), + )} +
+
+ ) +} diff --git a/packages/graph-client/src/subgraphs/data-api/index.ts b/packages/graph-client/src/subgraphs/data-api/index.ts index 61884eb0e4..839e81a845 100644 --- a/packages/graph-client/src/subgraphs/data-api/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/index.ts @@ -1,4 +1,5 @@ export * from './queries/pools' export * from './queries/portfolio-claimables' +export * from './queries/portfolio-history' export * from './queries/portfolio-positions' export * from './queries/portfolio-wallet' diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio-history.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-history.ts new file mode 100644 index 0000000000..0cd8e55acb --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio-history.ts @@ -0,0 +1,82 @@ +import type { VariablesOf } from 'gql.tada' + +import { request, type RequestOptions } from 'src/lib/request' +import { graphql } from '../graphql' + +export const PortfolioHistoryQuery = graphql( + ` +query PortfolioHistory($id: ID!) { + portfolioHistory(id: $id) { + category + approve { + amount + id + isCore + isScam + isSuspicious + isVerified + logoUrl + name + symbol + type + } + chain + chainId + functionName + gasFeeNative + gasFeeUSD + projectName + protocolLogo + receives { + amount + id + isCore + isScam + isSuspicious + isVerified + logoUrl + name + symbol + type + } + sends { + amount + id + isCore + isScam + isSuspicious + isVerified + logoUrl + name + symbol + type + } + timestamp + txHash + } +} +`, +) + +export type GetPortfolioHistory = VariablesOf + +export async function getPortfolioHistory( + variables: GetPortfolioHistory, + options?: RequestOptions, +) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + + const result = await request( + { url, document: PortfolioHistoryQuery, variables }, + options, + ) + if (result) { + return result.portfolioHistory + } + + throw new Error('No portfolio history') +} + +export type PortfolioHistory = Awaited> + +export type PortfolioTransaction = PortfolioHistory[0] diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index b32d47eb83..02fdfe03d0 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -1,3 +1,40 @@ +type Bucket { + id: ID! + date: Int! + volumeUSD: Float! + volumeUSDUntracked: Float! + liquidityUSD: Float! + feesUSD: Float! + txCount: Int! +} + +type SushiDayBuckets { + v2: [Bucket]! + v3: [Bucket]! +} + +type Query { + dayBuckets(chainId: ID!): SushiDayBuckets! + topPools(chainId: ID!): [TopPool] + pool(address: String!, chainId: Int!, protocol: String!): Pool + portfolioWallet(id: ID!): PortfolioWallet! + portfolioLiquidityPositions(id: ID!): PortfolioPositions! + portfolioClaimables(id: ID!): PortfolioClaimables! + portfolioHistory(id: ID!): [PortfolioTransaction]! + sushiBarStats: SushiBarStats! + sushiBarHistory: SushiBarHistory! + v2LiquidityPositions(user: String!, chainId: Int!): [V2LiquidityPosition]! + v2Swaps(address: String!, chainId: Int!): [V2Swap]! + v2Burns(address: String!, chainId: Int!): [V2Burn]! + v2Mints(address: String!, chainId: Int!): [V2Mint]! + v2Transactions(address: String!, chainId: Int!): [V2Transaction]! + v3Swaps(address: String!, chainId: Int!): [V3Swap] + v3Burns(address: String!, chainId: Int!): [V3Burn] + v3Mints(address: String!, chainId: Int!): [V3Mint] + v3Collects(address: String!, chainId: Int!): [V3Collect] + v3Transactions(address: String!, chainId: Int!): [V3Transaction] +} + type Token { id: ID! address: String! @@ -6,7 +43,7 @@ type Token { decimals: Int! } -type DetailedPool { +type Pool { id: ID! chainId: Int! name: String! @@ -38,10 +75,25 @@ type DetailedPool { hasSmartPool: Boolean! isIncentivized: Boolean! wasIncentivized: Boolean! + incentives: [Incentive]! + vaults: [String]! hourBuckets: [PoolBucket]! dayBuckets: [PoolBucket]! } +type Incentive { + id: ID! + chainId: Int! + chefType: String! + apr: Float! + rewardToken: Token! + rewardPerDay: Float! + poolAddress: String! + pid: Int! + rewarderAddress: String! + rewarderType: String! +} + type PoolBucket { id: ID! date: Int! @@ -51,108 +103,7 @@ type PoolBucket { feesUSD: Float! } -type V2Transaction { - id: ID! - createdAtBlock: String! - createdAtTimestamp: String! - swaps: [V2Swap] - burns: [V2Burn] - mints: [V2Mint] -} - -type V2Burn { - id: ID! - logIndex: String - amountUSD: String - amount1: String - amount0: String - liquidity: String! - sender: ID - transaction: V2Transaction! -} - -type V2Mint { - id: ID! - logIndex: String - amountUSD: String - amount1: String - amount0: String - liquidity: String! - sender: ID - transaction: V2Transaction! -} - -type V2Swap { - id: ID! - logIndex: String - amountUSD: String! - amount1Out: String! - amount0Out: String! - amount1In: String! - amount0In: String! - to: ID! - sender: ID! - transaction: V2Transaction! -} - -type V3Burn { - id: ID! - logIndex: String - amountUSD: String - amount1: String! - amount0: String! - amount: String! - origin: ID! - owner: ID - transaction: V3Transaction! -} - -type V3Collect { - id: ID! - logIndex: String - amountUSD: String - amount1: String! - amount0: String! - owner: ID - transaction: V3Transaction! -} - -type V3Mint { - id: ID! - logIndex: String - amountUSD: String - amount1: String! - amount0: String! - amount: String! - origin: ID! - sender: ID - owner: ID! - transaction: V3Transaction! -} - -type V3Swap { - id: ID! - logIndex: String - amountUSD: String! - amount1: String! - amount0: String! - origin: ID! - recipient: ID! - sender: ID! - transaction: V3Transaction! -} - -type V3Transaction { - id: ID! - blockNumber: String! - timestamp: String! - collects: [V3Collect] - swaps: [V3Swap] - burns: [V3Burn] - mints: [V3Mint] -} - -type Pool { +type TopPool { id: ID! chainId: Int! name: String! @@ -364,6 +315,7 @@ type PortfolioTransaction { chainId: Int chain: String! txHash: String! + timestamp: Int! functionName: String! projectName: String protocolLogo: String @@ -375,20 +327,138 @@ type PortfolioTransaction { gasFeeUSD: Float! } -type Query { - portfolioWallet(id: ID!): PortfolioWallet! - portfolioLiquidityPositions(id: ID!): PortfolioPositions! - portfolioClaimables(id: ID!): PortfolioClaimables! - portfolioHistory(id: ID!): [PortfolioTransaction]! - pools(chainId: ID!): [Pool] - pool(address: String!, chainId: Int!, protocol: String!): DetailedPool - v2Swaps(address: String!, chainId: Int!): [V2Swap] - v2Burns(address: String!, chainId: Int!): [V2Burn] - v2Mints(address: String!, chainId: Int!): [V2Mint] - v2Transactions(address: String!, chainId: Int!): [V2Transaction] - v3Swaps(address: String!, chainId: Int!): [V3Swap] - v3Burns(address: String!, chainId: Int!): [V3Burn] - v3Mints(address: String!, chainId: Int!): [V3Mint] - v3Collects(address: String!, chainId: Int!): [V3Collect] - v3Transactions(address: String!, chainId: Int!): [V3Transaction] +type SushiBarStats { + id: String! + sushiXsushiRatio: Float! + xSushiSushiRatio: Float! + sushiSupply: Float! + xSushiSupply: Float! + apr1m: Float! + apr3m: Float! + apr6m: Float! + apr12m: Float! +} + +type SushiBarBucket { + id: String! + date: Int! + xSushiSupply: Float! + apr1m: Float! + apr3m: Float! + apr6m: Float! + apr12m: Float! +} + +type SushiBarHistory { + hourSnapshots: [SushiBarBucket]! + daySnapshots: [SushiBarBucket]! + weekSnapshots: [SushiBarBucket]! +} + +type V2LiquidityPosition { + user: String! + stakedBalance: String! + unstakedBalance: String! + pool: String! +} + +type V2Burn { + id: ID! + logIndex: String + amountUSD: String + amount1: String + amount0: String + liquidity: String! + sender: ID + transaction: V2Transaction! +} + +type V2Mint { + id: ID! + logIndex: String + amountUSD: String + amount1: String + amount0: String + liquidity: String! + sender: ID + transaction: V2Transaction! +} + +type V2Swap { + id: ID! + logIndex: String + amountUSD: String! + amount1Out: String! + amount0Out: String! + amount1In: String! + amount0In: String! + to: ID! + sender: ID! + transaction: V2Transaction! +} + +type V2Transaction { + swaps: [V2Swap] + burns: [V2Burn] + mints: [V2Mint] + createdAtBlock: String! + createdAtTimestamp: String! + id: ID! +} + +type V3Burn { + id: ID! + logIndex: String + amountUSD: String + amount1: String! + amount0: String! + amount: String! + origin: ID! + owner: ID + transaction: V3Transaction! +} + +type V3Collect { + id: ID! + logIndex: String + amountUSD: String + amount1: String! + amount0: String! + owner: ID + transaction: V3Transaction! +} + +type V3Mint { + id: ID! + logIndex: String + amountUSD: String + amount1: String! + amount0: String! + amount: String! + origin: ID! + sender: ID + owner: ID! + transaction: V3Transaction! +} + +type V3Swap { + id: ID! + logIndex: String + amountUSD: String! + amount1: String! + amount0: String! + origin: ID! + recipient: ID! + sender: ID! + transaction: V3Transaction! +} + +type V3Transaction { + id: ID! + blockNumber: String! + timestamp: String! + collects: [V3Collect] + swaps: [V3Swap] + burns: [V3Burn] + mints: [V3Mint] } \ No newline at end of file diff --git a/packages/sushi/src/format/hash.ts b/packages/sushi/src/format/hash.ts new file mode 100644 index 0000000000..42e7e75ea1 --- /dev/null +++ b/packages/sushi/src/format/hash.ts @@ -0,0 +1,10 @@ +// shorten the checksummed version of the input hash to have 0x + 4 characters at start and end +export function shortenHash(hash: string, characters = 4): string { + try { + return `${hash.substring(0, characters + 2)}...${hash.substring( + hash.length - characters, + )}` + } catch { + throw `Invalid 'hash' parameter '${hash}'.` + } +} diff --git a/packages/sushi/src/format/index.ts b/packages/sushi/src/format/index.ts index 711d0d218b..f2a8879d2d 100644 --- a/packages/sushi/src/format/index.ts +++ b/packages/sushi/src/format/index.ts @@ -1,4 +1,5 @@ export * from './address.js' +export * from './hash.js' export * from './id.js' export * from './number.js' export * from './percent.js' From 7e150548a488271db1a455d9b19d2c3f6ec1a362 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 16 Jul 2024 01:50:29 +0700 Subject: [PATCH 018/139] fix: build --- .../portolio-history/PortfolioApproveTransaction.tsx | 2 +- packages/graph-client/src/subgraphs/data-api/queries/pools.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioApproveTransaction.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioApproveTransaction.tsx index d9f29d12f1..d7aa56768a 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioApproveTransaction.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/PortfolioApproveTransaction.tsx @@ -17,7 +17,7 @@ export const PortfolioApproveTransaction: FC<{ tx: PortfolioTransaction }> = ({ chainId={tx.chainId as ChainId} icon={
- +
} leftContent={ diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pools.ts index 063df0a4f7..7efd214f4e 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pools.ts @@ -6,7 +6,7 @@ import { graphql } from '../graphql' export const PoolsQuery = graphql( ` query Pools($chainId: ID!) { - pools(chainId: $chainId) { + topPools(chainId: $chainId) { chainId id name @@ -48,7 +48,7 @@ export async function getPools(variables: GetPools, options?: RequestOptions) { options, ) if (result) { - return result.pools + return result.topPools } throw new Error('No pools') From c06412f489175f040ea286b1f3df3cb9e2e7ead1 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 16 Jul 2024 02:00:46 +0700 Subject: [PATCH 019/139] style: center portfolio buttons --- .../wagmi/components/user-portfolio/PortfolioDefaultView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx index a241c42bfe..ad7b4ab98b 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx @@ -129,7 +129,7 @@ export const PortfolioDefaultView: FC = ({
-
+
{Object.values(PortfolioTab).map((_tab) => (
- - {data?.v2Positions.length ? ( - - ) : null} - {data?.v3Positions.length ? ( - - ) : null} - {data?.smartPositions.length ? ( - - ) : null} - + {isLoading ? ( +
+
+ +
+ {Array.from({ length: 12 }).map((_, i) => ( +
+
+ + +
+
+
+ + +
+
+ + +
+
+
+ ))} +
+ ) : ( + + {data?.v2Positions.length ? ( + + ) : null} + {data?.v3Positions.length ? ( + + ) : null} + {data?.smartPositions.length ? ( + + ) : null} + + )}
) } diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/index.tsx index df0372b2a5..8cc40543b5 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/index.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portfolio-tokens/index.tsx @@ -1,5 +1,5 @@ import { getPortfolioWallet } from '@sushiswap/graph-client/data-api' -import { SkeletonText, classNames } from '@sushiswap/ui' +import { SkeletonCircle, SkeletonText, classNames } from '@sushiswap/ui' import { useQuery } from '@tanstack/react-query' import React from 'react' import { formatPercent, formatUSD } from 'sushi/format' @@ -35,8 +35,8 @@ export const PortfolioTokens = () => {
{isLoading ? ( <> - - + + ) : ( <> @@ -62,7 +62,29 @@ export const PortfolioTokens = () => {
- {data?.tokens.length ? ( + + {isLoading ? ( +
+ {Array.from({ length: 12 }).map((_, i) => ( +
+ +
+
+ + +
+
+ + +
+
+
+ ))} +
+ ) : data?.tokens.length ? ( ) : null}
diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/index.tsx index aa78ef5a89..00ecb3bc2f 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/index.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/portolio-history/index.tsx @@ -1,4 +1,5 @@ import { getPortfolioHistory } from '@sushiswap/graph-client/data-api' +import { SkeletonCircle, SkeletonText } from '@sushiswap/ui' import { useQuery } from '@tanstack/react-query' import { Address } from 'viem' import { useAccount } from 'wagmi' @@ -25,21 +26,44 @@ function usePortfolioHistory( export const PortfolioHistory = () => { const { address } = useAccount() - const { data } = usePortfolioHistory(address) + const { data, isLoading } = usePortfolioHistory(address) return (
- {data?.map((tx) => - tx.category === 'APPROVE' ? ( - - ) : tx.category === 'SEND' ? ( - - ) : tx.category === 'RECEIVE' ? ( - - ) : ( - - ), + {isLoading ? ( +
+ {Array.from({ length: 12 }).map((_, i) => ( +
+ +
+
+ + +
+
+ + +
+
+
+ ))} +
+ ) : ( + data?.map((tx) => + tx.category === 'APPROVE' ? ( + + ) : tx.category === 'SEND' ? ( + + ) : tx.category === 'RECEIVE' ? ( + + ) : ( + + ), + ) )}
From afb36962e4626a8227db5b2dd47b59206c6a5976 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 19 Jul 2024 00:14:56 +0700 Subject: [PATCH 021/139] chore: portfolio placeholder icons --- .../user-portfolio/PortfolioDefaultView.tsx | 24 +++++-- .../user-portfolio/PortfolioInfoRow.tsx | 2 +- .../user-portfolio/portfolio-tokens/index.tsx | 2 +- .../PortfolioApproveTransaction.tsx | 4 +- .../PortfolioOtherTransaction.tsx | 45 +++++++------ .../PortfolioReceiveTransaction.tsx | 64 ++++-------------- .../PortfolioSendTransaction.tsx | 66 ++++--------------- packages/ui/src/icons/SushiLiteIcon.tsx | 27 ++++++++ 8 files changed, 92 insertions(+), 142 deletions(-) create mode 100644 packages/ui/src/icons/SushiLiteIcon.tsx diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx index dab689281e..1b6bb7dd06 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/PortfolioDefaultView.tsx @@ -4,6 +4,7 @@ import { DocumentDuplicateIcon, LinkIcon, } from '@heroicons/react/24/outline' +import { UserCircleIcon } from '@heroicons/react/24/solid' import { Button, ClipboardController, @@ -67,12 +68,21 @@ export const PortfolioDefaultView: FC = ({
{connector ? ( - + connector.icon ? ( + + ) : ( + + ) ) : ( )} @@ -129,7 +139,7 @@ export const PortfolioDefaultView: FC = ({
-
+
{Object.values(PortfolioTab).map((_tab) => ( + +
+
+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/layout.tsx index b877084cc5..a98cc77a03 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/layout.tsx @@ -1,15 +1,15 @@ -import { Container } from '@sushiswap/ui' +// import { Container } from '@sushiswap/ui' -import { Hero } from '../../pool/hero' +// import { Hero } from '../../pool/hero' export default async function PoolsLayout({ children, }: { children: React.ReactNode }) { return ( <> - + {/* - + */}
{children} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx new file mode 100644 index 0000000000..cdb1770ee6 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx @@ -0,0 +1,55 @@ +import { getPool } from '@sushiswap/graph-client/data-api' +import { Breadcrumb, Container } from '@sushiswap/ui' +import { unstable_cache } from 'next/cache' +import { headers } from 'next/headers' +import { PoolHeader } from 'src/ui/pool/PoolHeader' +import notFound from '../../../../not-found' + +export const metadata = { + title: 'Pool 💦', +} + +export default async function Layout({ + children, + params, +}: { + children: React.ReactNode + params: { chainId: string; address: string } +}) { + const { chainId, address } = params + const pool = await unstable_cache( + async () => + getPool({ chainId: Number(chainId), address, protocol: 'SUSHISWAP_V2' }), + ['pool', `${chainId}:${address}`], + { + revalidate: 60 * 15, + }, + )() + + if (!pool) { + notFound() + } + + const headersList = headers() + const referer = headersList.get('referer') + return ( + <> + + + + + + +
+
+ {children} +
+
+ + ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx new file mode 100644 index 0000000000..9d00340e70 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx @@ -0,0 +1,27 @@ +import { getPool } from '@sushiswap/graph-client/data-api' +import { unstable_cache } from 'next/cache' +import { notFound } from 'next/navigation' + +import { PoolPageV2 } from 'src/ui/pool/PoolPageV2' + +export default async function PoolPage({ + params, +}: { + params: { chainId: string; address: string } +}) { + const { chainId, address } = params + const pool = await unstable_cache( + async () => await getPool({ chainId: Number(chainId), address, protocol: 'SUSHISWAP_V2' }), + ['pool', `${chainId}:${address}`], + { + revalidate: 60 * 3, + }, + )() + + // Rockstar C&D + if (!pool || pool.id === '42161:0x0a4f9962e24893a4a7567e52c1ce37d5482365de') { + notFound() + } + + return +} diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx index 5cb48140af..51dbb78d87 100644 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx +++ b/apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx @@ -29,5 +29,5 @@ export default async function PoolPage({ return } - return + // return } diff --git a/apps/web/src/ui/pool/PoolChartGraph.tsx b/apps/web/src/ui/pool/PoolChartGraph.tsx index 1cffb33cc6..d1d247efae 100644 --- a/apps/web/src/ui/pool/PoolChartGraph.tsx +++ b/apps/web/src/ui/pool/PoolChartGraph.tsx @@ -2,24 +2,24 @@ import { CardContent, + CardDescription, CardHeader, + CardTitle, + SkeletonBox, SkeletonText, classNames, } from '@sushiswap/ui' -import { CardDescription, CardTitle } from '@sushiswap/ui' -import { SkeletonBox } from '@sushiswap/ui' import format from 'date-fns/format' import { FC, useCallback, useMemo } from 'react' -import { usePoolGraphData } from 'src/lib/hooks' import { formatUSD } from 'sushi/format' import tailwindConfig from 'tailwind.config.js' import resolveConfig from 'tailwindcss/resolveConfig' -import { SushiSwapV2ChainId } from 'sushi/config' import { PoolChartPeriod, chartPeriods } from './PoolChartPeriods' import { PoolChartType } from './PoolChartTypes' +import { PoolV1 } from '@sushiswap/graph-client/data-api' import ReactEchartsCore from 'echarts-for-react/lib/core' import { EChartsOption } from 'echarts-for-react/lib/types' import 'echarts/lib/chart/bar' @@ -32,34 +32,20 @@ import 'echarts/lib/visual/seriesColor' interface PoolChartProps { chart: PoolChartType.Volume | PoolChartType.Fees | PoolChartType.TVL period: PoolChartPeriod - address: string - chainId: SushiSwapV2ChainId + pool: PoolV1 | null } const tailwind = resolveConfig(tailwindConfig) -export const PoolChartGraph: FC = ({ - chart, - period, - address, - chainId, -}) => { - const { - data: graphPair, - isInitialLoading: isLoading, - isError, - } = usePoolGraphData({ - poolAddress: address, - chainId, - }) - - const swapFee = graphPair ? graphPair?.swapFee : 0 +export const PoolChartGraph: FC = ({ chart, period, pool }) => { + const isLoading = useMemo(() => !pool, [pool]) const [xData, yData]: [number[], number[]] = useMemo(() => { + const data = (chartPeriods[period] < chartPeriods[PoolChartPeriod.Week] - ? graphPair?.hourSnapshots - : graphPair?.daySnapshots) || [] + ? pool?.poolHourData + : pool?.poolDayData) || [] const currentDate = Math.round(Date.now()) const [x, y] = data.reduce<[number[], number[]]>( @@ -67,7 +53,7 @@ export const PoolChartGraph: FC = ({ if (cur?.date * 1000 >= currentDate - chartPeriods[period]) { acc[0].push(cur?.date) if (chart === PoolChartType.Fees) { - acc[1].push(Number(cur?.volumeUSD * Number(swapFee))) + acc[1].push(Number(cur?.volumeUSD * Number(pool?.swapFee))) } else if (chart === PoolChartType.Volume) { acc[1].push(Number(cur?.volumeUSD)) } else if (chart === PoolChartType.TVL) { @@ -80,13 +66,7 @@ export const PoolChartGraph: FC = ({ ) return [x.reverse(), y.reverse()] - }, [ - chart, - graphPair?.hourSnapshots, - graphPair?.daySnapshots, - period, - swapFee, - ]) + }, [chart, period, pool]) // Transient update for performance const onMouseOver = useCallback( @@ -100,7 +80,7 @@ export const PoolChartGraph: FC = ({ if (valueNodes[1]) { if (chart === PoolChartType.Volume) { - valueNodes[1].innerHTML = formatUSD(value * Number(swapFee)) + valueNodes[1].innerHTML = formatUSD(value * Number(pool?.swapFee)) } } @@ -115,7 +95,7 @@ export const PoolChartGraph: FC = ({ ) } }, - [period, chart, swapFee], + [period, chart, pool?.swapFee], ) const DEFAULT_OPTION: EChartsOption = useMemo( @@ -231,7 +211,7 @@ export const PoolChartGraph: FC = ({ {' '} - {formatUSD(defaultValue * Number(swapFee))} + {formatUSD(defaultValue * Number(pool?.swapFee))} {' '} earned @@ -240,8 +220,6 @@ export const PoolChartGraph: FC = ({ {isLoading ? ( - ) : isError || !xData.length ? ( -
) : (
{format( @@ -259,8 +237,6 @@ export const PoolChartGraph: FC = ({ 'h-[400px] w-full dark:via-slate-800 dark:to-slate-900', )} /> - ) : isError ? ( -
) : ( = ({ address, chainId }) => { +const PoolChartV2: FC = ({ pool }) => { const [chart, setChart] = useState<(typeof charts)[number]>(charts[0]) const [period, setPeriod] = useState(PoolChartPeriod.Month) @@ -47,8 +45,7 @@ const PoolChartV2: FC = ({ address, chainId }) => { ) diff --git a/apps/web/src/ui/pool/PoolComposition.tsx b/apps/web/src/ui/pool/PoolComposition.tsx index 26e340cb73..2c0a5040c4 100644 --- a/apps/web/src/ui/pool/PoolComposition.tsx +++ b/apps/web/src/ui/pool/PoolComposition.tsx @@ -1,7 +1,6 @@ 'use client' -import { Pool } from '@sushiswap/client' -import { SkeletonText } from '@sushiswap/ui' +import { PoolV1 } from '@sushiswap/graph-client/data-api' import { Card, CardContent, @@ -10,31 +9,46 @@ import { CardGroup, CardHeader, CardLabel, - CardTitle, + CardTitle, SkeletonText } from '@sushiswap/ui' -import React, { FC, useMemo } from 'react' -import { usePoolGraphData, useTokenAmountDollarValues } from 'src/lib/hooks' -import { SushiSwapV2ChainId } from 'sushi/config' +import { FC, useMemo } from 'react' +import { useTokenAmountDollarValues } from 'src/lib/hooks' +import { Amount, Token } from 'sushi/currency' import { formatUSD } from 'sushi/format' interface PoolCompositionProps { - pool: Pool + pool: PoolV1 } export const PoolComposition: FC = ({ pool }) => { - const { data, isLoading: isPoolLoading } = usePoolGraphData({ - poolAddress: pool.address, - chainId: pool.chainId as SushiSwapV2ChainId, - }) + const amounts = useMemo(() => { + const token0 = new Token({ + chainId: pool.chainId, + address: pool.token0.address, + decimals: pool.token0.decimals, + symbol: pool.token0.symbol, + name: pool.token0.name, + }) - const amounts = [data?.reserve0, data?.reserve1] + const token1 = new Token({ + chainId: pool.chainId, + address: pool.token1.address, + decimals: pool.token1.decimals, + symbol: pool.token1.symbol, + name: pool.token1.name, + }) + return [ + Amount.fromRawAmount(token0, pool.reserve0), + Amount.fromRawAmount(token1, pool.reserve1), + ] + }, [pool]) const fiatValues = useTokenAmountDollarValues({ chainId: pool.chainId, amounts, }) - const isLoading = isPoolLoading || fiatValues.length !== amounts.length + const isLoading = fiatValues.length !== amounts.length const [reserve0USD, reserve1USD, reserveUSD] = useMemo(() => { if (isLoading) return [0, 0, 0] @@ -54,12 +68,12 @@ export const PoolComposition: FC = ({ pool }) => { Tokens diff --git a/apps/web/src/ui/pool/PoolHeader.tsx b/apps/web/src/ui/pool/PoolHeader.tsx index 32c59fbec2..710cd99f95 100644 --- a/apps/web/src/ui/pool/PoolHeader.tsx +++ b/apps/web/src/ui/pool/PoolHeader.tsx @@ -1,7 +1,6 @@ 'use client' import { ArrowTopRightOnSquareIcon } from '@heroicons/react/20/solid' -import { Pool as PoolV2 } from '@sushiswap/client' import { Button, Currency, @@ -23,11 +22,12 @@ import { formatPercent, shortenAddress } from 'sushi/format' import { SushiSwapV3Pool } from 'sushi/pool/sushiswap-v3' import { APRHoverCard } from './APRHoverCard' +import { PoolV1 } from '@sushiswap/graph-client/data-api' type PoolHeader = { backUrl: string address: string - pool: SushiSwapV3Pool | null | undefined | PoolV2 + pool: SushiSwapV3Pool | null | undefined | PoolV1 apy?: { fees: number | undefined rewards: number | undefined diff --git a/apps/web/src/ui/pool/PoolPageV2.tsx b/apps/web/src/ui/pool/PoolPageV2.tsx index bc8409694e..2c6a0ac93c 100644 --- a/apps/web/src/ui/pool/PoolPageV2.tsx +++ b/apps/web/src/ui/pool/PoolPageV2.tsx @@ -1,32 +1,25 @@ import { Container, Separator } from '@sushiswap/ui' -import { ManageV2LiquidityCard } from 'src/ui/pool/ManageV2LiquidityCard' import { PoolTransactionsV2 } from 'src/ui/pool/PoolTransactionsV2' -import { getPool } from '@sushiswap/client' import { FC } from 'react' -import { SushiSwapV2ChainId } from 'sushi/config' import { PoolChartV2 } from './PoolChartV2' import { PoolComposition } from './PoolComposition' -import { PoolMyRewards } from './PoolMyRewards' -import { PoolPosition } from './PoolPosition' -import { PoolPositionProvider } from './PoolPositionProvider' -import { PoolPositionRewardsProvider } from './PoolPositionRewardsProvider' -import { PoolPositionStakedProvider } from './PoolPositionStakedProvider' import { PoolRewards } from './PoolRewards' import { PoolStats } from './PoolStats' import { UnknownTokenAlert } from './UnknownTokenAlert' +import { getPool } from '@sushiswap/graph-client/data-api' interface PoolPageV2 { pool: Awaited> - tab: 'add' | 'remove' | 'unstake' | 'stake' + } -export const PoolPageV2: FC = ({ pool, tab }) => { +export const PoolPageV2: FC = ({ pool }) => { return (
-
+ {/*
@@ -40,16 +33,13 @@ export const PoolPageV2: FC = ({ pool, tab }) => {
-
+
*/}
- +
diff --git a/apps/web/src/ui/pool/PoolRewards.tsx b/apps/web/src/ui/pool/PoolRewards.tsx index 2492305fb0..77796bed93 100644 --- a/apps/web/src/ui/pool/PoolRewards.tsx +++ b/apps/web/src/ui/pool/PoolRewards.tsx @@ -1,21 +1,22 @@ 'use client' -import { Pool } from '@sushiswap/client' +import { PoolV1 } from '@sushiswap/graph-client/data-api' import { + Card, CardContent, CardCurrencyAmountItem, + CardDescription, CardGroup, CardHeader, CardLabel, CardTitle, } from '@sushiswap/ui' -import { Card, CardDescription } from '@sushiswap/ui' -import React, { FC } from 'react' +import { FC } from 'react' import { incentiveRewardToToken } from 'src/lib/functions' import { ChainId } from 'sushi/chain' import { tryParseAmount } from 'sushi/currency' -export const PoolRewards: FC<{ pool: Pool }> = ({ pool }) => { +export const PoolRewards: FC<{ pool: PoolV1 }> = ({ pool }) => { const incentives = pool.incentives.filter( (incentive) => incentive.rewardPerDay > 0, ) diff --git a/apps/web/src/ui/pool/PoolStats.tsx b/apps/web/src/ui/pool/PoolStats.tsx index a937817a39..5eb6ddf90e 100644 --- a/apps/web/src/ui/pool/PoolStats.tsx +++ b/apps/web/src/ui/pool/PoolStats.tsx @@ -1,6 +1,6 @@ 'use client' -import { Pool } from '@sushiswap/client' +import { PoolV1 } from '@sushiswap/graph-client/data-api' import { Card, CardContent, @@ -9,21 +9,14 @@ import { CardTitle, classNames, } from '@sushiswap/ui' -import { SkeletonText } from '@sushiswap/ui' import { FC } from 'react' -import { usePoolGraphData } from 'src/lib/hooks' -import { SushiSwapV2ChainId } from 'sushi/config' import { formatNumber, formatPercent, formatUSD } from 'sushi/format' interface PoolStats { - pool: Pool + pool: PoolV1 } export const PoolStats: FC = ({ pool }) => { - const { data, isLoading } = usePoolGraphData({ - poolAddress: pool.address, - chainId: pool.chainId as SushiSwapV2ChainId, - }) return ( @@ -34,78 +27,70 @@ export const PoolStats: FC = ({ pool }) => {
Liquidity - {isLoading ? ( - - ) : data ? ( + {pool ? (
- {formatUSD(data.liquidityUSD ?? 0)}{' '} + {formatUSD(pool.liquidityUSD ?? 0)}{' '} 0 ? 'text-green' : 'text-red', + pool.liquidityUSD1dChange > 0 ? 'text-green' : 'text-red', )} > - {data.liquidity1dChange > 0 ? '+' : '-'} - {formatPercent(Math.abs(data.liquidity1dChange))} + {pool.liquidityUSD1dChange > 0 ? '+' : '-'} + {formatPercent(Math.abs(pool.liquidityUSD1dChange))}
) : null}
Volume (24h) - {data ? ( + {pool ? (
- {formatUSD(data.volume1d ?? 0)}{' '} + {formatUSD(pool.volumeUSD1d ?? 0)}{' '} 0 ? 'text-green' : 'text-red', + pool.volumeUSD1dChange > 0 ? 'text-green' : 'text-red', )} > - {data.volume1dChange > 0 ? '+' : '-'} - {formatPercent(Math.abs(data.volume1dChange))} + {pool.volumeUSD1dChange > 0 ? '+' : '-'} + {formatPercent(Math.abs(pool.volumeUSD1dChange))}
- ) : isLoading ? ( - ) : null}
Fees (24h) - {data ? ( + {pool ? (
- {formatUSD(data.fees1d ?? 0)}{' '} + {formatUSD(pool.feesUSD1d ?? 0)}{' '} 0 ? 'text-green' : 'text-red', + pool.feesUSD1dChange > 0 ? 'text-green' : 'text-red', )} > - {data.fees1dChange > 0 ? '+' : '-'} - {formatPercent(Math.abs(data.fees1dChange))} + {pool.feesUSD1dChange > 0 ? '+' : '-'} + {formatPercent(Math.abs(pool.feesUSD1dChange))}
- ) : isLoading ? ( - ) : null}
Transactions (24h) - {data ? ( + {pool ? (
- {formatNumber(data.txCount1d).replace('.00', '')}{' '} + {formatNumber(pool.txCount1d).replace('.00', '')}{' '} 0 ? 'text-green' : 'text-red', + pool.txCount1dChange > 0 ? 'text-green' : 'text-red', )} > - {data.txCount1dChange > 0 ? '+' : '-'} - {formatPercent(Math.abs(data.txCount1dChange))} + {pool.txCount1dChange > 0 ? '+' : '-'} + {formatPercent(Math.abs(pool.txCount1dChange))}
- ) : isLoading ? ( - ) : null}
diff --git a/apps/web/src/ui/pool/PoolTransactionsV2.tsx b/apps/web/src/ui/pool/PoolTransactionsV2.tsx index f0671bca49..9494d73281 100644 --- a/apps/web/src/ui/pool/PoolTransactionsV2.tsx +++ b/apps/web/src/ui/pool/PoolTransactionsV2.tsx @@ -1,26 +1,26 @@ 'use client' -import { Pool } from '@sushiswap/client' import { Card, CardContent, CardHeader, CardTitle, DataTable, + Toggle, } from '@sushiswap/ui' -import { Toggle } from '@sushiswap/ui' import { useQuery } from '@tanstack/react-query' import { PaginationState } from '@tanstack/react-table' -import React, { FC, useMemo, useState } from 'react' +import { FC, useMemo, useState } from 'react' import { Chain, ChainId } from 'sushi/chain' import { SushiSwapV2ChainId, isSushiSwapV2ChainId } from 'sushi/config' import { + PoolV1, getSushiV2Burns, getSushiV2Mints, getSushiV2Swaps, - getSushiV2Transactions, -} from '@sushiswap/graph-client/sushi-v2' +} from '@sushiswap/graph-client/data-api' + import { TX_AMOUNT_IN_V2_COLUMN, TX_AMOUNT_OUT_V2_COLUMN, @@ -42,56 +42,10 @@ interface UseTransactionsV2Opts { skip?: number } -const fetchAll = async ( - poolId: string, - chainId: SushiSwapV2ChainId, - opts: UseTransactionsV2Opts, -) => { - const transactions = await getSushiV2Transactions({ - chainId, - first: opts.first, - skip: opts?.skip ?? 0, - where: { - or: [ - { - mints_: { - pair: poolId.toLowerCase(), - }, - }, - { - burns_: { - pair: poolId.toLowerCase(), - amount0_not: null, - amount1_not: null, - sender_not: null, - }, - }, - { - swaps_: { - pair: poolId.toLowerCase(), - }, - }, - ], - }, - orderBy: 'timestamp', - orderDirection: 'desc', - }) - - return transactions -} - -const fetchMints = async ( - poolId: string, - chainId: SushiSwapV2ChainId, - opts: UseTransactionsV2Opts, -) => { +const fetchMints = async (address: string, chainId: SushiSwapV2ChainId) => { const mints = await getSushiV2Mints({ chainId, - first: opts.first, - skip: opts?.skip ?? 0, - where: { pair: poolId.toLowerCase() }, - orderBy: 'timestamp', - orderDirection: 'desc', + address, }) return mints.map((mint) => ({ @@ -102,24 +56,10 @@ const fetchMints = async ( })) } -const fetchBurns = async ( - poolId: string, - chainId: SushiSwapV2ChainId, - opts: UseTransactionsV2Opts, -) => { +const fetchBurns = async (address: string, chainId: SushiSwapV2ChainId) => { const burns = await getSushiV2Burns({ chainId, - first: opts.first, - skip: opts?.skip ?? 0, - where: { - pair: poolId.toLowerCase(), - // TODO: disbled for now, according to the types this can never be null so not sure if we need it anymore - // amount0_not: null, - // amount1_not: null, - // sender_not: null, - }, - orderBy: 'timestamp', - orderDirection: 'desc', + address, }) return burns.map((burn) => ({ @@ -130,18 +70,10 @@ const fetchBurns = async ( })) } -const fetchSwaps = async ( - poolId: string, - chainId: SushiSwapV2ChainId, - opts: UseTransactionsV2Opts, -) => { +const fetchSwaps = async (address: string, chainId: SushiSwapV2ChainId) => { const swaps = await getSushiV2Swaps({ chainId, - first: opts.first, - skip: opts?.skip ?? 0, - where: { pair: poolId.toLowerCase() }, - orderBy: 'timestamp', - orderDirection: 'desc', + address, }) return swaps.map((swap) => ({ @@ -155,7 +87,7 @@ const fetchSwaps = async ( // Will only support the last 1k txs // The fact that there are different subtransactions aggregated under one transaction makes paging a bit difficult function useTransactionsV2( - pool: Pool | undefined | null, + pool: PoolV1 | undefined | null, poolId: string, opts: UseTransactionsV2Opts, ) { @@ -166,23 +98,20 @@ function useTransactionsV2( if (!pool || !isSushiSwapV2ChainId(chainId)) return [] - let transactions: Awaited> + let transactions switch (opts.type) { - case 'All': - transactions = await fetchAll(poolId, chainId, opts) + case TransactionType.Burn: + transactions = await fetchBurns(poolId, chainId) break case TransactionType.Mint: - transactions = await fetchMints(poolId, chainId, opts) - break - case TransactionType.Burn: - transactions = await fetchBurns(poolId, chainId, opts) + transactions = await fetchMints(poolId, chainId) break case TransactionType.Swap: - transactions = await fetchSwaps(poolId, chainId, opts) + transactions = await fetchSwaps(poolId, chainId) break default: - transactions = await fetchAll(poolId, chainId, opts) + transactions = await fetchSwaps(poolId, chainId) } if (!transactions.length) return [] @@ -225,7 +154,9 @@ function useTransactionsV2( return [...mints, ...burns, ...swaps] .flatMap((subtransaction) => ({ - pool, + symbol0: pool.token0.symbol, + symbol1: pool.token1.symbol, + chainId, txHash: transaction.id, createdAtTimestamp: Number(transaction.createdAtTimestamp), createdAtBlock: Number(transaction.createdAtBlock), @@ -244,7 +175,7 @@ function useTransactionsV2( type Transaction = NonNullable['data']>[0] interface PoolTransactionsV2Props { - pool: Pool | undefined | null + pool: PoolV1 | undefined | null poolId: string } @@ -322,7 +253,7 @@ const PoolTransactionsV2: FC = ({ pool, poolId }) => { - Chain.from(row.pool.chainId)?.getTxUrl(row.txHash) ?? '' + Chain.from(row.chainId)?.getTxUrl(row.txHash) ?? '' } loading={isLoading} columns={COLUMNS} diff --git a/apps/web/src/ui/pool/UnknownTokenAlert.tsx b/apps/web/src/ui/pool/UnknownTokenAlert.tsx index da4115678e..36e37e46e6 100644 --- a/apps/web/src/ui/pool/UnknownTokenAlert.tsx +++ b/apps/web/src/ui/pool/UnknownTokenAlert.tsx @@ -1,6 +1,6 @@ 'use client' -import { Pool } from '@sushiswap/client' +import { PoolV1 } from '@sushiswap/graph-client/data-api' import { useCustomTokens } from '@sushiswap/hooks' import { Message } from '@sushiswap/ui' import { FC, useMemo } from 'react' @@ -9,10 +9,10 @@ import { ChainId } from 'sushi/chain' import { shortenAddress } from 'sushi/format' interface UnknownTokenAlert { - pool: Pool + pool: PoolV1 } -const tokenName = (token: Pool['token0']) => +const tokenName = (token: PoolV1['token0']) => token.name ? `${token.name} (${token.symbol})` : shortenAddress(token.address) export const UnknownTokenAlert: FC = ({ pool }) => { diff --git a/apps/web/src/ui/pool/columns.tsx b/apps/web/src/ui/pool/columns.tsx index 3dc34fa428..604d509c95 100644 --- a/apps/web/src/ui/pool/columns.tsx +++ b/apps/web/src/ui/pool/columns.tsx @@ -399,8 +399,8 @@ export const TX_AMOUNT_IN_V2_COLUMN = ( } />{' '} {row.original.amount0In !== '0' - ? row.original.pool.token0.symbol - : row.original.pool.token1.symbol} + ? row.original.symbol0 + : row.original.symbol1 } ) case TransactionType.Mint: @@ -408,7 +408,7 @@ export const TX_AMOUNT_IN_V2_COLUMN = ( return ( {' '} - {row.original.pool.token0.symbol} + {row.original.symbol0} ) } @@ -436,8 +436,8 @@ export const TX_AMOUNT_OUT_V2_COLUMN = ( ).toPrecision(2)} />{' '} {row.original.amount0Out !== '0' - ? row.original.pool.token0.symbol - : row.original.pool.token1.symbol} + ? row.original.symbol0 + : row.original.symbol1} ) case TransactionType.Mint: @@ -445,7 +445,7 @@ export const TX_AMOUNT_OUT_V2_COLUMN = ( return ( {' '} - {row.original.pool.token1.symbol} + {row.original.symbol1} ) } diff --git a/packages/graph-client/src/subgraphs/data-api/index.ts b/packages/graph-client/src/subgraphs/data-api/index.ts index 4ba322f11e..1fa8372637 100644 --- a/packages/graph-client/src/subgraphs/data-api/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/index.ts @@ -1,2 +1 @@ -export * from './queries/pool/top-pools' -export * from './queries/portfolio' +export * from './queries' diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/pool.ts index 51902e4c43..35a1cd349a 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/pool.ts @@ -1,12 +1,26 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { + ChainId, + ChefType, + RewarderType, + SushiSwapProtocol, + withoutScientificNotation, + type PoolBase, + type PoolHistory1D, + type PoolV2, + type PoolWithAprs, + type PoolWithBuckets, + type PoolWithIncentives, +} from 'sushi' +import { isSushiSwapV2ChainId, isSushiSwapV3ChainId } from 'sushi/config' +import type { Address } from 'viem' import { graphql } from '../../graphql' - export const PoolQuery = graphql( ` query Pool($address: String!, $chainId: Int!, $protocol: String!) { - pool(address: $address, chainId: $chainId, protocol: $protocol) { + pool(address: $address, chainId: $chainId, protocol: $protocol) { id chainId name @@ -15,18 +29,18 @@ export const PoolQuery = graphql( swapFee protocol token0 { - id - address - name - symbol - decimals + id + address + name + symbol + decimals } token1 { - id - address - name - symbol - decimals + id + address + name + symbol + decimals } source reserve0 @@ -51,66 +65,155 @@ export const PoolQuery = graphql( isIncentivized wasIncentivized incentives { - id - chainId - chefType - apr - rewardToken { + id + chainId + chefType + apr + rewardToken { id address name symbol decimals - } - rewardPerDay - poolAddress - pid - rewarderAddress - rewarderType + } + rewardPerDay + poolAddress + pid + rewarderAddress + rewarderType } vaults - hour { - id - date - volumeUSD - liquidityUSD - txCount - feesUSD + hourBuckets { + id + date + volumeUSD + liquidityUSD + txCount + feesUSD } - day { - id - date - volumeUSD - liquidityUSD - txCount - feesUSD + dayBuckets { + id + date + volumeUSD + liquidityUSD + txCount + feesUSD } - } + } } `, ) -export type GetPool = VariablesOf< - typeof PoolQuery -> +export type GetPool = VariablesOf -export async function getPool( - variables: GetPool, - options?: RequestOptions, -) { +export async function getPool(variables: GetPool, options?: RequestOptions) { const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const chainId = Number(variables.chainId) as ChainId + + if (!isSushiSwapV2ChainId(chainId) && !isSushiSwapV3ChainId(chainId)) { + throw new Error('Invalid chainId') + } + + const result = await request({ url, document: PoolQuery, variables }, options) + if (result.pool) { + const pool = result.pool + if (result.pool.protocol === SushiSwapProtocol.SUSHISWAP_V2) { + return { + id: pool.id as `${string}:0x${string}`, + address: pool.address as Address, + chainId, + name: `${pool.token0.symbol}-${pool.token1.symbol}`, + swapFee: pool.swapFee, + protocol: SushiSwapProtocol.SUSHISWAP_V2, + reserve0: BigInt( + withoutScientificNotation( + ( + Number(pool.reserve0) * + 10 ** Number(pool.token0.decimals) + ).toFixed(), + )!, + ), + reserve1: BigInt( + withoutScientificNotation( + ( + Number(pool.reserve1) * + 10 ** Number(pool.token1.decimals) + ).toFixed(), + )!, + ), - const result = await request( - { url, document: PoolQuery, variables }, - options, - ) - if (result) { - return result.pool + liquidity: BigInt( + withoutScientificNotation( + (Number(pool.liquidity) * 10 ** 18).toFixed(), + )!, + ), + liquidityUSD: pool.liquidityUSD, + + volumeUSD: pool.volumeUSD, + feesUSD: pool.volumeUSD * 0.003, + + token0: { + id: pool.token0.id as `${string}:0x${string}`, + address: pool.token0.address as Address, + chainId, + decimals: pool.token0.decimals, + name: pool.token0.name, + symbol: pool.token0.symbol, + }, + token1: { + id: pool.token1.id as `${string}:0x${string}`, + address: pool.token1.address as Address, + chainId, + decimals: pool.token1.decimals, + name: pool.token1.name, + symbol: pool.token1.symbol, + }, + token0Price: pool.token0Price, + token1Price: pool.token1Price, + txCount: pool.txCount1d, + + volumeUSD1d: pool.volumeUSD1d, + feesUSD1d: pool.feeUSD1d, + txCount1d: pool.txCount1d, + liquidityUSD1dChange: pool.liquidityUSD1dChange, + volumeUSD1dChange: pool.volumeUSD1dChange, + feesUSD1dChange: pool.feeUSD1dChange, + txCount1dChange: pool.txCount1dChange, + + feeApr1d: pool.feeApr1d, + totalApr1d: pool.totalApr1d, + incentiveApr: pool.incentiveApr, + isIncentivized: pool.isIncentivized, + wasIncentivized: pool.wasIncentivized, + + incentives: pool.incentives.map((incentive) => ({ + id: incentive.id as `${string}:0x${string}`, + chainId, + chefType: incentive.chefType as ChefType, + apr: incentive.apr, + rewardToken: { + id: incentive.rewardToken.id as `${string}:0x${string}`, + address: incentive.rewardToken.address as Address, + chainId, + decimals: incentive.rewardToken.decimals, + name: incentive.rewardToken.name, + symbol: incentive.rewardToken.symbol, + }, + rewardPerDay: incentive.rewardPerDay, + poolAddress: incentive.poolAddress as Address, + pid: incentive.pid, + rewarderAddress: incentive.rewarderAddress as Address, + rewarderType: incentive.rewarderType as RewarderType, + })), + poolHourData: pool.hourBuckets, + poolDayData: pool.dayBuckets, + } satisfies PoolWithBuckets< + PoolWithAprs>>> + > + } } throw new Error('No pool found') } -export type PoolV1 = Awaited< - ReturnType -> +export type PoolV1 = Awaited> diff --git a/packages/sushi/src/types/sushi-pool/pool-with-aprs.ts b/packages/sushi/src/types/sushi-pool/pool-with-aprs.ts index cc65841e5b..1d024c5a5a 100644 --- a/packages/sushi/src/types/sushi-pool/pool-with-aprs.ts +++ b/packages/sushi/src/types/sushi-pool/pool-with-aprs.ts @@ -10,15 +10,15 @@ export type PoolWithIncentiveApr = T & { } export type PoolWithFeeAprs = T & { - feeApr1h: number + // feeApr1h: number feeApr1d: number - feeApr1w: number - feeApr1m: number + // feeApr1w: number + // feeApr1m: number } export type PoolWithTotalAprs = T & { - totalApr1h: number + // totalApr1h: number totalApr1d: number - totalApr1w: number - totalApr1m: number + // totalApr1w: number + // totalApr1m: number } From e5edb0d4ad075ae225f815b40c536a44cf3d18ac Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Sun, 21 Jul 2024 18:08:51 +0200 Subject: [PATCH 024/139] refactor: v3 page, use data api --- .../pool/v2/[address]/(landing)/layout.tsx | 4 +- .../pool/v2/[address]/(landing)/page.tsx | 4 +- .../pool/v3/[address]/(landing)/layout.tsx | 55 +++++ .../pool/v3/[address]/(landing)/page.tsx | 27 +++ apps/web/src/ui/pool/PoolChartGraph.tsx | 4 +- apps/web/src/ui/pool/PoolPageV2.tsx | 4 +- apps/web/src/ui/pool/PoolPageV3.tsx | 93 ++------ .../ui/pool/PoolRewardDistributionsCard.tsx | 4 +- apps/web/src/ui/pool/PoolTransactionsV2.tsx | 6 +- apps/web/src/ui/pool/PoolTransactionsV3.tsx | 117 ++-------- ...tisticsChart.tsx => StatisticsChartV3.tsx} | 11 +- .../subgraphs/data-api/queries/pool/index.ts | 3 +- .../subgraphs/data-api/queries/pool/pool.ts | 219 ----------------- .../data-api/queries/pool/v2-pool.ts | 200 ++++++++++++++++ .../data-api/queries/pool/v3-pool.ts | 220 ++++++++++++++++++ .../src/subgraphs/data-api/schema.graphql | 63 ++++- 16 files changed, 615 insertions(+), 419 deletions(-) create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/layout.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx rename apps/web/src/ui/pool/{StatisticsChart.tsx => StatisticsChartV3.tsx} (87%) delete mode 100644 packages/graph-client/src/subgraphs/data-api/queries/pool/pool.ts create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx index cdb1770ee6..ce5ef98fb2 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx @@ -1,4 +1,4 @@ -import { getPool } from '@sushiswap/graph-client/data-api' +import { getV2Pool } from '@sushiswap/graph-client/data-api' import { Breadcrumb, Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' import { headers } from 'next/headers' @@ -19,7 +19,7 @@ export default async function Layout({ const { chainId, address } = params const pool = await unstable_cache( async () => - getPool({ chainId: Number(chainId), address, protocol: 'SUSHISWAP_V2' }), + getV2Pool({ chainId: Number(chainId), address }), ['pool', `${chainId}:${address}`], { revalidate: 60 * 15, diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx index 9d00340e70..41f4d0e083 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx @@ -1,4 +1,4 @@ -import { getPool } from '@sushiswap/graph-client/data-api' +import { getV2Pool } from '@sushiswap/graph-client/data-api' import { unstable_cache } from 'next/cache' import { notFound } from 'next/navigation' @@ -11,7 +11,7 @@ export default async function PoolPage({ }) { const { chainId, address } = params const pool = await unstable_cache( - async () => await getPool({ chainId: Number(chainId), address, protocol: 'SUSHISWAP_V2' }), + async () => await getV2Pool({ chainId: Number(chainId), address }), ['pool', `${chainId}:${address}`], { revalidate: 60 * 3, diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/layout.tsx new file mode 100644 index 0000000000..604abfafaa --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/layout.tsx @@ -0,0 +1,55 @@ +import { getV3Pool } from '@sushiswap/graph-client/data-api' +import { Breadcrumb, Container } from '@sushiswap/ui' +import { unstable_cache } from 'next/cache' +import { headers } from 'next/headers' +import { PoolHeader } from 'src/ui/pool/PoolHeader' +import notFound from '../../../../not-found' + +export const metadata = { + title: 'Pool 💦', +} + +export default async function Layout({ + children, + params, +}: { + children: React.ReactNode + params: { chainId: string; address: string } +}) { + const { chainId, address } = params + const pool = await unstable_cache( + async () => + getV3Pool({ chainId: Number(chainId), address }), + ['pool', `${chainId}:${address}`], + { + revalidate: 60 * 15, + }, + )() + + if (!pool) { + notFound() + } + + const headersList = headers() + const referer = headersList.get('referer') + return ( + <> + + + + + + +
+
+ {children} +
+
+ + ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx new file mode 100644 index 0000000000..c329268625 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx @@ -0,0 +1,27 @@ +import { getV3Pool } from '@sushiswap/graph-client/data-api' +import { unstable_cache } from 'next/cache' +import { notFound } from 'next/navigation' + +import { PoolPageV3 } from 'src/ui/pool/PoolPageV3' + +export default async function PoolPage({ + params, +}: { + params: { chainId: string; address: string } +}) { + const { chainId, address } = params + const pool = await unstable_cache( + async () => await getV3Pool({ chainId: Number(chainId), address }), + ['pool', `${chainId}:${address}`], + { + revalidate: 60 * 3, + }, + )() + + // Rockstar C&D + if (!pool || pool.id === '42161:0x0a4f9962e24893a4a7567e52c1ce37d5482365de') { + notFound() + } + + return +} diff --git a/apps/web/src/ui/pool/PoolChartGraph.tsx b/apps/web/src/ui/pool/PoolChartGraph.tsx index d1d247efae..312ff3fd4f 100644 --- a/apps/web/src/ui/pool/PoolChartGraph.tsx +++ b/apps/web/src/ui/pool/PoolChartGraph.tsx @@ -19,7 +19,7 @@ import resolveConfig from 'tailwindcss/resolveConfig' import { PoolChartPeriod, chartPeriods } from './PoolChartPeriods' import { PoolChartType } from './PoolChartTypes' -import { PoolV1 } from '@sushiswap/graph-client/data-api' +import { V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' import ReactEchartsCore from 'echarts-for-react/lib/core' import { EChartsOption } from 'echarts-for-react/lib/types' import 'echarts/lib/chart/bar' @@ -32,7 +32,7 @@ import 'echarts/lib/visual/seriesColor' interface PoolChartProps { chart: PoolChartType.Volume | PoolChartType.Fees | PoolChartType.TVL period: PoolChartPeriod - pool: PoolV1 | null + pool: V2Pool | V3Pool | null } const tailwind = resolveConfig(tailwindConfig) diff --git a/apps/web/src/ui/pool/PoolPageV2.tsx b/apps/web/src/ui/pool/PoolPageV2.tsx index 2c6a0ac93c..4e97921a13 100644 --- a/apps/web/src/ui/pool/PoolPageV2.tsx +++ b/apps/web/src/ui/pool/PoolPageV2.tsx @@ -7,10 +7,10 @@ import { PoolComposition } from './PoolComposition' import { PoolRewards } from './PoolRewards' import { PoolStats } from './PoolStats' import { UnknownTokenAlert } from './UnknownTokenAlert' -import { getPool } from '@sushiswap/graph-client/data-api' +import { V2Pool } from '@sushiswap/graph-client/data-api' interface PoolPageV2 { - pool: Awaited> + pool: Awaited } diff --git a/apps/web/src/ui/pool/PoolPageV3.tsx b/apps/web/src/ui/pool/PoolPageV3.tsx index 7380375f2a..ed66c6aea5 100644 --- a/apps/web/src/ui/pool/PoolPageV3.tsx +++ b/apps/web/src/ui/pool/PoolPageV3.tsx @@ -1,40 +1,34 @@ 'use client' -import { getPool } from '@sushiswap/client' +import { V3Pool } from '@sushiswap/graph-client/data-api' import { useConcentratedLiquidityPoolStats } from '@sushiswap/react-query' -import { CardLabel, Separator, SkeletonText, classNames } from '@sushiswap/ui' -import { Container, LinkInternal, Message } from '@sushiswap/ui' import { Card, CardContent, CardCurrencyAmountItem, CardDescription, CardHeader, + CardLabel, CardTitle, + Container, + LinkInternal, + Message, + Separator, + SkeletonText, + classNames, } from '@sushiswap/ui' -import { Toggle } from '@sushiswap/ui' -import React, { FC, useState } from 'react' +import { FC } from 'react' import { useTokenAmountDollarValues } from 'src/lib/hooks' import { useConcentratedLiquidityPool } from 'src/lib/wagmi/hooks/pools/hooks/useConcentratedLiquidityPool' import { useConcentratedLiquidityPoolReserves } from 'src/lib/wagmi/hooks/pools/hooks/useConcentratedLiquidityPoolReserves' import { SushiSwapV3ChainId } from 'sushi/config' import { formatUSD } from 'sushi/format' -import { Address } from 'viem' import { ConcentratedLiquidityProvider } from './ConcentratedLiquidityProvider' -import { ConcentratedPositionsTable } from './ConcentratedPositionsTable' import { PoolRewardDistributionsCard } from './PoolRewardDistributionsCard' import { PoolTransactionsV3 } from './PoolTransactionsV3' -import { PoolsFiltersProvider } from './PoolsFiltersProvider' -import { StatisticsCharts } from './StatisticsChart' +import { StatisticsChartsV3 } from './StatisticsChartV3' -enum Granularity { - Day = 0, - Week = 1, -} - -const PoolPageV3: FC<{ pool: Awaited> }> = ({ - pool, -}) => { +const PoolPageV3: FC<{ pool: Awaited }> = ({ pool }) => { return ( @@ -42,11 +36,10 @@ const PoolPageV3: FC<{ pool: Awaited> }> = ({ ) } -const Pool: FC<{ pool: Awaited> }> = ({ pool }) => { +const Pool: FC<{ pool: Awaited }> = ({ pool }) => { const { id } = pool const [_chainId, address] = id.split(':') const chainId = +_chainId as SushiSwapV3ChainId - const [granularity, setGranularity] = useState(Granularity.Day) const { data: poolStats } = useConcentratedLiquidityPoolStats({ chainId, @@ -86,18 +79,18 @@ const Pool: FC<{ pool: Awaited> }> = ({ pool }) => { )} - + {/* - + */}
- +
@@ -124,24 +117,6 @@ const Pool: FC<{ pool: Awaited> }> = ({ pool }) => {
Statistics -
- setGranularity(Granularity.Day)} - > - 24H - - setGranularity(Granularity.Week)} - > - 1W - -
@@ -151,29 +126,16 @@ const Pool: FC<{ pool: Awaited> }> = ({ pool }) => { Volume {poolStats ? (
- {formatUSD( - granularity === Granularity.Week - ? poolStats.volumeUSD1w - : poolStats.volumeUSD1d ?? 0, - )}{' '} + {formatUSD(poolStats.volumeUSD1d ?? 0)}{' '} 0 + poolStats['volumeUSD1dChange'] > 0 ? 'text-green' : 'text-red', )} > - ( - {poolStats[ - granularity === Granularity.Week - ? 'volumeUSD1wChange' - : 'volumeUSD1dChange' - ].toFixed(2)} + ({poolStats['volumeUSD1dChange'].toFixed(2)} %)
@@ -185,29 +147,16 @@ const Pool: FC<{ pool: Awaited> }> = ({ pool }) => { Fees {poolStats ? (
- {formatUSD( - granularity === Granularity.Week - ? poolStats.feesUSD1w - : poolStats.feesUSD1d ?? 0, - )}{' '} + {formatUSD(poolStats.feesUSD1d ?? 0)}{' '} 0 + poolStats['feesUSD1dChange'] > 0 ? 'text-green' : 'text-red', )} > - ( - {poolStats[ - granularity === Granularity.Week - ? 'feesUSD1wChange' - : 'feesUSD1dChange' - ].toFixed(2)} + ({poolStats['feesUSD1dChange'].toFixed(2)} %)
diff --git a/apps/web/src/ui/pool/PoolRewardDistributionsCard.tsx b/apps/web/src/ui/pool/PoolRewardDistributionsCard.tsx index 7204397130..ddabbeb129 100644 --- a/apps/web/src/ui/pool/PoolRewardDistributionsCard.tsx +++ b/apps/web/src/ui/pool/PoolRewardDistributionsCard.tsx @@ -1,6 +1,5 @@ 'use client' -import { Pool } from '@sushiswap/client' import { useAngleRewards } from '@sushiswap/react-query' import { Button, @@ -22,9 +21,10 @@ import { getAddress } from 'viem' import { isAngleEnabledChainId } from 'sushi/config' import { DistributionDataTable } from './DistributionDataTable' +import { V3Pool } from '@sushiswap/graph-client/data-api' interface PoolRewardDistributionsCardParams { - pool: Pool + pool: V3Pool } export const PoolRewardDistributionsCard: FC< diff --git a/apps/web/src/ui/pool/PoolTransactionsV2.tsx b/apps/web/src/ui/pool/PoolTransactionsV2.tsx index 9494d73281..1b81ece81f 100644 --- a/apps/web/src/ui/pool/PoolTransactionsV2.tsx +++ b/apps/web/src/ui/pool/PoolTransactionsV2.tsx @@ -15,7 +15,7 @@ import { Chain, ChainId } from 'sushi/chain' import { SushiSwapV2ChainId, isSushiSwapV2ChainId } from 'sushi/config' import { - PoolV1, + V2Pool, getSushiV2Burns, getSushiV2Mints, getSushiV2Swaps, @@ -87,7 +87,7 @@ const fetchSwaps = async (address: string, chainId: SushiSwapV2ChainId) => { // Will only support the last 1k txs // The fact that there are different subtransactions aggregated under one transaction makes paging a bit difficult function useTransactionsV2( - pool: PoolV1 | undefined | null, + pool: V2Pool | undefined | null, poolId: string, opts: UseTransactionsV2Opts, ) { @@ -175,7 +175,7 @@ function useTransactionsV2( type Transaction = NonNullable['data']>[0] interface PoolTransactionsV2Props { - pool: PoolV1 | undefined | null + pool: V2Pool | undefined | null poolId: string } diff --git a/apps/web/src/ui/pool/PoolTransactionsV3.tsx b/apps/web/src/ui/pool/PoolTransactionsV3.tsx index 0cd4aeb187..0ca2325476 100644 --- a/apps/web/src/ui/pool/PoolTransactionsV3.tsx +++ b/apps/web/src/ui/pool/PoolTransactionsV3.tsx @@ -1,17 +1,16 @@ 'use client' -import { Pool } from '@sushiswap/client' import { Card, CardContent, CardHeader, CardTitle, DataTable, + Toggle, } from '@sushiswap/ui' -import { Toggle } from '@sushiswap/ui' import { useQuery } from '@tanstack/react-query' import { PaginationState } from '@tanstack/react-table' -import React, { FC, useMemo, useState } from 'react' +import { FC, useMemo, useState } from 'react' import { Chain, ChainId } from 'sushi/chain' import { SushiSwapV3ChainId, isSushiSwapV3ChainId } from 'sushi/config' @@ -20,8 +19,9 @@ import { getSushiV3Collects, getSushiV3Mints, getSushiV3Swaps, - getSushiV3Transactions, -} from '@sushiswap/graph-client/sushi-v3' +} from '@sushiswap/graph-client/data-api' + +import { V3Pool } from '@sushiswap/graph-client/data-api' import { TX_AMOUNT_IN_V3_COLUMN, TX_AMOUNT_OUT_V3_COLUMN, @@ -44,58 +44,10 @@ interface UseTransactionsV3Opts { skip?: number } -const fetchAll = async ( - poolId: string, - chainId: SushiSwapV3ChainId, - opts: UseTransactionsV3Opts, -) => { - const transactions = await getSushiV3Transactions({ - chainId, - first: opts.first, - skip: opts?.skip ?? 0, - where: { - or: [ - { - mints_: { - pool: poolId.toLowerCase(), - }, - }, - { - burns_: { - pool: poolId.toLowerCase(), - }, - }, - { - swaps_: { - pool: poolId.toLowerCase(), - }, - }, - { - collects_: { - pool: poolId.toLowerCase(), - }, - }, - ], - }, - orderBy: 'timestamp', - orderDirection: 'desc', - }) - - return transactions -} - -const fetchMints = async ( - poolId: string, - chainId: SushiSwapV3ChainId, - opts: UseTransactionsV3Opts, -) => { +const fetchMints = async (address: string, chainId: SushiSwapV3ChainId) => { const mints = await getSushiV3Mints({ + address, chainId, - first: opts.first, - skip: opts?.skip ?? 0, - where: { pool: poolId.toLowerCase() }, - orderBy: 'timestamp', - orderDirection: 'desc', }) return mints.map((mint) => ({ @@ -107,18 +59,10 @@ const fetchMints = async ( })) } -const fetchBurns = async ( - poolId: string, - chainId: SushiSwapV3ChainId, - opts: UseTransactionsV3Opts, -) => { +const fetchBurns = async (address: string, chainId: SushiSwapV3ChainId) => { const burns = await getSushiV3Burns({ chainId, - first: opts.first, - skip: opts?.skip ?? 0, - where: { pool: poolId.toLowerCase() }, - orderBy: 'timestamp', - orderDirection: 'desc', + address, }) return burns.map((burn) => ({ @@ -130,18 +74,10 @@ const fetchBurns = async ( })) } -const fetchSwaps = async ( - poolId: string, - chainId: SushiSwapV3ChainId, - opts: UseTransactionsV3Opts, -) => { +const fetchSwaps = async (address: string, chainId: SushiSwapV3ChainId) => { const swaps = await getSushiV3Swaps({ chainId, - first: opts.first, - skip: opts?.skip ?? 0, - where: { pool: poolId.toLowerCase() }, - orderBy: 'timestamp', - orderDirection: 'desc', + address, }) return swaps.map((swap) => ({ @@ -153,18 +89,10 @@ const fetchSwaps = async ( })) } -const fetchCollects = async ( - poolId: string, - chainId: SushiSwapV3ChainId, - opts: UseTransactionsV3Opts, -) => { +const fetchCollects = async (address: string, chainId: SushiSwapV3ChainId) => { const collects = await getSushiV3Collects({ chainId, - first: opts.first, - skip: opts?.skip ?? 0, - where: { pool: poolId.toLowerCase() }, - orderBy: 'timestamp', - orderDirection: 'desc', + address, }) return collects.map((collect) => ({ @@ -179,7 +107,7 @@ const fetchCollects = async ( // Will only support the last 1k txs // The fact that there are different subtransactions aggregated under one transaction makes paging a bit difficult function useTransactionsV3( - pool: Pool | undefined | null, + pool: V3Pool | undefined | null, poolId: string, opts: UseTransactionsV3Opts, ) { @@ -190,26 +118,23 @@ function useTransactionsV3( if (!pool || !isSushiSwapV3ChainId(chainId)) return [] - let transactions: Awaited> = [] + let transactions = [] switch (opts.type) { - case 'All': - transactions = await fetchAll(poolId, chainId, opts) - break case TransactionTypeV3.Mint: - transactions = await fetchMints(poolId, chainId, opts) + transactions = await fetchMints(poolId, chainId) break case TransactionTypeV3.Burn: - transactions = await fetchBurns(poolId, chainId, opts) + transactions = await fetchBurns(poolId, chainId) break case TransactionTypeV3.Swap: - transactions = await fetchSwaps(poolId, chainId, opts) + transactions = await fetchSwaps(poolId, chainId) break case TransactionTypeV3.Collect: - transactions = await fetchCollects(poolId, chainId, opts) + transactions = await fetchCollects(poolId, chainId) break default: - transactions = await fetchAll(poolId, chainId, opts) + transactions = await fetchSwaps(poolId, chainId) } if (!transactions.length) return [] @@ -278,7 +203,7 @@ type TransactionV3 = NonNullable< >[0] interface PoolTransactionsV3Props { - pool: Pool | undefined | null + pool: V3Pool | undefined | null poolId: string } diff --git a/apps/web/src/ui/pool/StatisticsChart.tsx b/apps/web/src/ui/pool/StatisticsChartV3.tsx similarity index 87% rename from apps/web/src/ui/pool/StatisticsChart.tsx rename to apps/web/src/ui/pool/StatisticsChartV3.tsx index 4035d111ae..95b0d528d4 100644 --- a/apps/web/src/ui/pool/StatisticsChart.tsx +++ b/apps/web/src/ui/pool/StatisticsChartV3.tsx @@ -5,6 +5,7 @@ import { LiquidityDepthWidget } from './LiquidityDepthWidget' import { PoolChartGraph } from './PoolChartGraph' import { PoolChartPeriod, PoolChartPeriods } from './PoolChartPeriods' import { PoolChartType, PoolChartTypes } from './PoolChartTypes' +import { V3Pool } from '@sushiswap/graph-client/data-api' const statisticsChart = [ PoolChartType.Volume, @@ -16,9 +17,10 @@ const statisticsChart = [ interface Charts { address: string chainId: SushiSwapV3ChainId + pool: V3Pool } -export const StatisticsCharts: FC = ({ address, chainId }) => { +export const StatisticsChartsV3: FC = ({ address, chainId, pool }) => { const [chart, setChart] = useState(statisticsChart[0]) const [period, setPeriod] = useState(PoolChartPeriod.Month) @@ -51,12 +53,7 @@ export const StatisticsCharts: FC = ({ address, chainId }) => { {chart === PoolChartType.Depth ? ( ) : ( - + )}
) diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/index.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/index.ts index 8c6fbbff48..b513c926d2 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/index.ts @@ -1,2 +1,3 @@ export * from './top-pools' -export * from './pool' \ No newline at end of file +export * from './v2-pool' +export * from './v3-pool' \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/pool.ts deleted file mode 100644 index 35a1cd349a..0000000000 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/pool.ts +++ /dev/null @@ -1,219 +0,0 @@ -import type { VariablesOf } from 'gql.tada' - -import { request, type RequestOptions } from 'src/lib/request' -import { - ChainId, - ChefType, - RewarderType, - SushiSwapProtocol, - withoutScientificNotation, - type PoolBase, - type PoolHistory1D, - type PoolV2, - type PoolWithAprs, - type PoolWithBuckets, - type PoolWithIncentives, -} from 'sushi' -import { isSushiSwapV2ChainId, isSushiSwapV3ChainId } from 'sushi/config' -import type { Address } from 'viem' -import { graphql } from '../../graphql' -export const PoolQuery = graphql( - ` - query Pool($address: String!, $chainId: Int!, $protocol: String!) { - pool(address: $address, chainId: $chainId, protocol: $protocol) { - id - chainId - name - address - createdAt - swapFee - protocol - token0 { - id - address - name - symbol - decimals - } - token1 { - id - address - name - symbol - decimals - } - source - reserve0 - reserve1 - liquidity - volumeUSD - liquidityUSD - token0Price - token1Price - volumeUSD1d - feeUSD1d - txCount1d - feeApr1d - totalApr1d - volumeUSD1dChange - feeUSD1dChange - txCount1dChange - liquidityUSD1dChange - incentiveApr - hadSmartPool - hasSmartPool - isIncentivized - wasIncentivized - incentives { - id - chainId - chefType - apr - rewardToken { - id - address - name - symbol - decimals - } - rewardPerDay - poolAddress - pid - rewarderAddress - rewarderType - } - vaults - hourBuckets { - id - date - volumeUSD - liquidityUSD - txCount - feesUSD - } - dayBuckets { - id - date - volumeUSD - liquidityUSD - txCount - feesUSD - } - } - } -`, -) - -export type GetPool = VariablesOf - -export async function getPool(variables: GetPool, options?: RequestOptions) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` - const chainId = Number(variables.chainId) as ChainId - - if (!isSushiSwapV2ChainId(chainId) && !isSushiSwapV3ChainId(chainId)) { - throw new Error('Invalid chainId') - } - - const result = await request({ url, document: PoolQuery, variables }, options) - if (result.pool) { - const pool = result.pool - if (result.pool.protocol === SushiSwapProtocol.SUSHISWAP_V2) { - return { - id: pool.id as `${string}:0x${string}`, - address: pool.address as Address, - chainId, - name: `${pool.token0.symbol}-${pool.token1.symbol}`, - swapFee: pool.swapFee, - protocol: SushiSwapProtocol.SUSHISWAP_V2, - reserve0: BigInt( - withoutScientificNotation( - ( - Number(pool.reserve0) * - 10 ** Number(pool.token0.decimals) - ).toFixed(), - )!, - ), - reserve1: BigInt( - withoutScientificNotation( - ( - Number(pool.reserve1) * - 10 ** Number(pool.token1.decimals) - ).toFixed(), - )!, - ), - - liquidity: BigInt( - withoutScientificNotation( - (Number(pool.liquidity) * 10 ** 18).toFixed(), - )!, - ), - liquidityUSD: pool.liquidityUSD, - - volumeUSD: pool.volumeUSD, - feesUSD: pool.volumeUSD * 0.003, - - token0: { - id: pool.token0.id as `${string}:0x${string}`, - address: pool.token0.address as Address, - chainId, - decimals: pool.token0.decimals, - name: pool.token0.name, - symbol: pool.token0.symbol, - }, - token1: { - id: pool.token1.id as `${string}:0x${string}`, - address: pool.token1.address as Address, - chainId, - decimals: pool.token1.decimals, - name: pool.token1.name, - symbol: pool.token1.symbol, - }, - token0Price: pool.token0Price, - token1Price: pool.token1Price, - txCount: pool.txCount1d, - - volumeUSD1d: pool.volumeUSD1d, - feesUSD1d: pool.feeUSD1d, - txCount1d: pool.txCount1d, - liquidityUSD1dChange: pool.liquidityUSD1dChange, - volumeUSD1dChange: pool.volumeUSD1dChange, - feesUSD1dChange: pool.feeUSD1dChange, - txCount1dChange: pool.txCount1dChange, - - feeApr1d: pool.feeApr1d, - totalApr1d: pool.totalApr1d, - incentiveApr: pool.incentiveApr, - isIncentivized: pool.isIncentivized, - wasIncentivized: pool.wasIncentivized, - - incentives: pool.incentives.map((incentive) => ({ - id: incentive.id as `${string}:0x${string}`, - chainId, - chefType: incentive.chefType as ChefType, - apr: incentive.apr, - rewardToken: { - id: incentive.rewardToken.id as `${string}:0x${string}`, - address: incentive.rewardToken.address as Address, - chainId, - decimals: incentive.rewardToken.decimals, - name: incentive.rewardToken.name, - symbol: incentive.rewardToken.symbol, - }, - rewardPerDay: incentive.rewardPerDay, - poolAddress: incentive.poolAddress as Address, - pid: incentive.pid, - rewarderAddress: incentive.rewarderAddress as Address, - rewarderType: incentive.rewarderType as RewarderType, - })), - poolHourData: pool.hourBuckets, - poolDayData: pool.dayBuckets, - } satisfies PoolWithBuckets< - PoolWithAprs>>> - > - } - } - - throw new Error('No pool found') -} - -export type PoolV1 = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts new file mode 100644 index 0000000000..26a825a970 --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts @@ -0,0 +1,200 @@ +import type { VariablesOf } from 'gql.tada' + +import { request, type RequestOptions } from 'src/lib/request' +import { + ChainId, + ChefType, + RewarderType, + SushiSwapProtocol, + type PoolBase, + type PoolHistory1D, + type PoolV2, + type PoolWithAprs, + type PoolWithBuckets, + type PoolWithIncentives +} from 'sushi' +import { isSushiSwapV2ChainId } from 'sushi/config' +import type { Address } from 'viem' +import { graphql } from '../../graphql' +export const V2PoolQuery = graphql( + ` + query V2Pool($address: String!, $chainId: Int!) { + v2Pool(address: $address, chainId: $chainId) { + id + chainId + name + address + createdAt + swapFee + protocol + token0 { + id + address + name + symbol + decimals + } + token1 { + id + address + name + symbol + decimals + } + source + reserve0 + reserve1 + liquidity + volumeUSD + liquidityUSD + token0Price + token1Price + volumeUSD1d + feeUSD1d + txCount1d + feeApr1d + totalApr1d + volumeUSD1dChange + feeUSD1dChange + txCount1dChange + liquidityUSD1dChange + incentiveApr + isIncentivized + wasIncentivized + incentives { + id + chainId + chefType + apr + rewardToken { + id + address + name + symbol + decimals + } + rewardPerDay + poolAddress + pid + rewarderAddress + rewarderType + } + hourBuckets { + id + date + volumeUSD + liquidityUSD + txCount + feesUSD + } + dayBuckets { + id + date + volumeUSD + liquidityUSD + txCount + feesUSD + } + } + } +`, +) + +export type GetV2Pool = VariablesOf + +export async function getV2Pool( + variables: GetV2Pool, + options?: RequestOptions, +) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const chainId = Number(variables.chainId) as ChainId + + if (!isSushiSwapV2ChainId(chainId)) { + throw new Error('Invalid chainId') + } + + const result = await request( + { url, document: V2PoolQuery, variables }, + options, + ) + if (result.v2Pool) { + const pool = result.v2Pool + return { + id: pool.id as `${string}:0x${string}`, + address: pool.address as Address, + chainId, + name: `${pool.token0.symbol}-${pool.token1.symbol}`, + swapFee: pool.swapFee, + protocol: SushiSwapProtocol.SUSHISWAP_V2, + reserve0: BigInt(pool.reserve0), + reserve1: BigInt(pool.reserve1), + liquidity: BigInt(pool.liquidity), + liquidityUSD: pool.liquidityUSD, + + volumeUSD: pool.volumeUSD, + feesUSD: pool.volumeUSD * pool.swapFee, + + token0: { + id: pool.token0.id as `${string}:0x${string}`, + address: pool.token0.address as Address, + chainId, + decimals: pool.token0.decimals, + name: pool.token0.name, + symbol: pool.token0.symbol, + }, + token1: { + id: pool.token1.id as `${string}:0x${string}`, + address: pool.token1.address as Address, + chainId, + decimals: pool.token1.decimals, + name: pool.token1.name, + symbol: pool.token1.symbol, + }, + token0Price: pool.token0Price, + token1Price: pool.token1Price, + txCount: pool.txCount1d, + + volumeUSD1d: pool.volumeUSD1d, + feesUSD1d: pool.feeUSD1d, + txCount1d: pool.txCount1d, + liquidityUSD1dChange: pool.liquidityUSD1dChange, + volumeUSD1dChange: pool.volumeUSD1dChange, + feesUSD1dChange: pool.feeUSD1dChange, + txCount1dChange: pool.txCount1dChange, + + feeApr1d: pool.feeApr1d, + totalApr1d: pool.totalApr1d, + incentiveApr: pool.incentiveApr, + isIncentivized: pool.isIncentivized, + wasIncentivized: pool.wasIncentivized, + + incentives: pool.incentives.map((incentive) => ({ + id: incentive.id as `${string}:0x${string}`, + chainId, + chefType: incentive.chefType as ChefType, + apr: incentive.apr, + rewardToken: { + id: incentive.rewardToken.id as `${string}:0x${string}`, + address: incentive.rewardToken.address as Address, + chainId, + decimals: incentive.rewardToken.decimals, + name: incentive.rewardToken.name, + symbol: incentive.rewardToken.symbol, + }, + rewardPerDay: incentive.rewardPerDay, + poolAddress: incentive.poolAddress as Address, + pid: incentive.pid, + rewarderAddress: incentive.rewarderAddress as Address, + rewarderType: incentive.rewarderType as RewarderType, + })), + poolHourData: result.v2Pool.hourBuckets, + poolDayData: pool.dayBuckets, + } satisfies PoolWithBuckets< + PoolWithAprs>>> + > + } + + throw new Error('No pool found') +} + +export type V2Pool = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts new file mode 100644 index 0000000000..6ebc84380c --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts @@ -0,0 +1,220 @@ +import type { VariablesOf } from 'gql.tada' + +import type { PoolHasSteerVaults } from '@sushiswap/steer-sdk' +import { request, type RequestOptions } from 'src/lib/request' +import { + ChainId, + ChefType, + RewarderType, + SushiSwapProtocol, + type PoolBase, + type PoolHistory1D, + type PoolV3, + type PoolWithAprs, + type PoolWithBuckets, + type PoolWithIncentives +} from 'sushi' +import { isSushiSwapV3ChainId } from 'sushi/config' +import type { Address } from 'viem' +import { graphql } from '../../graphql' +export const V3PoolQuery = graphql( + ` + query V3Pool($address: String!, $chainId: Int!) { + v3Pool(address: $address, chainId: $chainId) { + id + chainId + name + address + createdAt + swapFee + protocol + token0 { + id + address + name + symbol + decimals + } + token1 { + id + address + name + symbol + decimals + } + source + reserve0 + reserve1 + liquidity + sqrtPrice + tick + observationIndex + feeGrowthGlobal0X128 + feeGrowthGlobal1X128 + volumeUSD + liquidityUSD + token0Price + token1Price + volumeUSD1d + feeUSD1d + txCount1d + feeApr1d + totalApr1d + volumeUSD1dChange + feeUSD1dChange + txCount1dChange + liquidityUSD1dChange + incentiveApr + hadSmartPool + hasSmartPool + isIncentivized + wasIncentivized + incentives { + id + chainId + chefType + apr + rewardToken { + id + address + name + symbol + decimals + } + rewardPerDay + poolAddress + pid + rewarderAddress + rewarderType + } + vaults + hourBuckets { + id + date + volumeUSD + liquidityUSD + txCount + feesUSD + } + dayBuckets { + id + date + volumeUSD + liquidityUSD + txCount + feesUSD + } + } + } +`, +) + +export type GetV3Pool = VariablesOf + +export async function getV3Pool( + variables: GetV3Pool, + options?: RequestOptions, +) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const chainId = Number(variables.chainId) as ChainId + + if (!isSushiSwapV3ChainId(chainId)) { + throw new Error('Invalid chainId') + } + + const result = await request( + { url, document: V3PoolQuery, variables }, + options, + ) + if (result.v3Pool) { + const incentives = result.v3Pool.incentives.filter((i) => i !== null) + const pool = result.v3Pool + return { + id: pool.id as `${string}:0x${string}`, + address: pool.address as Address, + chainId, + name: `${pool.token0.symbol}-${pool.token1.symbol}`, + swapFee: pool.swapFee, + protocol: SushiSwapProtocol.SUSHISWAP_V3, + reserve0: BigInt(pool.reserve0), + reserve1: BigInt(pool.reserve1), + liquidity: BigInt(pool.liquidity), + + sqrtPrice: BigInt(pool.sqrtPrice), + tick: BigInt(pool.tick), + observationIndex: BigInt(pool.observationIndex), + feeGrowthGlobal0X128: BigInt(pool.feeGrowthGlobal0X128), + feeGrowthGlobal1X128: BigInt(pool.feeGrowthGlobal1X128), + + liquidityUSD: pool.liquidityUSD, + volumeUSD: pool.volumeUSD, + feesUSD: pool.volumeUSD * pool.swapFee, + + token0: { + id: pool.token0.id as `${string}:0x${string}`, + address: pool.token0.address as Address, + chainId, + decimals: pool.token0.decimals, + name: pool.token0.name, + symbol: pool.token0.symbol, + }, + token1: { + id: pool.token1.id as `${string}:0x${string}`, + address: pool.token1.address as Address, + chainId, + decimals: pool.token1.decimals, + name: pool.token1.name, + symbol: pool.token1.symbol, + }, + token0Price: pool.token0Price, + token1Price: pool.token1Price, + txCount: pool.txCount1d, + + volumeUSD1d: pool.volumeUSD1d, + feesUSD1d: pool.feeUSD1d, + txCount1d: pool.txCount1d, + liquidityUSD1dChange: pool.liquidityUSD1dChange, + volumeUSD1dChange: pool.volumeUSD1dChange, + feesUSD1dChange: pool.feeUSD1dChange, + txCount1dChange: pool.txCount1dChange, + + feeApr1d: pool.feeApr1d, + totalApr1d: pool.totalApr1d, + incentiveApr: pool.incentiveApr, + isIncentivized: pool.isIncentivized, + wasIncentivized: pool.wasIncentivized, + hasEnabledSteerVault: pool.hasSmartPool, + hadEnabledSteerVault: pool.hadSmartPool, + + incentives: incentives.map((incentive) => ({ + id: incentive.id as `${string}:0x${string}`, + chainId, + chefType: incentive.chefType as ChefType, + apr: incentive.apr, + rewardToken: { + id: incentive.rewardToken.id as `${string}:0x${string}`, + address: incentive.rewardToken.address as Address, + chainId, + decimals: incentive.rewardToken.decimals, + name: incentive.rewardToken.name, + symbol: incentive.rewardToken.symbol, + }, + rewardPerDay: incentive.rewardPerDay, + poolAddress: incentive.poolAddress as Address, + pid: incentive.pid, + rewarderAddress: incentive.rewarderAddress as Address, + rewarderType: incentive.rewarderType as RewarderType, + })), + poolHourData: pool.hourBuckets.filter((bucket) => bucket !== null), + poolDayData: pool.dayBuckets.filter((bucket) => bucket !== null), + } satisfies PoolWithBuckets< + PoolHasSteerVaults< + PoolWithAprs>>> + > + > + } + + throw new Error('No pool found') +} + +export type V3Pool = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index c81e24e55d..408802e7d8 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -15,8 +15,9 @@ type SushiDayBuckets { type Query { sushiDayBuckets(chainId: Int!): SushiDayBuckets! - topPools(chainId: Int!): [TopPool] - pool(address: String!, chainId: Int!, protocol: String!): Pool + topPools(chainId: Int!): [TopPool]! + v2Pool(address: String!, chainId: Int!): V2Pool! + v3Pool(address: String!, chainId: Int!): V3Pool! portfolioWallet(id: ID!): PortfolioWallet! portfolioLiquidityPositions(id: ID!): PortfolioPositions! portfolioClaimables(id: ID!): PortfolioClaimables! @@ -30,11 +31,11 @@ type Query { v2Burns(address: String!, chainId: Int!): [V2Burn]! v2Mints(address: String!, chainId: Int!): [V2Mint]! v2Transactions(address: String!, chainId: Int!): [V2Transaction]! - v3Swaps(address: String!, chainId: Int!): [V3Swap] - v3Burns(address: String!, chainId: Int!): [V3Burn] - v3Mints(address: String!, chainId: Int!): [V3Mint] - v3Collects(address: String!, chainId: Int!): [V3Collect] - v3Transactions(address: String!, chainId: Int!): [V3Transaction] + v3Swaps(address: String!, chainId: Int!): [V3Swap]! + v3Burns(address: String!, chainId: Int!): [V3Burn]! + v3Mints(address: String!, chainId: Int!): [V3Mint]! + v3Collects(address: String!, chainId: Int!): [V3Collect]! + v3Transactions(address: String!, chainId: Int!): [V3Transaction]! } type Token { @@ -45,7 +46,7 @@ type Token { decimals: Int! } -type Pool { +type V2Pool { id: ID! chainId: Int! name: String! @@ -56,9 +57,49 @@ type Pool { token0: Token! token1: Token! source: String! - reserve0: Float! - reserve1: Float! - liquidity: Float! + reserve0: String! + reserve1: String! + liquidity: String! + volumeUSD: Float! + liquidityUSD: Float! + token0Price: Float! + token1Price: Float! + volumeUSD1d: Float! + feeUSD1d: Float! + txCount1d: Int! + feeApr1d: Float! + totalApr1d: Float! + volumeUSD1dChange: Float! + feeUSD1dChange: Float! + txCount1dChange: Float! + liquidityUSD1dChange: Float! + incentiveApr: Float! + isIncentivized: Boolean! + wasIncentivized: Boolean! + incentives: [Incentive]! + hourBuckets: [PoolBucket]! + dayBuckets: [PoolBucket]! +} + +type V3Pool { + id: ID! + chainId: Int! + name: String! + address: String! + createdAt: String! + swapFee: Float! + protocol: String! + token0: Token! + token1: Token! + source: String! + reserve0: String! + reserve1: String! + liquidity: String! + sqrtPrice: String! + tick: String! + observationIndex: String! + feeGrowthGlobal0X128: String! + feeGrowthGlobal1X128: String! volumeUSD: Float! liquidityUSD: Float! token0Price: Float! From 77fb588ec8d6f6979e0467b437cb4b2043f2950a Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Mon, 22 Jul 2024 10:53:45 +0200 Subject: [PATCH 025/139] refactor: sushi-bar use data api --- apps/web/src/lib/stake/use-bar-chart-data.ts | 2 +- apps/web/src/lib/stake/use-bar-data.ts | 4 +-- .../data-api/queries/sushi-bar/stats.ts | 29 ------------------- 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/apps/web/src/lib/stake/use-bar-chart-data.ts b/apps/web/src/lib/stake/use-bar-chart-data.ts index 0a211b677c..b3d7108cf9 100644 --- a/apps/web/src/lib/stake/use-bar-chart-data.ts +++ b/apps/web/src/lib/stake/use-bar-chart-data.ts @@ -1,6 +1,6 @@ 'use client' -import { getSushiBarHistory } from '@sushiswap/graph-client/sushi-bar' +import { getSushiBarHistory } from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' export const useBarChartData = (enabled = true) => { diff --git a/apps/web/src/lib/stake/use-bar-data.ts b/apps/web/src/lib/stake/use-bar-data.ts index f8f0c0bc42..a081363869 100644 --- a/apps/web/src/lib/stake/use-bar-data.ts +++ b/apps/web/src/lib/stake/use-bar-data.ts @@ -1,12 +1,12 @@ 'use client' -import { getSushiBar } from '@sushiswap/graph-client/sushi-bar' +import { getSushiBarStats } from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' export const useBarData = (enabled = true) => { return useQuery({ queryKey: ['useBarData'], - queryFn: async () => await getSushiBar({}), + queryFn: async () => await getSushiBarStats({}), keepPreviousData: true, staleTime: 30000, cacheTime: 86400000, // 24hs diff --git a/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts b/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts index 2aa3ac02a8..0a10eac699 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts @@ -17,35 +17,6 @@ query SushiBarStats { apr6m apr12m } - sushiBarStats { - hourSnapshots { - id - date - xSushiSupply - apr1m - apr3m - apr6m - apr12m - } - daySnapshots { - id - date - xSushiSupply - apr1m - apr3m - apr6m - apr12m - } - weekSnapshots { - id - date - xSushiSupply - apr1m - apr3m - apr6m - apr12m - } - } } `, From e6a5e239cb3e7b435509ada6a997e1b466a26fc6 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Mon, 22 Jul 2024 20:11:16 +0200 Subject: [PATCH 026/139] refactor: use data api for smart pools --- apps/web/src/ui/pool/SmartPoolsTable.tsx | 129 +++++++++++++---------- 1 file changed, 76 insertions(+), 53 deletions(-) diff --git a/apps/web/src/ui/pool/SmartPoolsTable.tsx b/apps/web/src/ui/pool/SmartPoolsTable.tsx index 374827f908..8a1b0752cb 100644 --- a/apps/web/src/ui/pool/SmartPoolsTable.tsx +++ b/apps/web/src/ui/pool/SmartPoolsTable.tsx @@ -10,7 +10,6 @@ import { MinusIcon, PlusIcon, } from '@heroicons/react/24/outline' -import { SteerVaults } from '@sushiswap/client' import { Badge, Button, @@ -45,13 +44,17 @@ import { SortingState, TableState, } from '@tanstack/react-table' -import React, { useMemo, useState } from 'react' +import { useMemo, useState } from 'react' import { Native, Token, unwrapToken } from 'sushi/currency' import { formatPercent, formatUSD } from 'sushi/format' -import { useSteerVaults } from '@sushiswap/client/hooks' +import { SteerStrategy } from '@prisma/client' +import { SmartPoolsV1, getSmartPools } from '@sushiswap/graph-client/data-api' +import { useQuery } from '@tanstack/react-query' import Link from 'next/link' +import { ChainId, SushiSwapProtocol } from 'sushi' import { isAngleEnabledChainId } from 'sushi/config' +import { Address } from 'viem' import { APRHoverCard } from './APRHoverCard' import { ProtocolBadge } from './PoolNameCell' import { usePoolFilters } from './PoolsFiltersProvider' @@ -112,7 +115,7 @@ const COLUMNS = [ - {ProtocolBadge[original.pool.protocol]} + {ProtocolBadge[original.protocol as SushiSwapProtocol]}

Protocol version

@@ -123,7 +126,7 @@ const COLUMNS = [
- {formatPercent(original.pool.swapFee)} + {formatPercent(original.swapFee)}
@@ -131,7 +134,7 @@ const COLUMNS = [
- {original.pool.isIncentivized && ( + {original.isIncentivized && ( @@ -157,11 +160,12 @@ const COLUMNS = [ - {original.isDeprecated && ( + + {/* {original.isDeprecated && (
Deprecated
- )} + )} */}
@@ -194,7 +198,11 @@ const COLUMNS = [ -

{SteerStrategyConfig[original.strategy].description}

+

+ {' '} + {SteerStrategyConfig[original.strategy as SteerStrategy] + .description ?? ''} +

@@ -206,21 +214,21 @@ const COLUMNS = [ { id: 'liquidityUSD', header: 'TVL', - accessorFn: (row) => row.reserveUSD, + accessorFn: (row) => row.vaultLiquidityUSD, cell: ({ row: { original } }) => ( - {formatUSD(original.pool.liquidityUSD).includes('NaN') + {formatUSD(original.liquidityUSD).includes('NaN') ? '$0.00' - : formatUSD(original.pool.liquidityUSD)} + : formatUSD(original.liquidityUSD)} - {formatUSD(original.reserveUSD).includes('NaN') + {formatUSD(original.vaultLiquidityUSD).includes('NaN') ? '$0.00' - : formatUSD(original.reserveUSD)} + : formatUSD(original.vaultLiquidityUSD)} @@ -237,11 +245,11 @@ const COLUMNS = [ { id: 'fees1d', header: 'Fees (24h)', - accessorFn: (row) => row.pool.feesUSD1d, + accessorFn: (row) => row.feeUSD1d, cell: (props) => - formatUSD(props.row.original.pool.feesUSD1d).includes('NaN') + formatUSD(props.row.original.feeUSD1d).includes('NaN') ? '$0.00' - : formatUSD(props.row.original.pool.feesUSD1d), + : formatUSD(props.row.original.feeUSD1d), meta: { skeleton: , }, @@ -249,18 +257,15 @@ const COLUMNS = [ { id: 'totalApr1d', header: 'APR (24h)', - accessorFn: (row) => (row.apr1d + row.pool.incentiveApr) * 100, + accessorFn: (row) => row.stakedAndIncentiveApr1d, cell: (props) => { - const totalAPR = - (props.row.original.apr1d + props.row.original.pool.incentiveApr) * 100 - return (
- {formatPercent(props.row.original.pool.totalApr1d)} + {formatPercent(props.row.original.feeAndIncentiveApr1d)} @@ -269,11 +274,20 @@ const COLUMNS = [ - {formatPercent(totalAPR / 100)} + {formatPercent(props.row.original.stakedAndIncentiveApr1d)}
@@ -286,7 +300,7 @@ const COLUMNS = [ { id: 'actions', cell: ({ row }) => - row.original.pool.protocol === 'SUSHISWAP_V3' ? ( + row.original.protocol === 'SUSHISWAP_V3' ? (
)}
diff --git a/apps/web/src/ui/pool/SmartPoolsTable.tsx b/apps/web/src/ui/pool/SmartPoolsTable.tsx index 8a1b0752cb..f74c80b622 100644 --- a/apps/web/src/ui/pool/SmartPoolsTable.tsx +++ b/apps/web/src/ui/pool/SmartPoolsTable.tsx @@ -48,7 +48,6 @@ import { useMemo, useState } from 'react' import { Native, Token, unwrapToken } from 'sushi/currency' import { formatPercent, formatUSD } from 'sushi/format' -import { SteerStrategy } from '@prisma/client' import { SmartPoolsV1, getSmartPools } from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' import Link from 'next/link' @@ -520,7 +519,7 @@ const COLUMNS = [ ] satisfies ColumnDef[] export const SmartPoolsTable = () => { - const { tokenSymbols, chainIds, protocols, farmsOnly } = usePoolFilters() + const { _tokenSymbols, chainIds, protocols, farmsOnly } = usePoolFilters() const [sorting, setSorting] = useState([ { id: 'liquidityUSD', desc: true }, ]) @@ -529,16 +528,6 @@ export const SmartPoolsTable = () => { pageSize: 10, }) - // const { data: vaults, isValidating: isValidatingVaults } = useSteerVaults({ - // args: { - // chainIds: chainIds, - // orderBy: 'reserveUSD', - // orderDir: 'desc', - // onlyEnabled: true, - // tokenSymbols, - // }, - // }) - const { data: vaults, isLoading: isValidatingVaults } = useQuery({ queryKey: ['useSmartPools', { chainId: chainIds[0] }], queryFn: async () => await getSmartPools({ chainId: chainIds[0] }), diff --git a/apps/web/src/ui/pool/Steer/SteerCarousel.tsx b/apps/web/src/ui/pool/Steer/SteerCarousel.tsx index 2d5febcf6c..65307b0903 100644 --- a/apps/web/src/ui/pool/Steer/SteerCarousel.tsx +++ b/apps/web/src/ui/pool/Steer/SteerCarousel.tsx @@ -3,15 +3,15 @@ import { Carousel, SkeletonBox } from '@sushiswap/ui' import { FC, useCallback, useMemo } from 'react' -import { SteerVault } from '@sushiswap/steer-sdk' import type { PoolWithFeeAprs, PoolWithIncentives } from 'sushi/types' import { SteerPoolCard } from './SteerPoolCard' +import { VaultV1 } from '@sushiswap/graph-client/data-api' type RequiredPool = PoolWithIncentives interface SteerCarousel { pool: RequiredPool - vaults: SteerVault[] + vaults: VaultV1[] } export const SteerCarousel: FC = ({ pool, vaults }) => { @@ -19,9 +19,8 @@ export const SteerCarousel: FC = ({ pool, vaults }) => { () => vaults.filter((vault) => vault.isEnabled), [vaults], ) - const render = useCallback( - (vault: SteerVault) => { + (vault: VaultV1) => { return (
diff --git a/apps/web/src/ui/pool/Steer/SteerPoolCard.tsx b/apps/web/src/ui/pool/Steer/SteerPoolCard.tsx index aba37a710e..db9958ef4c 100644 --- a/apps/web/src/ui/pool/Steer/SteerPoolCard.tsx +++ b/apps/web/src/ui/pool/Steer/SteerPoolCard.tsx @@ -14,16 +14,16 @@ import { import { FC } from 'react' import { formatPercent, formatUSD } from 'sushi/format' -import { SteerVault } from '@sushiswap/steer-sdk' import type { PoolWithFeeAprs, PoolWithIncentives } from 'sushi/types' import { APRHoverCard } from '../APRHoverCard' import { SteerAPRChart } from './SteerAPRChart' import { SteerLiquidityDistributionWidget } from './SteerLiquidityDistributionWidget/SteerLiquidityDistributionWidget' import { SteerStrategyConfig } from './constants' +import { VaultV1 } from '@sushiswap/graph-client/data-api' interface SteerPoolCardProps { pool: PoolWithIncentives - vault: SteerVault + vault: VaultV1 } export const SteerPoolCard: FC = ({ pool, vault }) => { diff --git a/apps/web/src/ui/pool/Steer/SteerStrategies/SteerBaseStrategy.tsx b/apps/web/src/ui/pool/Steer/SteerStrategies/SteerBaseStrategy.tsx index 0b2d82b2cb..0adc928a8e 100644 --- a/apps/web/src/ui/pool/Steer/SteerStrategies/SteerBaseStrategy.tsx +++ b/apps/web/src/ui/pool/Steer/SteerStrategies/SteerBaseStrategy.tsx @@ -34,6 +34,7 @@ import { SteerStrategyLiquidityDistribution } from '../SteerStrategyLiquidityCha import { SteerStrategyConfig } from '../constants' export const SteerBaseStrategy: SteerStrategyComponent = ({ + pool, vault, generic: { priceExtremes, tokenRatios, adjustment, positions }, }) => { @@ -127,9 +128,9 @@ export const SteerBaseStrategy: SteerStrategyComponent = ({ Total APR (24h) - + - {formatPercent(vault.apr1d + vault.pool.incentiveApr)} + {formatPercent(vault.apr1d + pool.incentiveApr)} @@ -169,7 +170,7 @@ export const SteerBaseStrategy: SteerStrategyComponent = ({ Liquidity pool fee - {formatPercent(vault.pool.swapFee)} + {formatPercent(pool.swapFee)} {/* @@ -204,7 +205,7 @@ export const SteerBaseStrategy: SteerStrategyComponent = ({
diff --git a/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts b/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts index 1901bfa13f..cc3333fc2e 100644 --- a/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts +++ b/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts @@ -1,14 +1,10 @@ -import { SteerStrategy } from '@sushiswap/database' +import { SteerStrategy } from '@sushiswap/steer-sdk' import { FC } from 'react' -import { SteerVault, SteerVaultWithPool } from '@sushiswap/steer-sdk' -import type { - PoolIfIncentivized, - PoolSwapFee, - PoolWithFeeAprs, - PoolWithIncentiveApr, -} from 'sushi/types' +import { SteerVault } from '@sushiswap/steer-sdk' + import { SteerBaseStrategy } from './SteerBaseStrategy' +import { V3Pool } from '@sushiswap/graph-client/data-api' export interface SteerStrategyGeneric { tokenRatios: { @@ -31,10 +27,8 @@ export interface SteerStrategyGeneric { } export type SteerStrategyComponent = FC<{ - vault: SteerVaultWithPool< - SteerVault, - PoolIfIncentivized>> - > + pool: V3Pool + vault: SteerVault generic: SteerStrategyGeneric }> diff --git a/apps/web/src/ui/pool/Steer/constants.tsx b/apps/web/src/ui/pool/Steer/constants.tsx index df4ddc1e4d..4727d0af50 100644 --- a/apps/web/src/ui/pool/Steer/constants.tsx +++ b/apps/web/src/ui/pool/Steer/constants.tsx @@ -1,4 +1,4 @@ -import { SteerStrategy } from '@sushiswap/client' +import { SteerStrategy } from '@sushiswap/steer-sdk' interface SteerStrategyConfig { name: string diff --git a/jobs/pool/src/steer.ts b/jobs/pool/src/steer.ts index c6c886e694..2ce6f4c4f3 100644 --- a/jobs/pool/src/steer.ts +++ b/jobs/pool/src/steer.ts @@ -1,4 +1,5 @@ -import { Prisma, SteerStrategy } from '@sushiswap/database' +import { Prisma } from '@sushiswap/database' +import { SteerStrategy } from '@sushiswap/steer-sdk' import { getSteerVaults } from '@sushiswap/graph-client/steer' import { STEER_SUPPORTED_CHAIN_IDS, diff --git a/packages/client/src/api/steer-vault/vaults.ts b/packages/client/src/api/steer-vault/vaults.ts index 7da0aaef86..2ec7c7aec4 100644 --- a/packages/client/src/api/steer-vault/vaults.ts +++ b/packages/client/src/api/steer-vault/vaults.ts @@ -241,7 +241,7 @@ export async function getSteerVaultsFromDB( reserveUSD: Number(vault.reserveUSD), feesUSD: Number(vault.feesUSD), - strategy: vault.strategy, + strategy: vault.strategy as any, payloadHash: vault.payloadHash, // description: vault.description, // state: vault.state diff --git a/packages/client/src/hooks/steer-vault/index.ts b/packages/client/src/hooks/steer-vault/index.ts index ac590d37b4..44c3cd8edf 100644 --- a/packages/client/src/hooks/steer-vault/index.ts +++ b/packages/client/src/hooks/steer-vault/index.ts @@ -1,4 +1,4 @@ export * from './count' export * from './vault' export * from './vaults' -export { SteerStrategy } from '@sushiswap/database' + diff --git a/packages/client/src/pure/steer-vault/index.ts b/packages/client/src/pure/steer-vault/index.ts index be35e5ada8..c00a9fd96b 100644 --- a/packages/client/src/pure/steer-vault/index.ts +++ b/packages/client/src/pure/steer-vault/index.ts @@ -1,4 +1,4 @@ export * from './count/count' export * from './vault/vault' export * from './vaults/vaults' -export { SteerStrategy } from '@sushiswap/database' + diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/index.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/index.ts index bd0bf47555..fecb863099 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/index.ts @@ -1,2 +1,3 @@ export * from './smart-pools' -export * from './smart-pool' \ No newline at end of file +export * from './vault' +export * from './vaults' diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pool.ts deleted file mode 100644 index f776dd0acb..0000000000 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pool.ts +++ /dev/null @@ -1,73 +0,0 @@ -import type { VariablesOf } from 'gql.tada' - -import { request, type RequestOptions } from 'src/lib/request' -import { graphql } from '../../graphql' - -export const SmartPoolQuery = graphql( - ` - query SmartPool($chainId: Int!, $vaultAddress: String!) { - smartPool(chainId: $chainId, vaultAddress: $vaultAddress) { - id - chainId - address - swapFee - protocol - token0 { - id - address - name - symbol - decimals - } - token1 { - id - address - name - symbol - decimals - } - strategy - liquidityUSD - vaultLiquidityUSD - feeUSD1d - feeApr1d - feeAndIncentiveApr1d - stakedApr1d - stakedAndIncentiveApr1d - incentiveApr - wasIncentivized - isIncentivized - description - lowerTick - upperTick - adjustmentFrequency - lastAdjustmentTimestamp - } - } -`, -) - -export type GetSmartPool = VariablesOf< - typeof SmartPoolQuery -> - -export async function getSmartPool( - variables: GetSmartPool, - options?: RequestOptions, -) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` - - const result = await request( - { url, document: SmartPoolQuery, variables }, - options, - ) - if (result) { - return result.smartPool - } - - throw new Error('No smart pool found') -} - -export type SmartPoolV1 = Awaited< - ReturnType -> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts new file mode 100644 index 0000000000..a503d8ce2c --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts @@ -0,0 +1,110 @@ +import type { VariablesOf } from 'gql.tada' +import { SteerStrategy } from '@sushiswap/steer-sdk' +import { request, type RequestOptions } from 'src/lib/request' +import { graphql } from '../../graphql' +import type { SteerChainId } from '@sushiswap/steer-sdk' +import type { Address } from 'viem' + +export const VaultQuery = graphql( + ` + query Vault($chainId: Int!, $vaultAddress: String!) { + vault(chainId: $chainId, vaultAddress: $vaultAddress) { + id + address + chainId + poolAddress + feeTier + performanceFee + token0 { + id + address + name + symbol + decimals + } + token1 { + id + address + name + symbol + decimals + } + adjustmentFrequency + lastAdjustmentTimestamp + strategy + payloadHash + lowerTick + upperTick + apr + apr1d + apr1w + reserve0 + reserve0USD + fees0 + fees0USD + reserve1 + reserve1USD + fees1 + fees1USD + reserveUSD + feesUSD + feeApr1d + feeAndIncentiveApr1d + stakedApr1d + stakedAndIncentiveApr1d + incentiveApr + wasIncentivized + isIncentivized + isEnabled + wasEnabled + isDeprecated + } + } +`, +) + +export type GetVault = VariablesOf + +export async function getVault( + variables: GetVault, + options?: RequestOptions, +) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + + const result = await request( + { url, document: VaultQuery, variables }, + options, + ) + if (result) { + const vault = result.vault + const strategy = SteerStrategy[vault.strategy as keyof typeof SteerStrategy] + if (!strategy) throw new Error('No strategy found') + return { + ...vault, + chainId: vault.chainId as SteerChainId, + id: `${vault.chainId}:${vault.id}` as `${string}:0x${string}`, + address: vault.address as Address, + reserve0: BigInt(vault.reserve0), + reserve1: BigInt(vault.reserve1), + fees0: BigInt(vault.fees0), + fees1: BigInt(vault.fees1), + token0: { + ...vault.token0, + id: `${vault.chainId}:${vault.token0.address}` as `${string}:0x${string}`, + address: vault.token0.address as Address, + chainId: vault.chainId as SteerChainId, + }, + token1: { + ...vault.token1, + id: `${vault.chainId}:${vault.token1.address}` as `${string}:0x${string}`, + address: vault.token1.address as Address, + chainId: vault.chainId as SteerChainId, + }, + strategy, + } + } + + throw new Error('No smart pool found') +} + +export type VaultV1 = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts new file mode 100644 index 0000000000..a6af4d0f5e --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts @@ -0,0 +1,106 @@ +import type { VariablesOf } from 'gql.tada' +import { SteerStrategy } from '@sushiswap/steer-sdk' +import { request, type RequestOptions } from 'src/lib/request' +import { graphql } from '../../graphql' +import type { SteerChainId, SteerVault } from '@sushiswap/steer-sdk' +import type { Address } from 'viem' + +export const VaultsQuery = graphql( + ` + query Vaults($chainId: Int!, $poolAddress: String!) { + vaults(chainId: $chainId, poolAddress: $poolAddress) { + id + address + chainId + poolAddress + feeTier + performanceFee + adjustmentFrequency + lastAdjustmentTimestamp + lowerTick + upperTick + apr + apr1d + apr1w + reserve0 + reserve0USD + fees0 + fees0USD + reserve1 + reserve1USD + fees1 + fees1USD + reserveUSD + feesUSD + strategy + payloadHash + isEnabled + wasEnabled + isDeprecated + + token0 { + id + address + name + symbol + decimals + } + token1 { + id + address + name + symbol + decimals + } + } + } +`, +) + +export type GetVaults = VariablesOf + +export async function getVaults( + variables: GetVaults, + options?: RequestOptions, +) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + + const result = await request( + { url, document: VaultsQuery, variables }, + options, + ) + if (result) { + const vaults = result.vaults.map((v) => { + const strategy = SteerStrategy[v.strategy as keyof typeof SteerStrategy] + if (!strategy) return null + return { + ...v, + chainId: v.chainId as SteerChainId, + id: `${v.chainId}:${v.id}` as `${string}:0x${string}`, + address: v.address as Address, + reserve0: BigInt(v.reserve0), + reserve1: BigInt(v.reserve1), + fees0: BigInt(v.fees0), + fees1: BigInt(v.fees1), + token0: { + ...v.token0, + id: `${v.chainId}:${v.token0.address}` as `${string}:0x${string}`, + address: v.token0.address as Address, + chainId: v.chainId as SteerChainId, + }, + token1: { + ...v.token1, + id: `${v.chainId}:${v.token1.address}` as `${string}:0x${string}`, + address: v.token1.address as Address, + chainId: v.chainId as SteerChainId, + }, + strategy, + } satisfies SteerVault + }) + + return vaults.filter((v) => v !== null) as SteerVault[] + } + + throw new Error('No smart pool found') +} + diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index 408802e7d8..1cf3c74801 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -22,8 +22,9 @@ type Query { portfolioLiquidityPositions(id: ID!): PortfolioPositions! portfolioClaimables(id: ID!): PortfolioClaimables! portfolioHistory(id: ID!): [PortfolioTransaction]! - smartPool(chainId: Int!, vaultAddress: String!): BasicSmartPool! smartPools(chainId: Int!): [BasicSmartPool]! + vault(chainId: Int!, vaultAddress: String!): Vault! + vaults(chainId: Int!, poolAddress: String!): [Vault]! sushiBarStats: SushiBarStats! sushiBarHistory: SushiBarHistory! v2LiquidityPositions(user: String!, chainId: Int!): [V2LiquidityPosition]! @@ -389,13 +390,52 @@ type BasicSmartPool { incentiveApr: Float! wasIncentivized: Boolean! isIncentivized: Boolean! - description: String! lowerTick: Int! upperTick: Int! adjustmentFrequency: Int! lastAdjustmentTimestamp: Int! } +type Vault { + id: ID! + address: String! + chainId: Int! + poolAddress: String! + feeTier: Float! + performanceFee: Float! + token0: Token! + token1: Token! + adjustmentFrequency: Int! + lastAdjustmentTimestamp: Int! + strategy: String! + payloadHash: String! + lowerTick: Int! + upperTick: Int! + apr: Float! + apr1d: Float! + apr1w: Float! + reserve0: String! + reserve0USD: Float! + fees0: String! + fees0USD: Float! + reserve1: String! + reserve1USD: Float! + fees1: String! + fees1USD: Float! + reserveUSD: Float! + feesUSD: Float! + feeApr1d: Float! + feeAndIncentiveApr1d: Float! + stakedApr1d: Float! + stakedAndIncentiveApr1d: Float! + incentiveApr: Float! + wasIncentivized: Boolean! + isIncentivized: Boolean! + isEnabled: Boolean! + wasEnabled: Boolean! + isDeprecated: Boolean! +} + type SushiBarStats { id: String! sushiXsushiRatio: Float! diff --git a/packages/steer-sdk/src/constants.ts b/packages/steer-sdk/src/constants.ts index c5e6883ff0..f190c569b8 100644 --- a/packages/steer-sdk/src/constants.ts +++ b/packages/steer-sdk/src/constants.ts @@ -76,3 +76,20 @@ export const STEER_SUBGRAPH_URL: Record = { [ChainId.ROOTSTOCK]: 'api.goldsky.com/api/public/project_clohj3ta78ok12nzs5m8yag0b/subgraphs/steer-protocol-rootstock/1.1.1/gn', } + +export enum SteerStrategy { + SuperWide = 'SuperWide', + DeltaNeutralStables = 'DeltaNeutralStables', + StableExpansion = 'StableExpansion', + ElasticExpansion = 'ElasticExpansion', + MovingVolatilityChannel = 'MovingVolatilityChannel', + MovingVolatilityChannelMedium = 'MovingVolatilityChannelMedium', + HighLowChannel = 'HighLowChannel', + StaticStable = 'StaticStable', + ClassicRebalance = 'ClassicRebalance', + ChannelMultiplier = 'ChannelMultiplier', + PriceMultiplier = 'PriceMultiplier', + FixedPercentage = 'FixedPercentage', + KeltnerAlgo = 'KeltnerAlgo', + BollingerAlgo = 'BollingerAlgo', +} diff --git a/packages/steer-sdk/src/types/steer-vault.ts b/packages/steer-sdk/src/types/steer-vault.ts index df8e499930..c7b16434be 100644 --- a/packages/steer-sdk/src/types/steer-vault.ts +++ b/packages/steer-sdk/src/types/steer-vault.ts @@ -1,4 +1,4 @@ -import type { SteerStrategy } from '@sushiswap/database' +import { SteerStrategy } from '@sushiswap/steer-sdk' import type { Token } from 'sushi/types' import type { SteerVaultId } from './steer-vault-id' From 63d43fbcdfab4f2dc6eabe1dbf6203d9e21cb525 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Tue, 23 Jul 2024 18:41:27 +0200 Subject: [PATCH 028/139] refactor: separate buckets from pool queries --- .../app/(evm)/pool/[id]/(landing)/page.tsx | 1 - .../web/src/lib/hooks/api/usePoolGraphData.ts | 71 +++++++------------ apps/web/src/ui/pool/PoolChartGraph.tsx | 29 +++++--- apps/web/src/ui/pool/PoolChartV2.tsx | 6 +- apps/web/src/ui/pool/PoolComposition.tsx | 4 +- apps/web/src/ui/pool/PoolRewards.tsx | 4 +- apps/web/src/ui/pool/PoolStats.tsx | 4 +- apps/web/src/ui/pool/StatisticsChartV3.tsx | 3 +- apps/web/src/ui/pool/UnknownTokenAlert.tsx | 6 +- .../data-api/queries/pool/v2-pool.ts | 23 +----- .../data-api/queries/pool/v3-pool.ts | 23 +----- .../data-api/queries/smart-pool/vaults.ts | 55 +++++++------- .../subgraphs/data-api/queries/v2/buckets.ts | 61 ++++++++++++++++ .../subgraphs/data-api/queries/v2/index.ts | 1 + .../subgraphs/data-api/queries/v3/buckets.ts | 61 ++++++++++++++++ .../subgraphs/data-api/queries/v3/index.ts | 1 + .../src/subgraphs/data-api/schema.graphql | 13 ++-- 17 files changed, 227 insertions(+), 139 deletions(-) create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx index 51dbb78d87..5eadd40c2c 100644 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx +++ b/apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx @@ -2,7 +2,6 @@ import { getPool } from '@sushiswap/client' import { unstable_cache } from 'next/cache' import { notFound } from 'next/navigation' -import { PoolPageV2 } from 'src/ui/pool/PoolPageV2' import { PoolPageV3 } from 'src/ui/pool/PoolPageV3' import { unsanitize } from 'sushi' diff --git a/apps/web/src/lib/hooks/api/usePoolGraphData.ts b/apps/web/src/lib/hooks/api/usePoolGraphData.ts index 412aa5293b..46a881f006 100644 --- a/apps/web/src/lib/hooks/api/usePoolGraphData.ts +++ b/apps/web/src/lib/hooks/api/usePoolGraphData.ts @@ -1,66 +1,45 @@ 'use client' -import { getSushiHistoricPool } from '@sushiswap/graph-client/composite/sushi-historic-pool' +import { + getV2PoolBuckets, + getV3PoolBuckets, +} from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' -import { SushiSwapV2ChainId } from 'sushi/config' -import { Amount, Token } from 'sushi/currency' +import { SushiSwapProtocol } from 'sushi' +import { SushiSwapV2ChainId, SushiSwapV3ChainId } from 'sushi/config' interface UsePoolGraphDataParams { poolAddress: string - chainId: SushiSwapV2ChainId + chainId: SushiSwapV2ChainId | SushiSwapV3ChainId + protocol: SushiSwapProtocol enabled?: boolean } export const usePoolGraphData = ({ poolAddress, chainId, + protocol, enabled = true, }: UsePoolGraphDataParams) => { return useQuery({ queryKey: ['usePoolGraphData', { poolAddress, chainId }], queryFn: async () => { - const pair = await getSushiHistoricPool({ - chainId, - id: poolAddress, - }) - - if (pair) { - const token0 = new Token({ - chainId: pair.chainId, - address: pair.token0.address, - decimals: pair.token0.decimals, - symbol: pair.token0.symbol, - name: pair.token0.name, - }) - - const token1 = new Token({ - chainId: pair.chainId, - address: pair.token1.address, - decimals: pair.token1.decimals, - symbol: pair.token1.symbol, - name: pair.token1.name, - }) - - return { - token0, - token1, - swapFee: Number(pair.swapFee), - reserve0: Amount.fromRawAmount(token0, pair.reserve0), - reserve1: Amount.fromRawAmount(token1, pair.reserve1), - liquidityUSD: Number(pair.liquidityUSD), - liquidity1dChange: Number(pair.liquidityUSD1dChange), - fees1d: Number(pair.feesUSD1d), - fees1dChange: Number(pair.feesUSD1dChange), - volume1d: Number(pair.volumeUSD1d), - volume1dChange: Number(pair.volumeUSD1dChange), - txCount1d: Number(pair.txCount1d), - txCount1dChange: Number(pair.txCount1dChange), - hourSnapshots: pair.poolHourData, - daySnapshots: pair.poolDayData, - } - } - - return null + const buckets = + protocol === SushiSwapProtocol.SUSHISWAP_V2 + ? await getV2PoolBuckets({ + chainId, + address: poolAddress, + }) + : protocol === SushiSwapProtocol.SUSHISWAP_V3 + ? await getV3PoolBuckets({ + chainId, + address: poolAddress, + }) + : { + dayBuckets: [], + hourBuckets: [], + } + return buckets }, keepPreviousData: true, staleTime: 0, diff --git a/apps/web/src/ui/pool/PoolChartGraph.tsx b/apps/web/src/ui/pool/PoolChartGraph.tsx index 312ff3fd4f..3c25075a06 100644 --- a/apps/web/src/ui/pool/PoolChartGraph.tsx +++ b/apps/web/src/ui/pool/PoolChartGraph.tsx @@ -19,7 +19,6 @@ import resolveConfig from 'tailwindcss/resolveConfig' import { PoolChartPeriod, chartPeriods } from './PoolChartPeriods' import { PoolChartType } from './PoolChartTypes' -import { V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' import ReactEchartsCore from 'echarts-for-react/lib/core' import { EChartsOption } from 'echarts-for-react/lib/types' import 'echarts/lib/chart/bar' @@ -28,24 +27,36 @@ import 'echarts/lib/component/tooltip' import 'echarts/lib/component/visualMap' import echarts from 'echarts/lib/echarts' import 'echarts/lib/visual/seriesColor' +import { usePoolGraphData } from 'src/lib/hooks' +import { V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' +import { SushiSwapProtocol } from 'sushi' interface PoolChartProps { chart: PoolChartType.Volume | PoolChartType.Fees | PoolChartType.TVL period: PoolChartPeriod - pool: V2Pool | V3Pool | null + pool: V2Pool | V3Pool + protocol: SushiSwapProtocol } const tailwind = resolveConfig(tailwindConfig) -export const PoolChartGraph: FC = ({ chart, period, pool }) => { - const isLoading = useMemo(() => !pool, [pool]) +export const PoolChartGraph: FC = ({ chart, period, pool, protocol }) => { + const { + data: buckets, + isInitialLoading: isLoading, + } = usePoolGraphData({ + poolAddress: pool.address, + chainId: pool.chainId, + protocol, + }) + const [xData, yData]: [number[], number[]] = useMemo(() => { const data = (chartPeriods[period] < chartPeriods[PoolChartPeriod.Week] - ? pool?.poolHourData - : pool?.poolDayData) || [] + ? buckets?.hourBuckets + : buckets?.dayBuckets) || [] const currentDate = Math.round(Date.now()) const [x, y] = data.reduce<[number[], number[]]>( @@ -53,7 +64,7 @@ export const PoolChartGraph: FC = ({ chart, period, pool }) => { if (cur?.date * 1000 >= currentDate - chartPeriods[period]) { acc[0].push(cur?.date) if (chart === PoolChartType.Fees) { - acc[1].push(Number(cur?.volumeUSD * Number(pool?.swapFee))) + acc[1].push(Number(cur?.feesUSD)) } else if (chart === PoolChartType.Volume) { acc[1].push(Number(cur?.volumeUSD)) } else if (chart === PoolChartType.TVL) { @@ -66,7 +77,7 @@ export const PoolChartGraph: FC = ({ chart, period, pool }) => { ) return [x.reverse(), y.reverse()] - }, [chart, period, pool]) + }, [chart, period, buckets]) // Transient update for performance const onMouseOver = useCallback( @@ -80,7 +91,7 @@ export const PoolChartGraph: FC = ({ chart, period, pool }) => { if (valueNodes[1]) { if (chart === PoolChartType.Volume) { - valueNodes[1].innerHTML = formatUSD(value * Number(pool?.swapFee)) + valueNodes[1].innerHTML = formatUSD(value * Number(pool.swapFee)) } } diff --git a/apps/web/src/ui/pool/PoolChartV2.tsx b/apps/web/src/ui/pool/PoolChartV2.tsx index 482d811fab..a9e244cb86 100644 --- a/apps/web/src/ui/pool/PoolChartV2.tsx +++ b/apps/web/src/ui/pool/PoolChartV2.tsx @@ -5,7 +5,8 @@ import React, { FC, useState } from 'react' import { PoolChartGraph } from './PoolChartGraph' import { PoolChartPeriod, PoolChartPeriods } from './PoolChartPeriods' import { PoolChartType, PoolChartTypes } from './PoolChartTypes' -import { PoolV1 } from '@sushiswap/graph-client/data-api' +import { V2Pool } from '@sushiswap/graph-client/data-api' +import { SushiSwapProtocol } from 'sushi' const charts = [ PoolChartType.Volume, @@ -21,7 +22,7 @@ const periods = [ ] interface PoolChartV2Props { - pool: PoolV1 + pool: V2Pool } const PoolChartV2: FC = ({ pool }) => { @@ -46,6 +47,7 @@ const PoolChartV2: FC = ({ pool }) => { chart={chart} period={period} pool={pool} + protocol={SushiSwapProtocol.SUSHISWAP_V2} /> ) diff --git a/apps/web/src/ui/pool/PoolComposition.tsx b/apps/web/src/ui/pool/PoolComposition.tsx index 2c0a5040c4..63b33bb521 100644 --- a/apps/web/src/ui/pool/PoolComposition.tsx +++ b/apps/web/src/ui/pool/PoolComposition.tsx @@ -1,6 +1,6 @@ 'use client' -import { PoolV1 } from '@sushiswap/graph-client/data-api' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { Card, CardContent, @@ -17,7 +17,7 @@ import { Amount, Token } from 'sushi/currency' import { formatUSD } from 'sushi/format' interface PoolCompositionProps { - pool: PoolV1 + pool: V2Pool } export const PoolComposition: FC = ({ pool }) => { diff --git a/apps/web/src/ui/pool/PoolRewards.tsx b/apps/web/src/ui/pool/PoolRewards.tsx index 77796bed93..b3e384aa4e 100644 --- a/apps/web/src/ui/pool/PoolRewards.tsx +++ b/apps/web/src/ui/pool/PoolRewards.tsx @@ -1,6 +1,6 @@ 'use client' -import { PoolV1 } from '@sushiswap/graph-client/data-api' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { Card, CardContent, @@ -16,7 +16,7 @@ import { incentiveRewardToToken } from 'src/lib/functions' import { ChainId } from 'sushi/chain' import { tryParseAmount } from 'sushi/currency' -export const PoolRewards: FC<{ pool: PoolV1 }> = ({ pool }) => { +export const PoolRewards: FC<{ pool: V2Pool }> = ({ pool }) => { const incentives = pool.incentives.filter( (incentive) => incentive.rewardPerDay > 0, ) diff --git a/apps/web/src/ui/pool/PoolStats.tsx b/apps/web/src/ui/pool/PoolStats.tsx index 5eb6ddf90e..4a8f75a608 100644 --- a/apps/web/src/ui/pool/PoolStats.tsx +++ b/apps/web/src/ui/pool/PoolStats.tsx @@ -1,6 +1,6 @@ 'use client' -import { PoolV1 } from '@sushiswap/graph-client/data-api' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { Card, CardContent, @@ -13,7 +13,7 @@ import { FC } from 'react' import { formatNumber, formatPercent, formatUSD } from 'sushi/format' interface PoolStats { - pool: PoolV1 + pool: V2Pool } export const PoolStats: FC = ({ pool }) => { diff --git a/apps/web/src/ui/pool/StatisticsChartV3.tsx b/apps/web/src/ui/pool/StatisticsChartV3.tsx index 95b0d528d4..97cec597e2 100644 --- a/apps/web/src/ui/pool/StatisticsChartV3.tsx +++ b/apps/web/src/ui/pool/StatisticsChartV3.tsx @@ -6,6 +6,7 @@ import { PoolChartGraph } from './PoolChartGraph' import { PoolChartPeriod, PoolChartPeriods } from './PoolChartPeriods' import { PoolChartType, PoolChartTypes } from './PoolChartTypes' import { V3Pool } from '@sushiswap/graph-client/data-api' +import { SushiSwapProtocol } from 'sushi' const statisticsChart = [ PoolChartType.Volume, @@ -53,7 +54,7 @@ export const StatisticsChartsV3: FC = ({ address, chainId, pool }) => { {chart === PoolChartType.Depth ? ( ) : ( - + )} ) diff --git a/apps/web/src/ui/pool/UnknownTokenAlert.tsx b/apps/web/src/ui/pool/UnknownTokenAlert.tsx index 36e37e46e6..0e854a49e0 100644 --- a/apps/web/src/ui/pool/UnknownTokenAlert.tsx +++ b/apps/web/src/ui/pool/UnknownTokenAlert.tsx @@ -1,6 +1,6 @@ 'use client' -import { PoolV1 } from '@sushiswap/graph-client/data-api' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { useCustomTokens } from '@sushiswap/hooks' import { Message } from '@sushiswap/ui' import { FC, useMemo } from 'react' @@ -9,10 +9,10 @@ import { ChainId } from 'sushi/chain' import { shortenAddress } from 'sushi/format' interface UnknownTokenAlert { - pool: PoolV1 + pool: V2Pool } -const tokenName = (token: PoolV1['token0']) => +const tokenName = (token: V2Pool['token0']) => token.name ? `${token.name} (${token.symbol})` : shortenAddress(token.address) export const UnknownTokenAlert: FC = ({ pool }) => { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts index 26a825a970..b30e56a244 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts @@ -10,7 +10,6 @@ import { type PoolHistory1D, type PoolV2, type PoolWithAprs, - type PoolWithBuckets, type PoolWithIncentives } from 'sushi' import { isSushiSwapV2ChainId } from 'sushi/config' @@ -79,22 +78,6 @@ export const V2PoolQuery = graphql( rewarderAddress rewarderType } - hourBuckets { - id - date - volumeUSD - liquidityUSD - txCount - feesUSD - } - dayBuckets { - id - date - volumeUSD - liquidityUSD - txCount - feesUSD - } } } `, @@ -187,10 +170,8 @@ export async function getV2Pool( rewarderAddress: incentive.rewarderAddress as Address, rewarderType: incentive.rewarderType as RewarderType, })), - poolHourData: result.v2Pool.hourBuckets, - poolDayData: pool.dayBuckets, - } satisfies PoolWithBuckets< - PoolWithAprs>>> + } satisfies + PoolWithAprs>> > } diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts index 6ebc84380c..7b55d51bfe 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts @@ -11,7 +11,6 @@ import { type PoolHistory1D, type PoolV3, type PoolWithAprs, - type PoolWithBuckets, type PoolWithIncentives } from 'sushi' import { isSushiSwapV3ChainId } from 'sushi/config' @@ -88,22 +87,6 @@ export const V3PoolQuery = graphql( rewarderType } vaults - hourBuckets { - id - date - volumeUSD - liquidityUSD - txCount - feesUSD - } - dayBuckets { - id - date - volumeUSD - liquidityUSD - txCount - feesUSD - } } } `, @@ -205,11 +188,9 @@ export async function getV3Pool( rewarderAddress: incentive.rewarderAddress as Address, rewarderType: incentive.rewarderType as RewarderType, })), - poolHourData: pool.hourBuckets.filter((bucket) => bucket !== null), - poolDayData: pool.dayBuckets.filter((bucket) => bucket !== null), - } satisfies PoolWithBuckets< + } satisfies PoolHasSteerVaults< - PoolWithAprs>>> + PoolWithAprs>> > > } diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts index a6af4d0f5e..d428adfa6d 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts @@ -1,22 +1,39 @@ -import type { VariablesOf } from 'gql.tada' +import type { SteerChainId } from '@sushiswap/steer-sdk' import { SteerStrategy } from '@sushiswap/steer-sdk' +import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' -import { graphql } from '../../graphql' -import type { SteerChainId, SteerVault } from '@sushiswap/steer-sdk' import type { Address } from 'viem' +import { graphql } from '../../graphql' +import type { VaultV1 } from './vault' export const VaultsQuery = graphql( ` query Vaults($chainId: Int!, $poolAddress: String!) { - vaults(chainId: $chainId, poolAddress: $poolAddress) { + vaults(chainId: $chainId, vaultAddress: $poolAddress) { id address chainId poolAddress feeTier performanceFee + token0 { + id + address + name + symbol + decimals + } + token1 { + id + address + name + symbol + decimals + } adjustmentFrequency lastAdjustmentTimestamp + strategy + payloadHash lowerTick upperTick apr @@ -32,26 +49,16 @@ export const VaultsQuery = graphql( fees1USD reserveUSD feesUSD - strategy - payloadHash + feeApr1d + feeAndIncentiveApr1d + stakedApr1d + stakedAndIncentiveApr1d + incentiveApr + wasIncentivized + isIncentivized isEnabled wasEnabled isDeprecated - - token0 { - id - address - name - symbol - decimals - } - token1 { - id - address - name - symbol - decimals - } } } `, @@ -69,7 +76,7 @@ export async function getVaults( { url, document: VaultsQuery, variables }, options, ) - if (result) { + if (result.vaults) { const vaults = result.vaults.map((v) => { const strategy = SteerStrategy[v.strategy as keyof typeof SteerStrategy] if (!strategy) return null @@ -95,10 +102,10 @@ export async function getVaults( chainId: v.chainId as SteerChainId, }, strategy, - } satisfies SteerVault + } satisfies VaultV1 }) - return vaults.filter((v) => v !== null) as SteerVault[] + return vaults.filter((v) => v !== null) as VaultV1[] } throw new Error('No smart pool found') diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts new file mode 100644 index 0000000000..ab58731d77 --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts @@ -0,0 +1,61 @@ +import type { VariablesOf } from 'gql.tada' + +import { request, type RequestOptions } from 'src/lib/request' +import { + ChainId +} from 'sushi' +import { isSushiSwapV2ChainId } from 'sushi/config' +import { graphql } from '../../graphql' +export const V2PoolBucketsQuery = graphql( + ` +query V2PoolBuckets($address: String!, $chainId: Int!) { + v2PoolBuckets(address: $address, chainId: $chainId) { + hourBuckets { + id + date + volumeUSD + liquidityUSD + txCount + feesUSD + } + dayBuckets { + id + date + volumeUSD + liquidityUSD + txCount + feesUSD + } + } +} +`, +) + +export type GetV2PoolBuckets = VariablesOf + +export async function getV2PoolBuckets( + variables: GetV2PoolBuckets, + options?: RequestOptions, +) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const chainId = Number(variables.chainId) as ChainId + + if (!isSushiSwapV2ChainId(chainId)) { + throw new Error('Invalid chainId') + } + + const result = await request( + { url, document: V2PoolBucketsQuery, variables }, + options, + ) + if (result.v2PoolBuckets) { + return { + hourBuckets: result.v2PoolBuckets.hourBuckets.filter((b) => b !== null), + dayBuckets: result.v2PoolBuckets.dayBuckets.filter((b) => b !== null), + } + } + + throw new Error('No buckets found') +} + +export type V2PoolBuckets = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v2/index.ts b/packages/graph-client/src/subgraphs/data-api/queries/v2/index.ts index cbeeccecbe..a44989cb57 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v2/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v2/index.ts @@ -1,3 +1,4 @@ +export * from './buckets' export * from './burns' export * from './mints' export * from './swaps' diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts new file mode 100644 index 0000000000..46dc6b8a37 --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts @@ -0,0 +1,61 @@ +import type { VariablesOf } from 'gql.tada' + +import { request, type RequestOptions } from 'src/lib/request' +import { + ChainId +} from 'sushi' +import { isSushiSwapV3ChainId } from 'sushi/config' +import { graphql } from '../../graphql' +export const V3PoolBucketsQuery = graphql( + ` +query V3PoolBuckets($address: String!, $chainId: Int!) { + v3PoolBuckets(address: $address, chainId: $chainId) { + hourBuckets { + id + date + volumeUSD + liquidityUSD + txCount + feesUSD + } + dayBuckets { + id + date + volumeUSD + liquidityUSD + txCount + feesUSD + } + } +} +`, +) + +export type GetV3PoolBuckets = VariablesOf + +export async function getV3PoolBuckets( + variables: GetV3PoolBuckets, + options?: RequestOptions, +) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const chainId = Number(variables.chainId) as ChainId + + if (!isSushiSwapV3ChainId(chainId)) { + throw new Error('Invalid chainId') + } + + const result = await request( + { url, document: V3PoolBucketsQuery, variables }, + options, + ) + if (result.v3PoolBuckets) { + return { + hourBuckets: result.v3PoolBuckets.hourBuckets.filter((b) => b !== null), + dayBuckets: result.v3PoolBuckets.dayBuckets.filter((b) => b !== null), + } + } + + throw new Error('No buckets found') +} + +export type V3PoolBuckets = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts index dc7158e559..3139d2d228 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts @@ -1,3 +1,4 @@ +export * from './buckets' export * from './burns' export * from './collects' export * from './mints' diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index 1cf3c74801..9ac1e8ce53 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -18,13 +18,15 @@ type Query { topPools(chainId: Int!): [TopPool]! v2Pool(address: String!, chainId: Int!): V2Pool! v3Pool(address: String!, chainId: Int!): V3Pool! + v2PoolBuckets(address: String!, chainId: Int!): PoolBuckets! + v3PoolBuckets(address: String!, chainId: Int!): PoolBuckets! portfolioWallet(id: ID!): PortfolioWallet! portfolioLiquidityPositions(id: ID!): PortfolioPositions! portfolioClaimables(id: ID!): PortfolioClaimables! portfolioHistory(id: ID!): [PortfolioTransaction]! smartPools(chainId: Int!): [BasicSmartPool]! vault(chainId: Int!, vaultAddress: String!): Vault! - vaults(chainId: Int!, poolAddress: String!): [Vault]! + vaults(chainId: Int!, poolAddress: String!): [Vault!]! sushiBarStats: SushiBarStats! sushiBarHistory: SushiBarHistory! v2LiquidityPositions(user: String!, chainId: Int!): [V2LiquidityPosition]! @@ -78,8 +80,6 @@ type V2Pool { isIncentivized: Boolean! wasIncentivized: Boolean! incentives: [Incentive]! - hourBuckets: [PoolBucket]! - dayBuckets: [PoolBucket]! } type V3Pool { @@ -121,8 +121,6 @@ type V3Pool { wasIncentivized: Boolean! incentives: [Incentive]! vaults: [String]! - hourBuckets: [PoolBucket]! - dayBuckets: [PoolBucket]! } type Incentive { @@ -177,6 +175,11 @@ type TopPool { source: String! } +type PoolBuckets { + hourBuckets: [PoolBucket]! + dayBuckets: [PoolBucket]! +} + type SimpleToken { id: String! chain: String! From a2dfcf8d88e5f2b0c9c191337025e6248a2888d5 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Tue, 23 Jul 2024 20:26:27 +0200 Subject: [PATCH 029/139] refactor(jobs): delete jobs --- jobs/pool/.env | 3 - jobs/pool/.gitignore | 1 - jobs/pool/Dockerfile | 35 - jobs/pool/README.md | 27 - jobs/pool/cloudbuild.yaml | 41 - jobs/pool/package.json | 64 - jobs/pool/src/config.ts | 34 - jobs/pool/src/etl/incentive/index.ts | 2 - jobs/pool/src/etl/incentive/load.ts | 86 -- jobs/pool/src/etl/incentive/transform.ts | 96 -- jobs/pool/src/etl/pool/index.ts | 1 - jobs/pool/src/etl/pool/load.ts | 595 -------- jobs/pool/src/etl/steer/index.ts | 1 - jobs/pool/src/etl/steer/load.ts | 412 ------ jobs/pool/src/etl/token/load.ts | 53 - jobs/pool/src/incentives.ts | 144 -- jobs/pool/src/lib/chefs/index.ts | 3 - .../src/lib/chefs/masterChefV1/fetchers.ts | 53 - jobs/pool/src/lib/chefs/masterChefV1/index.ts | 91 -- .../src/lib/chefs/masterChefV2/fetchers.ts | 106 -- jobs/pool/src/lib/chefs/masterChefV2/index.ts | 187 --- jobs/pool/src/lib/chefs/minichef/fetchers.ts | 218 --- jobs/pool/src/lib/chefs/minichef/index.ts | 198 --- jobs/pool/src/lib/common/index.ts | 3 - jobs/pool/src/lib/common/pairs.ts | 38 - jobs/pool/src/lib/common/tokens.ts | 117 -- jobs/pool/src/lib/common/utils.ts | 14 - jobs/pool/src/lib/index.ts | 3 - jobs/pool/src/lib/price.ts | 23 - jobs/pool/src/lib/prisma.ts | 3 - jobs/pool/src/lib/types.ts | 26 - jobs/pool/src/lib/wagmi.ts | 6 - jobs/pool/src/merkl-incentives.ts | 372 ----- jobs/pool/src/misc/manage-token.ts | 129 -- jobs/pool/src/misc/merkl-mock-response.json | 151 -- jobs/pool/src/misc/migrate-field.ts | 49 - jobs/pool/src/misc/migrate-tokens.ts | 107 -- jobs/pool/src/pools.ts | 1258 ----------------- jobs/pool/src/server.ts | 87 -- jobs/pool/src/steer.ts | 308 ---- jobs/pool/tsconfig.json | 22 - jobs/pool/turbo.json | 19 - package.json | 4 +- 43 files changed, 2 insertions(+), 5188 deletions(-) delete mode 100644 jobs/pool/.env delete mode 100644 jobs/pool/.gitignore delete mode 100644 jobs/pool/Dockerfile delete mode 100644 jobs/pool/README.md delete mode 100644 jobs/pool/cloudbuild.yaml delete mode 100644 jobs/pool/package.json delete mode 100644 jobs/pool/src/config.ts delete mode 100644 jobs/pool/src/etl/incentive/index.ts delete mode 100644 jobs/pool/src/etl/incentive/load.ts delete mode 100644 jobs/pool/src/etl/incentive/transform.ts delete mode 100644 jobs/pool/src/etl/pool/index.ts delete mode 100644 jobs/pool/src/etl/pool/load.ts delete mode 100644 jobs/pool/src/etl/steer/index.ts delete mode 100644 jobs/pool/src/etl/steer/load.ts delete mode 100644 jobs/pool/src/etl/token/load.ts delete mode 100644 jobs/pool/src/incentives.ts delete mode 100644 jobs/pool/src/lib/chefs/index.ts delete mode 100644 jobs/pool/src/lib/chefs/masterChefV1/fetchers.ts delete mode 100644 jobs/pool/src/lib/chefs/masterChefV1/index.ts delete mode 100644 jobs/pool/src/lib/chefs/masterChefV2/fetchers.ts delete mode 100644 jobs/pool/src/lib/chefs/masterChefV2/index.ts delete mode 100644 jobs/pool/src/lib/chefs/minichef/fetchers.ts delete mode 100644 jobs/pool/src/lib/chefs/minichef/index.ts delete mode 100644 jobs/pool/src/lib/common/index.ts delete mode 100644 jobs/pool/src/lib/common/pairs.ts delete mode 100644 jobs/pool/src/lib/common/tokens.ts delete mode 100644 jobs/pool/src/lib/common/utils.ts delete mode 100644 jobs/pool/src/lib/index.ts delete mode 100644 jobs/pool/src/lib/price.ts delete mode 100644 jobs/pool/src/lib/prisma.ts delete mode 100644 jobs/pool/src/lib/types.ts delete mode 100644 jobs/pool/src/lib/wagmi.ts delete mode 100644 jobs/pool/src/merkl-incentives.ts delete mode 100644 jobs/pool/src/misc/manage-token.ts delete mode 100644 jobs/pool/src/misc/merkl-mock-response.json delete mode 100644 jobs/pool/src/misc/migrate-field.ts delete mode 100644 jobs/pool/src/misc/migrate-tokens.ts delete mode 100644 jobs/pool/src/pools.ts delete mode 100644 jobs/pool/src/server.ts delete mode 100644 jobs/pool/src/steer.ts delete mode 100644 jobs/pool/tsconfig.json delete mode 100644 jobs/pool/turbo.json diff --git a/jobs/pool/.env b/jobs/pool/.env deleted file mode 100644 index c2cd65d2b8..0000000000 --- a/jobs/pool/.env +++ /dev/null @@ -1,3 +0,0 @@ -# !! THIS FILE IS COMMITED TO THE REPO - -NEXT_PUBLIC_EVM_APP_BASE_URL="https://www.sushi.com/" \ No newline at end of file diff --git a/jobs/pool/.gitignore b/jobs/pool/.gitignore deleted file mode 100644 index 1e18f275e9..0000000000 --- a/jobs/pool/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!.env \ No newline at end of file diff --git a/jobs/pool/Dockerfile b/jobs/pool/Dockerfile deleted file mode 100644 index aa205b17b3..0000000000 --- a/jobs/pool/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM node:20-alpine - -# Install git and pnpm -RUN apk add --no-cache git libc6-compat grep python3 py3-setuptools make g++ -RUN npm install -g pnpm@8.15.9 turbo@2.0.5 - -# Do ARG stuff -ARG SCRIPT_PATH="./" -ENV SCRIPT_PATH ${SCRIPT_PATH} - -ARG TURBO_TOKEN -ARG TURBO_TEAM - -# Copy the repo into the build context -WORKDIR /workdir/repo -COPY . . - -RUN ls - -# Prune unneeded packages -# Need to pull the package name from the path -RUN turbo prune --out-dir=../pruned --scope=$(pnpm list --depth -1 --parseable --long --filter "./$SCRIPT_PATH" | grep -oP '(?<=\:)(.*(?=@))') - -WORKDIR /workdir/pruned -# Can delete the previous workdir, won't be needed anymore -RUN rm -rf /workdir/repo - -RUN HUSKY=0 pnpm install -RUN pnpm exec turbo run build --filter="./$SCRIPT_PATH" - -# Delete store path since it's now unneeded, to reduce image size -RUN rm -rf $(pnpm store path) - -EXPOSE 8080/tcp -CMD pnpm exec turbo run start --only --filter="./$SCRIPT_PATH" \ No newline at end of file diff --git a/jobs/pool/README.md b/jobs/pool/README.md deleted file mode 100644 index 9dcca285db..0000000000 --- a/jobs/pool/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Pool job - -## Usage - -### Pools - -First time seed, set `FIRST_TIME_SEED` to true to speed things up. Otherwise ignore the env - -```bash -FIRST_TIME_SEED=true pnpm ts-node --esm --swc ./src/pools.ts -``` - -### Incentives - -```bash -pnpm ts-node --esm --swc ./src/incentives.ts -``` - -### Volume - -```bash -pnpm ts-node --esm --swc ./src/volume.ts -``` - -``` -http://localhost:8080/?target=incentives -``` \ No newline at end of file diff --git a/jobs/pool/cloudbuild.yaml b/jobs/pool/cloudbuild.yaml deleted file mode 100644 index e1b83a59e7..0000000000 --- a/jobs/pool/cloudbuild.yaml +++ /dev/null @@ -1,41 +0,0 @@ -steps: - - name: gcr.io/cloud-builders/docker - args: - - build - - '--build-arg' - - 'SCRIPT_PATH=./jobs/pool' - - '-t' - - 'gcr.io/$PROJECT_ID/$TRIGGER_NAME:latest' - - '-f' - - './jobs/pool/Dockerfile' - - . - dir: /workspace - id: Build Docker Image - - name: gcr.io/cloud-builders/docker - args: - - push - - 'gcr.io/$PROJECT_ID/$TRIGGER_NAME:latest' - id: Push Docker Image - - name: gcr.io/google.com/cloudsdktool/cloud-sdk - env: - - 'DATABASE_URL=${_DATABASE_URL}' - - 'SUSHI_GRAPH_KEY=${_SUSHI_GRAPH_KEY}' - - 'DRPC_ID=${_DRPC_ID}' - args: - - run - - deploy - - scripts-earn - - '--image' - - 'gcr.io/$PROJECT_ID/$TRIGGER_NAME:latest' - - '--region' - - us-central1 - - '--set-env-vars=DATABASE_URL=$_DATABASE_URL' - - '--set-env-vars=SUSHI_GRAPH_KEY=$_SUSHI_GRAPH_KEY' - - '--set-env-vars=DRPC_ID=$_DRPC_ID' - id: Update Cloud Run Service - entrypoint: gcloud -timeout: 3600s -images: - - 'gcr.io/$PROJECT_ID/$TRIGGER_NAME:latest' -options: - machineType: E2_HIGHCPU_8 \ No newline at end of file diff --git a/jobs/pool/package.json b/jobs/pool/package.json deleted file mode 100644 index 615f10c02c..0000000000 --- a/jobs/pool/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@sushiswap/pool-job", - "version": "0.0.0", - "private": true, - "description": "Pool jobs", - "keywords": [ - "pool", - "job" - ], - "homepage": "https://www.sushi.com", - "repository": { - "type": "git", - "url": "https://github.com/sushiswap/sushiswap.git", - "directory": "jobs/pools" - }, - "license": "MIT", - "type": "module", - "main": "dist/index.js", - "module": "dist/index.mjs", - "source": "src/index.ts", - "typings": "dist/index.d.ts", - "files": [ - "dist" - ], - "scripts": { - "check": "tsc --pretty --noEmit", - "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", - "server": "tsx src/server.ts", - "start": "tsx src/server.ts" - }, - "dependencies": { - "@ethersproject/address": "5.7.0", - "@ethersproject/bignumber": "5.7.0", - "@sushiswap/bonds-sdk": "workspace:*", - "@sushiswap/client": "workspace:*", - "@sushiswap/database": "workspace:*", - "@sushiswap/graph-client": "workspace:*", - "@sushiswap/steer-sdk": "workspace:*", - "@sushiswap/wagmi-config": "workspace:*", - "@wagmi/core": "2.10.6", - "@whatwg-node/fetch": "0.8.4", - "connect-timeout": "1.9.0", - "date-fns": "2.29.3", - "ethers": "5.7.2", - "express": "4.18.2", - "lodash.zip": "4.2.0", - "sushi": "workspace:*", - "tsx": "^4.7.1", - "viem": "2.10.11", - "zod": "3.21.4" - }, - "devDependencies": { - "@sushiswap/jest-config": "workspace:*", - "@swc/core": "1.4.2", - "@swc/helpers": "0.5.6", - "@tsconfig/esm": "1.0.4", - "@tsconfig/node18": "18.2.2", - "@types/connect-timeout": "0.0.36", - "@types/express": "4.17.15", - "@types/lodash.zip": "4.2.7", - "dotenv": "16.0.3", - "typescript": "5.4.5" - } -} diff --git a/jobs/pool/src/config.ts b/jobs/pool/src/config.ts deleted file mode 100644 index 06b01e7c30..0000000000 --- a/jobs/pool/src/config.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { ChainId } from 'sushi/chain' -import { Address } from 'viem' - -export const MINICHEF_ADDRESS: Record = { - [ChainId.POLYGON]: '0x0769fd68dFb93167989C6f7254cd0D766Fb2841F', - [ChainId.GNOSIS]: '0xdDCbf776dF3dE60163066A5ddDF2277cB445E0F3', - [ChainId.HARMONY]: '0x67dA5f2FfaDDfF067AB9d5F025F8810634d84287', - [ChainId.ARBITRUM]: '0xF4d73326C13a4Fc5FD7A064217e12780e9Bd62c3', - [ChainId.CELO]: '0x8084936982D089130e001b470eDf58faCA445008', - [ChainId.MOONRIVER]: '0x3dB01570D97631f69bbb0ba39796865456Cf89A5', - [ChainId.FUSE]: '0x182CD0C6F1FaEc0aED2eA83cd0e160c8Bd4cb063', - [ChainId.FANTOM]: '0xf731202A3cf7EfA9368C2d7bD613926f7A144dB5', - [ChainId.MOONBEAM]: '0x011E52E4E40CF9498c79273329E8827b21E2e581', - [ChainId.KAVA]: '0xf731202A3cf7EfA9368C2d7bD613926f7A144dB5', - [ChainId.METIS]: '0x1334c8e873E1cae8467156e2A81d1C8b566B2da1', - [ChainId.BOBA]: '0x75f52766A6a23F736edEfCD69dfBE6153a48c3F3', - [ChainId.ARBITRUM_NOVA]: '0xC09756432dAD2FF50B2D40618f7B04546DD20043', - [ChainId.BTTC]: '0xC09756432dAD2FF50B2D40618f7B04546DD20043', - [ChainId.OPTIMISM]: '0xB25157bF349295a7Cd31D1751973f426182070D6', - [ChainId.AVALANCHE]: '0xe11252176CEDd4a493Aec9767192C06A04A6B04F', - [ChainId.BSC]: '0x5219C5E32b9FFf87F29d5A833832c29134464aaa', -} - -export const MASTERCHEF_ADDRESS: Record = { - [ChainId.ETHEREUM]: '0xc2EdaD668740f1aA35E4D8f227fB8E17dcA888Cd', - // [ChainId.ROPSTEN]: '0x80C7DD17B01855a6D2347444a0FCC36136a314de', - // [ChainId.RINKEBY]: '0x80C7DD17B01855a6D2347444a0FCC36136a314de', - // [ChainId.GÖRLI]: '0x80C7DD17B01855a6D2347444a0FCC36136a314de', - // [ChainId.KOVAN]: '0x80C7DD17B01855a6D2347444a0FCC36136a314de', -} - -export const MASTERCHEF_V2_ADDRESS: Record = { - [ChainId.ETHEREUM]: '0xEF0881eC094552b2e128Cf945EF17a6752B4Ec5d', -} diff --git a/jobs/pool/src/etl/incentive/index.ts b/jobs/pool/src/etl/incentive/index.ts deleted file mode 100644 index 69f0204069..0000000000 --- a/jobs/pool/src/etl/incentive/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './load.js' -export * from './transform.js' diff --git a/jobs/pool/src/etl/incentive/load.ts b/jobs/pool/src/etl/incentive/load.ts deleted file mode 100644 index 1c326131cf..0000000000 --- a/jobs/pool/src/etl/incentive/load.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { Prisma } from '@sushiswap/database' -import { performance } from 'perf_hooks' -import { client } from 'src/lib/prisma' - -/** - * Merges(Create/Update) incentives. - * Using this wrapper function because createMany() has better performance than upsert(), speeds up the initial seeding. - * @param client - * @param incentives - */ -export async function mergeIncentives( - incentivesToCreate: Prisma.IncentiveCreateManyInput[], - incentivesToUpdate: Prisma.IncentiveCreateManyInput[], -) { - const incentivesAlreadyExist = await hasIncentives() - if (incentivesAlreadyExist) { - await updateIncentives(incentivesToUpdate) - await createIncentives(incentivesToCreate) - } else { - await createIncentives(incentivesToCreate) - } -} - -async function updateIncentives(incentives: Prisma.IncentiveCreateManyInput[]) { - if (incentives.length === 0) { - return - } - console.log(`LOAD - Preparing to update ${incentives.length} incentives`) - - const incentivesToUpdate = incentives.map((incentive) => { - return client.incentive.update({ - select: { - id: true, - }, - where: { - id: incentive.id, - }, - data: { - apr: incentive.apr, - rewardPerDay: incentive.rewardPerDay, - }, - }) - }) - - const startTime = performance.now() - const updatedIncentives = await Promise.all(incentivesToUpdate) - const endTime = performance.now() - - console.log( - `LOAD - Updated ${updatedIncentives.length} incentives. (${( - (endTime - startTime) / - 1000 - ).toFixed(1)}s) `, - ) -} - -async function createIncentives(incentives: Prisma.IncentiveCreateManyInput[]) { - if (incentives.length === 0) { - return - } - - let count = 0 - const batchSize = 500 - const startTime = performance.now() - - for (let i = 0; i < incentives.length; i += batchSize) { - const created = await client.incentive.createMany({ - data: incentives.slice(i, i + batchSize), - skipDuplicates: true, - }) - console.log(`LOAD - Batched and created ${created.count} incentives`) - count += created.count - } - const endTime = performance.now() - console.log( - `LOAD - Created ${count} incentives. (${( - (endTime - startTime) / - 1000 - ).toFixed(1)}s)`, - ) -} - -async function hasIncentives() { - const count = await client.incentive.count() - return count > 0 -} diff --git a/jobs/pool/src/etl/incentive/transform.ts b/jobs/pool/src/etl/incentive/transform.ts deleted file mode 100644 index 4dcc03c538..0000000000 --- a/jobs/pool/src/etl/incentive/transform.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { Prisma } from '@sushiswap/database' -import { client } from 'src/lib/prisma' - -/** - * Filters token incentives to only include the ones that are new or have changed. - * @param client - * @param incentives - * @returns - */ -export async function filterIncentives( - incentives: Prisma.IncentiveCreateManyInput[], -): Promise<{ - incentivesToCreate: Prisma.IncentiveCreateManyInput[] - incentivesToUpdate: Prisma.IncentiveCreateManyInput[] -}> { - const incentiveSelect = Prisma.validator()({ - id: true, - apr: true, - rewardPerDay: true, - }) - - const incentiveFound = await client.incentive.findMany({ - select: incentiveSelect, - }) - - const poolsFound = await client.sushiPool.findMany({ - where: { id: { in: incentives.map((incentive) => incentive.poolId) } }, - select: { id: true }, - }) - const foundPools = poolsFound.map((pool) => pool.id) - - const rewardTokensFound = await client.token.findMany({ - where: { - id: { in: incentives.map((incentive) => incentive.rewardTokenId) }, - }, - select: { id: true }, - }) - const foundRewardTokens = rewardTokensFound.map((token) => token.id) - - let missingTokens = 0 - const missingPoolIds: Record = {} - let missingPools = 0 - const incentivesToCreate = incentives.filter((incentive) => { - const incentiveExists = incentiveFound.find((i) => i.id === incentive.id) - if (!foundRewardTokens.includes(incentive.rewardTokenId)) { - missingTokens += 1 - return false - } - if (!incentiveExists) { - if (!foundPools.includes(incentive.poolId)) { - missingPools += 1 - if (!missingPoolIds[incentive.chainId]) { - missingPoolIds[incentive.chainId] = [] - } - missingPoolIds[incentive.chainId].push(incentive.poolId) - return false - } - return true - } - return false - }) - if (missingPools) - console.log(`Missing pools, skipping incentives: ${missingPools}`) - if (missingTokens) - console.log(`Missing tokens, skipping incentives: ${missingTokens}`) - if (missingPools > 0) { - Object.entries(missingPoolIds).forEach(([chainId, poolIds]) => { - console.log(`Missing pools on chain ${chainId}, count: ${poolIds.length}`) - }) - } - let incentivesAlreadyUpToDate = 0 - const incentivesToUpdate = incentives.filter((incentive) => { - const incentiveExists = incentiveFound.find((i) => i.id === incentive.id) - if (!incentiveExists) { - return false - } - if ( - incentive.apr !== incentiveExists.apr || - incentive.rewardPerDay !== incentiveExists.rewardPerDay - ) { - return true - } else { - incentivesAlreadyUpToDate++ - } - return false - }) - - console.log( - `TRANSFORM - Filtering incentives\n - ${incentivesToCreate.length} incentives should be created.\n - ${incentivesAlreadyUpToDate} incentives are already up to date.\n - ${incentivesToUpdate.length} incentives should be updated.\n`, - ) - - return { incentivesToCreate, incentivesToUpdate } -} diff --git a/jobs/pool/src/etl/pool/index.ts b/jobs/pool/src/etl/pool/index.ts deleted file mode 100644 index 46b942b746..0000000000 --- a/jobs/pool/src/etl/pool/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './load.js' diff --git a/jobs/pool/src/etl/pool/load.ts b/jobs/pool/src/etl/pool/load.ts deleted file mode 100644 index 23cfe72cf1..0000000000 --- a/jobs/pool/src/etl/pool/load.ts +++ /dev/null @@ -1,595 +0,0 @@ -import { Prisma } from '@sushiswap/database' -import { performance } from 'perf_hooks' -import { client } from 'src/lib/prisma' - -function clipDecimal(value: any) { - if (Number(value) >= 1e32) { - return 1e32 - } - return value -} - -export async function upsertPools(pools: Prisma.SushiPoolCreateManyInput[]) { - if (pools.length === 0) return - const poolsWithIncentives = await client.sushiPool.findMany({ - where: { - id: { - in: pools.map((pool) => pool.id), - }, - }, - select: { - id: true, - incentives: true, - }, - }) - - const poolsToCreate: Prisma.SushiPoolCreateManyInput[] = [] - const poolsToUpdate: Prisma.SushiPoolCreateManyInput[] = [] - - for (const pool of pools) { - const existingPools = poolsWithIncentives.find((p) => p.id === pool.id) - if (existingPools) { - if (!existingPools.incentives) { - poolsToUpdate.push(pool) - continue - } - - const totalIncentiveApr = existingPools.incentives.reduce( - (total, incentive) => { - return total + incentive.apr - }, - 0, - ) - poolsToUpdate.push({ - ...pool, - totalApr1h: (pool.feeApr1h ?? 0) + totalIncentiveApr, - totalApr1d: (pool.feeApr1d ?? 0) + totalIncentiveApr, - totalApr1w: (pool.feeApr1w ?? 0) + totalIncentiveApr, - totalApr1m: (pool.feeApr1m ?? 0) + totalIncentiveApr, - }) - continue - } - poolsToCreate.push(pool) - } - - const feeApr1h = poolsToUpdate - .filter((p) => p.feeApr1h !== undefined) - .map((update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.feeApr1h}`) - const feeApr1hQuery = feeApr1h.length - ? Prisma.sql`feeApr1h = CASE - ${Prisma.join(feeApr1h, ' ')} - ELSE feeApr1h - END,` - : Prisma.empty - const feeApr1d = poolsToUpdate - .filter((p) => p.feeApr1d !== undefined) - .map((update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.feeApr1d}`) - const feeApr1dQuery = feeApr1d.length - ? Prisma.sql`feeApr1d = CASE - ${Prisma.join(feeApr1d, ' ')} - ELSE feeApr1d - END,` - : Prisma.empty - const feeApr1w = poolsToUpdate - .filter((p) => p.feeApr1w !== undefined) - .map((update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.feeApr1w}`) - const feeApr1wQuery = feeApr1w.length - ? Prisma.sql`feeApr1w = CASE - ${Prisma.join(feeApr1w, ' ')} - ELSE feeApr1w - END,` - : Prisma.empty - const feeApr1m = poolsToUpdate - .filter((p) => p.feeApr1m) - .map((update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.feeApr1m}`) - const feeApr1mQuery = feeApr1m.length - ? Prisma.sql`feeApr1m = CASE - ${Prisma.join(feeApr1m, ' ')} - ELSE feeApr1m - END,` - : Prisma.empty - const totalApr1h = poolsToUpdate - .filter((p) => p.totalApr1h !== undefined) - .map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.totalApr1h}`, - ) - const totalApr1hQuery = totalApr1h.length - ? Prisma.sql`totalApr1h = CASE - ${Prisma.join(totalApr1h, ' ')} - ELSE totalApr1h - END,` - : Prisma.empty - const totalApr1d = poolsToUpdate - .filter((p) => p.totalApr1d !== undefined) - .map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.totalApr1d}`, - ) - const totalApr1dQuery = totalApr1d.length - ? Prisma.sql`totalApr1d = CASE - ${Prisma.join(totalApr1d, ' ')} - ELSE totalApr1d - END,` - : Prisma.empty - const totalApr1w = poolsToUpdate - .filter((p) => p.totalApr1w !== undefined) - .map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.totalApr1w}`, - ) - const totalApr1wQuery = totalApr1w.length - ? Prisma.sql`totalApr1w = CASE - ${Prisma.join(totalApr1w, ' ')} - ELSE totalApr1w - END,` - : Prisma.empty - const totalApr1m = poolsToUpdate - .filter((p) => p.totalApr1m) - .map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.totalApr1m}`, - ) - const totalApr1mQuery = totalApr1m.length - ? Prisma.sql`totalApr1w = CASE - ${Prisma.join(totalApr1m, ' ')} - ELSE totalApr1w - END,` - : Prisma.empty - const fees1h = poolsToUpdate - .filter((p) => p.fees1h !== undefined) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal(update.fees1h)}`, - ) - const fees1hQuery = fees1h.length - ? Prisma.sql`fees1h = CASE - ${Prisma.join(fees1h, ' ')} - ELSE fees1h - END,` - : Prisma.empty - const fees1d = poolsToUpdate - .filter((p) => p.fees1d !== undefined) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal(update.fees1d)}`, - ) - const fees1dQuery = fees1d.length - ? Prisma.sql`fees1d = CASE - ${Prisma.join(fees1d, ' ')} - ELSE fees1d - END,` - : Prisma.empty - const fees1w = poolsToUpdate - .filter((p) => p.fees1w !== undefined) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal(update.fees1w)}`, - ) - const fees1wQuery = fees1w.length - ? Prisma.sql`fees1w = CASE - ${Prisma.join(fees1w, ' ')} - ELSE fees1w - END,` - : Prisma.empty - const fees1m = poolsToUpdate - .filter((p) => p.fees1m !== undefined) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal(update.fees1m)}`, - ) - const fees1mQuery = fees1m.length - ? Prisma.sql`fees1m = CASE - ${Prisma.join(fees1m, ' ')} - ELSE fees1m - END,` - : Prisma.empty - const volume1h = poolsToUpdate - .filter((p) => p.volume1h !== undefined) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal(update.volume1h)}`, - ) - const volume1hQuery = volume1h.length - ? Prisma.sql`volume1h = CASE - ${Prisma.join(volume1h, ' ')} - ELSE volume1h - END,` - : Prisma.empty - const volume1d = poolsToUpdate - .filter((p) => p.volume1d !== undefined) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal(update.volume1d)}`, - ) - const volume1dQuery = volume1d.length - ? Prisma.sql`volume1d = CASE - ${Prisma.join(volume1d, ' ')} - ELSE volume1d - END,` - : Prisma.empty - const volume1w = poolsToUpdate - .filter((p) => p.volume1w !== undefined) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal(update.volume1w)}`, - ) - const volume1wQuery = volume1w.length - ? Prisma.sql`volume1w = CASE - ${Prisma.join(volume1w, ' ')} - ELSE volume1w - END,` - : Prisma.empty - const volume1m = poolsToUpdate - .filter((p) => p.volume1m !== undefined) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal(update.volume1m)}`, - ) - const volume1mQuery = volume1m.length - ? Prisma.sql`volume1m = CASE - ${Prisma.join(volume1m, ' ')} - ELSE volume1m - END,` - : Prisma.empty - const liquidityUSDChange1h = poolsToUpdate - .filter((p) => p.liquidityUSDChange1h) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.liquidityUSDChange1h}`, - ) - const liquidityUSDChange1hQuery = liquidityUSDChange1h.length - ? Prisma.sql`liquidityUSDChange1h = CASE - ${Prisma.join(liquidityUSDChange1h, ' ')} - ELSE liquidityUSDChange1h - END,` - : Prisma.empty - const liquidityUSDChange1d = poolsToUpdate - .filter((p) => p.liquidityUSDChange1d) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.liquidityUSDChange1d}`, - ) - const liquidityUSDChange1dQuery = liquidityUSDChange1d.length - ? Prisma.sql`liquidityUSDChange1d = CASE - ${Prisma.join(liquidityUSDChange1d, ' ')} - ELSE liquidityUSDChange1d - END,` - : Prisma.empty - const liquidityUSDChange1w = poolsToUpdate - .filter((p) => p.liquidityUSDChange1w) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.liquidityUSDChange1w}`, - ) - const liquidityUSDChange1wQuery = liquidityUSDChange1w.length - ? Prisma.sql`liquidityUSDChange1w = CASE - ${Prisma.join(liquidityUSDChange1w, ' ')} - ELSE liquidityUSDChange1w - END,` - : Prisma.empty - const liquidityUSDChange1m = poolsToUpdate - .filter((p) => p.liquidityUSDChange1m) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.liquidityUSDChange1m}`, - ) - const liquidityUSDChange1mQuery = liquidityUSDChange1m.length - ? Prisma.sql`liquidityUSDChange1m = CASE - ${Prisma.join(liquidityUSDChange1m, ' ')} - ELSE liquidityUSDChange1m - END,` - : Prisma.empty - const volumeChange1h = poolsToUpdate - .filter((p) => p.volumeChange1h) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.volumeChange1h}`, - ) - const volumeChange1hQuery = volumeChange1h.length - ? Prisma.sql`volumeChange1h = CASE - ${Prisma.join(volumeChange1h, ' ')} - ELSE volumeChange1h - END,` - : Prisma.empty - const volumeChange1d = poolsToUpdate - .filter((p) => p.volumeChange1d) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.volumeChange1d}`, - ) - const volumeChange1dQuery = volumeChange1d.length - ? Prisma.sql`volumeChange1d = CASE - ${Prisma.join(volumeChange1d, ' ')} - ELSE volumeChange1d - END,` - : Prisma.empty - const volumeChange1w = poolsToUpdate - .filter((p) => p.volumeChange1w) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.volumeChange1w}`, - ) - const volumeChange1wQuery = volumeChange1w.length - ? Prisma.sql`volumeChange1w = CASE - ${Prisma.join(volumeChange1w, ' ')} - ELSE volumeChange1w - END,` - : Prisma.empty - const volumeChange1m = poolsToUpdate - .filter((p) => p.volumeChange1m) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.volumeChange1m}`, - ) - const volumeChange1mQuery = volumeChange1m.length - ? Prisma.sql`volumeChange1m = CASE - ${Prisma.join(volumeChange1m, ' ')} - ELSE volumeChange1m - END,` - : Prisma.empty - const feesChange1h = poolsToUpdate - .filter((p) => p.feesChange1h) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.feesChange1h}`, - ) - const feesChange1hQuery = feesChange1h.length - ? Prisma.sql`feesChange1h = CASE - ${Prisma.join(feesChange1h, ' ')} - ELSE feesChange1h - END,` - : Prisma.empty - const feesChange1d = poolsToUpdate - .filter((p) => p.feesChange1d) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.feesChange1d}`, - ) - const feesChange1dQuery = feesChange1d.length - ? Prisma.sql`feesChange1d = CASE - ${Prisma.join(feesChange1d, ' ')} - ELSE feesChange1d - END,` - : Prisma.empty - const feesChange1w = poolsToUpdate - .filter((p) => p.feesChange1w) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.feesChange1w}`, - ) - const feesChange1wQuery = feesChange1w.length - ? Prisma.sql`feesChange1w = CASE - ${Prisma.join(feesChange1w, ' ')} - ELSE feesChange1w - END,` - : Prisma.empty - const feesChange1m = poolsToUpdate - .filter((p) => p.feesChange1m) - .map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.feesChange1m}`, - ) - const feesChange1mQuery = feesChange1m.length - ? Prisma.sql`feesChange1m = CASE - ${Prisma.join(feesChange1m, ' ')} - ELSE feesChange1m - END,` - : Prisma.empty - - const query = - poolsToUpdate.length && - Prisma.sql` - UPDATE SushiPool - SET - reserve0 = CASE - ${Prisma.join( - poolsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.reserve0}`, - ), - ' ', - )} - ELSE reserve0 - END, - reserve1 = CASE - ${Prisma.join( - poolsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.reserve1}`, - ), - ' ', - )} - ELSE reserve1 - END, - totalSupply = CASE - ${Prisma.join( - poolsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.totalSupply}`, - ), - ' ', - )} - ELSE totalSupply - END, - liquidityUSD = CASE - ${Prisma.join( - poolsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal( - update.liquidityUSD, - )}`, - ), - ' ', - )} - ELSE liquidityUSD - END, - feesUSD = CASE - ${Prisma.join( - poolsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal( - update.feesUSD, - )}`, - ), - ' ', - )} - ELSE feesUSD - END, - liquidityNative = CASE - ${Prisma.join( - poolsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal( - update.liquidityNative, - )}`, - ), - ' ', - )} - ELSE liquidityNative - END, - volumeUSD = CASE - ${Prisma.join( - poolsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal( - update.volumeUSD, - )}`, - ), - ' ', - )} - ELSE volumeUSD - END, - volumeNative = CASE - ${Prisma.join( - poolsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${clipDecimal( - update.volumeNative, - )}`, - ), - ' ', - )} - ELSE volumeNative - END, - token0Price = CASE - ${Prisma.join( - poolsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.token0Price}`, - ), - ' ', - )} - ELSE token0Price - END, - token1Price = CASE - ${Prisma.join( - poolsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.token1Price}`, - ), - ' ', - )} - ELSE token1Price - END, - ${feeApr1hQuery} - ${feeApr1dQuery} - ${feeApr1wQuery} - ${feeApr1mQuery} - ${totalApr1hQuery} - ${totalApr1dQuery} - ${totalApr1wQuery} - ${totalApr1mQuery} - ${fees1hQuery} - ${fees1dQuery} - ${fees1wQuery} - ${fees1mQuery} - ${volume1hQuery} - ${volume1dQuery} - ${volume1wQuery} - ${volume1mQuery} - ${liquidityUSDChange1hQuery} - ${liquidityUSDChange1dQuery} - ${liquidityUSDChange1wQuery} - ${liquidityUSDChange1mQuery} - ${volumeChange1hQuery} - ${volumeChange1dQuery} - ${volumeChange1wQuery} - ${volumeChange1mQuery} - ${feesChange1hQuery} - ${feesChange1dQuery} - ${feesChange1wQuery} - ${feesChange1mQuery} - updatedAt = NOW() - WHERE id IN (${Prisma.join(poolsToUpdate.map((update) => update.id))}); - ` - - try { - const [updated, created] = await Promise.all([ - poolsToUpdate.length ? client.$executeRaw`${query}` : Promise.resolve(0), - client.sushiPool.createMany({ - data: poolsToCreate, - skipDuplicates: true, - }), - ]) - - console.error( - `LOAD - Updated ${updated} and created ${created.count} pools. `, - ) - } catch (e) { - console.log(e) - } -} - -export async function updatePoolsWithIncentivesTotalApr() { - const startTime = performance.now() - - const updatedPoolsCount = await client.$executeRaw` - UPDATE - SushiPool p - SET - totalApr1h = COALESCE((SELECT SUM(i.apr) FROM Incentive i WHERE i.poolId = p.id), 0) + COALESCE(p.feeApr1h, 0), - totalApr1d = COALESCE((SELECT SUM(i.apr) FROM Incentive i WHERE i.poolId = p.id), 0) + COALESCE(p.feeApr1d, 0), - totalApr1w = COALESCE((SELECT SUM(i.apr) FROM Incentive i WHERE i.poolId = p.id), 0) + COALESCE(p.feeApr1w, 0), - totalApr1m = COALESCE((SELECT SUM(i.apr) FROM Incentive i WHERE i.poolId = p.id), 0) + COALESCE(p.feeApr1m, 0), - incentiveApr = COALESCE((SELECT SUM(i.apr) FROM Incentive i WHERE i.poolId = p.id), 0), - isIncentivized = COALESCE((SELECT MAX(i.rewardPerDay > 0) FROM Incentive i WHERE i.poolId = p.id), false), - wasIncentivized = true - WHERE - EXISTS (SELECT 1 FROM Incentive i WHERE i.poolId = p.id); -` - - const endTime = performance.now() - - console.log( - `LOAD - Updated ${updatedPoolsCount} pools with total APR (${( - (endTime - startTime) / - 1000 - ).toFixed(1)}s) `, - ) -} - -export async function updatePoolsWithSteerVaults() { - const startTime = performance.now() - - const poolsUpdatedCount = await client.$executeRaw` - UPDATE - SushiPool p - SET - hasEnabledSteerVault = COALESCE( - (SELECT MAX(sv.isEnabled) FROM SteerVault sv WHERE sv.poolId = p.id), - false - ), - hadEnabledSteerVault = COALESCE( - (SELECT MAX(sv.isEnabled OR sv.wasEnabled) FROM SteerVault sv WHERE sv.poolId = p.id), - false - ) - WHERE - EXISTS (SELECT 1 FROM SteerVault sv WHERE sv.poolId = p.id AND (sv.isEnabled OR sv.wasEnabled)); - ` - - const endTime = performance.now() - - console.log( - `LOAD - Updated ${poolsUpdatedCount} pools with steer vaults (${( - (endTime - startTime) / - 1000 - ).toFixed(1)}s) `, - ) -} diff --git a/jobs/pool/src/etl/steer/index.ts b/jobs/pool/src/etl/steer/index.ts deleted file mode 100644 index 46b942b746..0000000000 --- a/jobs/pool/src/etl/steer/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './load.js' diff --git a/jobs/pool/src/etl/steer/load.ts b/jobs/pool/src/etl/steer/load.ts deleted file mode 100644 index ad33a4181a..0000000000 --- a/jobs/pool/src/etl/steer/load.ts +++ /dev/null @@ -1,412 +0,0 @@ -import { Prisma } from '@sushiswap/database' -import { client } from 'src/lib/prisma' - -export async function upsertVaults(vaults: Prisma.SteerVaultCreateManyInput[]) { - const vaultTokens = vaults.flatMap((vault) => [ - vault.token0Id, - vault.token1Id, - ]) - const dbTokens = ( - await client.token.findMany({ - select: { - id: true, - }, - where: { - id: { - in: vaultTokens, - }, - }, - }) - ).map((token) => token.id) - - const vaultPools = vaults.map((vault) => vault.poolId) - const dbPools = ( - await client.sushiPool.findMany({ - select: { - id: true, - }, - where: { - id: { - in: vaultPools, - }, - }, - }) - ).map((pool) => pool.id) - - const vaultsToUpdate = vaults.filter( - (vault) => - dbTokens.includes(vault.token0Id) && - dbTokens.includes(vault.token1Id) && - dbPools.includes(vault.poolId), - ) - - if (vaultsToUpdate.length === 0) return - - const query = Prisma.sql` - UPDATE SteerVault - SET - poolId = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.poolId}`, - ), - ' ', - )} - ELSE poolId - END, - chainId = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.chainId}`, - ), - ' ', - )} - ELSE chainId - END, - feeTier = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.feeTier}`, - ), - ' ', - )} - ELSE feeTier - END, - apr = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.apr}`, - ), - ' ', - )} - ELSE apr - END, - apr1d = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.apr1d}`, - ), - ' ', - )} - ELSE apr1d - END, - apr1w = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.apr1w}`, - ), - ' ', - )} - ELSE apr1w - END, - apr1m = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.apr1m}`, - ), - ' ', - )} - ELSE apr1m - END, - apr1y = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.apr1y}`, - ), - ' ', - )} - ELSE apr1y - END, - token0Id = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.token0Id}`, - ), - ' ', - )} - ELSE token0Id - END, - reserve0 = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.reserve0}`, - ), - ' ', - )} - ELSE reserve0 - END, - reserve0USD = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.reserve0USD}`, - ), - ' ', - )} - ELSE reserve0USD - END, - fees0 = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.fees0}`, - ), - ' ', - )} - ELSE fees0 - END, - fees0USD = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.fees0USD}`, - ), - ' ', - )} - ELSE fees0USD - END, - token1Id = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.token1Id}`, - ), - ' ', - )} - ELSE token1Id - END, - reserve1 = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.reserve1}`, - ), - ' ', - )} - ELSE reserve1 - END, - reserve1USD = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.reserve1USD}`, - ), - ' ', - )} - ELSE reserve1USD - END, - fees1 = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.fees1}`, - ), - ' ', - )} - ELSE fees1 - END, - fees1USD = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.fees1USD}`, - ), - ' ', - )} - ELSE fees1USD - END, - reserveUSD = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.reserveUSD}`, - ), - ' ', - )} - ELSE reserveUSD - END, - feesUSD = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.feesUSD}`, - ), - ' ', - )} - ELSE feesUSD - END, - strategy = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.strategy}`, - ), - ' ', - )} - ELSE strategy - END, - description = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.description}`, - ), - ' ', - )} - ELSE description - END, - state = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.state}`, - ), - ' ', - )} - ELSE state - END, - performanceFee = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.performanceFee}`, - ), - ' ', - )} - ELSE performanceFee - END, - lowerTick = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.lowerTick}`, - ), - ' ', - )} - ELSE lowerTick - END, - upperTick = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.upperTick}`, - ), - ' ', - )} - ELSE upperTick - END, - adjustmentFrequency = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.adjustmentFrequency}`, - ), - ' ', - )} - ELSE adjustmentFrequency - END, - lastAdjustmentTimestamp = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.lastAdjustmentTimestamp}`, - ), - ' ', - )} - ELSE lastAdjustmentTimestamp - END, - creator = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.creator}`, - ), - ' ', - )} - ELSE creator - END, - admin = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => Prisma.sql`WHEN id = ${update.id} THEN ${update.admin}`, - ), - ' ', - )} - ELSE admin - END, - manager = CASE - ${Prisma.join( - vaultsToUpdate.map( - (update) => - Prisma.sql`WHEN id = ${update.id} THEN ${update.manager}`, - ), - ' ', - )} - ELSE manager - END, - updatedAt = NOW() - WHERE id IN (${Prisma.join( - vaultsToUpdate.map((update) => Prisma.sql`${update.id}`), - )}); - ` - - const [updated, created] = await Promise.all([ - vaultsToUpdate.length ? client.$executeRaw`${query}` : Promise.resolve(0), - client.steerVault.createMany({ - data: vaultsToUpdate, - skipDuplicates: true, - }), - ]) - - const currentVaults = await client.steerVault.findMany({ - select: { - id: true, - }, - where: { - isEnabled: true, - wasEnabled: false, - }, - }) - - await client.steerVault.updateMany({ - where: { - id: { in: currentVaults.map((vault) => vault.id) }, - }, - data: { - wasEnabled: true, - }, - }) - - console.log(`LOAD - Updated ${updated} and created ${created.count} vaults. `) -} - -export async function enableVaults(vaultIds: string[]) { - const enabled = await client.steerVault.updateMany({ - data: { - isEnabled: true, - wasEnabled: true, - }, - where: { id: { in: vaultIds } }, - }) - - console.log(`LOAD - Enabled ${enabled.count} vaults.`) -} - -export async function deprecateVaults(vaultIds: string[]) { - const deprecated = await client.steerVault.updateMany({ - data: { - apr: 0, - apr1d: 0, - apr1w: 0, - apr1m: 0, - apr1y: 0, - isDeprecated: true, - isEnabled: false, - }, - where: { id: { in: vaultIds } }, - }) - - console.log(`LOAD - Deprecated ${deprecated.count} vaults.`) -} diff --git a/jobs/pool/src/etl/token/load.ts b/jobs/pool/src/etl/token/load.ts deleted file mode 100644 index 99e57a0f15..0000000000 --- a/jobs/pool/src/etl/token/load.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Prisma } from '@sushiswap/database' -import { client } from 'src/lib/prisma' -import { ChainId } from 'sushi' -import { Address } from 'viem' - -export async function createTokens(tokens: Prisma.TokenCreateManyInput[]) { - if (tokens.length === 0) { - return - } - const created = await client.token.createMany({ - data: tokens, - skipDuplicates: true, - }) - if (created.count > 0) { - console.log(`LOAD - Created ${created.count} tokens. `) - } -} - -export async function getMissingTokens( - tokens: { chainId: ChainId; address: Address }[], -) { - if (tokens.length === 0) { - return [] - } - const tokensFound = await client.token.findMany({ - select: { - id: true, - name: true, - symbol: true, - }, - where: { - id: { - in: tokens.map( - (token) => `${token.chainId}:${token.address.toLowerCase()}`, - ), - }, - }, - }) - - return tokens - .filter( - (token) => - !tokensFound.find( - (createdToken) => - createdToken.id === - `${token.chainId}:${token.address.toLowerCase()}`, - ), - ) - .map((token) => ({ - address: token.address, - chainId: token.chainId, - })) -} diff --git a/jobs/pool/src/incentives.ts b/jobs/pool/src/incentives.ts deleted file mode 100644 index c8a03a2796..0000000000 --- a/jobs/pool/src/incentives.ts +++ /dev/null @@ -1,144 +0,0 @@ -import 'dotenv/config' -import './lib/wagmi.js' - -import { Prisma } from '@sushiswap/database' -import { performance } from 'perf_hooks' -import { ChainId } from 'sushi/chain' - -import { MINICHEF_SUPPORTED_CHAIN_IDS } from 'sushi/config' -import { filterIncentives } from './etl/incentive/index.js' -import { mergeIncentives } from './etl/incentive/load.js' -import { updatePoolsWithIncentivesTotalApr } from './etl/pool/index.js' -import { createTokens } from './etl/token/load.js' -import { getMasterChefV1, getMasterChefV2, getMinichef } from './lib/index.js' -import { ChefReturn } from './lib/types.js' - -export async function execute() { - try { - console.log('Preparing to load farms/incentives') - const startTime = performance.now() - - // EXTRACT - const farms = await extract() - console.log(`EXTRACT - Extracted farms from ${farms.length} chains.`) - - // TRANSFORM - const { incentivesToCreate, incentivesToUpdate, tokens } = - await transform(farms) - - // LOAD - await createTokens(tokens) - await mergeIncentives(incentivesToCreate, incentivesToUpdate) - await updatePoolsWithIncentivesTotalApr() - - const endTime = performance.now() - console.log( - `COMPLETE - Script ran for ${((endTime - startTime) / 1000).toFixed( - 1, - )} seconds. `, - ) - } catch (e) { - console.error(e) - } -} - -async function extract() { - const minichefsP = MINICHEF_SUPPORTED_CHAIN_IDS.map((chainId) => - getMinichef(chainId), - ) - const masterChefV1P = getMasterChefV1() - const masterChefV2P = getMasterChefV2() - - const [masterChefV1, masterChefV2, ...minichefs] = await Promise.all([ - masterChefV1P, - masterChefV2P, - ...minichefsP, - ]) - const combined = [ - { - chainId: ChainId.ETHEREUM, - farms: { ...masterChefV1.farms, ...masterChefV2.farms }, - }, - ...minichefs, - ] - - const totalFarms = combined.reduce( - (acc, { farms }) => acc + (farms ? Object.keys(farms).length : 0), - 0, - ) - let totalIncentives = 0 - for (const combination of combined) { - if (combination.farms) { - const incentiveCount = Object.entries(combination.farms).reduce( - (acc, [, farm]) => acc + farm.incentives.length, - 0, - ) - totalIncentives += incentiveCount - console.log( - `Chain ID: ${combination.chainId}. Farms: ${ - Object.keys(combination.farms).length - }, incentives: ${incentiveCount}`, - ) - } else { - console.error(`Chain ID: ${combination.chainId}. Error.`) - } - } - console.log( - `Total farms: ${totalFarms}, total incentives: ${totalIncentives}`, - ) - return combined -} - -async function transform(data: ChefReturn[]): Promise<{ - incentivesToCreate: Prisma.IncentiveCreateManyInput[] - incentivesToUpdate: Prisma.IncentiveCreateManyInput[] - tokens: Prisma.TokenCreateManyInput[] -}> { - const tokens: Prisma.TokenCreateManyInput[] = [] - const incentives = data.flatMap((farm) => { - const chainId = farm.chainId - return Object.entries(farm.farms ?? []).flatMap(([poolAddress, farm]) => { - return farm.incentives.flatMap((incentive) => { - tokens.push( - Prisma.validator()({ - id: chainId - .toString() - .concat(':') - .concat(incentive.rewardToken.address.toLowerCase()), - address: incentive.rewardToken.address.toLowerCase(), - chainId: chainId, - name: incentive.rewardToken.name, - symbol: incentive.rewardToken.symbol, - decimals: incentive.rewardToken.decimals, - }), - ) - return Prisma.validator()({ - id: poolAddress.concat(':').concat(incentive.rewarder.address), - chainId: chainId, - chefType: farm.chefType, - apr: - Number.isNaN(incentive.apr) || incentive.apr === Infinity - ? 0 - : incentive.apr, - rewardTokenId: chainId - .toString() - .concat(':') - .concat(incentive.rewardToken.address.toLowerCase()), - rewardPerDay: incentive.rewardPerDay, - poolId: chainId - .toString() - .concat(':') - .concat(poolAddress.toLowerCase()), - pid: farm.id, - rewarderAddress: incentive.rewarder.address.toLowerCase(), - rewarderType: incentive.rewarder.type, - }) - }) - }) - }) - - const { incentivesToCreate, incentivesToUpdate } = - await filterIncentives(incentives) - - return { incentivesToCreate, incentivesToUpdate, tokens } -} diff --git a/jobs/pool/src/lib/chefs/index.ts b/jobs/pool/src/lib/chefs/index.ts deleted file mode 100644 index c07916fc50..0000000000 --- a/jobs/pool/src/lib/chefs/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './masterChefV1/index.js' -export * from './masterChefV2/index.js' -export * from './minichef/index.js' diff --git a/jobs/pool/src/lib/chefs/masterChefV1/fetchers.ts b/jobs/pool/src/lib/chefs/masterChefV1/fetchers.ts deleted file mode 100644 index 5af0a989ad..0000000000 --- a/jobs/pool/src/lib/chefs/masterChefV1/fetchers.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { readContract, readContracts } from '@wagmi/core' -import { masterChefV1Abi } from 'sushi/abi' -import { ChainId } from 'sushi/chain' - -import { config } from 'src/lib/wagmi.js' -import { MASTERCHEF_ADDRESS } from '../../../config.js' - -export async function getPoolLength() { - const poolLengthCall = { - address: MASTERCHEF_ADDRESS[ChainId.ETHEREUM], - chainId: ChainId.ETHEREUM, - abi: masterChefV1Abi, - functionName: 'poolLength', - } as const - - return readContract(config, poolLengthCall) -} - -export async function getTotalAllocPoint() { - const totalAllocPointCall = { - address: MASTERCHEF_ADDRESS[ChainId.ETHEREUM], - chainId: ChainId.ETHEREUM, - abi: masterChefV1Abi, - functionName: 'totalAllocPoint', - } as const - - return readContract(config, totalAllocPointCall) -} - -export async function getPoolInfos(poolLength: bigint) { - const poolInfoCalls = [...Array(Number(poolLength))].map( - (_, i) => - ({ - address: MASTERCHEF_ADDRESS[ChainId.ETHEREUM], - args: [BigInt(i)], - chainId: ChainId.ETHEREUM, - abi: masterChefV1Abi, - functionName: 'poolInfo', - }) as const, - ) - - return readContracts(config, { - allowFailure: false, - contracts: poolInfoCalls, - }).then((results) => - results.flatMap((result) => ({ - lpToken: result[0], - allocPoint: result[1], - lastRewardBlock: result[2], - accSushiPerShare: result[3], - })), - ) -} diff --git a/jobs/pool/src/lib/chefs/masterChefV1/index.ts b/jobs/pool/src/lib/chefs/masterChefV1/index.ts deleted file mode 100644 index 6d236f6116..0000000000 --- a/jobs/pool/src/lib/chefs/masterChefV1/index.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { daysInYear, secondsInDay } from 'date-fns/constants' -import { ChainId } from 'sushi/chain' -import { SUSHI } from 'sushi/currency' - -import { SECONDS_BETWEEN_BLOCKS } from 'sushi/config/subgraph' -import { MASTERCHEF_ADDRESS } from '../../../config.js' -import { getPairs, getTokenBalancesOf, getTokens } from '../../common/index.js' -import type { ChefReturn, Farm } from '../../types.js' -import { getPoolInfos, getPoolLength, getTotalAllocPoint } from './fetchers.js' - -const SUSHI_PER_BLOCK = 100 - -export async function getMasterChefV1(): Promise { - const [ - poolLength, - totalAllocPoint, - [{ derivedUSD: sushiPriceUSD }], - averageBlockTime, - ] = await Promise.all([ - getPoolLength(), - getTotalAllocPoint(), - getTokens([SUSHI[ChainId.ETHEREUM].address], ChainId.ETHEREUM), - SECONDS_BETWEEN_BLOCKS[ChainId.ETHEREUM], - ]) - - const blocksPerDay = averageBlockTime ? secondsInDay / averageBlockTime : 0 - const sushiPerDay = SUSHI_PER_BLOCK * blocksPerDay - console.log( - `MasterChefV1 - pools: ${poolLength}, sushiPerDay: ${sushiPerDay}, averageBlockTime: ${averageBlockTime}, totalAllocPoint: ${totalAllocPoint}`, - ) - - const poolInfos = await getPoolInfos(poolLength) - - const [pairs, lpBalances] = await Promise.all([ - getPairs( - poolInfos.map((pool) => pool.lpToken), - ChainId.ETHEREUM, - ), - getTokenBalancesOf( - poolInfos.map((pool) => pool.lpToken), - MASTERCHEF_ADDRESS[ChainId.ETHEREUM], - ChainId.ETHEREUM, - ), - ]) - - return { - chainId: ChainId.ETHEREUM, - farms: poolInfos.reduce>((acc, farm, i) => { - const pair = pairs.find((pair) => pair.id === farm.lpToken.toLowerCase()) - const lpBalance = lpBalances.find( - ({ token }) => token === farm.lpToken, - )?.balance - if (!pair || !lpBalance) return acc - - let rewardPerDay = - sushiPerDay * (Number(farm.allocPoint) / Number(totalAllocPoint)) - - // Edge case for virtually disabled rewards - if (rewardPerDay < 0.000001) rewardPerDay = 0 - - const rewardPerYearUSD = daysInYear * rewardPerDay * sushiPriceUSD - - const incentives: Farm['incentives'] = [ - { - apr: - rewardPerYearUSD / - ((pair.liquidityUSD * lpBalance) / pair.totalSupply), - rewardPerDay: rewardPerDay, - rewardToken: { - address: SUSHI[ChainId.ETHEREUM].address, - name: SUSHI[ChainId.ETHEREUM].name ?? '', - decimals: SUSHI[ChainId.ETHEREUM].decimals ?? 18, - symbol: SUSHI[ChainId.ETHEREUM].symbol ?? '', - }, - rewarder: { - address: MASTERCHEF_ADDRESS[ChainId.ETHEREUM], - type: 'Primary', - }, - }, - ] - - acc[farm.lpToken.toLowerCase()] = { - id: i, - incentives: incentives, - chefType: 'MasterChefV1', - poolType: pair.type, - } - return acc - }, {}), - } -} diff --git a/jobs/pool/src/lib/chefs/masterChefV2/fetchers.ts b/jobs/pool/src/lib/chefs/masterChefV2/fetchers.ts deleted file mode 100644 index d1c97142c3..0000000000 --- a/jobs/pool/src/lib/chefs/masterChefV2/fetchers.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { readContract, readContracts } from '@wagmi/core' -import { masterChefV2Abi } from 'sushi/abi' -import { ChainId } from 'sushi/chain' - -import { getMasterChefV2Rewarders } from '@sushiswap/graph-client/master-chef-v2' -import { config } from 'src/lib/wagmi.js' -import { MASTERCHEF_V2_ADDRESS } from '../../../config.js' - -export async function getPoolLength() { - const poolLengthCall = { - address: MASTERCHEF_V2_ADDRESS[ChainId.ETHEREUM], - chainId: ChainId.ETHEREUM, - abi: masterChefV2Abi, - functionName: 'poolLength', - } as const - - return readContract(config, poolLengthCall) -} - -export async function getTotalAllocPoint() { - return readContract(config, { - address: MASTERCHEF_V2_ADDRESS[ChainId.ETHEREUM], - chainId: ChainId.ETHEREUM, - abi: masterChefV2Abi, - functionName: 'totalAllocPoint', - } as const) -} - -export async function getSushiPerBlock() { - return readContract(config, { - address: MASTERCHEF_V2_ADDRESS[ChainId.ETHEREUM], - chainId: ChainId.ETHEREUM, - abi: masterChefV2Abi, - functionName: 'sushiPerBlock', - } as const) -} - -export async function getPoolInfos(poolLength: number) { - const poolInfoCalls = [...Array(poolLength)].map( - (_, i) => - ({ - address: MASTERCHEF_V2_ADDRESS[ChainId.ETHEREUM], - args: [BigInt(i)], - chainId: ChainId.ETHEREUM, - abi: masterChefV2Abi, - functionName: 'poolInfo', - }) as const, - ) - - const poolInfos = await readContracts(config, { - allowFailure: false, - contracts: poolInfoCalls, - }) - - return poolInfos.map((poolInfo) => ({ - accSushiPerShare: poolInfo[0], - lastRewardBlock: poolInfo[1], - allocPoint: poolInfo[2], - })) -} - -export async function getLpTokens(poolLength: number) { - const lpTokenCalls = [...Array(poolLength)].map( - (_, i) => - ({ - address: MASTERCHEF_V2_ADDRESS[ChainId.ETHEREUM], - args: [BigInt(i)], - chainId: ChainId.ETHEREUM, - abi: masterChefV2Abi, - functionName: 'lpToken', - }) as const, - ) - - return readContracts(config, { - allowFailure: false, - contracts: lpTokenCalls, - }) -} - -export async function getRewarders(poolLength: number) { - const rewarderCalls = [...Array(poolLength)].map( - (_, i) => - ({ - address: MASTERCHEF_V2_ADDRESS[ChainId.ETHEREUM], - args: [BigInt(i)], - chainId: ChainId.ETHEREUM, - abi: masterChefV2Abi, - functionName: 'rewarder', - }) as const, - ) - - return readContracts(config, { - allowFailure: false, - contracts: rewarderCalls, - }) -} - -export async function getRewarderInfos() { - const rewarders = await getMasterChefV2Rewarders({}) - - return rewarders.map((rewarder) => ({ - id: rewarder.id, - rewardToken: rewarder.address, - rewardPerSecond: BigInt(rewarder.rewardPerSecond), - })) -} diff --git a/jobs/pool/src/lib/chefs/masterChefV2/index.ts b/jobs/pool/src/lib/chefs/masterChefV2/index.ts deleted file mode 100644 index 00a34bc12b..0000000000 --- a/jobs/pool/src/lib/chefs/masterChefV2/index.ts +++ /dev/null @@ -1,187 +0,0 @@ -import { daysInYear, secondsInDay } from 'date-fns/constants' -import { ChainId } from 'sushi/chain' -import { SUSHI } from 'sushi/currency' - -import { SECONDS_BETWEEN_BLOCKS } from 'sushi/config/subgraph' -import { MASTERCHEF_V2_ADDRESS } from '../../../config.js' -import { - divBigIntToNumber, - getPairs, - getTokenBalancesOf, - getTokens, -} from '../../common/index.js' -import type { ChefReturn, Farm } from '../../types.js' -import { - getLpTokens, - getPoolInfos, - getPoolLength, - getRewarderInfos, - getRewarders, - getSushiPerBlock, - getTotalAllocPoint, -} from './fetchers.js' - -export async function getMasterChefV2(): Promise { - const [ - poolLength, - totalAllocPoint, - sushiPerBlock, - rewarderInfos, - averageBlockTime, - ] = await Promise.all([ - getPoolLength(), - getTotalAllocPoint(), - getSushiPerBlock(), - getRewarderInfos(), - SECONDS_BETWEEN_BLOCKS[ChainId.ETHEREUM], - ]) - - console.log( - `MasterChefV2 - pools: ${poolLength}, sushiPerBlock: ${sushiPerBlock}, averageBlockTime: ${averageBlockTime}, rewarderInfos: ${rewarderInfos.length}, totalAllocPoint: ${totalAllocPoint}`, - ) - - const [poolInfos, lpTokens, rewarders, tokens] = await Promise.all([ - getPoolInfos(Number(poolLength)), - getLpTokens(Number(poolLength)), - getRewarders(Number(poolLength)), - getTokens( - [ - ...rewarderInfos.map((rewarder) => rewarder.rewardToken), - SUSHI[ChainId.ETHEREUM].address, - ], - ChainId.ETHEREUM, - ), - ]) - - const [pairs, lpBalances] = await Promise.all([ - getPairs(lpTokens, ChainId.ETHEREUM), - getTokenBalancesOf( - lpTokens, - MASTERCHEF_V2_ADDRESS[ChainId.ETHEREUM], - ChainId.ETHEREUM, - ), - ]) - - const pools = [...Array(Number(poolLength)).keys()].map((_, i) => ({ - id: i, - poolInfo: poolInfos[i], - lpBalance: lpBalances.find(({ token }) => token === lpTokens[i])?.balance, - pair: pairs.find((pair) => pair.id === lpTokens?.[i]?.toLowerCase()), - rewarder: rewarderInfos.find( - (rewarderInfo) => rewarderInfo.id === rewarders?.[i]?.toLowerCase(), - ), - })) - - const blocksPerDay = averageBlockTime ? secondsInDay / averageBlockTime : 0 - const sushiPerDay = - divBigIntToNumber(sushiPerBlock, SUSHI[ChainId.ETHEREUM].decimals) * - blocksPerDay - const sushiPriceUSD = - tokens.find( - (tokenPrice) => - tokenPrice.id === SUSHI[ChainId.ETHEREUM].address.toLowerCase(), - )?.derivedUSD ?? 0 - - return { - chainId: ChainId.ETHEREUM, - farms: pools.reduce>((acc, pool) => { - if (!pool.pair || !pool.lpBalance || !pool.poolInfo) return acc - - let sushiRewardPerDay = - sushiPerDay * - (Number(pool.poolInfo.allocPoint) / Number(totalAllocPoint)) - - // Edge case for virtually disabled rewards - if (sushiRewardPerDay < 0.000001) sushiRewardPerDay = 0 - - const sushiRewardPerYearUSD = - daysInYear * sushiRewardPerDay * sushiPriceUSD - - const stakedLiquidityUSD = - (pool.pair.liquidityUSD * pool.lpBalance) / pool.pair.totalSupply - - const incentives: Farm['incentives'] = [ - { - apr: sushiRewardPerYearUSD / stakedLiquidityUSD, - rewardPerDay: sushiRewardPerDay, - rewardToken: { - address: SUSHI[ChainId.ETHEREUM].address, - name: SUSHI[ChainId.ETHEREUM].name ?? '', - decimals: SUSHI[ChainId.ETHEREUM].decimals ?? 18, - symbol: SUSHI[ChainId.ETHEREUM].symbol ?? '', - }, - rewarder: { - address: MASTERCHEF_V2_ADDRESS[ChainId.ETHEREUM], - type: 'Primary', - }, - }, - ] - - if (pool.rewarder) { - const token = tokens.find( - (token) => token.id === pool.rewarder?.rewardToken, - ) - if (token) { - let rewardPerSecond = 0 - - switch (pool.rewarder.id.toLowerCase()) { - case '0x0000000000000000000000000000000000000000': { - break - } - // LIDO rewarder (rewards have ended) - case '0x75ff3dd673ef9fc459a52e1054db5df2a1101212': { - break - } - // ALCX rewarder (second on subgraph = block irl) - case '0xd101479ce045b903ae14ec6afa7a11171afb5dfa': - case '0x7519c93fc5073e15d89131fd38118d73a72370f8': { - rewardPerSecond = divBigIntToNumber( - pool.rewarder.rewardPerSecond / 12n, - token.decimals, - ) - break - } - // Convex rewarder (rewards have ended) - case '0x9e01aac4b3e8781a85b21d9d9f848e72af77b362': - case '0x1fd97b5e5a257b0b9b9a42a96bb8870cbdd1eb79': { - break - } - default: { - rewardPerSecond = divBigIntToNumber( - pool.rewarder.rewardPerSecond, - token.decimals, - ) - } - } - - const rewardPerDay = secondsInDay * rewardPerSecond - const rewardPerYearUSD = daysInYear * rewardPerDay * token.derivedUSD - - incentives.push({ - apr: rewardPerYearUSD / stakedLiquidityUSD, - rewardPerDay: rewardPerDay, - rewardToken: { - address: pool.rewarder.rewardToken, - name: token.name, - decimals: token.decimals, - symbol: token.symbol, - }, - rewarder: { - address: pool.rewarder.id, - type: 'Secondary', - }, - }) - } - } - - acc[pool.pair.id] = { - id: pool.id, - incentives: incentives, - chefType: 'MasterChefV2', - poolType: pool.pair.type, - } - - return acc - }, {}), - } -} diff --git a/jobs/pool/src/lib/chefs/minichef/fetchers.ts b/jobs/pool/src/lib/chefs/minichef/fetchers.ts deleted file mode 100644 index 9a21e260eb..0000000000 --- a/jobs/pool/src/lib/chefs/minichef/fetchers.ts +++ /dev/null @@ -1,218 +0,0 @@ -import { readContract, readContracts } from '@wagmi/core' -import zip from 'lodash.zip' -import { complexRewarderTimeAbi, miniChefAbi } from 'sushi/abi' -import { ChainId } from 'sushi/chain' - -import { getMiniChefRewarders } from '@sushiswap/graph-client/mini-chef' -import { config } from 'src/lib/wagmi.js' -import { MiniChefChainId } from 'sushi/config' -import { Address } from 'viem' -import { MINICHEF_ADDRESS } from '../../../config.js' - -export async function getPoolLength(chainId: ChainId) { - const poolLengthCall = { - address: MINICHEF_ADDRESS[chainId], - chainId: chainId, - abi: miniChefAbi, - functionName: 'poolLength', - } as const - - return readContract(config, poolLengthCall) -} - -export async function getTotalAllocPoint(chainId: ChainId) { - const totalAllocPointCall = { - address: MINICHEF_ADDRESS[chainId], - chainId: chainId, - abi: miniChefAbi, - functionName: 'totalAllocPoint', - } as const - - return readContract(config, totalAllocPointCall) -} - -export async function getSushiPerSecond(chainId: ChainId) { - const sushiPerSecondCall = { - address: MINICHEF_ADDRESS[chainId], - chainId: chainId, - abi: miniChefAbi, - functionName: 'sushiPerSecond', - } as const - - return readContract(config, sushiPerSecondCall) -} - -export async function getPoolInfos(poolLength: bigint, chainId: ChainId) { - const poolInfoCalls = [...Array(Number(poolLength))].map( - (_, i) => - ({ - address: MINICHEF_ADDRESS[chainId], - args: [BigInt(i)], - chainId: chainId, - abi: miniChefAbi, - functionName: 'poolInfo', - }) as const, - ) - - return readContracts(config, { - allowFailure: true, - contracts: poolInfoCalls, - }).then((results) => - results.map(({ result }) => - result - ? { - accSushiPerShare: result[0], - lastRewardTime: result[1], - allocPoint: result[2], - } - : undefined, - ), - ) -} - -export async function getLpTokens(poolLength: bigint, chainId: ChainId) { - const lpTokenCalls = [...Array(Number(poolLength))].map( - (_, i) => - ({ - address: MINICHEF_ADDRESS[chainId], - args: [BigInt(i)], - chainId: chainId, - abi: miniChefAbi, - functionName: 'lpToken', - }) as const, - ) - - return readContracts(config, { - allowFailure: true, - contracts: lpTokenCalls, - }).then((results) => results.map(({ result }) => result)) -} - -export async function getRewarders(poolLength: bigint, chainId: ChainId) { - const rewarderCalls = [...Array(Number(poolLength))].map( - (_, i) => - ({ - address: MINICHEF_ADDRESS[chainId], - args: [BigInt(i)], - chainId: chainId, - abi: miniChefAbi, - functionName: 'rewarder', - }) as const, - ) - - return readContracts(config, { - allowFailure: true, - contracts: rewarderCalls, - }).then((results) => results.map(({ result }) => result)) -} - -export async function getRewarderInfos(chainId: MiniChefChainId) { - const rewarders = await getMiniChefRewarders({ chainId }) - console.log(`Retrieved ${rewarders.length} rewarders from ${chainId}`) - - return Promise.all( - rewarders.map(async (rewarder) => { - try { - // single-rewarders, no need to fetch anything for those, can just return - const blacklist: Record = { - [ChainId.POLYGON]: [ - '0xb52b4b6779553a89e7f5f6f1d463595d88e88822', - '0x0fc98e524095f7a0f09eb9786beba120060f8004', - '0x9e21698426a29c32d7c0fdaeb7723c9856ba9ac7', - '0x71581bf0ce397f50f87cc2490146d30a1e686461', - '0x4db1c6364924b90310d68948fc7a3121fa9edf10', - '0x99246001c6e458c63052fb4e3d04df6bd932a6a7', - '0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0', - '0x78b8abe9e6bf27d3ea68da096921b77efcfd389c', - ], - [ChainId.ARBITRUM]: [ - '0x9c37b0b498da78830284afdcb534c3350b52e744', - '0x948bfbb7bdb7e74ec8ed0859c79502408bee4de1', - '0xec932d20ba851ac26630835771476dc2d1a3ac8d', - '0xf6348d37950c79b9f7b02b4d97e04db7dea855ae', - '0x1a9c20e2b0ac11ebecbdca626bba566c4ce8e606', - '0xae961a7d116bfd9b2534ad27fe4d178ed188c87a', - '0x3c61b93b64f59b5091a11a071083598ee8b5cb64', - '0x1a140bed2ec8ce72ee3723d18fd5d50851e455fd', - '0xccc3760a0a315937877687bc99df4edb0f7315b4', - '0x294eadcc534084c1333dc99e1afcf3e92c5c1297', - '0xb873813f710093cbc17836297a6fefcfc6989faf', - '0xa15a0789112d9aa7e40e76bfaa39ae36cc0aad3c', - ], - [ChainId.GNOSIS]: [ - '0xb291149e478dbdd2cd2528ad4088ee5c8376df1e', - '0xc375411c6597f692add6a7a3ad5b3c38626b0f26', - ], - [ChainId.ARBITRUM_NOVA]: [ - '0x3f505b5cff05d04f468db65e27e72ec45a12645f', - '0x840ecabcad4d6b8d25a9bb853ae32eac467e017b', - '0x16ac10499ad2712a847641996e0aab97e90305fa', - '0x948bfbb7bdb7e74ec8ed0859c79502408bee4de1', - '0x3f505b5cff05d04f468db65e27e72ec45a12645f', - ], - } - - if ( - blacklist[chainId]?.includes(rewarder.id) || - rewarder.id === '0x0000000000000000000000000000000000000000' - ) { - return { - id: rewarder.id as Address, - rewardToken: rewarder.address, - rewardPerSecond: BigInt(rewarder.rewardPerSecond), - } - } - - const poolLength = await getPoolLength(chainId) - - const poolIds = - poolLength !== 0n ? [...Array(Number(poolLength)).keys()] : [] - - const poolInfoCalls = poolIds.map( - (_, i) => - ({ - address: rewarder.id as Address, - args: [BigInt(i)], - chainId: chainId, - abi: complexRewarderTimeAbi, - functionName: 'poolInfo', - }) as const, - ) - - const poolInfos = await readContracts(config, { - allowFailure: true, - contracts: poolInfoCalls, - }) - - const zipped = zip(poolIds, poolInfos) - const successful = zipped - .filter(([, poolInfo]) => poolInfo?.result) - .map(([poolId, poolInfo]) => [poolId, poolInfo!.result!] as const) - - return { - id: rewarder.id, - pools: successful.map(([id, [, , allocPoint]]) => ({ - // Minichef pool ID - id, - allocPoint: Number(allocPoint), - })), - totalAllocPoint: successful.reduce((acc, [, [, , allocPoint]]) => { - acc += allocPoint - return acc - }, 0n), - rewardToken: rewarder.address, - rewardPerSecond: BigInt(rewarder.rewardPerSecond), - } - } catch (error) { - console.log('error', chainId, rewarder.id, error) - - // so that the script doesn't fail on new should-be-blacklisted pools - return { - id: rewarder.id, - rewardToken: rewarder.address, - rewardPerSecond: BigInt(rewarder.rewardPerSecond), - } - } - }), - ) -} diff --git a/jobs/pool/src/lib/chefs/minichef/index.ts b/jobs/pool/src/lib/chefs/minichef/index.ts deleted file mode 100644 index 5e9971e3ec..0000000000 --- a/jobs/pool/src/lib/chefs/minichef/index.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { daysInYear, secondsInDay } from 'date-fns/constants' -import { ChainId } from 'sushi/chain' -import { SUSHI, SUSHI_ADDRESS } from 'sushi/currency' - -import { MiniChefChainId } from 'sushi/config' -import { MINICHEF_ADDRESS } from '../../../config.js' -import { - divBigIntToNumber, - getPairs, - getTokenBalancesOf, - getTokens, -} from '../../common/index.js' -import type { ChefReturn, Farm } from '../../types.js' -import { - getLpTokens, - getPoolInfos, - getPoolLength, - getRewarderInfos, - getRewarders, - getSushiPerSecond, - getTotalAllocPoint, -} from './fetchers.js' - -export async function getMinichef( - chainId: MiniChefChainId, -): Promise { - try { - if (!(chainId in SUSHI)) { - return { chainId, farms: null } - } - - const [ - poolLength, - totalAllocPoint, - sushiPerSecond, - rewarderInfos, - [{ derivedUSD: sushiPriceUSD }], - ] = await Promise.all([ - getPoolLength(chainId), - getTotalAllocPoint(chainId), - getSushiPerSecond(chainId), - getRewarderInfos(chainId), - getTokens([SUSHI_ADDRESS[ChainId.ETHEREUM]], ChainId.ETHEREUM), - ]) - const sushiPerDay = - secondsInDay * - divBigIntToNumber( - sushiPerSecond, - SUSHI[chainId as keyof typeof SUSHI]?.decimals ?? 18, - ) - - console.log( - `MiniChef ${chainId} - pools: ${poolLength}, sushiPerDay: ${sushiPerDay}, rewarderInfos: ${rewarderInfos.length}, totalAllocPoint: ${totalAllocPoint}`, - ) - - const [poolInfos, lpTokens, rewarders, tokens] = await Promise.all([ - getPoolInfos(poolLength, chainId), - getLpTokens(poolLength, chainId), - getRewarders(poolLength, chainId), - getTokens( - rewarderInfos.map((rewarder) => rewarder?.rewardToken), - chainId, - ), - ]) - - const [pairs, lpBalances] = await Promise.all([ - getPairs(lpTokens.filter(Boolean) as string[], chainId), - getTokenBalancesOf( - lpTokens.filter(Boolean) as string[], - MINICHEF_ADDRESS[chainId], - chainId, - ), - ]) - - const pools = [...Array(Number(poolLength))].map((_, i) => { - return { - id: i, - poolInfo: poolInfos[i], - lpBalance: lpBalances.find(({ token }) => token === lpTokens[i]) - ?.balance, - pair: pairs.find((pair) => pair.id === lpTokens?.[i]?.toLowerCase()), - rewarder: rewarderInfos.find( - (rewarderInfo) => rewarderInfo.id === rewarders?.[i]?.toLowerCase(), - ), - } - }) - - return { - chainId, - farms: pools.reduce>((acc, pool) => { - if (!pool.pair || typeof pool.lpBalance !== 'number' || !pool.poolInfo) - return acc - - let sushiRewardPerDay = - sushiPerDay * - (Number(pool.poolInfo.allocPoint) / Number(totalAllocPoint)) - - // Edge case for virtually disabled rewards - if (sushiRewardPerDay < 0.000001) sushiRewardPerDay = NaN - - const sushiRewardPerYearUSD = - daysInYear * sushiRewardPerDay * sushiPriceUSD - - const stakedLiquidityUSD = - (pool.pair.liquidityUSD * pool.lpBalance) / pool.pair.totalSupply - - const incentives: Farm['incentives'] = [] - - if (!Number.isNaN(sushiRewardPerDay)) { - incentives.push({ - apr: sushiRewardPerYearUSD / stakedLiquidityUSD, - rewardPerDay: sushiRewardPerDay, - rewardToken: { - address: SUSHI[chainId as keyof typeof SUSHI]?.address ?? '', - name: SUSHI[chainId as keyof typeof SUSHI]?.name ?? '', - decimals: SUSHI[chainId as keyof typeof SUSHI]?.decimals ?? 18, - symbol: SUSHI[chainId as keyof typeof SUSHI]?.symbol ?? '', - }, - rewarder: { - address: MINICHEF_ADDRESS[chainId], - type: 'Primary', - }, - }) - } - - if (pool.rewarder) { - const token = tokens.find( - (token) => token.id === pool.rewarder?.rewardToken, - ) - - if (token) { - let rewardPerSecond = 0 - // Multipool rewarder - if (pool.rewarder.pools) { - const poolInfo = pool.rewarder.pools.find( - (rewaderPool) => rewaderPool.id === pool.id, - ) - - if (poolInfo) { - // poolInfo.allocPoint.div(masterChefV2.totalAllocPoint).times(masterChefV2.sushiPerDay) - rewardPerSecond = - (poolInfo.allocPoint / - Number(pool.rewarder.totalAllocPoint)) * - divBigIntToNumber( - pool.rewarder.rewardPerSecond, - token.decimals, - ) - } - - // Singlepool rewarder - } else { - rewardPerSecond = divBigIntToNumber( - pool.rewarder.rewardPerSecond, - token.decimals, - ) - } - - // Edge case for virtually disabled rewards - if (rewardPerSecond < 0.000001) sushiRewardPerDay = NaN - - if (!Number.isNaN(rewardPerSecond)) { - const rewardPerDay = secondsInDay * rewardPerSecond - const rewardPerYearUSD = - daysInYear * rewardPerDay * token.derivedUSD - - incentives.push({ - apr: rewardPerYearUSD / stakedLiquidityUSD, - rewardPerDay: rewardPerDay, - rewardToken: { - address: pool.rewarder.rewardToken, - name: token.name, - decimals: token.decimals, - symbol: token.symbol, - }, - rewarder: { - address: pool.rewarder.id, - type: 'Secondary', - }, - }) - } - } - } - - acc[pool.pair.id] = { - id: pool.id, - incentives: incentives, - chefType: 'MiniChef', - poolType: pool.pair.type, - } - - return acc - }, {}), - } - } catch (e) { - console.log(chainId, e) - return { chainId, farms: null } - } -} diff --git a/jobs/pool/src/lib/common/index.ts b/jobs/pool/src/lib/common/index.ts deleted file mode 100644 index 25cf97f017..0000000000 --- a/jobs/pool/src/lib/common/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './pairs.js' -export * from './tokens.js' -export * from './utils.js' diff --git a/jobs/pool/src/lib/common/pairs.ts b/jobs/pool/src/lib/common/pairs.ts deleted file mode 100644 index 8cd8f543e8..0000000000 --- a/jobs/pool/src/lib/common/pairs.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { getSushiV2Pools } from '@sushiswap/graph-client/sushi-v2' -import { SushiSwapV2ChainId } from 'sushi/config' -import { Address } from 'viem' -import type { Farm } from '../types.js' -import { divBigIntToNumber } from './utils.js' - -interface Pair { - id: string - totalSupply: number - liquidityUSD: number - type: Farm['poolType'] -} - -async function getExchangePairs( - ids: string[], - chainId: SushiSwapV2ChainId, -): Promise { - const pairs = await getSushiV2Pools( - { - chainId, - first: ids.length, - where: { id_in: ids.map((id) => id.toLowerCase() as Address) }, - }, - { retries: 3 }, - ) - return pairs.map((pair) => { - return { - id: pair.address.toLowerCase(), - totalSupply: divBigIntToNumber(BigInt(pair.liquidity), 18), - liquidityUSD: pair.liquidityUSD, - type: 'Legacy', - } - }) -} - -export async function getPairs(ids: string[], chainId: SushiSwapV2ChainId) { - return await getExchangePairs(ids, chainId) -} diff --git a/jobs/pool/src/lib/common/tokens.ts b/jobs/pool/src/lib/common/tokens.ts deleted file mode 100644 index 0ea5d7300e..0000000000 --- a/jobs/pool/src/lib/common/tokens.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { readContracts } from '@wagmi/core' -import { Chain, ChainId } from 'sushi/chain' - -import { getSushiV2Tokens } from '@sushiswap/graph-client/sushi-v2' -import { SushiSwapV2ChainId } from 'sushi/config' -import { Address, erc20Abi } from 'viem' -import { getTokenPrices } from '../price.js' -import { config } from '../wagmi.js' -import { divBigIntToNumber } from './utils.js' - -interface Token { - id: string - symbol: string - name: string - decimals: number - liquidity: number - derivedUSD: number -} - -const getExchangeTokens = async ( - ids: string[], - chainId: SushiSwapV2ChainId, -): Promise => { - const [tokens, tokenPrices] = await Promise.all([ - getSushiV2Tokens( - { - chainId, - where: { id_in: ids.map((id) => id.toLowerCase() as Address) }, - }, - { retries: 3 }, - ), - getTokenPrices({ chainId }), - ]) - - return tokens.map((token) => ({ - id: token.address.toLowerCase(), - symbol: token.symbol, - name: token.name, - decimals: Number(token.decimals), - liquidity: Number(token.totalLiquidity), - derivedUSD: tokenPrices[token.address] || 0, - })) -} - -export const getTokens = async (ids: string[], chainId: SushiSwapV2ChainId) => { - return await getExchangeTokens(ids, chainId) -} - -export async function getTokenBalancesOf( - _tokens: string[], - address: string, - chainId: ChainId, -) { - // not fully erc20, farm not active - const tokens = _tokens.filter( - (token) => token !== '0x0c810E08fF76E2D0beB51B10b4614b8f2b4438F9', - ) - - const balanceOfCalls = tokens.map( - (token) => - ({ - address: token as Address, - args: [address as Address], - chainId: chainId, - abi: erc20Abi, - functionName: 'balanceOf', - }) as const, - ) - - const decimalCalls = tokens.map( - (token) => - ({ - address: token as Address, - chainId: chainId, - abi: erc20Abi, - functionName: 'decimals', - }) as const, - ) - - const [balancesOf, decimals] = await Promise.all([ - readContracts(config, { - allowFailure: true, - contracts: balanceOfCalls, - }), - readContracts(config, { - allowFailure: true, - contracts: decimalCalls, - }), - ]) - - return tokens - .map((token, i) => { - const balance = balancesOf[i].result - const decimal = decimals[i].result - - if ( - balance === null || - balance === undefined || - decimal === null || - decimal === undefined - ) { - console.log( - `Balance / decimal fetch failed for ${token} on ${ - Chain.from(chainId)?.shortName - }`, - ) - return null - } - - return { - token, - // so that we don't need to seed new pairs - balance: balance === 0n ? 1 : divBigIntToNumber(balance, decimal), - } - }) - .filter((token): token is NonNullable => Boolean(token)) -} diff --git a/jobs/pool/src/lib/common/utils.ts b/jobs/pool/src/lib/common/utils.ts deleted file mode 100644 index d2a08e0946..0000000000 --- a/jobs/pool/src/lib/common/utils.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { formatUnits } from 'viem' - -export const divBigIntToNumber = (value: bigint, decimals: number): number => - Number(formatUnits(value, decimals)) - -/** - * Formula source: http://www.linked8.com/blog/158-apy-to-apr-and-apr-to-apy-calculation-methodologies - * - * @param apr {Number} APR as percentage (ie. 5.82) - * @param frequency {Number} Compounding frequency (times a year) - * @returns {Number} APY as percentage (ie. 6 for APR of 5.82%) - */ -export const aprToApy = (apr: number | string, frequency: number) => - ((1 + Number(apr) / 100 / frequency) ** frequency - 1) * 100 diff --git a/jobs/pool/src/lib/index.ts b/jobs/pool/src/lib/index.ts deleted file mode 100644 index 42e2cffb79..0000000000 --- a/jobs/pool/src/lib/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './chefs/index.js' -export * from './common/index.js' -export * from './wagmi.js' diff --git a/jobs/pool/src/lib/price.ts b/jobs/pool/src/lib/price.ts deleted file mode 100644 index 2873a093b5..0000000000 --- a/jobs/pool/src/lib/price.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { ChainId } from 'sushi/chain' - -export async function getTokenPrices({ - chainId, -}: { - chainId: ChainId -}): Promise> { - return fetch(`https://api.sushi.com/price/v1/${chainId}`) - .then((res) => res.json()) - .then((prices: Record) => - Object.entries(prices).reduce( - (acc, [key, value]) => { - acc[key.toLowerCase()] = value - return acc - }, - {}, - ), - ) - .catch((e) => { - console.error('Error fetching token prices', chainId, e) - throw e - }) -} diff --git a/jobs/pool/src/lib/prisma.ts b/jobs/pool/src/lib/prisma.ts deleted file mode 100644 index 5175c68b5b..0000000000 --- a/jobs/pool/src/lib/prisma.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { createDirectClient } from '@sushiswap/database' - -export const client = await createDirectClient() diff --git a/jobs/pool/src/lib/types.ts b/jobs/pool/src/lib/types.ts deleted file mode 100644 index f1e00448e5..0000000000 --- a/jobs/pool/src/lib/types.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ChainId } from 'sushi/chain' - -export interface Farm { - id: number - incentives: { - apr: number - rewardPerDay: number - rewardToken: { - address: string - name: string - decimals: number - symbol: string - } - rewarder: { - address: string - type: 'Primary' | 'Secondary' - } - }[] - chefType: 'MasterChefV1' | 'MasterChefV2' | 'MiniChef' - poolType: 'Legacy' | 'Trident' | 'Kashi' | 'Unknown' -} - -export interface ChefReturn { - chainId: ChainId - farms: Record | null -} diff --git a/jobs/pool/src/lib/wagmi.ts b/jobs/pool/src/lib/wagmi.ts deleted file mode 100644 index c333647cdc..0000000000 --- a/jobs/pool/src/lib/wagmi.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { publicWagmiConfig } from '@sushiswap/wagmi-config' -import { createConfig } from '@wagmi/core' - -export const config = createConfig({ - ...publicWagmiConfig, -}) diff --git a/jobs/pool/src/merkl-incentives.ts b/jobs/pool/src/merkl-incentives.ts deleted file mode 100644 index 6e66e1b58e..0000000000 --- a/jobs/pool/src/merkl-incentives.ts +++ /dev/null @@ -1,372 +0,0 @@ -import 'dotenv/config' -import './lib/wagmi.js' - -import { ChefType, Prisma, RewarderType } from '@sushiswap/database' -import { fetchToken } from '@wagmi/core' -import { fetch } from '@whatwg-node/fetch' -import { performance } from 'perf_hooks' -import { ChainId } from 'sushi/chain' - -import { Address } from 'viem' -import { filterIncentives } from './etl/incentive/index.js' -import { mergeIncentives } from './etl/incentive/load.js' -import { updatePoolsWithIncentivesTotalApr } from './etl/pool/index.js' -import { createTokens, getMissingTokens } from './etl/token/load.js' -import { config } from './lib/wagmi.js' - -const TEST_TOKENS = [{ name: 'Angle Merkl', symbol: 'anglaMerkl' }] -const isTestToken = (token: TokenSuccess) => - TEST_TOKENS.every( - (testToken) => - testToken.name === token.token.name || - testToken.symbol === token.token.symbol, - ) - -const isTokenSuccessResponse = ( - token: TokenSuccess | TokenError, -): token is TokenSuccess => token.status === 'ok' -const isTokenErrorResponse = ( - token: TokenSuccess | TokenError, -): token is TokenError => token.status === 'error' - -type MerklResponse = { - [chainId: string]: ChainData -} - -type ChainData = { - pools: { - [poolId: string]: Pool - } -} - -type Pool = { - amm: number - ammAlgo: number - ammAlgoName: string - ammName: string - aprs: Record // Changed from array to Record - chainId: number - decimalsToken0: number - decimalsToken1: number - disputeLive: boolean - distributionData: MerklDistribution[] - endOfDisputePeriod: number - meanAPR: number - pool: string - poolBalanceToken0: number - poolBalanceToken1: number - poolFee: number - poolTotalLiquidity: number - rewardsPerToken: Record // Update this type based on the actual structure - symbolToken0: string - symbolToken1: string - tick: number - token0: string - token1: string - tvl: number -} - -type MerklDistribution = { - amount: number - apr: number - blacklist: string[] - breakdown: Record // Adjust the type based on the actual structure - decimalsRewardToken: number - endTimestamp: number - id: string - isBoosted: boolean - isLive: boolean - isMock: boolean - isOutOfRangeIncentivized: boolean - propFees: number - propToken0: number - propToken1: number - rewardToken: string - startTimestamp: number - symbolRewardToken: string - unclaimed: number - whitelist: string[] -} - -type PriceResponse = { - [token: string]: number -} - -type PriceMap = { - [chainId: number]: PriceResponse -} - -type TokenSuccess = { - status: 'ok' - chainId: number - token: Prisma.TokenCreateManyInput -} - -type TokenError = { - status: 'error' - chainId: number - token: { - id: string - } -} - -const MERKL_SUPPORTED_NETWORKS = [ - ChainId.ETHEREUM, - ChainId.OPTIMISM, - ChainId.BASE, - ChainId.BSC, - ChainId.GNOSIS, - ChainId.POLYGON, - ChainId.ARBITRUM, - ChainId.CELO, - ChainId.AVALANCHE, - ChainId.POLYGON_ZKEVM, - ChainId.THUNDERCORE, - ChainId.CORE, - ChainId.BLAST, - ChainId.SCROLL, - ChainId.LINEA, - ChainId.SKALE_EUROPA, - ChainId.ROOTSTOCK, -] - -export async function execute() { - try { - console.log('Preparing to load merkl farms/incentives') - const startTime = performance.now() - - // EXTRACT - const merkls = await extract() - console.log('EXTRACT - Extracted merkl incentives.') - const prices = ( - await Promise.all( - MERKL_SUPPORTED_NETWORKS.map((chainId) => - fetch(`https://api.sushi.com/price/v1/${chainId}`).then( - (data) => data.json() as Promise, - ), - ), - ) - ).reduce((acc: PriceMap, prices: PriceResponse, index: number) => { - const chainId = MERKL_SUPPORTED_NETWORKS[index] - acc[chainId] = Object.keys(prices).reduce((result, key) => { - result[key.toLowerCase()] = prices[key] - return result - }, {} as PriceResponse) - return acc - }, {}) - - // TRANSFORM - const { incentivesToCreate, incentivesToUpdate, tokens } = await transform( - merkls, - prices, - ) - - console.log( - `TRANSFORM - ${incentivesToCreate.length} incentives to create, ${incentivesToUpdate.length} incentives to update, ${tokens.length} tokens to create.`, - ) - - // LOAD - await createTokens(tokens) - await mergeIncentives(incentivesToCreate, incentivesToUpdate) - await updatePoolsWithIncentivesTotalApr() - - const endTime = performance.now() - console.log( - `COMPLETE - Script ran for ${((endTime - startTime) / 1000).toFixed( - 1, - )} seconds. `, - ) - } catch (e) { - console.error(e) - } -} - -async function extract() { - const response = await fetch('https://api.angle.money/v2/merkl') - if (response.status !== 200) { - throw new Error('Failed to fetch merkl incentives.') - } - return response.json() as Promise -} - -async function transform( - response: MerklResponse, - prices: PriceMap, -): Promise<{ - incentivesToCreate: Prisma.IncentiveCreateManyInput[] - incentivesToUpdate: Prisma.IncentiveCreateManyInput[] - tokens: Prisma.TokenCreateManyInput[] -}> { - let incentives: Prisma.IncentiveCreateManyInput[] = [] - const tokensToCreate: Prisma.TokenCreateManyInput[] = [] - const rewardTokens: Map = - new Map() - - const pools: { address: string; pool: Pool }[] = [] - - for (const [chainId, value] of Object.entries(response)) { - if ((MERKL_SUPPORTED_NETWORKS as number[]).includes(Number(chainId))) { - const chainPools = Object.entries(value.pools).map(([address, pool]) => ({ - address, - pool, - })) - pools.push(...chainPools) - } - } - - const sushiPools = pools.filter((item) => item.pool.ammName === 'SushiSwapV3') - - if ( - response === undefined || - sushiPools === undefined || - sushiPools.length === 0 - ) { - return { incentivesToCreate: [], incentivesToUpdate: [], tokens: [] } - } - sushiPools.forEach(({ address, pool }) => { - if (pool.distributionData.length > 0) { - const rewardsByToken: Map = new Map() - // Group rewards by token - for (const distributionData of pool.distributionData) { - if (!rewardsByToken.has(distributionData.rewardToken)) { - rewardsByToken.set(distributionData.rewardToken, []) - } - rewardsByToken.get(distributionData.rewardToken)!.push(distributionData) - } - - for (const [token, rewards] of rewardsByToken) { - const rewardPerDay = rewards.reduce((acc, distData) => { - if ( - !distData.isLive || - distData.isMock || - !(MERKL_SUPPORTED_NETWORKS as number[]).includes(pool.chainId) || - distData.whitelist.length > 0 - ) { - return acc - } - const duration = distData.endTimestamp - distData.startTimestamp - const durationInDays = duration / 86400 - const amountPerDay = distData.amount / durationInDays - return acc + amountPerDay - }, 0) - - const price = prices[pool.chainId][token.toLowerCase()] ?? 0 - const rewardPerYearUSD = 365 * rewardPerDay * price - const apr = pool.tvl ? rewardPerYearUSD / pool.tvl : 0 - - const incentive = Prisma.validator()({ - id: address - .toLowerCase() - .concat(':') - .concat(token.toLowerCase()) - .concat(':') - .concat('merkl'), - chainId: pool.chainId, - chefType: ChefType.Merkl, - apr: Number.isNaN(apr) || apr === Infinity ? 0 : apr, - rewardTokenId: pool.chainId - .toString() - .concat(':') - .concat(token.toLowerCase()), - rewardPerDay: rewardPerDay, - poolId: pool.chainId - .toString() - .concat(':') - .concat(address.toLowerCase()), - pid: 0, // Does not exist for merkl - rewarderAddress: '0x0000000000000000000000000000000000000000', - rewarderType: RewarderType.Primary, - }) - incentives.push(incentive) - rewardTokens.set(`${pool.chainId}:${token.toLowerCase()}`, { - chainId: pool.chainId as ChainId, - address: token.toLowerCase() as Address, - }) - } - } - }) - - const missingTokens = await getMissingTokens( - Array.from(rewardTokens.values()), - ) - if (missingTokens.length > 0) { - const tokens = await Promise.all( - missingTokens.map((token) => fetchTokenFromContract(token)), - ) - const validTokens = tokens - .filter(isTokenSuccessResponse) - .map((token) => token.token) - tokensToCreate.push(...validTokens) - const invalidTokens = tokens.filter(isTokenErrorResponse) - incentives = incentives.filter((incentive) => - invalidTokens.every( - (token) => token.token.id !== incentive.rewardTokenId, - ), - ) - } else { - console.log('TRANSFORM - All reward tokens already exist in db.') - } - - const { incentivesToCreate, incentivesToUpdate } = - await filterIncentives(incentives) - return { incentivesToCreate, incentivesToUpdate, tokens: tokensToCreate } -} - -async function fetchTokenFromContract(token: { - chainId: ChainId - address: Address -}): Promise { - try { - const tokenFromContract = await fetchToken(config, { - chainId: token.chainId, - address: token.address, - }) - const errorResponse: TokenError = { - status: 'error', - chainId: token.chainId, - token: { - id: token.chainId - .toString() - .concat(':') - .concat(token.address.toLowerCase()), - }, - } - - if (tokenFromContract?.decimals) { - const response: TokenSuccess = { - status: 'ok', - chainId: token.chainId, - token: { - id: token.chainId - .toString() - .concat(':') - .concat(tokenFromContract.address.toLowerCase()), - chainId: token.chainId, - address: tokenFromContract.address.toString(), - name: tokenFromContract.name!, - symbol: tokenFromContract.symbol!, - decimals: tokenFromContract.decimals, - }, - } - if (!isTestToken(response)) { - return response - } else { - return errorResponse - } - } - return errorResponse - } catch (e: any) { - const id = token.chainId - .toString() - .concat(':') - .concat(token.address.toLowerCase()) - console.error(`Error fetching token ${id}, error: ${e.message}`) - return { - status: 'error', - chainId: token.chainId, - token: { - id, - }, - } as TokenError - } -} diff --git a/jobs/pool/src/misc/manage-token.ts b/jobs/pool/src/misc/manage-token.ts deleted file mode 100644 index 21309359ef..0000000000 --- a/jobs/pool/src/misc/manage-token.ts +++ /dev/null @@ -1,129 +0,0 @@ -import '../lib/wagmi.js' - -import { isAddress } from '@ethersproject/address' -import { fetchToken } from '@wagmi/core' -import { client } from 'src/lib/prisma.js' -import { ChainId, chainIds, chains } from 'sushi/chain' -import { Address } from 'viem' -import { config } from '../lib/wagmi.js' - -class Token { - id: string - chainId: ChainId - address: Address - status: 'APPROVED' | 'DISAPPROVED' | 'UNKNOWN' | undefined - isFeeOnTransfer: boolean | undefined - isCommon: boolean | undefined - constructor( - chainId: ChainId, - address: Address, - status: 'APPROVED' | 'DISAPPROVED' | 'UNKNOWN' | undefined = undefined, - isFeeOnTransfer: boolean | undefined = undefined, - isCommon: boolean | undefined = undefined, - ) { - if (!isAddress(address)) { - throw new Error(`Invalid address: ${address}`) - } - if (!chains[chainId]) { - throw new Error( - `Invalid chainId, ${chainId}, valid chains are ${chainIds.join(', ')}`, - ) - } - this.id = `${chainId}:${address.toLowerCase()}` - this.chainId = chainId - this.status = status - this.address = address.toLowerCase() as Address - this.isFeeOnTransfer = isFeeOnTransfer - this.isCommon = isCommon - } -} - -export async function main() { - // const token = new Token(56288, '0x4a2c2838c3907D024916c3f4Fe07832745Ae4bec', 'APPROVED') - const token = new Token(1, '0x', 'DISAPPROVED') - try { - const foundToken = await client.token.findFirst({ - where: { - id: token.id, - }, - }) - if (foundToken) { - let data = {} - if (token.status) { - data = { status: token.status } - } - if (token.isFeeOnTransfer !== undefined) { - data = { ...data, isFeeOnTransfer: token.isFeeOnTransfer } - } - if (token.isCommon !== undefined) { - data = { ...data, isCommon: token.isCommon } - } - if (Object.keys(data).length === 0) { - console.log( - `Token ${token.id} exist and no data was provided to update.`, - ) - } - const updatedToken = await client.token.update({ - where: { - id: token.id, - }, - data, - }) - console.log(`Token updated, new data: - ID: ${updatedToken.id} - CHAINID: ${updatedToken.chainId} - ADDRESS: ${updatedToken.address} - NAME: ${updatedToken.name} - SYMBOL: ${updatedToken.symbol} - DECIMALS: ${updatedToken.decimals} - STATUS: ${updatedToken.status} - FOT: ${updatedToken.isFeeOnTransfer} - COMMON: ${updatedToken.isCommon} - `) - } else { - const tokenFromContract = await fetchTokenFromContract(token) - const newToken = await client.token.create({ - data: { - id: token.id, - chainId: token.chainId, - ...tokenFromContract, - status: token.status, - isFeeOnTransfer: token.isFeeOnTransfer, - isCommon: token.isCommon, - }, - }) - console.log(`Token was not found in the database, the token was fetched from the contract and then created: - ID: ${newToken.id} - CHAINID: ${newToken.chainId} - ADDRESS: ${newToken.address} - NAME: ${newToken.name} - SYMBOL: ${newToken.symbol} - DECIMALS: ${newToken.decimals} - STATUS: ${newToken.status} - FOT: ${newToken.isFeeOnTransfer} - COMMON: ${newToken.isCommon} - `) - } - } catch (e) { - console.error(e) - } -} - -async function fetchTokenFromContract(token: Token) { - const tokenFromContract = await fetchToken(config, { - chainId: token.chainId, - address: token.address, - }) - if (tokenFromContract) { - return { - address: tokenFromContract.address, - name: tokenFromContract.name!, - symbol: tokenFromContract.symbol!, - decimals: tokenFromContract.decimals, - } - } else { - throw new Error(`Not ERC20? ${token.id}`) - } -} - -main() diff --git a/jobs/pool/src/misc/merkl-mock-response.json b/jobs/pool/src/misc/merkl-mock-response.json deleted file mode 100644 index ad724b3ea5..0000000000 --- a/jobs/pool/src/misc/merkl-mock-response.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "pools": { - "0xFf5713FdbAD797b81539b5F9766859d4E050a6CC": { - "aprs": { - "Average APR (rewards / pool TVL)": 92.798642353471, - "SUSHI APR (rewards for SUSHI / SUSHI TVL)": 52.367925908524576, - "WETH APR (rewards for WETH / WETH TVL)": 74.12689133589781 - }, - "decimalToken0": 18, - "decimalToken1": 18, - "liquidity": 490.6719642747023, - "meanAPR": 92.798642353471, - "pool": "0xFf5713FdbAD797b81539b5F9766859d4E050a6CC", - "poolFee": 0.3, - "rewardsPerToken": {}, - "token0": "0x0b3F868E0BE5597D5DB7fEB59E1CADBb0fdDa50a", - "token0InPool": 4285.875501472752, - "token1": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", - "token1InPool": 2.0668213358218335, - "tokenSymbol0": "SUSHI", - "tokenSymbol1": "WETH", - "tvl": 7625.542191750643, - "userBalances": [], - "userTVL": 0, - "userTotalBalance0": 0, - "userTotalBalance1": 0, - "distributionData": [ - { - "amm": 1, - "amount": 1, - "breakdown": {}, - "end": 1685534400, - "isOutOfRangeIncentivized": false, - "propFees": 10, - "propToken0": 45, - "propToken1": 45, - "start": 1684324800, - "token": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619", - "tokenSymbol": "WETH", - "unclaimed": 0, - "wrappers": [] - }, - { - "amm": 1, - "amount": 97, - "breakdown": {}, - "end": 1685534400, - "isOutOfRangeIncentivized": false, - "propFees": 10, - "propToken0": 45, - "propToken1": 45, - "start": 1684324800, - "token": "0x0b3F868E0BE5597D5DB7fEB59E1CADBb0fdDa50a", - "tokenSymbol": "SUSHI", - "unclaimed": 0, - "wrappers": [] - }, - { - "amm": 1, - "amount": 4.85, - "breakdown": {}, - "end": 1684573200, - "isOutOfRangeIncentivized": false, - "propFees": 50, - "propToken0": 25, - "propToken1": 25, - "start": 1684400400, - "token": "0x0b3F868E0BE5597D5DB7fEB59E1CADBb0fdDa50a", - "tokenSymbol": "SUSHI", - "unclaimed": 0, - "wrappers": [] - }, - { - "amm": 1, - "amount": 4.85, - "breakdown": {}, - "end": 1684573200, - "isOutOfRangeIncentivized": false, - "propFees": 60, - "propToken0": 10, - "propToken1": 30, - "start": 1684400400, - "token": "0x0b3F868E0BE5597D5DB7fEB59E1CADBb0fdDa50a", - "tokenSymbol": "SUSHI", - "unclaimed": 0, - "wrappers": [] - }, - { - "amm": 1, - "amount": 4.85, - "breakdown": {}, - "end": 1684573200, - "isOutOfRangeIncentivized": false, - "propFees": 70, - "propToken0": 5, - "propToken1": 25, - "start": 1684400400, - "token": "0x0b3F868E0BE5597D5DB7fEB59E1CADBb0fdDa50a", - "tokenSymbol": "SUSHI", - "unclaimed": 0, - "wrappers": [] - }, - { - "amm": 1, - "amount": 4.85, - "breakdown": {}, - "end": 1684573200, - "isOutOfRangeIncentivized": false, - "propFees": 40, - "propToken0": 40, - "propToken1": 20, - "start": 1684400400, - "token": "0x0b3F868E0BE5597D5DB7fEB59E1CADBb0fdDa50a", - "tokenSymbol": "SUSHI", - "unclaimed": 0, - "wrappers": [] - }, - { - "amm": 1, - "amount": 4.85, - "breakdown": {}, - "end": 1684573200, - "isOutOfRangeIncentivized": false, - "propFees": 25, - "propToken0": 25, - "propToken1": 50, - "start": 1684400400, - "token": "0x0b3F868E0BE5597D5DB7fEB59E1CADBb0fdDa50a", - "tokenSymbol": "SUSHI", - "unclaimed": 0, - "wrappers": [] - }, - { - "amm": 1, - "amount": 4.85, - "breakdown": {}, - "end": 1684573200, - "isOutOfRangeIncentivized": false, - "propFees": 10, - "propToken0": 20, - "propToken1": 70, - "start": 1684400400, - "token": "0x0b3F868E0BE5597D5DB7fEB59E1CADBb0fdDa50a", - "tokenSymbol": "SUSHI", - "unclaimed": 0, - "wrappers": [] - } - ] - } - } -} diff --git a/jobs/pool/src/misc/migrate-field.ts b/jobs/pool/src/misc/migrate-field.ts deleted file mode 100644 index 8ae94571ed..0000000000 --- a/jobs/pool/src/misc/migrate-field.ts +++ /dev/null @@ -1,49 +0,0 @@ -// import { createDirectClient, Prisma } from '@sushiswap/database' -// import { ChainId, chainName } from '@sushiswap/chain' -// import { performance } from 'perf_hooks' - -// - -// export async function test() { -// try { -// const startTime = performance.now() -// const client = await createDirectClient() -// const incentives = await client.incentive.findMany({ -// select: { -// id: true, -// type: true, -// }, -// }) -// console.log(incentives.length) - -// const batchSize = 250 -// let updatedCount = 0 - -// for (let i = 0; i < incentives.length; i += batchSize) { -// const batch = incentives.slice(i, i + batchSize) -// const requests = batch.map((incentive) => { -// return client.incentive.update({ -// select: { id: true }, // select only the `id` field, otherwise it returns everything and we don't use the data after updating. -// where: { id: incentive.id }, -// data: { -// chefType: incentive.type, -// }, -// }) -// }) -// const responses = await Promise.all(requests) -// console.log(`BATCH: Updated ${responses.length}/${incentives.length} pools.`) -// updatedCount += responses.length -// } -// console.log({updatedCount}) - -// const endTime = performance.now() -// console.log(`COMPLETE - Script ran for ${((endTime - startTime) / 1000).toFixed(1)} seconds. `) -// } catch (e) { -// console.error(e) -// await (await createDirectClient()).$disconnect() -// } finally { -// await (await createDirectClient()).$disconnect() -// } -// } - -// test() diff --git a/jobs/pool/src/misc/migrate-tokens.ts b/jobs/pool/src/misc/migrate-tokens.ts deleted file mode 100644 index a4da9d17c7..0000000000 --- a/jobs/pool/src/misc/migrate-tokens.ts +++ /dev/null @@ -1,107 +0,0 @@ -// import { PrismaClient, createDirectClient } from "@sushiswap/database" - -// export async function whitelistTokens2() { -// const productionClient = await createDirectClient({ -// datasources: { -// db: { -// url: process.env.PRODUCTION_DATABASE_URL as string, -// }, -// }, -// }) -// const previewClient = await createDirectClient({ -// datasources: { -// db: { -// url: process.env.PREVIEW_DATABASE_URL as string, -// }, -// }, -// }) - -// try { -// const startTime = performance.now() - -// await start(productionClient, previewClient) - -// const endTime = performance.now() -// console.log(`COMPLETED (${((endTime - startTime) / 1000).toFixed(1)}s). `) -// } catch (e) { -// console.error(e) -// await previewClient.$disconnect() -// await productionClient.$disconnect() -// } finally { -// await previewClient.$disconnect() -// await productionClient.$disconnect() -// } -// } - -// async function start(productionClient: PrismaClient, previewClient: PrismaClient) { -// const approvedTokensResult = await productionClient.token.findMany({ -// select: { -// id: true, -// address: true, -// chainId: true, -// name: true, -// symbol: true, -// decimals: true, -// status: true, -// isFeeOnTransfer: true, -// isCommon: true, -// }, -// where: { -// status: 'APPROVED', -// }, -// }) - -// const existingTokens = await previewClient.token.findMany({ -// select: { -// id: true, -// name: true, -// symbol: true, -// }, -// where: { -// id: { -// in: approvedTokensResult.map((token) => token.id), -// }, -// }, -// }) - -// const tokensToCreate = approvedTokensResult.filter((token) => !existingTokens.find((existingToken) => existingToken.id === token.id)) -// const tokensToUpdate = approvedTokensResult.filter((token) => existingTokens.find((existingToken) => existingToken.id === token.id)) -// const batchSize = 200 - -// console.log(`Tokens to create: ${tokensToCreate.length}, tokens to update: ${tokensToUpdate.length}`) - -// for (let i = 0; i < tokensToCreate.length; i += batchSize) { -// const batch = tokensToCreate.slice(i, i + batchSize) - -// const tokensCreated = await previewClient.token.createMany({ -// data: batch, -// }) - -// console.log(`LOAD - ${tokensCreated.count} tokens created.`) -// } - -// let updateTokenCount = 0 -// for (let i = 0; i < tokensToUpdate.length; i += batchSize) { -// const batch = tokensToUpdate.slice(i, i + batchSize) -// const batchToUpdate = batch.map((token) => -// previewClient.token.update({ -// where: { -// id: token.id, -// }, -// data: { -// status: 'APPROVED', -// name: token.name, -// symbol: token.symbol, -// isFeeOnTransfer: token.isFeeOnTransfer, -// isCommon: token.isCommon, -// }, -// }) -// ) -// const tokensUpdated = await Promise.allSettled(batchToUpdate) - -// console.log(`LOAD - ${tokensUpdated.length} tokens updated.`) -// updateTokenCount += tokensUpdated.length -// } -// console.log(`LOAD - COMPLETE, ${updateTokenCount} tokens updated.`) -// } -// whitelistTokens2() diff --git a/jobs/pool/src/pools.ts b/jobs/pool/src/pools.ts deleted file mode 100644 index e14609f3a8..0000000000 --- a/jobs/pool/src/pools.ts +++ /dev/null @@ -1,1258 +0,0 @@ -import { Prisma, Protocol } from '@sushiswap/database' -import { performance } from 'perf_hooks' -import { ChainId, chainShortName } from 'sushi/chain' - -import { - SUSHISWAP_V2_SUPPORTED_CHAIN_IDS, - SUSHISWAP_V3_SUPPORTED_CHAIN_IDS, - SushiSwapV2ChainId, - SushiSwapV3ChainId, -} from 'sushi/config' - -import { getBlockHistoric } from '@sushiswap/graph-client/blocks' -import { fetchMultichain } from '@sushiswap/graph-client/multichain' -import { SushiV2Pools, getSushiV2Pools } from '@sushiswap/graph-client/sushi-v2' -import { SushiV3Pools, getSushiV3Pools } from '@sushiswap/graph-client/sushi-v3' -import { upsertPools } from './etl/pool/index.js' -import { createTokens } from './etl/token/load.js' - -interface Blocks { - oneHour: number | undefined - twoHour: number | undefined - oneDay: number | undefined - twoDay: number | undefined - oneWeek: number | undefined - twoWeek: number | undefined - oneMonth: number | undefined - twoMonth: number | undefined -} - -type V2Data = { - currentPools: SushiV2Pools - pools1h: SushiV2Pools - pools2h: SushiV2Pools - pools1d: SushiV2Pools - pools2d: SushiV2Pools - pools1w: SushiV2Pools - pools2w: SushiV2Pools - pools1m: SushiV2Pools - pools2m: SushiV2Pools -} -type V3Data = { - currentPools: SushiV3Pools - pools1h: SushiV3Pools - pools2h: SushiV3Pools - pools1d: SushiV3Pools - pools2d: SushiV3Pools - pools1w: SushiV3Pools - pools2w: SushiV3Pools - pools1m: SushiV3Pools - pools2m: SushiV3Pools -} - -enum AprTimeRange { - ONE_HOUR = 'ONE_HOUR', - ONE_DAY = 'ONE_DAY', - ONE_WEEK = 'ONE_WEEK', - ONE_MONTH = 'ONE_MONTH', -} - -const SUBGRAPH_REQUEST_OPTIONS = { - retries: 10, // can lower to 3 when bad indexer error is fixed by the graph -} - -export async function execute(protocol: Protocol) { - try { - const startTime = performance.now() - console.log(`${protocol}: Preparing to load pools/tokens`) - if ( - protocol !== Protocol.SUSHISWAP_V2 && - protocol !== Protocol.SUSHISWAP_V3 - ) { - throw new Error('Unsupported protocol') - } - // EXTRACT - const exchanges = await extract(protocol) - console.log( - `EXTRACT - ${protocol} - Pairs extracted from ${exchanges.length} different subgraphs`, - ) - - // TRANSFORM - const { tokens, pools } = transform(protocol, exchanges) - - // LOAD - const batchSize = 250 - - for (let i = 0; i < tokens.length; i += batchSize) { - const batch = tokens.slice(i, i + batchSize) - await createTokens(batch) - } - const concurrentBatches = 10 - for (let i = 0; i < pools.length; i += batchSize * concurrentBatches) { - const batches = [] - for (let j = i; j < i + concurrentBatches * batchSize; j += batchSize) { - if (j > pools.length) { - break - } - batches.push(upsertPools(pools.slice(j, j + batchSize))) - } - const batchStartTime = performance.now() - await Promise.all(batches) - const batchEndTime = performance.now() - console.log( - `LOAD: ${protocol} - Batch completed in ${( - (batchEndTime - batchStartTime) / - 1000 - ).toFixed(1)} seconds. `, - ) - } - const endTime = performance.now() - - console.log( - `LOAD: ${protocol} - COMPLETE - Script ran for ${( - (endTime - startTime) / - 1000 - ).toFixed(1)} seconds. `, - ) - } catch (e) { - console.error(e) - } -} - -async function extract(protocol: 'SUSHISWAP_V2' | 'SUSHISWAP_V3') { - const result: { chainId: ChainId; data: V2Data | V3Data }[] = [] - - const chainIds = - protocol === Protocol.SUSHISWAP_V2 - ? SUSHISWAP_V2_SUPPORTED_CHAIN_IDS - : SUSHISWAP_V3_SUPPORTED_CHAIN_IDS - - console.log( - `EXTRACT - ${protocol} - Extracting from ${ - chainIds.length - } different chains, ${chainIds.join(', ')}`, - ) - const [ - oneHourBlocks, - twoHourBlocks, - oneDayBlocks, - twoDayBlocks, - oneWeekBlocks, - twoWeekBlocks, - oneMonthBlocks, - twoMonthBlocks, - ] = await Promise.all([ - fetchMultichain({ - chainIds, - fetch: getBlockHistoric, - variables: { - hoursAgo: 1, - }, - options: SUBGRAPH_REQUEST_OPTIONS, - }), - - fetchMultichain({ - chainIds, - fetch: getBlockHistoric, - variables: { - hoursAgo: 2, - }, - options: SUBGRAPH_REQUEST_OPTIONS, - }), - fetchMultichain({ - chainIds, - fetch: getBlockHistoric, - variables: { - daysAgo: 1, - }, - options: SUBGRAPH_REQUEST_OPTIONS, - }), - fetchMultichain({ - chainIds, - fetch: getBlockHistoric, - variables: { - daysAgo: 2, - }, - options: SUBGRAPH_REQUEST_OPTIONS, - }), - fetchMultichain({ - chainIds, - fetch: getBlockHistoric, - variables: { - weeksAgo: 1, - }, - options: SUBGRAPH_REQUEST_OPTIONS, - }), - fetchMultichain({ - chainIds, - fetch: getBlockHistoric, - variables: { - weeksAgo: 2, - }, - options: SUBGRAPH_REQUEST_OPTIONS, - }), - fetchMultichain({ - chainIds, - fetch: getBlockHistoric, - variables: { - monthsAgo: 1, - }, - options: SUBGRAPH_REQUEST_OPTIONS, - }), - fetchMultichain({ - chainIds, - fetch: getBlockHistoric, - variables: { - monthsAgo: 2, - }, - options: SUBGRAPH_REQUEST_OPTIONS, - }), - ]) - - await Promise.allSettled( - chainIds.map(async (chainId) => { - const blocks: Blocks = { - oneHour: oneHourBlocks.data.find((b) => b.chainId === chainId)?.number, - twoHour: twoHourBlocks.data.find((b) => b.chainId === chainId)?.number, - oneDay: oneDayBlocks.data.find((b) => b.chainId === chainId)?.number, - twoDay: twoDayBlocks.data.find((b) => b.chainId === chainId)?.number, - oneWeek: oneWeekBlocks.data.find((b) => b.chainId === chainId)?.number, - twoWeek: twoWeekBlocks.data.find((b) => b.chainId === chainId)?.number, - oneMonth: oneMonthBlocks.data.find((b) => b.chainId === chainId) - ?.number, - twoMonth: twoMonthBlocks.data.find((b) => b.chainId === chainId) - ?.number, - } - const pairs = await fetchPairs(chainId, protocol, blocks) - - if (pairs === undefined) { - console.warn( - `No pairs found, skipping ${protocol} - ${chainShortName[chainId]}`, - ) - return - } - console.log( - `EXTRACT: ${protocol} - ${chainShortName[chainId]}, batches: ${pairs.currentPools.length}`, - ) - result.push({ chainId, data: pairs }) - }), - ) - return result -} - -async function tryGetSushiV2Pools(...args: Parameters) { - return getSushiV2Pools(...args).catch((e) => { - if (e instanceof Error) { - console.error(e.message) - } - return [] - }) -} - -async function tryGetSushiV3Pools(...args: Parameters) { - return getSushiV3Pools(...args).catch((e) => { - if (e instanceof Error) { - console.error(e.message) - } - return [] - }) -} - -async function fetchPairs( - chainId: SushiSwapV2ChainId | SushiSwapV3ChainId, - protocol: 'SUSHISWAP_V2' | 'SUSHISWAP_V3', - blocks: Blocks, -) { - try { - if (protocol === Protocol.SUSHISWAP_V2) { - const [ - currentPools, - pools1h, - pools2h, - pools1d, - pools2d, - pools1w, - pools2w, - pools1m, - pools2m, - ] = await Promise.all([ - tryGetSushiV2Pools( - { - chainId, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ), - blocks.oneHour - ? tryGetSushiV2Pools( - { - chainId, - block: { - number: blocks.oneHour, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV2Pools), - blocks.twoHour - ? tryGetSushiV2Pools( - { - chainId, - block: { - number: blocks.twoHour, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV2Pools), - blocks.oneDay - ? tryGetSushiV2Pools( - { - chainId, - block: { - number: blocks.oneDay, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV2Pools), - blocks.twoDay - ? tryGetSushiV2Pools( - { - chainId, - block: { - number: blocks.twoDay, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV2Pools), - blocks.oneWeek - ? tryGetSushiV2Pools( - { - chainId, - block: { - number: blocks.oneWeek, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV2Pools), - blocks.twoWeek - ? tryGetSushiV2Pools( - { - chainId, - block: { - number: blocks.twoWeek, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV2Pools), - blocks.oneMonth - ? tryGetSushiV2Pools( - { - chainId, - block: { - number: blocks.oneMonth, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV2Pools), - blocks.twoMonth - ? tryGetSushiV2Pools( - { - chainId, - block: { - number: blocks.twoMonth, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV2Pools), - ]) - - console.log( - `V2-${chainShortName[chainId]} results by timeframe - * current: ${currentPools.length} - 1h: ${pools1h.length} - 2h: ${pools2h.length} - 1d: ${pools1d.length} - 2d: ${pools2d.length} - 1w: ${pools1w.length} - 2w: ${pools2w.length} - 1m: ${pools1m.length} - 2m: ${pools2m.length}`, - ) - return { - currentPools, - pools1h, - pools2h, - pools1d, - pools2d, - pools1w, - pools2w, - pools1m, - pools2m, - } - } else if (protocol === Protocol.SUSHISWAP_V3) { - const [ - currentPools, - pools1h, - pools2h, - pools1d, - pools2d, - pools1w, - pools2w, - pools1m, - pools2m, - ] = await Promise.all([ - tryGetSushiV3Pools( - { - chainId: chainId as SushiSwapV3ChainId, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ), - blocks.oneHour - ? tryGetSushiV3Pools( - { - chainId: chainId as SushiSwapV3ChainId, - block: { - number: blocks.oneHour, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV3Pools), - blocks.twoHour - ? tryGetSushiV3Pools( - { - chainId: chainId as SushiSwapV3ChainId, - block: { - number: blocks.twoHour, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV3Pools), - blocks.oneDay - ? tryGetSushiV3Pools( - { - chainId: chainId as SushiSwapV3ChainId, - block: { - number: blocks.oneDay, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV3Pools), - blocks.twoDay - ? tryGetSushiV3Pools( - { - chainId: chainId as SushiSwapV3ChainId, - block: { - number: blocks.twoDay, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV3Pools), - blocks.oneWeek - ? tryGetSushiV3Pools( - { - chainId: chainId as SushiSwapV3ChainId, - block: { - number: blocks.oneWeek, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV3Pools), - blocks.twoWeek - ? tryGetSushiV3Pools( - { - chainId: chainId as SushiSwapV3ChainId, - block: { - number: blocks.twoWeek, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV3Pools), - blocks.oneMonth - ? tryGetSushiV3Pools( - { - chainId: chainId as SushiSwapV3ChainId, - block: { - number: blocks.oneMonth, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV3Pools), - blocks.twoMonth - ? tryGetSushiV3Pools( - { - chainId: chainId as SushiSwapV3ChainId, - block: { - number: blocks.twoMonth, - }, - first: Infinity, - }, - SUBGRAPH_REQUEST_OPTIONS, - ) - : ([] as SushiV3Pools), - ]) - - console.log( - `V3-${chainShortName[chainId]} results by timeframe - * current: ${currentPools.length} - 1h: ${pools1h.length} - 2h: ${pools2h.length} - 1d: ${pools1d.length} - 2d: ${pools2d.length} - 1w: ${pools1w.length} - 2w: ${pools2w.length} - 1m: ${pools1m.length} - 2m: ${pools2m.length}`, - ) - return { - currentPools, - pools1h, - pools2h, - pools1d, - pools2d, - pools1w, - pools2w, - pools1m, - pools2m, - } - } else { - throw new Error('EXTRACT: fetchPairs: V2 or V3, skipping') - } - } catch (error) { - console.error(`Error in fetchPairs for chainId ${chainId}:`, error) - return undefined - } -} - -function transform( - protocol: 'SUSHISWAP_V2' | 'SUSHISWAP_V3', - queryResults: { chainId: ChainId; data: V2Data | V3Data }[], -) { - const tokens: Map = new Map() - const pools: Prisma.SushiPoolCreateManyInput[] = [] - - for (const result of queryResults) { - const { chainId, data } = result - if (protocol === Protocol.SUSHISWAP_V2) { - const { pools: v2Pools, tokens: v2Tokens } = transformV2({ - chainId, - data: data as V2Data, - }) - pools.push(...v2Pools) - - v2Tokens.forEach((token) => { - const existing = tokens.get(token.id) - if (!existing) { - tokens.set(token.id, token) - } - }) - } else if (protocol === Protocol.SUSHISWAP_V3) { - const { pools: v3Pools, tokens: v3Tokens } = transformV3({ - chainId, - data: data as V3Data, - }) - pools.push(...v3Pools) - - v3Tokens.forEach((token) => { - const existing = tokens.get(token.id) - if (!existing) { - tokens.set(token.id, token) - } - }) - } else { - console.warn('Unknown protocol') - } - } - - const dedupedTokens = [...new Set(Array.from(tokens.values()))] - console.log( - `${protocol}: ${pools.length} pools, ${dedupedTokens.length} tokens`, - ) - return { pools: pools, tokens: dedupedTokens } -} - -function transformV2(queryResult: { - chainId: ChainId - data: V2Data -}) { - const oneHourData = new Map( - queryResult.data.pools1h.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.volumeUSD * 0.003), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const twoHourData = new Map( - queryResult.data.pools2h.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.volumeUSD * 0.003), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const oneDayData = new Map( - queryResult.data.pools1d.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.volumeUSD * 0.003), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const twoDayData = new Map( - queryResult.data.pools2d.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.volumeUSD * 0.003), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const oneWeekData = new Map( - queryResult.data.pools1w.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.volumeUSD * 0.003), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const twoWeekData = new Map( - queryResult.data.pools2w.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.volumeUSD * 0.003), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const oneMonthData = new Map( - queryResult.data.pools1m.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.volumeUSD * 0.003), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const twoMonthData = new Map( - queryResult.data.pools2m.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.volumeUSD * 0.003), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - - const chainsToSkip = new Set() - const tokens: Prisma.TokenCreateManyInput[] = [] - - return { - pools: queryResult.data.currentPools.flatMap((pair) => { - if (chainsToSkip.has(queryResult.chainId)) { - return [] - } - - tokens.push( - Prisma.validator()({ - id: pair.token0.id.toLowerCase(), - address: pair.token0.address.toLowerCase(), - chainId: queryResult.chainId, - name: pair.token0.name, - symbol: pair.token0.symbol, - decimals: Number(pair.token0.decimals), - }), - ) - tokens.push( - Prisma.validator()({ - id: pair.token1.id.toLowerCase(), - address: pair.token1.address.toLowerCase(), - chainId: queryResult.chainId, - name: pair.token1.name, - symbol: pair.token1.symbol, - decimals: Number(pair.token1.decimals), - }), - ) - - const regex = /([^\w ]|_|-)/g - const name = pair.token0.symbol - .replace(regex, '') - .slice(0, 15) - .concat('-') - .concat(pair.token1.symbol.replace(regex, '').slice(0, 15)) - const protocol = Protocol.SUSHISWAP_V2 - - const currentVolumeUSD = Number(pair.volumeUSD) - const currentLiquidityUSD = Number(pair.liquidityUSD) - const currentFeesUSD = Number(pair.volumeUSD * 0.003) - - const anyNotCurrent = - oneHourData.get(pair.id) || - twoHourData.get(pair.id) || - oneDayData.get(pair.id) || - twoDayData.get(pair.id) || - oneWeekData.get(pair.id) || - twoWeekData.get(pair.id) || - oneMonthData.get(pair.id) || - twoMonthData.get(pair.id) - - // A way to prevent old data (thanks TheGraph!) from being added - if (anyNotCurrent && anyNotCurrent.volumeUSD > currentVolumeUSD) { - console.warn( - 'Ignoring chain', - queryResult.chainId, - 'Old Volume:', - anyNotCurrent.volumeUSD, - 'Current Volume:', - currentVolumeUSD, - ) - chainsToSkip.add(queryResult.chainId) - return [] - } - - const feeApr1h = calculateFeeApr( - AprTimeRange.ONE_HOUR, - oneHourData.get(pair.id)?.feesUSD ?? currentFeesUSD, - currentFeesUSD, - pair.liquidityUSD, - ) - const feeApr1d = calculateFeeApr( - AprTimeRange.ONE_DAY, - oneDayData.get(pair.id)?.feesUSD ?? currentFeesUSD, - currentFeesUSD, - pair.liquidityUSD, - ) - const feeApr1w = calculateFeeApr( - AprTimeRange.ONE_WEEK, - oneWeekData.get(pair.id)?.feesUSD ?? currentFeesUSD, - currentFeesUSD, - pair.liquidityUSD, - ) - const feeApr1m = calculateFeeApr( - AprTimeRange.ONE_MONTH, - oneMonthData.get(pair.id)?.feesUSD ?? currentFeesUSD, - currentFeesUSD, - pair.liquidityUSD, - ) - - const fees1h = oneHourData.has(pair.id) - ? currentFeesUSD - oneHourData.get(pair.id)!.feesUSD - : currentFeesUSD - const fees1d = oneDayData.has(pair.id) - ? currentFeesUSD - oneDayData.get(pair.id)!.feesUSD - : currentFeesUSD - const fees1w = oneWeekData.has(pair.id) - ? currentFeesUSD - oneWeekData.get(pair.id)!.feesUSD - : currentFeesUSD - const fees1m = oneMonthData.has(pair.id) - ? currentFeesUSD - oneMonthData.get(pair.id)!.feesUSD - : currentFeesUSD - const feesChange1h = calculatePercentageChange( - currentFeesUSD, - oneHourData.get(pair.id)?.feesUSD ?? 0, - twoHourData.get(pair.id)?.feesUSD ?? 0, - ) - const feesChange1d = calculatePercentageChange( - currentFeesUSD, - oneDayData.get(pair.id)?.feesUSD ?? 0, - twoDayData.get(pair.id)?.feesUSD ?? 0, - ) - const feesChange1w = calculatePercentageChange( - currentFeesUSD, - oneWeekData.get(pair.id)?.feesUSD ?? 0, - twoWeekData.get(pair.id)?.feesUSD ?? 0, - ) - const feesChange1m = calculatePercentageChange( - currentFeesUSD, - oneMonthData.get(pair.id)?.feesUSD ?? 0, - twoMonthData.get(pair.id)?.feesUSD ?? 0, - ) - const volume1h = oneHourData.has(pair.id) - ? currentVolumeUSD - oneHourData.get(pair.id)!.volumeUSD - : currentVolumeUSD - const volume1d = oneDayData.has(pair.id) - ? currentVolumeUSD - oneDayData.get(pair.id)!.volumeUSD - : currentVolumeUSD - const volume1w = oneWeekData.has(pair.id) - ? currentVolumeUSD - oneWeekData.get(pair.id)!.volumeUSD - : currentVolumeUSD - const volume1m = oneMonthData.has(pair.id) - ? currentVolumeUSD - oneMonthData.get(pair.id)!.volumeUSD - : currentVolumeUSD - const volumeChange1h = calculatePercentageChange( - currentVolumeUSD, - oneHourData.get(pair.id)?.volumeUSD ?? 0, - twoHourData.get(pair.id)?.volumeUSD ?? 0, - ) - const volumeChange1d = calculatePercentageChange( - currentVolumeUSD, - oneDayData.get(pair.id)?.volumeUSD ?? 0, - twoDayData.get(pair.id)?.volumeUSD ?? 0, - ) - const volumeChange1w = calculatePercentageChange( - currentVolumeUSD, - oneWeekData.get(pair.id)?.volumeUSD ?? 0, - twoWeekData.get(pair.id)?.volumeUSD ?? 0, - ) - const volumeChange1m = calculatePercentageChange( - currentVolumeUSD, - oneMonthData.get(pair.id)?.volumeUSD ?? 0, - twoMonthData.get(pair.id)?.volumeUSD ?? 0, - ) - const liquidityUSDChange1h = oneHourData.get(pair.id)?.liquidityUSD - ? currentLiquidityUSD / oneHourData.get(pair.id)!.liquidityUSD - 1 - : 0 - const liquidityUSDChange1d = oneDayData.get(pair.id)?.liquidityUSD - ? currentLiquidityUSD / oneDayData.get(pair.id)!.liquidityUSD - 1 - : 0 - - const liquidityUSDChange1w = oneWeekData.get(pair.id)?.liquidityUSD - ? currentLiquidityUSD / oneWeekData.get(pair.id)!.liquidityUSD - 1 - : 0 - - const liquidityUSDChange1m = oneMonthData.get(pair.id)?.liquidityUSD - ? currentLiquidityUSD / oneMonthData.get(pair.id)!.liquidityUSD - 1 - : 0 - - return { - id: pair.id.toLowerCase(), - address: pair.address.toLowerCase(), - name: name, - protocol, - chainId: queryResult.chainId, - swapFee: 0.003, - twapEnabled: true, - token0Id: pair.token0.id.toLowerCase(), - token1Id: pair.token1.id.toLowerCase(), - reserve0: pair.reserve0.toString(), - reserve1: pair.reserve1.toString(), - totalSupply: pair.liquidity.toString(), - liquidityUSD: currentLiquidityUSD, - liquidityNative: 0, - volumeUSD: currentVolumeUSD, - feesUSD: currentFeesUSD, - volumeNative: 0, // DOES NOT EXIST IN V2 anymore - token0Price: pair.token0Price.toString(), - token1Price: pair.token1Price.toString(), - ...(oneHourData.get(pair.id)?.feesUSD && { fees1h }), - ...(oneDayData.get(pair.id)?.feesUSD && { fees1d }), - ...(oneWeekData.get(pair.id)?.feesUSD && { fees1w }), - ...(oneMonthData.get(pair.id)?.feesUSD && { fees1m }), - ...(oneHourData.get(pair.id)?.feesUSD && { feesChange1h }), - ...(oneDayData.get(pair.id)?.feesUSD && { feesChange1d }), - ...(oneWeekData.get(pair.id)?.feesUSD && { feesChange1w }), - ...(oneMonthData.get(pair.id)?.feesUSD && { feesChange1m }), - ...(oneHourData.get(pair.id)?.volumeUSD && { volume1h }), - ...(oneDayData.get(pair.id)?.volumeUSD && { volume1d }), - ...(oneWeekData.get(pair.id)?.volumeUSD && { volume1w }), - ...(oneMonthData.get(pair.id)?.volumeUSD && { volume1m }), - ...(oneHourData.get(pair.id)?.volumeUSD && { volumeChange1h }), - ...(oneDayData.get(pair.id)?.volumeUSD && { volumeChange1d }), - ...(oneWeekData.get(pair.id)?.volumeUSD && { volumeChange1w }), - ...(oneMonthData.get(pair.id)?.volumeUSD && { volumeChange1m }), - ...(oneHourData.get(pair.id)?.liquidityUSD && { - liquidityUSDChange1h, - }), - ...(oneDayData.get(pair.id)?.liquidityUSD && { - liquidityUSDChange1d, - }), - ...(oneWeekData.get(pair.id)?.liquidityUSD && { - liquidityUSDChange1w, - }), - ...(oneMonthData.get(pair.id)?.liquidityUSD && { - liquidityUSDChange1m, - }), - ...(oneHourData.get(pair.id)?.feesUSD && { feeApr1h }), - ...(oneDayData.get(pair.id)?.feesUSD && { feeApr1d }), - ...(oneWeekData.get(pair.id)?.feesUSD && { feeApr1w }), - ...(oneMonthData.get(pair.id)?.feesUSD && { feeApr1m }), - ...(oneHourData.get(pair.id)?.feesUSD && { totalApr1h: feeApr1h }), - ...(oneDayData.get(pair.id)?.feesUSD && { totalApr1d: feeApr1d }), - ...(oneWeekData.get(pair.id)?.feesUSD && { totalApr1w: feeApr1w }), - ...(oneMonthData.get(pair.id)?.feesUSD && { totalApr1m: feeApr1m }), - createdAtBlockNumber: 0, - } satisfies Prisma.SushiPoolCreateManyInput - }), - tokens, - } -} - -function transformV3(queryResult: { chainId: ChainId; data: V3Data }) { - const oneHourData = new Map( - queryResult.data.pools1h.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.feesUSD), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const twoHourData = new Map( - queryResult.data.pools2h.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.feesUSD), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const oneDayData = new Map( - queryResult.data.pools1d.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.feesUSD), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const twoDayData = new Map( - queryResult.data.pools2d.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.feesUSD), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const oneWeekData = new Map( - queryResult.data.pools1w.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.feesUSD), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const twoWeekData = new Map( - queryResult.data.pools2w.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.feesUSD), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const oneMonthData = new Map( - queryResult.data.pools1m.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.feesUSD), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - const twoMonthData = new Map( - queryResult.data.pools2m.map((pool) => [ - pool.id, - { - feesUSD: Number(pool.feesUSD), - volumeUSD: Number(pool.volumeUSD), - liquidityUSD: Number(pool.liquidityUSD), - }, - ]), - ) - - const chainsToSkip = new Set() - const tokens: Prisma.TokenCreateManyInput[] = [] - const poolsTransformed = queryResult.data.currentPools.flatMap((pair) => { - if (chainsToSkip.has(queryResult.chainId)) { - return [] - } - - tokens.push( - Prisma.validator()({ - id: pair.token0.id.toLowerCase(), - address: pair.token0.address.toLowerCase(), - chainId: queryResult.chainId, - name: pair.token0.name, - symbol: pair.token0.symbol, - decimals: Number(pair.token0.decimals), - }), - ) - tokens.push( - Prisma.validator()({ - id: pair.token1.id.toLowerCase(), - address: pair.token1.address.toLowerCase(), - chainId: queryResult.chainId, - name: pair.token1.name, - symbol: pair.token1.symbol, - decimals: Number(pair.token1.decimals), - }), - ) - const regex = /([^\w ]|_|-)/g - const name = pair.token0.symbol - .replace(regex, '') - .slice(0, 15) - .concat('-') - .concat(pair.token1.symbol.replace(regex, '').slice(0, 15)) - const swapFee = pair.swapFee - - const currentVolumeUSD = Number(pair.volumeUSD) - const currentLiquidityUSD = Number(pair.liquidityUSD) - const currentFeesUSD = Number(pair.feesUSD) - - const anyNotCurrent = - oneHourData.get(pair.id) || - twoHourData.get(pair.id) || - oneDayData.get(pair.id) || - twoDayData.get(pair.id) || - oneWeekData.get(pair.id) || - twoWeekData.get(pair.id) || - oneMonthData.get(pair.id) || - twoMonthData.get(pair.id) - - // A way to prevent old data (thanks TheGraph!) from being added - if (anyNotCurrent && anyNotCurrent.volumeUSD > currentVolumeUSD) { - console.warn( - 'Ignoring chain', - queryResult.chainId, - 'Old Volume:', - anyNotCurrent.volumeUSD, - 'Current Volume:', - currentVolumeUSD, - ) - chainsToSkip.add(queryResult.chainId) - return [] - } - - const feeApr1h = calculateFeeApr( - AprTimeRange.ONE_HOUR, - oneHourData.get(pair.id)?.feesUSD ?? currentFeesUSD, - pair.feesUSD, - pair.liquidityUSD, - ) - const feeApr1d = calculateFeeApr( - AprTimeRange.ONE_DAY, - oneDayData.get(pair.id)?.feesUSD ?? currentFeesUSD, - pair.feesUSD, - pair.liquidityUSD, - ) - const feeApr1w = calculateFeeApr( - AprTimeRange.ONE_WEEK, - oneWeekData.get(pair.id)?.feesUSD ?? currentFeesUSD, - pair.feesUSD, - pair.liquidityUSD, - ) - const feeApr1m = calculateFeeApr( - AprTimeRange.ONE_MONTH, - oneMonthData.get(pair.id)?.feesUSD ?? currentFeesUSD, - pair.feesUSD, - pair.liquidityUSD, - ) - - const fees1h = oneHourData.has(pair.id) - ? currentFeesUSD - oneHourData.get(pair.id)!.feesUSD - : currentFeesUSD - const fees1d = oneDayData.has(pair.id) - ? currentFeesUSD - oneDayData.get(pair.id)!.feesUSD - : currentFeesUSD - const fees1w = oneWeekData.has(pair.id) - ? currentFeesUSD - oneWeekData.get(pair.id)!.feesUSD - : currentFeesUSD - const fees1m = oneMonthData.has(pair.id) - ? currentFeesUSD - oneMonthData.get(pair.id)!.feesUSD - : currentFeesUSD - const feesChange1h = calculatePercentageChange( - currentFeesUSD, - oneHourData.get(pair.id)?.feesUSD ?? 0, - twoHourData.get(pair.id)?.feesUSD ?? 0, - ) - const feesChange1d = calculatePercentageChange( - currentFeesUSD, - oneDayData.get(pair.id)?.feesUSD ?? 0, - twoDayData.get(pair.id)?.feesUSD ?? 0, - ) - const feesChange1w = calculatePercentageChange( - currentFeesUSD, - oneWeekData.get(pair.id)?.feesUSD ?? 0, - twoWeekData.get(pair.id)?.feesUSD ?? 0, - ) - const feesChange1m = calculatePercentageChange( - currentFeesUSD, - oneMonthData.get(pair.id)?.feesUSD ?? 0, - twoMonthData.get(pair.id)?.feesUSD ?? 0, - ) - const volume1h = oneHourData.has(pair.id) - ? currentVolumeUSD - oneHourData.get(pair.id)!.volumeUSD - : currentVolumeUSD - const volume1d = oneDayData.has(pair.id) - ? currentVolumeUSD - oneDayData.get(pair.id)!.volumeUSD - : currentVolumeUSD - const volume1w = oneWeekData.has(pair.id) - ? currentVolumeUSD - oneWeekData.get(pair.id)!.volumeUSD - : currentVolumeUSD - const volume1m = oneMonthData.has(pair.id) - ? currentVolumeUSD - oneMonthData.get(pair.id)!.volumeUSD - : currentVolumeUSD - const volumeChange1h = calculatePercentageChange( - currentVolumeUSD, - oneHourData.get(pair.id)?.volumeUSD ?? 0, - twoHourData.get(pair.id)?.volumeUSD ?? 0, - ) - const volumeChange1d = calculatePercentageChange( - currentVolumeUSD, - oneDayData.get(pair.id)?.volumeUSD ?? 0, - twoDayData.get(pair.id)?.volumeUSD ?? 0, - ) - const volumeChange1w = calculatePercentageChange( - currentVolumeUSD, - oneWeekData.get(pair.id)?.volumeUSD ?? 0, - twoWeekData.get(pair.id)?.volumeUSD ?? 0, - ) - const volumeChange1m = calculatePercentageChange( - currentVolumeUSD, - oneMonthData.get(pair.id)?.volumeUSD ?? 0, - twoMonthData.get(pair.id)?.volumeUSD ?? 0, - ) - const liquidityUSDChange1h = oneHourData.get(pair.id)?.liquidityUSD - ? currentLiquidityUSD / oneHourData.get(pair.id)!.liquidityUSD - 1 - : 0 - const liquidityUSDChange1d = oneDayData.get(pair.id)?.liquidityUSD - ? currentLiquidityUSD / oneDayData.get(pair.id)!.liquidityUSD - 1 - : 0 - - const liquidityUSDChange1w = oneWeekData.get(pair.id)?.liquidityUSD - ? currentLiquidityUSD / oneWeekData.get(pair.id)!.liquidityUSD - 1 - : 0 - - const liquidityUSDChange1m = oneMonthData.get(pair.id)?.liquidityUSD - ? currentLiquidityUSD / oneMonthData.get(pair.id)!.liquidityUSD - 1 - : 0 - - return { - id: pair.id.toLowerCase(), - address: pair.address.toLowerCase(), - name: name, - protocol: Protocol.SUSHISWAP_V3, - chainId: queryResult.chainId, - swapFee, - twapEnabled: true, - token0Id: pair.token0.id.toLowerCase(), - token1Id: pair.token1.id.toLowerCase(), - reserve0: pair.reserve0.toString(), - reserve1: pair.reserve1.toString(), - totalSupply: pair.liquidity.toString(), - fees1h, - fees1d, - fees1w, - fees1m, - ...(oneHourData.get(pair.id)?.feesUSD && { feesChange1h }), - ...(oneDayData.get(pair.id)?.feesUSD && { feesChange1d }), - ...(oneWeekData.get(pair.id)?.feesUSD && { feesChange1w }), - ...(oneMonthData.get(pair.id)?.feesUSD && { feesChange1m }), - volume1h, - volume1d, - volume1w, - volume1m, - ...(oneHourData.get(pair.id)?.volumeUSD && { volumeChange1h }), - ...(oneDayData.get(pair.id)?.volumeUSD && { volumeChange1d }), - ...(oneWeekData.get(pair.id)?.volumeUSD && { volumeChange1w }), - ...(oneMonthData.get(pair.id)?.volumeUSD && { volumeChange1m }), - ...(oneHourData.get(pair.id)?.liquidityUSD && { liquidityUSDChange1h }), - ...(oneDayData.get(pair.id)?.liquidityUSD && { liquidityUSDChange1d }), - ...(oneWeekData.get(pair.id)?.liquidityUSD && { liquidityUSDChange1w }), - ...(oneMonthData.get(pair.id)?.liquidityUSD && { - liquidityUSDChange1m, - }), - ...(oneHourData.get(pair.id)?.feesUSD && { feeApr1h }), - ...(oneDayData.get(pair.id)?.feesUSD && { feeApr1d }), - ...(oneWeekData.get(pair.id)?.feesUSD && { feeApr1w }), - ...(oneMonthData.get(pair.id)?.feesUSD && { feeApr1m }), - ...((oneDayData.get(pair.id)?.feesUSD && { feeApr1d }) || - (oneHourData.get(pair.id)?.feesUSD && { feeApr1d: feeApr1h })), - ...(oneDayData.get(pair.id)?.feesUSD && { totalApr1d: feeApr1d }), - ...(oneWeekData.get(pair.id)?.feesUSD && { totalApr1w: feeApr1w }), - ...(oneMonthData.get(pair.id)?.feesUSD && { totalApr1m: feeApr1m }), - liquidityUSD: currentLiquidityUSD, - liquidityNative: 0, // TODO: add this back? - volumeUSD: currentVolumeUSD, - feesUSD: currentFeesUSD, - volumeNative: 0, // DOES NOT EXIST IN V3 subgraph - token0Price: pair.token0Price.toString(), - token1Price: pair.token1Price.toString(), - createdAtBlockNumber: 0, - } satisfies Prisma.SushiPoolCreateManyInput - }) - - return { pools: poolsTransformed, tokens } -} - -const calculateFeeApr = ( - timeRange: AprTimeRange, - historicalFee: number, - currentFee: number, - currentLiquidityUSD: number, -) => { - if (Number(currentLiquidityUSD) === 0) return 0 - - if (timeRange === AprTimeRange.ONE_HOUR) { - return ((currentFee - historicalFee) * 24 * 365) / currentLiquidityUSD - } else if (timeRange === AprTimeRange.ONE_DAY) { - return ((currentFee - historicalFee) * 365) / currentLiquidityUSD - } else if (timeRange === AprTimeRange.ONE_WEEK) { - return ((currentFee - historicalFee) * 52) / currentLiquidityUSD - } else if (timeRange === AprTimeRange.ONE_MONTH) { - return ((currentFee - historicalFee) * 12) / currentLiquidityUSD - } - return 0 -} - -const calculatePercentageChange = ( - current: number, - previous: number, - previous2: number, -) => { - if (current === 0) return 0 - const change1 = previous !== 0 ? current - previous : 0 - const change2 = previous !== 0 && previous2 !== 0 ? previous - previous2 : 0 - if (change2 === 0) return 0 // avoid division by 0 - return previous !== 0 && previous2 !== 0 ? change1 / change2 - 1 : 0 -} diff --git a/jobs/pool/src/server.ts b/jobs/pool/src/server.ts deleted file mode 100644 index f6ca057473..0000000000 --- a/jobs/pool/src/server.ts +++ /dev/null @@ -1,87 +0,0 @@ -import 'dotenv/config' - -import { Protocol } from '@sushiswap/database' -import timeout from 'connect-timeout' -import express from 'express' -import { z } from 'zod' - -import { execute as incentives } from './incentives.js' -import { execute as merklIncentives } from './merkl-incentives.js' -import { execute as pools } from './pools.js' -import { steer } from './steer.js' - -if (!process.env.SUSHI_GRAPH_KEY) { - throw new Error('SUSHI_GRAPH_KEY not set') -} - -const app = express() - -const protocolSchema = z.object({ - protocol: z.nativeEnum(Protocol), -}) - -app.get( - '/pools', - async (req, res) => { - req.setTimeout(1200_000) - - const result = protocolSchema.safeParse(req.query) - if (result.success === false) { - return res.status(400).send(result.error.format()) - } - - const { protocol } = result.data - try { - await pools(protocol) - res.sendStatus(200) - } catch (err) { - res.status(500).send(err) - } - }, - timeout('1200s'), -) - -app.get( - '/incentives', - async (req, res) => { - req.setTimeout(600_000) - try { - await incentives() - res.sendStatus(200) - } catch (err) { - res.status(500).send(err) - } - }, - timeout('600s'), -) - -app.get( - '/merkl-incentives', - async (req, res) => { - req.setTimeout(600_000) - try { - await merklIncentives() - res.sendStatus(200) - } catch (err) { - res.status(500).send(err) - } - }, - timeout('600s'), -) - -app.get( - '/steer', - async (req, res) => { - req.setTimeout(600_000) - try { - await steer() - res.sendStatus(200) - } catch (err) { - console.log(err) - res.status(500).send(err) - } - }, - timeout('600s'), -) - -app.listen(8080) diff --git a/jobs/pool/src/steer.ts b/jobs/pool/src/steer.ts deleted file mode 100644 index 2ce6f4c4f3..0000000000 --- a/jobs/pool/src/steer.ts +++ /dev/null @@ -1,308 +0,0 @@ -import { Prisma } from '@sushiswap/database' -import { SteerStrategy } from '@sushiswap/steer-sdk' -import { getSteerVaults } from '@sushiswap/graph-client/steer' -import { - STEER_SUPPORTED_CHAIN_IDS, - SteerChainId, - getStrategiesPayloads, - getVaultAprs, - getVerifiedVaults, -} from '@sushiswap/steer-sdk' -import { ID, chainName, isPromiseFulfilled } from 'sushi' -import { TickMath } from 'sushi/pool/sushiswap-v3' - -import { getAddress } from 'viem' -import { updatePoolsWithSteerVaults } from './etl/pool/load.js' -import { - deprecateVaults, - enableVaults, - upsertVaults, -} from './etl/steer/load.js' -import { getTokenPrices } from './lib/price.js' - -export async function steer() { - console.log('Starting steer') - - try { - const startTime = performance.now() - const chainsWithVaults = await extract() - - const transformed = transform(chainsWithVaults) - - await upsertVaults(transformed) - await updatePoolsWithSteerVaults() - - await enable() - await deprecate() - - const endTime = performance.now() - console.log( - `COMPLETE - Script ran for ${((endTime - startTime) / 1000).toFixed( - 1, - )} seconds. `, - ) - } catch (e) { - console.error(e) - } -} - -async function enable() { - const results = await Promise.allSettled( - STEER_SUPPORTED_CHAIN_IDS.map((chainId) => getVerifiedVaults({ chainId })), - ) - - const verifiedVaults = results - .filter(isPromiseFulfilled) - .flatMap((r) => r.value) - - await enableVaults(verifiedVaults) -} - -async function deprecate() { - const deprecatedVaults = await fetch( - 'https://ro81h8hq6b.execute-api.us-east-1.amazonaws.com/deprecated-bundles', - ) - .then((data) => data.json()) - .then((data: { id: string; chainId: number; type: string }[]) => - data.filter((el) => el.type === 'VAULT'), - ) - - await deprecateVaults(deprecatedVaults.map((vault) => vault.id)) -} - -async function extract() { - const result = await Promise.allSettled( - STEER_SUPPORTED_CHAIN_IDS.map((chainId) => - extractChain(chainId).catch((e) => { - console.log( - 'Steer: Extract failed for chain', - chainName[chainId], - e.message, - ) - throw e - }), - ), - ) - - return result.filter(isPromiseFulfilled).map((r) => r.value) -} - -async function extractChain(chainId: SteerChainId) { - const { getPools } = await import('@sushiswap/client') - - const prices = await getTokenPrices({ chainId }) - const vaults = await getSteerVaults( - { - chainId, - first: Infinity, - }, - { retries: 3 }, - ) - - const poolIds = vaults - .filter((vault) => !!vault.pool) - .map((vault) => vault.pool.id) - - const pools = [] as Awaited> - - while (poolIds.length > 0) { - const poolIdsChunk = poolIds.splice(0, 100) - const poolsChunk = await getPools({ - ids: poolIdsChunk as ID[], - chainIds: [chainId], - }) - pools.push(...poolsChunk) - } - - const payloadIpfsHashes = vaults.map((vault) => vault.payloadIpfs) - const payloads: Awaited> = [] - - while (payloadIpfsHashes.length > 0) { - const payloadIpfsHashesChunk = payloadIpfsHashes.splice(0, 10) - const payloadsChunk = await getStrategiesPayloads({ - payloadHashes: payloadIpfsHashesChunk, - }) - payloads.push(...payloadsChunk) - } - - let aprs - - try { - aprs = await getVaultAprs({ chainId }) - } catch (e: any) { - console.error(`Failed to fetch aprs for chainId: ${chainId}`, e.message) - aprs = {} - } - - const vaultsWithPayloads = await Promise.allSettled( - vaults.map(async (vault, i) => { - const pool = pools.find((pool) => pool.id === vault.pool.id) - - const { - apr1d = null, - apr1w = null, - apr1m = null, - apr = null, - } = aprs[vault.id] || {} - - const payload = payloads[i] - - const token0Price = prices[getAddress(vault.token0.address)] || 0 - const token1Price = prices[getAddress(vault.token1.address)] || 0 - - const reserve0USD = pool - ? (Number(vault.reserve0) / 10 ** pool.token0.decimals) * token0Price - : 0 - const fees0USD = pool - ? (Number(vault.fees0) / 10 ** pool.token0.decimals) * token0Price - : 0 - - const reserve1USD = pool - ? (Number(vault.reserve1) / 10 ** pool.token1.decimals) * token1Price - : 0 - const fees1USD = pool - ? (Number(vault.fees1) / 10 ** pool.token1.decimals) * token1Price - : 0 - - const reserveUSD = reserve0USD + reserve1USD - const feesUSD = Number(fees0USD) + Number(fees1USD) - - return { - ...vault, - payload, - apr1d, - apr1w, - apr1m, - apr, - reserve0USD, - fees0USD, - reserve1USD, - fees1USD, - reserveUSD, - feesUSD, - } - }), - ) - - return { - chainId, - vaults: vaultsWithPayloads.filter(isPromiseFulfilled).map((r) => r.value), - } -} - -const StrategyTypes: Record = { - 'Static Super Wide Strategy': SteerStrategy.SuperWide, - 'Classic Rebalance Strategy': SteerStrategy.ClassicRebalance, - 'Classic Rebalance Strategy V2': SteerStrategy.ClassicRebalance, - 'Delta Neutral - Stables': SteerStrategy.DeltaNeutralStables, - 'Stable Expansion Strategy': SteerStrategy.ElasticExpansion, - 'Elastic Expansion Strategy': SteerStrategy.ElasticExpansion, - 'Elastic Expansion Strategy V2': SteerStrategy.ElasticExpansion, - 'High Low Channel Strategy': SteerStrategy.HighLowChannel, - 'High Low Channel Strategy - Medium Range': SteerStrategy.HighLowChannel, - 'High Low Channel Strategy - Narrow Range': SteerStrategy.HighLowChannel, - 'High Low Channel Strategy V2': SteerStrategy.HighLowChannel, - 'Moving Volatility Channel': SteerStrategy.MovingVolatilityChannel, - 'Moving Volatility Channel Strategy': SteerStrategy.MovingVolatilityChannel, - 'Moving Volatility Channel Strategy - Medium': - SteerStrategy.MovingVolatilityChannel, - 'Moving Volatility Strategy V2': SteerStrategy.MovingVolatilityChannel, - 'Moving Volatility Strategy V2.': SteerStrategy.MovingVolatilityChannel, - 'Moving Volatility Channel Strategy V2': - SteerStrategy.MovingVolatilityChannel, - 'Channel Multiplier Strategy': SteerStrategy.ChannelMultiplier, - 'Algebra Channel Multiplier': SteerStrategy.ChannelMultiplier, - 'MIM-USDC Stable Strategy': SteerStrategy.StaticStable, - 'Relative Static Stable Strategy': SteerStrategy.StaticStable, - 'Generic Static Stable Strategy': SteerStrategy.StaticStable, - 'Static Stable Strategy': SteerStrategy.StaticStable, - 'Static Stable Strategy ': SteerStrategy.StaticStable, - 'Static Stable 1% Strategy': SteerStrategy.StaticStable, - 'Static Stable 0.3% Strategy': SteerStrategy.StaticStable, - 'Static Stable 0.05% Strategy': SteerStrategy.StaticStable, - 'Static Stable Strategy V2': SteerStrategy.StaticStable, - 'Keltner Algo': SteerStrategy.KeltnerAlgo, - 'Bollinger Algo': SteerStrategy.BollingerAlgo, - 'Fixed Percentage Strategy': SteerStrategy.FixedPercentage, - 'Price Multiplier Strategy': SteerStrategy.PriceMultiplier, -} - -function transform( - chainsWithVaults: Awaited>, -): Prisma.SteerVaultCreateManyInput[] { - const vaults = chainsWithVaults.flatMap(({ chainId, vaults }) => - vaults.flatMap((vault) => { - // ! Missing strategies will be ignored - const strategyType = vault?.payload?.strategyConfigData.name - ? StrategyTypes[vault.payload.strategyConfigData.name] - : null - - if (!strategyType) { - return [] - } - - let lastAdjustmentTimestamp = Math.floor( - vault.payload!.strategyConfigData.epochStart, - ) - if (lastAdjustmentTimestamp > 1000000000000) { - lastAdjustmentTimestamp = Math.floor(lastAdjustmentTimestamp / 1000) - } - - return { - id: vault.id.toLowerCase(), - address: vault.address.toLowerCase(), - chainId: chainId, - - poolId: vault.pool.id, - feeTier: Number(vault.feeTier) / 1000000, - - // apr1d, apr1m, apr1y are from the subgraph and inaccurate - apr: vault.apr || 0, - apr1d: vault.apr1d || 0, - apr1w: vault.apr1w || 0, - apr1m: vault.apr1m || 0, - apr1y: 0, - - token0Id: vault.token0.id.toLowerCase(), - reserve0: String(vault.reserve0), - reserve0USD: vault.reserve0USD, - fees0: String(vault.fees0), - fees0USD: vault.fees0USD, - - token1Id: vault.token1.id.toLowerCase(), - reserve1: String(vault.reserve1), - reserve1USD: vault.reserve1USD, - fees1: String(vault.fees1), - fees1USD: vault.fees1USD, - - reserveUSD: vault.reserveUSD, - feesUSD: vault.feesUSD, - - strategy: strategyType, - payloadHash: vault.payloadIpfs, - description: vault.payload!.strategyConfigData.description, - state: 'PendingThreshold', // unused - - performanceFee: 0.15, // currently constant - - lowerTick: vault.lowerTick - ? Number(vault.lowerTick) - : TickMath.MIN_TICK, - upperTick: vault.upperTick - ? Number(vault.upperTick) - : TickMath.MAX_TICK, - - adjustmentFrequency: Number( - vault.payload!.strategyConfigData.epochLength, - ), - lastAdjustmentTimestamp, - - admin: vault.strategyToken.admin, - creator: vault.strategyToken.creator.id, - manager: vault.manager, - } satisfies Prisma.SteerVaultCreateManyInput - }), - ) - console.log(`TRANSFORM: ${vaults.length} vaults`) - return vaults -} diff --git a/jobs/pool/tsconfig.json b/jobs/pool/tsconfig.json deleted file mode 100644 index ea1a1a29a4..0000000000 --- a/jobs/pool/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "@tsconfig/node18/tsconfig.json", - "include": ["src", "resolvers"], - "exclude": ["node_modules"], - "compilerOptions": { - "baseUrl": ".", - "rootDir": ".", - "target": "ES2022", - "lib": ["ESNext"], - "module": "ES2022", - "moduleResolution": "Bundler", - "esModuleInterop": true, - "resolveJsonModule": true, - "downlevelIteration": true, - "allowSyntheticDefaultImports": true, - "skipLibCheck": true - }, - "ts-node": { - "swc": true, - "esm": true - } -} diff --git a/jobs/pool/turbo.json b/jobs/pool/turbo.json deleted file mode 100644 index 711b9f5c64..0000000000 --- a/jobs/pool/turbo.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": ["//"], - "tasks": { - "start": { - "dependsOn": ["build"], - "env": ["DRPC_ID", "DATABASE_URL", "SUSHI_GRAPH_KEY"], - "cache": false, - "persistent": true - }, - "build": { - "outputs": [".graphclient/**"], - "dependsOn": ["^build"] - }, - "check": { - "dependsOn": ["build"], - "cache": false - } - } -} diff --git a/package.json b/package.json index e89da8dd97..89d19a018f 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "preinstall": "npx -y only-allow pnpm", "lint": "biome check .", "lint:fix": "biome check . --apply", - "sort": "sort-package-json 'package.json' 'apis/*/package.json' 'apps/*/package.json' 'config/*/package.json' 'jobs/*/package.json' 'packages/*/package.json' 'protocols/*/package.json'", - "sort-check": "sort-package-json 'package.json' 'apis/*/package.json' 'apps/*/package.json' 'config/*/package.json' 'jobs/*/package.json' 'packages/*/package.json' 'protocols/*/package.json' --check", + "sort": "sort-package-json 'package.json' 'apis/*/package.json' 'apps/*/package.json' 'config/*/package.json' 'packages/*/package.json' 'protocols/*/package.json'", + "sort-check": "sort-package-json 'package.json' 'apis/*/package.json' 'apps/*/package.json' 'config/*/package.json' 'packages/*/package.json' 'protocols/*/package.json' --check", "test": "dotenv -- turbo run test --parallel", "test-web-app": "dotenv -- turbo run test --filter=web", "web": "pnpm exec turbo run dev --filter web" From 820e4b504ebabe2aabe7a71290682c1cd4364a25 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Wed, 24 Jul 2024 11:35:38 +0200 Subject: [PATCH 030/139] refactor: v2 positions --- .../lib/hooks/api/useSushiV2UserPositions.ts | 33 ++-- apps/web/src/ui/pool/PositionsTable.tsx | 46 ++--- .../data-api/queries/smart-pool/vaults.ts | 2 +- .../subgraphs/data-api/queries/v2/index.ts | 1 + .../data-api/queries/v2/positions.ts | 157 ++++++++++++++++++ .../src/subgraphs/data-api/schema.graphql | 38 ++--- 6 files changed, 202 insertions(+), 75 deletions(-) create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/v2/positions.ts diff --git a/apps/web/src/lib/hooks/api/useSushiV2UserPositions.ts b/apps/web/src/lib/hooks/api/useSushiV2UserPositions.ts index ccd96e67d5..14c51fece4 100644 --- a/apps/web/src/lib/hooks/api/useSushiV2UserPositions.ts +++ b/apps/web/src/lib/hooks/api/useSushiV2UserPositions.ts @@ -1,32 +1,19 @@ 'use client' -import { parseArgs } from '@sushiswap/client' -import type { GetSushiV2StakedUnstakedPositions } from '@sushiswap/graph-client/composite/sushi-v2-staked-unstaked-positions' +import { + GetV2Positions, + getV2Positions, + V2Position, +} from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' -import { UserWithPool } from 'src/app/(evm)/pool/api/user-with-pools/route' -import { ChainId } from 'sushi/chain' - -export interface GetUserArgs { - id?: string - chainIds?: ChainId[] -} - -export function getUserPositionsWithPoolsUrl( - args: GetSushiV2StakedUnstakedPositions, -) { - return `/pool/api/user-with-pools/${parseArgs(args)}` -} export function useSushiV2UserPositions( - args: GetSushiV2StakedUnstakedPositions, + args: GetV2Positions, shouldFetch = true, ) { - return useQuery({ - queryKey: [getUserPositionsWithPoolsUrl(args)], - queryFn: () => - fetch(getUserPositionsWithPoolsUrl(args)) - .then((data) => data.text()) - .then(JSON.parse), - enabled: Boolean(shouldFetch && args.id), + return useQuery({ + queryKey: ['v2-positions', { ...args }], + queryFn: async () => await getV2Positions(args), + enabled: Boolean(shouldFetch && args.chainId && args.user), }) } diff --git a/apps/web/src/ui/pool/PositionsTable.tsx b/apps/web/src/ui/pool/PositionsTable.tsx index a4f4391173..56d8c84681 100644 --- a/apps/web/src/ui/pool/PositionsTable.tsx +++ b/apps/web/src/ui/pool/PositionsTable.tsx @@ -1,13 +1,11 @@ -import { Card, CardHeader, CardTitle, DataTable } from '@sushiswap/ui' -import { Slot } from '@sushiswap/ui' +import { Card, CardHeader, CardTitle, DataTable, Slot } from '@sushiswap/ui' import { DisplayColumnDef, PaginationState, Row } from '@tanstack/react-table' -import React, { FC, ReactNode, useCallback, useMemo, useState } from 'react' -import { SUPPORTED_CHAIN_IDS } from 'src/config' +import { FC, ReactNode, useCallback, useMemo, useState } from 'react' import { useSushiV2UserPositions } from 'src/lib/hooks' -import type { UserWithPool } from 'src/app/(evm)/pool/api/user-with-pools/route' +import { V2Position } from '@sushiswap/graph-client/data-api' +import { ChainId } from 'sushi' import { useAccount } from 'wagmi' -import { usePoolFilters } from './PoolsFiltersProvider' import { APR_COLUMN, NAME_COLUMN_POOL, VALUE_COLUMN } from './columns' // ! Column types have to be checked manually @@ -15,11 +13,11 @@ const COLUMNS = [ NAME_COLUMN_POOL, VALUE_COLUMN, APR_COLUMN, -] as DisplayColumnDef[] +] as DisplayColumnDef[] interface PositionsTableProps { - onRowClick?(row: UserWithPool): void - rowLink?(row: UserWithPool): string + onRowClick?(row: V2Position): void + rowLink?(row: V2Position): string } const tableState = { sorting: [{ id: 'value', desc: true }] } @@ -29,7 +27,7 @@ export const PositionsTable: FC = ({ rowLink, }) => { const { address } = useAccount() - const { chainIds, tokenSymbols } = usePoolFilters() + // const { chainIds, tokenSymbols } = usePoolFilters() const [paginationState, setPaginationState] = useState({ pageIndex: 0, pageSize: 10, @@ -37,34 +35,18 @@ export const PositionsTable: FC = ({ const { data: positions, isLoading } = useSushiV2UserPositions( { - id: address!, - chainIds: SUPPORTED_CHAIN_IDS, + user: address!, + chainId: ChainId.ARBITRUM, // TODO: fix }, !!address, ) - const _positions = useMemo(() => { if (!positions) return [] - - const _tokenSymbols = tokenSymbols?.filter((el) => el !== '') || [] - const searchFiltered = positions.filter((el) => - _tokenSymbols.length > 0 - ? _tokenSymbols.some((symbol) => { - return [el.pool?.token0.symbol, el.pool?.token1.symbol].includes( - symbol.toUpperCase(), - ) - }) - : true, - ) - - const chainFiltered = searchFiltered.filter((el) => - chainIds.includes(el.pool.chainId as (typeof chainIds)[number]), - ) - return chainFiltered - }, [positions, tokenSymbols, chainIds]) + return positions + }, [positions]) const rowRenderer = useCallback( - (row: Row, rowNode: ReactNode) => { + (row: Row, rowNode: ReactNode) => { if (onRowClick) return ( = ({ My Positions{' '} - ({_positions.length}) + ({positions?.length ?? 0}) diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts index d428adfa6d..a44aa8898e 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts @@ -9,7 +9,7 @@ import type { VaultV1 } from './vault' export const VaultsQuery = graphql( ` query Vaults($chainId: Int!, $poolAddress: String!) { - vaults(chainId: $chainId, vaultAddress: $poolAddress) { + vaults(chainId: $chainId, poolAddress: $poolAddress) { id address chainId diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v2/index.ts b/packages/graph-client/src/subgraphs/data-api/queries/v2/index.ts index a44989cb57..50f015cfd6 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v2/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v2/index.ts @@ -1,4 +1,5 @@ export * from './buckets' export * from './burns' export * from './mints' +export * from './positions' export * from './swaps' diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v2/positions.ts b/packages/graph-client/src/subgraphs/data-api/queries/v2/positions.ts new file mode 100644 index 0000000000..7956d27df2 --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/v2/positions.ts @@ -0,0 +1,157 @@ +import type { VariablesOf } from 'gql.tada' +import { request, type RequestOptions } from 'src/lib/request' +import { ChainId, ChefType, RewarderType, SushiSwapProtocol } from 'sushi' +import { isSushiSwapV2ChainId } from 'sushi/config' +import { getAddress, type Address } from 'viem' +import { graphql } from '../../graphql' +export const V2PositionsQuery = graphql( + ` +query V2PositionsQuery($user: String!, $chainId: Int!) { + v2LiquidityPositions(user: $user, chainId: $chainId) { + user + stakedBalance + unstakedBalance + pool { + id + chainId + name + address + swapFee + protocol + + liquidity + liquidityUSD + feeApr1d + totalApr1d + incentiveApr + isIncentivized + wasIncentivized + + incentives { + id + chainId + chefType + apr + rewardToken { + id + address + name + symbol + decimals + } + rewardPerDay + poolAddress + pid + rewarderAddress + rewarderType + } + + token0 { + id + address + name + symbol + decimals + } + token1 { + id + address + name + symbol + decimals + } + } + } +} +`, +) + +export type GetV2Positions = VariablesOf + +export async function getV2Positions( + variables: GetV2Positions, + options?: RequestOptions, +) { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const chainId = Number(variables.chainId) as ChainId + + if (!isSushiSwapV2ChainId(chainId)) { + throw new Error('Invalid chainId') + } + const user = getAddress(variables.user).toLowerCase() + + const result = await request( + { url, document: V2PositionsQuery, variables: { chainId, user } }, + options, + ) + if (result.v2LiquidityPositions) { + return result.v2LiquidityPositions.map((p) => { + const incentives = p.pool.incentives + .filter((i) => i !== null) + .map((incentive) => ({ + id: incentive.id as `${string}:0x${string}`, + chainId, + chefType: incentive.chefType as ChefType, + apr: incentive.apr, + rewardToken: { + id: incentive.rewardToken.id as `${string}:0x${string}`, + address: incentive.rewardToken.address as Address, + chainId, + decimals: incentive.rewardToken.decimals, + name: incentive.rewardToken.name, + symbol: incentive.rewardToken.symbol, + }, + rewardPerDay: incentive.rewardPerDay, + poolAddress: incentive.poolAddress as Address, + pid: incentive.pid, + rewarderAddress: incentive.rewarderAddress as Address, + rewarderType: incentive.rewarderType as RewarderType, + })) + + const pool = { + id: p.pool.id as `${string}:0x${string}`, + address: p.pool.address as Address, + chainId, + name: `${p.pool.token0.symbol}-${p.pool.token1.symbol}`, + swapFee: p.pool.swapFee, + protocol: SushiSwapProtocol.SUSHISWAP_V2, + liquidity: BigInt(p.pool.liquidity), + liquidityUSD: p.pool.liquidityUSD, + + token0: { + id: p.pool.token0.id as `${string}:0x${string}`, + address: p.pool.token0.address as Address, + chainId, + decimals: p.pool.token0.decimals, + name: p.pool.token0.name, + symbol: p.pool.token0.symbol, + }, + token1: { + id: p.pool.token1.id as `${string}:0x${string}`, + address: p.pool.token1.address as Address, + chainId, + decimals: p.pool.token1.decimals, + name: p.pool.token1.name, + symbol: p.pool.token1.symbol, + }, + + feeApr1d: p.pool.feeApr1d, + totalApr1d: p.pool.totalApr1d, + incentiveApr: p.pool.incentiveApr, + isIncentivized: p.pool.isIncentivized, + wasIncentivized: p.pool.wasIncentivized, + incentives, + } + return { + user: p.user, + stakedBalance: BigInt(p.stakedBalance), + unstakedBalance: BigInt(p.unstakedBalance), + pool, + } + }) + } + + throw new Error('No positions found') +} + +export type V2Position = Awaited>[0] diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index 9ac1e8ce53..c537c00234 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -9,13 +9,13 @@ type Bucket { } type SushiDayBuckets { - v2: [Bucket]! - v3: [Bucket]! + v2: [Bucket!]! + v3: [Bucket!]! } type Query { sushiDayBuckets(chainId: Int!): SushiDayBuckets! - topPools(chainId: Int!): [TopPool]! + topPools(chainId: Int!): [TopPool!]! v2Pool(address: String!, chainId: Int!): V2Pool! v3Pool(address: String!, chainId: Int!): V3Pool! v2PoolBuckets(address: String!, chainId: Int!): PoolBuckets! @@ -23,22 +23,22 @@ type Query { portfolioWallet(id: ID!): PortfolioWallet! portfolioLiquidityPositions(id: ID!): PortfolioPositions! portfolioClaimables(id: ID!): PortfolioClaimables! - portfolioHistory(id: ID!): [PortfolioTransaction]! - smartPools(chainId: Int!): [BasicSmartPool]! + portfolioHistory(id: ID!): [PortfolioTransaction!]! + smartPools(chainId: Int!): [BasicSmartPool!]! vault(chainId: Int!, vaultAddress: String!): Vault! vaults(chainId: Int!, poolAddress: String!): [Vault!]! sushiBarStats: SushiBarStats! sushiBarHistory: SushiBarHistory! - v2LiquidityPositions(user: String!, chainId: Int!): [V2LiquidityPosition]! - v2Swaps(address: String!, chainId: Int!): [V2Swap]! - v2Burns(address: String!, chainId: Int!): [V2Burn]! - v2Mints(address: String!, chainId: Int!): [V2Mint]! - v2Transactions(address: String!, chainId: Int!): [V2Transaction]! - v3Swaps(address: String!, chainId: Int!): [V3Swap]! - v3Burns(address: String!, chainId: Int!): [V3Burn]! - v3Mints(address: String!, chainId: Int!): [V3Mint]! - v3Collects(address: String!, chainId: Int!): [V3Collect]! - v3Transactions(address: String!, chainId: Int!): [V3Transaction]! + v2LiquidityPositions(user: String!, chainId: Int!): [V2LiquidityPosition!]! + v2Swaps(address: String!, chainId: Int!): [V2Swap!]! + v2Burns(address: String!, chainId: Int!): [V2Burn!]! + v2Mints(address: String!, chainId: Int!): [V2Mint!]! + v2Transactions(address: String!, chainId: Int!): [V2Transaction!]! + v3Swaps(address: String!, chainId: Int!): [V3Swap!]! + v3Burns(address: String!, chainId: Int!): [V3Burn!]! + v3Mints(address: String!, chainId: Int!): [V3Mint!]! + v3Collects(address: String!, chainId: Int!): [V3Collect!]! + v3Transactions(address: String!, chainId: Int!): [V3Transaction!]! } type Token { @@ -462,16 +462,16 @@ type SushiBarBucket { } type SushiBarHistory { - hourSnapshots: [SushiBarBucket]! - daySnapshots: [SushiBarBucket]! - weekSnapshots: [SushiBarBucket]! + hourSnapshots: [SushiBarBucket!]! + daySnapshots: [SushiBarBucket!]! + weekSnapshots: [SushiBarBucket!]! } type V2LiquidityPosition { user: String! stakedBalance: String! unstakedBalance: String! - pool: String! + pool: V2Pool! } type V2Burn { From 108e8bcdfa25b01e5a5d4f2069ada36ab96e5ae7 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Wed, 24 Jul 2024 22:11:18 +0200 Subject: [PATCH 031/139] refactor: smart pool positions --- apps/web/src/lib/hooks/api/userSmartPools.ts | 19 +++++++++++++ .../steer/useSteerAccountPositionsExtended.ts | 26 +++++++++++------ .../Smart/columns/SteerStrategyCell.tsx | 4 +-- .../Tables/Smart/columns/index.tsx | 8 +++--- apps/web/src/ui/pool/PositionCardList.tsx | 5 ++-- apps/web/src/ui/pool/SmartPoolsTable.tsx | 3 +- apps/web/src/ui/pool/SmartPositionsTable.tsx | 28 ++++++++++++------- .../queries/smart-pool/smart-pools.ts | 23 +++++++++++---- .../src/subgraphs/data-api/schema.graphql | 15 ++++++---- packages/steer-sdk/src/constants.ts | 3 ++ 10 files changed, 94 insertions(+), 40 deletions(-) create mode 100644 apps/web/src/lib/hooks/api/userSmartPools.ts diff --git a/apps/web/src/lib/hooks/api/userSmartPools.ts b/apps/web/src/lib/hooks/api/userSmartPools.ts new file mode 100644 index 0000000000..5ed98b6000 --- /dev/null +++ b/apps/web/src/lib/hooks/api/userSmartPools.ts @@ -0,0 +1,19 @@ +'use client' + +import { + getSmartPools, + GetSmartPools, + SmartPoolsV1, +} from '@sushiswap/graph-client/data-api' +import { useQuery } from '@tanstack/react-query' + +export function useSmartPools( + args: GetSmartPools, + shouldFetch = true +) { + return useQuery({ + queryKey: ['smart-pools', {...args}], + queryFn: async () => await getSmartPools(args), + enabled: Boolean(shouldFetch && args.chainId), + }) +} diff --git a/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts b/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts index c20dc4bebf..b6f6293eb7 100644 --- a/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts +++ b/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts @@ -1,4 +1,3 @@ -import { useSteerVaults } from '@sushiswap/client/hooks' import { useAllPrices } from '@sushiswap/react-query' import { Amount, Token } from 'sushi/currency' import { Address } from 'viem' @@ -6,6 +5,8 @@ import { Address } from 'viem' import { STEER_SUPPORTED_CHAIN_IDS } from '@sushiswap/steer-sdk' import { useMemo } from 'react' import { useSteerAccountPositions } from './useSteerAccountPosition' +import { useSmartPools } from 'src/lib/hooks/api/userSmartPools' +import { ID } from 'sushi' interface UseSteerAccountPositionsExtended { account: Address | undefined @@ -17,6 +18,11 @@ export type SteerAccountPositionExtended = NonNullable< ReturnType['data'] >[0] + +export type SteerAccountPositionVault = NonNullable< + ReturnType['data'] +>[0]['vault'] + export const useSteerAccountPositionsExtended = ({ account, enabled = true, @@ -24,12 +30,14 @@ export const useSteerAccountPositionsExtended = ({ }: UseSteerAccountPositionsExtended) => { const { data: prices, isInitialLoading: isPricesLoading } = useAllPrices() - const { data: vaults, isLoading: isVaultsLoading } = useSteerVaults({ - args: { chainIds }, - shouldFetch: Boolean(enabled && account), - }) - const vaultIds = useMemo(() => vaults?.map((el) => el.id), [vaults]) + const { data: smartPools, isLoading: isVaultsLoading } = useSmartPools( + { chainId: 137 }, // TODO: FIX + Boolean(enabled && account), + ) + + + const vaultIds = useMemo(() => smartPools?.map((el) => el.id as ID) ?? [], [smartPools]) const { data: positions, isLoading } = useSteerAccountPositions({ account, @@ -38,12 +46,12 @@ export const useSteerAccountPositionsExtended = ({ }) const data = useMemo(() => { - if (!vaults || !positions) return undefined + if (!smartPools || !positions) return undefined return positions.flatMap((position) => { if (position.steerTokenBalance <= 0n) return [] - const vault = vaults.find((vault) => vault.id === position.id) + const vault = smartPools.find((vault) => vault.id === position.id) if (!vault) return [] @@ -75,7 +83,7 @@ export const useSteerAccountPositionsExtended = ({ totalAmountUSD: token0AmountUSD + token1AmountUSD, } }) - }, [vaults, prices, positions]) + }, [smartPools, prices, positions]) return { data, diff --git a/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx b/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx index 38932e97ae..94a6d3001b 100644 --- a/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx +++ b/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx @@ -1,7 +1,7 @@ -import { SteerVault } from '@sushiswap/client' import React, { FC } from 'react' import { SteerStrategyConfig } from '../../../../Steer/constants' +import { SteerAccountPositionVault } from 'src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended' -export const SteerStrategyCell: FC<{ vault: SteerVault }> = ({ vault }) => { +export const SteerStrategyCell: FC<{ vault: SteerAccountPositionVault }> = ({ vault }) => { return
{SteerStrategyConfig[vault.strategy].name}
} diff --git a/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/index.tsx b/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/index.tsx index 96a45170f4..5d7f13ea21 100644 --- a/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/index.tsx +++ b/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/index.tsx @@ -17,6 +17,7 @@ import { SteerAccountPositionExtended } from 'src/lib/wagmi/hooks/steer/useSteer import { unwrapToken } from 'sushi/currency' import { ProtocolBadge } from '../../../../PoolNameCell' import { SteerStrategyCell } from './SteerStrategyCell' +import { SushiSwapProtocol } from 'sushi' export const STEER_NAME_COLUMN: ColumnDef< SteerAccountPositionExtended, @@ -26,7 +27,6 @@ export const STEER_NAME_COLUMN: ColumnDef< header: 'Name', cell: ({ row: { original } }) => { const vault = original.vault - const pool = vault.pool return (
@@ -61,7 +61,7 @@ export const STEER_NAME_COLUMN: ColumnDef< - {ProtocolBadge[pool.protocol]} + {ProtocolBadge[SushiSwapProtocol.SUSHISWAP_V3]}

Protocol version

@@ -72,7 +72,7 @@ export const STEER_NAME_COLUMN: ColumnDef<
- {formatPercent(pool.swapFee)} + {formatPercent(vault.swapFee)}
@@ -80,7 +80,7 @@ export const STEER_NAME_COLUMN: ColumnDef<
- {pool.isIncentivized && ( + {vault.isIncentivized && ( diff --git a/apps/web/src/ui/pool/PositionCardList.tsx b/apps/web/src/ui/pool/PositionCardList.tsx index 90d6adc24c..70963de013 100644 --- a/apps/web/src/ui/pool/PositionCardList.tsx +++ b/apps/web/src/ui/pool/PositionCardList.tsx @@ -1,6 +1,5 @@ import React, { FC, ReactNode } from 'react' import type { UserWithPool } from 'src/app/(evm)/pool/api/user-with-pools/route' -import { SUPPORTED_CHAIN_IDS } from 'src/config' import { useSushiV2UserPositions } from 'src/lib/hooks' import { useAccount } from 'wagmi' @@ -22,8 +21,8 @@ const value = (position: UserWithPool) => export const PositionCardList: FC = ({ children }) => { const { address } = useAccount() const { data: userPositions, isLoading } = useSushiV2UserPositions({ - id: address!, - chainIds: SUPPORTED_CHAIN_IDS, + user: address!, + chainId: 42161, // TODO: FIX }) return ( diff --git a/apps/web/src/ui/pool/SmartPoolsTable.tsx b/apps/web/src/ui/pool/SmartPoolsTable.tsx index f74c80b622..2d5d670c29 100644 --- a/apps/web/src/ui/pool/SmartPoolsTable.tsx +++ b/apps/web/src/ui/pool/SmartPoolsTable.tsx @@ -58,6 +58,7 @@ import { APRHoverCard } from './APRHoverCard' import { ProtocolBadge } from './PoolNameCell' import { usePoolFilters } from './PoolsFiltersProvider' import { SteerStrategyConfig } from './Steer/constants' +import { SteerStrategy } from '@sushiswap/steer-sdk' const COLUMNS = [ { @@ -519,7 +520,7 @@ const COLUMNS = [ ] satisfies ColumnDef[] export const SmartPoolsTable = () => { - const { _tokenSymbols, chainIds, protocols, farmsOnly } = usePoolFilters() + const { chainIds, protocols, farmsOnly } = usePoolFilters() const [sorting, setSorting] = useState([ { id: 'liquidityUSD', desc: true }, ]) diff --git a/apps/web/src/ui/pool/SmartPositionsTable.tsx b/apps/web/src/ui/pool/SmartPositionsTable.tsx index ccd3fd3f8a..5afde066fd 100644 --- a/apps/web/src/ui/pool/SmartPositionsTable.tsx +++ b/apps/web/src/ui/pool/SmartPositionsTable.tsx @@ -16,7 +16,7 @@ import { SteerAccountPositionExtended, useSteerAccountPositionsExtended, } from 'src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended' -import { formatPercent } from 'sushi' +import { ChainId, formatPercent, SushiSwapProtocol } from 'sushi' import { useAccount } from 'wagmi' import { APRHoverCard } from './APRHoverCard' import { @@ -25,6 +25,7 @@ import { STEER_STRATEGY_COLUMN, } from './ConcentratedPositionsTable/Tables/Smart/columns' import { usePoolFilters } from './PoolsFiltersProvider' +import { Address } from 'viem' const COLUMNS = [ STEER_NAME_COLUMN, @@ -33,12 +34,9 @@ const COLUMNS = [ { id: 'totalApr1d', header: 'APR (24h)', - accessorFn: (row) => (row.vault.apr1d + row.vault.pool.incentiveApr) * 100, + accessorFn: (row) => row.vault.stakedAndIncentiveApr1d, cell: (props) => { - const totalAPR = - (props.row.original.vault.apr1d + - props.row.original.vault.pool.incentiveApr) * - 100 + const totalAPR = props.row.original.vault.stakedAndIncentiveApr1d return (
@@ -46,7 +44,7 @@ const COLUMNS = [ - {formatPercent(props.row.original.vault.pool.totalApr1d)} + {formatPercent(props.row.original.vault.feeAndIncentiveApr1d)} @@ -55,8 +53,18 @@ const COLUMNS = [ {formatPercent(totalAPR / 100)} @@ -101,7 +109,7 @@ export const SmartPositionsTable = () => { - `/pool/${row.vault.pool.id}/smart/${row.vault.id}` + `/pool/${row.vault.poolAddress}/smart/${row.vault.id}` } columns={COLUMNS} data={_positions} diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts index 5ccff2a15e..b80e931813 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts @@ -2,19 +2,23 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' import { graphql } from '../../graphql' +import { isSteerStrategy, type SteerStrategy } from '@sushiswap/steer-sdk' export const SmartPoolsQuery = graphql( ` query SmartPools($chainId: Int!) { smartPools(chainId: $chainId) { id + address chainId + poolAddress address swapFee strategy protocol token0 { id + chainId address name symbol @@ -22,6 +26,7 @@ export const SmartPoolsQuery = graphql( } token1 { id + chainId address name symbol @@ -37,14 +42,16 @@ export const SmartPoolsQuery = graphql( incentiveApr wasIncentivized isIncentivized + + isEnabled + wasEnabled + isDeprecated } } `, ) -export type GetSmartPools = VariablesOf< - typeof SmartPoolsQuery -> +export type GetSmartPools = VariablesOf export async function getSmartPools( variables: GetSmartPools, @@ -58,11 +65,15 @@ export async function getSmartPools( ) if (result) { return result.smartPools + .filter((v) => isSteerStrategy(v.strategy)) + .map((pool) => ({ + ...pool, + id: pool.id as `${string}:0x${string}`, + strategy: pool.strategy as SteerStrategy, + })) } throw new Error('No smart pools found') } -export type SmartPoolsV1 = Awaited< - ReturnType -> +export type SmartPoolsV1 = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index c537c00234..939b2f4bd9 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -43,6 +43,7 @@ type Query { type Token { id: ID! + chainId: Int! address: String! name: String! symbol: String! @@ -79,7 +80,7 @@ type V2Pool { incentiveApr: Float! isIncentivized: Boolean! wasIncentivized: Boolean! - incentives: [Incentive]! + incentives: [Incentive!]! } type V3Pool { @@ -119,8 +120,8 @@ type V3Pool { hasSmartPool: Boolean! isIncentivized: Boolean! wasIncentivized: Boolean! - incentives: [Incentive]! - vaults: [String]! + incentives: [Incentive!]! + vaults: [String!]! } type Incentive { @@ -176,8 +177,8 @@ type TopPool { } type PoolBuckets { - hourBuckets: [PoolBucket]! - dayBuckets: [PoolBucket]! + hourBuckets: [PoolBucket!]! + dayBuckets: [PoolBucket!]! } type SimpleToken { @@ -378,6 +379,7 @@ type BasicSmartPool { id: ID! chainId: Int! address: String! + poolAddress: String! swapFee: Float! protocol: String! token0: Token! @@ -397,6 +399,9 @@ type BasicSmartPool { upperTick: Int! adjustmentFrequency: Int! lastAdjustmentTimestamp: Int! + isEnabled: Boolean! + wasEnabled: Boolean! + isDeprecated: Boolean! } type Vault { diff --git a/packages/steer-sdk/src/constants.ts b/packages/steer-sdk/src/constants.ts index f190c569b8..2569dcaef8 100644 --- a/packages/steer-sdk/src/constants.ts +++ b/packages/steer-sdk/src/constants.ts @@ -93,3 +93,6 @@ export enum SteerStrategy { KeltnerAlgo = 'KeltnerAlgo', BollingerAlgo = 'BollingerAlgo', } + +export const isSteerStrategy = (strategy: string): strategy is SteerStrategy => + Object.values(SteerStrategy).includes(strategy as SteerStrategy) \ No newline at end of file From 70bd7c9e2673000bdb841842dfcec857815e2e14 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 25 Jul 2024 21:55:54 +0200 Subject: [PATCH 032/139] WIP --- .../pool/incentivize/layout.tsx | 0 .../{ => [chainId]}/pool/incentivize/page.tsx | 0 .../pool/v2/[address]/(landing)/layout.tsx | 2 +- .../pool/v2/[address]/(landing)/page.tsx | 2 +- .../pool/v3/[address]/(landing)/layout.tsx | 4 +- .../pool/v3/[address]/(landing)/page.tsx | 2 +- .../v3/[address]/smart/(overview)/layout.tsx | 2 +- .../v3/[address]/smart/(overview)/page.tsx | 5 +- .../v3/[address]/smart/[vaultId]/page.tsx | 5 + .../app/(evm)/analytics/api/charts/route.ts | 16 - apps/web/src/app/(evm)/analytics/layout.tsx | 13 - apps/web/src/app/(evm)/analytics/page.tsx | 5 - .../(evm)/api/campaign/taskon/core/route.ts | 47 - .../src/app/(evm)/pool/(landing)/layout.tsx | 95 - .../app/(evm)/pool/(landing)/migrate/page.tsx | 7 - .../web/src/app/(evm)/pool/(landing)/page.tsx | 26 - .../(evm)/pool/(landing)/smart-pool/page.tsx | 24 - .../(evm)/pool/[id]/(landing)/add/page.tsx | 7 - .../app/(evm)/pool/[id]/(landing)/layout.tsx | 52 - .../pool/[id]/(landing)/migrate/layout.tsx | 14 - .../pool/[id]/(landing)/migrate/page.tsx | 51 - .../app/(evm)/pool/[id]/(landing)/page.tsx | 32 - .../(landing)/positions/[positionId]/page.tsx | 20 - .../[id]/(landing)/positions/create/page.tsx | 31 - .../(evm)/pool/[id]/(landing)/remove/page.tsx | 7 - .../(evm)/pool/[id]/(landing)/stake/page.tsx | 7 - .../pool/[id]/(landing)/unstake/page.tsx | 7 - .../pool/[id]/smart/(overview)/layout.tsx | 73 - .../pool/[id]/smart/(overview)/loading.tsx | 8 - .../(evm)/pool/[id]/smart/(overview)/page.tsx | 31 - .../pool/[id]/smart/[vaultId]/layout.tsx | 86 - .../pool/[id]/smart/[vaultId]/loading.tsx | 13 - .../(evm)/pool/[id]/smart/[vaultId]/page.tsx | 103 - apps/web/src/app/(evm)/pool/add/layout.tsx | 39 - apps/web/src/app/(evm)/pool/add/page.tsx | 210 - .../app/(evm)/pool/add/v2/[chainId]/page.tsx | 391 - apps/web/src/app/(evm)/pool/api/cors.ts | 5 - .../(evm)/pool/api/graphPool/[id]/route.ts | 25 - .../api/pools/[chainId]/[address]/route.ts | 34 - .../app/(evm)/pool/api/pools/count/route.ts | 21 - .../web/src/app/(evm)/pool/api/pools/route.ts | 22 - .../steer-vault/[chainId]/[address]/route.ts | 26 - .../(evm)/pool/api/steer-vault/count/route.ts | 26 - .../app/(evm)/pool/api/steer-vault/route.ts | 26 - .../(evm)/pool/api/user-with-pools/route.ts | 117 - apps/web/src/app/(evm)/pool/api/user/route.ts | 51 - apps/web/src/app/(evm)/pool/header.tsx | 17 - apps/web/src/app/(evm)/pool/hero.tsx | 154 - apps/web/src/app/(evm)/pool/layout.tsx | 22 - apps/web/src/app/(evm)/pool/loading.tsx | 6 - apps/web/src/app/(evm)/pool/not-found.tsx | 39 - apps/web/src/app/(evm)/pool/providers.tsx | 7 - apps/web/src/app/(evm)/pool/swr-config.tsx | 7 - apps/web/src/app/(landing)/api/stats/route.ts | 129 - apps/web/src/lib/graph.ts | 119 +- apps/web/src/lib/hooks/useTokensFromPool.ts | 15 +- .../src/ui/analytics/global-stats-charts.tsx | 155 - apps/web/src/ui/pool/NewPoolsTable.tsx | 2 +- apps/web/src/ui/pool/PoolChartGraph.tsx | 1 - apps/web/src/ui/pool/PoolHeader.tsx | 4 +- apps/web/src/ui/pool/PoolPageV3.tsx | 6 +- apps/web/src/ui/pool/PositionCard.tsx | 4 +- apps/web/src/ui/pool/PositionCardList.tsx | 6 +- apps/web/src/ui/pool/Steer/SteerCarousel.tsx | 7 +- apps/web/src/ui/pool/columns.tsx | 3 +- packages/graph-client/scripts/t.ts | 5 - .../graph-client/scripts/update-schemas.ts | 9 - .../src/composite/chef-user-positions.ts | 86 - .../src/composite/sushi-day-datas.ts | 100 - .../src/composite/sushi-historic-pool.ts | 204 - .../sushi-v2-staked-unstaked-positions.ts | 116 - .../src/subgraphs/blocks/graphql.ts | 8 - .../src/subgraphs/blocks/index.ts | 2 - .../blocks/queries/block-historic.ts | 64 - .../src/subgraphs/blocks/queries/blocks.ts | 49 - .../src/subgraphs/blocks/schema.graphql | 381 - .../data-api/queries/pool/v2-pool.ts | 155 +- .../data-api/queries/pool/v3-pool.ts | 174 +- .../queries/smart-pool/smart-pools.ts | 20 + .../subgraphs/data-api/queries/v2/buckets.ts | 29 +- .../subgraphs/data-api/queries/v3/buckets.ts | 29 +- .../subgraphs/data-api/queries/v3/index.ts | 1 + .../data-api/queries/v3/pools-by-tokens.ts | 124 + .../src/subgraphs/data-api/schema.graphql | 28 + .../src/subgraphs/master-chef-v1/graphql.ts | 8 - .../src/subgraphs/master-chef-v1/index.ts | 1 - .../master-chef-v1/queries/user-positions.ts | 69 - .../subgraphs/master-chef-v1/schema.graphql | 1318 --- .../src/subgraphs/master-chef-v2/graphql.ts | 8 - .../src/subgraphs/master-chef-v2/index.ts | 2 - .../master-chef-v2/queries/rewarders.ts | 56 - .../master-chef-v2/queries/user-positions.ts | 69 - .../subgraphs/master-chef-v2/schema.graphql | 749 -- .../src/subgraphs/mini-chef/graphql.ts | 8 - .../src/subgraphs/mini-chef/index.ts | 2 - .../subgraphs/mini-chef/queries/rewarders.ts | 55 - .../mini-chef/queries/user-positions.ts | 71 - .../src/subgraphs/mini-chef/schema.graphql | 878 -- .../src/subgraphs/steer/graphql.ts | 8 - .../graph-client/src/subgraphs/steer/index.ts | 1 - .../src/subgraphs/steer/queries/vaults.ts | 135 - .../src/subgraphs/steer/schema.graphql | 7681 ----------------- .../src/subgraphs/sushi-bar/graphql.ts | 8 - .../src/subgraphs/sushi-bar/index.ts | 2 - .../sushi-bar/queries/bar-history.ts | 57 - .../src/subgraphs/sushi-bar/queries/bar.ts | 46 - .../src/subgraphs/sushi-bar/schema.graphql | 1886 ---- .../sushi-v2/fragments/pool-fields.ts | 30 - .../src/subgraphs/sushi-v2/graphql.ts | 8 - .../src/subgraphs/sushi-v2/index.ts | 10 - .../src/subgraphs/sushi-v2/queries/burns.ts | 54 - .../subgraphs/sushi-v2/queries/day-datas.ts | 51 - .../src/subgraphs/sushi-v2/queries/factory.ts | 52 - .../sushi-v2/queries/liquidity-positions.ts | 94 - .../src/subgraphs/sushi-v2/queries/mints.ts | 49 - .../sushi-v2/queries/pool-with-buckets.ts | 87 - .../src/subgraphs/sushi-v2/queries/pool.ts | 48 - .../src/subgraphs/sushi-v2/queries/pools.ts | 49 - .../src/subgraphs/sushi-v2/queries/swaps.ts | 53 - .../src/subgraphs/sushi-v2/queries/tokens.ts | 48 - .../sushi-v2/queries/transactions.ts | 73 - .../src/subgraphs/sushi-v2/schema.graphql | 3197 ------- .../sushi-v2/transforms/bucket-v2-to-std.ts | 24 - .../sushi-v2/transforms/pool-v2-to-base.ts | 83 - .../sushi-v3/fragments/pool-fields.ts | 51 - .../src/subgraphs/sushi-v3/graphql.ts | 8 - .../src/subgraphs/sushi-v3/index.ts | 11 - .../src/subgraphs/sushi-v3/queries/burns.ts | 50 - .../subgraphs/sushi-v3/queries/collects.ts | 48 - .../subgraphs/sushi-v3/queries/day-datas.ts | 52 - .../src/subgraphs/sushi-v3/queries/factory.ts | 56 - .../src/subgraphs/sushi-v3/queries/mints.ts | 57 - .../sushi-v3/queries/pool-with-buckets.ts | 73 - .../src/subgraphs/sushi-v3/queries/pool.ts | 48 - .../sushi-v3/queries/pools-by-token-pair.ts | 58 - .../src/subgraphs/sushi-v3/queries/pools.ts | 48 - .../src/subgraphs/sushi-v3/queries/swaps.ts | 50 - .../sushi-v3/queries/transactions.ts | 83 - .../src/subgraphs/sushi-v3/schema.graphql | 6541 -------------- .../sushi-v3/transforms/bucket-v3-to-std.ts | 24 - .../sushi-v3/transforms/pool-v3-to-base.ts | 97 - packages/graph-client/tsconfig.json | 48 - packages/react-query/package.json | 1 + .../useConcentratedLiquidityPoolStats.ts | 5 +- pnpm-lock.yaml | 258 +- 145 files changed, 423 insertions(+), 28449 deletions(-) rename apps/web/src/app/(evm)/{ => [chainId]}/pool/incentivize/layout.tsx (100%) rename apps/web/src/app/(evm)/{ => [chainId]}/pool/incentivize/page.tsx (100%) delete mode 100644 apps/web/src/app/(evm)/analytics/api/charts/route.ts delete mode 100644 apps/web/src/app/(evm)/api/campaign/taskon/core/route.ts delete mode 100644 apps/web/src/app/(evm)/pool/(landing)/layout.tsx delete mode 100644 apps/web/src/app/(evm)/pool/(landing)/migrate/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/(landing)/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/(landing)/smart-pool/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/(landing)/add/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/(landing)/layout.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/(landing)/migrate/layout.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/(landing)/migrate/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/(landing)/positions/[positionId]/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/(landing)/positions/create/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/(landing)/remove/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/(landing)/stake/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/(landing)/unstake/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/smart/(overview)/layout.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/smart/(overview)/loading.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/smart/(overview)/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/layout.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/loading.tsx delete mode 100644 apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/add/layout.tsx delete mode 100644 apps/web/src/app/(evm)/pool/add/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/add/v2/[chainId]/page.tsx delete mode 100644 apps/web/src/app/(evm)/pool/api/cors.ts delete mode 100644 apps/web/src/app/(evm)/pool/api/graphPool/[id]/route.ts delete mode 100644 apps/web/src/app/(evm)/pool/api/pools/[chainId]/[address]/route.ts delete mode 100644 apps/web/src/app/(evm)/pool/api/pools/count/route.ts delete mode 100644 apps/web/src/app/(evm)/pool/api/pools/route.ts delete mode 100644 apps/web/src/app/(evm)/pool/api/steer-vault/[chainId]/[address]/route.ts delete mode 100644 apps/web/src/app/(evm)/pool/api/steer-vault/count/route.ts delete mode 100644 apps/web/src/app/(evm)/pool/api/steer-vault/route.ts delete mode 100644 apps/web/src/app/(evm)/pool/api/user-with-pools/route.ts delete mode 100644 apps/web/src/app/(evm)/pool/api/user/route.ts delete mode 100644 apps/web/src/app/(evm)/pool/header.tsx delete mode 100644 apps/web/src/app/(evm)/pool/hero.tsx delete mode 100644 apps/web/src/app/(evm)/pool/layout.tsx delete mode 100644 apps/web/src/app/(evm)/pool/loading.tsx delete mode 100644 apps/web/src/app/(evm)/pool/not-found.tsx delete mode 100644 apps/web/src/app/(evm)/pool/providers.tsx delete mode 100644 apps/web/src/app/(evm)/pool/swr-config.tsx delete mode 100644 apps/web/src/app/(landing)/api/stats/route.ts delete mode 100644 apps/web/src/ui/analytics/global-stats-charts.tsx delete mode 100644 packages/graph-client/scripts/t.ts delete mode 100644 packages/graph-client/src/composite/chef-user-positions.ts delete mode 100644 packages/graph-client/src/composite/sushi-day-datas.ts delete mode 100644 packages/graph-client/src/composite/sushi-historic-pool.ts delete mode 100644 packages/graph-client/src/composite/sushi-v2-staked-unstaked-positions.ts delete mode 100644 packages/graph-client/src/subgraphs/blocks/graphql.ts delete mode 100644 packages/graph-client/src/subgraphs/blocks/index.ts delete mode 100644 packages/graph-client/src/subgraphs/blocks/queries/block-historic.ts delete mode 100644 packages/graph-client/src/subgraphs/blocks/queries/blocks.ts delete mode 100644 packages/graph-client/src/subgraphs/blocks/schema.graphql create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts delete mode 100644 packages/graph-client/src/subgraphs/master-chef-v1/graphql.ts delete mode 100644 packages/graph-client/src/subgraphs/master-chef-v1/index.ts delete mode 100644 packages/graph-client/src/subgraphs/master-chef-v1/queries/user-positions.ts delete mode 100644 packages/graph-client/src/subgraphs/master-chef-v1/schema.graphql delete mode 100644 packages/graph-client/src/subgraphs/master-chef-v2/graphql.ts delete mode 100644 packages/graph-client/src/subgraphs/master-chef-v2/index.ts delete mode 100644 packages/graph-client/src/subgraphs/master-chef-v2/queries/rewarders.ts delete mode 100644 packages/graph-client/src/subgraphs/master-chef-v2/queries/user-positions.ts delete mode 100644 packages/graph-client/src/subgraphs/master-chef-v2/schema.graphql delete mode 100644 packages/graph-client/src/subgraphs/mini-chef/graphql.ts delete mode 100644 packages/graph-client/src/subgraphs/mini-chef/index.ts delete mode 100644 packages/graph-client/src/subgraphs/mini-chef/queries/rewarders.ts delete mode 100644 packages/graph-client/src/subgraphs/mini-chef/queries/user-positions.ts delete mode 100644 packages/graph-client/src/subgraphs/mini-chef/schema.graphql delete mode 100644 packages/graph-client/src/subgraphs/steer/graphql.ts delete mode 100644 packages/graph-client/src/subgraphs/steer/index.ts delete mode 100644 packages/graph-client/src/subgraphs/steer/queries/vaults.ts delete mode 100644 packages/graph-client/src/subgraphs/steer/schema.graphql delete mode 100644 packages/graph-client/src/subgraphs/sushi-bar/graphql.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-bar/index.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-bar/queries/bar-history.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-bar/queries/bar.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-bar/schema.graphql delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/fragments/pool-fields.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/graphql.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/index.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/queries/burns.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/queries/day-datas.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/queries/factory.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/queries/liquidity-positions.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/queries/mints.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/queries/pool-with-buckets.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/queries/pool.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/queries/pools.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/queries/swaps.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/queries/tokens.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/queries/transactions.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/schema.graphql delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/transforms/bucket-v2-to-std.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v2/transforms/pool-v2-to-base.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/graphql.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/index.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/burns.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/collects.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/day-datas.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/factory.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/mints.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/pool-with-buckets.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/pool.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/pools-by-token-pair.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/swaps.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/transactions.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/schema.graphql delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/transforms/bucket-v3-to-std.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts diff --git a/apps/web/src/app/(evm)/pool/incentivize/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx similarity index 100% rename from apps/web/src/app/(evm)/pool/incentivize/layout.tsx rename to apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx diff --git a/apps/web/src/app/(evm)/pool/incentivize/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx similarity index 100% rename from apps/web/src/app/(evm)/pool/incentivize/page.tsx rename to apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx index ce5ef98fb2..e296cbc259 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx @@ -27,7 +27,7 @@ export default async function Layout({ )() if (!pool) { - notFound() + return notFound() } const headersList = headers() diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx index 41f4d0e083..25e0cd1bed 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx @@ -20,7 +20,7 @@ export default async function PoolPage({ // Rockstar C&D if (!pool || pool.id === '42161:0x0a4f9962e24893a4a7567e52c1ce37d5482365de') { - notFound() + return notFound() } return diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/layout.tsx index 604abfafaa..92d53afc13 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/layout.tsx @@ -27,7 +27,7 @@ export default async function Layout({ )() if (!pool) { - notFound() + return notFound() } const headersList = headers() @@ -40,7 +40,7 @@ export default async function Layout({ diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx index c329268625..6d65e4e4c1 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx @@ -20,7 +20,7 @@ export default async function PoolPage({ // Rockstar C&D if (!pool || pool.id === '42161:0x0a4f9962e24893a4a7567e52c1ce37d5482365de') { - notFound() + return notFound() } return diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/layout.tsx index 08c4e78373..40b95ed58a 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/layout.tsx @@ -31,7 +31,7 @@ export default async function Layout({ )() if (!pool) { - notFound() + return notFound() } const headersList = headers() diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx index 807dc778df..aa68a4c646 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx @@ -1,6 +1,6 @@ import { getV3Pool, getVaults } from '@sushiswap/graph-client/data-api' import { unstable_cache } from 'next/cache' -import notFound from 'src/app/(evm)/pool/not-found' +import notFound from '../../../../../not-found' import { SteerCarousel } from 'src/ui/pool/Steer/SteerCarousel' @@ -29,8 +29,9 @@ export default async function VaultOverviewPage({ const [pool, vaults] = await Promise.all([poolP, vaultsP]) if (!pool || !vaults) { - notFound() + return notFound() } + return } diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/page.tsx index 431a6a4035..a265fcb6fb 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/page.tsx @@ -15,6 +15,7 @@ import { publicClientConfig } from 'sushi/config' import { Token } from 'sushi/currency' import { formatNumber, unsanitize } from 'sushi/format' import { tickToPrice } from 'sushi/pool/sushiswap-v3' +import notFound from '../../../../../not-found' import { PublicClient, createPublicClient } from 'viem' function getPriceExtremes( @@ -110,6 +111,10 @@ export default async function SteerVaultPage({ const Component = SteerStrategyComponents[vault.strategy] + if (!pool || !vault) { + return notFound() + } + return ( diff --git a/apps/web/src/app/(evm)/analytics/api/charts/route.ts b/apps/web/src/app/(evm)/analytics/api/charts/route.ts deleted file mode 100644 index a75d1d89b9..0000000000 --- a/apps/web/src/app/(evm)/analytics/api/charts/route.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { NextResponse } from 'next/server' - -import { getCharts } from 'src/lib/graph' - -export const revalidate = 3600 - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url) - const networks = searchParams.get('networks') as string - const data = await getCharts({ networks }) - return NextResponse.json(data, { - headers: { - 'Cache-Control': 'public, max-age=60, stale-while-revalidate=600', - }, - }) -} diff --git a/apps/web/src/app/(evm)/analytics/layout.tsx b/apps/web/src/app/(evm)/analytics/layout.tsx index 88546ace1f..f0a66bc1b9 100644 --- a/apps/web/src/app/(evm)/analytics/layout.tsx +++ b/apps/web/src/app/(evm)/analytics/layout.tsx @@ -3,8 +3,6 @@ import { HotJar } from '@sushiswap/ui' import { Header } from './header' -import { GlobalStatsCharts } from 'src/ui/analytics/global-stats-charts' - import { PathnameButton } from 'src/ui/pool' export const metadata = { @@ -36,21 +34,10 @@ export default function AnalyticsLayout({

-
- - - Pools - - -
@@ -21,9 +18,7 @@ export default function AnalyticsPage() {
-
-
) } diff --git a/apps/web/src/app/(evm)/api/campaign/taskon/core/route.ts b/apps/web/src/app/(evm)/api/campaign/taskon/core/route.ts deleted file mode 100644 index 0f00c65747..0000000000 --- a/apps/web/src/app/(evm)/api/campaign/taskon/core/route.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { getSushiV3Mints } from '@sushiswap/graph-client/sushi-v3' -import { NextRequest, NextResponse } from 'next/server' -import { ChainId } from 'sushi/chain' -import { getAddress } from 'viem' -import { z } from 'zod' - -const schema = z.object({ - address: z.coerce.string().transform((address) => getAddress(address)), -}) - -const poolAddress = '0xc1e92e02e12324b69ee0b29c6c6f471841d959ec' // CORE/BSSB - 1% - -export async function GET(request: NextRequest) { - const params = Object.fromEntries(request.nextUrl.searchParams.entries()) - - try { - const { address } = schema.parse(params) - - const mints = await getSushiV3Mints({ - chainId: ChainId.CORE, - where: { - origin: address, - pool: poolAddress, - }, - }) - - if (mints.length > 0) { - return NextResponse.json( - { result: { isValid: true } }, - { - headers: { - 'Cache-Control': 'public, max-age=60, stale-while-revalidate=600', - }, - }, - ) - } - } catch (_) {} - - return NextResponse.json( - { result: { isValid: false } }, - { - headers: { - 'Cache-Control': 'public, max-age=60, stale-while-revalidate=600', - }, - }, - ) -} diff --git a/apps/web/src/app/(evm)/pool/(landing)/layout.tsx b/apps/web/src/app/(evm)/pool/(landing)/layout.tsx deleted file mode 100644 index 009e0f8f65..0000000000 --- a/apps/web/src/app/(evm)/pool/(landing)/layout.tsx +++ /dev/null @@ -1,95 +0,0 @@ -'use client' - -import { Container, LinkInternal } from '@sushiswap/ui' -import { useSearchParams } from 'next/navigation' - -import { PathnameButton, PoolsFiltersProvider } from 'src/ui/pool' -import { Hero } from '../hero' - -export default function TabsLayout({ - children, -}: { children: React.ReactNode }) { - const searchParams = useSearchParams() - - return ( - <> - - - - -
- - - All Pools - - - - - Smart Pools - - - - - My Positions - - - - - My Rewards - - - - - Migrate - - -
-
-
-
- {children} -
-
- - ) -} diff --git a/apps/web/src/app/(evm)/pool/(landing)/migrate/page.tsx b/apps/web/src/app/(evm)/pool/(landing)/migrate/page.tsx deleted file mode 100644 index 02a4ad4dc9..0000000000 --- a/apps/web/src/app/(evm)/pool/(landing)/migrate/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react' - -import { MigrateTabContent } from 'src/ui/pool/MigrateTabContent' - -export default function MigratePage() { - return -} diff --git a/apps/web/src/app/(evm)/pool/(landing)/page.tsx b/apps/web/src/app/(evm)/pool/(landing)/page.tsx deleted file mode 100644 index 555e7dfaab..0000000000 --- a/apps/web/src/app/(evm)/pool/(landing)/page.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { Container } from '@sushiswap/ui' -import React from 'react' - -import { PoolsTable } from 'src/ui/pool/PoolsTable' -import { TableFiltersSmartPoolsOnly } from 'src/ui/pool/TableFilterSmartPoolsOnly' -import { TableFiltersFarmsOnly } from 'src/ui/pool/TableFiltersFarmsOnly' -import { TableFiltersNetwork } from 'src/ui/pool/TableFiltersNetwork' -import { TableFiltersPoolType } from 'src/ui/pool/TableFiltersPoolType' -import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' -import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' - -export default async function PoolPage() { - return ( - -
- - - - - - -
- -
- ) -} diff --git a/apps/web/src/app/(evm)/pool/(landing)/smart-pool/page.tsx b/apps/web/src/app/(evm)/pool/(landing)/smart-pool/page.tsx deleted file mode 100644 index db5c5e54de..0000000000 --- a/apps/web/src/app/(evm)/pool/(landing)/smart-pool/page.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Container } from '@sushiswap/ui' -import React from 'react' - -import { SmartPoolsTable } from 'src/ui/pool/SmartPoolsTable' -import { TableFiltersFarmsOnly } from 'src/ui/pool/TableFiltersFarmsOnly' -import { TableFiltersNetwork } from 'src/ui/pool/TableFiltersNetwork' -import { TableFiltersPoolType } from 'src/ui/pool/TableFiltersPoolType' -import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' -import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' - -export default async function PoolPage() { - return ( - -
- - - - - -
- -
- ) -} diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/add/page.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/add/page.tsx deleted file mode 100644 index 388fe82c55..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/add/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import PoolPage from '../page' - -export default async function PoolPageAdd({ - params, -}: { params: { id: string } }) { - return -} diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/layout.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/layout.tsx deleted file mode 100644 index 06fb975a11..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/layout.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { getPool } from '@sushiswap/client' -import { Breadcrumb, Container } from '@sushiswap/ui' -import { unstable_cache } from 'next/cache' -import { headers } from 'next/headers' -import { PoolHeader } from 'src/ui/pool/PoolHeader' -import { unsanitize } from 'sushi/format' -import notFound from '../../not-found' - -export const metadata = { - title: 'Pool 💦', -} - -export default async function Layout({ - children, - params, -}: { children: React.ReactNode; params: { id: string } }) { - const poolId = unsanitize(params.id) - const pool = await unstable_cache( - async () => getPool(poolId), - ['pool', poolId], - { - revalidate: 60 * 15, - }, - )() - - if (!pool) { - notFound() - } - - const headersList = headers() - const referer = headersList.get('referer') - return ( - <> - - - - - - -
-
- {children} -
-
- - ) -} diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/migrate/layout.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/migrate/layout.tsx deleted file mode 100644 index c0a62b1cdf..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/migrate/layout.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { Container } from '@sushiswap/ui' -import React from 'react' - -export default async function Layout({ - children, -}: { children: React.ReactNode; params: { id: string } }) { - return ( - <> - - {children} - - - ) -} diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/migrate/page.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/migrate/page.tsx deleted file mode 100644 index 63e5ed8984..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/migrate/page.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { getPool } from '@sushiswap/client' -import { LinkInternal } from '@sushiswap/ui' -import { unstable_cache } from 'next/cache' -import notFound from 'src/app/(evm)/pool/not-found' -import { - PoolPositionProvider, - PoolPositionRewardsProvider, - PoolPositionStakedProvider, -} from 'src/ui/pool' -import { ConcentratedLiquidityProvider } from 'src/ui/pool/ConcentratedLiquidityProvider' -import { MigrateTab } from 'src/ui/pool/MigrateTab' -import { unsanitize } from 'sushi' - -export default async function MigratePage({ - params, -}: { params: { id: string } }) { - const poolId = unsanitize(params.id) - const pool = await unstable_cache( - async () => getPool(poolId), - ['pool', poolId], - { - revalidate: 60 * 15, - }, - )() - - if (!pool) { - notFound() - } - - return ( -
- - ← Back - -
- - - - - - - - - -
-
- ) -} diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx deleted file mode 100644 index 5eadd40c2c..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/page.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { getPool } from '@sushiswap/client' -import { unstable_cache } from 'next/cache' -import { notFound } from 'next/navigation' - -import { PoolPageV3 } from 'src/ui/pool/PoolPageV3' -import { unsanitize } from 'sushi' - -export default async function PoolPage({ - params, -}: { - params: { id: string; tab: 'add' | 'remove' | 'unstake' | 'stake' } -}) { - const poolId = unsanitize(params.id) - const pool = await unstable_cache( - async () => await getPool(poolId), - ['pool', poolId], - { - revalidate: 60 * 15, - }, - )() - - // Rockstar C&D - if (!pool || pool.id === '42161:0x0a4f9962e24893a4a7567e52c1ce37d5482365de') { - notFound() - } - - if (pool.protocol === 'SUSHISWAP_V3') { - return - } - - // return -} diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/positions/[positionId]/page.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/positions/[positionId]/page.tsx deleted file mode 100644 index 55d55d3fec..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/positions/[positionId]/page.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { Container, LinkInternal } from '@sushiswap/ui' -import { PositionView } from 'src/ui/pool/PositionView' - -export default async function PositionsPage({ - params, -}: { params: { id: string; positionId: string } }) { - return ( - -
- - ← View all positions - - -
-
- ) -} diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/positions/create/page.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/positions/create/page.tsx deleted file mode 100644 index ba2ae4756d..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/positions/create/page.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { Container, LinkInternal } from '@sushiswap/ui' -import { ConcentratedLiquidityProvider } from 'src/ui/pool/ConcentratedLiquidityProvider' -import { NewPosition } from 'src/ui/pool/NewPosition' -import { isSushiSwapV3ChainId } from 'sushi/config' -import { getChainIdAddressFromId, unsanitize } from 'sushi/format' - -export default async function PositionsCreatePage({ - params, -}: { params: { id: string } }) { - const { chainId, address } = getChainIdAddressFromId(unsanitize(params.id)) - - if (!isSushiSwapV3ChainId(chainId)) { - throw new Error('This page only supports SushiSwap V3 pools') - } - - return ( - -
- - ← Back - - - - -
-
- ) -} diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/remove/page.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/remove/page.tsx deleted file mode 100644 index e53610eaba..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/remove/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import PoolPage from '../page' - -export default async function PoolPageRemove({ - params, -}: { params: { id: string } }) { - return -} diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/stake/page.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/stake/page.tsx deleted file mode 100644 index 1322612519..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/stake/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import PoolPage from '../page' - -export default async function PoolPageStake({ - params, -}: { params: { id: string } }) { - return -} diff --git a/apps/web/src/app/(evm)/pool/[id]/(landing)/unstake/page.tsx b/apps/web/src/app/(evm)/pool/[id]/(landing)/unstake/page.tsx deleted file mode 100644 index 45259e807f..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/(landing)/unstake/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import PoolPage from '../page' - -export default async function PoolPageUnstake({ - params, -}: { params: { id: string } }) { - return -} diff --git a/apps/web/src/app/(evm)/pool/[id]/smart/(overview)/layout.tsx b/apps/web/src/app/(evm)/pool/[id]/smart/(overview)/layout.tsx deleted file mode 100644 index 90e5efbffb..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/smart/(overview)/layout.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { getPool } from '@sushiswap/client' -import { - Breadcrumb, - CardDescription, - CardHeader, - CardTitle, - Container, - LinkInternal, -} from '@sushiswap/ui' -import { unstable_cache } from 'next/cache' -import { headers } from 'next/headers' -import { notFound } from 'next/navigation' -import React from 'react' -import { unsanitize } from 'sushi/format' - -import { PoolHeader } from 'src/ui/pool/PoolHeader' - -export default async function Layout({ - children, - params, -}: { children: React.ReactNode; params: { id: string } }) { - const poolId = unsanitize(params.id) - const pool = await unstable_cache( - async () => getPool(poolId), - ['pool', poolId], - { - revalidate: 60 * 15, - }, - )() - - if (!pool) { - notFound() - } - - const headersList = headers() - const referer = headersList.get('referer') - - return ( - <> - - - - - - -
-
-
- - - ← Pool details - - - Available Strategies - - Choose one of the following strategies: - - - - {children} -
-
-
- - ) -} diff --git a/apps/web/src/app/(evm)/pool/[id]/smart/(overview)/loading.tsx b/apps/web/src/app/(evm)/pool/[id]/smart/(overview)/loading.tsx deleted file mode 100644 index 65be64dd0c..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/smart/(overview)/loading.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from 'react' -import { SteerCarouselLoading } from 'src/ui/pool/Steer/SteerCarousel' - -const VaultOverviewLoadingPage = () => { - return -} - -export default VaultOverviewLoadingPage diff --git a/apps/web/src/app/(evm)/pool/[id]/smart/(overview)/page.tsx b/apps/web/src/app/(evm)/pool/[id]/smart/(overview)/page.tsx deleted file mode 100644 index 6107f4340e..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/smart/(overview)/page.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { getPool, getSteerVaults } from '@sushiswap/client' -import { unstable_cache } from 'next/cache' -import notFound from 'src/app/(evm)/pool/not-found' -import { SteerCarousel } from 'src/ui/pool/Steer/SteerCarousel' -import type { ID } from 'sushi' -import { unsanitize } from 'sushi/format' - -export default async function VaultOverviewPage({ - params, -}: { params: { id: string } }) { - const poolId = unsanitize(params.id) as ID - const poolP = unstable_cache(async () => getPool(poolId), ['pool', poolId], { - revalidate: 60 * 15, - })() - - const vaultsP = unstable_cache( - async () => getSteerVaults({ poolId }), - ['pool', poolId], - { - revalidate: 60 * 15, - }, - )() - - const [pool, vaults] = await Promise.all([poolP, vaultsP]) - - if (!pool || !vaults) { - notFound() - } - - return -} diff --git a/apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/layout.tsx b/apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/layout.tsx deleted file mode 100644 index 4beedc6709..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/layout.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import { getPool, getSteerVault } from '@sushiswap/client' -import { Breadcrumb, Container, LinkInternal } from '@sushiswap/ui' -import { unstable_cache } from 'next/cache' -import { headers } from 'next/headers' -import { notFound } from 'next/navigation' -import React from 'react' -import { PoolHeader } from 'src/ui/pool/PoolHeader' -import { unsanitize } from 'sushi/format' - -export default async function Layout({ - children, - params, -}: { - children: React.ReactNode - params: { id: string; vaultId: string } -}) { - const poolId = unsanitize(params.id) - const pool = await unstable_cache( - async () => getPool(poolId), - ['pool', poolId], - { - revalidate: 60 * 15, - }, - )() - - const vaultId = unsanitize(params.vaultId) - - const vault = await unstable_cache( - () => getSteerVault(vaultId), - ['steer-vault', vaultId], - { revalidate: 60 * 15 }, - )() - - if (!pool) { - notFound() - } - - const headersList = headers() - const referer = headersList.get('referer') - - return ( - <> - - - - - - -
-
- {' '} -
- - {vault.isDeprecated && ( -
-
This vault is deprecated.
-
- {"It will not accrue any fees and won't be readjusted."} -
-
- )} - - ← Strategies - -
- - {children} - -
-
-
- - ) -} diff --git a/apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/loading.tsx b/apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/loading.tsx deleted file mode 100644 index ffbdf5f78e..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/loading.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { SkeletonBox } from '@sushiswap/ui' -import React from 'react' - -const SteerVaultLoadingPage = () => { - return ( -
- - -
- ) -} - -export default SteerVaultLoadingPage diff --git a/apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/page.tsx b/apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/page.tsx deleted file mode 100644 index a2243c99dd..0000000000 --- a/apps/web/src/app/(evm)/pool/[id]/smart/[vaultId]/page.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import { getSteerVault } from '@sushiswap/client' -import { SteerVault } from '@sushiswap/client' -import { - SteerChainId, - getTokenRatios, - getVaultPositions, -} from '@sushiswap/steer-sdk' -import { Container } from '@sushiswap/ui' -import formatDistanceStrict from 'date-fns/formatDistanceStrict' -import formatDistanceToNow from 'date-fns/formatDistanceToNow' -import { unstable_cache } from 'next/cache' -import { - SteerStrategyComponents, - SteerStrategyGeneric, -} from 'src/ui/pool/Steer/SteerStrategies' -import { publicClientConfig } from 'sushi/config' -import { Token } from 'sushi/currency' -import { formatNumber, unsanitize } from 'sushi/format' -import { tickToPrice } from 'sushi/pool/sushiswap-v3' -import { PublicClient, createPublicClient } from 'viem' - -function getPriceExtremes( - vault: SteerVault, -): SteerStrategyGeneric['priceExtremes'] { - const token0 = new Token(vault.token0) - const token1 = new Token(vault.token1) - - let lowerPrice = tickToPrice(token0, token1, vault.lowerTick).toSignificant(7) - let upperPrice = tickToPrice(token0, token1, vault.upperTick).toSignificant(7) - - lowerPrice = - !lowerPrice.includes('.') && lowerPrice.length > 9 - ? formatNumber(lowerPrice) - : lowerPrice - upperPrice = - !upperPrice.includes('.') && upperPrice.length > 9 - ? formatNumber(upperPrice) - : upperPrice - return { min: lowerPrice, max: upperPrice } -} - -function getAdjustment(vault: SteerVault): SteerStrategyGeneric['adjustment'] { - const next = formatDistanceToNow( - (vault.lastAdjustmentTimestamp + vault.adjustmentFrequency) * 1000, - { - addSuffix: true, - }, - ) - const frequency = formatDistanceStrict(vault.adjustmentFrequency * 1000, 0) - - return { next, frequency } -} - -async function getGenerics(vault: SteerVault): Promise { - const client = createPublicClient( - publicClientConfig[vault.pool.chainId as SteerChainId], - ) as PublicClient - - const prices = await fetch( - `https://api.sushi.com/price/v1/${vault.chainId}`, - ).then((data) => data.json()) - - const priceExtremes = getPriceExtremes(vault) - const tokenRatios = await getTokenRatios({ - vault, - prices, - }) - const adjustment = getAdjustment(vault) - const positions = - (await getVaultPositions({ - client, - vaultId: vault.id, - })) || [] - - return { priceExtremes, tokenRatios, adjustment, positions } -} - -export default async function SteerVaultPage({ - params, -}: { params: { vaultId: string } }) { - const vaultId = unsanitize(params.vaultId) - - const vault = await unstable_cache( - () => getSteerVault(vaultId), - ['steer-vault', vaultId], - { revalidate: 60 * 15 }, - )() - const generics = await unstable_cache( - async () => await getGenerics(vault), - ['steer-vault-generics', vaultId], - { - revalidate: 60 * 5, - }, - )() - - const Component = SteerStrategyComponents[vault.strategy] - - return ( - - - - ) -} diff --git a/apps/web/src/app/(evm)/pool/add/layout.tsx b/apps/web/src/app/(evm)/pool/add/layout.tsx deleted file mode 100644 index 7a929e95e8..0000000000 --- a/apps/web/src/app/(evm)/pool/add/layout.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { Container, typographyVariants } from '@sushiswap/ui' - -import { BackButton } from 'src/ui/pool/BackButton' - -export const metadata = { - title: 'Pool 💦', -} - -export default function Layout({ children }: { children: React.ReactNode }) { - return ( - <> - -
-
- -

- Add Liquidity -

-
-

- Create a new pool or create a liquidity position on an existing - pool. -

-
-
-
-
- - {children} - -
-
- - ) -} diff --git a/apps/web/src/app/(evm)/pool/add/page.tsx b/apps/web/src/app/(evm)/pool/add/page.tsx deleted file mode 100644 index 018dc7a660..0000000000 --- a/apps/web/src/app/(evm)/pool/add/page.tsx +++ /dev/null @@ -1,210 +0,0 @@ -'use client' - -import React, { FC, useMemo, useState } from 'react' -import { SUPPORTED_CHAIN_IDS } from 'src/config' -import { useTokenAmountDollarValues } from 'src/lib/hooks' -import { useConcentratedPositionInfo } from 'src/lib/wagmi/hooks/positions/hooks/useConcentratedPositionInfo' -import { ConcentratedLiquidityProvider } from 'src/ui/pool/ConcentratedLiquidityProvider' -import { - ConcentratedLiquidityURLStateProvider, - useConcentratedLiquidityURLState, -} from 'src/ui/pool/ConcentratedLiquidityURLStateProvider' -import { ConcentratedLiquidityWidget } from 'src/ui/pool/ConcentratedLiquidityWidget' -import { SelectFeeConcentratedWidget } from 'src/ui/pool/SelectFeeConcentratedWidget' -import { SelectNetworkWidget } from 'src/ui/pool/SelectNetworkWidget' -import { SelectPricesWidget } from 'src/ui/pool/SelectPricesWidget' -import { SelectTokensWidget } from 'src/ui/pool/SelectTokensWidget' -import { computeSushiSwapV3PoolAddress } from 'sushi' -import { SUSHISWAP_V3_FACTORY_ADDRESS, isWNativeSupported } from 'sushi/config' -import { tryParseAmount } from 'sushi/currency' -import { SWRConfig } from 'swr' -import { useAccount } from 'wagmi' - -export default function Page() { - return ( - - - - <_Add /> - - - - ) -} - -const _Add: FC = () => { - const { address } = useAccount() - const { - chainId, - token0, - token1, - setToken1, - setToken0, - setNetwork, - feeAmount, - setFeeAmount, - tokensLoading, - tokenId, - switchTokens, - } = useConcentratedLiquidityURLState() - - const [_invert, _setInvert] = useState(false) - const { data: position } = useConcentratedPositionInfo({ - chainId, - token0, - tokenId, - token1, - }) - - const poolAddress = useMemo( - () => - token0 && token1 && feeAmount && chainId - ? computeSushiSwapV3PoolAddress({ - factoryAddress: SUSHISWAP_V3_FACTORY_ADDRESS[chainId], - tokenA: token0.wrapped, - tokenB: token1.wrapped, - fee: feeAmount, - }) - : undefined, - [chainId, feeAmount, token0, token1], - ) - - const fiatAmounts = useMemo( - () => [tryParseAmount('1', token0), tryParseAmount('1', token1)], - [token0, token1], - ) - const _fiatAmountsAsNumber = useTokenAmountDollarValues({ - chainId, - amounts: fiatAmounts, - }) - - return ( - <> - {/*
*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/* */} - {/* ) : (*/} - {/*
*/} - {/* )*/} - {/* }*/} - {/* >*/} - {/* */} - {/* {token0 && !tokensLoading ? (*/} - {/* */} - {/* ) : (*/} - {/*
*/} - {/* )}*/} - {/* {token1 && !tokensLoading ? (*/} - {/* */} - {/* ) : (*/} - {/*
*/} - {/* )}*/} - {/* */} - {/* */} - {/*
*/} - {/*
*/} - {/* {token0 && token1 ? (*/} - {/* <>*/} - {/*

*/} - {/* {token0.symbol}/{token1.symbol}*/} - {/*

*/} - {/*

*/} - {/* SushiSwap V3 • {feeAmount / 10000}%*/} - {/*

*/} - {/* */} - {/* ) : tokensLoading ? (*/} - {/* <>*/} - {/* */} - {/* */} - {/* */} - {/* ) : (*/} - {/* <>*/} - {/* )}*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/* Network*/} - {/*
*/} - {/* {Chain.from(chainId)?.name}*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/* Fee Tier*/} - {/*
{feeAmount / 10000}% Fee
*/} - {/*
*/} - {/*
*/} - {/* Pool Type*/} - {/*
Concentrated Liquidity
*/} - {/*
*/} - {/*
*/} - {/* Current Price*/} - {/* {!isInitialLoading && !pool ? (*/} - {/* N/A*/} - {/* ) : isInitialLoading ? (*/} - {/* */} - {/* ) : token0 && token1 && pool ? (*/} - {/*
*/} - {/* */} - {/*
*/} - {/* ) : null}*/} - {/*
*/} - {/*
*/} - {/*
*/} - - - - - - - ) -} diff --git a/apps/web/src/app/(evm)/pool/add/v2/[chainId]/page.tsx b/apps/web/src/app/(evm)/pool/add/v2/[chainId]/page.tsx deleted file mode 100644 index 6185068140..0000000000 --- a/apps/web/src/app/(evm)/pool/add/v2/[chainId]/page.tsx +++ /dev/null @@ -1,391 +0,0 @@ -'use client' - -import { PlusIcon } from '@heroicons/react-v1/solid' -import { FormSection } from '@sushiswap/ui' -import { Button } from '@sushiswap/ui' -import { Loader } from '@sushiswap/ui' -import { useRouter } from 'next/navigation' -import React, { - Dispatch, - FC, - ReactNode, - SetStateAction, - useCallback, - useEffect, - useMemo, - useState, -} from 'react' -import { DISABLED_CHAIN_IDS } from 'src/config' -import { APPROVE_TAG_ADD_LEGACY } from 'src/lib/constants' -import { isSushiSwapV2Pool } from 'src/lib/functions' -import { ChainId, TESTNET_CHAIN_IDS } from 'sushi/chain' -import { - SUSHISWAP_V2_ROUTER_ADDRESS, - SUSHISWAP_V2_SUPPORTED_CHAIN_IDS, - SushiSwapV2ChainId, - defaultCurrency, - defaultQuoteCurrency, - isSushiSwapV2ChainId, - isWNativeSupported, -} from 'sushi/config' -import { Amount, Type, tryParseAmount } from 'sushi/currency' -import { ZERO } from 'sushi/math' -import { SushiSwapV2Pool } from 'sushi/pool/sushiswap-v2' -import { SWRConfig } from 'swr' - -import { Web3Input } from 'src/lib/wagmi/components/web3-input' -import { SushiSwapV2PoolState } from 'src/lib/wagmi/hooks/pools/hooks/useSushiSwapV2Pools' -import { Checker } from 'src/lib/wagmi/systems/Checker' -import { CheckerProvider } from 'src/lib/wagmi/systems/Checker/Provider' -import { PoolFinder } from 'src/lib/wagmi/systems/PoolFinder/PoolFinder' -import { AddSectionPoolShareCardV2 } from 'src/ui/pool/AddSectionPoolShareCardV2' -import { AddSectionReviewModalLegacy } from 'src/ui/pool/AddSectionReviewModalLegacy' -import { SelectNetworkWidget } from 'src/ui/pool/SelectNetworkWidget' -import { SelectTokensWidget } from 'src/ui/pool/SelectTokensWidget' - -export default function Page({ params }: { params: { chainId: string } }) { - const router = useRouter() - const [chainId, setChainId] = useState(+params.chainId as SushiSwapV2ChainId) - const [token0, setToken0] = useState( - defaultCurrency[chainId as keyof typeof defaultCurrency], - ) - const [token1, setToken1] = useState( - defaultQuoteCurrency[chainId as keyof typeof defaultQuoteCurrency], - ) - - useEffect(() => { - setToken0(defaultCurrency[chainId as keyof typeof defaultCurrency]) - setToken1( - defaultQuoteCurrency[chainId as keyof typeof defaultQuoteCurrency], - ) - }, [chainId]) - - return ( - - - - - } - > - {({ pool: [poolState, pool] }) => { - const title = - !token0 || !token1 ? ( - 'Select Tokens' - ) : [SushiSwapV2PoolState.LOADING].includes( - poolState as SushiSwapV2PoolState, - ) ? ( -
- -
- ) : [SushiSwapV2PoolState.EXISTS].includes( - poolState as SushiSwapV2PoolState, - ) ? ( - 'Add Liquidity' - ) : ( - 'Create Pool' - ) - - return ( - <_Add - chainId={chainId} - setChainId={(chainId) => { - if (!isSushiSwapV2ChainId(chainId)) return - router.push(`/pool/add/v2/${chainId}`) - setChainId(chainId) - }} - pool={pool as SushiSwapV2Pool | null} - poolState={poolState as SushiSwapV2PoolState} - title={title} - token0={token0} - token1={token1} - setToken0={setToken0} - setToken1={setToken1} - /> - ) - }} -
-
- ) -} - -interface AddProps { - chainId: ChainId - setChainId(chainId: ChainId): void - pool: SushiSwapV2Pool | null - poolState: SushiSwapV2PoolState - title: ReactNode - token0: Type | undefined - token1: Type | undefined - setToken0: Dispatch> - setToken1: Dispatch> -} - -const _Add: FC = ({ - chainId, - setChainId, - pool, - poolState, - title, - token0, - token1, - setToken0, - setToken1, -}) => { - const [independendField, setIndependendField] = useState(0) - - const [{ input0, input1 }, setTypedAmounts] = useState<{ - input0: string - input1: string - }>({ input0: '', input1: '' }) - - const [parsedInput0, parsedInput1] = useMemo(() => { - if (!token0 || !token1) return [undefined, undefined] - - return [ - tryParseAmount(input0, token0) || Amount.fromRawAmount(token0, 0), - tryParseAmount(input1, token1) || Amount.fromRawAmount(token1, 0), - ] - }, [input0, input1, token0, token1]) - - const noLiquidity = useMemo(() => { - return pool?.reserve0.equalTo(ZERO) && pool.reserve1.equalTo(ZERO) - }, [pool]) - - const onChangeToken0TypedAmount = useCallback( - (value: string) => { - setIndependendField(0) - if (poolState === SushiSwapV2PoolState.NOT_EXISTS || noLiquidity) { - setTypedAmounts((prev) => ({ - ...prev, - input0: value, - })) - } else if (token0 && pool) { - setTypedAmounts({ - input0: value, - input1: '', - }) - } - }, - [noLiquidity, pool, poolState, token0], - ) - - const onChangeToken1TypedAmount = useCallback( - (value: string) => { - setIndependendField(1) - if (poolState === SushiSwapV2PoolState.NOT_EXISTS || noLiquidity) { - setTypedAmounts((prev) => ({ - ...prev, - input1: value, - })) - } else if (token1 && pool) { - setTypedAmounts({ - input0: '', - input1: value, - }) - } - }, - [noLiquidity, pool, poolState, token1], - ) - - const networks = useMemo( - () => - SUSHISWAP_V2_SUPPORTED_CHAIN_IDS.filter( - (chainId) => - !TESTNET_CHAIN_IDS.includes( - chainId as (typeof TESTNET_CHAIN_IDS)[number], - ) && - !DISABLED_CHAIN_IDS.includes( - chainId as (typeof DISABLED_CHAIN_IDS)[number], - ), - ), - [], - ) - - const _setToken0 = useCallback( - (token: Type | undefined) => { - if (token?.id === token1?.id) return - setIndependendField(1) - setTypedAmounts((prev) => ({ ...prev, input0: '' })) - setToken0(token) - }, - [setToken0, token1], - ) - - const _setToken1 = useCallback( - (token: Type | undefined) => { - if (token?.id === token0?.id) return - setIndependendField(0) - setTypedAmounts((prev) => ({ ...prev, input1: '' })) - setToken1(token) - }, - [setToken1, token0], - ) - - useEffect(() => { - // Includes !!pool - if ( - pool?.reserve0.greaterThan(0) && - pool.reserve1.greaterThan(0) && - token0 && - token1 - ) { - if (independendField === 0) { - const parsedAmount = tryParseAmount(input0, token0) - setTypedAmounts({ - input0, - input1: parsedAmount - ? pool.priceOf(token0.wrapped).quote(parsedAmount.wrapped).toExact() - : '', - }) - } - - if (independendField === 1) { - const parsedAmount = tryParseAmount(input1, token1) - setTypedAmounts({ - input0: parsedAmount - ? pool.priceOf(token1.wrapped).quote(parsedAmount.wrapped).toExact() - : '', - input1, - }) - } - } - }, [independendField, pool, input0, input1, token0, token1]) - - return ( - <> - - - -
- -
- -
- - - - - - - {(!pool || isSushiSwapV2Pool(pool)) && - isSushiSwapV2ChainId(chainId) && ( - <> - - - - { - setTypedAmounts({ input0: '', input1: '' }) - }} - > - - - - - - - )} - - - - -
-
- - ) -} diff --git a/apps/web/src/app/(evm)/pool/api/cors.ts b/apps/web/src/app/(evm)/pool/api/cors.ts deleted file mode 100644 index c4603e7685..0000000000 --- a/apps/web/src/app/(evm)/pool/api/cors.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const CORS = { - 'Access-Control-Allow-Origin': '*', - 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS', - 'Access-Control-Allow-Headers': 'Content-Type, Authorization', -} diff --git a/apps/web/src/app/(evm)/pool/api/graphPool/[id]/route.ts b/apps/web/src/app/(evm)/pool/api/graphPool/[id]/route.ts deleted file mode 100644 index ff245fdc6a..0000000000 --- a/apps/web/src/app/(evm)/pool/api/graphPool/[id]/route.ts +++ /dev/null @@ -1,25 +0,0 @@ -import 'sushi/bigint-serializer' - -import { NextResponse } from 'next/server' -import { getV2GraphPool } from 'src/lib/graph' -import { z } from 'zod' - -export const revalidate = 15 - -const schema = z.object({ - id: z.string(), -}) - -// uses thegraph, not the pools api -export async function GET( - _request: Request, - { params }: { params: { id: string } }, -) { - const result = schema.safeParse(params) - if (!result.success) { - return new Response(result.error.message, { status: 400 }) - } - - const pool = await getV2GraphPool(result.data.id) - return NextResponse.json(pool) -} diff --git a/apps/web/src/app/(evm)/pool/api/pools/[chainId]/[address]/route.ts b/apps/web/src/app/(evm)/pool/api/pools/[chainId]/[address]/route.ts deleted file mode 100644 index 101c9b31c2..0000000000 --- a/apps/web/src/app/(evm)/pool/api/pools/[chainId]/[address]/route.ts +++ /dev/null @@ -1,34 +0,0 @@ -import 'sushi/bigint-serializer' - -import { PoolApiSchema, getPoolFromDB } from '@sushiswap/client/api' -import { NextResponse } from 'next/server.js' -import { CORS } from '../../../cors' - -export const revalidate = 15 - -export async function GET( - _request: Request, - { params }: { params: { chainId: string; address: string } }, -) { - const result = PoolApiSchema.safeParse({ - chainId: params.chainId, - address: params.address, - }) - - if (!result.success) { - return NextResponse.json(result.error.format(), { status: 400 }) - } - - let pool - - try { - pool = await getPoolFromDB(result.data) - } catch (error) { - console.error(error) - return NextResponse.json({ error: 'Failed to fetch pool' }, { status: 500 }) - } - - return NextResponse.json(pool, { - headers: CORS, - }) -} diff --git a/apps/web/src/app/(evm)/pool/api/pools/count/route.ts b/apps/web/src/app/(evm)/pool/api/pools/count/route.ts deleted file mode 100644 index 072245b225..0000000000 --- a/apps/web/src/app/(evm)/pool/api/pools/count/route.ts +++ /dev/null @@ -1,21 +0,0 @@ -import 'sushi/bigint-serializer' - -import { PoolCountApiSchema, getPoolCountFromDB } from '@sushiswap/client/api' -import { NextResponse } from 'next/server.js' -import { CORS } from '../../cors' - -export const revalidate = 15 - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url) - const result = PoolCountApiSchema.safeParse(Object.fromEntries(searchParams)) - - if (!result.success) { - return NextResponse.json(result.error.format(), { status: 400 }) - } - - const count = await getPoolCountFromDB(result.data) - return NextResponse.json(count, { - headers: CORS, - }) -} diff --git a/apps/web/src/app/(evm)/pool/api/pools/route.ts b/apps/web/src/app/(evm)/pool/api/pools/route.ts deleted file mode 100644 index 6443a12a5e..0000000000 --- a/apps/web/src/app/(evm)/pool/api/pools/route.ts +++ /dev/null @@ -1,22 +0,0 @@ -import 'sushi/bigint-serializer' - -import { PoolsApiSchema, getPoolsFromDB } from '@sushiswap/client/api' -import { NextResponse } from 'next/server.js' -import { CORS } from '../cors' - -export const revalidate = 15 - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url) - const result = PoolsApiSchema.safeParse(Object.fromEntries(searchParams)) - - if (!result.success) { - return NextResponse.json(result.error.format(), { status: 400 }) - } - - const pools = await getPoolsFromDB(result.data) - - return NextResponse.json(pools, { - headers: CORS, - }) -} diff --git a/apps/web/src/app/(evm)/pool/api/steer-vault/[chainId]/[address]/route.ts b/apps/web/src/app/(evm)/pool/api/steer-vault/[chainId]/[address]/route.ts deleted file mode 100644 index 7e09de2f2d..0000000000 --- a/apps/web/src/app/(evm)/pool/api/steer-vault/[chainId]/[address]/route.ts +++ /dev/null @@ -1,26 +0,0 @@ -import 'sushi/bigint-serializer' - -import { SteerVaultApiSchema, getSteerVaultFromDB } from '@sushiswap/client/api' -import { NextResponse } from 'next/server.js' -import { CORS } from '../../../cors' - -export const revalidate = 15 - -export async function GET( - _request: Request, - { params }: { params: { chainId: string; address: string } }, -) { - const result = SteerVaultApiSchema.safeParse({ - chainId: params.chainId, - address: params.address, - }) - - if (!result.success) { - return NextResponse.json(result.error.format(), { status: 400 }) - } - - const vault = await getSteerVaultFromDB(result.data) - return NextResponse.json(vault, { - headers: CORS, - }) -} diff --git a/apps/web/src/app/(evm)/pool/api/steer-vault/count/route.ts b/apps/web/src/app/(evm)/pool/api/steer-vault/count/route.ts deleted file mode 100644 index 158150b100..0000000000 --- a/apps/web/src/app/(evm)/pool/api/steer-vault/count/route.ts +++ /dev/null @@ -1,26 +0,0 @@ -import 'sushi/bigint-serializer' - -import { - SteerVaultCountApiSchema, - getSteerVaultCountFromDB, -} from '@sushiswap/client/api' -import { NextResponse } from 'next/server.js' -import { CORS } from '../../cors' - -export const revalidate = 15 - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url) - const result = SteerVaultCountApiSchema.safeParse( - Object.fromEntries(searchParams), - ) - - if (!result.success) { - return NextResponse.json(result.error.format(), { status: 400 }) - } - - const count = await getSteerVaultCountFromDB(result.data) - return NextResponse.json(count, { - headers: CORS, - }) -} diff --git a/apps/web/src/app/(evm)/pool/api/steer-vault/route.ts b/apps/web/src/app/(evm)/pool/api/steer-vault/route.ts deleted file mode 100644 index cce9b56134..0000000000 --- a/apps/web/src/app/(evm)/pool/api/steer-vault/route.ts +++ /dev/null @@ -1,26 +0,0 @@ -import 'sushi/bigint-serializer' - -import { - SteerVaultsApiSchema, - getSteerVaultsFromDB, -} from '@sushiswap/client/api' -import { NextResponse } from 'next/server.js' -import { CORS } from '../cors' - -export const revalidate = 15 - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url) - const result = SteerVaultsApiSchema.safeParse( - Object.fromEntries(searchParams), - ) - - if (!result.success) { - return NextResponse.json(result.error.format(), { status: 400 }) - } - - const vaults = await getSteerVaultsFromDB(result.data) - return NextResponse.json(vaults, { - headers: CORS, - }) -} diff --git a/apps/web/src/app/(evm)/pool/api/user-with-pools/route.ts b/apps/web/src/app/(evm)/pool/api/user-with-pools/route.ts deleted file mode 100644 index 97f88516cc..0000000000 --- a/apps/web/src/app/(evm)/pool/api/user-with-pools/route.ts +++ /dev/null @@ -1,117 +0,0 @@ -import 'sushi/bigint-serializer' - -import { getPools } from '@sushiswap/client' -import type { PoolHasSteerVaults } from '@sushiswap/steer-sdk' -import { NextResponse } from 'next/server' -import { getUser, getV2GraphPools } from 'src/lib/graph' -import { ChainId } from 'sushi/chain' - -import { isSushiSwapV2ChainId } from 'sushi/config' -import type { - PoolBase, - PoolIfIncentivized, - PoolWithAprs, - SushiPositionStaked, - SushiPositionWithPool, -} from 'sushi/types' -import { Address } from 'viem' -import { z } from 'zod' -import { CORS } from '../cors' - -export const revalidate = 15 - -const schema = z.object({ - id: z - .string() - .refine((id) => id.startsWith('0x')) - .transform((id) => id.toLowerCase() as Address), - chainIds: z.nullable(z.string()).transform((chainIds) => - chainIds - ?.split(',') - .map((chainId) => Number(chainId) as ChainId) - .filter(isSushiSwapV2ChainId), - ), -}) - -export type UserWithPool = SushiPositionWithPool< - PoolHasSteerVaults, true>, - SushiPositionStaked -> - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url) - const id = searchParams.get('id') - const chainIds = searchParams.get('chainIds') - - if (!id) return new Response('No user(id) provided', { status: 422 }) - const result = schema.safeParse({ id, chainIds }) - if (!result.success) { - return new Response(result.error.message, { status: 400 }) - } - const args = result.data - const data = await getUser(args) - const poolIds = data.map((position) => position.pool.id) - - if (poolIds.length === 0) { - return NextResponse.json([], { - status: 200, - headers: { - 'Cache-Control': 'public, max-age=15, stale-while-revalidate=600', - ...CORS, - }, - }) - } - - const [graphPoolsPromise, dbPoolsPromise] = await Promise.allSettled([ - getV2GraphPools(poolIds), - getPools({ - ids: poolIds, - }), - ]) - - const graphPools = - graphPoolsPromise.status === 'fulfilled' ? graphPoolsPromise.value : [] - const dbPools = - dbPoolsPromise.status === 'fulfilled' ? dbPoolsPromise.value : [] - - const userPositions = data - .map((position) => { - const dbPool = dbPools?.find((pool) => pool.id === position.pool.id) - const graphPool = graphPools?.find( - (graphPool) => graphPool.id === position.pool.id, - ) - - const pool: PoolWithAprs> | undefined = - dbPool || graphPool - ? { - ...graphPool!, - isIncentivized: dbPool?.isIncentivized ?? false, - wasIncentivized: dbPool?.wasIncentivized ?? false, - incentiveApr: dbPool?.incentiveApr ?? 0, - feeApr1h: dbPool?.feeApr1h ?? 0, - feeApr1d: dbPool?.feeApr1d ?? 0, - feeApr1w: dbPool?.feeApr1w ?? 0, - feeApr1m: dbPool?.feeApr1m ?? 0, - totalApr1h: dbPool?.totalApr1h ?? 0, - totalApr1d: dbPool?.totalApr1d ?? 0, - totalApr1w: dbPool?.totalApr1w ?? 0, - totalApr1m: dbPool?.totalApr1m ?? 0, - } - : undefined - - if (!pool) return undefined - - return { - ...position, - pool, - } - }) - .filter((pool): pool is NonNullable => pool !== undefined) - - return NextResponse.json(userPositions, { - headers: { - 'Cache-Control': 'public, max-age=15, stale-while-revalidate=600', - ...CORS, - }, - }) -} diff --git a/apps/web/src/app/(evm)/pool/api/user/route.ts b/apps/web/src/app/(evm)/pool/api/user/route.ts deleted file mode 100644 index 296dc97508..0000000000 --- a/apps/web/src/app/(evm)/pool/api/user/route.ts +++ /dev/null @@ -1,51 +0,0 @@ -import 'sushi/bigint-serializer' - -import { NextResponse } from 'next/server' -import { getUser } from 'src/lib/graph' -import { ChainId } from 'sushi/chain' -import { isSushiSwapV2ChainId } from 'sushi/config' -import { Address } from 'viem' -import { z } from 'zod' -import { CORS } from '../cors' - -export const revalidate = 15 - -const schema = z.object({ - id: z - .string() - .refine((id) => id.startsWith('0x')) - .transform((id) => id.toLowerCase() as Address), - chainIds: z.nullable(z.string()).transform((chainIds) => - chainIds - ?.split(',') - .map((chainId) => Number(chainId) as ChainId) - .filter(isSushiSwapV2ChainId), - ), -}) - -// export const dynamic = 'auto' -// export const dynamicParams = true -// export const revalidate = false -// export const fetchCache = 'auto' -// export const runtime = 'nodejs' -// export const preferredRegion = 'auto' - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url) - const id = searchParams.get('id') - const chainIds = searchParams.get('chainIds') - if (!id) return new Response(null, { status: 422 }) - const result = schema.safeParse({ id, chainIds }) - if (!result.success) { - return new Response(result.error.message, { status: 400 }) - } - const args = result.data - const data = await getUser(args) - - return NextResponse.json(data, { - headers: { - 'Cache-Control': 'public, max-age=15, stale-while-revalidate=600', - ...CORS, - }, - }) -} diff --git a/apps/web/src/app/(evm)/pool/header.tsx b/apps/web/src/app/(evm)/pool/header.tsx deleted file mode 100644 index 6c93565318..0000000000 --- a/apps/web/src/app/(evm)/pool/header.tsx +++ /dev/null @@ -1,17 +0,0 @@ -'use client' - -import { Navigation } from '@sushiswap/ui' -import React, { FC } from 'react' -import { SUPPORTED_CHAIN_IDS } from 'src/config' -import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' -import { useChainId } from 'wagmi' - -export const Header: FC = () => { - const chainId = useChainId() - return ( - } - chainId={chainId} - /> - ) -} diff --git a/apps/web/src/app/(evm)/pool/hero.tsx b/apps/web/src/app/(evm)/pool/hero.tsx deleted file mode 100644 index a1e0ecfda6..0000000000 --- a/apps/web/src/app/(evm)/pool/hero.tsx +++ /dev/null @@ -1,154 +0,0 @@ -'use client' - -import { GiftIcon } from '@heroicons/react-v1/outline' -import { LinkExternal, LinkInternal, typographyVariants } from '@sushiswap/ui' -import { Button } from '@sushiswap/ui' -import { Chip } from '@sushiswap/ui' -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuItem, - DropdownMenuTrigger, -} from '@sushiswap/ui' -import { SelectIcon } from '@sushiswap/ui' -import { DiscordIcon } from '@sushiswap/ui/icons/DiscordIcon' -import { FC } from 'react' -import { ChainId } from 'sushi/chain' -import { - SushiSwapV3ChainId, - isSushiSwapV2ChainId, - isSushiSwapV3ChainId, -} from 'sushi/config' -import { useChainId } from 'wagmi' - -export const Hero: FC = () => { - const chainId = useChainId() - - return ( -
-
-
-

- Put your funds to work
- by providing liquidity. -

-

- When you add liquidity to a pool, you can receive a share of its - trading volume and potentially snag extra rewards when there are - incentives involved! -

-
-
-
- - - - - - - - - -
- V3 Position - - {isSushiSwapV3ChainId(chainId as SushiSwapV3ChainId) - ? 'New 🔥' - : 'Unavailable'} - -
-

- Provide liquidity to a V3 liquidity pool. -

-
-
- {isSushiSwapV2ChainId(chainId as ChainId) ? ( - - -
- V2 Position -
-

- Provide liquidity to a V2 liquidity pool. -

-
-
- ) : null} -
-
-
-
- -
-
-
-
- - Looking for a partnership with Sushi? - - -
-
- Need Help? - -
-
-
- ) -} diff --git a/apps/web/src/app/(evm)/pool/layout.tsx b/apps/web/src/app/(evm)/pool/layout.tsx deleted file mode 100644 index bd46e1474f..0000000000 --- a/apps/web/src/app/(evm)/pool/layout.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { HotJar } from '@sushiswap/ui' - -import { Header } from './header' -import { Providers } from './providers' - -export const metadata = { - title: 'Pool 💦', -} - -export default function PoolLayout({ - children, -}: { children: React.ReactNode }) { - return ( - <> - -
-
{children}
- - - - ) -} diff --git a/apps/web/src/app/(evm)/pool/loading.tsx b/apps/web/src/app/(evm)/pool/loading.tsx deleted file mode 100644 index 75da76e366..0000000000 --- a/apps/web/src/app/(evm)/pool/loading.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import { Splash } from '@sushiswap/ui' -import React from 'react' - -export default function Loading() { - return -} diff --git a/apps/web/src/app/(evm)/pool/not-found.tsx b/apps/web/src/app/(evm)/pool/not-found.tsx deleted file mode 100644 index f0b52bf960..0000000000 --- a/apps/web/src/app/(evm)/pool/not-found.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { ChevronRightIcon } from '@heroicons/react/20/solid' -import { Button, LinkInternal, typographyVariants } from '@sushiswap/ui' - -export default function NotFound() { - return ( -
-
-

- Not Found -

-
- - -
-
-
- ) -} diff --git a/apps/web/src/app/(evm)/pool/providers.tsx b/apps/web/src/app/(evm)/pool/providers.tsx deleted file mode 100644 index f35d19144e..0000000000 --- a/apps/web/src/app/(evm)/pool/providers.tsx +++ /dev/null @@ -1,7 +0,0 @@ -'use client' - -import { SplashController } from '@sushiswap/ui' - -export function Providers({ children }: { children: React.ReactNode }) { - return {children} -} diff --git a/apps/web/src/app/(evm)/pool/swr-config.tsx b/apps/web/src/app/(evm)/pool/swr-config.tsx deleted file mode 100644 index 7eaf2f26e0..0000000000 --- a/apps/web/src/app/(evm)/pool/swr-config.tsx +++ /dev/null @@ -1,7 +0,0 @@ -'use client' - -import { SWRConfig } from 'swr' - -export const SWRProvider = ({ children }: { children: React.ReactNode }) => { - return {children} -} diff --git a/apps/web/src/app/(landing)/api/stats/route.ts b/apps/web/src/app/(landing)/api/stats/route.ts deleted file mode 100644 index 57d48cbb17..0000000000 --- a/apps/web/src/app/(landing)/api/stats/route.ts +++ /dev/null @@ -1,129 +0,0 @@ -import { fetchMultichain } from '@sushiswap/graph-client/multichain' -import { getSushiV2Factory } from '@sushiswap/graph-client/sushi-v2' -import { getSushiV3Factory } from '@sushiswap/graph-client/sushi-v3' -import { NextResponse } from 'next/server' -import { DISABLED_ANALYTICS_CHAIN_IDS } from 'src/config' -import { ChainId } from 'sushi/chain' -import { - SUSHISWAP_V2_SUPPORTED_CHAIN_IDS, - SUSHISWAP_V3_SUPPORTED_CHAIN_IDS, -} from 'sushi/config' -import { SUSHI_ADDRESS } from 'sushi/currency' -import { formatNumber, formatUSD } from 'sushi/format' - -const getSushiPriceUSD = async () => { - const url = `https://api.sushi.com/price/v1/1/${ - SUSHI_ADDRESS[ChainId.ETHEREUM] - }` - const res = await fetch(url) - const json = await res.json() - return json -} - -interface ExchangeData { - tvlUSD: number - volumeUSD: number - pairCount: number -} - -const getV2Data = async () => { - const { data: factories } = await fetchMultichain({ - chainIds: SUSHISWAP_V2_SUPPORTED_CHAIN_IDS.filter( - (c) => - !DISABLED_ANALYTICS_CHAIN_IDS.includes( - c as (typeof DISABLED_ANALYTICS_CHAIN_IDS)[number], - ), - ), - fetch: getSushiV2Factory, - }) - - return { - v2: factories.reduce( - (acc, cur) => { - return { - tvlUSD: acc.tvlUSD + Number(cur.totalLiquidityUSD), - volumeUSD: acc.volumeUSD + Number(cur.totalVolumeUSD), - pairCount: acc.pairCount + Number(cur.poolCount), - } - }, - { - tvlUSD: 0, - volumeUSD: 0, - pairCount: 0, - }, - ), - } -} - -const getV3Data = async () => { - const { data: factories } = await fetchMultichain({ - chainIds: SUSHISWAP_V3_SUPPORTED_CHAIN_IDS.filter( - (c) => - !DISABLED_ANALYTICS_CHAIN_IDS.includes( - c as (typeof DISABLED_ANALYTICS_CHAIN_IDS)[number], - ), - ), - fetch: getSushiV3Factory, - }) - - return factories.reduce( - (acc, cur) => { - return { - tvlUSD: acc.tvlUSD + Number(cur.totalValueLockedUSD), - volumeUSD: acc.volumeUSD + Number(cur.totalVolumeUSD), - pairCount: acc.pairCount + Number(cur.poolCount), - } - }, - { - tvlUSD: 0, - volumeUSD: 0, - pairCount: 0, - }, - ) -} - -export const revalidate = 3600 - -export async function GET() { - const [sushiPrice, v2Data, v3Data] = await Promise.all([ - getSushiPriceUSD(), - getV2Data(), - getV3Data(), - ]) - - let totalTVL = Number(v2Data.v2.tvlUSD) + Number(v3Data.tvlUSD) - let totalVolume = Number(v2Data.v2.volumeUSD) + Number(v3Data.volumeUSD) - const totalPoolCount = Number(v2Data.v2.pairCount) + Number(v3Data.pairCount) - - totalTVL = totalTVL > 10_000_000_000 ? 0 : totalTVL - totalVolume = totalVolume > 5_000_000_000_000 ? 0 : totalVolume - - return NextResponse.json({ - stats: { - price: { - formatted: !sushiPrice ? '-' : formatUSD(sushiPrice), - number: Number(sushiPrice), - title: '$SUSHI Price', - decimalPlaces: 2, - }, - liquidity: { - formatted: !totalTVL ? '-' : formatUSD(totalTVL), - number: totalTVL, - title: 'Total Liquidity', - decimalPlaces: 0, - }, - volume: { - formatted: !totalVolume ? '-' : formatUSD(totalVolume), - number: totalVolume, - title: 'Total Volume', - decimalPlaces: 0, - }, - pairs: { - formatted: !totalPoolCount ? '-' : formatNumber(totalPoolCount), - number: totalPoolCount, - title: 'Total Pairs', - decimalPlaces: 0, - }, - }, - }) -} diff --git a/apps/web/src/lib/graph.ts b/apps/web/src/lib/graph.ts index 336b97e2b2..c012583320 100644 --- a/apps/web/src/lib/graph.ts +++ b/apps/web/src/lib/graph.ts @@ -1,87 +1,14 @@ import { getRebases as _getRebases } from '@sushiswap/graph-client/bentobox' -import { getSushiDayDatas } from '@sushiswap/graph-client/composite/sushi-day-datas' -import { getSushiV2StakedUnstakedPositions } from '@sushiswap/graph-client/composite/sushi-v2-staked-unstaked-positions' +import { getV3BasePoolsByToken } from '@sushiswap/graph-client/data-api' import { getFuroTokens as _getFuroTokens } from '@sushiswap/graph-client/furo' import { fetchMultichain } from '@sushiswap/graph-client/multichain' import { - SushiV2Pools, - getSushiV2Pool, - getSushiV2Pools, -} from '@sushiswap/graph-client/sushi-v2' -import { getSushiV3PoolsByTokenPair } from '@sushiswap/graph-client/sushi-v3' -import { SUPPORTED_CHAIN_IDS } from 'src/config' -import { - SUSHISWAP_V2_SUPPORTED_CHAIN_IDS, - SushiSwapV2ChainId, - isSushiSwapV2ChainId, - isSushiSwapV3ChainId, + isSushiSwapV3ChainId } from 'sushi/config' import { getChainIdAddressFromId } from 'sushi/format' -import { Address } from 'viem' import { bentoBoxTokensSchema, furoTokensSchema } from './schema' -export async function getUser(args: { - id?: Address - chainIds?: SushiSwapV2ChainId[] -}) { - if (!args.id) return [] - - const { data } = await getSushiV2StakedUnstakedPositions({ - chainIds: args.chainIds || [...SUSHISWAP_V2_SUPPORTED_CHAIN_IDS], - id: args.id.toLowerCase() as Address, - }) - - return data -} - -export const getV2GraphPool = async (id: string) => { - const split = getChainIdAddressFromId(id) - - if (!isSushiSwapV2ChainId(split.chainId)) throw Error('Invalid chain id') - - const pool = await getSushiV2Pool( - { - chainId: split.chainId, - id: split.address, - }, - { - retries: 3, - }, - ) - return pool -} - -export const getV2GraphPools = async (ids: string[]) => { - if (!ids.every((id) => id.includes(':'))) throw Error('Invalid pair ids') - - // Migrating to new format, graph-client uses the deprecated one - const addresses = ids.map((id) => id.split(':')[1]) as Address[] - - // PairsByIds would be better, not implemented though... - // Need to hack around - - const chainIds = Array.from( - new Set(ids.map((id) => Number(id.split(':')[0]))), - ) as SushiSwapV2ChainId[] - - const { data: pools } = await fetchMultichain({ - chainIds, - fetch: getSushiV2Pools, - variables: { - where: { - id_in: addresses, - }, - }, - }) - - return ( - pools - .map((pool) => ({ ...pool, id: `${pool.chainId}:${pool.address}` })) - // To prevent possible (although unlikely) collisions - .filter((pool) => ids.includes(pool.id)) as SushiV2Pools - ) -} export const getV3PoolsByTokenPair = async ( tokenId0: string, @@ -98,7 +25,7 @@ export const getV3PoolsByTokenPair = async ( throw Error('Invalid chain id') } - const pools = await getSushiV3PoolsByTokenPair({ + const pools = await getV3BasePoolsByToken({ chainId: chainId0, token0: address0, token1: address1, @@ -169,43 +96,3 @@ export const getBentoBoxTokens = async ( } } -export const getCharts = async (query?: { networks: string }) => { - const chainIds = query?.networks - ? JSON.parse(query.networks) - : SUPPORTED_CHAIN_IDS - - const { data: daySnapshots } = await getSushiDayDatas({ - chainIds, - }) - - const dateSnapshotMap = new Map() - - for (const snapshot of daySnapshots) { - const value = dateSnapshotMap.get(snapshot.date) - dateSnapshotMap.set( - snapshot.date, - value - ? [ - value[0] + Number(snapshot.liquidityUSD), - value[1] + Number(snapshot.volumeUSD), - ] - : [Number(snapshot.liquidityUSD), Number(snapshot.volumeUSD)], - ) - } - - // tvl x,y arrays - const tvl: [number[], number[]] = [[], []] - - // vol x,y arrays - const vol: [number[], number[]] = [[], []] - - dateSnapshotMap.forEach(([liquidity, volume], date) => { - tvl[0].push(date) - tvl[1].push(liquidity) - - vol[0].push(date) - vol[1].push(volume) - }) - - return [tvl, vol] -} diff --git a/apps/web/src/lib/hooks/useTokensFromPool.ts b/apps/web/src/lib/hooks/useTokensFromPool.ts index 711b16e986..dfc6d298e1 100644 --- a/apps/web/src/lib/hooks/useTokensFromPool.ts +++ b/apps/web/src/lib/hooks/useTokensFromPool.ts @@ -1,10 +1,14 @@ 'use client' import { useMemo } from 'react' -import type { PoolBase } from 'sushi' import { Native, Token } from 'sushi/currency' -export const getTokensFromPool = (pool: PoolBase) => { +export const getTokensFromPool = (pool: { + id: string + token0: { address: string; name: string; decimals: string; symbol: string } + token1: { address: string; name: string; decimals: string; symbol: string } + chainId: number +}) => { const _token0 = new Token({ address: pool.token0.address, name: pool.token0.name, @@ -44,7 +48,12 @@ export const getTokensFromPool = (pool: PoolBase) => { } } -export const useTokensFromPool = (pool: PoolBase) => { +export const useTokensFromPool = (pool: { + id: string + token0: { address: string; name: string; decimals: string; symbol: string } + token1: { address: string; name: string; decimals: string; symbol: string } + chainId: number +}) => { return useMemo(() => { return getTokensFromPool(pool) }, [pool]) diff --git a/apps/web/src/ui/analytics/global-stats-charts.tsx b/apps/web/src/ui/analytics/global-stats-charts.tsx deleted file mode 100644 index f0b0736a62..0000000000 --- a/apps/web/src/ui/analytics/global-stats-charts.tsx +++ /dev/null @@ -1,155 +0,0 @@ -'use client' - -import stringify from 'fast-json-stable-stringify' -import { FC, useCallback, useState } from 'react' -import useSWR from 'swr' - -import { PlusCircleIcon } from '@heroicons/react/20/solid' -import { - Button, - Card, - CardHeader, - Chip, - Command, - CommandGroup, - CommandItem, - Popover, - PopoverContent, - PopoverTrigger, - Separator, -} from '@sushiswap/ui' -import { CheckIcon } from '@sushiswap/ui/icons/CheckIcon' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' -import { Chain, ChainId } from 'sushi/chain' -import { ANALYTICS_CHAIN_IDS } from '../../config' -import { TVLChart } from './tvl-chart' -import { VolumeChart } from './volume-chart' - -const isAllThenNone = (chainIds: number[]) => - ANALYTICS_CHAIN_IDS.length === chainIds.length ? [] : chainIds - -const fetcher = ({ url, chainIds }: { url: string; chainIds: ChainId[] }) => { - const _url = new URL(url, window.location.origin) - _url.searchParams.set( - 'networks', - stringify(chainIds.length > 0 ? chainIds : ANALYTICS_CHAIN_IDS), - ) - - return fetch(_url.href) - .then((res) => res.json()) - .catch((e) => console.log(stringify(e))) -} - -export const GlobalStatsCharts: FC = () => { - const [open, setOpen] = useState(false) - const [localValue, setValues] = useState( - isAllThenNone(ANALYTICS_CHAIN_IDS), - ) - const { data } = useSWR( - { url: '/analytics/api/charts', chainIds: localValue }, - fetcher, - ) - - const onClick = useCallback( - (chainId: ChainId) => { - let _newValues: number[] - if (localValue.includes(chainId)) { - _newValues = localValue.filter((el) => el !== chainId) - } else { - _newValues = [...(localValue ?? []), chainId] - } - setValues(_newValues) - }, - [localValue], - ) - - return ( -
- - -
- Filter by - - - - - - - - {ANALYTICS_CHAIN_IDS.map((chainId) => ( - - onClick(+currentValue as ChainId) - } - className="py-2 pl-8 pr-2" - > - {localValue.includes(chainId) ? ( - - - - ) : null} - - {Chain.from(chainId)?.name} - - ))} - - - - -
-
-
- - -
-
-
- ) -} diff --git a/apps/web/src/ui/pool/NewPoolsTable.tsx b/apps/web/src/ui/pool/NewPoolsTable.tsx index 6759cb5a20..23479116ad 100644 --- a/apps/web/src/ui/pool/NewPoolsTable.tsx +++ b/apps/web/src/ui/pool/NewPoolsTable.tsx @@ -240,7 +240,7 @@ export const NewPoolsTable: FC = ({ state={state} onSortingChange={setSorting} loading={!pools} - linkFormatter={(row) => `/pool/${row.chainId}%3A${row.address}`} + linkFormatter={(row) => `pool/${row.protocol === SushiSwapProtocol.SUSHISWAP_V2 ? 'v2' : 'v3'}/${row.address}`} rowRenderer={rowRenderer} columns={COLUMNS} data={data} diff --git a/apps/web/src/ui/pool/PoolChartGraph.tsx b/apps/web/src/ui/pool/PoolChartGraph.tsx index 3c25075a06..b8b2a74626 100644 --- a/apps/web/src/ui/pool/PoolChartGraph.tsx +++ b/apps/web/src/ui/pool/PoolChartGraph.tsx @@ -78,7 +78,6 @@ export const PoolChartGraph: FC = ({ chart, period, pool, protoc return [x.reverse(), y.reverse()] }, [chart, period, buckets]) - // Transient update for performance const onMouseOver = useCallback( ({ name, value }: { name: number; value: number }) => { diff --git a/apps/web/src/ui/pool/PoolHeader.tsx b/apps/web/src/ui/pool/PoolHeader.tsx index 617349d3cf..eb3070c6a9 100644 --- a/apps/web/src/ui/pool/PoolHeader.tsx +++ b/apps/web/src/ui/pool/PoolHeader.tsx @@ -22,12 +22,12 @@ import { formatPercent, shortenAddress } from 'sushi/format' import { SushiSwapV3Pool } from 'sushi/pool/sushiswap-v3' import { APRHoverCard } from './APRHoverCard' -import { SmartPoolsV1, V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' +import { V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' type PoolHeader = { backUrl: string address: string - pool: SushiSwapV3Pool | null | undefined | V2Pool | V3Pool | SmartPoolsV1 + pool: SushiSwapV3Pool | null | undefined | V2Pool | V3Pool apy?: { fees: number | undefined rewards: number | undefined diff --git a/apps/web/src/ui/pool/PoolPageV3.tsx b/apps/web/src/ui/pool/PoolPageV3.tsx index ed66c6aea5..af0d875f04 100644 --- a/apps/web/src/ui/pool/PoolPageV3.tsx +++ b/apps/web/src/ui/pool/PoolPageV3.tsx @@ -62,7 +62,7 @@ const Pool: FC<{ pool: Awaited }> = ({ pool }) => { return (
- {pool.hasEnabledSteerVault && ( + {pool?.hasEnabledSteerVault && ( {`This pool has been activated to leverage our smart pool feature. Smart pools are designed to optimize the allocation of liquidity within customized price ranges, thereby improving trading efficiency. They achieve @@ -72,7 +72,7 @@ const Pool: FC<{ pool: Awaited }> = ({ pool }) => { To create a smart pool position, click{' '} here @@ -173,7 +173,7 @@ const Pool: FC<{ pool: Awaited }> = ({ pool }) => {
- +
) diff --git a/apps/web/src/ui/pool/PositionCard.tsx b/apps/web/src/ui/pool/PositionCard.tsx index a92144ca26..4fe55635c4 100644 --- a/apps/web/src/ui/pool/PositionCard.tsx +++ b/apps/web/src/ui/pool/PositionCard.tsx @@ -1,3 +1,4 @@ +import { V2Position } from '@sushiswap/graph-client/data-api' import { LinkInternal } from '@sushiswap/ui' import { Button } from '@sushiswap/ui' import { Currency } from '@sushiswap/ui' @@ -9,13 +10,12 @@ import { TooltipTrigger, } from '@sushiswap/ui' import React, { FC } from 'react' -import { UserWithPool } from 'src/app/(evm)/pool/api/user-with-pools/route' import { useTokensFromPool } from 'src/lib/hooks' import { Chain } from 'sushi/chain' import { formatPercent, formatUSD } from 'sushi/format' interface PositionCard { - position: UserWithPool + position: V2Position } export const PositionCardSkeleton = () => { diff --git a/apps/web/src/ui/pool/PositionCardList.tsx b/apps/web/src/ui/pool/PositionCardList.tsx index 70963de013..db94470ede 100644 --- a/apps/web/src/ui/pool/PositionCardList.tsx +++ b/apps/web/src/ui/pool/PositionCardList.tsx @@ -1,5 +1,5 @@ +import { V2Position } from '@sushiswap/graph-client/data-api' import React, { FC, ReactNode } from 'react' -import type { UserWithPool } from 'src/app/(evm)/pool/api/user-with-pools/route' import { useSushiV2UserPositions } from 'src/lib/hooks' import { useAccount } from 'wagmi' @@ -8,12 +8,12 @@ interface PositionCardList { positions, isLoading, }: { - positions: UserWithPool[] + positions: V2Position[] isLoading: boolean }): ReactNode } -const value = (position: UserWithPool) => +const value = (position: V2Position) => (Number(position.unstakedBalance + position.stakedBalance) / Number(position.pool.liquidity)) * Number(position.pool.liquidityUSD) diff --git a/apps/web/src/ui/pool/Steer/SteerCarousel.tsx b/apps/web/src/ui/pool/Steer/SteerCarousel.tsx index 65307b0903..04e0c3dd59 100644 --- a/apps/web/src/ui/pool/Steer/SteerCarousel.tsx +++ b/apps/web/src/ui/pool/Steer/SteerCarousel.tsx @@ -2,15 +2,12 @@ import { Carousel, SkeletonBox } from '@sushiswap/ui' import { FC, useCallback, useMemo } from 'react' - -import type { PoolWithFeeAprs, PoolWithIncentives } from 'sushi/types' import { SteerPoolCard } from './SteerPoolCard' -import { VaultV1 } from '@sushiswap/graph-client/data-api' +import { V3Pool, VaultV1 } from '@sushiswap/graph-client/data-api' -type RequiredPool = PoolWithIncentives interface SteerCarousel { - pool: RequiredPool + pool: V3Pool vaults: VaultV1[] } diff --git a/apps/web/src/ui/pool/columns.tsx b/apps/web/src/ui/pool/columns.tsx index 604d509c95..79853a7e26 100644 --- a/apps/web/src/ui/pool/columns.tsx +++ b/apps/web/src/ui/pool/columns.tsx @@ -1,4 +1,3 @@ -import { SushiV2StakedUnstakedPosition } from '@sushiswap/graph-client/composite/sushi-v2-staked-unstaked-positions' import { AngleRewardsPool } from '@sushiswap/react-query' import { PoolHasSteerVaults } from '@sushiswap/steer-sdk' import { @@ -253,7 +252,7 @@ export const NETWORK_COLUMN = { meta: { skeleton: , }, -} as const satisfies ColumnDef +} as const satisfies ColumnDef export const APR_COLUMN = { id: 'totalApr1d', diff --git a/packages/graph-client/scripts/t.ts b/packages/graph-client/scripts/t.ts deleted file mode 100644 index e18f44fdda..0000000000 --- a/packages/graph-client/scripts/t.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getSushiV3Pools } from '../src/subgraphs/sushi-v3/queries/pools' - -const a = await getSushiV3Pools({ chainId: 8453, first: Infinity }) - -console.log('v3 pools:', a.length) diff --git a/packages/graph-client/scripts/update-schemas.ts b/packages/graph-client/scripts/update-schemas.ts index 524eeb4c86..75818e3e50 100644 --- a/packages/graph-client/scripts/update-schemas.ts +++ b/packages/graph-client/scripts/update-schemas.ts @@ -4,19 +4,10 @@ import { buildClientSchema, getIntrospectionQuery, printSchema } from 'graphql' import fs from 'fs' const schemas = { - blocks: 'api.studio.thegraph.com/query/72545/ethereum-blocks/v0.0.2', bonds: BONDS_SUBGRAPH_URL[1], bentobox: 'api.studio.thegraph.com/query/32073/bentobox-ethereum/v0.0.1', strapi: 'sushi-strapi-cms.herokuapp.com/graphql', furo: 'api.studio.thegraph.com/query/32073/furo-ethereum/v0.0.1', - 'master-chef-v1': 'api.studio.thegraph.com/query/32073/masterchef/v0.0.1', - 'master-chef-v2': 'api.studio.thegraph.com/query/32073/master-chefv2/v0.0.1', - 'mini-chef': - 'api.studio.thegraph.com/query/32073/minichef-arbitrum/version/latest', - steer: 'api.thegraph.com/subgraphs/name/steerprotocol/steer-protocol-polygon', - 'sushi-bar': 'api.studio.thegraph.com/query/32073/xsushi/v0.0.1', - 'sushi-v2': 'api.studio.thegraph.com/query/32073/v2-arbitrum/v0.0.5', - 'sushi-v3': 'api.studio.thegraph.com/query/32073/v3-arbitrum/v0.0.1', 'data-api': 'data-api-production-acb1.up.railway.app/graphql', } as const satisfies Record diff --git a/packages/graph-client/src/composite/chef-user-positions.ts b/packages/graph-client/src/composite/chef-user-positions.ts deleted file mode 100644 index 57989f9551..0000000000 --- a/packages/graph-client/src/composite/chef-user-positions.ts +++ /dev/null @@ -1,86 +0,0 @@ -import type { ChainIdVariable, ChainIdsVariable } from 'src/lib/types/chainId' -import { - MINICHEF_SUPPORTED_CHAIN_IDS, - type MiniChefChainId, - isMiniChefChainId, -} from 'sushi/config' - -import type { RequestOptions } from 'src/lib/request' -import { - type GetMasterChefV1UserPositions, - type MasterChefV1UserPositions, - getMasterChefV1UserPositions, -} from 'src/subgraphs/master-chef-v1' -import { - type GetMasterChefV2UserPositions, - type MasterChefV2UserPositions, - getMasterChefV2UserPositions, -} from 'src/subgraphs/master-chef-v2' -import { - type GetMiniChefUserPositions, - type MiniChefUserPositions, - getMiniChefUserPositions, -} from 'src/subgraphs/mini-chef' -import { ChainId } from 'sushi/chain' - -export type GetChefUserPositions = Omit< - GetMasterChefV1UserPositions & - GetMasterChefV2UserPositions & - GetMiniChefUserPositions, - 'chainId' -> & - ChainIdsVariable<1 | MiniChefChainId> - -type CombinedPosition = ( - | MasterChefV1UserPositions - | MasterChefV2UserPositions - | MiniChefUserPositions -)[number] - -export type ChefPosition = Omit & { - pool: Omit & - ChainIdVariable['chainId']> -} - -export async function getChefUserPositions( - { - chainIds = [ChainId.ETHEREUM, ...MINICHEF_SUPPORTED_CHAIN_IDS], - ...variables - }: GetChefUserPositions, - options?: RequestOptions, -) { - const miniChefChainIds = chainIds.filter(isMiniChefChainId) - - const masterChefPromises = chainIds.includes(ChainId.ETHEREUM) - ? [ - getMasterChefV1UserPositions(variables, options), - getMasterChefV2UserPositions(variables, options), - ] - : [] - - const promises = await Promise.allSettled([ - ...masterChefPromises, - ...miniChefChainIds.map((chainId) => - getMiniChefUserPositions( - { - ...variables, - chainId, - }, - options, - ), - ), - ]) - - const data = [] as ChefPosition[] - const errors = [] - - for (const promise of promises) { - if (promise.status === 'fulfilled') { - data.push(...promise.value) - } else { - errors.push(promise.reason) - } - } - - return { data, errors } -} diff --git a/packages/graph-client/src/composite/sushi-day-datas.ts b/packages/graph-client/src/composite/sushi-day-datas.ts deleted file mode 100644 index 053abf2e22..0000000000 --- a/packages/graph-client/src/composite/sushi-day-datas.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type { RequestOptions } from 'src/lib/request' -import type { ChainIdsVariable } from 'src/lib/types/chainId' -import { fetchMultichain } from 'src/multichain' -import { getSushiV2DayDatas } from 'src/subgraphs/sushi-v2/queries/day-datas' -import { - type SushiV3DayDatas, - getSushiV3DayDatas, -} from 'src/subgraphs/sushi-v3/queries/day-datas' -import { - SUSHISWAP_V2_SUPPORTED_CHAIN_IDS, - SUSHISWAP_V3_SUPPORTED_CHAIN_IDS, - type SushiSwapV2ChainId, - type SushiSwapV3ChainId, - isSushiSwapV2ChainId, - isSushiSwapV3ChainId, -} from 'sushi/config' - -export type GetSushiDayDatas = {} & ChainIdsVariable< - SushiSwapV2ChainId | SushiSwapV3ChainId -> - -export async function getSushiDayDatas( - { - chainIds = Array.from( - new Set([ - ...SUSHISWAP_V2_SUPPORTED_CHAIN_IDS, - ...SUSHISWAP_V3_SUPPORTED_CHAIN_IDS, - ]), - ), - }: GetSushiDayDatas, - options: RequestOptions = { - retries: 10, - }, -) { - const sushiSwapV2ChainIds = chainIds.filter(isSushiSwapV2ChainId) - const v2p = fetchMultichain({ - chainIds: sushiSwapV2ChainIds, - fetch: getSushiV2DayDatas, - variables: { - first: 1000, - orderBy: 'date', - orderDirection: 'desc', - }, - options, - }) - - const sushiSwapV3ChainIds = chainIds.filter(isSushiSwapV3ChainId) - const v3p = fetchMultichain({ - chainIds: sushiSwapV3ChainIds, - fetch: getSushiV3DayDatas, - variables: { - first: 1000, - orderBy: 'date', - orderDirection: 'desc', - }, - options, - }) - - const [ - { data: sushiSwapV2DayDatas, errors: sushiSwapV2DayDataErrors }, - { data: sushiSwapV3DayDatas, errors: sushiSwapV3DayDatasErrors }, - ] = await Promise.all([v2p, v3p]) - - const dataMap = new Map() - - const setOrAdd = (date: number, dayData: SushiV3DayDatas[number]) => { - if (Number(dayData.volumeUSD) > 1_000_000_000) return // Skip volume if it's too high, MEV txs on ethereum can cause this - - const existing = dataMap.get(date) - - if (existing) { - dataMap.set(date, { - ...existing, - volumeUSD: existing.volumeUSD + dayData.volumeUSD, - volumeUSDUntracked: - existing.volumeUSDUntracked + dayData.volumeUSDUntracked, - liquidityUSD: existing.liquidityUSD + dayData.liquidityUSD, - txCount: existing.txCount + dayData.txCount, - feesUSD: existing.feesUSD + dayData.feesUSD, - }) - return - } - - dataMap.set(date, dayData) - } - - sushiSwapV3DayDatas.forEach((dayData) => { - setOrAdd(dayData.date, dayData) - }) - - sushiSwapV2DayDatas.forEach((dayData) => { - setOrAdd(dayData.date, dayData) - }) - - const data = Array.from(dataMap.values()) - - const errors = [...sushiSwapV2DayDataErrors, ...sushiSwapV3DayDatasErrors] - - return { data, errors } -} diff --git a/packages/graph-client/src/composite/sushi-historic-pool.ts b/packages/graph-client/src/composite/sushi-historic-pool.ts deleted file mode 100644 index dac910a2af..0000000000 --- a/packages/graph-client/src/composite/sushi-historic-pool.ts +++ /dev/null @@ -1,204 +0,0 @@ -import type { RequestOptions } from 'src/lib/request' -import { getBlockHistoric } from 'src/subgraphs/blocks/queries/block-historic' -import { - type GetSushiV2Pool, - getSushiV2Pool, -} from 'src/subgraphs/sushi-v2/queries/pool' -import { getSushiV2PoolBuckets } from 'src/subgraphs/sushi-v2/queries/pool-with-buckets' -import { - type GetSushiV3Pool, - getSushiV3Pool, -} from 'src/subgraphs/sushi-v3/queries/pool' -import { getSushiV3PoolBuckets } from 'src/subgraphs/sushi-v3/queries/pool-with-buckets' -import { isSushiSwapV2ChainId, isSushiSwapV3ChainId } from 'sushi/config' -import type { - PoolBase, - PoolHistory1D, - PoolV2, - PoolV3, - PoolWithBuckets, -} from 'sushi/types' -import { isPromiseFulfilled } from 'sushi/validate' - -export type GetSushiHistoricPool = Omit< - GetSushiV2Pool | GetSushiV3Pool, - 'block' -> - -type Result = PoolHistory1D< - PoolWithBuckets | PoolV3> -> - -async function fetchSushiV2Pool( - { chainId, ...variables }: GetSushiV2Pool | GetSushiV3Pool, - options?: RequestOptions, -) { - if (!isSushiSwapV2ChainId(chainId)) { - throw new Error(`ChainId ${chainId} is not a SushiSwap V2 chain`) - } - - return getSushiV2Pool({ chainId, ...variables }, options) -} - -async function fetchSushiV3Pool( - { chainId, ...variables }: GetSushiV2Pool | GetSushiV3Pool, - options?: RequestOptions, -) { - if (!isSushiSwapV3ChainId(chainId)) { - throw new Error(`ChainId ${chainId} is not a SushiSwap V3 chain`) - } - - return getSushiV3Pool({ chainId, ...variables }, options) -} - -export async function getSushiHistoricPool( - { chainId, ...variables }: GetSushiHistoricPool, - options?: RequestOptions, -): Promise { - const id = variables.id.toLowerCase() - - // FETCH - const v2poolF = isSushiSwapV2ChainId(chainId) - ? getSushiV2PoolBuckets( - { - chainId, - id, - }, - options, - ) - : null - const v3poolF = isSushiSwapV3ChainId(chainId) - ? getSushiV3PoolBuckets( - { - chainId, - id, - }, - options, - ) - : null - - const [v2poolS, v3poolS] = await Promise.allSettled([v2poolF, v3poolF]) - - const v2pool = isPromiseFulfilled(v2poolS) ? v2poolS.value : null - const v3pool = isPromiseFulfilled(v3poolS) ? v3poolS.value : null - - if (!v2pool && !v3pool) { - throw new Error(`Failed to fetch pool ${chainId}:${variables.id}`) - } - - const fetcher = v2pool ? fetchSushiV2Pool : fetchSushiV3Pool - - const getPoolTimeAgo = async ( - ago: Omit[0], 'chainId'>, - ) => { - return getBlockHistoric( - { - chainId, - ...ago, - }, - options, - ) - .then(async (block) => { - return fetcher( - { - chainId, - id, - block: { number: block.number }, - }, - options, - ) - }) - .catch(() => null) - } - - const pool1dP = getPoolTimeAgo({ daysAgo: 1 }) - const pool2dP = getPoolTimeAgo({ daysAgo: 2 }) - - const [pool1dS, pool2dS] = await Promise.allSettled([pool1dP, pool2dP]) - - const pool = v2pool || v3pool! - const pool1d = isPromiseFulfilled(pool1dS) ? pool1dS.value : null - const pool2d = isPromiseFulfilled(pool2dS) ? pool2dS.value : null - - // TRANSFORM - const liquidityUSD1dChange = calculateRelativePercentageChange( - pool.liquidityUSD, - pool1d?.liquidityUSD, - ) - - const volumeUSD1d = calculateValueChange(pool.volumeUSD, pool1d?.volumeUSD) - const volumeUSD1dChange = calculateCumulativePercentageChange( - pool.volumeUSD, - pool1d?.volumeUSD, - pool2d?.volumeUSD, - ) - - const feesUSD1d = calculateValueChange(pool.feesUSD, pool1d?.feesUSD) - const feesUSD1dChange = calculateCumulativePercentageChange( - pool.feesUSD, - pool1d?.feesUSD, - pool2d?.feesUSD, - ) - const txCount1d = calculateValueChange(pool.txCount, pool1d?.txCount) - const txCount1dChange = calculateCumulativePercentageChange( - pool.txCount, - pool1d?.txCount, - pool2d?.txCount, - ) - - return { - ...pool, - liquidityUSD1dChange, - volumeUSD1d, - volumeUSD1dChange, - feesUSD1d, - feesUSD1dChange, - txCount1d, - txCount1dChange, - } -} - -const calculateValueChange = ( - current: string | number | bigint | undefined, - previous: string | number | bigint | undefined, -) => { - const _current = Number(current) - const _previous = Number(previous) - - if (_current === 0 || [_current, _previous].some((num) => isNaN(num))) - return 0 - return _previous !== 0 ? _current - _previous : 0 -} - -const calculateCumulativePercentageChange = ( - current: string | number | bigint | undefined, - previous: string | number | bigint | undefined, - previous2?: string | number | bigint | undefined, -) => { - const _current = Number(current) - const _previous = Number(previous) - const _previous2 = Number(previous2) - - if ( - _current === 0 || - [_current, _previous, _previous2].some((num) => isNaN(num)) - ) - return 0 - const change1 = _previous !== 0 ? _current - _previous : 0 - const change2 = - _previous !== 0 && _previous2 !== 0 ? _previous - _previous2 : 0 - if (change2 === 0) return 0 // avoid division by 0 - return _previous !== 0 && _previous2 !== 0 ? change1 / change2 - 1 : 0 -} - -const calculateRelativePercentageChange = ( - current: string | number | bigint | undefined, - previous?: string | number | bigint | undefined, -) => { - const _current = Number(current) - const _previous = Number(previous) - - if (_current === 0 || [_current, _previous].some((num) => isNaN(num))) - return 0 - return _previous !== 0 ? _current / _previous - 1 : 0 -} diff --git a/packages/graph-client/src/composite/sushi-v2-staked-unstaked-positions.ts b/packages/graph-client/src/composite/sushi-v2-staked-unstaked-positions.ts deleted file mode 100644 index f1b1c69207..0000000000 --- a/packages/graph-client/src/composite/sushi-v2-staked-unstaked-positions.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { FetchError } from 'src/lib/fetch-error' -import type { ChainIdsVariable } from 'src/lib/types/chainId' -import type { Hex } from 'src/lib/types/hex' -import { fetchMultichain } from 'src/multichain/fetch-multichain' -import { - type GetSushiV2LiquidityPositions, - getSushiV2LiquidityPositions, -} from 'src/subgraphs/sushi-v2' -import { ChainId } from 'sushi/chain' -import { - MINICHEF_SUPPORTED_CHAIN_IDS, - SUSHISWAP_V2_SUPPORTED_CHAIN_IDS, - isMiniChefChainId, - isSushiSwapV2ChainId, -} from 'sushi/config' -import type { - PoolV2, - SushiPositionStaked, - SushiPositionWithPool, -} from 'sushi/types' -import { - type GetChefUserPositions, - getChefUserPositions, -} from './chef-user-positions' - -export type GetSushiV2StakedUnstakedPositions = { - id: Hex -} & ChainIdsVariable< - | NonNullable[number] - | GetSushiV2LiquidityPositions['chainId'] -> - -export type SushiV2StakedUnstakedPosition = SushiPositionStaked< - SushiPositionWithPool -> - -/** - * @brief Get staked AND unstaked user positions - */ -export async function getSushiV2StakedUnstakedPositions({ - chainIds = [ - ...new Set([ - ...SUSHISWAP_V2_SUPPORTED_CHAIN_IDS, - ...MINICHEF_SUPPORTED_CHAIN_IDS, - ]), - ], - id, -}: GetSushiV2StakedUnstakedPositions): Promise<{ - data: SushiV2StakedUnstakedPosition[] - errors: FetchError[] -}> { - const sushiSwapChainIds = chainIds.filter(isSushiSwapV2ChainId) - const { - data: sushiSwapV2LiquidityPositions, - errors: sushiSwapV2LiquidityPositionErrors, - } = await fetchMultichain({ - chainIds: sushiSwapChainIds, - fetch: getSushiV2LiquidityPositions, - variables: { - first: 1000, - where: { - user: id, - liquidityTokenBalance_gt: '0', - }, - }, - }) - - const chefChainIds = [ - ...chainIds.filter(isMiniChefChainId), - ...(chainIds.includes(ChainId.ETHEREUM) ? [ChainId.ETHEREUM] : []), - ] - const { data: chefUserPositions, errors: chefUserPositionErrors } = - await getChefUserPositions({ - chainIds: chefChainIds, - where: { - address: id, - amount_gt: '0', - }, - }) - - const poolIds = Array.from( - new Set([ - ...sushiSwapV2LiquidityPositions.map((position) => position.pool.id), - ...chefUserPositions.map((position) => position.pool.id), - ]), - ) - - const data = poolIds - .map((poolId) => { - const sushiSwapPosition = sushiSwapV2LiquidityPositions.find( - (position) => position.pool.id === poolId, - ) - const chefPosition = chefUserPositions.find( - (position) => position.pool.id === poolId, - ) - - const pool = sushiSwapPosition?.pool ?? chefPosition?.pool - - if (!pool) return null - - return { - user: id, - unstakedBalance: BigInt(sushiSwapPosition?.balance ?? '0'), - stakedBalance: BigInt(chefPosition?.balance ?? '0'), - pool, - } - }) - .filter((p): p is NonNullable => p !== null) - - const errors = [ - ...sushiSwapV2LiquidityPositionErrors, - ...chefUserPositionErrors, - ] - - return { data, errors } -} diff --git a/packages/graph-client/src/subgraphs/blocks/graphql.ts b/packages/graph-client/src/subgraphs/blocks/graphql.ts deleted file mode 100644 index f6de3c9c20..0000000000 --- a/packages/graph-client/src/subgraphs/blocks/graphql.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { initGraphQLTada } from 'gql.tada' -import type { Scalars } from 'src/lib/types/scalars.js' -import type { introspection } from './blocks-env.js' - -export const graphql = initGraphQLTada<{ - introspection: introspection - scalars: Scalars -}>() diff --git a/packages/graph-client/src/subgraphs/blocks/index.ts b/packages/graph-client/src/subgraphs/blocks/index.ts deleted file mode 100644 index 2b85d07c49..0000000000 --- a/packages/graph-client/src/subgraphs/blocks/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './queries/block-historic' -export * from './queries/blocks' diff --git a/packages/graph-client/src/subgraphs/blocks/queries/block-historic.ts b/packages/graph-client/src/subgraphs/blocks/queries/block-historic.ts deleted file mode 100644 index 7936a6b424..0000000000 --- a/packages/graph-client/src/subgraphs/blocks/queries/block-historic.ts +++ /dev/null @@ -1,64 +0,0 @@ -import type { RequestOptions } from 'src/lib/request' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import type { ChainId } from 'sushi/chain' -import { getBlocks } from './blocks' - -type GetBlockHistoric = { - secsAgo?: number - minsAgo?: number - hoursAgo?: number - daysAgo?: number - weeksAgo?: number - monthsAgo?: number - yearsAgo?: number -} & ChainIdVariable - -export async function getBlockHistoric( - { - chainId, - secsAgo = 0, - minsAgo = 0, - hoursAgo = 0, - daysAgo = 0, - weeksAgo = 0, - monthsAgo = 0, - yearsAgo = 0, - }: GetBlockHistoric, - options?: RequestOptions, -) { - const current = Math.floor(Date.now() / 1000) - const ago = - secsAgo + - minsAgo * 60 + - hoursAgo * 60 * 60 + - daysAgo * 60 * 60 * 24 + - weeksAgo * 60 * 60 * 24 * 7 + - monthsAgo * 60 * 60 * 24 * 30 + - yearsAgo * 60 * 60 * 24 * 365 - - const target = current - ago - - const blocks = await getBlocks( - { - chainId, - first: 1, - orderBy: 'timestamp', - orderDirection: 'asc', - where: { - timestamp_gte: String(target), - }, - }, - options, - ) - - const block = blocks[0] - - if (!block) { - throw new Error('Block not found') - } - - return { - chainId, - ...block, - } -} diff --git a/packages/graph-client/src/subgraphs/blocks/queries/blocks.ts b/packages/graph-client/src/subgraphs/blocks/queries/blocks.ts deleted file mode 100644 index 3ae82aba7c..0000000000 --- a/packages/graph-client/src/subgraphs/blocks/queries/blocks.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type { VariablesOf } from 'gql.tada' - -import { FetchError } from 'src/lib/fetch-error' -import { type RequestOptions, request } from 'src/lib/request' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import type { ChainId } from 'sushi/chain' -import { BLOCKS_SUBGRAPH_URL } from 'sushi/config/subgraph' -import { graphql } from '../graphql' - -export const BlocksQuery = graphql( - ` - query Blocks($first: Int = 1000, $skip: Int = 0, $orderBy: Block_orderBy = number, $orderDirection: OrderDirection = desc, $where: Block_filter) { - blocks(first: $first, skip: $skip, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - number - timestamp - } - } -`, -) - -export type GetBlocks = VariablesOf & - ChainIdVariable - -export async function getBlocks( - { chainId, ...variables }: GetBlocks, - options?: RequestOptions, -) { - const baseUrl = BLOCKS_SUBGRAPH_URL[chainId] - - if (!baseUrl) { - throw new FetchError(chainId, `No subgraph URL for chainId ${chainId}`) - } - - const url = `https://${baseUrl}` - - const result = await request( - { url, document: BlocksQuery, variables }, - options, - ) - - return result.blocks.map((block) => ({ - id: block.id, - number: Number(block.number), - timestamp: Number(block.timestamp), - })) -} - -export type Blocks = Awaited> diff --git a/packages/graph-client/src/subgraphs/blocks/schema.graphql b/packages/graph-client/src/subgraphs/blocks/schema.graphql deleted file mode 100644 index 662dac97e1..0000000000 --- a/packages/graph-client/src/subgraphs/blocks/schema.graphql +++ /dev/null @@ -1,381 +0,0 @@ -""" -Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive. -""" -directive @entity on OBJECT - -"""Defined a Subgraph ID for an object type""" -directive @subgraphId(id: String!) on OBJECT - -""" -creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API. -""" -directive @derivedFrom(field: String!) on FIELD_DEFINITION - -enum Aggregation_interval { - hour - day -} - -scalar BigDecimal - -scalar BigInt - -type Block { - id: Bytes! - number: BigInt! - timestamp: BigInt! - parentHash: String - author: String - difficulty: BigInt - totalDifficulty: BigInt - gasUsed: BigInt - gasLimit: BigInt - receiptsRoot: String - transactionsRoot: String - stateRoot: String - size: BigInt - unclesHash: String -} - -input BlockChangedFilter { - number_gte: Int! -} - -input Block_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - number: BigInt - number_not: BigInt - number_gt: BigInt - number_lt: BigInt - number_gte: BigInt - number_lte: BigInt - number_in: [BigInt!] - number_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - parentHash: String - parentHash_not: String - parentHash_gt: String - parentHash_lt: String - parentHash_gte: String - parentHash_lte: String - parentHash_in: [String!] - parentHash_not_in: [String!] - parentHash_contains: String - parentHash_contains_nocase: String - parentHash_not_contains: String - parentHash_not_contains_nocase: String - parentHash_starts_with: String - parentHash_starts_with_nocase: String - parentHash_not_starts_with: String - parentHash_not_starts_with_nocase: String - parentHash_ends_with: String - parentHash_ends_with_nocase: String - parentHash_not_ends_with: String - parentHash_not_ends_with_nocase: String - author: String - author_not: String - author_gt: String - author_lt: String - author_gte: String - author_lte: String - author_in: [String!] - author_not_in: [String!] - author_contains: String - author_contains_nocase: String - author_not_contains: String - author_not_contains_nocase: String - author_starts_with: String - author_starts_with_nocase: String - author_not_starts_with: String - author_not_starts_with_nocase: String - author_ends_with: String - author_ends_with_nocase: String - author_not_ends_with: String - author_not_ends_with_nocase: String - difficulty: BigInt - difficulty_not: BigInt - difficulty_gt: BigInt - difficulty_lt: BigInt - difficulty_gte: BigInt - difficulty_lte: BigInt - difficulty_in: [BigInt!] - difficulty_not_in: [BigInt!] - totalDifficulty: BigInt - totalDifficulty_not: BigInt - totalDifficulty_gt: BigInt - totalDifficulty_lt: BigInt - totalDifficulty_gte: BigInt - totalDifficulty_lte: BigInt - totalDifficulty_in: [BigInt!] - totalDifficulty_not_in: [BigInt!] - gasUsed: BigInt - gasUsed_not: BigInt - gasUsed_gt: BigInt - gasUsed_lt: BigInt - gasUsed_gte: BigInt - gasUsed_lte: BigInt - gasUsed_in: [BigInt!] - gasUsed_not_in: [BigInt!] - gasLimit: BigInt - gasLimit_not: BigInt - gasLimit_gt: BigInt - gasLimit_lt: BigInt - gasLimit_gte: BigInt - gasLimit_lte: BigInt - gasLimit_in: [BigInt!] - gasLimit_not_in: [BigInt!] - receiptsRoot: String - receiptsRoot_not: String - receiptsRoot_gt: String - receiptsRoot_lt: String - receiptsRoot_gte: String - receiptsRoot_lte: String - receiptsRoot_in: [String!] - receiptsRoot_not_in: [String!] - receiptsRoot_contains: String - receiptsRoot_contains_nocase: String - receiptsRoot_not_contains: String - receiptsRoot_not_contains_nocase: String - receiptsRoot_starts_with: String - receiptsRoot_starts_with_nocase: String - receiptsRoot_not_starts_with: String - receiptsRoot_not_starts_with_nocase: String - receiptsRoot_ends_with: String - receiptsRoot_ends_with_nocase: String - receiptsRoot_not_ends_with: String - receiptsRoot_not_ends_with_nocase: String - transactionsRoot: String - transactionsRoot_not: String - transactionsRoot_gt: String - transactionsRoot_lt: String - transactionsRoot_gte: String - transactionsRoot_lte: String - transactionsRoot_in: [String!] - transactionsRoot_not_in: [String!] - transactionsRoot_contains: String - transactionsRoot_contains_nocase: String - transactionsRoot_not_contains: String - transactionsRoot_not_contains_nocase: String - transactionsRoot_starts_with: String - transactionsRoot_starts_with_nocase: String - transactionsRoot_not_starts_with: String - transactionsRoot_not_starts_with_nocase: String - transactionsRoot_ends_with: String - transactionsRoot_ends_with_nocase: String - transactionsRoot_not_ends_with: String - transactionsRoot_not_ends_with_nocase: String - stateRoot: String - stateRoot_not: String - stateRoot_gt: String - stateRoot_lt: String - stateRoot_gte: String - stateRoot_lte: String - stateRoot_in: [String!] - stateRoot_not_in: [String!] - stateRoot_contains: String - stateRoot_contains_nocase: String - stateRoot_not_contains: String - stateRoot_not_contains_nocase: String - stateRoot_starts_with: String - stateRoot_starts_with_nocase: String - stateRoot_not_starts_with: String - stateRoot_not_starts_with_nocase: String - stateRoot_ends_with: String - stateRoot_ends_with_nocase: String - stateRoot_not_ends_with: String - stateRoot_not_ends_with_nocase: String - size: BigInt - size_not: BigInt - size_gt: BigInt - size_lt: BigInt - size_gte: BigInt - size_lte: BigInt - size_in: [BigInt!] - size_not_in: [BigInt!] - unclesHash: String - unclesHash_not: String - unclesHash_gt: String - unclesHash_lt: String - unclesHash_gte: String - unclesHash_lte: String - unclesHash_in: [String!] - unclesHash_not_in: [String!] - unclesHash_contains: String - unclesHash_contains_nocase: String - unclesHash_not_contains: String - unclesHash_not_contains_nocase: String - unclesHash_starts_with: String - unclesHash_starts_with_nocase: String - unclesHash_not_starts_with: String - unclesHash_not_starts_with_nocase: String - unclesHash_ends_with: String - unclesHash_ends_with_nocase: String - unclesHash_not_ends_with: String - unclesHash_not_ends_with_nocase: String - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Block_filter] - or: [Block_filter] -} - -input Block_height { - hash: Bytes - number: Int - number_gte: Int -} - -enum Block_orderBy { - id - number - timestamp - parentHash - author - difficulty - totalDifficulty - gasUsed - gasLimit - receiptsRoot - transactionsRoot - stateRoot - size - unclesHash -} - -scalar Bytes - -"8 bytes signed integer\n" -scalar Int8 - -"""Defines the order direction, either ascending or descending""" -enum OrderDirection { - asc - desc -} - -type Query { - block( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Block - blocks( - skip: Int = 0 - first: Int = 100 - orderBy: Block_orderBy - orderDirection: OrderDirection - where: Block_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Block!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type Subscription { - block( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Block - blocks( - skip: Int = 0 - first: Int = 100 - orderBy: Block_orderBy - orderDirection: OrderDirection - where: Block_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Block!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -"A string representation of microseconds UNIX timestamp (16 digits)\n" -scalar Timestamp - -type _Block_ { - """The hash of the block""" - hash: Bytes - - """The block number""" - number: Int! - - """Integer representation of the timestamp stored in blocks for the chain""" - timestamp: Int - - """The hash of the parent block""" - parentHash: Bytes -} - -"""The type for the top-level _meta field""" -type _Meta_ { - "Information about a specific subgraph block. The hash of the block\nwill be null if the _meta field has a block constraint that asks for\na block number. It will be filled if the _meta field has no block constraint\nand therefore asks for the latest block\n" - block: _Block_! - - """The deployment ID""" - deployment: String! - - """If `true`, the subgraph encountered indexing errors at some past block""" - hasIndexingErrors: Boolean! -} - -enum _SubgraphErrorPolicy_ { - """Data will be returned even if the subgraph has indexing errors""" - allow - - """ - If the subgraph has indexing errors, data will be omitted. The default. - """ - deny -} \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts index b30e56a244..51714be02f 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts @@ -10,7 +10,7 @@ import { type PoolHistory1D, type PoolV2, type PoolWithAprs, - type PoolWithIncentives + type PoolWithIncentives, } from 'sushi' import { isSushiSwapV2ChainId } from 'sushi/config' import type { Address } from 'viem' @@ -96,86 +96,91 @@ export async function getV2Pool( throw new Error('Invalid chainId') } - const result = await request( - { url, document: V2PoolQuery, variables }, - options, - ) - if (result.v2Pool) { - const pool = result.v2Pool - return { - id: pool.id as `${string}:0x${string}`, - address: pool.address as Address, - chainId, - name: `${pool.token0.symbol}-${pool.token1.symbol}`, - swapFee: pool.swapFee, - protocol: SushiSwapProtocol.SUSHISWAP_V2, - reserve0: BigInt(pool.reserve0), - reserve1: BigInt(pool.reserve1), - liquidity: BigInt(pool.liquidity), - liquidityUSD: pool.liquidityUSD, + try { + const result = await request( + { url, document: V2PoolQuery, variables }, + options, + ) + if (result.v2Pool) { + const pool = result.v2Pool + return { + id: pool.id as `${string}:0x${string}`, + address: pool.address as Address, + chainId, + name: `${pool.token0.symbol}-${pool.token1.symbol}`, + swapFee: pool.swapFee, + protocol: SushiSwapProtocol.SUSHISWAP_V2, + reserve0: BigInt(pool.reserve0), + reserve1: BigInt(pool.reserve1), + liquidity: BigInt(pool.liquidity), + liquidityUSD: pool.liquidityUSD, - volumeUSD: pool.volumeUSD, - feesUSD: pool.volumeUSD * pool.swapFee, + volumeUSD: pool.volumeUSD, + feesUSD: pool.volumeUSD * pool.swapFee, - token0: { - id: pool.token0.id as `${string}:0x${string}`, - address: pool.token0.address as Address, - chainId, - decimals: pool.token0.decimals, - name: pool.token0.name, - symbol: pool.token0.symbol, - }, - token1: { - id: pool.token1.id as `${string}:0x${string}`, - address: pool.token1.address as Address, - chainId, - decimals: pool.token1.decimals, - name: pool.token1.name, - symbol: pool.token1.symbol, - }, - token0Price: pool.token0Price, - token1Price: pool.token1Price, - txCount: pool.txCount1d, + token0: { + id: pool.token0.id as `${string}:0x${string}`, + address: pool.token0.address as Address, + chainId, + decimals: pool.token0.decimals, + name: pool.token0.name, + symbol: pool.token0.symbol, + }, + token1: { + id: pool.token1.id as `${string}:0x${string}`, + address: pool.token1.address as Address, + chainId, + decimals: pool.token1.decimals, + name: pool.token1.name, + symbol: pool.token1.symbol, + }, + token0Price: pool.token0Price, + token1Price: pool.token1Price, + txCount: pool.txCount1d, - volumeUSD1d: pool.volumeUSD1d, - feesUSD1d: pool.feeUSD1d, - txCount1d: pool.txCount1d, - liquidityUSD1dChange: pool.liquidityUSD1dChange, - volumeUSD1dChange: pool.volumeUSD1dChange, - feesUSD1dChange: pool.feeUSD1dChange, - txCount1dChange: pool.txCount1dChange, + volumeUSD1d: pool.volumeUSD1d, + feesUSD1d: pool.feeUSD1d, + txCount1d: pool.txCount1d, + liquidityUSD1dChange: pool.liquidityUSD1dChange, + volumeUSD1dChange: pool.volumeUSD1dChange, + feesUSD1dChange: pool.feeUSD1dChange, + txCount1dChange: pool.txCount1dChange, - feeApr1d: pool.feeApr1d, - totalApr1d: pool.totalApr1d, - incentiveApr: pool.incentiveApr, - isIncentivized: pool.isIncentivized, - wasIncentivized: pool.wasIncentivized, + feeApr1d: pool.feeApr1d, + totalApr1d: pool.totalApr1d, + incentiveApr: pool.incentiveApr, + isIncentivized: pool.isIncentivized, + wasIncentivized: pool.wasIncentivized, - incentives: pool.incentives.map((incentive) => ({ - id: incentive.id as `${string}:0x${string}`, - chainId, - chefType: incentive.chefType as ChefType, - apr: incentive.apr, - rewardToken: { - id: incentive.rewardToken.id as `${string}:0x${string}`, - address: incentive.rewardToken.address as Address, + incentives: pool.incentives.map((incentive) => ({ + id: incentive.id as `${string}:0x${string}`, chainId, - decimals: incentive.rewardToken.decimals, - name: incentive.rewardToken.name, - symbol: incentive.rewardToken.symbol, - }, - rewardPerDay: incentive.rewardPerDay, - poolAddress: incentive.poolAddress as Address, - pid: incentive.pid, - rewarderAddress: incentive.rewarderAddress as Address, - rewarderType: incentive.rewarderType as RewarderType, - })), - } satisfies - PoolWithAprs>> - > - } + chefType: incentive.chefType as ChefType, + apr: incentive.apr, + rewardToken: { + id: incentive.rewardToken.id as `${string}:0x${string}`, + address: incentive.rewardToken.address as Address, + chainId, + decimals: incentive.rewardToken.decimals, + name: incentive.rewardToken.name, + symbol: incentive.rewardToken.symbol, + }, + rewardPerDay: incentive.rewardPerDay, + poolAddress: incentive.poolAddress as Address, + pid: incentive.pid, + rewarderAddress: incentive.rewarderAddress as Address, + rewarderType: incentive.rewarderType as RewarderType, + })), + } satisfies PoolWithAprs< + PoolWithIncentives>> + > + } - throw new Error('No pool found') + throw new Error('No pool found') + } catch (_e) { + // console.error(e) + return null + } } -export type V2Pool = Awaited> +export type V2Pool = NonNullable>> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts index 7b55d51bfe..4212942cdf 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts @@ -11,7 +11,7 @@ import { type PoolHistory1D, type PoolV3, type PoolWithAprs, - type PoolWithIncentives + type PoolWithIncentives, } from 'sushi' import { isSushiSwapV3ChainId } from 'sushi/config' import type { Address } from 'viem' @@ -104,98 +104,102 @@ export async function getV3Pool( if (!isSushiSwapV3ChainId(chainId)) { throw new Error('Invalid chainId') } + try { + const result = await request( + { url, document: V3PoolQuery, variables }, + options, + ) + if (result.v3Pool) { + const incentives = result.v3Pool.incentives.filter((i) => i !== null) + const pool = result.v3Pool + return { + id: pool.id as `${string}:0x${string}`, + address: pool.address as Address, + chainId, + name: `${pool.token0.symbol}-${pool.token1.symbol}`, + swapFee: pool.swapFee, + protocol: SushiSwapProtocol.SUSHISWAP_V3, + reserve0: BigInt(pool.reserve0), + reserve1: BigInt(pool.reserve1), + liquidity: BigInt(pool.liquidity), - const result = await request( - { url, document: V3PoolQuery, variables }, - options, - ) - if (result.v3Pool) { - const incentives = result.v3Pool.incentives.filter((i) => i !== null) - const pool = result.v3Pool - return { - id: pool.id as `${string}:0x${string}`, - address: pool.address as Address, - chainId, - name: `${pool.token0.symbol}-${pool.token1.symbol}`, - swapFee: pool.swapFee, - protocol: SushiSwapProtocol.SUSHISWAP_V3, - reserve0: BigInt(pool.reserve0), - reserve1: BigInt(pool.reserve1), - liquidity: BigInt(pool.liquidity), - - sqrtPrice: BigInt(pool.sqrtPrice), - tick: BigInt(pool.tick), - observationIndex: BigInt(pool.observationIndex), - feeGrowthGlobal0X128: BigInt(pool.feeGrowthGlobal0X128), - feeGrowthGlobal1X128: BigInt(pool.feeGrowthGlobal1X128), + sqrtPrice: BigInt(pool.sqrtPrice), + tick: BigInt(pool.tick), + observationIndex: BigInt(pool.observationIndex), + feeGrowthGlobal0X128: BigInt(pool.feeGrowthGlobal0X128), + feeGrowthGlobal1X128: BigInt(pool.feeGrowthGlobal1X128), - liquidityUSD: pool.liquidityUSD, - volumeUSD: pool.volumeUSD, - feesUSD: pool.volumeUSD * pool.swapFee, + liquidityUSD: pool.liquidityUSD, + volumeUSD: pool.volumeUSD, + feesUSD: pool.volumeUSD * pool.swapFee, - token0: { - id: pool.token0.id as `${string}:0x${string}`, - address: pool.token0.address as Address, - chainId, - decimals: pool.token0.decimals, - name: pool.token0.name, - symbol: pool.token0.symbol, - }, - token1: { - id: pool.token1.id as `${string}:0x${string}`, - address: pool.token1.address as Address, - chainId, - decimals: pool.token1.decimals, - name: pool.token1.name, - symbol: pool.token1.symbol, - }, - token0Price: pool.token0Price, - token1Price: pool.token1Price, - txCount: pool.txCount1d, + token0: { + id: pool.token0.id as `${string}:0x${string}`, + address: pool.token0.address as Address, + chainId, + decimals: pool.token0.decimals, + name: pool.token0.name, + symbol: pool.token0.symbol, + }, + token1: { + id: pool.token1.id as `${string}:0x${string}`, + address: pool.token1.address as Address, + chainId, + decimals: pool.token1.decimals, + name: pool.token1.name, + symbol: pool.token1.symbol, + }, + token0Price: pool.token0Price, + token1Price: pool.token1Price, + txCount: pool.txCount1d, - volumeUSD1d: pool.volumeUSD1d, - feesUSD1d: pool.feeUSD1d, - txCount1d: pool.txCount1d, - liquidityUSD1dChange: pool.liquidityUSD1dChange, - volumeUSD1dChange: pool.volumeUSD1dChange, - feesUSD1dChange: pool.feeUSD1dChange, - txCount1dChange: pool.txCount1dChange, + volumeUSD1d: pool.volumeUSD1d, + feesUSD1d: pool.feeUSD1d, + txCount1d: pool.txCount1d, + liquidityUSD1dChange: pool.liquidityUSD1dChange, + volumeUSD1dChange: pool.volumeUSD1dChange, + feesUSD1dChange: pool.feeUSD1dChange, + txCount1dChange: pool.txCount1dChange, - feeApr1d: pool.feeApr1d, - totalApr1d: pool.totalApr1d, - incentiveApr: pool.incentiveApr, - isIncentivized: pool.isIncentivized, - wasIncentivized: pool.wasIncentivized, - hasEnabledSteerVault: pool.hasSmartPool, - hadEnabledSteerVault: pool.hadSmartPool, + feeApr1d: pool.feeApr1d, + totalApr1d: pool.totalApr1d, + incentiveApr: pool.incentiveApr, + isIncentivized: pool.isIncentivized, + wasIncentivized: pool.wasIncentivized, + hasEnabledSteerVault: pool.hasSmartPool, + hadEnabledSteerVault: pool.hadSmartPool, - incentives: incentives.map((incentive) => ({ - id: incentive.id as `${string}:0x${string}`, - chainId, - chefType: incentive.chefType as ChefType, - apr: incentive.apr, - rewardToken: { - id: incentive.rewardToken.id as `${string}:0x${string}`, - address: incentive.rewardToken.address as Address, + incentives: incentives.map((incentive) => ({ + id: incentive.id as `${string}:0x${string}`, chainId, - decimals: incentive.rewardToken.decimals, - name: incentive.rewardToken.name, - symbol: incentive.rewardToken.symbol, - }, - rewardPerDay: incentive.rewardPerDay, - poolAddress: incentive.poolAddress as Address, - pid: incentive.pid, - rewarderAddress: incentive.rewarderAddress as Address, - rewarderType: incentive.rewarderType as RewarderType, - })), - } satisfies - PoolHasSteerVaults< - PoolWithAprs>> + chefType: incentive.chefType as ChefType, + apr: incentive.apr, + rewardToken: { + id: incentive.rewardToken.id as `${string}:0x${string}`, + address: incentive.rewardToken.address as Address, + chainId, + decimals: incentive.rewardToken.decimals, + name: incentive.rewardToken.name, + symbol: incentive.rewardToken.symbol, + }, + rewardPerDay: incentive.rewardPerDay, + poolAddress: incentive.poolAddress as Address, + pid: incentive.pid, + rewarderAddress: incentive.rewarderAddress as Address, + rewarderType: incentive.rewarderType as RewarderType, + })), + } satisfies PoolHasSteerVaults< + PoolWithAprs>>> > - > - } + } - throw new Error('No pool found') + throw new Error('No pool found') + } catch (_e) { + // console.error(e) + return null + } } -export type V3Pool = Awaited> +export type MaybeV3Pool = Awaited> + +export type V3Pool = NonNullable>> \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts index b80e931813..0307f0f93f 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts @@ -3,6 +3,8 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' import { graphql } from '../../graphql' import { isSteerStrategy, type SteerStrategy } from '@sushiswap/steer-sdk' +import type { ChainId } from 'sushi' +import type { Address } from 'viem' export const SmartPoolsQuery = graphql( ` @@ -63,13 +65,31 @@ export async function getSmartPools( { url, document: SmartPoolsQuery, variables }, options, ) + if (result) { return result.smartPools .filter((v) => isSteerStrategy(v.strategy)) .map((pool) => ({ ...pool, + chainId: pool.chainId as ChainId, id: pool.id as `${string}:0x${string}`, strategy: pool.strategy as SteerStrategy, + token0: { + id: pool.token0.id as `${string}:0x${string}`, + address: pool.token0.address as Address, + chainId: pool.token0.chainId as ChainId, + decimals: pool.token0.decimals, + name: pool.token0.name, + symbol: pool.token0.symbol, + }, + token1: { + id: pool.token1.id as `${string}:0x${string}`, + address: pool.token1.address as Address, + chainId: pool.token1.chainId as ChainId, + decimals: pool.token1.decimals, + name: pool.token1.name, + symbol: pool.token1.symbol, + }, })) } diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts index ab58731d77..8b5f7f882b 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts @@ -1,9 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' -import { - ChainId -} from 'sushi' +import { ChainId } from 'sushi' import { isSushiSwapV2ChainId } from 'sushi/config' import { graphql } from '../../graphql' export const V2PoolBucketsQuery = graphql( @@ -43,19 +41,24 @@ export async function getV2PoolBuckets( if (!isSushiSwapV2ChainId(chainId)) { throw new Error('Invalid chainId') } - - const result = await request( - { url, document: V2PoolBucketsQuery, variables }, - options, - ) - if (result.v2PoolBuckets) { + try { + const result = await request( + { url, document: V2PoolBucketsQuery, variables }, + options, + ) + if (result.v2PoolBuckets) { + return { + hourBuckets: result.v2PoolBuckets.hourBuckets.filter((b) => b !== null), + dayBuckets: result.v2PoolBuckets.dayBuckets.filter((b) => b !== null), + } + } + throw new Error('Invalid response') + } catch { return { - hourBuckets: result.v2PoolBuckets.hourBuckets.filter((b) => b !== null), - dayBuckets: result.v2PoolBuckets.dayBuckets.filter((b) => b !== null), + hourBuckets: [], + dayBuckets: [], } } - - throw new Error('No buckets found') } export type V2PoolBuckets = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts index 46dc6b8a37..7e54ca1c47 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts @@ -1,9 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' -import { - ChainId -} from 'sushi' +import { ChainId } from 'sushi' import { isSushiSwapV3ChainId } from 'sushi/config' import { graphql } from '../../graphql' export const V3PoolBucketsQuery = graphql( @@ -43,19 +41,24 @@ export async function getV3PoolBuckets( if (!isSushiSwapV3ChainId(chainId)) { throw new Error('Invalid chainId') } - - const result = await request( - { url, document: V3PoolBucketsQuery, variables }, - options, - ) - if (result.v3PoolBuckets) { + try { + const result = await request( + { url, document: V3PoolBucketsQuery, variables }, + options, + ) + if (result.v3PoolBuckets) { + return { + hourBuckets: result.v3PoolBuckets.hourBuckets.filter((b) => b !== null), + dayBuckets: result.v3PoolBuckets.dayBuckets.filter((b) => b !== null), + } + } + throw new Error('Invalid response') + } catch { return { - hourBuckets: result.v3PoolBuckets.hourBuckets.filter((b) => b !== null), - dayBuckets: result.v3PoolBuckets.dayBuckets.filter((b) => b !== null), + hourBuckets: [], + dayBuckets: [], } } - - throw new Error('No buckets found') } export type V3PoolBuckets = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts index 3139d2d228..93acb75db4 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts @@ -2,4 +2,5 @@ export * from './buckets' export * from './burns' export * from './collects' export * from './mints' +export * from './pools-by-tokens' export * from './swaps' diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts new file mode 100644 index 0000000000..f61b83ab81 --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts @@ -0,0 +1,124 @@ +import type { VariablesOf } from 'gql.tada' + +import { request, type RequestOptions } from 'src/lib/request' +import { + ChainId, + SushiSwapProtocol, + type PoolBase, + type PoolV3 +} from 'sushi' +import { isSushiSwapV3ChainId } from 'sushi/config' +import type { Address } from 'viem' +import { graphql } from '../../graphql' +export const V3PoolsByTokensQuery = graphql( + ` + query V3PoolsByTokens($token0: String!, $token1: String!, $chainId: Int!) { + v3PoolsByTokens(token0: $token0, token1: $token1, chainId: $chainId) { + id + address + chainId + protocol + name + createdAt + swapFee + token0 { + id + chainId + address + name + symbol + decimals + } + token1 { + id + chainId + address + name + symbol + decimals + } + source + reserve0 + reserve1 + liquidity + token0Price + token1Price + sqrtPrice + tick + observationIndex + feeGrowthGlobal0X128 + feeGrowthGlobal1X128 + volumeUSD + liquidityUSD + feesUSD + txCount + } + } +`, +) + +export type GetV3BasePools = VariablesOf + +export async function getV3BasePoolsByToken( + variables: GetV3BasePools, + options?: RequestOptions, +): Promise[]> { + const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const chainId = Number(variables.chainId) as ChainId + + if (!isSushiSwapV3ChainId(chainId)) { + throw new Error('Invalid chainId') + } + + const result = await request( + { url, document: V3PoolsByTokensQuery, variables }, + options, + ) + if (result.v3PoolsByTokens) { + + return result.v3PoolsByTokens.map((pool) => + ({ + id: pool.id as `${string}:0x${string}`, + address: pool.address as Address, + chainId, + name: pool.name, + swapFee: pool.swapFee, + protocol: SushiSwapProtocol.SUSHISWAP_V3, + token0: { + id: pool.token0.id as `${string}:0x${string}`, + address: pool.token0.address as Address, + chainId, + decimals: pool.token0.decimals, + name: pool.token0.name, + symbol: pool.token0.symbol, + }, + token1: { + id: pool.token1.id as `${string}:0x${string}`, + address: pool.token1.address as Address, + chainId, + decimals: pool.token1.decimals, + name: pool.token1.name, + symbol: pool.token1.symbol, + }, + + reserve0: BigInt(pool.reserve0), + reserve1: BigInt(pool.reserve1), + liquidity: BigInt(pool.liquidity), + token0Price: pool.token0Price, + token1Price: pool.token1Price, + + sqrtPrice: BigInt(pool.sqrtPrice), + tick: BigInt(pool.tick), + observationIndex: BigInt(pool.observationIndex), + feeGrowthGlobal0X128: BigInt(pool.feeGrowthGlobal0X128), + feeGrowthGlobal1X128: BigInt(pool.feeGrowthGlobal1X128), + + liquidityUSD: pool.liquidityUSD, + volumeUSD: pool.volumeUSD, + feesUSD: pool.feesUSD, + txCount: pool.txCount, + } satisfies PoolV3)) + } + + throw new Error('No pool found') +} diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index 939b2f4bd9..e7b3cbef99 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -20,6 +20,7 @@ type Query { v3Pool(address: String!, chainId: Int!): V3Pool! v2PoolBuckets(address: String!, chainId: Int!): PoolBuckets! v3PoolBuckets(address: String!, chainId: Int!): PoolBuckets! + v3PoolsByTokens(token0: String!, token1: String!, chainId: Int!): [V3BasePool!]! portfolioWallet(id: ID!): PortfolioWallet! portfolioLiquidityPositions(id: ID!): PortfolioPositions! portfolioClaimables(id: ID!): PortfolioClaimables! @@ -124,6 +125,33 @@ type V3Pool { vaults: [String!]! } +type V3BasePool { + id: ID! + address: String! + chainId: Int! + protocol: String! + name: String! + createdAt: String! + swapFee: Float! + token0: Token! + token1: Token! + source: String! + reserve0: String! + reserve1: String! + liquidity: String! + token0Price: Float! + token1Price: Float! + sqrtPrice: String! + tick: String! + observationIndex: String! + feeGrowthGlobal0X128: String! + feeGrowthGlobal1X128: String! + volumeUSD: Float! + liquidityUSD: Float! + feesUSD: Float! + txCount: Int! +} + type Incentive { id: ID! chainId: Int! diff --git a/packages/graph-client/src/subgraphs/master-chef-v1/graphql.ts b/packages/graph-client/src/subgraphs/master-chef-v1/graphql.ts deleted file mode 100644 index 36f29587b1..0000000000 --- a/packages/graph-client/src/subgraphs/master-chef-v1/graphql.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { initGraphQLTada } from 'gql.tada' -import type { Scalars } from 'src/lib/types/scalars.js' -import type { introspection } from './master-chef-v1-env.js' - -export const graphql = initGraphQLTada<{ - introspection: introspection - scalars: Scalars -}>() diff --git a/packages/graph-client/src/subgraphs/master-chef-v1/index.ts b/packages/graph-client/src/subgraphs/master-chef-v1/index.ts deleted file mode 100644 index 044b4b733e..0000000000 --- a/packages/graph-client/src/subgraphs/master-chef-v1/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './queries/user-positions' diff --git a/packages/graph-client/src/subgraphs/master-chef-v1/queries/user-positions.ts b/packages/graph-client/src/subgraphs/master-chef-v1/queries/user-positions.ts deleted file mode 100644 index b0eccc5de1..0000000000 --- a/packages/graph-client/src/subgraphs/master-chef-v1/queries/user-positions.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { VariablesOf } from 'gql.tada' - -import { addChainId } from 'src/lib/modifiers/add-chain-id' -import { convertIdToMultichainId } from 'src/lib/modifiers/convert-id-to-multichain-id' -import { copyIdToAddress } from 'src/lib/modifiers/copy-id-to-address' -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import { ChainId } from 'sushi/chain' -import { MASTERCHEF_V1_SUBGRAPH_URL } from 'sushi/config/subgraph' -import { SushiSwapProtocol } from 'sushi/types' -import { graphql } from '../graphql' - -export const MasterChefV1UserPositionsQuery = graphql( - ` - query UserPositions($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: User_orderBy, $orderDirection: OrderDirection, $where: User_filter) { - users(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - address - balance: amount - pool { - id: pair - } - } - } -`, -) - -export type GetMasterChefV1UserPositions = VariablesOf< - typeof MasterChefV1UserPositionsQuery -> - -export async function getMasterChefV1UserPositions( - { ...variables }: GetMasterChefV1UserPositions, - options?: RequestOptions, -) { - const url = `https://${MASTERCHEF_V1_SUBGRAPH_URL}` - - const result = await requestPaged({ - chainId: ChainId.ETHEREUM, - url, - query: MasterChefV1UserPositionsQuery, - variables, - options, - }) - - return result.users.flatMap((position) => { - if (!position.pool) { - return [] - } - - const pool = { - ...convertIdToMultichainId( - copyIdToAddress(addChainId(ChainId.ETHEREUM, position.pool)), - ), - protocol: SushiSwapProtocol.SUSHISWAP_V2, - } - - return { - id: position.id, - address: position.address, - balance: position.balance, - pool, - } - }) -} - -export type MasterChefV1UserPositions = Awaited< - ReturnType -> diff --git a/packages/graph-client/src/subgraphs/master-chef-v1/schema.graphql b/packages/graph-client/src/subgraphs/master-chef-v1/schema.graphql deleted file mode 100644 index 59c46fbb5d..0000000000 --- a/packages/graph-client/src/subgraphs/master-chef-v1/schema.graphql +++ /dev/null @@ -1,1318 +0,0 @@ -""" -Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive. -""" -directive @entity on OBJECT - -"""Defined a Subgraph ID for an object type""" -directive @subgraphId(id: String!) on OBJECT - -""" -creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API. -""" -directive @derivedFrom(field: String!) on FIELD_DEFINITION - -enum Aggregation_interval { - hour - day -} - -scalar BigDecimal - -scalar BigInt - -input BlockChangedFilter { - number_gte: Int! -} - -input Block_height { - hash: Bytes - number: Int - number_gte: Int -} - -scalar Bytes - -type History { - id: ID! - owner: MasterChef! - slpBalance: BigDecimal! - slpAge: BigDecimal! - slpAgeRemoved: BigDecimal! - slpDeposited: BigDecimal! - slpWithdrawn: BigDecimal! - timestamp: BigInt! - block: BigInt! -} - -input History_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - owner: String - owner_not: String - owner_gt: String - owner_lt: String - owner_gte: String - owner_lte: String - owner_in: [String!] - owner_not_in: [String!] - owner_contains: String - owner_contains_nocase: String - owner_not_contains: String - owner_not_contains_nocase: String - owner_starts_with: String - owner_starts_with_nocase: String - owner_not_starts_with: String - owner_not_starts_with_nocase: String - owner_ends_with: String - owner_ends_with_nocase: String - owner_not_ends_with: String - owner_not_ends_with_nocase: String - owner_: MasterChef_filter - slpBalance: BigDecimal - slpBalance_not: BigDecimal - slpBalance_gt: BigDecimal - slpBalance_lt: BigDecimal - slpBalance_gte: BigDecimal - slpBalance_lte: BigDecimal - slpBalance_in: [BigDecimal!] - slpBalance_not_in: [BigDecimal!] - slpAge: BigDecimal - slpAge_not: BigDecimal - slpAge_gt: BigDecimal - slpAge_lt: BigDecimal - slpAge_gte: BigDecimal - slpAge_lte: BigDecimal - slpAge_in: [BigDecimal!] - slpAge_not_in: [BigDecimal!] - slpAgeRemoved: BigDecimal - slpAgeRemoved_not: BigDecimal - slpAgeRemoved_gt: BigDecimal - slpAgeRemoved_lt: BigDecimal - slpAgeRemoved_gte: BigDecimal - slpAgeRemoved_lte: BigDecimal - slpAgeRemoved_in: [BigDecimal!] - slpAgeRemoved_not_in: [BigDecimal!] - slpDeposited: BigDecimal - slpDeposited_not: BigDecimal - slpDeposited_gt: BigDecimal - slpDeposited_lt: BigDecimal - slpDeposited_gte: BigDecimal - slpDeposited_lte: BigDecimal - slpDeposited_in: [BigDecimal!] - slpDeposited_not_in: [BigDecimal!] - slpWithdrawn: BigDecimal - slpWithdrawn_not: BigDecimal - slpWithdrawn_gt: BigDecimal - slpWithdrawn_lt: BigDecimal - slpWithdrawn_gte: BigDecimal - slpWithdrawn_lte: BigDecimal - slpWithdrawn_in: [BigDecimal!] - slpWithdrawn_not_in: [BigDecimal!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [History_filter] - or: [History_filter] -} - -enum History_orderBy { - id - owner - owner__id - owner__bonusMultiplier - owner__bonusEndBlock - owner__devaddr - owner__migrator - owner__owner - owner__startBlock - owner__sushi - owner__sushiPerBlock - owner__totalAllocPoint - owner__poolCount - owner__slpBalance - owner__slpAge - owner__slpAgeRemoved - owner__slpDeposited - owner__slpWithdrawn - owner__updatedAt - slpBalance - slpAge - slpAgeRemoved - slpDeposited - slpWithdrawn - timestamp - block -} - -"8 bytes signed integer\n" -scalar Int8 - -type MasterChef { - id: ID! - bonusMultiplier: BigInt! - bonusEndBlock: BigInt! - devaddr: Bytes! - migrator: Bytes! - owner: Bytes! - startBlock: BigInt! - sushi: Bytes! - sushiPerBlock: BigInt! - totalAllocPoint: BigInt! - pools(skip: Int = 0, first: Int = 100, orderBy: Pool_orderBy, orderDirection: OrderDirection, where: Pool_filter): [Pool!]! - poolCount: BigInt! - slpBalance: BigDecimal! - slpAge: BigDecimal! - slpAgeRemoved: BigDecimal! - slpDeposited: BigDecimal! - slpWithdrawn: BigDecimal! - history(skip: Int = 0, first: Int = 100, orderBy: History_orderBy, orderDirection: OrderDirection, where: History_filter): [History!]! - updatedAt: BigInt! -} - -input MasterChef_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - bonusMultiplier: BigInt - bonusMultiplier_not: BigInt - bonusMultiplier_gt: BigInt - bonusMultiplier_lt: BigInt - bonusMultiplier_gte: BigInt - bonusMultiplier_lte: BigInt - bonusMultiplier_in: [BigInt!] - bonusMultiplier_not_in: [BigInt!] - bonusEndBlock: BigInt - bonusEndBlock_not: BigInt - bonusEndBlock_gt: BigInt - bonusEndBlock_lt: BigInt - bonusEndBlock_gte: BigInt - bonusEndBlock_lte: BigInt - bonusEndBlock_in: [BigInt!] - bonusEndBlock_not_in: [BigInt!] - devaddr: Bytes - devaddr_not: Bytes - devaddr_gt: Bytes - devaddr_lt: Bytes - devaddr_gte: Bytes - devaddr_lte: Bytes - devaddr_in: [Bytes!] - devaddr_not_in: [Bytes!] - devaddr_contains: Bytes - devaddr_not_contains: Bytes - migrator: Bytes - migrator_not: Bytes - migrator_gt: Bytes - migrator_lt: Bytes - migrator_gte: Bytes - migrator_lte: Bytes - migrator_in: [Bytes!] - migrator_not_in: [Bytes!] - migrator_contains: Bytes - migrator_not_contains: Bytes - owner: Bytes - owner_not: Bytes - owner_gt: Bytes - owner_lt: Bytes - owner_gte: Bytes - owner_lte: Bytes - owner_in: [Bytes!] - owner_not_in: [Bytes!] - owner_contains: Bytes - owner_not_contains: Bytes - startBlock: BigInt - startBlock_not: BigInt - startBlock_gt: BigInt - startBlock_lt: BigInt - startBlock_gte: BigInt - startBlock_lte: BigInt - startBlock_in: [BigInt!] - startBlock_not_in: [BigInt!] - sushi: Bytes - sushi_not: Bytes - sushi_gt: Bytes - sushi_lt: Bytes - sushi_gte: Bytes - sushi_lte: Bytes - sushi_in: [Bytes!] - sushi_not_in: [Bytes!] - sushi_contains: Bytes - sushi_not_contains: Bytes - sushiPerBlock: BigInt - sushiPerBlock_not: BigInt - sushiPerBlock_gt: BigInt - sushiPerBlock_lt: BigInt - sushiPerBlock_gte: BigInt - sushiPerBlock_lte: BigInt - sushiPerBlock_in: [BigInt!] - sushiPerBlock_not_in: [BigInt!] - totalAllocPoint: BigInt - totalAllocPoint_not: BigInt - totalAllocPoint_gt: BigInt - totalAllocPoint_lt: BigInt - totalAllocPoint_gte: BigInt - totalAllocPoint_lte: BigInt - totalAllocPoint_in: [BigInt!] - totalAllocPoint_not_in: [BigInt!] - pools_: Pool_filter - poolCount: BigInt - poolCount_not: BigInt - poolCount_gt: BigInt - poolCount_lt: BigInt - poolCount_gte: BigInt - poolCount_lte: BigInt - poolCount_in: [BigInt!] - poolCount_not_in: [BigInt!] - slpBalance: BigDecimal - slpBalance_not: BigDecimal - slpBalance_gt: BigDecimal - slpBalance_lt: BigDecimal - slpBalance_gte: BigDecimal - slpBalance_lte: BigDecimal - slpBalance_in: [BigDecimal!] - slpBalance_not_in: [BigDecimal!] - slpAge: BigDecimal - slpAge_not: BigDecimal - slpAge_gt: BigDecimal - slpAge_lt: BigDecimal - slpAge_gte: BigDecimal - slpAge_lte: BigDecimal - slpAge_in: [BigDecimal!] - slpAge_not_in: [BigDecimal!] - slpAgeRemoved: BigDecimal - slpAgeRemoved_not: BigDecimal - slpAgeRemoved_gt: BigDecimal - slpAgeRemoved_lt: BigDecimal - slpAgeRemoved_gte: BigDecimal - slpAgeRemoved_lte: BigDecimal - slpAgeRemoved_in: [BigDecimal!] - slpAgeRemoved_not_in: [BigDecimal!] - slpDeposited: BigDecimal - slpDeposited_not: BigDecimal - slpDeposited_gt: BigDecimal - slpDeposited_lt: BigDecimal - slpDeposited_gte: BigDecimal - slpDeposited_lte: BigDecimal - slpDeposited_in: [BigDecimal!] - slpDeposited_not_in: [BigDecimal!] - slpWithdrawn: BigDecimal - slpWithdrawn_not: BigDecimal - slpWithdrawn_gt: BigDecimal - slpWithdrawn_lt: BigDecimal - slpWithdrawn_gte: BigDecimal - slpWithdrawn_lte: BigDecimal - slpWithdrawn_in: [BigDecimal!] - slpWithdrawn_not_in: [BigDecimal!] - history_: History_filter - updatedAt: BigInt - updatedAt_not: BigInt - updatedAt_gt: BigInt - updatedAt_lt: BigInt - updatedAt_gte: BigInt - updatedAt_lte: BigInt - updatedAt_in: [BigInt!] - updatedAt_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [MasterChef_filter] - or: [MasterChef_filter] -} - -enum MasterChef_orderBy { - id - bonusMultiplier - bonusEndBlock - devaddr - migrator - owner - startBlock - sushi - sushiPerBlock - totalAllocPoint - pools - poolCount - slpBalance - slpAge - slpAgeRemoved - slpDeposited - slpWithdrawn - history - updatedAt -} - -"""Defines the order direction, either ascending or descending""" -enum OrderDirection { - asc - desc -} - -type Pool { - id: ID! - owner: MasterChef! - pair: Bytes! - allocPoint: BigInt! - lastRewardBlock: BigInt! - accSushiPerShare: BigInt! - balance: BigInt! - users(skip: Int = 0, first: Int = 100, orderBy: User_orderBy, orderDirection: OrderDirection, where: User_filter): [User!]! - userCount: BigInt! - slpBalance: BigDecimal! - slpAge: BigDecimal! - slpAgeRemoved: BigDecimal! - slpDeposited: BigDecimal! - slpWithdrawn: BigDecimal! - timestamp: BigInt! - block: BigInt! - updatedAt: BigInt! - entryUSD: BigDecimal! - exitUSD: BigDecimal! - sushiHarvested: BigDecimal! - sushiHarvestedUSD: BigDecimal! -} - -type PoolHistory { - id: ID! - pool: Pool! - slpBalance: BigDecimal! - slpAge: BigDecimal! - slpAgeRemoved: BigDecimal! - slpDeposited: BigDecimal! - slpWithdrawn: BigDecimal! - userCount: BigInt! - timestamp: BigInt! - block: BigInt! - entryUSD: BigDecimal! - exitUSD: BigDecimal! - sushiHarvested: BigDecimal! - sushiHarvestedUSD: BigDecimal! -} - -input PoolHistory_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - slpBalance: BigDecimal - slpBalance_not: BigDecimal - slpBalance_gt: BigDecimal - slpBalance_lt: BigDecimal - slpBalance_gte: BigDecimal - slpBalance_lte: BigDecimal - slpBalance_in: [BigDecimal!] - slpBalance_not_in: [BigDecimal!] - slpAge: BigDecimal - slpAge_not: BigDecimal - slpAge_gt: BigDecimal - slpAge_lt: BigDecimal - slpAge_gte: BigDecimal - slpAge_lte: BigDecimal - slpAge_in: [BigDecimal!] - slpAge_not_in: [BigDecimal!] - slpAgeRemoved: BigDecimal - slpAgeRemoved_not: BigDecimal - slpAgeRemoved_gt: BigDecimal - slpAgeRemoved_lt: BigDecimal - slpAgeRemoved_gte: BigDecimal - slpAgeRemoved_lte: BigDecimal - slpAgeRemoved_in: [BigDecimal!] - slpAgeRemoved_not_in: [BigDecimal!] - slpDeposited: BigDecimal - slpDeposited_not: BigDecimal - slpDeposited_gt: BigDecimal - slpDeposited_lt: BigDecimal - slpDeposited_gte: BigDecimal - slpDeposited_lte: BigDecimal - slpDeposited_in: [BigDecimal!] - slpDeposited_not_in: [BigDecimal!] - slpWithdrawn: BigDecimal - slpWithdrawn_not: BigDecimal - slpWithdrawn_gt: BigDecimal - slpWithdrawn_lt: BigDecimal - slpWithdrawn_gte: BigDecimal - slpWithdrawn_lte: BigDecimal - slpWithdrawn_in: [BigDecimal!] - slpWithdrawn_not_in: [BigDecimal!] - userCount: BigInt - userCount_not: BigInt - userCount_gt: BigInt - userCount_lt: BigInt - userCount_gte: BigInt - userCount_lte: BigInt - userCount_in: [BigInt!] - userCount_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - entryUSD: BigDecimal - entryUSD_not: BigDecimal - entryUSD_gt: BigDecimal - entryUSD_lt: BigDecimal - entryUSD_gte: BigDecimal - entryUSD_lte: BigDecimal - entryUSD_in: [BigDecimal!] - entryUSD_not_in: [BigDecimal!] - exitUSD: BigDecimal - exitUSD_not: BigDecimal - exitUSD_gt: BigDecimal - exitUSD_lt: BigDecimal - exitUSD_gte: BigDecimal - exitUSD_lte: BigDecimal - exitUSD_in: [BigDecimal!] - exitUSD_not_in: [BigDecimal!] - sushiHarvested: BigDecimal - sushiHarvested_not: BigDecimal - sushiHarvested_gt: BigDecimal - sushiHarvested_lt: BigDecimal - sushiHarvested_gte: BigDecimal - sushiHarvested_lte: BigDecimal - sushiHarvested_in: [BigDecimal!] - sushiHarvested_not_in: [BigDecimal!] - sushiHarvestedUSD: BigDecimal - sushiHarvestedUSD_not: BigDecimal - sushiHarvestedUSD_gt: BigDecimal - sushiHarvestedUSD_lt: BigDecimal - sushiHarvestedUSD_gte: BigDecimal - sushiHarvestedUSD_lte: BigDecimal - sushiHarvestedUSD_in: [BigDecimal!] - sushiHarvestedUSD_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PoolHistory_filter] - or: [PoolHistory_filter] -} - -enum PoolHistory_orderBy { - id - pool - pool__id - pool__pair - pool__allocPoint - pool__lastRewardBlock - pool__accSushiPerShare - pool__balance - pool__userCount - pool__slpBalance - pool__slpAge - pool__slpAgeRemoved - pool__slpDeposited - pool__slpWithdrawn - pool__timestamp - pool__block - pool__updatedAt - pool__entryUSD - pool__exitUSD - pool__sushiHarvested - pool__sushiHarvestedUSD - slpBalance - slpAge - slpAgeRemoved - slpDeposited - slpWithdrawn - userCount - timestamp - block - entryUSD - exitUSD - sushiHarvested - sushiHarvestedUSD -} - -input Pool_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - owner: String - owner_not: String - owner_gt: String - owner_lt: String - owner_gte: String - owner_lte: String - owner_in: [String!] - owner_not_in: [String!] - owner_contains: String - owner_contains_nocase: String - owner_not_contains: String - owner_not_contains_nocase: String - owner_starts_with: String - owner_starts_with_nocase: String - owner_not_starts_with: String - owner_not_starts_with_nocase: String - owner_ends_with: String - owner_ends_with_nocase: String - owner_not_ends_with: String - owner_not_ends_with_nocase: String - owner_: MasterChef_filter - pair: Bytes - pair_not: Bytes - pair_gt: Bytes - pair_lt: Bytes - pair_gte: Bytes - pair_lte: Bytes - pair_in: [Bytes!] - pair_not_in: [Bytes!] - pair_contains: Bytes - pair_not_contains: Bytes - allocPoint: BigInt - allocPoint_not: BigInt - allocPoint_gt: BigInt - allocPoint_lt: BigInt - allocPoint_gte: BigInt - allocPoint_lte: BigInt - allocPoint_in: [BigInt!] - allocPoint_not_in: [BigInt!] - lastRewardBlock: BigInt - lastRewardBlock_not: BigInt - lastRewardBlock_gt: BigInt - lastRewardBlock_lt: BigInt - lastRewardBlock_gte: BigInt - lastRewardBlock_lte: BigInt - lastRewardBlock_in: [BigInt!] - lastRewardBlock_not_in: [BigInt!] - accSushiPerShare: BigInt - accSushiPerShare_not: BigInt - accSushiPerShare_gt: BigInt - accSushiPerShare_lt: BigInt - accSushiPerShare_gte: BigInt - accSushiPerShare_lte: BigInt - accSushiPerShare_in: [BigInt!] - accSushiPerShare_not_in: [BigInt!] - balance: BigInt - balance_not: BigInt - balance_gt: BigInt - balance_lt: BigInt - balance_gte: BigInt - balance_lte: BigInt - balance_in: [BigInt!] - balance_not_in: [BigInt!] - users_: User_filter - userCount: BigInt - userCount_not: BigInt - userCount_gt: BigInt - userCount_lt: BigInt - userCount_gte: BigInt - userCount_lte: BigInt - userCount_in: [BigInt!] - userCount_not_in: [BigInt!] - slpBalance: BigDecimal - slpBalance_not: BigDecimal - slpBalance_gt: BigDecimal - slpBalance_lt: BigDecimal - slpBalance_gte: BigDecimal - slpBalance_lte: BigDecimal - slpBalance_in: [BigDecimal!] - slpBalance_not_in: [BigDecimal!] - slpAge: BigDecimal - slpAge_not: BigDecimal - slpAge_gt: BigDecimal - slpAge_lt: BigDecimal - slpAge_gte: BigDecimal - slpAge_lte: BigDecimal - slpAge_in: [BigDecimal!] - slpAge_not_in: [BigDecimal!] - slpAgeRemoved: BigDecimal - slpAgeRemoved_not: BigDecimal - slpAgeRemoved_gt: BigDecimal - slpAgeRemoved_lt: BigDecimal - slpAgeRemoved_gte: BigDecimal - slpAgeRemoved_lte: BigDecimal - slpAgeRemoved_in: [BigDecimal!] - slpAgeRemoved_not_in: [BigDecimal!] - slpDeposited: BigDecimal - slpDeposited_not: BigDecimal - slpDeposited_gt: BigDecimal - slpDeposited_lt: BigDecimal - slpDeposited_gte: BigDecimal - slpDeposited_lte: BigDecimal - slpDeposited_in: [BigDecimal!] - slpDeposited_not_in: [BigDecimal!] - slpWithdrawn: BigDecimal - slpWithdrawn_not: BigDecimal - slpWithdrawn_gt: BigDecimal - slpWithdrawn_lt: BigDecimal - slpWithdrawn_gte: BigDecimal - slpWithdrawn_lte: BigDecimal - slpWithdrawn_in: [BigDecimal!] - slpWithdrawn_not_in: [BigDecimal!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - updatedAt: BigInt - updatedAt_not: BigInt - updatedAt_gt: BigInt - updatedAt_lt: BigInt - updatedAt_gte: BigInt - updatedAt_lte: BigInt - updatedAt_in: [BigInt!] - updatedAt_not_in: [BigInt!] - entryUSD: BigDecimal - entryUSD_not: BigDecimal - entryUSD_gt: BigDecimal - entryUSD_lt: BigDecimal - entryUSD_gte: BigDecimal - entryUSD_lte: BigDecimal - entryUSD_in: [BigDecimal!] - entryUSD_not_in: [BigDecimal!] - exitUSD: BigDecimal - exitUSD_not: BigDecimal - exitUSD_gt: BigDecimal - exitUSD_lt: BigDecimal - exitUSD_gte: BigDecimal - exitUSD_lte: BigDecimal - exitUSD_in: [BigDecimal!] - exitUSD_not_in: [BigDecimal!] - sushiHarvested: BigDecimal - sushiHarvested_not: BigDecimal - sushiHarvested_gt: BigDecimal - sushiHarvested_lt: BigDecimal - sushiHarvested_gte: BigDecimal - sushiHarvested_lte: BigDecimal - sushiHarvested_in: [BigDecimal!] - sushiHarvested_not_in: [BigDecimal!] - sushiHarvestedUSD: BigDecimal - sushiHarvestedUSD_not: BigDecimal - sushiHarvestedUSD_gt: BigDecimal - sushiHarvestedUSD_lt: BigDecimal - sushiHarvestedUSD_gte: BigDecimal - sushiHarvestedUSD_lte: BigDecimal - sushiHarvestedUSD_in: [BigDecimal!] - sushiHarvestedUSD_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Pool_filter] - or: [Pool_filter] -} - -enum Pool_orderBy { - id - owner - owner__id - owner__bonusMultiplier - owner__bonusEndBlock - owner__devaddr - owner__migrator - owner__owner - owner__startBlock - owner__sushi - owner__sushiPerBlock - owner__totalAllocPoint - owner__poolCount - owner__slpBalance - owner__slpAge - owner__slpAgeRemoved - owner__slpDeposited - owner__slpWithdrawn - owner__updatedAt - pair - allocPoint - lastRewardBlock - accSushiPerShare - balance - users - userCount - slpBalance - slpAge - slpAgeRemoved - slpDeposited - slpWithdrawn - timestamp - block - updatedAt - entryUSD - exitUSD - sushiHarvested - sushiHarvestedUSD -} - -type Query { - masterChef( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): MasterChef - masterChefs( - skip: Int = 0 - first: Int = 100 - orderBy: MasterChef_orderBy - orderDirection: OrderDirection - where: MasterChef_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [MasterChef!]! - history( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): History - histories( - skip: Int = 0 - first: Int = 100 - orderBy: History_orderBy - orderDirection: OrderDirection - where: History_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [History!]! - pool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pool - pools( - skip: Int = 0 - first: Int = 100 - orderBy: Pool_orderBy - orderDirection: OrderDirection - where: Pool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pool!]! - poolHistory( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PoolHistory - poolHistories( - skip: Int = 0 - first: Int = 100 - orderBy: PoolHistory_orderBy - orderDirection: OrderDirection - where: PoolHistory_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PoolHistory!]! - user( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): User - users( - skip: Int = 0 - first: Int = 100 - orderBy: User_orderBy - orderDirection: OrderDirection - where: User_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [User!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type Subscription { - masterChef( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): MasterChef - masterChefs( - skip: Int = 0 - first: Int = 100 - orderBy: MasterChef_orderBy - orderDirection: OrderDirection - where: MasterChef_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [MasterChef!]! - history( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): History - histories( - skip: Int = 0 - first: Int = 100 - orderBy: History_orderBy - orderDirection: OrderDirection - where: History_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [History!]! - pool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pool - pools( - skip: Int = 0 - first: Int = 100 - orderBy: Pool_orderBy - orderDirection: OrderDirection - where: Pool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pool!]! - poolHistory( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PoolHistory - poolHistories( - skip: Int = 0 - first: Int = 100 - orderBy: PoolHistory_orderBy - orderDirection: OrderDirection - where: PoolHistory_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PoolHistory!]! - user( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): User - users( - skip: Int = 0 - first: Int = 100 - orderBy: User_orderBy - orderDirection: OrderDirection - where: User_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [User!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -"A string representation of microseconds UNIX timestamp (16 digits)\n" -scalar Timestamp - -type User { - id: ID! - address: Bytes! - pool: Pool - amount: BigInt! - rewardDebt: BigInt! - entryUSD: BigDecimal! - exitUSD: BigDecimal! - sushiHarvested: BigDecimal! - sushiHarvestedUSD: BigDecimal! - timestamp: BigInt! - block: BigInt! -} - -input User_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - address: Bytes - address_not: Bytes - address_gt: Bytes - address_lt: Bytes - address_gte: Bytes - address_lte: Bytes - address_in: [Bytes!] - address_not_in: [Bytes!] - address_contains: Bytes - address_not_contains: Bytes - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - rewardDebt: BigInt - rewardDebt_not: BigInt - rewardDebt_gt: BigInt - rewardDebt_lt: BigInt - rewardDebt_gte: BigInt - rewardDebt_lte: BigInt - rewardDebt_in: [BigInt!] - rewardDebt_not_in: [BigInt!] - entryUSD: BigDecimal - entryUSD_not: BigDecimal - entryUSD_gt: BigDecimal - entryUSD_lt: BigDecimal - entryUSD_gte: BigDecimal - entryUSD_lte: BigDecimal - entryUSD_in: [BigDecimal!] - entryUSD_not_in: [BigDecimal!] - exitUSD: BigDecimal - exitUSD_not: BigDecimal - exitUSD_gt: BigDecimal - exitUSD_lt: BigDecimal - exitUSD_gte: BigDecimal - exitUSD_lte: BigDecimal - exitUSD_in: [BigDecimal!] - exitUSD_not_in: [BigDecimal!] - sushiHarvested: BigDecimal - sushiHarvested_not: BigDecimal - sushiHarvested_gt: BigDecimal - sushiHarvested_lt: BigDecimal - sushiHarvested_gte: BigDecimal - sushiHarvested_lte: BigDecimal - sushiHarvested_in: [BigDecimal!] - sushiHarvested_not_in: [BigDecimal!] - sushiHarvestedUSD: BigDecimal - sushiHarvestedUSD_not: BigDecimal - sushiHarvestedUSD_gt: BigDecimal - sushiHarvestedUSD_lt: BigDecimal - sushiHarvestedUSD_gte: BigDecimal - sushiHarvestedUSD_lte: BigDecimal - sushiHarvestedUSD_in: [BigDecimal!] - sushiHarvestedUSD_not_in: [BigDecimal!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [User_filter] - or: [User_filter] -} - -enum User_orderBy { - id - address - pool - pool__id - pool__pair - pool__allocPoint - pool__lastRewardBlock - pool__accSushiPerShare - pool__balance - pool__userCount - pool__slpBalance - pool__slpAge - pool__slpAgeRemoved - pool__slpDeposited - pool__slpWithdrawn - pool__timestamp - pool__block - pool__updatedAt - pool__entryUSD - pool__exitUSD - pool__sushiHarvested - pool__sushiHarvestedUSD - amount - rewardDebt - entryUSD - exitUSD - sushiHarvested - sushiHarvestedUSD - timestamp - block -} - -type _Block_ { - """The hash of the block""" - hash: Bytes - - """The block number""" - number: Int! - - """Integer representation of the timestamp stored in blocks for the chain""" - timestamp: Int - - """The hash of the parent block""" - parentHash: Bytes -} - -"""The type for the top-level _meta field""" -type _Meta_ { - "Information about a specific subgraph block. The hash of the block\nwill be null if the _meta field has a block constraint that asks for\na block number. It will be filled if the _meta field has no block constraint\nand therefore asks for the latest block\n" - block: _Block_! - - """The deployment ID""" - deployment: String! - - """If `true`, the subgraph encountered indexing errors at some past block""" - hasIndexingErrors: Boolean! -} - -enum _SubgraphErrorPolicy_ { - """Data will be returned even if the subgraph has indexing errors""" - allow - - """ - If the subgraph has indexing errors, data will be omitted. The default. - """ - deny -} \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/master-chef-v2/graphql.ts b/packages/graph-client/src/subgraphs/master-chef-v2/graphql.ts deleted file mode 100644 index 81d0ae2967..0000000000 --- a/packages/graph-client/src/subgraphs/master-chef-v2/graphql.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { initGraphQLTada } from 'gql.tada' -import type { Scalars } from 'src/lib/types/scalars.js' -import type { introspection } from './master-chef-v2-env.js' - -export const graphql = initGraphQLTada<{ - introspection: introspection - scalars: Scalars -}>() diff --git a/packages/graph-client/src/subgraphs/master-chef-v2/index.ts b/packages/graph-client/src/subgraphs/master-chef-v2/index.ts deleted file mode 100644 index b161405c5e..0000000000 --- a/packages/graph-client/src/subgraphs/master-chef-v2/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './queries/user-positions' -export * from './queries/rewarders' diff --git a/packages/graph-client/src/subgraphs/master-chef-v2/queries/rewarders.ts b/packages/graph-client/src/subgraphs/master-chef-v2/queries/rewarders.ts deleted file mode 100644 index 169faf4e33..0000000000 --- a/packages/graph-client/src/subgraphs/master-chef-v2/queries/rewarders.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import { ChainId } from 'sushi/chain' -import { MASTERCHEF_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import { graphql } from '../graphql' - -export const MasterChefV2RewardersQuery = graphql( - ` - query MasterChefV2Rewarders( - $first: Int = 1000 - $skip: Int = 0 - $where: Rewarder_filter - $block: Block_height - ) { - rewarders(first: $first, skip: $skip, where: $where, block: $block) { - id - rewardToken - rewardPerSecond - } - } -`, -) - -export type GetMasterChefV2Rewarders = VariablesOf< - typeof MasterChefV2RewardersQuery -> - -export async function getMasterChefV2Rewarders( - { ...variables }: GetMasterChefV2Rewarders, - options?: RequestOptions, -) { - const url = `https://${MASTERCHEF_V2_SUBGRAPH_URL}` - - const result = await requestPaged({ - chainId: ChainId.ETHEREUM, - url, - query: MasterChefV2RewardersQuery, - variables, - options, - }) - - return result.rewarders.map((rewarder) => { - // TODO: multichain id for rewardToken? - return { - id: rewarder.id, - address: rewarder.rewardToken, - rewardPerSecond: BigInt(rewarder.rewardPerSecond), - } - }) -} - -export type MasterChefV2Rewarders = Awaited< - ReturnType -> diff --git a/packages/graph-client/src/subgraphs/master-chef-v2/queries/user-positions.ts b/packages/graph-client/src/subgraphs/master-chef-v2/queries/user-positions.ts deleted file mode 100644 index a3759e7c5c..0000000000 --- a/packages/graph-client/src/subgraphs/master-chef-v2/queries/user-positions.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import { ChainId } from 'sushi/chain' -import { MASTERCHEF_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import { addChainId } from 'src/lib/modifiers/add-chain-id' -import { convertIdToMultichainId } from 'src/lib/modifiers/convert-id-to-multichain-id' -import { copyIdToAddress } from 'src/lib/modifiers/copy-id-to-address' -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import { SushiSwapProtocol } from 'sushi' -import { graphql } from '../graphql' - -export const MasterChefV2UserPositionsQuery = graphql( - ` - query UserPositions($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: User_orderBy, $orderDirection: OrderDirection, $where: User_filter) { - users(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - address - balance: amount - pool { - id: pair - } - } - } -`, -) - -export type GetMasterChefV2UserPositions = VariablesOf< - typeof MasterChefV2UserPositionsQuery -> - -export async function getMasterChefV2UserPositions( - { ...variables }: GetMasterChefV2UserPositions, - options?: RequestOptions, -) { - const url = `https://${MASTERCHEF_V2_SUBGRAPH_URL}` - - const result = await requestPaged({ - chainId: ChainId.ETHEREUM, - url, - query: MasterChefV2UserPositionsQuery, - variables, - options, - }) - - return result.users.flatMap((position) => { - if (!position.pool) { - return [] - } - - const pool = { - ...convertIdToMultichainId( - copyIdToAddress(addChainId(ChainId.ETHEREUM, position.pool)), - ), - protocol: SushiSwapProtocol.SUSHISWAP_V2, - } - - return { - id: position.id, - address: position.address, - balance: position.balance, - pool, - } - }) -} - -export type MasterChefV2UserPositions = Awaited< - ReturnType -> diff --git a/packages/graph-client/src/subgraphs/master-chef-v2/schema.graphql b/packages/graph-client/src/subgraphs/master-chef-v2/schema.graphql deleted file mode 100644 index 9b8d761688..0000000000 --- a/packages/graph-client/src/subgraphs/master-chef-v2/schema.graphql +++ /dev/null @@ -1,749 +0,0 @@ -""" -Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive. -""" -directive @entity on OBJECT - -"""Defined a Subgraph ID for an object type""" -directive @subgraphId(id: String!) on OBJECT - -""" -creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API. -""" -directive @derivedFrom(field: String!) on FIELD_DEFINITION - -enum Aggregation_interval { - hour - day -} - -scalar BigDecimal - -scalar BigInt - -input BlockChangedFilter { - number_gte: Int! -} - -input Block_height { - hash: Bytes - number: Int - number_gte: Int -} - -scalar Bytes - -"8 bytes signed integer\n" -scalar Int8 - -type MasterChef { - id: ID! - totalAllocPoint: BigInt! - pools(skip: Int = 0, first: Int = 100, orderBy: Pool_orderBy, orderDirection: OrderDirection, where: Pool_filter): [Pool!] - poolCount: BigInt! - timestamp: BigInt! - block: BigInt! -} - -input MasterChef_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - totalAllocPoint: BigInt - totalAllocPoint_not: BigInt - totalAllocPoint_gt: BigInt - totalAllocPoint_lt: BigInt - totalAllocPoint_gte: BigInt - totalAllocPoint_lte: BigInt - totalAllocPoint_in: [BigInt!] - totalAllocPoint_not_in: [BigInt!] - pools_: Pool_filter - poolCount: BigInt - poolCount_not: BigInt - poolCount_gt: BigInt - poolCount_lt: BigInt - poolCount_gte: BigInt - poolCount_lte: BigInt - poolCount_in: [BigInt!] - poolCount_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [MasterChef_filter] - or: [MasterChef_filter] -} - -enum MasterChef_orderBy { - id - totalAllocPoint - pools - poolCount - timestamp - block -} - -"""Defines the order direction, either ascending or descending""" -enum OrderDirection { - asc - desc -} - -type Pool { - id: ID! - masterChef: MasterChef! - pair: Bytes! - rewarder: Rewarder - allocPoint: BigInt! - lastRewardBlock: BigInt! - accSushiPerShare: BigInt! - slpBalance: BigInt! - users(skip: Int = 0, first: Int = 100, orderBy: User_orderBy, orderDirection: OrderDirection, where: User_filter): [User!]! - userCount: BigInt! - timestamp: BigInt! - block: BigInt! -} - -input Pool_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - masterChef: String - masterChef_not: String - masterChef_gt: String - masterChef_lt: String - masterChef_gte: String - masterChef_lte: String - masterChef_in: [String!] - masterChef_not_in: [String!] - masterChef_contains: String - masterChef_contains_nocase: String - masterChef_not_contains: String - masterChef_not_contains_nocase: String - masterChef_starts_with: String - masterChef_starts_with_nocase: String - masterChef_not_starts_with: String - masterChef_not_starts_with_nocase: String - masterChef_ends_with: String - masterChef_ends_with_nocase: String - masterChef_not_ends_with: String - masterChef_not_ends_with_nocase: String - masterChef_: MasterChef_filter - pair: Bytes - pair_not: Bytes - pair_gt: Bytes - pair_lt: Bytes - pair_gte: Bytes - pair_lte: Bytes - pair_in: [Bytes!] - pair_not_in: [Bytes!] - pair_contains: Bytes - pair_not_contains: Bytes - rewarder: String - rewarder_not: String - rewarder_gt: String - rewarder_lt: String - rewarder_gte: String - rewarder_lte: String - rewarder_in: [String!] - rewarder_not_in: [String!] - rewarder_contains: String - rewarder_contains_nocase: String - rewarder_not_contains: String - rewarder_not_contains_nocase: String - rewarder_starts_with: String - rewarder_starts_with_nocase: String - rewarder_not_starts_with: String - rewarder_not_starts_with_nocase: String - rewarder_ends_with: String - rewarder_ends_with_nocase: String - rewarder_not_ends_with: String - rewarder_not_ends_with_nocase: String - rewarder_: Rewarder_filter - allocPoint: BigInt - allocPoint_not: BigInt - allocPoint_gt: BigInt - allocPoint_lt: BigInt - allocPoint_gte: BigInt - allocPoint_lte: BigInt - allocPoint_in: [BigInt!] - allocPoint_not_in: [BigInt!] - lastRewardBlock: BigInt - lastRewardBlock_not: BigInt - lastRewardBlock_gt: BigInt - lastRewardBlock_lt: BigInt - lastRewardBlock_gte: BigInt - lastRewardBlock_lte: BigInt - lastRewardBlock_in: [BigInt!] - lastRewardBlock_not_in: [BigInt!] - accSushiPerShare: BigInt - accSushiPerShare_not: BigInt - accSushiPerShare_gt: BigInt - accSushiPerShare_lt: BigInt - accSushiPerShare_gte: BigInt - accSushiPerShare_lte: BigInt - accSushiPerShare_in: [BigInt!] - accSushiPerShare_not_in: [BigInt!] - slpBalance: BigInt - slpBalance_not: BigInt - slpBalance_gt: BigInt - slpBalance_lt: BigInt - slpBalance_gte: BigInt - slpBalance_lte: BigInt - slpBalance_in: [BigInt!] - slpBalance_not_in: [BigInt!] - users_: User_filter - userCount: BigInt - userCount_not: BigInt - userCount_gt: BigInt - userCount_lt: BigInt - userCount_gte: BigInt - userCount_lte: BigInt - userCount_in: [BigInt!] - userCount_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Pool_filter] - or: [Pool_filter] -} - -enum Pool_orderBy { - id - masterChef - masterChef__id - masterChef__totalAllocPoint - masterChef__poolCount - masterChef__timestamp - masterChef__block - pair - rewarder - rewarder__id - rewarder__rewardToken - rewarder__rewardPerSecond - rewarder__timestamp - rewarder__block - allocPoint - lastRewardBlock - accSushiPerShare - slpBalance - users - userCount - timestamp - block -} - -type Query { - masterChef( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): MasterChef - masterChefs( - skip: Int = 0 - first: Int = 100 - orderBy: MasterChef_orderBy - orderDirection: OrderDirection - where: MasterChef_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [MasterChef!]! - pool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pool - pools( - skip: Int = 0 - first: Int = 100 - orderBy: Pool_orderBy - orderDirection: OrderDirection - where: Pool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pool!]! - rewarder( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Rewarder - rewarders( - skip: Int = 0 - first: Int = 100 - orderBy: Rewarder_orderBy - orderDirection: OrderDirection - where: Rewarder_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Rewarder!]! - user( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): User - users( - skip: Int = 0 - first: Int = 100 - orderBy: User_orderBy - orderDirection: OrderDirection - where: User_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [User!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type Rewarder { - id: ID! - rewardToken: Bytes! - rewardPerSecond: BigInt! - timestamp: BigInt! - block: BigInt! -} - -input Rewarder_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - rewardToken: Bytes - rewardToken_not: Bytes - rewardToken_gt: Bytes - rewardToken_lt: Bytes - rewardToken_gte: Bytes - rewardToken_lte: Bytes - rewardToken_in: [Bytes!] - rewardToken_not_in: [Bytes!] - rewardToken_contains: Bytes - rewardToken_not_contains: Bytes - rewardPerSecond: BigInt - rewardPerSecond_not: BigInt - rewardPerSecond_gt: BigInt - rewardPerSecond_lt: BigInt - rewardPerSecond_gte: BigInt - rewardPerSecond_lte: BigInt - rewardPerSecond_in: [BigInt!] - rewardPerSecond_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Rewarder_filter] - or: [Rewarder_filter] -} - -enum Rewarder_orderBy { - id - rewardToken - rewardPerSecond - timestamp - block -} - -type Subscription { - masterChef( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): MasterChef - masterChefs( - skip: Int = 0 - first: Int = 100 - orderBy: MasterChef_orderBy - orderDirection: OrderDirection - where: MasterChef_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [MasterChef!]! - pool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pool - pools( - skip: Int = 0 - first: Int = 100 - orderBy: Pool_orderBy - orderDirection: OrderDirection - where: Pool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pool!]! - rewarder( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Rewarder - rewarders( - skip: Int = 0 - first: Int = 100 - orderBy: Rewarder_orderBy - orderDirection: OrderDirection - where: Rewarder_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Rewarder!]! - user( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): User - users( - skip: Int = 0 - first: Int = 100 - orderBy: User_orderBy - orderDirection: OrderDirection - where: User_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [User!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -"A string representation of microseconds UNIX timestamp (16 digits)\n" -scalar Timestamp - -type User { - id: ID! - address: Bytes! - pool: Pool - amount: BigInt! - rewardDebt: BigInt! - sushiHarvested: BigInt! - timestamp: BigInt! - block: BigInt! -} - -input User_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - address: Bytes - address_not: Bytes - address_gt: Bytes - address_lt: Bytes - address_gte: Bytes - address_lte: Bytes - address_in: [Bytes!] - address_not_in: [Bytes!] - address_contains: Bytes - address_not_contains: Bytes - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - rewardDebt: BigInt - rewardDebt_not: BigInt - rewardDebt_gt: BigInt - rewardDebt_lt: BigInt - rewardDebt_gte: BigInt - rewardDebt_lte: BigInt - rewardDebt_in: [BigInt!] - rewardDebt_not_in: [BigInt!] - sushiHarvested: BigInt - sushiHarvested_not: BigInt - sushiHarvested_gt: BigInt - sushiHarvested_lt: BigInt - sushiHarvested_gte: BigInt - sushiHarvested_lte: BigInt - sushiHarvested_in: [BigInt!] - sushiHarvested_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [User_filter] - or: [User_filter] -} - -enum User_orderBy { - id - address - pool - pool__id - pool__pair - pool__allocPoint - pool__lastRewardBlock - pool__accSushiPerShare - pool__slpBalance - pool__userCount - pool__timestamp - pool__block - amount - rewardDebt - sushiHarvested - timestamp - block -} - -type _Block_ { - """The hash of the block""" - hash: Bytes - - """The block number""" - number: Int! - - """Integer representation of the timestamp stored in blocks for the chain""" - timestamp: Int - - """The hash of the parent block""" - parentHash: Bytes -} - -"""The type for the top-level _meta field""" -type _Meta_ { - "Information about a specific subgraph block. The hash of the block\nwill be null if the _meta field has a block constraint that asks for\na block number. It will be filled if the _meta field has no block constraint\nand therefore asks for the latest block\n" - block: _Block_! - - """The deployment ID""" - deployment: String! - - """If `true`, the subgraph encountered indexing errors at some past block""" - hasIndexingErrors: Boolean! -} - -enum _SubgraphErrorPolicy_ { - """Data will be returned even if the subgraph has indexing errors""" - allow - - """ - If the subgraph has indexing errors, data will be omitted. The default. - """ - deny -} \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/mini-chef/graphql.ts b/packages/graph-client/src/subgraphs/mini-chef/graphql.ts deleted file mode 100644 index 01a82d3406..0000000000 --- a/packages/graph-client/src/subgraphs/mini-chef/graphql.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { initGraphQLTada } from 'gql.tada' -import type { Scalars } from 'src/lib/types/scalars.js' -import type { introspection } from './mini-chef-env.js' - -export const graphql = initGraphQLTada<{ - introspection: introspection - scalars: Scalars -}>() diff --git a/packages/graph-client/src/subgraphs/mini-chef/index.ts b/packages/graph-client/src/subgraphs/mini-chef/index.ts deleted file mode 100644 index b161405c5e..0000000000 --- a/packages/graph-client/src/subgraphs/mini-chef/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './queries/user-positions' -export * from './queries/rewarders' diff --git a/packages/graph-client/src/subgraphs/mini-chef/queries/rewarders.ts b/packages/graph-client/src/subgraphs/mini-chef/queries/rewarders.ts deleted file mode 100644 index 817e18ac4c..0000000000 --- a/packages/graph-client/src/subgraphs/mini-chef/queries/rewarders.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { VariablesOf } from 'gql.tada' - -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import type { MiniChefChainId } from 'sushi/config' -import { MINICHEF_SUBGRAPH_URL } from 'sushi/config/subgraph' -import { graphql } from '../graphql' - -export const MiniChefRewardersQuery = graphql( - ` -query MiniChefRewarders( - $first: Int = 1000 - $skip: Int = 0 - $where: Rewarder_filter - $block: Block_height -) { - rewarders(first: $first, skip: $skip, where: $where, block: $block) { - id - rewardToken - rewardPerSecond - } -} - -`, -) - -export type GetMiniChefRewarders = VariablesOf & - ChainIdVariable - -export async function getMiniChefRewarders( - { chainId, ...variables }: GetMiniChefRewarders, - options?: RequestOptions, -) { - const url = `https://${MINICHEF_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: MiniChefRewardersQuery, - variables, - options, - }) - - return result.rewarders.map((rewarder) => { - // TODO: multichain id for rewardToken? - return { - id: rewarder.id, - address: rewarder.rewardToken, - rewardPerSecond: BigInt(rewarder.rewardPerSecond), - } - }) -} - -export type MiniChefRewarders = Awaited> diff --git a/packages/graph-client/src/subgraphs/mini-chef/queries/user-positions.ts b/packages/graph-client/src/subgraphs/mini-chef/queries/user-positions.ts deleted file mode 100644 index 228ce3bf1c..0000000000 --- a/packages/graph-client/src/subgraphs/mini-chef/queries/user-positions.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type { VariablesOf } from 'gql.tada' - -import { addChainId } from 'src/lib/modifiers/add-chain-id' -import { convertIdToMultichainId } from 'src/lib/modifiers/convert-id-to-multichain-id' -import { copyIdToAddress } from 'src/lib/modifiers/copy-id-to-address' -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import type { MiniChefChainId } from 'sushi/config' -import { MINICHEF_SUBGRAPH_URL } from 'sushi/config/subgraph' -import { SushiSwapProtocol } from 'sushi/types' -import { graphql } from '../graphql' - -export const MiniChefUserPositionsQuery = graphql( - ` - query UserPositions($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: User_orderBy, $orderDirection: OrderDirection, $where: User_filter) { - users(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - address - balance: amount - pool { - id: pair - } - } - } -`, -) - -export type GetMiniChefUserPositions = VariablesOf< - typeof MiniChefUserPositionsQuery -> & - ChainIdVariable - -export async function getMiniChefUserPositions( - { chainId, ...variables }: GetMiniChefUserPositions, - options?: RequestOptions, -) { - const url = `https://${MINICHEF_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: MiniChefUserPositionsQuery, - variables, - options, - }) - - return result.users.flatMap((position) => { - if (!position.pool) { - return [] - } - - const pool = { - ...convertIdToMultichainId( - copyIdToAddress(addChainId(chainId, position.pool)), - ), - protocol: SushiSwapProtocol.SUSHISWAP_V2, - } - - return { - id: position.id, - address: position.address, - balance: position.balance, - pool, - } - }) -} - -export type MiniChefUserPositions = Awaited< - ReturnType -> diff --git a/packages/graph-client/src/subgraphs/mini-chef/schema.graphql b/packages/graph-client/src/subgraphs/mini-chef/schema.graphql deleted file mode 100644 index 516e5d30bd..0000000000 --- a/packages/graph-client/src/subgraphs/mini-chef/schema.graphql +++ /dev/null @@ -1,878 +0,0 @@ -""" -Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive. -""" -directive @entity on OBJECT - -"""Defined a Subgraph ID for an object type""" -directive @subgraphId(id: String!) on OBJECT - -""" -creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API. -""" -directive @derivedFrom(field: String!) on FIELD_DEFINITION - -enum Aggregation_interval { - hour - day -} - -scalar BigDecimal - -scalar BigInt - -input BlockChangedFilter { - number_gte: Int! -} - -input Block_height { - hash: Bytes - number: Int - number_gte: Int -} - -scalar Bytes - -"8 bytes signed integer\n" -scalar Int8 - -type MiniChef { - id: ID! - sushi: Bytes! - sushiPerSecond: BigInt! - totalAllocPoint: BigInt! - pools(skip: Int = 0, first: Int = 100, orderBy: Pool_orderBy, orderDirection: OrderDirection, where: Pool_filter): [Pool!] - poolCount: BigInt! - timestamp: BigInt! - block: BigInt! -} - -input MiniChef_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - sushi: Bytes - sushi_not: Bytes - sushi_gt: Bytes - sushi_lt: Bytes - sushi_gte: Bytes - sushi_lte: Bytes - sushi_in: [Bytes!] - sushi_not_in: [Bytes!] - sushi_contains: Bytes - sushi_not_contains: Bytes - sushiPerSecond: BigInt - sushiPerSecond_not: BigInt - sushiPerSecond_gt: BigInt - sushiPerSecond_lt: BigInt - sushiPerSecond_gte: BigInt - sushiPerSecond_lte: BigInt - sushiPerSecond_in: [BigInt!] - sushiPerSecond_not_in: [BigInt!] - totalAllocPoint: BigInt - totalAllocPoint_not: BigInt - totalAllocPoint_gt: BigInt - totalAllocPoint_lt: BigInt - totalAllocPoint_gte: BigInt - totalAllocPoint_lte: BigInt - totalAllocPoint_in: [BigInt!] - totalAllocPoint_not_in: [BigInt!] - pools_: Pool_filter - poolCount: BigInt - poolCount_not: BigInt - poolCount_gt: BigInt - poolCount_lt: BigInt - poolCount_gte: BigInt - poolCount_lte: BigInt - poolCount_in: [BigInt!] - poolCount_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [MiniChef_filter] - or: [MiniChef_filter] -} - -enum MiniChef_orderBy { - id - sushi - sushiPerSecond - totalAllocPoint - pools - poolCount - timestamp - block -} - -type NativeRewarderPool { - id: ID! - allocPoint: BigInt! -} - -input NativeRewarderPool_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - allocPoint: BigInt - allocPoint_not: BigInt - allocPoint_gt: BigInt - allocPoint_lt: BigInt - allocPoint_gte: BigInt - allocPoint_lte: BigInt - allocPoint_in: [BigInt!] - allocPoint_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [NativeRewarderPool_filter] - or: [NativeRewarderPool_filter] -} - -enum NativeRewarderPool_orderBy { - id - allocPoint -} - -"""Defines the order direction, either ascending or descending""" -enum OrderDirection { - asc - desc -} - -type Pool { - id: ID! - miniChef: MiniChef! - pair: Bytes! - rewarder: Rewarder - allocPoint: BigInt! - lastRewardTime: BigInt! - accSushiPerShare: BigInt! - slpBalance: BigInt! - users(skip: Int = 0, first: Int = 100, orderBy: User_orderBy, orderDirection: OrderDirection, where: User_filter): [User!]! - userCount: BigInt! - timestamp: BigInt! - block: BigInt! -} - -input Pool_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - miniChef: String - miniChef_not: String - miniChef_gt: String - miniChef_lt: String - miniChef_gte: String - miniChef_lte: String - miniChef_in: [String!] - miniChef_not_in: [String!] - miniChef_contains: String - miniChef_contains_nocase: String - miniChef_not_contains: String - miniChef_not_contains_nocase: String - miniChef_starts_with: String - miniChef_starts_with_nocase: String - miniChef_not_starts_with: String - miniChef_not_starts_with_nocase: String - miniChef_ends_with: String - miniChef_ends_with_nocase: String - miniChef_not_ends_with: String - miniChef_not_ends_with_nocase: String - miniChef_: MiniChef_filter - pair: Bytes - pair_not: Bytes - pair_gt: Bytes - pair_lt: Bytes - pair_gte: Bytes - pair_lte: Bytes - pair_in: [Bytes!] - pair_not_in: [Bytes!] - pair_contains: Bytes - pair_not_contains: Bytes - rewarder: String - rewarder_not: String - rewarder_gt: String - rewarder_lt: String - rewarder_gte: String - rewarder_lte: String - rewarder_in: [String!] - rewarder_not_in: [String!] - rewarder_contains: String - rewarder_contains_nocase: String - rewarder_not_contains: String - rewarder_not_contains_nocase: String - rewarder_starts_with: String - rewarder_starts_with_nocase: String - rewarder_not_starts_with: String - rewarder_not_starts_with_nocase: String - rewarder_ends_with: String - rewarder_ends_with_nocase: String - rewarder_not_ends_with: String - rewarder_not_ends_with_nocase: String - rewarder_: Rewarder_filter - allocPoint: BigInt - allocPoint_not: BigInt - allocPoint_gt: BigInt - allocPoint_lt: BigInt - allocPoint_gte: BigInt - allocPoint_lte: BigInt - allocPoint_in: [BigInt!] - allocPoint_not_in: [BigInt!] - lastRewardTime: BigInt - lastRewardTime_not: BigInt - lastRewardTime_gt: BigInt - lastRewardTime_lt: BigInt - lastRewardTime_gte: BigInt - lastRewardTime_lte: BigInt - lastRewardTime_in: [BigInt!] - lastRewardTime_not_in: [BigInt!] - accSushiPerShare: BigInt - accSushiPerShare_not: BigInt - accSushiPerShare_gt: BigInt - accSushiPerShare_lt: BigInt - accSushiPerShare_gte: BigInt - accSushiPerShare_lte: BigInt - accSushiPerShare_in: [BigInt!] - accSushiPerShare_not_in: [BigInt!] - slpBalance: BigInt - slpBalance_not: BigInt - slpBalance_gt: BigInt - slpBalance_lt: BigInt - slpBalance_gte: BigInt - slpBalance_lte: BigInt - slpBalance_in: [BigInt!] - slpBalance_not_in: [BigInt!] - users_: User_filter - userCount: BigInt - userCount_not: BigInt - userCount_gt: BigInt - userCount_lt: BigInt - userCount_gte: BigInt - userCount_lte: BigInt - userCount_in: [BigInt!] - userCount_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Pool_filter] - or: [Pool_filter] -} - -enum Pool_orderBy { - id - miniChef - miniChef__id - miniChef__sushi - miniChef__sushiPerSecond - miniChef__totalAllocPoint - miniChef__poolCount - miniChef__timestamp - miniChef__block - pair - rewarder - rewarder__id - rewarder__rewardToken - rewarder__rewardPerSecond - rewarder__totalAllocPoint - rewarder__timestamp - rewarder__block - allocPoint - lastRewardTime - accSushiPerShare - slpBalance - users - userCount - timestamp - block -} - -type Query { - miniChef( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): MiniChef - miniChefs( - skip: Int = 0 - first: Int = 100 - orderBy: MiniChef_orderBy - orderDirection: OrderDirection - where: MiniChef_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [MiniChef!]! - pool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pool - pools( - skip: Int = 0 - first: Int = 100 - orderBy: Pool_orderBy - orderDirection: OrderDirection - where: Pool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pool!]! - nativeRewarderPool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): NativeRewarderPool - nativeRewarderPools( - skip: Int = 0 - first: Int = 100 - orderBy: NativeRewarderPool_orderBy - orderDirection: OrderDirection - where: NativeRewarderPool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [NativeRewarderPool!]! - rewarder( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Rewarder - rewarders( - skip: Int = 0 - first: Int = 100 - orderBy: Rewarder_orderBy - orderDirection: OrderDirection - where: Rewarder_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Rewarder!]! - user( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): User - users( - skip: Int = 0 - first: Int = 100 - orderBy: User_orderBy - orderDirection: OrderDirection - where: User_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [User!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type Rewarder { - id: ID! - rewardToken: Bytes! - rewardPerSecond: BigInt! - totalAllocPoint: BigInt! - timestamp: BigInt! - block: BigInt! -} - -input Rewarder_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - rewardToken: Bytes - rewardToken_not: Bytes - rewardToken_gt: Bytes - rewardToken_lt: Bytes - rewardToken_gte: Bytes - rewardToken_lte: Bytes - rewardToken_in: [Bytes!] - rewardToken_not_in: [Bytes!] - rewardToken_contains: Bytes - rewardToken_not_contains: Bytes - rewardPerSecond: BigInt - rewardPerSecond_not: BigInt - rewardPerSecond_gt: BigInt - rewardPerSecond_lt: BigInt - rewardPerSecond_gte: BigInt - rewardPerSecond_lte: BigInt - rewardPerSecond_in: [BigInt!] - rewardPerSecond_not_in: [BigInt!] - totalAllocPoint: BigInt - totalAllocPoint_not: BigInt - totalAllocPoint_gt: BigInt - totalAllocPoint_lt: BigInt - totalAllocPoint_gte: BigInt - totalAllocPoint_lte: BigInt - totalAllocPoint_in: [BigInt!] - totalAllocPoint_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Rewarder_filter] - or: [Rewarder_filter] -} - -enum Rewarder_orderBy { - id - rewardToken - rewardPerSecond - totalAllocPoint - timestamp - block -} - -type Subscription { - miniChef( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): MiniChef - miniChefs( - skip: Int = 0 - first: Int = 100 - orderBy: MiniChef_orderBy - orderDirection: OrderDirection - where: MiniChef_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [MiniChef!]! - pool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pool - pools( - skip: Int = 0 - first: Int = 100 - orderBy: Pool_orderBy - orderDirection: OrderDirection - where: Pool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pool!]! - nativeRewarderPool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): NativeRewarderPool - nativeRewarderPools( - skip: Int = 0 - first: Int = 100 - orderBy: NativeRewarderPool_orderBy - orderDirection: OrderDirection - where: NativeRewarderPool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [NativeRewarderPool!]! - rewarder( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Rewarder - rewarders( - skip: Int = 0 - first: Int = 100 - orderBy: Rewarder_orderBy - orderDirection: OrderDirection - where: Rewarder_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Rewarder!]! - user( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): User - users( - skip: Int = 0 - first: Int = 100 - orderBy: User_orderBy - orderDirection: OrderDirection - where: User_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [User!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -"A string representation of microseconds UNIX timestamp (16 digits)\n" -scalar Timestamp - -type User { - id: ID! - address: Bytes! - pool: Pool - amount: BigInt! - rewardDebt: BigInt! - sushiHarvested: BigInt! - timestamp: BigInt! - block: BigInt! -} - -input User_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - address: Bytes - address_not: Bytes - address_gt: Bytes - address_lt: Bytes - address_gte: Bytes - address_lte: Bytes - address_in: [Bytes!] - address_not_in: [Bytes!] - address_contains: Bytes - address_not_contains: Bytes - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - rewardDebt: BigInt - rewardDebt_not: BigInt - rewardDebt_gt: BigInt - rewardDebt_lt: BigInt - rewardDebt_gte: BigInt - rewardDebt_lte: BigInt - rewardDebt_in: [BigInt!] - rewardDebt_not_in: [BigInt!] - sushiHarvested: BigInt - sushiHarvested_not: BigInt - sushiHarvested_gt: BigInt - sushiHarvested_lt: BigInt - sushiHarvested_gte: BigInt - sushiHarvested_lte: BigInt - sushiHarvested_in: [BigInt!] - sushiHarvested_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - block: BigInt - block_not: BigInt - block_gt: BigInt - block_lt: BigInt - block_gte: BigInt - block_lte: BigInt - block_in: [BigInt!] - block_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [User_filter] - or: [User_filter] -} - -enum User_orderBy { - id - address - pool - pool__id - pool__pair - pool__allocPoint - pool__lastRewardTime - pool__accSushiPerShare - pool__slpBalance - pool__userCount - pool__timestamp - pool__block - amount - rewardDebt - sushiHarvested - timestamp - block -} - -type _Block_ { - """The hash of the block""" - hash: Bytes - - """The block number""" - number: Int! - - """Integer representation of the timestamp stored in blocks for the chain""" - timestamp: Int - - """The hash of the parent block""" - parentHash: Bytes -} - -"""The type for the top-level _meta field""" -type _Meta_ { - "Information about a specific subgraph block. The hash of the block\nwill be null if the _meta field has a block constraint that asks for\na block number. It will be filled if the _meta field has no block constraint\nand therefore asks for the latest block\n" - block: _Block_! - - """The deployment ID""" - deployment: String! - - """If `true`, the subgraph encountered indexing errors at some past block""" - hasIndexingErrors: Boolean! -} - -enum _SubgraphErrorPolicy_ { - """Data will be returned even if the subgraph has indexing errors""" - allow - - """ - If the subgraph has indexing errors, data will be omitted. The default. - """ - deny -} \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/steer/graphql.ts b/packages/graph-client/src/subgraphs/steer/graphql.ts deleted file mode 100644 index 5e19070a0d..0000000000 --- a/packages/graph-client/src/subgraphs/steer/graphql.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { initGraphQLTada } from 'gql.tada' -import type { Scalars } from 'src/lib/types/scalars.js' -import type { introspection } from './steer-env.js' - -export const graphql = initGraphQLTada<{ - introspection: introspection - scalars: Scalars -}>() diff --git a/packages/graph-client/src/subgraphs/steer/index.ts b/packages/graph-client/src/subgraphs/steer/index.ts deleted file mode 100644 index 5bda41d19f..0000000000 --- a/packages/graph-client/src/subgraphs/steer/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './queries/vaults' diff --git a/packages/graph-client/src/subgraphs/steer/queries/vaults.ts b/packages/graph-client/src/subgraphs/steer/queries/vaults.ts deleted file mode 100644 index 59ada9bb07..0000000000 --- a/packages/graph-client/src/subgraphs/steer/queries/vaults.ts +++ /dev/null @@ -1,135 +0,0 @@ -import type { VariablesOf } from 'gql.tada' - -import { STEER_SUBGRAPH_URL, type SteerChainId } from '@sushiswap/steer-sdk' -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { - type Address, - SushiSwapProtocol, - TickMath, - getIdFromChainIdAddress, -} from 'sushi' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { graphql } from '../graphql' - -export const SteerVaultsQuery = graphql(` - query Vaults($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Vault_orderBy, $orderDirection: OrderDirection, $where: Vault_filter) { - vaults(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - feeTier - reserve0: token0Balance - reserve1: token1Balance - pool - state - payloadIpfs - strategyToken { - id - name - - creator { - id - } - admin - } - - positions(first: 1000) { - lowerTick - upperTick - } - - createdAt - token0 - token1 - fees0 - fees1 - - manager: vaultManager - } - } -`) - -export type GetSteerVaults = VariablesOf & - ChainIdVariable - -export async function getSteerVaults( - { chainId, ...variables }: GetSteerVaults, - options?: RequestOptions, -) { - const url = `https://${STEER_SUBGRAPH_URL[chainId]}` - const result = await requestPaged({ - chainId, - url, - query: SteerVaultsQuery, - variables, - options, - }) - - return result.vaults.map((vault) => { - const lowTicks = vault.positions.flatMap((position) => position.lowerTick) - const lowestTick = Math.max( - lowTicks.reduce( - (lowest, tick) => (Number(tick) < lowest ? Number(tick) : lowest), - Number(lowTicks[0] || 0), - ), - TickMath.MIN_TICK, - ) - - const highTicks = vault.positions.flatMap((position) => position.upperTick) - const highestTick = Math.min( - highTicks.reduce( - (highest, tick) => (Number(tick) > highest ? Number(tick) : highest), - Number(highTicks[0] || 0), - ), - TickMath.MAX_TICK, - ) - return { - id: getIdFromChainIdAddress(chainId, vault.id as Address), - chainId: chainId as SteerChainId, - address: vault.id as Address, - - feeTier: Number(vault.feeTier), - - reserve0: BigInt(vault.reserve0), - reserve1: BigInt(vault.reserve1), - - pool: { - id: getIdFromChainIdAddress(chainId, vault.pool as Address), - address: vault.pool as Address, - chainId: chainId as SushiSwapV3ChainId, - protocol: SushiSwapProtocol.SUSHISWAP_V3, - }, - - state: vault.state, - payloadIpfs: vault.payloadIpfs, - strategyToken: { - id: vault.strategyToken.id, - name: vault.strategyToken.name, - creator: { - id: vault.strategyToken.creator.id, - }, - admin: vault.strategyToken.admin, - }, - lowerTick: lowestTick ? BigInt(lowestTick || 0) : null, - upperTick: highestTick ? BigInt(highestTick || 0) : null, - - token0: { - id: getIdFromChainIdAddress(chainId, vault.token0 as Address), - chainId: chainId as SushiSwapV3ChainId, - address: vault.token0 as Address, - }, - token1: { - id: getIdFromChainIdAddress(chainId, vault.token1 as Address), - chainId: chainId as SushiSwapV3ChainId, - address: vault.token1 as Address, - }, - - fees0: BigInt(vault.fees0), - fees1: BigInt(vault.fees1), - - manager: vault.manager, - } - }) -} - -export type SteerVaults = Awaited> diff --git a/packages/graph-client/src/subgraphs/steer/schema.graphql b/packages/graph-client/src/subgraphs/steer/schema.graphql deleted file mode 100644 index 8b3fc7f782..0000000000 --- a/packages/graph-client/src/subgraphs/steer/schema.graphql +++ /dev/null @@ -1,7681 +0,0 @@ -""" -Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive. -""" -directive @entity on OBJECT - -"""Defined a Subgraph ID for an object type""" -directive @subgraphId(id: String!) on OBJECT - -""" -creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API. -""" -directive @derivedFrom(field: String!) on FIELD_DEFINITION - -type ActionFailure { - id: ID! - timeStamp: BigInt! - method: BigInt! - action: OrchestratorAction! -} - -input ActionFailure_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - method: BigInt - method_not: BigInt - method_gt: BigInt - method_lt: BigInt - method_gte: BigInt - method_lte: BigInt - method_in: [BigInt!] - method_not_in: [BigInt!] - action: String - action_not: String - action_gt: String - action_lt: String - action_gte: String - action_lte: String - action_in: [String!] - action_not_in: [String!] - action_contains: String - action_contains_nocase: String - action_not_contains: String - action_not_contains_nocase: String - action_starts_with: String - action_starts_with_nocase: String - action_not_starts_with: String - action_not_starts_with_nocase: String - action_ends_with: String - action_ends_with_nocase: String - action_not_ends_with: String - action_not_ends_with_nocase: String - action_: OrchestratorAction_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [ActionFailure_filter] - or: [ActionFailure_filter] -} - -enum ActionFailure_orderBy { - id - timeStamp - method - action - action__id - action__timestamp - action__lastUpdated - action__state - action__status - action__vault - action__transactionHash - action__hash - action__gasUsed -} - -enum Aggregation_interval { - hour - day -} - -scalar BigDecimal - -scalar BigInt - -input BlockChangedFilter { - number_gte: Int! -} - -input Block_height { - hash: Bytes - number: Int - number_gte: Int -} - -type Bundle { - id: ID! - createdAt: BigInt! - bundle: String! - creator: String! - host: String! - source: String! - output: String! - active: Boolean! - infoHash: String! - hash: String! -} - -input Bundle_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - createdAt: BigInt - createdAt_not: BigInt - createdAt_gt: BigInt - createdAt_lt: BigInt - createdAt_gte: BigInt - createdAt_lte: BigInt - createdAt_in: [BigInt!] - createdAt_not_in: [BigInt!] - bundle: String - bundle_not: String - bundle_gt: String - bundle_lt: String - bundle_gte: String - bundle_lte: String - bundle_in: [String!] - bundle_not_in: [String!] - bundle_contains: String - bundle_contains_nocase: String - bundle_not_contains: String - bundle_not_contains_nocase: String - bundle_starts_with: String - bundle_starts_with_nocase: String - bundle_not_starts_with: String - bundle_not_starts_with_nocase: String - bundle_ends_with: String - bundle_ends_with_nocase: String - bundle_not_ends_with: String - bundle_not_ends_with_nocase: String - creator: String - creator_not: String - creator_gt: String - creator_lt: String - creator_gte: String - creator_lte: String - creator_in: [String!] - creator_not_in: [String!] - creator_contains: String - creator_contains_nocase: String - creator_not_contains: String - creator_not_contains_nocase: String - creator_starts_with: String - creator_starts_with_nocase: String - creator_not_starts_with: String - creator_not_starts_with_nocase: String - creator_ends_with: String - creator_ends_with_nocase: String - creator_not_ends_with: String - creator_not_ends_with_nocase: String - host: String - host_not: String - host_gt: String - host_lt: String - host_gte: String - host_lte: String - host_in: [String!] - host_not_in: [String!] - host_contains: String - host_contains_nocase: String - host_not_contains: String - host_not_contains_nocase: String - host_starts_with: String - host_starts_with_nocase: String - host_not_starts_with: String - host_not_starts_with_nocase: String - host_ends_with: String - host_ends_with_nocase: String - host_not_ends_with: String - host_not_ends_with_nocase: String - source: String - source_not: String - source_gt: String - source_lt: String - source_gte: String - source_lte: String - source_in: [String!] - source_not_in: [String!] - source_contains: String - source_contains_nocase: String - source_not_contains: String - source_not_contains_nocase: String - source_starts_with: String - source_starts_with_nocase: String - source_not_starts_with: String - source_not_starts_with_nocase: String - source_ends_with: String - source_ends_with_nocase: String - source_not_ends_with: String - source_not_ends_with_nocase: String - output: String - output_not: String - output_gt: String - output_lt: String - output_gte: String - output_lte: String - output_in: [String!] - output_not_in: [String!] - output_contains: String - output_contains_nocase: String - output_not_contains: String - output_not_contains_nocase: String - output_starts_with: String - output_starts_with_nocase: String - output_not_starts_with: String - output_not_starts_with_nocase: String - output_ends_with: String - output_ends_with_nocase: String - output_not_ends_with: String - output_not_ends_with_nocase: String - active: Boolean - active_not: Boolean - active_in: [Boolean!] - active_not_in: [Boolean!] - infoHash: String - infoHash_not: String - infoHash_gt: String - infoHash_lt: String - infoHash_gte: String - infoHash_lte: String - infoHash_in: [String!] - infoHash_not_in: [String!] - infoHash_contains: String - infoHash_contains_nocase: String - infoHash_not_contains: String - infoHash_not_contains_nocase: String - infoHash_starts_with: String - infoHash_starts_with_nocase: String - infoHash_not_starts_with: String - infoHash_not_starts_with_nocase: String - infoHash_ends_with: String - infoHash_ends_with_nocase: String - infoHash_not_ends_with: String - infoHash_not_ends_with_nocase: String - hash: String - hash_not: String - hash_gt: String - hash_lt: String - hash_gte: String - hash_lte: String - hash_in: [String!] - hash_not_in: [String!] - hash_contains: String - hash_contains_nocase: String - hash_not_contains: String - hash_not_contains_nocase: String - hash_starts_with: String - hash_starts_with_nocase: String - hash_not_starts_with: String - hash_not_starts_with_nocase: String - hash_ends_with: String - hash_ends_with_nocase: String - hash_not_ends_with: String - hash_not_ends_with_nocase: String - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Bundle_filter] - or: [Bundle_filter] -} - -enum Bundle_orderBy { - id - createdAt - bundle - creator - host - source - output - active - infoHash - hash -} - -scalar Bytes - -type Creator { - id: ID! - strategies(skip: Int = 0, first: Int = 100, orderBy: Strategy_orderBy, orderDirection: OrderDirection, where: Strategy_filter): [Strategy!]! - revenue: BigDecimal! - withdrawals(skip: Int = 0, first: Int = 100, orderBy: CreatorWithdrawal_orderBy, orderDirection: OrderDirection, where: CreatorWithdrawal_filter): [CreatorWithdrawal!] - totalValueLocked: BigDecimal! - totalYield: BigDecimal! -} - -type CreatorWithdrawal { - id: ID! - timeStamp: BigInt! - creator: Creator! - amount: BigDecimal! -} - -input CreatorWithdrawal_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - creator: String - creator_not: String - creator_gt: String - creator_lt: String - creator_gte: String - creator_lte: String - creator_in: [String!] - creator_not_in: [String!] - creator_contains: String - creator_contains_nocase: String - creator_not_contains: String - creator_not_contains_nocase: String - creator_starts_with: String - creator_starts_with_nocase: String - creator_not_starts_with: String - creator_not_starts_with_nocase: String - creator_ends_with: String - creator_ends_with_nocase: String - creator_not_ends_with: String - creator_not_ends_with_nocase: String - creator_: Creator_filter - amount: BigDecimal - amount_not: BigDecimal - amount_gt: BigDecimal - amount_lt: BigDecimal - amount_gte: BigDecimal - amount_lte: BigDecimal - amount_in: [BigDecimal!] - amount_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [CreatorWithdrawal_filter] - or: [CreatorWithdrawal_filter] -} - -enum CreatorWithdrawal_orderBy { - id - timeStamp - creator - creator__id - creator__revenue - creator__totalValueLocked - creator__totalYield - amount -} - -input Creator_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - strategies_: Strategy_filter - revenue: BigDecimal - revenue_not: BigDecimal - revenue_gt: BigDecimal - revenue_lt: BigDecimal - revenue_gte: BigDecimal - revenue_lte: BigDecimal - revenue_in: [BigDecimal!] - revenue_not_in: [BigDecimal!] - withdrawals_: CreatorWithdrawal_filter - totalValueLocked: BigDecimal - totalValueLocked_not: BigDecimal - totalValueLocked_gt: BigDecimal - totalValueLocked_lt: BigDecimal - totalValueLocked_gte: BigDecimal - totalValueLocked_lte: BigDecimal - totalValueLocked_in: [BigDecimal!] - totalValueLocked_not_in: [BigDecimal!] - totalYield: BigDecimal - totalYield_not: BigDecimal - totalYield_gt: BigDecimal - totalYield_lt: BigDecimal - totalYield_gte: BigDecimal - totalYield_lte: BigDecimal - totalYield_in: [BigDecimal!] - totalYield_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Creator_filter] - or: [Creator_filter] -} - -enum Creator_orderBy { - id - strategies - revenue - withdrawals - totalValueLocked - totalYield -} - -type Depositor { - id: ID! - vault: Vault! - account: String! - executor: String! - depositCaller: String! - depositedAmount0: BigInt! - depositedAmount1: BigInt! - withdrawnAmount0: BigInt! - withdrawnAmount1: BigInt! - liquidityAmount0: BigInt! - liquidityAmount1: BigInt! - createdTimestamp: BigInt! - updatedTimestamp: BigInt! - shares: BigInt! -} - -input Depositor_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - vault_: Vault_filter - account: String - account_not: String - account_gt: String - account_lt: String - account_gte: String - account_lte: String - account_in: [String!] - account_not_in: [String!] - account_contains: String - account_contains_nocase: String - account_not_contains: String - account_not_contains_nocase: String - account_starts_with: String - account_starts_with_nocase: String - account_not_starts_with: String - account_not_starts_with_nocase: String - account_ends_with: String - account_ends_with_nocase: String - account_not_ends_with: String - account_not_ends_with_nocase: String - executor: String - executor_not: String - executor_gt: String - executor_lt: String - executor_gte: String - executor_lte: String - executor_in: [String!] - executor_not_in: [String!] - executor_contains: String - executor_contains_nocase: String - executor_not_contains: String - executor_not_contains_nocase: String - executor_starts_with: String - executor_starts_with_nocase: String - executor_not_starts_with: String - executor_not_starts_with_nocase: String - executor_ends_with: String - executor_ends_with_nocase: String - executor_not_ends_with: String - executor_not_ends_with_nocase: String - depositCaller: String - depositCaller_not: String - depositCaller_gt: String - depositCaller_lt: String - depositCaller_gte: String - depositCaller_lte: String - depositCaller_in: [String!] - depositCaller_not_in: [String!] - depositCaller_contains: String - depositCaller_contains_nocase: String - depositCaller_not_contains: String - depositCaller_not_contains_nocase: String - depositCaller_starts_with: String - depositCaller_starts_with_nocase: String - depositCaller_not_starts_with: String - depositCaller_not_starts_with_nocase: String - depositCaller_ends_with: String - depositCaller_ends_with_nocase: String - depositCaller_not_ends_with: String - depositCaller_not_ends_with_nocase: String - depositedAmount0: BigInt - depositedAmount0_not: BigInt - depositedAmount0_gt: BigInt - depositedAmount0_lt: BigInt - depositedAmount0_gte: BigInt - depositedAmount0_lte: BigInt - depositedAmount0_in: [BigInt!] - depositedAmount0_not_in: [BigInt!] - depositedAmount1: BigInt - depositedAmount1_not: BigInt - depositedAmount1_gt: BigInt - depositedAmount1_lt: BigInt - depositedAmount1_gte: BigInt - depositedAmount1_lte: BigInt - depositedAmount1_in: [BigInt!] - depositedAmount1_not_in: [BigInt!] - withdrawnAmount0: BigInt - withdrawnAmount0_not: BigInt - withdrawnAmount0_gt: BigInt - withdrawnAmount0_lt: BigInt - withdrawnAmount0_gte: BigInt - withdrawnAmount0_lte: BigInt - withdrawnAmount0_in: [BigInt!] - withdrawnAmount0_not_in: [BigInt!] - withdrawnAmount1: BigInt - withdrawnAmount1_not: BigInt - withdrawnAmount1_gt: BigInt - withdrawnAmount1_lt: BigInt - withdrawnAmount1_gte: BigInt - withdrawnAmount1_lte: BigInt - withdrawnAmount1_in: [BigInt!] - withdrawnAmount1_not_in: [BigInt!] - liquidityAmount0: BigInt - liquidityAmount0_not: BigInt - liquidityAmount0_gt: BigInt - liquidityAmount0_lt: BigInt - liquidityAmount0_gte: BigInt - liquidityAmount0_lte: BigInt - liquidityAmount0_in: [BigInt!] - liquidityAmount0_not_in: [BigInt!] - liquidityAmount1: BigInt - liquidityAmount1_not: BigInt - liquidityAmount1_gt: BigInt - liquidityAmount1_lt: BigInt - liquidityAmount1_gte: BigInt - liquidityAmount1_lte: BigInt - liquidityAmount1_in: [BigInt!] - liquidityAmount1_not_in: [BigInt!] - createdTimestamp: BigInt - createdTimestamp_not: BigInt - createdTimestamp_gt: BigInt - createdTimestamp_lt: BigInt - createdTimestamp_gte: BigInt - createdTimestamp_lte: BigInt - createdTimestamp_in: [BigInt!] - createdTimestamp_not_in: [BigInt!] - updatedTimestamp: BigInt - updatedTimestamp_not: BigInt - updatedTimestamp_gt: BigInt - updatedTimestamp_lt: BigInt - updatedTimestamp_gte: BigInt - updatedTimestamp_lte: BigInt - updatedTimestamp_in: [BigInt!] - updatedTimestamp_not_in: [BigInt!] - shares: BigInt - shares_not: BigInt - shares_gt: BigInt - shares_lt: BigInt - shares_gte: BigInt - shares_lte: BigInt - shares_in: [BigInt!] - shares_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Depositor_filter] - or: [Depositor_filter] -} - -enum Depositor_orderBy { - id - vault - vault__id - vault__deployer - vault__token0 - vault__token1 - vault__totalAmount0 - vault__totalAmount1 - vault__createdAt - vault__lastSnapshot - vault__pool - vault__state - vault__annualPercentageYield - vault__annualPercentageDailyYield - vault__annualPercentageMonthlyYield - vault__annualPercentageYearlyYield - vault__lastTotalT0ValuePerLPT - vault__accruedStrategistFees0 - vault__accruedStrategistFees1 - vault__fees0 - vault__fees1 - vault__beaconName - vault__gasUsed - vault__gasDeposited - vault__totalLPTokensIssued - vault__token1Symbol - vault__decimals - vault__feeTier - vault__name - vault__symbol - vault__token0Balance - vault__token0Decimals - vault__token0Name - vault__token0Symbol - vault__token1Balance - vault__token1Decimals - vault__token1Name - vault__payloadIpfs - vault__vaultManager - vault__averageFeeArrPerSecond - vault__totalSnapshots - vault__annualFeeARR - vault__dailyFeeAPR - vault__weeklyFeeAPR - vault__totalValueLockedToken0 - vault__totalValueLockedToken1 - account - executor - depositCaller - depositedAmount0 - depositedAmount1 - withdrawnAmount0 - withdrawnAmount1 - liquidityAmount0 - liquidityAmount1 - createdTimestamp - updatedTimestamp - shares -} - -"8 bytes signed integer\n" -scalar Int8 - -type Job { - id: ID! - name: String! - timestamp: BigInt! - jobInfo: [String!]! - targetAddresses: [String!]! - ipfsHash: String! - executions(skip: Int = 0, first: Int = 100, orderBy: JobExecution_orderBy, orderDirection: OrderDirection, where: JobExecution_filter): [JobExecution!]! - status: BigInt! - failedCounts: BigInt! - vaultAddress: Vault! - jobHash: String! - gasUsed: BigInt! -} - -type JobExecution { - id: ID! - timestamp: BigInt! - jobHash: String! - executor: String! - status: String! - jobIdString: String! - jobId: Job! -} - -input JobExecution_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - jobHash: String - jobHash_not: String - jobHash_gt: String - jobHash_lt: String - jobHash_gte: String - jobHash_lte: String - jobHash_in: [String!] - jobHash_not_in: [String!] - jobHash_contains: String - jobHash_contains_nocase: String - jobHash_not_contains: String - jobHash_not_contains_nocase: String - jobHash_starts_with: String - jobHash_starts_with_nocase: String - jobHash_not_starts_with: String - jobHash_not_starts_with_nocase: String - jobHash_ends_with: String - jobHash_ends_with_nocase: String - jobHash_not_ends_with: String - jobHash_not_ends_with_nocase: String - executor: String - executor_not: String - executor_gt: String - executor_lt: String - executor_gte: String - executor_lte: String - executor_in: [String!] - executor_not_in: [String!] - executor_contains: String - executor_contains_nocase: String - executor_not_contains: String - executor_not_contains_nocase: String - executor_starts_with: String - executor_starts_with_nocase: String - executor_not_starts_with: String - executor_not_starts_with_nocase: String - executor_ends_with: String - executor_ends_with_nocase: String - executor_not_ends_with: String - executor_not_ends_with_nocase: String - status: String - status_not: String - status_gt: String - status_lt: String - status_gte: String - status_lte: String - status_in: [String!] - status_not_in: [String!] - status_contains: String - status_contains_nocase: String - status_not_contains: String - status_not_contains_nocase: String - status_starts_with: String - status_starts_with_nocase: String - status_not_starts_with: String - status_not_starts_with_nocase: String - status_ends_with: String - status_ends_with_nocase: String - status_not_ends_with: String - status_not_ends_with_nocase: String - jobIdString: String - jobIdString_not: String - jobIdString_gt: String - jobIdString_lt: String - jobIdString_gte: String - jobIdString_lte: String - jobIdString_in: [String!] - jobIdString_not_in: [String!] - jobIdString_contains: String - jobIdString_contains_nocase: String - jobIdString_not_contains: String - jobIdString_not_contains_nocase: String - jobIdString_starts_with: String - jobIdString_starts_with_nocase: String - jobIdString_not_starts_with: String - jobIdString_not_starts_with_nocase: String - jobIdString_ends_with: String - jobIdString_ends_with_nocase: String - jobIdString_not_ends_with: String - jobIdString_not_ends_with_nocase: String - jobId: String - jobId_not: String - jobId_gt: String - jobId_lt: String - jobId_gte: String - jobId_lte: String - jobId_in: [String!] - jobId_not_in: [String!] - jobId_contains: String - jobId_contains_nocase: String - jobId_not_contains: String - jobId_not_contains_nocase: String - jobId_starts_with: String - jobId_starts_with_nocase: String - jobId_not_starts_with: String - jobId_not_starts_with_nocase: String - jobId_ends_with: String - jobId_ends_with_nocase: String - jobId_not_ends_with: String - jobId_not_ends_with_nocase: String - jobId_: Job_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [JobExecution_filter] - or: [JobExecution_filter] -} - -enum JobExecution_orderBy { - id - timestamp - jobHash - executor - status - jobIdString - jobId - jobId__id - jobId__name - jobId__timestamp - jobId__ipfsHash - jobId__status - jobId__failedCounts - jobId__jobHash - jobId__gasUsed -} - -type JobGasDeposited { - id: ID! - timestamp: BigInt! - creator: String! - amount: BigInt! -} - -input JobGasDeposited_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - creator: String - creator_not: String - creator_gt: String - creator_lt: String - creator_gte: String - creator_lte: String - creator_in: [String!] - creator_not_in: [String!] - creator_contains: String - creator_contains_nocase: String - creator_not_contains: String - creator_not_contains_nocase: String - creator_starts_with: String - creator_starts_with_nocase: String - creator_not_starts_with: String - creator_not_starts_with_nocase: String - creator_ends_with: String - creator_ends_with_nocase: String - creator_not_ends_with: String - creator_not_ends_with_nocase: String - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [JobGasDeposited_filter] - or: [JobGasDeposited_filter] -} - -enum JobGasDeposited_orderBy { - id - timestamp - creator - amount -} - -type JobGasWithdrawn { - id: ID! - timestamp: BigInt! - creator: String! - amount: BigInt! -} - -input JobGasWithdrawn_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - creator: String - creator_not: String - creator_gt: String - creator_lt: String - creator_gte: String - creator_lte: String - creator_in: [String!] - creator_not_in: [String!] - creator_contains: String - creator_contains_nocase: String - creator_not_contains: String - creator_not_contains_nocase: String - creator_starts_with: String - creator_starts_with_nocase: String - creator_not_starts_with: String - creator_not_starts_with_nocase: String - creator_ends_with: String - creator_ends_with_nocase: String - creator_not_ends_with: String - creator_not_ends_with_nocase: String - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [JobGasWithdrawn_filter] - or: [JobGasWithdrawn_filter] -} - -enum JobGasWithdrawn_orderBy { - id - timestamp - creator - amount -} - -input Job_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - name: String - name_not: String - name_gt: String - name_lt: String - name_gte: String - name_lte: String - name_in: [String!] - name_not_in: [String!] - name_contains: String - name_contains_nocase: String - name_not_contains: String - name_not_contains_nocase: String - name_starts_with: String - name_starts_with_nocase: String - name_not_starts_with: String - name_not_starts_with_nocase: String - name_ends_with: String - name_ends_with_nocase: String - name_not_ends_with: String - name_not_ends_with_nocase: String - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - jobInfo: [String!] - jobInfo_not: [String!] - jobInfo_contains: [String!] - jobInfo_contains_nocase: [String!] - jobInfo_not_contains: [String!] - jobInfo_not_contains_nocase: [String!] - targetAddresses: [String!] - targetAddresses_not: [String!] - targetAddresses_contains: [String!] - targetAddresses_contains_nocase: [String!] - targetAddresses_not_contains: [String!] - targetAddresses_not_contains_nocase: [String!] - ipfsHash: String - ipfsHash_not: String - ipfsHash_gt: String - ipfsHash_lt: String - ipfsHash_gte: String - ipfsHash_lte: String - ipfsHash_in: [String!] - ipfsHash_not_in: [String!] - ipfsHash_contains: String - ipfsHash_contains_nocase: String - ipfsHash_not_contains: String - ipfsHash_not_contains_nocase: String - ipfsHash_starts_with: String - ipfsHash_starts_with_nocase: String - ipfsHash_not_starts_with: String - ipfsHash_not_starts_with_nocase: String - ipfsHash_ends_with: String - ipfsHash_ends_with_nocase: String - ipfsHash_not_ends_with: String - ipfsHash_not_ends_with_nocase: String - executions_: JobExecution_filter - status: BigInt - status_not: BigInt - status_gt: BigInt - status_lt: BigInt - status_gte: BigInt - status_lte: BigInt - status_in: [BigInt!] - status_not_in: [BigInt!] - failedCounts: BigInt - failedCounts_not: BigInt - failedCounts_gt: BigInt - failedCounts_lt: BigInt - failedCounts_gte: BigInt - failedCounts_lte: BigInt - failedCounts_in: [BigInt!] - failedCounts_not_in: [BigInt!] - vaultAddress: String - vaultAddress_not: String - vaultAddress_gt: String - vaultAddress_lt: String - vaultAddress_gte: String - vaultAddress_lte: String - vaultAddress_in: [String!] - vaultAddress_not_in: [String!] - vaultAddress_contains: String - vaultAddress_contains_nocase: String - vaultAddress_not_contains: String - vaultAddress_not_contains_nocase: String - vaultAddress_starts_with: String - vaultAddress_starts_with_nocase: String - vaultAddress_not_starts_with: String - vaultAddress_not_starts_with_nocase: String - vaultAddress_ends_with: String - vaultAddress_ends_with_nocase: String - vaultAddress_not_ends_with: String - vaultAddress_not_ends_with_nocase: String - vaultAddress_: Vault_filter - jobHash: String - jobHash_not: String - jobHash_gt: String - jobHash_lt: String - jobHash_gte: String - jobHash_lte: String - jobHash_in: [String!] - jobHash_not_in: [String!] - jobHash_contains: String - jobHash_contains_nocase: String - jobHash_not_contains: String - jobHash_not_contains_nocase: String - jobHash_starts_with: String - jobHash_starts_with_nocase: String - jobHash_not_starts_with: String - jobHash_not_starts_with_nocase: String - jobHash_ends_with: String - jobHash_ends_with_nocase: String - jobHash_not_ends_with: String - jobHash_not_ends_with_nocase: String - gasUsed: BigInt - gasUsed_not: BigInt - gasUsed_gt: BigInt - gasUsed_lt: BigInt - gasUsed_gte: BigInt - gasUsed_lte: BigInt - gasUsed_in: [BigInt!] - gasUsed_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Job_filter] - or: [Job_filter] -} - -enum Job_orderBy { - id - name - timestamp - jobInfo - targetAddresses - ipfsHash - executions - status - failedCounts - vaultAddress - vaultAddress__id - vaultAddress__deployer - vaultAddress__token0 - vaultAddress__token1 - vaultAddress__totalAmount0 - vaultAddress__totalAmount1 - vaultAddress__createdAt - vaultAddress__lastSnapshot - vaultAddress__pool - vaultAddress__state - vaultAddress__annualPercentageYield - vaultAddress__annualPercentageDailyYield - vaultAddress__annualPercentageMonthlyYield - vaultAddress__annualPercentageYearlyYield - vaultAddress__lastTotalT0ValuePerLPT - vaultAddress__accruedStrategistFees0 - vaultAddress__accruedStrategistFees1 - vaultAddress__fees0 - vaultAddress__fees1 - vaultAddress__beaconName - vaultAddress__gasUsed - vaultAddress__gasDeposited - vaultAddress__totalLPTokensIssued - vaultAddress__token1Symbol - vaultAddress__decimals - vaultAddress__feeTier - vaultAddress__name - vaultAddress__symbol - vaultAddress__token0Balance - vaultAddress__token0Decimals - vaultAddress__token0Name - vaultAddress__token0Symbol - vaultAddress__token1Balance - vaultAddress__token1Decimals - vaultAddress__token1Name - vaultAddress__payloadIpfs - vaultAddress__vaultManager - vaultAddress__averageFeeArrPerSecond - vaultAddress__totalSnapshots - vaultAddress__annualFeeARR - vaultAddress__dailyFeeAPR - vaultAddress__weeklyFeeAPR - vaultAddress__totalValueLockedToken0 - vaultAddress__totalValueLockedToken1 - jobHash - gasUsed -} - -type Keeper { - id: ID! - bondHeld: BigDecimal! - index: BigInt! - actions(skip: Int = 0, first: Int = 100, orderBy: OrchestratorAction_orderBy, orderDirection: OrderDirection, where: OrchestratorAction_filter): [OrchestratorAction!]! - status: String! - queueTimeline(skip: Int = 0, first: Int = 100, orderBy: QueueTimeline_orderBy, orderDirection: OrderDirection, where: QueueTimeline_filter): [QueueTimeline!]! - permissionUpdates(skip: Int = 0, first: Int = 100, orderBy: PermissionUpdate_orderBy, orderDirection: OrderDirection, where: PermissionUpdate_filter): [PermissionUpdate!]! -} - -input Keeper_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - bondHeld: BigDecimal - bondHeld_not: BigDecimal - bondHeld_gt: BigDecimal - bondHeld_lt: BigDecimal - bondHeld_gte: BigDecimal - bondHeld_lte: BigDecimal - bondHeld_in: [BigDecimal!] - bondHeld_not_in: [BigDecimal!] - index: BigInt - index_not: BigInt - index_gt: BigInt - index_lt: BigInt - index_gte: BigInt - index_lte: BigInt - index_in: [BigInt!] - index_not_in: [BigInt!] - actions_: OrchestratorAction_filter - status: String - status_not: String - status_gt: String - status_lt: String - status_gte: String - status_lte: String - status_in: [String!] - status_not_in: [String!] - status_contains: String - status_contains_nocase: String - status_not_contains: String - status_not_contains_nocase: String - status_starts_with: String - status_starts_with_nocase: String - status_not_starts_with: String - status_not_starts_with_nocase: String - status_ends_with: String - status_ends_with_nocase: String - status_not_ends_with: String - status_not_ends_with_nocase: String - queueTimeline_: QueueTimeline_filter - permissionUpdates_: PermissionUpdate_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Keeper_filter] - or: [Keeper_filter] -} - -enum Keeper_orderBy { - id - bondHeld - index - actions - status - queueTimeline - permissionUpdates -} - -type LeaderBoard { - id: ID! - address: String! - numStaticJobs: BigInt! - numApps: BigInt! - timestamp: BigInt! -} - -input LeaderBoard_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - address: String - address_not: String - address_gt: String - address_lt: String - address_gte: String - address_lte: String - address_in: [String!] - address_not_in: [String!] - address_contains: String - address_contains_nocase: String - address_not_contains: String - address_not_contains_nocase: String - address_starts_with: String - address_starts_with_nocase: String - address_not_starts_with: String - address_not_starts_with_nocase: String - address_ends_with: String - address_ends_with_nocase: String - address_not_ends_with: String - address_not_ends_with_nocase: String - numStaticJobs: BigInt - numStaticJobs_not: BigInt - numStaticJobs_gt: BigInt - numStaticJobs_lt: BigInt - numStaticJobs_gte: BigInt - numStaticJobs_lte: BigInt - numStaticJobs_in: [BigInt!] - numStaticJobs_not_in: [BigInt!] - numApps: BigInt - numApps_not: BigInt - numApps_gt: BigInt - numApps_lt: BigInt - numApps_gte: BigInt - numApps_lte: BigInt - numApps_in: [BigInt!] - numApps_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [LeaderBoard_filter] - or: [LeaderBoard_filter] -} - -enum LeaderBoard_orderBy { - id - address - numStaticJobs - numApps - timestamp -} - -type LiquiditySteer { - id: ID! - vault: Vault! - timeStamp: BigInt! - tick: BigInt! -} - -input LiquiditySteer_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - vault_: Vault_filter - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - tick: BigInt - tick_not: BigInt - tick_gt: BigInt - tick_lt: BigInt - tick_gte: BigInt - tick_lte: BigInt - tick_in: [BigInt!] - tick_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [LiquiditySteer_filter] - or: [LiquiditySteer_filter] -} - -enum LiquiditySteer_orderBy { - id - vault - vault__id - vault__deployer - vault__token0 - vault__token1 - vault__totalAmount0 - vault__totalAmount1 - vault__createdAt - vault__lastSnapshot - vault__pool - vault__state - vault__annualPercentageYield - vault__annualPercentageDailyYield - vault__annualPercentageMonthlyYield - vault__annualPercentageYearlyYield - vault__lastTotalT0ValuePerLPT - vault__accruedStrategistFees0 - vault__accruedStrategistFees1 - vault__fees0 - vault__fees1 - vault__beaconName - vault__gasUsed - vault__gasDeposited - vault__totalLPTokensIssued - vault__token1Symbol - vault__decimals - vault__feeTier - vault__name - vault__symbol - vault__token0Balance - vault__token0Decimals - vault__token0Name - vault__token0Symbol - vault__token1Balance - vault__token1Decimals - vault__token1Name - vault__payloadIpfs - vault__vaultManager - vault__averageFeeArrPerSecond - vault__totalSnapshots - vault__annualFeeARR - vault__dailyFeeAPR - vault__weeklyFeeAPR - vault__totalValueLockedToken0 - vault__totalValueLockedToken1 - timeStamp - tick -} - -type OrchestratorAction { - id: ID! - timestamp: BigInt! - from: Keeper! - votes(skip: Int = 0, first: Int = 100, orderBy: Vote_orderBy, orderDirection: OrderDirection, where: Vote_filter): [Vote!]! - lastUpdated: BigInt - state: String! - status: String! - recipients: [String!] - actionFailed(skip: Int = 0, first: Int = 100, orderBy: ActionFailure_orderBy, orderDirection: OrderDirection, where: ActionFailure_filter): [ActionFailure!]! - vault: String! - transactionHash: String! - hash: String! - gasUsed: BigInt! -} - -input OrchestratorAction_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - from: String - from_not: String - from_gt: String - from_lt: String - from_gte: String - from_lte: String - from_in: [String!] - from_not_in: [String!] - from_contains: String - from_contains_nocase: String - from_not_contains: String - from_not_contains_nocase: String - from_starts_with: String - from_starts_with_nocase: String - from_not_starts_with: String - from_not_starts_with_nocase: String - from_ends_with: String - from_ends_with_nocase: String - from_not_ends_with: String - from_not_ends_with_nocase: String - from_: Keeper_filter - votes_: Vote_filter - lastUpdated: BigInt - lastUpdated_not: BigInt - lastUpdated_gt: BigInt - lastUpdated_lt: BigInt - lastUpdated_gte: BigInt - lastUpdated_lte: BigInt - lastUpdated_in: [BigInt!] - lastUpdated_not_in: [BigInt!] - state: String - state_not: String - state_gt: String - state_lt: String - state_gte: String - state_lte: String - state_in: [String!] - state_not_in: [String!] - state_contains: String - state_contains_nocase: String - state_not_contains: String - state_not_contains_nocase: String - state_starts_with: String - state_starts_with_nocase: String - state_not_starts_with: String - state_not_starts_with_nocase: String - state_ends_with: String - state_ends_with_nocase: String - state_not_ends_with: String - state_not_ends_with_nocase: String - status: String - status_not: String - status_gt: String - status_lt: String - status_gte: String - status_lte: String - status_in: [String!] - status_not_in: [String!] - status_contains: String - status_contains_nocase: String - status_not_contains: String - status_not_contains_nocase: String - status_starts_with: String - status_starts_with_nocase: String - status_not_starts_with: String - status_not_starts_with_nocase: String - status_ends_with: String - status_ends_with_nocase: String - status_not_ends_with: String - status_not_ends_with_nocase: String - recipients: [String!] - recipients_not: [String!] - recipients_contains: [String!] - recipients_contains_nocase: [String!] - recipients_not_contains: [String!] - recipients_not_contains_nocase: [String!] - actionFailed_: ActionFailure_filter - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - transactionHash: String - transactionHash_not: String - transactionHash_gt: String - transactionHash_lt: String - transactionHash_gte: String - transactionHash_lte: String - transactionHash_in: [String!] - transactionHash_not_in: [String!] - transactionHash_contains: String - transactionHash_contains_nocase: String - transactionHash_not_contains: String - transactionHash_not_contains_nocase: String - transactionHash_starts_with: String - transactionHash_starts_with_nocase: String - transactionHash_not_starts_with: String - transactionHash_not_starts_with_nocase: String - transactionHash_ends_with: String - transactionHash_ends_with_nocase: String - transactionHash_not_ends_with: String - transactionHash_not_ends_with_nocase: String - hash: String - hash_not: String - hash_gt: String - hash_lt: String - hash_gte: String - hash_lte: String - hash_in: [String!] - hash_not_in: [String!] - hash_contains: String - hash_contains_nocase: String - hash_not_contains: String - hash_not_contains_nocase: String - hash_starts_with: String - hash_starts_with_nocase: String - hash_not_starts_with: String - hash_not_starts_with_nocase: String - hash_ends_with: String - hash_ends_with_nocase: String - hash_not_ends_with: String - hash_not_ends_with_nocase: String - gasUsed: BigInt - gasUsed_not: BigInt - gasUsed_gt: BigInt - gasUsed_lt: BigInt - gasUsed_gte: BigInt - gasUsed_lte: BigInt - gasUsed_in: [BigInt!] - gasUsed_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [OrchestratorAction_filter] - or: [OrchestratorAction_filter] -} - -enum OrchestratorAction_orderBy { - id - timestamp - from - from__id - from__bondHeld - from__index - from__status - votes - lastUpdated - state - status - recipients - actionFailed - vault - transactionHash - hash - gasUsed -} - -type OrchestratorReward { - id: ID! - timeStamp: BigInt! - updatedTimeStamp: BigInt! - address: String! - reward: BigInt! - trackerId: OrchestratorRewardTracker! -} - -type OrchestratorRewardSnapshot { - id: ID! - timeStamp: BigInt! - updatedTimeStamp: BigInt! - address: String! - reward: BigInt! -} - -input OrchestratorRewardSnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - updatedTimeStamp: BigInt - updatedTimeStamp_not: BigInt - updatedTimeStamp_gt: BigInt - updatedTimeStamp_lt: BigInt - updatedTimeStamp_gte: BigInt - updatedTimeStamp_lte: BigInt - updatedTimeStamp_in: [BigInt!] - updatedTimeStamp_not_in: [BigInt!] - address: String - address_not: String - address_gt: String - address_lt: String - address_gte: String - address_lte: String - address_in: [String!] - address_not_in: [String!] - address_contains: String - address_contains_nocase: String - address_not_contains: String - address_not_contains_nocase: String - address_starts_with: String - address_starts_with_nocase: String - address_not_starts_with: String - address_not_starts_with_nocase: String - address_ends_with: String - address_ends_with_nocase: String - address_not_ends_with: String - address_not_ends_with_nocase: String - reward: BigInt - reward_not: BigInt - reward_gt: BigInt - reward_lt: BigInt - reward_gte: BigInt - reward_lte: BigInt - reward_in: [BigInt!] - reward_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [OrchestratorRewardSnapshot_filter] - or: [OrchestratorRewardSnapshot_filter] -} - -enum OrchestratorRewardSnapshot_orderBy { - id - timeStamp - updatedTimeStamp - address - reward -} - -type OrchestratorRewardTracker { - id: ID! - timeStamp: BigInt! - rewards(skip: Int = 0, first: Int = 100, orderBy: OrchestratorReward_orderBy, orderDirection: OrderDirection, where: OrchestratorReward_filter): [OrchestratorReward!]! -} - -input OrchestratorRewardTracker_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - rewards_: OrchestratorReward_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [OrchestratorRewardTracker_filter] - or: [OrchestratorRewardTracker_filter] -} - -enum OrchestratorRewardTracker_orderBy { - id - timeStamp - rewards -} - -input OrchestratorReward_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - updatedTimeStamp: BigInt - updatedTimeStamp_not: BigInt - updatedTimeStamp_gt: BigInt - updatedTimeStamp_lt: BigInt - updatedTimeStamp_gte: BigInt - updatedTimeStamp_lte: BigInt - updatedTimeStamp_in: [BigInt!] - updatedTimeStamp_not_in: [BigInt!] - address: String - address_not: String - address_gt: String - address_lt: String - address_gte: String - address_lte: String - address_in: [String!] - address_not_in: [String!] - address_contains: String - address_contains_nocase: String - address_not_contains: String - address_not_contains_nocase: String - address_starts_with: String - address_starts_with_nocase: String - address_not_starts_with: String - address_not_starts_with_nocase: String - address_ends_with: String - address_ends_with_nocase: String - address_not_ends_with: String - address_not_ends_with_nocase: String - reward: BigInt - reward_not: BigInt - reward_gt: BigInt - reward_lt: BigInt - reward_gte: BigInt - reward_lte: BigInt - reward_in: [BigInt!] - reward_not_in: [BigInt!] - trackerId: String - trackerId_not: String - trackerId_gt: String - trackerId_lt: String - trackerId_gte: String - trackerId_lte: String - trackerId_in: [String!] - trackerId_not_in: [String!] - trackerId_contains: String - trackerId_contains_nocase: String - trackerId_not_contains: String - trackerId_not_contains_nocase: String - trackerId_starts_with: String - trackerId_starts_with_nocase: String - trackerId_not_starts_with: String - trackerId_not_starts_with_nocase: String - trackerId_ends_with: String - trackerId_ends_with_nocase: String - trackerId_not_ends_with: String - trackerId_not_ends_with_nocase: String - trackerId_: OrchestratorRewardTracker_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [OrchestratorReward_filter] - or: [OrchestratorReward_filter] -} - -enum OrchestratorReward_orderBy { - id - timeStamp - updatedTimeStamp - address - reward - trackerId - trackerId__id - trackerId__timeStamp -} - -"""Defines the order direction, either ascending or descending""" -enum OrderDirection { - asc - desc -} - -type PermissionUpdate { - id: ID! - keeper: Keeper! - timeStamp: BigInt! - action: String! -} - -input PermissionUpdate_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - keeper: String - keeper_not: String - keeper_gt: String - keeper_lt: String - keeper_gte: String - keeper_lte: String - keeper_in: [String!] - keeper_not_in: [String!] - keeper_contains: String - keeper_contains_nocase: String - keeper_not_contains: String - keeper_not_contains_nocase: String - keeper_starts_with: String - keeper_starts_with_nocase: String - keeper_not_starts_with: String - keeper_not_starts_with_nocase: String - keeper_ends_with: String - keeper_ends_with_nocase: String - keeper_not_ends_with: String - keeper_not_ends_with_nocase: String - keeper_: Keeper_filter - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - action: String - action_not: String - action_gt: String - action_lt: String - action_gte: String - action_lte: String - action_in: [String!] - action_not_in: [String!] - action_contains: String - action_contains_nocase: String - action_not_contains: String - action_not_contains_nocase: String - action_starts_with: String - action_starts_with_nocase: String - action_not_starts_with: String - action_not_starts_with_nocase: String - action_ends_with: String - action_ends_with_nocase: String - action_not_ends_with: String - action_not_ends_with_nocase: String - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PermissionUpdate_filter] - or: [PermissionUpdate_filter] -} - -enum PermissionUpdate_orderBy { - id - keeper - keeper__id - keeper__bondHeld - keeper__index - keeper__status - timeStamp - action -} - -type PrevAnnualVaultSnapshot { - id: ID! - timestamp: BigInt! - vaultAddress: Vault! - totalAmount0: BigInt! - totalAmount1: BigInt! - sqrtPriceX96: BigInt! - totalSupply: BigInt! - fees1: BigInt! - fees0: BigInt! -} - -input PrevAnnualVaultSnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - vaultAddress: String - vaultAddress_not: String - vaultAddress_gt: String - vaultAddress_lt: String - vaultAddress_gte: String - vaultAddress_lte: String - vaultAddress_in: [String!] - vaultAddress_not_in: [String!] - vaultAddress_contains: String - vaultAddress_contains_nocase: String - vaultAddress_not_contains: String - vaultAddress_not_contains_nocase: String - vaultAddress_starts_with: String - vaultAddress_starts_with_nocase: String - vaultAddress_not_starts_with: String - vaultAddress_not_starts_with_nocase: String - vaultAddress_ends_with: String - vaultAddress_ends_with_nocase: String - vaultAddress_not_ends_with: String - vaultAddress_not_ends_with_nocase: String - vaultAddress_: Vault_filter - totalAmount0: BigInt - totalAmount0_not: BigInt - totalAmount0_gt: BigInt - totalAmount0_lt: BigInt - totalAmount0_gte: BigInt - totalAmount0_lte: BigInt - totalAmount0_in: [BigInt!] - totalAmount0_not_in: [BigInt!] - totalAmount1: BigInt - totalAmount1_not: BigInt - totalAmount1_gt: BigInt - totalAmount1_lt: BigInt - totalAmount1_gte: BigInt - totalAmount1_lte: BigInt - totalAmount1_in: [BigInt!] - totalAmount1_not_in: [BigInt!] - sqrtPriceX96: BigInt - sqrtPriceX96_not: BigInt - sqrtPriceX96_gt: BigInt - sqrtPriceX96_lt: BigInt - sqrtPriceX96_gte: BigInt - sqrtPriceX96_lte: BigInt - sqrtPriceX96_in: [BigInt!] - sqrtPriceX96_not_in: [BigInt!] - totalSupply: BigInt - totalSupply_not: BigInt - totalSupply_gt: BigInt - totalSupply_lt: BigInt - totalSupply_gte: BigInt - totalSupply_lte: BigInt - totalSupply_in: [BigInt!] - totalSupply_not_in: [BigInt!] - fees1: BigInt - fees1_not: BigInt - fees1_gt: BigInt - fees1_lt: BigInt - fees1_gte: BigInt - fees1_lte: BigInt - fees1_in: [BigInt!] - fees1_not_in: [BigInt!] - fees0: BigInt - fees0_not: BigInt - fees0_gt: BigInt - fees0_lt: BigInt - fees0_gte: BigInt - fees0_lte: BigInt - fees0_in: [BigInt!] - fees0_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PrevAnnualVaultSnapshot_filter] - or: [PrevAnnualVaultSnapshot_filter] -} - -enum PrevAnnualVaultSnapshot_orderBy { - id - timestamp - vaultAddress - vaultAddress__id - vaultAddress__deployer - vaultAddress__token0 - vaultAddress__token1 - vaultAddress__totalAmount0 - vaultAddress__totalAmount1 - vaultAddress__createdAt - vaultAddress__lastSnapshot - vaultAddress__pool - vaultAddress__state - vaultAddress__annualPercentageYield - vaultAddress__annualPercentageDailyYield - vaultAddress__annualPercentageMonthlyYield - vaultAddress__annualPercentageYearlyYield - vaultAddress__lastTotalT0ValuePerLPT - vaultAddress__accruedStrategistFees0 - vaultAddress__accruedStrategistFees1 - vaultAddress__fees0 - vaultAddress__fees1 - vaultAddress__beaconName - vaultAddress__gasUsed - vaultAddress__gasDeposited - vaultAddress__totalLPTokensIssued - vaultAddress__token1Symbol - vaultAddress__decimals - vaultAddress__feeTier - vaultAddress__name - vaultAddress__symbol - vaultAddress__token0Balance - vaultAddress__token0Decimals - vaultAddress__token0Name - vaultAddress__token0Symbol - vaultAddress__token1Balance - vaultAddress__token1Decimals - vaultAddress__token1Name - vaultAddress__payloadIpfs - vaultAddress__vaultManager - vaultAddress__averageFeeArrPerSecond - vaultAddress__totalSnapshots - vaultAddress__annualFeeARR - vaultAddress__dailyFeeAPR - vaultAddress__weeklyFeeAPR - vaultAddress__totalValueLockedToken0 - vaultAddress__totalValueLockedToken1 - totalAmount0 - totalAmount1 - sqrtPriceX96 - totalSupply - fees1 - fees0 -} - -type PrevDailyVaultSnapshot { - id: ID! - timestamp: BigInt! - vaultAddress: Vault! - totalAmount0: BigInt! - totalAmount1: BigInt! - sqrtPriceX96: BigInt! - totalSupply: BigInt! - fees1: BigInt! - fees0: BigInt! -} - -input PrevDailyVaultSnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - vaultAddress: String - vaultAddress_not: String - vaultAddress_gt: String - vaultAddress_lt: String - vaultAddress_gte: String - vaultAddress_lte: String - vaultAddress_in: [String!] - vaultAddress_not_in: [String!] - vaultAddress_contains: String - vaultAddress_contains_nocase: String - vaultAddress_not_contains: String - vaultAddress_not_contains_nocase: String - vaultAddress_starts_with: String - vaultAddress_starts_with_nocase: String - vaultAddress_not_starts_with: String - vaultAddress_not_starts_with_nocase: String - vaultAddress_ends_with: String - vaultAddress_ends_with_nocase: String - vaultAddress_not_ends_with: String - vaultAddress_not_ends_with_nocase: String - vaultAddress_: Vault_filter - totalAmount0: BigInt - totalAmount0_not: BigInt - totalAmount0_gt: BigInt - totalAmount0_lt: BigInt - totalAmount0_gte: BigInt - totalAmount0_lte: BigInt - totalAmount0_in: [BigInt!] - totalAmount0_not_in: [BigInt!] - totalAmount1: BigInt - totalAmount1_not: BigInt - totalAmount1_gt: BigInt - totalAmount1_lt: BigInt - totalAmount1_gte: BigInt - totalAmount1_lte: BigInt - totalAmount1_in: [BigInt!] - totalAmount1_not_in: [BigInt!] - sqrtPriceX96: BigInt - sqrtPriceX96_not: BigInt - sqrtPriceX96_gt: BigInt - sqrtPriceX96_lt: BigInt - sqrtPriceX96_gte: BigInt - sqrtPriceX96_lte: BigInt - sqrtPriceX96_in: [BigInt!] - sqrtPriceX96_not_in: [BigInt!] - totalSupply: BigInt - totalSupply_not: BigInt - totalSupply_gt: BigInt - totalSupply_lt: BigInt - totalSupply_gte: BigInt - totalSupply_lte: BigInt - totalSupply_in: [BigInt!] - totalSupply_not_in: [BigInt!] - fees1: BigInt - fees1_not: BigInt - fees1_gt: BigInt - fees1_lt: BigInt - fees1_gte: BigInt - fees1_lte: BigInt - fees1_in: [BigInt!] - fees1_not_in: [BigInt!] - fees0: BigInt - fees0_not: BigInt - fees0_gt: BigInt - fees0_lt: BigInt - fees0_gte: BigInt - fees0_lte: BigInt - fees0_in: [BigInt!] - fees0_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PrevDailyVaultSnapshot_filter] - or: [PrevDailyVaultSnapshot_filter] -} - -enum PrevDailyVaultSnapshot_orderBy { - id - timestamp - vaultAddress - vaultAddress__id - vaultAddress__deployer - vaultAddress__token0 - vaultAddress__token1 - vaultAddress__totalAmount0 - vaultAddress__totalAmount1 - vaultAddress__createdAt - vaultAddress__lastSnapshot - vaultAddress__pool - vaultAddress__state - vaultAddress__annualPercentageYield - vaultAddress__annualPercentageDailyYield - vaultAddress__annualPercentageMonthlyYield - vaultAddress__annualPercentageYearlyYield - vaultAddress__lastTotalT0ValuePerLPT - vaultAddress__accruedStrategistFees0 - vaultAddress__accruedStrategistFees1 - vaultAddress__fees0 - vaultAddress__fees1 - vaultAddress__beaconName - vaultAddress__gasUsed - vaultAddress__gasDeposited - vaultAddress__totalLPTokensIssued - vaultAddress__token1Symbol - vaultAddress__decimals - vaultAddress__feeTier - vaultAddress__name - vaultAddress__symbol - vaultAddress__token0Balance - vaultAddress__token0Decimals - vaultAddress__token0Name - vaultAddress__token0Symbol - vaultAddress__token1Balance - vaultAddress__token1Decimals - vaultAddress__token1Name - vaultAddress__payloadIpfs - vaultAddress__vaultManager - vaultAddress__averageFeeArrPerSecond - vaultAddress__totalSnapshots - vaultAddress__annualFeeARR - vaultAddress__dailyFeeAPR - vaultAddress__weeklyFeeAPR - vaultAddress__totalValueLockedToken0 - vaultAddress__totalValueLockedToken1 - totalAmount0 - totalAmount1 - sqrtPriceX96 - totalSupply - fees1 - fees0 -} - -type PrevMonthlyVaultSnapshot { - id: ID! - timestamp: BigInt! - vaultAddress: Vault! - totalAmount0: BigInt! - totalAmount1: BigInt! - sqrtPriceX96: BigInt! - totalSupply: BigInt! - fees1: BigInt! - fees0: BigInt! -} - -input PrevMonthlyVaultSnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - vaultAddress: String - vaultAddress_not: String - vaultAddress_gt: String - vaultAddress_lt: String - vaultAddress_gte: String - vaultAddress_lte: String - vaultAddress_in: [String!] - vaultAddress_not_in: [String!] - vaultAddress_contains: String - vaultAddress_contains_nocase: String - vaultAddress_not_contains: String - vaultAddress_not_contains_nocase: String - vaultAddress_starts_with: String - vaultAddress_starts_with_nocase: String - vaultAddress_not_starts_with: String - vaultAddress_not_starts_with_nocase: String - vaultAddress_ends_with: String - vaultAddress_ends_with_nocase: String - vaultAddress_not_ends_with: String - vaultAddress_not_ends_with_nocase: String - vaultAddress_: Vault_filter - totalAmount0: BigInt - totalAmount0_not: BigInt - totalAmount0_gt: BigInt - totalAmount0_lt: BigInt - totalAmount0_gte: BigInt - totalAmount0_lte: BigInt - totalAmount0_in: [BigInt!] - totalAmount0_not_in: [BigInt!] - totalAmount1: BigInt - totalAmount1_not: BigInt - totalAmount1_gt: BigInt - totalAmount1_lt: BigInt - totalAmount1_gte: BigInt - totalAmount1_lte: BigInt - totalAmount1_in: [BigInt!] - totalAmount1_not_in: [BigInt!] - sqrtPriceX96: BigInt - sqrtPriceX96_not: BigInt - sqrtPriceX96_gt: BigInt - sqrtPriceX96_lt: BigInt - sqrtPriceX96_gte: BigInt - sqrtPriceX96_lte: BigInt - sqrtPriceX96_in: [BigInt!] - sqrtPriceX96_not_in: [BigInt!] - totalSupply: BigInt - totalSupply_not: BigInt - totalSupply_gt: BigInt - totalSupply_lt: BigInt - totalSupply_gte: BigInt - totalSupply_lte: BigInt - totalSupply_in: [BigInt!] - totalSupply_not_in: [BigInt!] - fees1: BigInt - fees1_not: BigInt - fees1_gt: BigInt - fees1_lt: BigInt - fees1_gte: BigInt - fees1_lte: BigInt - fees1_in: [BigInt!] - fees1_not_in: [BigInt!] - fees0: BigInt - fees0_not: BigInt - fees0_gt: BigInt - fees0_lt: BigInt - fees0_gte: BigInt - fees0_lte: BigInt - fees0_in: [BigInt!] - fees0_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PrevMonthlyVaultSnapshot_filter] - or: [PrevMonthlyVaultSnapshot_filter] -} - -enum PrevMonthlyVaultSnapshot_orderBy { - id - timestamp - vaultAddress - vaultAddress__id - vaultAddress__deployer - vaultAddress__token0 - vaultAddress__token1 - vaultAddress__totalAmount0 - vaultAddress__totalAmount1 - vaultAddress__createdAt - vaultAddress__lastSnapshot - vaultAddress__pool - vaultAddress__state - vaultAddress__annualPercentageYield - vaultAddress__annualPercentageDailyYield - vaultAddress__annualPercentageMonthlyYield - vaultAddress__annualPercentageYearlyYield - vaultAddress__lastTotalT0ValuePerLPT - vaultAddress__accruedStrategistFees0 - vaultAddress__accruedStrategistFees1 - vaultAddress__fees0 - vaultAddress__fees1 - vaultAddress__beaconName - vaultAddress__gasUsed - vaultAddress__gasDeposited - vaultAddress__totalLPTokensIssued - vaultAddress__token1Symbol - vaultAddress__decimals - vaultAddress__feeTier - vaultAddress__name - vaultAddress__symbol - vaultAddress__token0Balance - vaultAddress__token0Decimals - vaultAddress__token0Name - vaultAddress__token0Symbol - vaultAddress__token1Balance - vaultAddress__token1Decimals - vaultAddress__token1Name - vaultAddress__payloadIpfs - vaultAddress__vaultManager - vaultAddress__averageFeeArrPerSecond - vaultAddress__totalSnapshots - vaultAddress__annualFeeARR - vaultAddress__dailyFeeAPR - vaultAddress__weeklyFeeAPR - vaultAddress__totalValueLockedToken0 - vaultAddress__totalValueLockedToken1 - totalAmount0 - totalAmount1 - sqrtPriceX96 - totalSupply - fees1 - fees0 -} - -type PrevVaultSnapshot { - id: ID! - timestamp: BigInt! - vaultAddress: Vault! - totalAmount0: BigInt! - totalAmount1: BigInt! - sqrtPriceX96: BigInt! - totalSupply: BigInt! - fees1: BigInt! - fees0: BigInt! -} - -input PrevVaultSnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - vaultAddress: String - vaultAddress_not: String - vaultAddress_gt: String - vaultAddress_lt: String - vaultAddress_gte: String - vaultAddress_lte: String - vaultAddress_in: [String!] - vaultAddress_not_in: [String!] - vaultAddress_contains: String - vaultAddress_contains_nocase: String - vaultAddress_not_contains: String - vaultAddress_not_contains_nocase: String - vaultAddress_starts_with: String - vaultAddress_starts_with_nocase: String - vaultAddress_not_starts_with: String - vaultAddress_not_starts_with_nocase: String - vaultAddress_ends_with: String - vaultAddress_ends_with_nocase: String - vaultAddress_not_ends_with: String - vaultAddress_not_ends_with_nocase: String - vaultAddress_: Vault_filter - totalAmount0: BigInt - totalAmount0_not: BigInt - totalAmount0_gt: BigInt - totalAmount0_lt: BigInt - totalAmount0_gte: BigInt - totalAmount0_lte: BigInt - totalAmount0_in: [BigInt!] - totalAmount0_not_in: [BigInt!] - totalAmount1: BigInt - totalAmount1_not: BigInt - totalAmount1_gt: BigInt - totalAmount1_lt: BigInt - totalAmount1_gte: BigInt - totalAmount1_lte: BigInt - totalAmount1_in: [BigInt!] - totalAmount1_not_in: [BigInt!] - sqrtPriceX96: BigInt - sqrtPriceX96_not: BigInt - sqrtPriceX96_gt: BigInt - sqrtPriceX96_lt: BigInt - sqrtPriceX96_gte: BigInt - sqrtPriceX96_lte: BigInt - sqrtPriceX96_in: [BigInt!] - sqrtPriceX96_not_in: [BigInt!] - totalSupply: BigInt - totalSupply_not: BigInt - totalSupply_gt: BigInt - totalSupply_lt: BigInt - totalSupply_gte: BigInt - totalSupply_lte: BigInt - totalSupply_in: [BigInt!] - totalSupply_not_in: [BigInt!] - fees1: BigInt - fees1_not: BigInt - fees1_gt: BigInt - fees1_lt: BigInt - fees1_gte: BigInt - fees1_lte: BigInt - fees1_in: [BigInt!] - fees1_not_in: [BigInt!] - fees0: BigInt - fees0_not: BigInt - fees0_gt: BigInt - fees0_lt: BigInt - fees0_gte: BigInt - fees0_lte: BigInt - fees0_in: [BigInt!] - fees0_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PrevVaultSnapshot_filter] - or: [PrevVaultSnapshot_filter] -} - -enum PrevVaultSnapshot_orderBy { - id - timestamp - vaultAddress - vaultAddress__id - vaultAddress__deployer - vaultAddress__token0 - vaultAddress__token1 - vaultAddress__totalAmount0 - vaultAddress__totalAmount1 - vaultAddress__createdAt - vaultAddress__lastSnapshot - vaultAddress__pool - vaultAddress__state - vaultAddress__annualPercentageYield - vaultAddress__annualPercentageDailyYield - vaultAddress__annualPercentageMonthlyYield - vaultAddress__annualPercentageYearlyYield - vaultAddress__lastTotalT0ValuePerLPT - vaultAddress__accruedStrategistFees0 - vaultAddress__accruedStrategistFees1 - vaultAddress__fees0 - vaultAddress__fees1 - vaultAddress__beaconName - vaultAddress__gasUsed - vaultAddress__gasDeposited - vaultAddress__totalLPTokensIssued - vaultAddress__token1Symbol - vaultAddress__decimals - vaultAddress__feeTier - vaultAddress__name - vaultAddress__symbol - vaultAddress__token0Balance - vaultAddress__token0Decimals - vaultAddress__token0Name - vaultAddress__token0Symbol - vaultAddress__token1Balance - vaultAddress__token1Decimals - vaultAddress__token1Name - vaultAddress__payloadIpfs - vaultAddress__vaultManager - vaultAddress__averageFeeArrPerSecond - vaultAddress__totalSnapshots - vaultAddress__annualFeeARR - vaultAddress__dailyFeeAPR - vaultAddress__weeklyFeeAPR - vaultAddress__totalValueLockedToken0 - vaultAddress__totalValueLockedToken1 - totalAmount0 - totalAmount1 - sqrtPriceX96 - totalSupply - fees1 - fees0 -} - -type PrevWeeklyVaultSnapshot { - id: ID! - timestamp: BigInt! - vaultAddress: Vault! - totalAmount0: BigInt! - totalAmount1: BigInt! - sqrtPriceX96: BigInt! - totalSupply: BigInt! - fees1: BigInt! - fees0: BigInt! - averageFeeArrPerSecond: BigDecimal! - totalSnapshots: BigInt! - weeklyFeeApr: BigDecimal! -} - -input PrevWeeklyVaultSnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - vaultAddress: String - vaultAddress_not: String - vaultAddress_gt: String - vaultAddress_lt: String - vaultAddress_gte: String - vaultAddress_lte: String - vaultAddress_in: [String!] - vaultAddress_not_in: [String!] - vaultAddress_contains: String - vaultAddress_contains_nocase: String - vaultAddress_not_contains: String - vaultAddress_not_contains_nocase: String - vaultAddress_starts_with: String - vaultAddress_starts_with_nocase: String - vaultAddress_not_starts_with: String - vaultAddress_not_starts_with_nocase: String - vaultAddress_ends_with: String - vaultAddress_ends_with_nocase: String - vaultAddress_not_ends_with: String - vaultAddress_not_ends_with_nocase: String - vaultAddress_: Vault_filter - totalAmount0: BigInt - totalAmount0_not: BigInt - totalAmount0_gt: BigInt - totalAmount0_lt: BigInt - totalAmount0_gte: BigInt - totalAmount0_lte: BigInt - totalAmount0_in: [BigInt!] - totalAmount0_not_in: [BigInt!] - totalAmount1: BigInt - totalAmount1_not: BigInt - totalAmount1_gt: BigInt - totalAmount1_lt: BigInt - totalAmount1_gte: BigInt - totalAmount1_lte: BigInt - totalAmount1_in: [BigInt!] - totalAmount1_not_in: [BigInt!] - sqrtPriceX96: BigInt - sqrtPriceX96_not: BigInt - sqrtPriceX96_gt: BigInt - sqrtPriceX96_lt: BigInt - sqrtPriceX96_gte: BigInt - sqrtPriceX96_lte: BigInt - sqrtPriceX96_in: [BigInt!] - sqrtPriceX96_not_in: [BigInt!] - totalSupply: BigInt - totalSupply_not: BigInt - totalSupply_gt: BigInt - totalSupply_lt: BigInt - totalSupply_gte: BigInt - totalSupply_lte: BigInt - totalSupply_in: [BigInt!] - totalSupply_not_in: [BigInt!] - fees1: BigInt - fees1_not: BigInt - fees1_gt: BigInt - fees1_lt: BigInt - fees1_gte: BigInt - fees1_lte: BigInt - fees1_in: [BigInt!] - fees1_not_in: [BigInt!] - fees0: BigInt - fees0_not: BigInt - fees0_gt: BigInt - fees0_lt: BigInt - fees0_gte: BigInt - fees0_lte: BigInt - fees0_in: [BigInt!] - fees0_not_in: [BigInt!] - averageFeeArrPerSecond: BigDecimal - averageFeeArrPerSecond_not: BigDecimal - averageFeeArrPerSecond_gt: BigDecimal - averageFeeArrPerSecond_lt: BigDecimal - averageFeeArrPerSecond_gte: BigDecimal - averageFeeArrPerSecond_lte: BigDecimal - averageFeeArrPerSecond_in: [BigDecimal!] - averageFeeArrPerSecond_not_in: [BigDecimal!] - totalSnapshots: BigInt - totalSnapshots_not: BigInt - totalSnapshots_gt: BigInt - totalSnapshots_lt: BigInt - totalSnapshots_gte: BigInt - totalSnapshots_lte: BigInt - totalSnapshots_in: [BigInt!] - totalSnapshots_not_in: [BigInt!] - weeklyFeeApr: BigDecimal - weeklyFeeApr_not: BigDecimal - weeklyFeeApr_gt: BigDecimal - weeklyFeeApr_lt: BigDecimal - weeklyFeeApr_gte: BigDecimal - weeklyFeeApr_lte: BigDecimal - weeklyFeeApr_in: [BigDecimal!] - weeklyFeeApr_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PrevWeeklyVaultSnapshot_filter] - or: [PrevWeeklyVaultSnapshot_filter] -} - -enum PrevWeeklyVaultSnapshot_orderBy { - id - timestamp - vaultAddress - vaultAddress__id - vaultAddress__deployer - vaultAddress__token0 - vaultAddress__token1 - vaultAddress__totalAmount0 - vaultAddress__totalAmount1 - vaultAddress__createdAt - vaultAddress__lastSnapshot - vaultAddress__pool - vaultAddress__state - vaultAddress__annualPercentageYield - vaultAddress__annualPercentageDailyYield - vaultAddress__annualPercentageMonthlyYield - vaultAddress__annualPercentageYearlyYield - vaultAddress__lastTotalT0ValuePerLPT - vaultAddress__accruedStrategistFees0 - vaultAddress__accruedStrategistFees1 - vaultAddress__fees0 - vaultAddress__fees1 - vaultAddress__beaconName - vaultAddress__gasUsed - vaultAddress__gasDeposited - vaultAddress__totalLPTokensIssued - vaultAddress__token1Symbol - vaultAddress__decimals - vaultAddress__feeTier - vaultAddress__name - vaultAddress__symbol - vaultAddress__token0Balance - vaultAddress__token0Decimals - vaultAddress__token0Name - vaultAddress__token0Symbol - vaultAddress__token1Balance - vaultAddress__token1Decimals - vaultAddress__token1Name - vaultAddress__payloadIpfs - vaultAddress__vaultManager - vaultAddress__averageFeeArrPerSecond - vaultAddress__totalSnapshots - vaultAddress__annualFeeARR - vaultAddress__dailyFeeAPR - vaultAddress__weeklyFeeAPR - vaultAddress__totalValueLockedToken0 - vaultAddress__totalValueLockedToken1 - totalAmount0 - totalAmount1 - sqrtPriceX96 - totalSupply - fees1 - fees0 - averageFeeArrPerSecond - totalSnapshots - weeklyFeeApr -} - -type Query { - keeper( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Keeper - keepers( - skip: Int = 0 - first: Int = 100 - orderBy: Keeper_orderBy - orderDirection: OrderDirection - where: Keeper_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Keeper!]! - runner( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Runner - runners( - skip: Int = 0 - first: Int = 100 - orderBy: Runner_orderBy - orderDirection: OrderDirection - where: Runner_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Runner!]! - queueTimeline( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): QueueTimeline - queueTimelines( - skip: Int = 0 - first: Int = 100 - orderBy: QueueTimeline_orderBy - orderDirection: OrderDirection - where: QueueTimeline_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [QueueTimeline!]! - permissionUpdate( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PermissionUpdate - permissionUpdates( - skip: Int = 0 - first: Int = 100 - orderBy: PermissionUpdate_orderBy - orderDirection: OrderDirection - where: PermissionUpdate_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PermissionUpdate!]! - orchestratorAction( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): OrchestratorAction - orchestratorActions( - skip: Int = 0 - first: Int = 100 - orderBy: OrchestratorAction_orderBy - orderDirection: OrderDirection - where: OrchestratorAction_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [OrchestratorAction!]! - vote( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Vote - votes( - skip: Int = 0 - first: Int = 100 - orderBy: Vote_orderBy - orderDirection: OrderDirection - where: Vote_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Vote!]! - actionFailure( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): ActionFailure - actionFailures( - skip: Int = 0 - first: Int = 100 - orderBy: ActionFailure_orderBy - orderDirection: OrderDirection - where: ActionFailure_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [ActionFailure!]! - creator( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Creator - creators( - skip: Int = 0 - first: Int = 100 - orderBy: Creator_orderBy - orderDirection: OrderDirection - where: Creator_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Creator!]! - creatorWithdrawal( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): CreatorWithdrawal - creatorWithdrawals( - skip: Int = 0 - first: Int = 100 - orderBy: CreatorWithdrawal_orderBy - orderDirection: OrderDirection - where: CreatorWithdrawal_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [CreatorWithdrawal!]! - strategy( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Strategy - strategies( - skip: Int = 0 - first: Int = 100 - orderBy: Strategy_orderBy - orderDirection: OrderDirection - where: Strategy_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Strategy!]! - vault( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Vault - vaults( - skip: Int = 0 - first: Int = 100 - orderBy: Vault_orderBy - orderDirection: OrderDirection - where: Vault_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Vault!]! - vaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultSnapshot - vaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: VaultSnapshot_orderBy - orderDirection: OrderDirection - where: VaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultSnapshot!]! - prevVaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PrevVaultSnapshot - prevVaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PrevVaultSnapshot_orderBy - orderDirection: OrderDirection - where: PrevVaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PrevVaultSnapshot!]! - prevDailyVaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PrevDailyVaultSnapshot - prevDailyVaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PrevDailyVaultSnapshot_orderBy - orderDirection: OrderDirection - where: PrevDailyVaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PrevDailyVaultSnapshot!]! - prevMonthlyVaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PrevMonthlyVaultSnapshot - prevMonthlyVaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PrevMonthlyVaultSnapshot_orderBy - orderDirection: OrderDirection - where: PrevMonthlyVaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PrevMonthlyVaultSnapshot!]! - prevAnnualVaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PrevAnnualVaultSnapshot - prevAnnualVaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PrevAnnualVaultSnapshot_orderBy - orderDirection: OrderDirection - where: PrevAnnualVaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PrevAnnualVaultSnapshot!]! - prevWeeklyVaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PrevWeeklyVaultSnapshot - prevWeeklyVaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PrevWeeklyVaultSnapshot_orderBy - orderDirection: OrderDirection - where: PrevWeeklyVaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PrevWeeklyVaultSnapshot!]! - vaultStateChanged( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultStateChanged - vaultStateChangeds( - skip: Int = 0 - first: Int = 100 - orderBy: VaultStateChanged_orderBy - orderDirection: OrderDirection - where: VaultStateChanged_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultStateChanged!]! - vaultDeposit( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultDeposit - vaultDeposits( - skip: Int = 0 - first: Int = 100 - orderBy: VaultDeposit_orderBy - orderDirection: OrderDirection - where: VaultDeposit_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultDeposit!]! - vaultWithdraw( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultWithdraw - vaultWithdraws( - skip: Int = 0 - first: Int = 100 - orderBy: VaultWithdraw_orderBy - orderDirection: OrderDirection - where: VaultWithdraw_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultWithdraw!]! - depositor( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Depositor - depositors( - skip: Int = 0 - first: Int = 100 - orderBy: Depositor_orderBy - orderDirection: OrderDirection - where: Depositor_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Depositor!]! - vaultBeacon( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultBeacon - vaultBeacons( - skip: Int = 0 - first: Int = 100 - orderBy: VaultBeacon_orderBy - orderDirection: OrderDirection - where: VaultBeacon_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultBeacon!]! - vaultPosition( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultPosition - vaultPositions( - skip: Int = 0 - first: Int = 100 - orderBy: VaultPosition_orderBy - orderDirection: OrderDirection - where: VaultPosition_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultPosition!]! - liquiditySteer( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): LiquiditySteer - liquiditySteers( - skip: Int = 0 - first: Int = 100 - orderBy: LiquiditySteer_orderBy - orderDirection: OrderDirection - where: LiquiditySteer_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [LiquiditySteer!]! - orchestratorReward( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): OrchestratorReward - orchestratorRewards( - skip: Int = 0 - first: Int = 100 - orderBy: OrchestratorReward_orderBy - orderDirection: OrderDirection - where: OrchestratorReward_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [OrchestratorReward!]! - orchestratorRewardTracker( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): OrchestratorRewardTracker - orchestratorRewardTrackers( - skip: Int = 0 - first: Int = 100 - orderBy: OrchestratorRewardTracker_orderBy - orderDirection: OrderDirection - where: OrchestratorRewardTracker_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [OrchestratorRewardTracker!]! - orchestratorRewardSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): OrchestratorRewardSnapshot - orchestratorRewardSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: OrchestratorRewardSnapshot_orderBy - orderDirection: OrderDirection - where: OrchestratorRewardSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [OrchestratorRewardSnapshot!]! - bundle( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Bundle - bundles( - skip: Int = 0 - first: Int = 100 - orderBy: Bundle_orderBy - orderDirection: OrderDirection - where: Bundle_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Bundle!]! - job( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Job - jobs( - skip: Int = 0 - first: Int = 100 - orderBy: Job_orderBy - orderDirection: OrderDirection - where: Job_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Job!]! - jobExecution( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): JobExecution - jobExecutions( - skip: Int = 0 - first: Int = 100 - orderBy: JobExecution_orderBy - orderDirection: OrderDirection - where: JobExecution_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [JobExecution!]! - jobGasDeposited( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): JobGasDeposited - jobGasDepositeds( - skip: Int = 0 - first: Int = 100 - orderBy: JobGasDeposited_orderBy - orderDirection: OrderDirection - where: JobGasDeposited_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [JobGasDeposited!]! - jobGasWithdrawn( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): JobGasWithdrawn - jobGasWithdrawns( - skip: Int = 0 - first: Int = 100 - orderBy: JobGasWithdrawn_orderBy - orderDirection: OrderDirection - where: JobGasWithdrawn_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [JobGasWithdrawn!]! - vaultGasUsed( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultGasUsed - vaultGasUseds( - skip: Int = 0 - first: Int = 100 - orderBy: VaultGasUsed_orderBy - orderDirection: OrderDirection - where: VaultGasUsed_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultGasUsed!]! - vaultGasDeposited( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultGasDeposited - vaultGasDepositeds( - skip: Int = 0 - first: Int = 100 - orderBy: VaultGasDeposited_orderBy - orderDirection: OrderDirection - where: VaultGasDeposited_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultGasDeposited!]! - vaultGasWithdrawn( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultGasWithdrawn - vaultGasWithdrawns( - skip: Int = 0 - first: Int = 100 - orderBy: VaultGasWithdrawn_orderBy - orderDirection: OrderDirection - where: VaultGasWithdrawn_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultGasWithdrawn!]! - whiteListManager( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): WhiteListManager - whiteListManagers( - skip: Int = 0 - first: Int = 100 - orderBy: WhiteListManager_orderBy - orderDirection: OrderDirection - where: WhiteListManager_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [WhiteListManager!]! - whiteListVaultPermission( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): WhiteListVaultPermission - whiteListVaultPermissions( - skip: Int = 0 - first: Int = 100 - orderBy: WhiteListVaultPermission_orderBy - orderDirection: OrderDirection - where: WhiteListVaultPermission_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [WhiteListVaultPermission!]! - leaderBoard( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): LeaderBoard - leaderBoards( - skip: Int = 0 - first: Int = 100 - orderBy: LeaderBoard_orderBy - orderDirection: OrderDirection - where: LeaderBoard_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [LeaderBoard!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type QueueTimeline { - id: ID! - keeper: Keeper! - timeDelay: BigInt! - queued: Boolean! -} - -input QueueTimeline_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - keeper: String - keeper_not: String - keeper_gt: String - keeper_lt: String - keeper_gte: String - keeper_lte: String - keeper_in: [String!] - keeper_not_in: [String!] - keeper_contains: String - keeper_contains_nocase: String - keeper_not_contains: String - keeper_not_contains_nocase: String - keeper_starts_with: String - keeper_starts_with_nocase: String - keeper_not_starts_with: String - keeper_not_starts_with_nocase: String - keeper_ends_with: String - keeper_ends_with_nocase: String - keeper_not_ends_with: String - keeper_not_ends_with_nocase: String - keeper_: Keeper_filter - timeDelay: BigInt - timeDelay_not: BigInt - timeDelay_gt: BigInt - timeDelay_lt: BigInt - timeDelay_gte: BigInt - timeDelay_lte: BigInt - timeDelay_in: [BigInt!] - timeDelay_not_in: [BigInt!] - queued: Boolean - queued_not: Boolean - queued_in: [Boolean!] - queued_not_in: [Boolean!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [QueueTimeline_filter] - or: [QueueTimeline_filter] -} - -enum QueueTimeline_orderBy { - id - keeper - keeper__id - keeper__bondHeld - keeper__index - keeper__status - timeDelay - queued -} - -type Runner { - id: ID! - bondHeld: BigInt! - - """Time when the runner was created""" - createdAt: BigInt! -} - -input Runner_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - bondHeld: BigInt - bondHeld_not: BigInt - bondHeld_gt: BigInt - bondHeld_lt: BigInt - bondHeld_gte: BigInt - bondHeld_lte: BigInt - bondHeld_in: [BigInt!] - bondHeld_not_in: [BigInt!] - createdAt: BigInt - createdAt_not: BigInt - createdAt_gt: BigInt - createdAt_lt: BigInt - createdAt_gte: BigInt - createdAt_lte: BigInt - createdAt_in: [BigInt!] - createdAt_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Runner_filter] - or: [Runner_filter] -} - -enum Runner_orderBy { - id - bondHeld - createdAt -} - -type Strategy { - id: ID! - name: String! - vault(skip: Int = 0, first: Int = 100, orderBy: Vault_orderBy, orderDirection: OrderDirection, where: Vault_filter): [Vault!]! - createdAt: BigInt! - admin: String! - creator: Creator! - executionBundle: String! -} - -input Strategy_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - name: String - name_not: String - name_gt: String - name_lt: String - name_gte: String - name_lte: String - name_in: [String!] - name_not_in: [String!] - name_contains: String - name_contains_nocase: String - name_not_contains: String - name_not_contains_nocase: String - name_starts_with: String - name_starts_with_nocase: String - name_not_starts_with: String - name_not_starts_with_nocase: String - name_ends_with: String - name_ends_with_nocase: String - name_not_ends_with: String - name_not_ends_with_nocase: String - vault_: Vault_filter - createdAt: BigInt - createdAt_not: BigInt - createdAt_gt: BigInt - createdAt_lt: BigInt - createdAt_gte: BigInt - createdAt_lte: BigInt - createdAt_in: [BigInt!] - createdAt_not_in: [BigInt!] - admin: String - admin_not: String - admin_gt: String - admin_lt: String - admin_gte: String - admin_lte: String - admin_in: [String!] - admin_not_in: [String!] - admin_contains: String - admin_contains_nocase: String - admin_not_contains: String - admin_not_contains_nocase: String - admin_starts_with: String - admin_starts_with_nocase: String - admin_not_starts_with: String - admin_not_starts_with_nocase: String - admin_ends_with: String - admin_ends_with_nocase: String - admin_not_ends_with: String - admin_not_ends_with_nocase: String - creator: String - creator_not: String - creator_gt: String - creator_lt: String - creator_gte: String - creator_lte: String - creator_in: [String!] - creator_not_in: [String!] - creator_contains: String - creator_contains_nocase: String - creator_not_contains: String - creator_not_contains_nocase: String - creator_starts_with: String - creator_starts_with_nocase: String - creator_not_starts_with: String - creator_not_starts_with_nocase: String - creator_ends_with: String - creator_ends_with_nocase: String - creator_not_ends_with: String - creator_not_ends_with_nocase: String - creator_: Creator_filter - executionBundle: String - executionBundle_not: String - executionBundle_gt: String - executionBundle_lt: String - executionBundle_gte: String - executionBundle_lte: String - executionBundle_in: [String!] - executionBundle_not_in: [String!] - executionBundle_contains: String - executionBundle_contains_nocase: String - executionBundle_not_contains: String - executionBundle_not_contains_nocase: String - executionBundle_starts_with: String - executionBundle_starts_with_nocase: String - executionBundle_not_starts_with: String - executionBundle_not_starts_with_nocase: String - executionBundle_ends_with: String - executionBundle_ends_with_nocase: String - executionBundle_not_ends_with: String - executionBundle_not_ends_with_nocase: String - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Strategy_filter] - or: [Strategy_filter] -} - -enum Strategy_orderBy { - id - name - vault - createdAt - admin - creator - creator__id - creator__revenue - creator__totalValueLocked - creator__totalYield - executionBundle -} - -type Subscription { - keeper( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Keeper - keepers( - skip: Int = 0 - first: Int = 100 - orderBy: Keeper_orderBy - orderDirection: OrderDirection - where: Keeper_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Keeper!]! - runner( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Runner - runners( - skip: Int = 0 - first: Int = 100 - orderBy: Runner_orderBy - orderDirection: OrderDirection - where: Runner_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Runner!]! - queueTimeline( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): QueueTimeline - queueTimelines( - skip: Int = 0 - first: Int = 100 - orderBy: QueueTimeline_orderBy - orderDirection: OrderDirection - where: QueueTimeline_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [QueueTimeline!]! - permissionUpdate( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PermissionUpdate - permissionUpdates( - skip: Int = 0 - first: Int = 100 - orderBy: PermissionUpdate_orderBy - orderDirection: OrderDirection - where: PermissionUpdate_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PermissionUpdate!]! - orchestratorAction( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): OrchestratorAction - orchestratorActions( - skip: Int = 0 - first: Int = 100 - orderBy: OrchestratorAction_orderBy - orderDirection: OrderDirection - where: OrchestratorAction_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [OrchestratorAction!]! - vote( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Vote - votes( - skip: Int = 0 - first: Int = 100 - orderBy: Vote_orderBy - orderDirection: OrderDirection - where: Vote_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Vote!]! - actionFailure( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): ActionFailure - actionFailures( - skip: Int = 0 - first: Int = 100 - orderBy: ActionFailure_orderBy - orderDirection: OrderDirection - where: ActionFailure_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [ActionFailure!]! - creator( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Creator - creators( - skip: Int = 0 - first: Int = 100 - orderBy: Creator_orderBy - orderDirection: OrderDirection - where: Creator_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Creator!]! - creatorWithdrawal( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): CreatorWithdrawal - creatorWithdrawals( - skip: Int = 0 - first: Int = 100 - orderBy: CreatorWithdrawal_orderBy - orderDirection: OrderDirection - where: CreatorWithdrawal_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [CreatorWithdrawal!]! - strategy( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Strategy - strategies( - skip: Int = 0 - first: Int = 100 - orderBy: Strategy_orderBy - orderDirection: OrderDirection - where: Strategy_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Strategy!]! - vault( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Vault - vaults( - skip: Int = 0 - first: Int = 100 - orderBy: Vault_orderBy - orderDirection: OrderDirection - where: Vault_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Vault!]! - vaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultSnapshot - vaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: VaultSnapshot_orderBy - orderDirection: OrderDirection - where: VaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultSnapshot!]! - prevVaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PrevVaultSnapshot - prevVaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PrevVaultSnapshot_orderBy - orderDirection: OrderDirection - where: PrevVaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PrevVaultSnapshot!]! - prevDailyVaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PrevDailyVaultSnapshot - prevDailyVaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PrevDailyVaultSnapshot_orderBy - orderDirection: OrderDirection - where: PrevDailyVaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PrevDailyVaultSnapshot!]! - prevMonthlyVaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PrevMonthlyVaultSnapshot - prevMonthlyVaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PrevMonthlyVaultSnapshot_orderBy - orderDirection: OrderDirection - where: PrevMonthlyVaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PrevMonthlyVaultSnapshot!]! - prevAnnualVaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PrevAnnualVaultSnapshot - prevAnnualVaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PrevAnnualVaultSnapshot_orderBy - orderDirection: OrderDirection - where: PrevAnnualVaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PrevAnnualVaultSnapshot!]! - prevWeeklyVaultSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PrevWeeklyVaultSnapshot - prevWeeklyVaultSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PrevWeeklyVaultSnapshot_orderBy - orderDirection: OrderDirection - where: PrevWeeklyVaultSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PrevWeeklyVaultSnapshot!]! - vaultStateChanged( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultStateChanged - vaultStateChangeds( - skip: Int = 0 - first: Int = 100 - orderBy: VaultStateChanged_orderBy - orderDirection: OrderDirection - where: VaultStateChanged_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultStateChanged!]! - vaultDeposit( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultDeposit - vaultDeposits( - skip: Int = 0 - first: Int = 100 - orderBy: VaultDeposit_orderBy - orderDirection: OrderDirection - where: VaultDeposit_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultDeposit!]! - vaultWithdraw( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultWithdraw - vaultWithdraws( - skip: Int = 0 - first: Int = 100 - orderBy: VaultWithdraw_orderBy - orderDirection: OrderDirection - where: VaultWithdraw_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultWithdraw!]! - depositor( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Depositor - depositors( - skip: Int = 0 - first: Int = 100 - orderBy: Depositor_orderBy - orderDirection: OrderDirection - where: Depositor_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Depositor!]! - vaultBeacon( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultBeacon - vaultBeacons( - skip: Int = 0 - first: Int = 100 - orderBy: VaultBeacon_orderBy - orderDirection: OrderDirection - where: VaultBeacon_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultBeacon!]! - vaultPosition( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultPosition - vaultPositions( - skip: Int = 0 - first: Int = 100 - orderBy: VaultPosition_orderBy - orderDirection: OrderDirection - where: VaultPosition_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultPosition!]! - liquiditySteer( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): LiquiditySteer - liquiditySteers( - skip: Int = 0 - first: Int = 100 - orderBy: LiquiditySteer_orderBy - orderDirection: OrderDirection - where: LiquiditySteer_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [LiquiditySteer!]! - orchestratorReward( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): OrchestratorReward - orchestratorRewards( - skip: Int = 0 - first: Int = 100 - orderBy: OrchestratorReward_orderBy - orderDirection: OrderDirection - where: OrchestratorReward_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [OrchestratorReward!]! - orchestratorRewardTracker( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): OrchestratorRewardTracker - orchestratorRewardTrackers( - skip: Int = 0 - first: Int = 100 - orderBy: OrchestratorRewardTracker_orderBy - orderDirection: OrderDirection - where: OrchestratorRewardTracker_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [OrchestratorRewardTracker!]! - orchestratorRewardSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): OrchestratorRewardSnapshot - orchestratorRewardSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: OrchestratorRewardSnapshot_orderBy - orderDirection: OrderDirection - where: OrchestratorRewardSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [OrchestratorRewardSnapshot!]! - bundle( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Bundle - bundles( - skip: Int = 0 - first: Int = 100 - orderBy: Bundle_orderBy - orderDirection: OrderDirection - where: Bundle_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Bundle!]! - job( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Job - jobs( - skip: Int = 0 - first: Int = 100 - orderBy: Job_orderBy - orderDirection: OrderDirection - where: Job_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Job!]! - jobExecution( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): JobExecution - jobExecutions( - skip: Int = 0 - first: Int = 100 - orderBy: JobExecution_orderBy - orderDirection: OrderDirection - where: JobExecution_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [JobExecution!]! - jobGasDeposited( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): JobGasDeposited - jobGasDepositeds( - skip: Int = 0 - first: Int = 100 - orderBy: JobGasDeposited_orderBy - orderDirection: OrderDirection - where: JobGasDeposited_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [JobGasDeposited!]! - jobGasWithdrawn( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): JobGasWithdrawn - jobGasWithdrawns( - skip: Int = 0 - first: Int = 100 - orderBy: JobGasWithdrawn_orderBy - orderDirection: OrderDirection - where: JobGasWithdrawn_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [JobGasWithdrawn!]! - vaultGasUsed( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultGasUsed - vaultGasUseds( - skip: Int = 0 - first: Int = 100 - orderBy: VaultGasUsed_orderBy - orderDirection: OrderDirection - where: VaultGasUsed_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultGasUsed!]! - vaultGasDeposited( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultGasDeposited - vaultGasDepositeds( - skip: Int = 0 - first: Int = 100 - orderBy: VaultGasDeposited_orderBy - orderDirection: OrderDirection - where: VaultGasDeposited_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultGasDeposited!]! - vaultGasWithdrawn( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): VaultGasWithdrawn - vaultGasWithdrawns( - skip: Int = 0 - first: Int = 100 - orderBy: VaultGasWithdrawn_orderBy - orderDirection: OrderDirection - where: VaultGasWithdrawn_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [VaultGasWithdrawn!]! - whiteListManager( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): WhiteListManager - whiteListManagers( - skip: Int = 0 - first: Int = 100 - orderBy: WhiteListManager_orderBy - orderDirection: OrderDirection - where: WhiteListManager_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [WhiteListManager!]! - whiteListVaultPermission( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): WhiteListVaultPermission - whiteListVaultPermissions( - skip: Int = 0 - first: Int = 100 - orderBy: WhiteListVaultPermission_orderBy - orderDirection: OrderDirection - where: WhiteListVaultPermission_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [WhiteListVaultPermission!]! - leaderBoard( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): LeaderBoard - leaderBoards( - skip: Int = 0 - first: Int = 100 - orderBy: LeaderBoard_orderBy - orderDirection: OrderDirection - where: LeaderBoard_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [LeaderBoard!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -"A string representation of microseconds UNIX timestamp (16 digits)\n" -scalar Timestamp - -type Vault { - id: ID! - deployer: String! - token0: String! - token1: String! - totalAmount0: BigDecimal! - totalAmount1: BigDecimal! - createdAt: BigInt! - lastSnapshot: BigInt! - pool: String! - state: BigInt! - statusUpdates(skip: Int = 0, first: Int = 100, orderBy: VaultStateChanged_orderBy, orderDirection: OrderDirection, where: VaultStateChanged_filter): [VaultStateChanged!]! - strategyToken: Strategy! - - """Statistics""" - snapshots(skip: Int = 0, first: Int = 100, orderBy: VaultSnapshot_orderBy, orderDirection: OrderDirection, where: VaultSnapshot_filter): [VaultSnapshot!]! - permissions(skip: Int = 0, first: Int = 100, orderBy: WhiteListVaultPermission_orderBy, orderDirection: OrderDirection, where: WhiteListVaultPermission_filter): [WhiteListVaultPermission!]! - positions(skip: Int = 0, first: Int = 100, orderBy: VaultPosition_orderBy, orderDirection: OrderDirection, where: VaultPosition_filter): [VaultPosition!]! - depositors(skip: Int = 0, first: Int = 100, orderBy: Depositor_orderBy, orderDirection: OrderDirection, where: Depositor_filter): [Depositor!]! - annualPercentageYield: BigDecimal! - annualPercentageDailyYield: BigDecimal! - annualPercentageMonthlyYield: BigDecimal! - annualPercentageYearlyYield: BigDecimal! - lastTotalT0ValuePerLPT: BigDecimal! - accruedStrategistFees0: BigInt! - accruedStrategistFees1: BigInt! - fees0: BigInt! - fees1: BigInt! - beaconName: String! - jobs(skip: Int = 0, first: Int = 100, orderBy: Job_orderBy, orderDirection: OrderDirection, where: Job_filter): [Job!]! - gasUsed: BigInt! - gasDeposited: BigInt! - totalLPTokensIssued: BigInt! - token1Symbol: String! - decimals: BigInt! - feeTier: BigInt! - name: String! - symbol: String! - token0Balance: BigInt! - token0Decimals: BigInt! - token0Name: String! - token0Symbol: String! - token1Balance: BigInt! - token1Decimals: BigInt! - token1Name: String! - payloadIpfs: String! - vaultManager: String! - averageFeeArrPerSecond: BigDecimal! - totalSnapshots: BigInt! - annualFeeARR: BigDecimal! - dailyFeeAPR: BigDecimal! - weeklyFeeAPR: BigDecimal! - totalValueLockedToken0: BigDecimal! - totalValueLockedToken1: BigDecimal! -} - -type VaultBeacon { - """Address of the VaultBeacon""" - id: ID! - address: String! - - """IPFS Config for Beacon""" - ipfsHash: String! - name: String! - - """Beacon status""" - status: String! - timestamp: BigInt! - updateTimestamp: BigInt! -} - -input VaultBeacon_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - address: String - address_not: String - address_gt: String - address_lt: String - address_gte: String - address_lte: String - address_in: [String!] - address_not_in: [String!] - address_contains: String - address_contains_nocase: String - address_not_contains: String - address_not_contains_nocase: String - address_starts_with: String - address_starts_with_nocase: String - address_not_starts_with: String - address_not_starts_with_nocase: String - address_ends_with: String - address_ends_with_nocase: String - address_not_ends_with: String - address_not_ends_with_nocase: String - ipfsHash: String - ipfsHash_not: String - ipfsHash_gt: String - ipfsHash_lt: String - ipfsHash_gte: String - ipfsHash_lte: String - ipfsHash_in: [String!] - ipfsHash_not_in: [String!] - ipfsHash_contains: String - ipfsHash_contains_nocase: String - ipfsHash_not_contains: String - ipfsHash_not_contains_nocase: String - ipfsHash_starts_with: String - ipfsHash_starts_with_nocase: String - ipfsHash_not_starts_with: String - ipfsHash_not_starts_with_nocase: String - ipfsHash_ends_with: String - ipfsHash_ends_with_nocase: String - ipfsHash_not_ends_with: String - ipfsHash_not_ends_with_nocase: String - name: String - name_not: String - name_gt: String - name_lt: String - name_gte: String - name_lte: String - name_in: [String!] - name_not_in: [String!] - name_contains: String - name_contains_nocase: String - name_not_contains: String - name_not_contains_nocase: String - name_starts_with: String - name_starts_with_nocase: String - name_not_starts_with: String - name_not_starts_with_nocase: String - name_ends_with: String - name_ends_with_nocase: String - name_not_ends_with: String - name_not_ends_with_nocase: String - status: String - status_not: String - status_gt: String - status_lt: String - status_gte: String - status_lte: String - status_in: [String!] - status_not_in: [String!] - status_contains: String - status_contains_nocase: String - status_not_contains: String - status_not_contains_nocase: String - status_starts_with: String - status_starts_with_nocase: String - status_not_starts_with: String - status_not_starts_with_nocase: String - status_ends_with: String - status_ends_with_nocase: String - status_not_ends_with: String - status_not_ends_with_nocase: String - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - updateTimestamp: BigInt - updateTimestamp_not: BigInt - updateTimestamp_gt: BigInt - updateTimestamp_lt: BigInt - updateTimestamp_gte: BigInt - updateTimestamp_lte: BigInt - updateTimestamp_in: [BigInt!] - updateTimestamp_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [VaultBeacon_filter] - or: [VaultBeacon_filter] -} - -enum VaultBeacon_orderBy { - id - address - ipfsHash - name - status - timestamp - updateTimestamp -} - -type VaultDeposit { - """Address of the depositor""" - id: ID! - vault: Vault! - - """Amount of tokens deposited""" - amount0: BigDecimal! - amount1: BigDecimal! - - """Token Addresses""" - token0: String! - token1: String! - sender: String! - transactionHash: String! - - """Time when the deposit was made""" - timeStamp: BigInt! - shares: BigInt! - executor: String! - depositCaller: String! -} - -input VaultDeposit_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - vault_: Vault_filter - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - sender: String - sender_not: String - sender_gt: String - sender_lt: String - sender_gte: String - sender_lte: String - sender_in: [String!] - sender_not_in: [String!] - sender_contains: String - sender_contains_nocase: String - sender_not_contains: String - sender_not_contains_nocase: String - sender_starts_with: String - sender_starts_with_nocase: String - sender_not_starts_with: String - sender_not_starts_with_nocase: String - sender_ends_with: String - sender_ends_with_nocase: String - sender_not_ends_with: String - sender_not_ends_with_nocase: String - transactionHash: String - transactionHash_not: String - transactionHash_gt: String - transactionHash_lt: String - transactionHash_gte: String - transactionHash_lte: String - transactionHash_in: [String!] - transactionHash_not_in: [String!] - transactionHash_contains: String - transactionHash_contains_nocase: String - transactionHash_not_contains: String - transactionHash_not_contains_nocase: String - transactionHash_starts_with: String - transactionHash_starts_with_nocase: String - transactionHash_not_starts_with: String - transactionHash_not_starts_with_nocase: String - transactionHash_ends_with: String - transactionHash_ends_with_nocase: String - transactionHash_not_ends_with: String - transactionHash_not_ends_with_nocase: String - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - shares: BigInt - shares_not: BigInt - shares_gt: BigInt - shares_lt: BigInt - shares_gte: BigInt - shares_lte: BigInt - shares_in: [BigInt!] - shares_not_in: [BigInt!] - executor: String - executor_not: String - executor_gt: String - executor_lt: String - executor_gte: String - executor_lte: String - executor_in: [String!] - executor_not_in: [String!] - executor_contains: String - executor_contains_nocase: String - executor_not_contains: String - executor_not_contains_nocase: String - executor_starts_with: String - executor_starts_with_nocase: String - executor_not_starts_with: String - executor_not_starts_with_nocase: String - executor_ends_with: String - executor_ends_with_nocase: String - executor_not_ends_with: String - executor_not_ends_with_nocase: String - depositCaller: String - depositCaller_not: String - depositCaller_gt: String - depositCaller_lt: String - depositCaller_gte: String - depositCaller_lte: String - depositCaller_in: [String!] - depositCaller_not_in: [String!] - depositCaller_contains: String - depositCaller_contains_nocase: String - depositCaller_not_contains: String - depositCaller_not_contains_nocase: String - depositCaller_starts_with: String - depositCaller_starts_with_nocase: String - depositCaller_not_starts_with: String - depositCaller_not_starts_with_nocase: String - depositCaller_ends_with: String - depositCaller_ends_with_nocase: String - depositCaller_not_ends_with: String - depositCaller_not_ends_with_nocase: String - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [VaultDeposit_filter] - or: [VaultDeposit_filter] -} - -enum VaultDeposit_orderBy { - id - vault - vault__id - vault__deployer - vault__token0 - vault__token1 - vault__totalAmount0 - vault__totalAmount1 - vault__createdAt - vault__lastSnapshot - vault__pool - vault__state - vault__annualPercentageYield - vault__annualPercentageDailyYield - vault__annualPercentageMonthlyYield - vault__annualPercentageYearlyYield - vault__lastTotalT0ValuePerLPT - vault__accruedStrategistFees0 - vault__accruedStrategistFees1 - vault__fees0 - vault__fees1 - vault__beaconName - vault__gasUsed - vault__gasDeposited - vault__totalLPTokensIssued - vault__token1Symbol - vault__decimals - vault__feeTier - vault__name - vault__symbol - vault__token0Balance - vault__token0Decimals - vault__token0Name - vault__token0Symbol - vault__token1Balance - vault__token1Decimals - vault__token1Name - vault__payloadIpfs - vault__vaultManager - vault__averageFeeArrPerSecond - vault__totalSnapshots - vault__annualFeeARR - vault__dailyFeeAPR - vault__weeklyFeeAPR - vault__totalValueLockedToken0 - vault__totalValueLockedToken1 - amount0 - amount1 - token0 - token1 - sender - transactionHash - timeStamp - shares - executor - depositCaller -} - -type VaultGasDeposited { - id: ID! - timestamp: BigInt! - vault: String! - origin: String! - amount: BigInt! -} - -input VaultGasDeposited_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - origin: String - origin_not: String - origin_gt: String - origin_lt: String - origin_gte: String - origin_lte: String - origin_in: [String!] - origin_not_in: [String!] - origin_contains: String - origin_contains_nocase: String - origin_not_contains: String - origin_not_contains_nocase: String - origin_starts_with: String - origin_starts_with_nocase: String - origin_not_starts_with: String - origin_not_starts_with_nocase: String - origin_ends_with: String - origin_ends_with_nocase: String - origin_not_ends_with: String - origin_not_ends_with_nocase: String - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [VaultGasDeposited_filter] - or: [VaultGasDeposited_filter] -} - -enum VaultGasDeposited_orderBy { - id - timestamp - vault - origin - amount -} - -type VaultGasUsed { - id: ID! - timestamp: BigInt! - vault: String! - actionHash: String - amount: BigInt! -} - -input VaultGasUsed_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - actionHash: String - actionHash_not: String - actionHash_gt: String - actionHash_lt: String - actionHash_gte: String - actionHash_lte: String - actionHash_in: [String!] - actionHash_not_in: [String!] - actionHash_contains: String - actionHash_contains_nocase: String - actionHash_not_contains: String - actionHash_not_contains_nocase: String - actionHash_starts_with: String - actionHash_starts_with_nocase: String - actionHash_not_starts_with: String - actionHash_not_starts_with_nocase: String - actionHash_ends_with: String - actionHash_ends_with_nocase: String - actionHash_not_ends_with: String - actionHash_not_ends_with_nocase: String - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [VaultGasUsed_filter] - or: [VaultGasUsed_filter] -} - -enum VaultGasUsed_orderBy { - id - timestamp - vault - actionHash - amount -} - -type VaultGasWithdrawn { - id: ID! - timestamp: BigInt! - vault: String! - to: String! - amount: BigInt! -} - -input VaultGasWithdrawn_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - to: String - to_not: String - to_gt: String - to_lt: String - to_gte: String - to_lte: String - to_in: [String!] - to_not_in: [String!] - to_contains: String - to_contains_nocase: String - to_not_contains: String - to_not_contains_nocase: String - to_starts_with: String - to_starts_with_nocase: String - to_not_starts_with: String - to_not_starts_with_nocase: String - to_ends_with: String - to_ends_with_nocase: String - to_not_ends_with: String - to_not_ends_with_nocase: String - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [VaultGasWithdrawn_filter] - or: [VaultGasWithdrawn_filter] -} - -enum VaultGasWithdrawn_orderBy { - id - timestamp - vault - to - amount -} - -type VaultPosition { - id: ID! - upperTick: [BigInt!]! - lowerTick: [BigInt!]! - vault: Vault! - relativeWeight: [BigInt!]! - timestamp: BigInt! -} - -input VaultPosition_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - upperTick: [BigInt!] - upperTick_not: [BigInt!] - upperTick_contains: [BigInt!] - upperTick_contains_nocase: [BigInt!] - upperTick_not_contains: [BigInt!] - upperTick_not_contains_nocase: [BigInt!] - lowerTick: [BigInt!] - lowerTick_not: [BigInt!] - lowerTick_contains: [BigInt!] - lowerTick_contains_nocase: [BigInt!] - lowerTick_not_contains: [BigInt!] - lowerTick_not_contains_nocase: [BigInt!] - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - vault_: Vault_filter - relativeWeight: [BigInt!] - relativeWeight_not: [BigInt!] - relativeWeight_contains: [BigInt!] - relativeWeight_contains_nocase: [BigInt!] - relativeWeight_not_contains: [BigInt!] - relativeWeight_not_contains_nocase: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [VaultPosition_filter] - or: [VaultPosition_filter] -} - -enum VaultPosition_orderBy { - id - upperTick - lowerTick - vault - vault__id - vault__deployer - vault__token0 - vault__token1 - vault__totalAmount0 - vault__totalAmount1 - vault__createdAt - vault__lastSnapshot - vault__pool - vault__state - vault__annualPercentageYield - vault__annualPercentageDailyYield - vault__annualPercentageMonthlyYield - vault__annualPercentageYearlyYield - vault__lastTotalT0ValuePerLPT - vault__accruedStrategistFees0 - vault__accruedStrategistFees1 - vault__fees0 - vault__fees1 - vault__beaconName - vault__gasUsed - vault__gasDeposited - vault__totalLPTokensIssued - vault__token1Symbol - vault__decimals - vault__feeTier - vault__name - vault__symbol - vault__token0Balance - vault__token0Decimals - vault__token0Name - vault__token0Symbol - vault__token1Balance - vault__token1Decimals - vault__token1Name - vault__payloadIpfs - vault__vaultManager - vault__averageFeeArrPerSecond - vault__totalSnapshots - vault__annualFeeARR - vault__dailyFeeAPR - vault__weeklyFeeAPR - vault__totalValueLockedToken0 - vault__totalValueLockedToken1 - relativeWeight - timestamp -} - -type VaultSnapshot { - id: ID! - timestamp: BigInt! - vaultAddress: Vault! - totalAmount0: BigInt! - totalAmount1: BigInt! - sqrtPriceX96: BigInt! - totalSupply: BigInt! - fees1: BigInt! - fees0: BigInt! - annualFeeAPR: BigDecimal! - dailyFeeAPR: BigDecimal! - weeklyFeeAPR: BigDecimal! - transactionHash: String! -} - -input VaultSnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - vaultAddress: String - vaultAddress_not: String - vaultAddress_gt: String - vaultAddress_lt: String - vaultAddress_gte: String - vaultAddress_lte: String - vaultAddress_in: [String!] - vaultAddress_not_in: [String!] - vaultAddress_contains: String - vaultAddress_contains_nocase: String - vaultAddress_not_contains: String - vaultAddress_not_contains_nocase: String - vaultAddress_starts_with: String - vaultAddress_starts_with_nocase: String - vaultAddress_not_starts_with: String - vaultAddress_not_starts_with_nocase: String - vaultAddress_ends_with: String - vaultAddress_ends_with_nocase: String - vaultAddress_not_ends_with: String - vaultAddress_not_ends_with_nocase: String - vaultAddress_: Vault_filter - totalAmount0: BigInt - totalAmount0_not: BigInt - totalAmount0_gt: BigInt - totalAmount0_lt: BigInt - totalAmount0_gte: BigInt - totalAmount0_lte: BigInt - totalAmount0_in: [BigInt!] - totalAmount0_not_in: [BigInt!] - totalAmount1: BigInt - totalAmount1_not: BigInt - totalAmount1_gt: BigInt - totalAmount1_lt: BigInt - totalAmount1_gte: BigInt - totalAmount1_lte: BigInt - totalAmount1_in: [BigInt!] - totalAmount1_not_in: [BigInt!] - sqrtPriceX96: BigInt - sqrtPriceX96_not: BigInt - sqrtPriceX96_gt: BigInt - sqrtPriceX96_lt: BigInt - sqrtPriceX96_gte: BigInt - sqrtPriceX96_lte: BigInt - sqrtPriceX96_in: [BigInt!] - sqrtPriceX96_not_in: [BigInt!] - totalSupply: BigInt - totalSupply_not: BigInt - totalSupply_gt: BigInt - totalSupply_lt: BigInt - totalSupply_gte: BigInt - totalSupply_lte: BigInt - totalSupply_in: [BigInt!] - totalSupply_not_in: [BigInt!] - fees1: BigInt - fees1_not: BigInt - fees1_gt: BigInt - fees1_lt: BigInt - fees1_gte: BigInt - fees1_lte: BigInt - fees1_in: [BigInt!] - fees1_not_in: [BigInt!] - fees0: BigInt - fees0_not: BigInt - fees0_gt: BigInt - fees0_lt: BigInt - fees0_gte: BigInt - fees0_lte: BigInt - fees0_in: [BigInt!] - fees0_not_in: [BigInt!] - annualFeeAPR: BigDecimal - annualFeeAPR_not: BigDecimal - annualFeeAPR_gt: BigDecimal - annualFeeAPR_lt: BigDecimal - annualFeeAPR_gte: BigDecimal - annualFeeAPR_lte: BigDecimal - annualFeeAPR_in: [BigDecimal!] - annualFeeAPR_not_in: [BigDecimal!] - dailyFeeAPR: BigDecimal - dailyFeeAPR_not: BigDecimal - dailyFeeAPR_gt: BigDecimal - dailyFeeAPR_lt: BigDecimal - dailyFeeAPR_gte: BigDecimal - dailyFeeAPR_lte: BigDecimal - dailyFeeAPR_in: [BigDecimal!] - dailyFeeAPR_not_in: [BigDecimal!] - weeklyFeeAPR: BigDecimal - weeklyFeeAPR_not: BigDecimal - weeklyFeeAPR_gt: BigDecimal - weeklyFeeAPR_lt: BigDecimal - weeklyFeeAPR_gte: BigDecimal - weeklyFeeAPR_lte: BigDecimal - weeklyFeeAPR_in: [BigDecimal!] - weeklyFeeAPR_not_in: [BigDecimal!] - transactionHash: String - transactionHash_not: String - transactionHash_gt: String - transactionHash_lt: String - transactionHash_gte: String - transactionHash_lte: String - transactionHash_in: [String!] - transactionHash_not_in: [String!] - transactionHash_contains: String - transactionHash_contains_nocase: String - transactionHash_not_contains: String - transactionHash_not_contains_nocase: String - transactionHash_starts_with: String - transactionHash_starts_with_nocase: String - transactionHash_not_starts_with: String - transactionHash_not_starts_with_nocase: String - transactionHash_ends_with: String - transactionHash_ends_with_nocase: String - transactionHash_not_ends_with: String - transactionHash_not_ends_with_nocase: String - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [VaultSnapshot_filter] - or: [VaultSnapshot_filter] -} - -enum VaultSnapshot_orderBy { - id - timestamp - vaultAddress - vaultAddress__id - vaultAddress__deployer - vaultAddress__token0 - vaultAddress__token1 - vaultAddress__totalAmount0 - vaultAddress__totalAmount1 - vaultAddress__createdAt - vaultAddress__lastSnapshot - vaultAddress__pool - vaultAddress__state - vaultAddress__annualPercentageYield - vaultAddress__annualPercentageDailyYield - vaultAddress__annualPercentageMonthlyYield - vaultAddress__annualPercentageYearlyYield - vaultAddress__lastTotalT0ValuePerLPT - vaultAddress__accruedStrategistFees0 - vaultAddress__accruedStrategistFees1 - vaultAddress__fees0 - vaultAddress__fees1 - vaultAddress__beaconName - vaultAddress__gasUsed - vaultAddress__gasDeposited - vaultAddress__totalLPTokensIssued - vaultAddress__token1Symbol - vaultAddress__decimals - vaultAddress__feeTier - vaultAddress__name - vaultAddress__symbol - vaultAddress__token0Balance - vaultAddress__token0Decimals - vaultAddress__token0Name - vaultAddress__token0Symbol - vaultAddress__token1Balance - vaultAddress__token1Decimals - vaultAddress__token1Name - vaultAddress__payloadIpfs - vaultAddress__vaultManager - vaultAddress__averageFeeArrPerSecond - vaultAddress__totalSnapshots - vaultAddress__annualFeeARR - vaultAddress__dailyFeeAPR - vaultAddress__weeklyFeeAPR - vaultAddress__totalValueLockedToken0 - vaultAddress__totalValueLockedToken1 - totalAmount0 - totalAmount1 - sqrtPriceX96 - totalSupply - fees1 - fees0 - annualFeeAPR - dailyFeeAPR - weeklyFeeAPR - transactionHash -} - -type VaultStateChanged { - id: ID! - timeStamp: BigInt! - vault: Vault! - status: BigInt! -} - -input VaultStateChanged_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - vault_: Vault_filter - status: BigInt - status_not: BigInt - status_gt: BigInt - status_lt: BigInt - status_gte: BigInt - status_lte: BigInt - status_in: [BigInt!] - status_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [VaultStateChanged_filter] - or: [VaultStateChanged_filter] -} - -enum VaultStateChanged_orderBy { - id - timeStamp - vault - vault__id - vault__deployer - vault__token0 - vault__token1 - vault__totalAmount0 - vault__totalAmount1 - vault__createdAt - vault__lastSnapshot - vault__pool - vault__state - vault__annualPercentageYield - vault__annualPercentageDailyYield - vault__annualPercentageMonthlyYield - vault__annualPercentageYearlyYield - vault__lastTotalT0ValuePerLPT - vault__accruedStrategistFees0 - vault__accruedStrategistFees1 - vault__fees0 - vault__fees1 - vault__beaconName - vault__gasUsed - vault__gasDeposited - vault__totalLPTokensIssued - vault__token1Symbol - vault__decimals - vault__feeTier - vault__name - vault__symbol - vault__token0Balance - vault__token0Decimals - vault__token0Name - vault__token0Symbol - vault__token1Balance - vault__token1Decimals - vault__token1Name - vault__payloadIpfs - vault__vaultManager - vault__averageFeeArrPerSecond - vault__totalSnapshots - vault__annualFeeARR - vault__dailyFeeAPR - vault__weeklyFeeAPR - vault__totalValueLockedToken0 - vault__totalValueLockedToken1 - status -} - -type VaultWithdraw { - """Address of the withdrawer""" - id: ID! - vault: Vault! - - """Amount of tokens withdrawn""" - amount0: BigDecimal! - amount1: BigDecimal! - - """Token Addresses""" - token0: String! - token1: String! - - """Time when the withdraw was made""" - timeStamp: BigInt! - sender: String! - transactionHash: String! -} - -input VaultWithdraw_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - vault_: Vault_filter - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - sender: String - sender_not: String - sender_gt: String - sender_lt: String - sender_gte: String - sender_lte: String - sender_in: [String!] - sender_not_in: [String!] - sender_contains: String - sender_contains_nocase: String - sender_not_contains: String - sender_not_contains_nocase: String - sender_starts_with: String - sender_starts_with_nocase: String - sender_not_starts_with: String - sender_not_starts_with_nocase: String - sender_ends_with: String - sender_ends_with_nocase: String - sender_not_ends_with: String - sender_not_ends_with_nocase: String - transactionHash: String - transactionHash_not: String - transactionHash_gt: String - transactionHash_lt: String - transactionHash_gte: String - transactionHash_lte: String - transactionHash_in: [String!] - transactionHash_not_in: [String!] - transactionHash_contains: String - transactionHash_contains_nocase: String - transactionHash_not_contains: String - transactionHash_not_contains_nocase: String - transactionHash_starts_with: String - transactionHash_starts_with_nocase: String - transactionHash_not_starts_with: String - transactionHash_not_starts_with_nocase: String - transactionHash_ends_with: String - transactionHash_ends_with_nocase: String - transactionHash_not_ends_with: String - transactionHash_not_ends_with_nocase: String - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [VaultWithdraw_filter] - or: [VaultWithdraw_filter] -} - -enum VaultWithdraw_orderBy { - id - vault - vault__id - vault__deployer - vault__token0 - vault__token1 - vault__totalAmount0 - vault__totalAmount1 - vault__createdAt - vault__lastSnapshot - vault__pool - vault__state - vault__annualPercentageYield - vault__annualPercentageDailyYield - vault__annualPercentageMonthlyYield - vault__annualPercentageYearlyYield - vault__lastTotalT0ValuePerLPT - vault__accruedStrategistFees0 - vault__accruedStrategistFees1 - vault__fees0 - vault__fees1 - vault__beaconName - vault__gasUsed - vault__gasDeposited - vault__totalLPTokensIssued - vault__token1Symbol - vault__decimals - vault__feeTier - vault__name - vault__symbol - vault__token0Balance - vault__token0Decimals - vault__token0Name - vault__token0Symbol - vault__token1Balance - vault__token1Decimals - vault__token1Name - vault__payloadIpfs - vault__vaultManager - vault__averageFeeArrPerSecond - vault__totalSnapshots - vault__annualFeeARR - vault__dailyFeeAPR - vault__weeklyFeeAPR - vault__totalValueLockedToken0 - vault__totalValueLockedToken1 - amount0 - amount1 - token0 - token1 - timeStamp - sender - transactionHash -} - -input Vault_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - deployer: String - deployer_not: String - deployer_gt: String - deployer_lt: String - deployer_gte: String - deployer_lte: String - deployer_in: [String!] - deployer_not_in: [String!] - deployer_contains: String - deployer_contains_nocase: String - deployer_not_contains: String - deployer_not_contains_nocase: String - deployer_starts_with: String - deployer_starts_with_nocase: String - deployer_not_starts_with: String - deployer_not_starts_with_nocase: String - deployer_ends_with: String - deployer_ends_with_nocase: String - deployer_not_ends_with: String - deployer_not_ends_with_nocase: String - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - totalAmount0: BigDecimal - totalAmount0_not: BigDecimal - totalAmount0_gt: BigDecimal - totalAmount0_lt: BigDecimal - totalAmount0_gte: BigDecimal - totalAmount0_lte: BigDecimal - totalAmount0_in: [BigDecimal!] - totalAmount0_not_in: [BigDecimal!] - totalAmount1: BigDecimal - totalAmount1_not: BigDecimal - totalAmount1_gt: BigDecimal - totalAmount1_lt: BigDecimal - totalAmount1_gte: BigDecimal - totalAmount1_lte: BigDecimal - totalAmount1_in: [BigDecimal!] - totalAmount1_not_in: [BigDecimal!] - createdAt: BigInt - createdAt_not: BigInt - createdAt_gt: BigInt - createdAt_lt: BigInt - createdAt_gte: BigInt - createdAt_lte: BigInt - createdAt_in: [BigInt!] - createdAt_not_in: [BigInt!] - lastSnapshot: BigInt - lastSnapshot_not: BigInt - lastSnapshot_gt: BigInt - lastSnapshot_lt: BigInt - lastSnapshot_gte: BigInt - lastSnapshot_lte: BigInt - lastSnapshot_in: [BigInt!] - lastSnapshot_not_in: [BigInt!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - state: BigInt - state_not: BigInt - state_gt: BigInt - state_lt: BigInt - state_gte: BigInt - state_lte: BigInt - state_in: [BigInt!] - state_not_in: [BigInt!] - statusUpdates_: VaultStateChanged_filter - strategyToken: String - strategyToken_not: String - strategyToken_gt: String - strategyToken_lt: String - strategyToken_gte: String - strategyToken_lte: String - strategyToken_in: [String!] - strategyToken_not_in: [String!] - strategyToken_contains: String - strategyToken_contains_nocase: String - strategyToken_not_contains: String - strategyToken_not_contains_nocase: String - strategyToken_starts_with: String - strategyToken_starts_with_nocase: String - strategyToken_not_starts_with: String - strategyToken_not_starts_with_nocase: String - strategyToken_ends_with: String - strategyToken_ends_with_nocase: String - strategyToken_not_ends_with: String - strategyToken_not_ends_with_nocase: String - strategyToken_: Strategy_filter - snapshots_: VaultSnapshot_filter - permissions_: WhiteListVaultPermission_filter - positions_: VaultPosition_filter - depositors_: Depositor_filter - annualPercentageYield: BigDecimal - annualPercentageYield_not: BigDecimal - annualPercentageYield_gt: BigDecimal - annualPercentageYield_lt: BigDecimal - annualPercentageYield_gte: BigDecimal - annualPercentageYield_lte: BigDecimal - annualPercentageYield_in: [BigDecimal!] - annualPercentageYield_not_in: [BigDecimal!] - annualPercentageDailyYield: BigDecimal - annualPercentageDailyYield_not: BigDecimal - annualPercentageDailyYield_gt: BigDecimal - annualPercentageDailyYield_lt: BigDecimal - annualPercentageDailyYield_gte: BigDecimal - annualPercentageDailyYield_lte: BigDecimal - annualPercentageDailyYield_in: [BigDecimal!] - annualPercentageDailyYield_not_in: [BigDecimal!] - annualPercentageMonthlyYield: BigDecimal - annualPercentageMonthlyYield_not: BigDecimal - annualPercentageMonthlyYield_gt: BigDecimal - annualPercentageMonthlyYield_lt: BigDecimal - annualPercentageMonthlyYield_gte: BigDecimal - annualPercentageMonthlyYield_lte: BigDecimal - annualPercentageMonthlyYield_in: [BigDecimal!] - annualPercentageMonthlyYield_not_in: [BigDecimal!] - annualPercentageYearlyYield: BigDecimal - annualPercentageYearlyYield_not: BigDecimal - annualPercentageYearlyYield_gt: BigDecimal - annualPercentageYearlyYield_lt: BigDecimal - annualPercentageYearlyYield_gte: BigDecimal - annualPercentageYearlyYield_lte: BigDecimal - annualPercentageYearlyYield_in: [BigDecimal!] - annualPercentageYearlyYield_not_in: [BigDecimal!] - lastTotalT0ValuePerLPT: BigDecimal - lastTotalT0ValuePerLPT_not: BigDecimal - lastTotalT0ValuePerLPT_gt: BigDecimal - lastTotalT0ValuePerLPT_lt: BigDecimal - lastTotalT0ValuePerLPT_gte: BigDecimal - lastTotalT0ValuePerLPT_lte: BigDecimal - lastTotalT0ValuePerLPT_in: [BigDecimal!] - lastTotalT0ValuePerLPT_not_in: [BigDecimal!] - accruedStrategistFees0: BigInt - accruedStrategistFees0_not: BigInt - accruedStrategistFees0_gt: BigInt - accruedStrategistFees0_lt: BigInt - accruedStrategistFees0_gte: BigInt - accruedStrategistFees0_lte: BigInt - accruedStrategistFees0_in: [BigInt!] - accruedStrategistFees0_not_in: [BigInt!] - accruedStrategistFees1: BigInt - accruedStrategistFees1_not: BigInt - accruedStrategistFees1_gt: BigInt - accruedStrategistFees1_lt: BigInt - accruedStrategistFees1_gte: BigInt - accruedStrategistFees1_lte: BigInt - accruedStrategistFees1_in: [BigInt!] - accruedStrategistFees1_not_in: [BigInt!] - fees0: BigInt - fees0_not: BigInt - fees0_gt: BigInt - fees0_lt: BigInt - fees0_gte: BigInt - fees0_lte: BigInt - fees0_in: [BigInt!] - fees0_not_in: [BigInt!] - fees1: BigInt - fees1_not: BigInt - fees1_gt: BigInt - fees1_lt: BigInt - fees1_gte: BigInt - fees1_lte: BigInt - fees1_in: [BigInt!] - fees1_not_in: [BigInt!] - beaconName: String - beaconName_not: String - beaconName_gt: String - beaconName_lt: String - beaconName_gte: String - beaconName_lte: String - beaconName_in: [String!] - beaconName_not_in: [String!] - beaconName_contains: String - beaconName_contains_nocase: String - beaconName_not_contains: String - beaconName_not_contains_nocase: String - beaconName_starts_with: String - beaconName_starts_with_nocase: String - beaconName_not_starts_with: String - beaconName_not_starts_with_nocase: String - beaconName_ends_with: String - beaconName_ends_with_nocase: String - beaconName_not_ends_with: String - beaconName_not_ends_with_nocase: String - jobs_: Job_filter - gasUsed: BigInt - gasUsed_not: BigInt - gasUsed_gt: BigInt - gasUsed_lt: BigInt - gasUsed_gte: BigInt - gasUsed_lte: BigInt - gasUsed_in: [BigInt!] - gasUsed_not_in: [BigInt!] - gasDeposited: BigInt - gasDeposited_not: BigInt - gasDeposited_gt: BigInt - gasDeposited_lt: BigInt - gasDeposited_gte: BigInt - gasDeposited_lte: BigInt - gasDeposited_in: [BigInt!] - gasDeposited_not_in: [BigInt!] - totalLPTokensIssued: BigInt - totalLPTokensIssued_not: BigInt - totalLPTokensIssued_gt: BigInt - totalLPTokensIssued_lt: BigInt - totalLPTokensIssued_gte: BigInt - totalLPTokensIssued_lte: BigInt - totalLPTokensIssued_in: [BigInt!] - totalLPTokensIssued_not_in: [BigInt!] - token1Symbol: String - token1Symbol_not: String - token1Symbol_gt: String - token1Symbol_lt: String - token1Symbol_gte: String - token1Symbol_lte: String - token1Symbol_in: [String!] - token1Symbol_not_in: [String!] - token1Symbol_contains: String - token1Symbol_contains_nocase: String - token1Symbol_not_contains: String - token1Symbol_not_contains_nocase: String - token1Symbol_starts_with: String - token1Symbol_starts_with_nocase: String - token1Symbol_not_starts_with: String - token1Symbol_not_starts_with_nocase: String - token1Symbol_ends_with: String - token1Symbol_ends_with_nocase: String - token1Symbol_not_ends_with: String - token1Symbol_not_ends_with_nocase: String - decimals: BigInt - decimals_not: BigInt - decimals_gt: BigInt - decimals_lt: BigInt - decimals_gte: BigInt - decimals_lte: BigInt - decimals_in: [BigInt!] - decimals_not_in: [BigInt!] - feeTier: BigInt - feeTier_not: BigInt - feeTier_gt: BigInt - feeTier_lt: BigInt - feeTier_gte: BigInt - feeTier_lte: BigInt - feeTier_in: [BigInt!] - feeTier_not_in: [BigInt!] - name: String - name_not: String - name_gt: String - name_lt: String - name_gte: String - name_lte: String - name_in: [String!] - name_not_in: [String!] - name_contains: String - name_contains_nocase: String - name_not_contains: String - name_not_contains_nocase: String - name_starts_with: String - name_starts_with_nocase: String - name_not_starts_with: String - name_not_starts_with_nocase: String - name_ends_with: String - name_ends_with_nocase: String - name_not_ends_with: String - name_not_ends_with_nocase: String - symbol: String - symbol_not: String - symbol_gt: String - symbol_lt: String - symbol_gte: String - symbol_lte: String - symbol_in: [String!] - symbol_not_in: [String!] - symbol_contains: String - symbol_contains_nocase: String - symbol_not_contains: String - symbol_not_contains_nocase: String - symbol_starts_with: String - symbol_starts_with_nocase: String - symbol_not_starts_with: String - symbol_not_starts_with_nocase: String - symbol_ends_with: String - symbol_ends_with_nocase: String - symbol_not_ends_with: String - symbol_not_ends_with_nocase: String - token0Balance: BigInt - token0Balance_not: BigInt - token0Balance_gt: BigInt - token0Balance_lt: BigInt - token0Balance_gte: BigInt - token0Balance_lte: BigInt - token0Balance_in: [BigInt!] - token0Balance_not_in: [BigInt!] - token0Decimals: BigInt - token0Decimals_not: BigInt - token0Decimals_gt: BigInt - token0Decimals_lt: BigInt - token0Decimals_gte: BigInt - token0Decimals_lte: BigInt - token0Decimals_in: [BigInt!] - token0Decimals_not_in: [BigInt!] - token0Name: String - token0Name_not: String - token0Name_gt: String - token0Name_lt: String - token0Name_gte: String - token0Name_lte: String - token0Name_in: [String!] - token0Name_not_in: [String!] - token0Name_contains: String - token0Name_contains_nocase: String - token0Name_not_contains: String - token0Name_not_contains_nocase: String - token0Name_starts_with: String - token0Name_starts_with_nocase: String - token0Name_not_starts_with: String - token0Name_not_starts_with_nocase: String - token0Name_ends_with: String - token0Name_ends_with_nocase: String - token0Name_not_ends_with: String - token0Name_not_ends_with_nocase: String - token0Symbol: String - token0Symbol_not: String - token0Symbol_gt: String - token0Symbol_lt: String - token0Symbol_gte: String - token0Symbol_lte: String - token0Symbol_in: [String!] - token0Symbol_not_in: [String!] - token0Symbol_contains: String - token0Symbol_contains_nocase: String - token0Symbol_not_contains: String - token0Symbol_not_contains_nocase: String - token0Symbol_starts_with: String - token0Symbol_starts_with_nocase: String - token0Symbol_not_starts_with: String - token0Symbol_not_starts_with_nocase: String - token0Symbol_ends_with: String - token0Symbol_ends_with_nocase: String - token0Symbol_not_ends_with: String - token0Symbol_not_ends_with_nocase: String - token1Balance: BigInt - token1Balance_not: BigInt - token1Balance_gt: BigInt - token1Balance_lt: BigInt - token1Balance_gte: BigInt - token1Balance_lte: BigInt - token1Balance_in: [BigInt!] - token1Balance_not_in: [BigInt!] - token1Decimals: BigInt - token1Decimals_not: BigInt - token1Decimals_gt: BigInt - token1Decimals_lt: BigInt - token1Decimals_gte: BigInt - token1Decimals_lte: BigInt - token1Decimals_in: [BigInt!] - token1Decimals_not_in: [BigInt!] - token1Name: String - token1Name_not: String - token1Name_gt: String - token1Name_lt: String - token1Name_gte: String - token1Name_lte: String - token1Name_in: [String!] - token1Name_not_in: [String!] - token1Name_contains: String - token1Name_contains_nocase: String - token1Name_not_contains: String - token1Name_not_contains_nocase: String - token1Name_starts_with: String - token1Name_starts_with_nocase: String - token1Name_not_starts_with: String - token1Name_not_starts_with_nocase: String - token1Name_ends_with: String - token1Name_ends_with_nocase: String - token1Name_not_ends_with: String - token1Name_not_ends_with_nocase: String - payloadIpfs: String - payloadIpfs_not: String - payloadIpfs_gt: String - payloadIpfs_lt: String - payloadIpfs_gte: String - payloadIpfs_lte: String - payloadIpfs_in: [String!] - payloadIpfs_not_in: [String!] - payloadIpfs_contains: String - payloadIpfs_contains_nocase: String - payloadIpfs_not_contains: String - payloadIpfs_not_contains_nocase: String - payloadIpfs_starts_with: String - payloadIpfs_starts_with_nocase: String - payloadIpfs_not_starts_with: String - payloadIpfs_not_starts_with_nocase: String - payloadIpfs_ends_with: String - payloadIpfs_ends_with_nocase: String - payloadIpfs_not_ends_with: String - payloadIpfs_not_ends_with_nocase: String - vaultManager: String - vaultManager_not: String - vaultManager_gt: String - vaultManager_lt: String - vaultManager_gte: String - vaultManager_lte: String - vaultManager_in: [String!] - vaultManager_not_in: [String!] - vaultManager_contains: String - vaultManager_contains_nocase: String - vaultManager_not_contains: String - vaultManager_not_contains_nocase: String - vaultManager_starts_with: String - vaultManager_starts_with_nocase: String - vaultManager_not_starts_with: String - vaultManager_not_starts_with_nocase: String - vaultManager_ends_with: String - vaultManager_ends_with_nocase: String - vaultManager_not_ends_with: String - vaultManager_not_ends_with_nocase: String - averageFeeArrPerSecond: BigDecimal - averageFeeArrPerSecond_not: BigDecimal - averageFeeArrPerSecond_gt: BigDecimal - averageFeeArrPerSecond_lt: BigDecimal - averageFeeArrPerSecond_gte: BigDecimal - averageFeeArrPerSecond_lte: BigDecimal - averageFeeArrPerSecond_in: [BigDecimal!] - averageFeeArrPerSecond_not_in: [BigDecimal!] - totalSnapshots: BigInt - totalSnapshots_not: BigInt - totalSnapshots_gt: BigInt - totalSnapshots_lt: BigInt - totalSnapshots_gte: BigInt - totalSnapshots_lte: BigInt - totalSnapshots_in: [BigInt!] - totalSnapshots_not_in: [BigInt!] - annualFeeARR: BigDecimal - annualFeeARR_not: BigDecimal - annualFeeARR_gt: BigDecimal - annualFeeARR_lt: BigDecimal - annualFeeARR_gte: BigDecimal - annualFeeARR_lte: BigDecimal - annualFeeARR_in: [BigDecimal!] - annualFeeARR_not_in: [BigDecimal!] - dailyFeeAPR: BigDecimal - dailyFeeAPR_not: BigDecimal - dailyFeeAPR_gt: BigDecimal - dailyFeeAPR_lt: BigDecimal - dailyFeeAPR_gte: BigDecimal - dailyFeeAPR_lte: BigDecimal - dailyFeeAPR_in: [BigDecimal!] - dailyFeeAPR_not_in: [BigDecimal!] - weeklyFeeAPR: BigDecimal - weeklyFeeAPR_not: BigDecimal - weeklyFeeAPR_gt: BigDecimal - weeklyFeeAPR_lt: BigDecimal - weeklyFeeAPR_gte: BigDecimal - weeklyFeeAPR_lte: BigDecimal - weeklyFeeAPR_in: [BigDecimal!] - weeklyFeeAPR_not_in: [BigDecimal!] - totalValueLockedToken0: BigDecimal - totalValueLockedToken0_not: BigDecimal - totalValueLockedToken0_gt: BigDecimal - totalValueLockedToken0_lt: BigDecimal - totalValueLockedToken0_gte: BigDecimal - totalValueLockedToken0_lte: BigDecimal - totalValueLockedToken0_in: [BigDecimal!] - totalValueLockedToken0_not_in: [BigDecimal!] - totalValueLockedToken1: BigDecimal - totalValueLockedToken1_not: BigDecimal - totalValueLockedToken1_gt: BigDecimal - totalValueLockedToken1_lt: BigDecimal - totalValueLockedToken1_gte: BigDecimal - totalValueLockedToken1_lte: BigDecimal - totalValueLockedToken1_in: [BigDecimal!] - totalValueLockedToken1_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Vault_filter] - or: [Vault_filter] -} - -enum Vault_orderBy { - id - deployer - token0 - token1 - totalAmount0 - totalAmount1 - createdAt - lastSnapshot - pool - state - statusUpdates - strategyToken - strategyToken__id - strategyToken__name - strategyToken__createdAt - strategyToken__admin - strategyToken__executionBundle - snapshots - permissions - positions - depositors - annualPercentageYield - annualPercentageDailyYield - annualPercentageMonthlyYield - annualPercentageYearlyYield - lastTotalT0ValuePerLPT - accruedStrategistFees0 - accruedStrategistFees1 - fees0 - fees1 - beaconName - jobs - gasUsed - gasDeposited - totalLPTokensIssued - token1Symbol - decimals - feeTier - name - symbol - token0Balance - token0Decimals - token0Name - token0Symbol - token1Balance - token1Decimals - token1Name - payloadIpfs - vaultManager - averageFeeArrPerSecond - totalSnapshots - annualFeeARR - dailyFeeAPR - weeklyFeeAPR - totalValueLockedToken0 - totalValueLockedToken1 -} - -type Vote { - id: ID! - timestamp: BigInt! - by: Keeper! - action: OrchestratorAction! -} - -input Vote_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - by: String - by_not: String - by_gt: String - by_lt: String - by_gte: String - by_lte: String - by_in: [String!] - by_not_in: [String!] - by_contains: String - by_contains_nocase: String - by_not_contains: String - by_not_contains_nocase: String - by_starts_with: String - by_starts_with_nocase: String - by_not_starts_with: String - by_not_starts_with_nocase: String - by_ends_with: String - by_ends_with_nocase: String - by_not_ends_with: String - by_not_ends_with_nocase: String - by_: Keeper_filter - action: String - action_not: String - action_gt: String - action_lt: String - action_gte: String - action_lte: String - action_in: [String!] - action_not_in: [String!] - action_contains: String - action_contains_nocase: String - action_not_contains: String - action_not_contains_nocase: String - action_starts_with: String - action_starts_with_nocase: String - action_not_starts_with: String - action_not_starts_with_nocase: String - action_ends_with: String - action_ends_with_nocase: String - action_not_ends_with: String - action_not_ends_with_nocase: String - action_: OrchestratorAction_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Vote_filter] - or: [Vote_filter] -} - -enum Vote_orderBy { - id - timestamp - by - by__id - by__bondHeld - by__index - by__status - action - action__id - action__timestamp - action__lastUpdated - action__state - action__status - action__vault - action__transactionHash - action__hash - action__gasUsed -} - -type WhiteListManager { - id: ID! - address: String! - vault: String! - timestamp: BigInt! - permission: WhiteListVaultPermission! -} - -input WhiteListManager_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - address: String - address_not: String - address_gt: String - address_lt: String - address_gte: String - address_lte: String - address_in: [String!] - address_not_in: [String!] - address_contains: String - address_contains_nocase: String - address_not_contains: String - address_not_contains_nocase: String - address_starts_with: String - address_starts_with_nocase: String - address_not_starts_with: String - address_not_starts_with_nocase: String - address_ends_with: String - address_ends_with_nocase: String - address_not_ends_with: String - address_not_ends_with_nocase: String - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - permission_: WhiteListVaultPermission_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [WhiteListManager_filter] - or: [WhiteListManager_filter] -} - -enum WhiteListManager_orderBy { - id - address - vault - timestamp - permission - permission__id - permission__timestamp - permission__updatedTimestamp -} - -type WhiteListVaultPermission { - id: ID! - manager: WhiteListManager! - vault: Vault! - addresses: [String!]! - timestamp: BigInt! - updatedTimestamp: BigInt! -} - -input WhiteListVaultPermission_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - manager: String - manager_not: String - manager_gt: String - manager_lt: String - manager_gte: String - manager_lte: String - manager_in: [String!] - manager_not_in: [String!] - manager_contains: String - manager_contains_nocase: String - manager_not_contains: String - manager_not_contains_nocase: String - manager_starts_with: String - manager_starts_with_nocase: String - manager_not_starts_with: String - manager_not_starts_with_nocase: String - manager_ends_with: String - manager_ends_with_nocase: String - manager_not_ends_with: String - manager_not_ends_with_nocase: String - manager_: WhiteListManager_filter - vault: String - vault_not: String - vault_gt: String - vault_lt: String - vault_gte: String - vault_lte: String - vault_in: [String!] - vault_not_in: [String!] - vault_contains: String - vault_contains_nocase: String - vault_not_contains: String - vault_not_contains_nocase: String - vault_starts_with: String - vault_starts_with_nocase: String - vault_not_starts_with: String - vault_not_starts_with_nocase: String - vault_ends_with: String - vault_ends_with_nocase: String - vault_not_ends_with: String - vault_not_ends_with_nocase: String - vault_: Vault_filter - addresses: [String!] - addresses_not: [String!] - addresses_contains: [String!] - addresses_contains_nocase: [String!] - addresses_not_contains: [String!] - addresses_not_contains_nocase: [String!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - updatedTimestamp: BigInt - updatedTimestamp_not: BigInt - updatedTimestamp_gt: BigInt - updatedTimestamp_lt: BigInt - updatedTimestamp_gte: BigInt - updatedTimestamp_lte: BigInt - updatedTimestamp_in: [BigInt!] - updatedTimestamp_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [WhiteListVaultPermission_filter] - or: [WhiteListVaultPermission_filter] -} - -enum WhiteListVaultPermission_orderBy { - id - manager - manager__id - manager__address - manager__vault - manager__timestamp - vault - vault__id - vault__deployer - vault__token0 - vault__token1 - vault__totalAmount0 - vault__totalAmount1 - vault__createdAt - vault__lastSnapshot - vault__pool - vault__state - vault__annualPercentageYield - vault__annualPercentageDailyYield - vault__annualPercentageMonthlyYield - vault__annualPercentageYearlyYield - vault__lastTotalT0ValuePerLPT - vault__accruedStrategistFees0 - vault__accruedStrategistFees1 - vault__fees0 - vault__fees1 - vault__beaconName - vault__gasUsed - vault__gasDeposited - vault__totalLPTokensIssued - vault__token1Symbol - vault__decimals - vault__feeTier - vault__name - vault__symbol - vault__token0Balance - vault__token0Decimals - vault__token0Name - vault__token0Symbol - vault__token1Balance - vault__token1Decimals - vault__token1Name - vault__payloadIpfs - vault__vaultManager - vault__averageFeeArrPerSecond - vault__totalSnapshots - vault__annualFeeARR - vault__dailyFeeAPR - vault__weeklyFeeAPR - vault__totalValueLockedToken0 - vault__totalValueLockedToken1 - addresses - timestamp - updatedTimestamp -} - -type _Block_ { - """The hash of the block""" - hash: Bytes - - """The block number""" - number: Int! - - """Integer representation of the timestamp stored in blocks for the chain""" - timestamp: Int - - """The hash of the parent block""" - parentHash: Bytes -} - -"""The type for the top-level _meta field""" -type _Meta_ { - "Information about a specific subgraph block. The hash of the block\nwill be null if the _meta field has a block constraint that asks for\na block number. It will be filled if the _meta field has no block constraint\nand therefore asks for the latest block\n" - block: _Block_! - - """The deployment ID""" - deployment: String! - - """If `true`, the subgraph encountered indexing errors at some past block""" - hasIndexingErrors: Boolean! -} - -enum _SubgraphErrorPolicy_ { - """Data will be returned even if the subgraph has indexing errors""" - allow - - """ - If the subgraph has indexing errors, data will be omitted. The default. - """ - deny -} \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/sushi-bar/graphql.ts b/packages/graph-client/src/subgraphs/sushi-bar/graphql.ts deleted file mode 100644 index ecbcd48bcf..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-bar/graphql.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { initGraphQLTada } from 'gql.tada' -import type { Scalars } from 'src/lib/types/scalars.js' -import type { introspection } from './sushi-bar-env.js' - -export const graphql = initGraphQLTada<{ - introspection: introspection - scalars: Scalars -}>() diff --git a/packages/graph-client/src/subgraphs/sushi-bar/index.ts b/packages/graph-client/src/subgraphs/sushi-bar/index.ts deleted file mode 100644 index 2848968ccc..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-bar/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './queries/bar-history' -export * from './queries/bar' diff --git a/packages/graph-client/src/subgraphs/sushi-bar/queries/bar-history.ts b/packages/graph-client/src/subgraphs/sushi-bar/queries/bar-history.ts deleted file mode 100644 index a506812b2d..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-bar/queries/bar-history.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { VariablesOf } from 'gql.tada' - -import { type RequestOptions, request } from 'src/lib/request' -import { SUSHI_BAR_SUBGRAPH_URL } from 'sushi/config/subgraph' -import { graphql } from '../graphql' - -export const SushiBarHistoryQuery = graphql( - ` - query Bar($hourCnt: Int = 24, $dayCnt: Int = 7, $weekCnt: Int = 1000) { - hourSnapshots(first: $hourCnt, orderBy: date, orderDirection: desc) { - id - date - xSushiSupply - apr1m - apr3m - apr6m - apr12m - } - daySnapshots(first: $dayCnt, orderBy: date, orderDirection: desc) { - id - date - xSushiSupply - apr1m - apr3m - apr6m - apr12m - } - weekSnapshots(first: $weekCnt, orderBy: date, orderDirection: desc) { - id - date - xSushiSupply - apr1m - apr3m - apr6m - apr12m - } - } -`, -) - -export type GetSushiBarHistory = VariablesOf - -export async function getSushiBarHistory( - variables: GetSushiBarHistory, - options?: RequestOptions, -) { - const url = `https://${SUSHI_BAR_SUBGRAPH_URL}` - - const result = await request( - { url, document: SushiBarHistoryQuery, variables }, - options, - ) - - return result -} - -export type SushiBarHistory = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-bar/queries/bar.ts b/packages/graph-client/src/subgraphs/sushi-bar/queries/bar.ts deleted file mode 100644 index 2778e85319..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-bar/queries/bar.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { VariablesOf } from 'gql.tada' - -import { FetchError } from 'src/lib/fetch-error' -import { type RequestOptions, request } from 'src/lib/request' -import { SUSHI_BAR_SUBGRAPH_URL } from 'sushi/config/subgraph' -import { graphql } from '../graphql' - -export const SushiBarQuery = graphql( - ` - query Bar($block: Block_height) { - xsushi(id: "xSushi", block: $block) { - id - sushiXsushiRatio - xSushiSushiRatio - sushiSupply - xSushiSupply - apr1m - apr3m - apr6m - apr12m - } - } -`, -) - -export type GetSushiBar = VariablesOf - -export async function getSushiBar( - variables: GetSushiBar, - options?: RequestOptions, -) { - const url = `https://${SUSHI_BAR_SUBGRAPH_URL}` - - const result = await request( - { url, document: SushiBarQuery, variables }, - options, - ) - - if (result) { - return result.xsushi - } - - throw new FetchError(1, 'No bar') -} - -export type SushiBar = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-bar/schema.graphql b/packages/graph-client/src/subgraphs/sushi-bar/schema.graphql deleted file mode 100644 index 2c6d936e75..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-bar/schema.graphql +++ /dev/null @@ -1,1886 +0,0 @@ -""" -Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive. -""" -directive @entity on OBJECT - -"""Defined a Subgraph ID for an object type""" -directive @subgraphId(id: String!) on OBJECT - -""" -creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API. -""" -directive @derivedFrom(field: String!) on FIELD_DEFINITION - -enum Aggregation_interval { - hour - day -} - -scalar BigDecimal - -scalar BigInt - -input BlockChangedFilter { - number_gte: Int! -} - -input Block_height { - hash: Bytes - number: Int - number_gte: Int -} - -scalar Bytes - -type DaySnapshot { - """ {day}-{date} """ - id: ID! - date: Int! - userCount: BigInt! - transactionCount: BigInt! - sushiSupply: BigDecimal! - xSushiSupply: BigDecimal! - sushiStaked: BigDecimal! - sushiHarvested: BigDecimal! - totalFeeAmount: BigDecimal! - xSushiBurned: BigDecimal! - xSushiMinted: BigDecimal! - xSushiSushiRatio: BigDecimal! - sushiXsushiRatio: BigDecimal! - apr1m: BigDecimal! - apr3m: BigDecimal! - apr6m: BigDecimal! - apr12m: BigDecimal! - newTransactions: BigInt! - newSushiStaked: BigDecimal! - newSushiHarvested: BigDecimal! - newFeeAmount: BigDecimal! - newXSushiBurned: BigDecimal! - newXSushiMinted: BigDecimal! -} - -input DaySnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - userCount: BigInt - userCount_not: BigInt - userCount_gt: BigInt - userCount_lt: BigInt - userCount_gte: BigInt - userCount_lte: BigInt - userCount_in: [BigInt!] - userCount_not_in: [BigInt!] - transactionCount: BigInt - transactionCount_not: BigInt - transactionCount_gt: BigInt - transactionCount_lt: BigInt - transactionCount_gte: BigInt - transactionCount_lte: BigInt - transactionCount_in: [BigInt!] - transactionCount_not_in: [BigInt!] - sushiSupply: BigDecimal - sushiSupply_not: BigDecimal - sushiSupply_gt: BigDecimal - sushiSupply_lt: BigDecimal - sushiSupply_gte: BigDecimal - sushiSupply_lte: BigDecimal - sushiSupply_in: [BigDecimal!] - sushiSupply_not_in: [BigDecimal!] - xSushiSupply: BigDecimal - xSushiSupply_not: BigDecimal - xSushiSupply_gt: BigDecimal - xSushiSupply_lt: BigDecimal - xSushiSupply_gte: BigDecimal - xSushiSupply_lte: BigDecimal - xSushiSupply_in: [BigDecimal!] - xSushiSupply_not_in: [BigDecimal!] - sushiStaked: BigDecimal - sushiStaked_not: BigDecimal - sushiStaked_gt: BigDecimal - sushiStaked_lt: BigDecimal - sushiStaked_gte: BigDecimal - sushiStaked_lte: BigDecimal - sushiStaked_in: [BigDecimal!] - sushiStaked_not_in: [BigDecimal!] - sushiHarvested: BigDecimal - sushiHarvested_not: BigDecimal - sushiHarvested_gt: BigDecimal - sushiHarvested_lt: BigDecimal - sushiHarvested_gte: BigDecimal - sushiHarvested_lte: BigDecimal - sushiHarvested_in: [BigDecimal!] - sushiHarvested_not_in: [BigDecimal!] - totalFeeAmount: BigDecimal - totalFeeAmount_not: BigDecimal - totalFeeAmount_gt: BigDecimal - totalFeeAmount_lt: BigDecimal - totalFeeAmount_gte: BigDecimal - totalFeeAmount_lte: BigDecimal - totalFeeAmount_in: [BigDecimal!] - totalFeeAmount_not_in: [BigDecimal!] - xSushiBurned: BigDecimal - xSushiBurned_not: BigDecimal - xSushiBurned_gt: BigDecimal - xSushiBurned_lt: BigDecimal - xSushiBurned_gte: BigDecimal - xSushiBurned_lte: BigDecimal - xSushiBurned_in: [BigDecimal!] - xSushiBurned_not_in: [BigDecimal!] - xSushiMinted: BigDecimal - xSushiMinted_not: BigDecimal - xSushiMinted_gt: BigDecimal - xSushiMinted_lt: BigDecimal - xSushiMinted_gte: BigDecimal - xSushiMinted_lte: BigDecimal - xSushiMinted_in: [BigDecimal!] - xSushiMinted_not_in: [BigDecimal!] - xSushiSushiRatio: BigDecimal - xSushiSushiRatio_not: BigDecimal - xSushiSushiRatio_gt: BigDecimal - xSushiSushiRatio_lt: BigDecimal - xSushiSushiRatio_gte: BigDecimal - xSushiSushiRatio_lte: BigDecimal - xSushiSushiRatio_in: [BigDecimal!] - xSushiSushiRatio_not_in: [BigDecimal!] - sushiXsushiRatio: BigDecimal - sushiXsushiRatio_not: BigDecimal - sushiXsushiRatio_gt: BigDecimal - sushiXsushiRatio_lt: BigDecimal - sushiXsushiRatio_gte: BigDecimal - sushiXsushiRatio_lte: BigDecimal - sushiXsushiRatio_in: [BigDecimal!] - sushiXsushiRatio_not_in: [BigDecimal!] - apr1m: BigDecimal - apr1m_not: BigDecimal - apr1m_gt: BigDecimal - apr1m_lt: BigDecimal - apr1m_gte: BigDecimal - apr1m_lte: BigDecimal - apr1m_in: [BigDecimal!] - apr1m_not_in: [BigDecimal!] - apr3m: BigDecimal - apr3m_not: BigDecimal - apr3m_gt: BigDecimal - apr3m_lt: BigDecimal - apr3m_gte: BigDecimal - apr3m_lte: BigDecimal - apr3m_in: [BigDecimal!] - apr3m_not_in: [BigDecimal!] - apr6m: BigDecimal - apr6m_not: BigDecimal - apr6m_gt: BigDecimal - apr6m_lt: BigDecimal - apr6m_gte: BigDecimal - apr6m_lte: BigDecimal - apr6m_in: [BigDecimal!] - apr6m_not_in: [BigDecimal!] - apr12m: BigDecimal - apr12m_not: BigDecimal - apr12m_gt: BigDecimal - apr12m_lt: BigDecimal - apr12m_gte: BigDecimal - apr12m_lte: BigDecimal - apr12m_in: [BigDecimal!] - apr12m_not_in: [BigDecimal!] - newTransactions: BigInt - newTransactions_not: BigInt - newTransactions_gt: BigInt - newTransactions_lt: BigInt - newTransactions_gte: BigInt - newTransactions_lte: BigInt - newTransactions_in: [BigInt!] - newTransactions_not_in: [BigInt!] - newSushiStaked: BigDecimal - newSushiStaked_not: BigDecimal - newSushiStaked_gt: BigDecimal - newSushiStaked_lt: BigDecimal - newSushiStaked_gte: BigDecimal - newSushiStaked_lte: BigDecimal - newSushiStaked_in: [BigDecimal!] - newSushiStaked_not_in: [BigDecimal!] - newSushiHarvested: BigDecimal - newSushiHarvested_not: BigDecimal - newSushiHarvested_gt: BigDecimal - newSushiHarvested_lt: BigDecimal - newSushiHarvested_gte: BigDecimal - newSushiHarvested_lte: BigDecimal - newSushiHarvested_in: [BigDecimal!] - newSushiHarvested_not_in: [BigDecimal!] - newFeeAmount: BigDecimal - newFeeAmount_not: BigDecimal - newFeeAmount_gt: BigDecimal - newFeeAmount_lt: BigDecimal - newFeeAmount_gte: BigDecimal - newFeeAmount_lte: BigDecimal - newFeeAmount_in: [BigDecimal!] - newFeeAmount_not_in: [BigDecimal!] - newXSushiBurned: BigDecimal - newXSushiBurned_not: BigDecimal - newXSushiBurned_gt: BigDecimal - newXSushiBurned_lt: BigDecimal - newXSushiBurned_gte: BigDecimal - newXSushiBurned_lte: BigDecimal - newXSushiBurned_in: [BigDecimal!] - newXSushiBurned_not_in: [BigDecimal!] - newXSushiMinted: BigDecimal - newXSushiMinted_not: BigDecimal - newXSushiMinted_gt: BigDecimal - newXSushiMinted_lt: BigDecimal - newXSushiMinted_gte: BigDecimal - newXSushiMinted_lte: BigDecimal - newXSushiMinted_in: [BigDecimal!] - newXSushiMinted_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [DaySnapshot_filter] - or: [DaySnapshot_filter] -} - -enum DaySnapshot_orderBy { - id - date - userCount - transactionCount - sushiSupply - xSushiSupply - sushiStaked - sushiHarvested - totalFeeAmount - xSushiBurned - xSushiMinted - xSushiSushiRatio - sushiXsushiRatio - apr1m - apr3m - apr6m - apr12m - newTransactions - newSushiStaked - newSushiHarvested - newFeeAmount - newXSushiBurned - newXSushiMinted -} - -type Fee { - id: ID! - sender: FeeSender! - amount: BigInt! - createdAtBlock: BigInt! - createdAtTimestamp: BigInt! -} - -type FeeSender { - id: ID! - totalFeeSent: BigInt! - fees(skip: Int = 0, first: Int = 100, orderBy: Fee_orderBy, orderDirection: OrderDirection, where: Fee_filter): [Fee!]! - createdAtBlock: BigInt! - createdAtTimestamp: BigInt! - modifiedAtBlock: BigInt! - modifiedAtTimestamp: BigInt! -} - -input FeeSender_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - totalFeeSent: BigInt - totalFeeSent_not: BigInt - totalFeeSent_gt: BigInt - totalFeeSent_lt: BigInt - totalFeeSent_gte: BigInt - totalFeeSent_lte: BigInt - totalFeeSent_in: [BigInt!] - totalFeeSent_not_in: [BigInt!] - fees_: Fee_filter - createdAtBlock: BigInt - createdAtBlock_not: BigInt - createdAtBlock_gt: BigInt - createdAtBlock_lt: BigInt - createdAtBlock_gte: BigInt - createdAtBlock_lte: BigInt - createdAtBlock_in: [BigInt!] - createdAtBlock_not_in: [BigInt!] - createdAtTimestamp: BigInt - createdAtTimestamp_not: BigInt - createdAtTimestamp_gt: BigInt - createdAtTimestamp_lt: BigInt - createdAtTimestamp_gte: BigInt - createdAtTimestamp_lte: BigInt - createdAtTimestamp_in: [BigInt!] - createdAtTimestamp_not_in: [BigInt!] - modifiedAtBlock: BigInt - modifiedAtBlock_not: BigInt - modifiedAtBlock_gt: BigInt - modifiedAtBlock_lt: BigInt - modifiedAtBlock_gte: BigInt - modifiedAtBlock_lte: BigInt - modifiedAtBlock_in: [BigInt!] - modifiedAtBlock_not_in: [BigInt!] - modifiedAtTimestamp: BigInt - modifiedAtTimestamp_not: BigInt - modifiedAtTimestamp_gt: BigInt - modifiedAtTimestamp_lt: BigInt - modifiedAtTimestamp_gte: BigInt - modifiedAtTimestamp_lte: BigInt - modifiedAtTimestamp_in: [BigInt!] - modifiedAtTimestamp_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [FeeSender_filter] - or: [FeeSender_filter] -} - -enum FeeSender_orderBy { - id - totalFeeSent - fees - createdAtBlock - createdAtTimestamp - modifiedAtBlock - modifiedAtTimestamp -} - -input Fee_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - sender: String - sender_not: String - sender_gt: String - sender_lt: String - sender_gte: String - sender_lte: String - sender_in: [String!] - sender_not_in: [String!] - sender_contains: String - sender_contains_nocase: String - sender_not_contains: String - sender_not_contains_nocase: String - sender_starts_with: String - sender_starts_with_nocase: String - sender_not_starts_with: String - sender_not_starts_with_nocase: String - sender_ends_with: String - sender_ends_with_nocase: String - sender_not_ends_with: String - sender_not_ends_with_nocase: String - sender_: FeeSender_filter - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - createdAtBlock: BigInt - createdAtBlock_not: BigInt - createdAtBlock_gt: BigInt - createdAtBlock_lt: BigInt - createdAtBlock_gte: BigInt - createdAtBlock_lte: BigInt - createdAtBlock_in: [BigInt!] - createdAtBlock_not_in: [BigInt!] - createdAtTimestamp: BigInt - createdAtTimestamp_not: BigInt - createdAtTimestamp_gt: BigInt - createdAtTimestamp_lt: BigInt - createdAtTimestamp_gte: BigInt - createdAtTimestamp_lte: BigInt - createdAtTimestamp_in: [BigInt!] - createdAtTimestamp_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Fee_filter] - or: [Fee_filter] -} - -enum Fee_orderBy { - id - sender - sender__id - sender__totalFeeSent - sender__createdAtBlock - sender__createdAtTimestamp - sender__modifiedAtBlock - sender__modifiedAtTimestamp - amount - createdAtBlock - createdAtTimestamp -} - -type HourSnapshot { - """ {hour}-{date} """ - id: ID! - date: Int! - userCount: BigInt! - transactionCount: BigInt! - sushiSupply: BigDecimal! - xSushiSupply: BigDecimal! - sushiStaked: BigDecimal! - sushiHarvested: BigDecimal! - totalFeeAmount: BigDecimal! - xSushiBurned: BigDecimal! - xSushiMinted: BigDecimal! - xSushiSushiRatio: BigDecimal! - sushiXsushiRatio: BigDecimal! - apr1m: BigDecimal! - apr3m: BigDecimal! - apr6m: BigDecimal! - apr12m: BigDecimal! - newTransactions: BigInt! - newSushiStaked: BigDecimal! - newSushiHarvested: BigDecimal! - newFeeAmount: BigDecimal! - newXSushiBurned: BigDecimal! - newXSushiMinted: BigDecimal! -} - -input HourSnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - userCount: BigInt - userCount_not: BigInt - userCount_gt: BigInt - userCount_lt: BigInt - userCount_gte: BigInt - userCount_lte: BigInt - userCount_in: [BigInt!] - userCount_not_in: [BigInt!] - transactionCount: BigInt - transactionCount_not: BigInt - transactionCount_gt: BigInt - transactionCount_lt: BigInt - transactionCount_gte: BigInt - transactionCount_lte: BigInt - transactionCount_in: [BigInt!] - transactionCount_not_in: [BigInt!] - sushiSupply: BigDecimal - sushiSupply_not: BigDecimal - sushiSupply_gt: BigDecimal - sushiSupply_lt: BigDecimal - sushiSupply_gte: BigDecimal - sushiSupply_lte: BigDecimal - sushiSupply_in: [BigDecimal!] - sushiSupply_not_in: [BigDecimal!] - xSushiSupply: BigDecimal - xSushiSupply_not: BigDecimal - xSushiSupply_gt: BigDecimal - xSushiSupply_lt: BigDecimal - xSushiSupply_gte: BigDecimal - xSushiSupply_lte: BigDecimal - xSushiSupply_in: [BigDecimal!] - xSushiSupply_not_in: [BigDecimal!] - sushiStaked: BigDecimal - sushiStaked_not: BigDecimal - sushiStaked_gt: BigDecimal - sushiStaked_lt: BigDecimal - sushiStaked_gte: BigDecimal - sushiStaked_lte: BigDecimal - sushiStaked_in: [BigDecimal!] - sushiStaked_not_in: [BigDecimal!] - sushiHarvested: BigDecimal - sushiHarvested_not: BigDecimal - sushiHarvested_gt: BigDecimal - sushiHarvested_lt: BigDecimal - sushiHarvested_gte: BigDecimal - sushiHarvested_lte: BigDecimal - sushiHarvested_in: [BigDecimal!] - sushiHarvested_not_in: [BigDecimal!] - totalFeeAmount: BigDecimal - totalFeeAmount_not: BigDecimal - totalFeeAmount_gt: BigDecimal - totalFeeAmount_lt: BigDecimal - totalFeeAmount_gte: BigDecimal - totalFeeAmount_lte: BigDecimal - totalFeeAmount_in: [BigDecimal!] - totalFeeAmount_not_in: [BigDecimal!] - xSushiBurned: BigDecimal - xSushiBurned_not: BigDecimal - xSushiBurned_gt: BigDecimal - xSushiBurned_lt: BigDecimal - xSushiBurned_gte: BigDecimal - xSushiBurned_lte: BigDecimal - xSushiBurned_in: [BigDecimal!] - xSushiBurned_not_in: [BigDecimal!] - xSushiMinted: BigDecimal - xSushiMinted_not: BigDecimal - xSushiMinted_gt: BigDecimal - xSushiMinted_lt: BigDecimal - xSushiMinted_gte: BigDecimal - xSushiMinted_lte: BigDecimal - xSushiMinted_in: [BigDecimal!] - xSushiMinted_not_in: [BigDecimal!] - xSushiSushiRatio: BigDecimal - xSushiSushiRatio_not: BigDecimal - xSushiSushiRatio_gt: BigDecimal - xSushiSushiRatio_lt: BigDecimal - xSushiSushiRatio_gte: BigDecimal - xSushiSushiRatio_lte: BigDecimal - xSushiSushiRatio_in: [BigDecimal!] - xSushiSushiRatio_not_in: [BigDecimal!] - sushiXsushiRatio: BigDecimal - sushiXsushiRatio_not: BigDecimal - sushiXsushiRatio_gt: BigDecimal - sushiXsushiRatio_lt: BigDecimal - sushiXsushiRatio_gte: BigDecimal - sushiXsushiRatio_lte: BigDecimal - sushiXsushiRatio_in: [BigDecimal!] - sushiXsushiRatio_not_in: [BigDecimal!] - apr1m: BigDecimal - apr1m_not: BigDecimal - apr1m_gt: BigDecimal - apr1m_lt: BigDecimal - apr1m_gte: BigDecimal - apr1m_lte: BigDecimal - apr1m_in: [BigDecimal!] - apr1m_not_in: [BigDecimal!] - apr3m: BigDecimal - apr3m_not: BigDecimal - apr3m_gt: BigDecimal - apr3m_lt: BigDecimal - apr3m_gte: BigDecimal - apr3m_lte: BigDecimal - apr3m_in: [BigDecimal!] - apr3m_not_in: [BigDecimal!] - apr6m: BigDecimal - apr6m_not: BigDecimal - apr6m_gt: BigDecimal - apr6m_lt: BigDecimal - apr6m_gte: BigDecimal - apr6m_lte: BigDecimal - apr6m_in: [BigDecimal!] - apr6m_not_in: [BigDecimal!] - apr12m: BigDecimal - apr12m_not: BigDecimal - apr12m_gt: BigDecimal - apr12m_lt: BigDecimal - apr12m_gte: BigDecimal - apr12m_lte: BigDecimal - apr12m_in: [BigDecimal!] - apr12m_not_in: [BigDecimal!] - newTransactions: BigInt - newTransactions_not: BigInt - newTransactions_gt: BigInt - newTransactions_lt: BigInt - newTransactions_gte: BigInt - newTransactions_lte: BigInt - newTransactions_in: [BigInt!] - newTransactions_not_in: [BigInt!] - newSushiStaked: BigDecimal - newSushiStaked_not: BigDecimal - newSushiStaked_gt: BigDecimal - newSushiStaked_lt: BigDecimal - newSushiStaked_gte: BigDecimal - newSushiStaked_lte: BigDecimal - newSushiStaked_in: [BigDecimal!] - newSushiStaked_not_in: [BigDecimal!] - newSushiHarvested: BigDecimal - newSushiHarvested_not: BigDecimal - newSushiHarvested_gt: BigDecimal - newSushiHarvested_lt: BigDecimal - newSushiHarvested_gte: BigDecimal - newSushiHarvested_lte: BigDecimal - newSushiHarvested_in: [BigDecimal!] - newSushiHarvested_not_in: [BigDecimal!] - newFeeAmount: BigDecimal - newFeeAmount_not: BigDecimal - newFeeAmount_gt: BigDecimal - newFeeAmount_lt: BigDecimal - newFeeAmount_gte: BigDecimal - newFeeAmount_lte: BigDecimal - newFeeAmount_in: [BigDecimal!] - newFeeAmount_not_in: [BigDecimal!] - newXSushiBurned: BigDecimal - newXSushiBurned_not: BigDecimal - newXSushiBurned_gt: BigDecimal - newXSushiBurned_lt: BigDecimal - newXSushiBurned_gte: BigDecimal - newXSushiBurned_lte: BigDecimal - newXSushiBurned_in: [BigDecimal!] - newXSushiBurned_not_in: [BigDecimal!] - newXSushiMinted: BigDecimal - newXSushiMinted_not: BigDecimal - newXSushiMinted_gt: BigDecimal - newXSushiMinted_lt: BigDecimal - newXSushiMinted_gte: BigDecimal - newXSushiMinted_lte: BigDecimal - newXSushiMinted_in: [BigDecimal!] - newXSushiMinted_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [HourSnapshot_filter] - or: [HourSnapshot_filter] -} - -enum HourSnapshot_orderBy { - id - date - userCount - transactionCount - sushiSupply - xSushiSupply - sushiStaked - sushiHarvested - totalFeeAmount - xSushiBurned - xSushiMinted - xSushiSushiRatio - sushiXsushiRatio - apr1m - apr3m - apr6m - apr12m - newTransactions - newSushiStaked - newSushiHarvested - newFeeAmount - newXSushiBurned - newXSushiMinted -} - -"8 bytes signed integer\n" -scalar Int8 - -"""Defines the order direction, either ascending or descending""" -enum OrderDirection { - asc - desc -} - -type Query { - xsushi( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): XSushi - xsushis( - skip: Int = 0 - first: Int = 100 - orderBy: XSushi_orderBy - orderDirection: OrderDirection - where: XSushi_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [XSushi!]! - transaction( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Transaction - transactions( - skip: Int = 0 - first: Int = 100 - orderBy: Transaction_orderBy - orderDirection: OrderDirection - where: Transaction_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Transaction!]! - user( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): User - users( - skip: Int = 0 - first: Int = 100 - orderBy: User_orderBy - orderDirection: OrderDirection - where: User_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [User!]! - feeSender( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): FeeSender - feeSenders( - skip: Int = 0 - first: Int = 100 - orderBy: FeeSender_orderBy - orderDirection: OrderDirection - where: FeeSender_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [FeeSender!]! - fee( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Fee - fees( - skip: Int = 0 - first: Int = 100 - orderBy: Fee_orderBy - orderDirection: OrderDirection - where: Fee_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Fee!]! - hourSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): HourSnapshot - hourSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: HourSnapshot_orderBy - orderDirection: OrderDirection - where: HourSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [HourSnapshot!]! - daySnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): DaySnapshot - daySnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: DaySnapshot_orderBy - orderDirection: OrderDirection - where: DaySnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [DaySnapshot!]! - weekSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): WeekSnapshot - weekSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: WeekSnapshot_orderBy - orderDirection: OrderDirection - where: WeekSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [WeekSnapshot!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type Subscription { - xsushi( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): XSushi - xsushis( - skip: Int = 0 - first: Int = 100 - orderBy: XSushi_orderBy - orderDirection: OrderDirection - where: XSushi_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [XSushi!]! - transaction( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Transaction - transactions( - skip: Int = 0 - first: Int = 100 - orderBy: Transaction_orderBy - orderDirection: OrderDirection - where: Transaction_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Transaction!]! - user( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): User - users( - skip: Int = 0 - first: Int = 100 - orderBy: User_orderBy - orderDirection: OrderDirection - where: User_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [User!]! - feeSender( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): FeeSender - feeSenders( - skip: Int = 0 - first: Int = 100 - orderBy: FeeSender_orderBy - orderDirection: OrderDirection - where: FeeSender_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [FeeSender!]! - fee( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Fee - fees( - skip: Int = 0 - first: Int = 100 - orderBy: Fee_orderBy - orderDirection: OrderDirection - where: Fee_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Fee!]! - hourSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): HourSnapshot - hourSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: HourSnapshot_orderBy - orderDirection: OrderDirection - where: HourSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [HourSnapshot!]! - daySnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): DaySnapshot - daySnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: DaySnapshot_orderBy - orderDirection: OrderDirection - where: DaySnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [DaySnapshot!]! - weekSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): WeekSnapshot - weekSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: WeekSnapshot_orderBy - orderDirection: OrderDirection - where: WeekSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [WeekSnapshot!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -"A string representation of microseconds UNIX timestamp (16 digits)\n" -scalar Timestamp - -type Transaction { - id: ID! - from: User! - to: User! - amount: BigDecimal! - type: TransactionType! - gasUsed: BigInt! - gasLimit: BigInt! - gasPrice: BigInt! - createdAtBlock: BigInt! - createdAtTimestamp: BigInt! -} - -enum TransactionType { - TRANSFER - MINT - BURN -} - -input Transaction_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - from: String - from_not: String - from_gt: String - from_lt: String - from_gte: String - from_lte: String - from_in: [String!] - from_not_in: [String!] - from_contains: String - from_contains_nocase: String - from_not_contains: String - from_not_contains_nocase: String - from_starts_with: String - from_starts_with_nocase: String - from_not_starts_with: String - from_not_starts_with_nocase: String - from_ends_with: String - from_ends_with_nocase: String - from_not_ends_with: String - from_not_ends_with_nocase: String - from_: User_filter - to: String - to_not: String - to_gt: String - to_lt: String - to_gte: String - to_lte: String - to_in: [String!] - to_not_in: [String!] - to_contains: String - to_contains_nocase: String - to_not_contains: String - to_not_contains_nocase: String - to_starts_with: String - to_starts_with_nocase: String - to_not_starts_with: String - to_not_starts_with_nocase: String - to_ends_with: String - to_ends_with_nocase: String - to_not_ends_with: String - to_not_ends_with_nocase: String - to_: User_filter - amount: BigDecimal - amount_not: BigDecimal - amount_gt: BigDecimal - amount_lt: BigDecimal - amount_gte: BigDecimal - amount_lte: BigDecimal - amount_in: [BigDecimal!] - amount_not_in: [BigDecimal!] - type: TransactionType - type_not: TransactionType - type_in: [TransactionType!] - type_not_in: [TransactionType!] - gasUsed: BigInt - gasUsed_not: BigInt - gasUsed_gt: BigInt - gasUsed_lt: BigInt - gasUsed_gte: BigInt - gasUsed_lte: BigInt - gasUsed_in: [BigInt!] - gasUsed_not_in: [BigInt!] - gasLimit: BigInt - gasLimit_not: BigInt - gasLimit_gt: BigInt - gasLimit_lt: BigInt - gasLimit_gte: BigInt - gasLimit_lte: BigInt - gasLimit_in: [BigInt!] - gasLimit_not_in: [BigInt!] - gasPrice: BigInt - gasPrice_not: BigInt - gasPrice_gt: BigInt - gasPrice_lt: BigInt - gasPrice_gte: BigInt - gasPrice_lte: BigInt - gasPrice_in: [BigInt!] - gasPrice_not_in: [BigInt!] - createdAtBlock: BigInt - createdAtBlock_not: BigInt - createdAtBlock_gt: BigInt - createdAtBlock_lt: BigInt - createdAtBlock_gte: BigInt - createdAtBlock_lte: BigInt - createdAtBlock_in: [BigInt!] - createdAtBlock_not_in: [BigInt!] - createdAtTimestamp: BigInt - createdAtTimestamp_not: BigInt - createdAtTimestamp_gt: BigInt - createdAtTimestamp_lt: BigInt - createdAtTimestamp_gte: BigInt - createdAtTimestamp_lte: BigInt - createdAtTimestamp_in: [BigInt!] - createdAtTimestamp_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Transaction_filter] - or: [Transaction_filter] -} - -enum Transaction_orderBy { - id - from - from__id - from__balance - from__createdAtBlock - from__createdAtTimestamp - from__modifiedAtBlock - from__modifiedAtTimestamp - to - to__id - to__balance - to__createdAtBlock - to__createdAtTimestamp - to__modifiedAtBlock - to__modifiedAtTimestamp - amount - type - gasUsed - gasLimit - gasPrice - createdAtBlock - createdAtTimestamp -} - -type User { - id: ID! - balance: BigInt! - withdrawals(skip: Int = 0, first: Int = 100, orderBy: Transaction_orderBy, orderDirection: OrderDirection, where: Transaction_filter): [Transaction!]! - deposits(skip: Int = 0, first: Int = 100, orderBy: Transaction_orderBy, orderDirection: OrderDirection, where: Transaction_filter): [Transaction!]! - createdAtBlock: BigInt! - createdAtTimestamp: BigInt! - modifiedAtBlock: BigInt! - modifiedAtTimestamp: BigInt! -} - -input User_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - balance: BigInt - balance_not: BigInt - balance_gt: BigInt - balance_lt: BigInt - balance_gte: BigInt - balance_lte: BigInt - balance_in: [BigInt!] - balance_not_in: [BigInt!] - withdrawals_: Transaction_filter - deposits_: Transaction_filter - createdAtBlock: BigInt - createdAtBlock_not: BigInt - createdAtBlock_gt: BigInt - createdAtBlock_lt: BigInt - createdAtBlock_gte: BigInt - createdAtBlock_lte: BigInt - createdAtBlock_in: [BigInt!] - createdAtBlock_not_in: [BigInt!] - createdAtTimestamp: BigInt - createdAtTimestamp_not: BigInt - createdAtTimestamp_gt: BigInt - createdAtTimestamp_lt: BigInt - createdAtTimestamp_gte: BigInt - createdAtTimestamp_lte: BigInt - createdAtTimestamp_in: [BigInt!] - createdAtTimestamp_not_in: [BigInt!] - modifiedAtBlock: BigInt - modifiedAtBlock_not: BigInt - modifiedAtBlock_gt: BigInt - modifiedAtBlock_lt: BigInt - modifiedAtBlock_gte: BigInt - modifiedAtBlock_lte: BigInt - modifiedAtBlock_in: [BigInt!] - modifiedAtBlock_not_in: [BigInt!] - modifiedAtTimestamp: BigInt - modifiedAtTimestamp_not: BigInt - modifiedAtTimestamp_gt: BigInt - modifiedAtTimestamp_lt: BigInt - modifiedAtTimestamp_gte: BigInt - modifiedAtTimestamp_lte: BigInt - modifiedAtTimestamp_in: [BigInt!] - modifiedAtTimestamp_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [User_filter] - or: [User_filter] -} - -enum User_orderBy { - id - balance - withdrawals - deposits - createdAtBlock - createdAtTimestamp - modifiedAtBlock - modifiedAtTimestamp -} - -type WeekSnapshot { - """ {week}-{date} """ - id: ID! - date: Int! - userCount: BigInt! - transactionCount: BigInt! - sushiSupply: BigDecimal! - xSushiSupply: BigDecimal! - sushiStaked: BigDecimal! - sushiHarvested: BigDecimal! - totalFeeAmount: BigDecimal! - xSushiBurned: BigDecimal! - xSushiMinted: BigDecimal! - xSushiSushiRatio: BigDecimal! - sushiXsushiRatio: BigDecimal! - apr1m: BigDecimal! - apr3m: BigDecimal! - apr6m: BigDecimal! - apr12m: BigDecimal! - newTransactions: BigInt! - newSushiStaked: BigDecimal! - newSushiHarvested: BigDecimal! - newFeeAmount: BigDecimal! - newXSushiBurned: BigDecimal! - newXSushiMinted: BigDecimal! -} - -input WeekSnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - userCount: BigInt - userCount_not: BigInt - userCount_gt: BigInt - userCount_lt: BigInt - userCount_gte: BigInt - userCount_lte: BigInt - userCount_in: [BigInt!] - userCount_not_in: [BigInt!] - transactionCount: BigInt - transactionCount_not: BigInt - transactionCount_gt: BigInt - transactionCount_lt: BigInt - transactionCount_gte: BigInt - transactionCount_lte: BigInt - transactionCount_in: [BigInt!] - transactionCount_not_in: [BigInt!] - sushiSupply: BigDecimal - sushiSupply_not: BigDecimal - sushiSupply_gt: BigDecimal - sushiSupply_lt: BigDecimal - sushiSupply_gte: BigDecimal - sushiSupply_lte: BigDecimal - sushiSupply_in: [BigDecimal!] - sushiSupply_not_in: [BigDecimal!] - xSushiSupply: BigDecimal - xSushiSupply_not: BigDecimal - xSushiSupply_gt: BigDecimal - xSushiSupply_lt: BigDecimal - xSushiSupply_gte: BigDecimal - xSushiSupply_lte: BigDecimal - xSushiSupply_in: [BigDecimal!] - xSushiSupply_not_in: [BigDecimal!] - sushiStaked: BigDecimal - sushiStaked_not: BigDecimal - sushiStaked_gt: BigDecimal - sushiStaked_lt: BigDecimal - sushiStaked_gte: BigDecimal - sushiStaked_lte: BigDecimal - sushiStaked_in: [BigDecimal!] - sushiStaked_not_in: [BigDecimal!] - sushiHarvested: BigDecimal - sushiHarvested_not: BigDecimal - sushiHarvested_gt: BigDecimal - sushiHarvested_lt: BigDecimal - sushiHarvested_gte: BigDecimal - sushiHarvested_lte: BigDecimal - sushiHarvested_in: [BigDecimal!] - sushiHarvested_not_in: [BigDecimal!] - totalFeeAmount: BigDecimal - totalFeeAmount_not: BigDecimal - totalFeeAmount_gt: BigDecimal - totalFeeAmount_lt: BigDecimal - totalFeeAmount_gte: BigDecimal - totalFeeAmount_lte: BigDecimal - totalFeeAmount_in: [BigDecimal!] - totalFeeAmount_not_in: [BigDecimal!] - xSushiBurned: BigDecimal - xSushiBurned_not: BigDecimal - xSushiBurned_gt: BigDecimal - xSushiBurned_lt: BigDecimal - xSushiBurned_gte: BigDecimal - xSushiBurned_lte: BigDecimal - xSushiBurned_in: [BigDecimal!] - xSushiBurned_not_in: [BigDecimal!] - xSushiMinted: BigDecimal - xSushiMinted_not: BigDecimal - xSushiMinted_gt: BigDecimal - xSushiMinted_lt: BigDecimal - xSushiMinted_gte: BigDecimal - xSushiMinted_lte: BigDecimal - xSushiMinted_in: [BigDecimal!] - xSushiMinted_not_in: [BigDecimal!] - xSushiSushiRatio: BigDecimal - xSushiSushiRatio_not: BigDecimal - xSushiSushiRatio_gt: BigDecimal - xSushiSushiRatio_lt: BigDecimal - xSushiSushiRatio_gte: BigDecimal - xSushiSushiRatio_lte: BigDecimal - xSushiSushiRatio_in: [BigDecimal!] - xSushiSushiRatio_not_in: [BigDecimal!] - sushiXsushiRatio: BigDecimal - sushiXsushiRatio_not: BigDecimal - sushiXsushiRatio_gt: BigDecimal - sushiXsushiRatio_lt: BigDecimal - sushiXsushiRatio_gte: BigDecimal - sushiXsushiRatio_lte: BigDecimal - sushiXsushiRatio_in: [BigDecimal!] - sushiXsushiRatio_not_in: [BigDecimal!] - apr1m: BigDecimal - apr1m_not: BigDecimal - apr1m_gt: BigDecimal - apr1m_lt: BigDecimal - apr1m_gte: BigDecimal - apr1m_lte: BigDecimal - apr1m_in: [BigDecimal!] - apr1m_not_in: [BigDecimal!] - apr3m: BigDecimal - apr3m_not: BigDecimal - apr3m_gt: BigDecimal - apr3m_lt: BigDecimal - apr3m_gte: BigDecimal - apr3m_lte: BigDecimal - apr3m_in: [BigDecimal!] - apr3m_not_in: [BigDecimal!] - apr6m: BigDecimal - apr6m_not: BigDecimal - apr6m_gt: BigDecimal - apr6m_lt: BigDecimal - apr6m_gte: BigDecimal - apr6m_lte: BigDecimal - apr6m_in: [BigDecimal!] - apr6m_not_in: [BigDecimal!] - apr12m: BigDecimal - apr12m_not: BigDecimal - apr12m_gt: BigDecimal - apr12m_lt: BigDecimal - apr12m_gte: BigDecimal - apr12m_lte: BigDecimal - apr12m_in: [BigDecimal!] - apr12m_not_in: [BigDecimal!] - newTransactions: BigInt - newTransactions_not: BigInt - newTransactions_gt: BigInt - newTransactions_lt: BigInt - newTransactions_gte: BigInt - newTransactions_lte: BigInt - newTransactions_in: [BigInt!] - newTransactions_not_in: [BigInt!] - newSushiStaked: BigDecimal - newSushiStaked_not: BigDecimal - newSushiStaked_gt: BigDecimal - newSushiStaked_lt: BigDecimal - newSushiStaked_gte: BigDecimal - newSushiStaked_lte: BigDecimal - newSushiStaked_in: [BigDecimal!] - newSushiStaked_not_in: [BigDecimal!] - newSushiHarvested: BigDecimal - newSushiHarvested_not: BigDecimal - newSushiHarvested_gt: BigDecimal - newSushiHarvested_lt: BigDecimal - newSushiHarvested_gte: BigDecimal - newSushiHarvested_lte: BigDecimal - newSushiHarvested_in: [BigDecimal!] - newSushiHarvested_not_in: [BigDecimal!] - newFeeAmount: BigDecimal - newFeeAmount_not: BigDecimal - newFeeAmount_gt: BigDecimal - newFeeAmount_lt: BigDecimal - newFeeAmount_gte: BigDecimal - newFeeAmount_lte: BigDecimal - newFeeAmount_in: [BigDecimal!] - newFeeAmount_not_in: [BigDecimal!] - newXSushiBurned: BigDecimal - newXSushiBurned_not: BigDecimal - newXSushiBurned_gt: BigDecimal - newXSushiBurned_lt: BigDecimal - newXSushiBurned_gte: BigDecimal - newXSushiBurned_lte: BigDecimal - newXSushiBurned_in: [BigDecimal!] - newXSushiBurned_not_in: [BigDecimal!] - newXSushiMinted: BigDecimal - newXSushiMinted_not: BigDecimal - newXSushiMinted_gt: BigDecimal - newXSushiMinted_lt: BigDecimal - newXSushiMinted_gte: BigDecimal - newXSushiMinted_lte: BigDecimal - newXSushiMinted_in: [BigDecimal!] - newXSushiMinted_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [WeekSnapshot_filter] - or: [WeekSnapshot_filter] -} - -enum WeekSnapshot_orderBy { - id - date - userCount - transactionCount - sushiSupply - xSushiSupply - sushiStaked - sushiHarvested - totalFeeAmount - xSushiBurned - xSushiMinted - xSushiSushiRatio - sushiXsushiRatio - apr1m - apr3m - apr6m - apr12m - newTransactions - newSushiStaked - newSushiHarvested - newFeeAmount - newXSushiBurned - newXSushiMinted -} - -type XSushi { - id: ID! - userCount: BigInt! - transactionCount: BigInt! - sushiSupply: BigDecimal! - xSushiSupply: BigDecimal! - sushiStaked: BigDecimal! - sushiHarvested: BigDecimal! - totalFeeAmount: BigDecimal! - xSushiBurned: BigDecimal! - xSushiMinted: BigDecimal! - xSushiSushiRatio: BigDecimal! - sushiXsushiRatio: BigDecimal! - apr1m: BigDecimal! - apr3m: BigDecimal! - apr6m: BigDecimal! - apr12m: BigDecimal! - aprUpdatedAtTimestamp: BigInt! -} - -input XSushi_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - userCount: BigInt - userCount_not: BigInt - userCount_gt: BigInt - userCount_lt: BigInt - userCount_gte: BigInt - userCount_lte: BigInt - userCount_in: [BigInt!] - userCount_not_in: [BigInt!] - transactionCount: BigInt - transactionCount_not: BigInt - transactionCount_gt: BigInt - transactionCount_lt: BigInt - transactionCount_gte: BigInt - transactionCount_lte: BigInt - transactionCount_in: [BigInt!] - transactionCount_not_in: [BigInt!] - sushiSupply: BigDecimal - sushiSupply_not: BigDecimal - sushiSupply_gt: BigDecimal - sushiSupply_lt: BigDecimal - sushiSupply_gte: BigDecimal - sushiSupply_lte: BigDecimal - sushiSupply_in: [BigDecimal!] - sushiSupply_not_in: [BigDecimal!] - xSushiSupply: BigDecimal - xSushiSupply_not: BigDecimal - xSushiSupply_gt: BigDecimal - xSushiSupply_lt: BigDecimal - xSushiSupply_gte: BigDecimal - xSushiSupply_lte: BigDecimal - xSushiSupply_in: [BigDecimal!] - xSushiSupply_not_in: [BigDecimal!] - sushiStaked: BigDecimal - sushiStaked_not: BigDecimal - sushiStaked_gt: BigDecimal - sushiStaked_lt: BigDecimal - sushiStaked_gte: BigDecimal - sushiStaked_lte: BigDecimal - sushiStaked_in: [BigDecimal!] - sushiStaked_not_in: [BigDecimal!] - sushiHarvested: BigDecimal - sushiHarvested_not: BigDecimal - sushiHarvested_gt: BigDecimal - sushiHarvested_lt: BigDecimal - sushiHarvested_gte: BigDecimal - sushiHarvested_lte: BigDecimal - sushiHarvested_in: [BigDecimal!] - sushiHarvested_not_in: [BigDecimal!] - totalFeeAmount: BigDecimal - totalFeeAmount_not: BigDecimal - totalFeeAmount_gt: BigDecimal - totalFeeAmount_lt: BigDecimal - totalFeeAmount_gte: BigDecimal - totalFeeAmount_lte: BigDecimal - totalFeeAmount_in: [BigDecimal!] - totalFeeAmount_not_in: [BigDecimal!] - xSushiBurned: BigDecimal - xSushiBurned_not: BigDecimal - xSushiBurned_gt: BigDecimal - xSushiBurned_lt: BigDecimal - xSushiBurned_gte: BigDecimal - xSushiBurned_lte: BigDecimal - xSushiBurned_in: [BigDecimal!] - xSushiBurned_not_in: [BigDecimal!] - xSushiMinted: BigDecimal - xSushiMinted_not: BigDecimal - xSushiMinted_gt: BigDecimal - xSushiMinted_lt: BigDecimal - xSushiMinted_gte: BigDecimal - xSushiMinted_lte: BigDecimal - xSushiMinted_in: [BigDecimal!] - xSushiMinted_not_in: [BigDecimal!] - xSushiSushiRatio: BigDecimal - xSushiSushiRatio_not: BigDecimal - xSushiSushiRatio_gt: BigDecimal - xSushiSushiRatio_lt: BigDecimal - xSushiSushiRatio_gte: BigDecimal - xSushiSushiRatio_lte: BigDecimal - xSushiSushiRatio_in: [BigDecimal!] - xSushiSushiRatio_not_in: [BigDecimal!] - sushiXsushiRatio: BigDecimal - sushiXsushiRatio_not: BigDecimal - sushiXsushiRatio_gt: BigDecimal - sushiXsushiRatio_lt: BigDecimal - sushiXsushiRatio_gte: BigDecimal - sushiXsushiRatio_lte: BigDecimal - sushiXsushiRatio_in: [BigDecimal!] - sushiXsushiRatio_not_in: [BigDecimal!] - apr1m: BigDecimal - apr1m_not: BigDecimal - apr1m_gt: BigDecimal - apr1m_lt: BigDecimal - apr1m_gte: BigDecimal - apr1m_lte: BigDecimal - apr1m_in: [BigDecimal!] - apr1m_not_in: [BigDecimal!] - apr3m: BigDecimal - apr3m_not: BigDecimal - apr3m_gt: BigDecimal - apr3m_lt: BigDecimal - apr3m_gte: BigDecimal - apr3m_lte: BigDecimal - apr3m_in: [BigDecimal!] - apr3m_not_in: [BigDecimal!] - apr6m: BigDecimal - apr6m_not: BigDecimal - apr6m_gt: BigDecimal - apr6m_lt: BigDecimal - apr6m_gte: BigDecimal - apr6m_lte: BigDecimal - apr6m_in: [BigDecimal!] - apr6m_not_in: [BigDecimal!] - apr12m: BigDecimal - apr12m_not: BigDecimal - apr12m_gt: BigDecimal - apr12m_lt: BigDecimal - apr12m_gte: BigDecimal - apr12m_lte: BigDecimal - apr12m_in: [BigDecimal!] - apr12m_not_in: [BigDecimal!] - aprUpdatedAtTimestamp: BigInt - aprUpdatedAtTimestamp_not: BigInt - aprUpdatedAtTimestamp_gt: BigInt - aprUpdatedAtTimestamp_lt: BigInt - aprUpdatedAtTimestamp_gte: BigInt - aprUpdatedAtTimestamp_lte: BigInt - aprUpdatedAtTimestamp_in: [BigInt!] - aprUpdatedAtTimestamp_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [XSushi_filter] - or: [XSushi_filter] -} - -enum XSushi_orderBy { - id - userCount - transactionCount - sushiSupply - xSushiSupply - sushiStaked - sushiHarvested - totalFeeAmount - xSushiBurned - xSushiMinted - xSushiSushiRatio - sushiXsushiRatio - apr1m - apr3m - apr6m - apr12m - aprUpdatedAtTimestamp -} - -type _Block_ { - """The hash of the block""" - hash: Bytes - - """The block number""" - number: Int! - - """Integer representation of the timestamp stored in blocks for the chain""" - timestamp: Int - - """The hash of the parent block""" - parentHash: Bytes -} - -"""The type for the top-level _meta field""" -type _Meta_ { - "Information about a specific subgraph block. The hash of the block\nwill be null if the _meta field has a block constraint that asks for\na block number. It will be filled if the _meta field has no block constraint\nand therefore asks for the latest block\n" - block: _Block_! - - """The deployment ID""" - deployment: String! - - """If `true`, the subgraph encountered indexing errors at some past block""" - hasIndexingErrors: Boolean! -} - -enum _SubgraphErrorPolicy_ { - """Data will be returned even if the subgraph has indexing errors""" - allow - - """ - If the subgraph has indexing errors, data will be omitted. The default. - """ - deny -} \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/sushi-v2/fragments/pool-fields.ts b/packages/graph-client/src/subgraphs/sushi-v2/fragments/pool-fields.ts deleted file mode 100644 index ffc4a3e18f..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/fragments/pool-fields.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { graphql } from '../graphql' - -export const PoolFieldsFragment = graphql(` - fragment PoolFields on Pair @_unmask { - id - token0 { - name - id - decimals - symbol - } - token1 { - name - id - decimals - symbol - } - createdAtBlockNumber - createdAtTimestamp - reserve0 - reserve1 - totalSupply - liquidityUSD: reserveUSD - liquidityNative: reserveETH - token0Price - token1Price - volumeUSD - txCount - } -`) diff --git a/packages/graph-client/src/subgraphs/sushi-v2/graphql.ts b/packages/graph-client/src/subgraphs/sushi-v2/graphql.ts deleted file mode 100644 index f63cba0e01..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/graphql.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { initGraphQLTada } from 'gql.tada' -import type { Scalars } from 'src/lib/types/scalars.js' -import type { introspection } from './sushi-v2-env.js' - -export const graphql = initGraphQLTada<{ - introspection: introspection - scalars: Scalars -}>() diff --git a/packages/graph-client/src/subgraphs/sushi-v2/index.ts b/packages/graph-client/src/subgraphs/sushi-v2/index.ts deleted file mode 100644 index 001281615f..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './queries/burns' -export * from './queries/day-datas' -export * from './queries/factory' -export * from './queries/liquidity-positions' -export * from './queries/mints' -export * from './queries/pool' -export * from './queries/pools' -export * from './queries/swaps' -export * from './queries/tokens' -export * from './queries/transactions' diff --git a/packages/graph-client/src/subgraphs/sushi-v2/queries/burns.ts b/packages/graph-client/src/subgraphs/sushi-v2/queries/burns.ts deleted file mode 100644 index ca27da5d1d..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/queries/burns.ts +++ /dev/null @@ -1,54 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV2ChainId } from 'sushi/config' -import { SUSHISWAP_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import { FetchError } from 'src/lib/fetch-error' -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV2BurnsQuery = graphql(` - query Burns($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Burn_orderBy, $orderDirection: OrderDirection, $where: Burn_filter) { - burns(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - sender - liquidity - amount0 - amount1 - amountUSD - logIndex - transaction { - id - createdAtTimestamp: timestamp - createdAtBlock: blockNumber - } - } - } -`) - -export type GetSushiV2Burns = VariablesOf & - ChainIdVariable - -export async function getSushiV2Burns( - { chainId, ...variables }: GetSushiV2Burns, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V2_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV2BurnsQuery, - variables, - options, - }) - - if (result) { - return result.burns - } - - throw new FetchError(chainId, 'Failed to fetch burns') -} - -export type SushiV2Burns = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v2/queries/day-datas.ts b/packages/graph-client/src/subgraphs/sushi-v2/queries/day-datas.ts deleted file mode 100644 index b736dc2b16..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/queries/day-datas.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV2ChainId } from 'sushi/config' -import { SUSHISWAP_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV2DayDatasQuery = graphql(` - query DayDatas($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: UniswapDayData_orderBy, $orderDirection: OrderDirection, $where: UniswapDayData_filter) { - uniswapDayDatas(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - date - dailyVolumeUSD - dailyVolumeUntracked - totalLiquidityUSD - txCount - } - } -`) - -export type GetSushiV2DayDatas = VariablesOf & - ChainIdVariable - -export async function getSushiV2DayDatas( - { chainId, ...variables }: GetSushiV2DayDatas, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V2_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV2DayDatasQuery, - variables, - options, - }) - - return result.uniswapDayDatas.map((dayData) => ({ - id: dayData.id, - date: dayData.date, - volumeUSD: Number(dayData.dailyVolumeUSD), - volumeUSDUntracked: Number(dayData.dailyVolumeUntracked), - liquidityUSD: Number(dayData.totalLiquidityUSD), - txCount: Number(dayData.txCount), - feesUSD: Number(dayData.totalLiquidityUSD) * 0.003, - })) -} - -export type SushiV2DayDatas = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v2/queries/factory.ts b/packages/graph-client/src/subgraphs/sushi-v2/queries/factory.ts deleted file mode 100644 index 3e43d4d7f2..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/queries/factory.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV2ChainId } from 'sushi/config' -import { SUSHISWAP_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import { FetchError } from 'src/lib/fetch-error' -import { addChainId } from 'src/lib/modifiers/add-chain-id' -import { convertIdToMultichainId } from 'src/lib/modifiers/convert-id-to-multichain-id' -import { copyIdToAddress } from 'src/lib/modifiers/copy-id-to-address' -import { type RequestOptions, request } from 'src/lib/request' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV2FactoriesQuery = graphql(` - query Factories { - uniswapFactories(first: 1) { - id - totalLiquidityUSD - untrackedVolumeUSD - totalVolumeUSD - poolCount: pairCount - } - } -`) - -export type GetSushiV2Factory = VariablesOf & - ChainIdVariable - -export async function getSushiV2Factory( - { chainId, ...variables }: GetSushiV2Factory, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V2_SUBGRAPH_URL[chainId]}` - - const result = await request( - { - url, - document: SushiV2FactoriesQuery, - variables, - }, - options, - ) - - if (result.uniswapFactories[0]) { - return convertIdToMultichainId( - copyIdToAddress(addChainId(chainId, result.uniswapFactories[0])), - ) - } - - throw new FetchError(chainId, 'Failed to fetch factory') -} - -export type SushiV2Factory = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v2/queries/liquidity-positions.ts b/packages/graph-client/src/subgraphs/sushi-v2/queries/liquidity-positions.ts deleted file mode 100644 index ed85ad9ae6..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/queries/liquidity-positions.ts +++ /dev/null @@ -1,94 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import { type SushiSwapV2ChainId, publicClientConfig } from 'sushi/config' -import { SUSHISWAP_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' -import { SushiSwapProtocol } from 'sushi/types' -import { createPublicClient, erc20Abi } from 'viem' - -import { FetchError } from 'src/lib/fetch-error' -import { addChainId } from 'src/lib/modifiers/add-chain-id' -import { convertIdToMultichainId } from 'src/lib/modifiers/convert-id-to-multichain-id' -import { copyIdToAddress } from 'src/lib/modifiers/copy-id-to-address' -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import type { Hex } from 'src/lib/types/hex' -import { graphql } from '../graphql' - -export const SushiV2LiquidityPositionsQuery = graphql(` - query LiquidityPositions($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: LiquidityPosition_orderBy, $orderDirection: OrderDirection, $where: LiquidityPosition_filter) { - liquidityPositions(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - balance: liquidityTokenBalance - pair { - id - } - user { - id - } - } - } -`) - -export type GetSushiV2LiquidityPositions = VariablesOf< - typeof SushiV2LiquidityPositionsQuery -> & - ChainIdVariable - -export async function getSushiV2LiquidityPositions( - { chainId, ...variables }: GetSushiV2LiquidityPositions, - options?: RequestOptions, -) { - try { - const url = `https://${SUSHISWAP_V2_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV2LiquidityPositionsQuery, - variables, - options, - }) - - const transformed = result.liquidityPositions.map((position) => { - const pool = { - ...convertIdToMultichainId( - copyIdToAddress(addChainId(chainId, position.pair)), - ), - protocol: SushiSwapProtocol.SUSHISWAP_V2, - } - - return { - id: position.id, - balance: position.balance, - pool, - user: position.user.id as Hex, - } - }) - - const client = createPublicClient(publicClientConfig[chainId]) - const balances = await client.multicall({ - contracts: transformed.map( - (pos) => - ({ - abi: erc20Abi, - functionName: 'balanceOf', - address: pos.pool.address, - args: [pos.user], - }) as const, - ), - allowFailure: false, - }) - - transformed.forEach((pos, i) => { - pos.balance = String(balances[i]!) - }) - - return transformed - } catch { - throw new FetchError(chainId, 'Failed to fetch liquidity positions') - } -} - -export type SushiV2LiquidityPositions = Awaited< - ReturnType -> diff --git a/packages/graph-client/src/subgraphs/sushi-v2/queries/mints.ts b/packages/graph-client/src/subgraphs/sushi-v2/queries/mints.ts deleted file mode 100644 index b6d7ab7bfc..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/queries/mints.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV2ChainId } from 'sushi/config' -import { SUSHISWAP_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV2MintsQuery = graphql(` - query Mints($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Mint_orderBy, $orderDirection: OrderDirection, $where: Mint_filter) { - mints(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - sender - liquidity - amount0 - amount1 - amountUSD - logIndex - transaction { - id - createdAtTimestamp: timestamp - createdAtBlock: blockNumber - } - } - } -`) - -export type GetSushiV2Mints = VariablesOf & - ChainIdVariable - -export async function getSushiV2Mints( - { chainId, ...variables }: GetSushiV2Mints, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V2_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV2MintsQuery, - variables, - options, - }) - - return result.mints -} - -export type SushiV2Mints = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v2/queries/pool-with-buckets.ts b/packages/graph-client/src/subgraphs/sushi-v2/queries/pool-with-buckets.ts deleted file mode 100644 index ec06613bfd..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/queries/pool-with-buckets.ts +++ /dev/null @@ -1,87 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV2ChainId } from 'sushi/config' -import { SUSHISWAP_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import { FetchError } from 'src/lib/fetch-error' -import { type RequestOptions, request } from 'src/lib/request' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import type { Hex } from 'src/lib/types/hex' -import { transformBucketsV2ToStd } from 'src/subgraphs/sushi-v2/transforms/bucket-v2-to-std' -import { transformPoolV2ToBase } from 'src/subgraphs/sushi-v2/transforms/pool-v2-to-base' -import type { PoolBase, PoolV2, PoolWithBuckets } from 'sushi/types' -import { PoolFieldsFragment } from '../fragments/pool-fields' -import { graphql } from '../graphql' - -export const SushiV2PoolBucketsQuery = graphql( - ` - query PoolBuckets($id: ID!, $id_Bytes: Bytes!, $block: Block_height, $hourDataFirst: Int = 168, $dayDataFirst: Int = 1000) { - pair(id: $id, block: $block) { - ...PoolFields - - poolHourData: pairHourData(first: $hourDataFirst, orderBy: hourStartUnix, orderDirection: desc) { - id - date: hourStartUnix - liquidityUSD: reserveUSD - volumeUSD: hourlyVolumeUSD - txCount: hourlyTxns - } - } - - poolDayData: pairDayDatas(first: $dayDataFirst, orderBy: date, orderDirection: desc, where: { pairAddress: $id_Bytes }) { - id - date - liquidityUSD: reserveUSD - volumeUSD: dailyVolumeUSD - txCount: dailyTxns - } - } -`, - [PoolFieldsFragment], -) - -export type GetSushiV2PoolBuckets = Omit< - VariablesOf, - 'id_Bytes' -> & - ChainIdVariable - -export type SushiV2PoolBuckets = PoolWithBuckets> - -export async function getSushiV2PoolBuckets( - { chainId, ...variables }: GetSushiV2PoolBuckets, - options?: RequestOptions, -): Promise { - const url = `https://${SUSHISWAP_V2_SUBGRAPH_URL[chainId]}` - - if (variables?.dayDataFirst || 0 > 1000) { - throw new Error( - 'dayDataFirst must be less than or equal to 1000, paging is not implemented', - ) - } - - const result = await request( - { - url, - document: SushiV2PoolBucketsQuery, - variables: { - ...variables, - id: variables.id.toLowerCase(), - id_Bytes: variables.id.toLowerCase() as Hex, - }, - }, - options, - ) - - if (result.pair) { - return { - ...transformPoolV2ToBase(result.pair, chainId), - poolHourData: transformBucketsV2ToStd(result.pair.poolHourData), - poolDayData: transformBucketsV2ToStd(result.poolDayData), - } - } - - throw new FetchError( - chainId, - `Failed to fetch pool ${chainId}:${variables.id}`, - ) -} diff --git a/packages/graph-client/src/subgraphs/sushi-v2/queries/pool.ts b/packages/graph-client/src/subgraphs/sushi-v2/queries/pool.ts deleted file mode 100644 index 285686c144..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/queries/pool.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV2ChainId } from 'sushi/config' -import { SUSHISWAP_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' -import type { PoolBase, PoolV2 } from 'sushi/types' - -import { FetchError } from 'src/lib/fetch-error' -import { type RequestOptions, request } from 'src/lib/request' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { transformPoolV2ToBase } from 'src/subgraphs/sushi-v2/transforms/pool-v2-to-base' -import { PoolFieldsFragment } from '../fragments/pool-fields' -import { graphql } from '../graphql' - -export const SushiV2PoolQuery = graphql( - ` - query Pool($id: ID!, $block: Block_height) { - pool: pair(id: $id, block: $block) { - ...PoolFields - } - } -`, - [PoolFieldsFragment], -) - -export type GetSushiV2Pool = VariablesOf & - ChainIdVariable - -export async function getSushiV2Pool( - { chainId, ...variables }: GetSushiV2Pool, - options?: RequestOptions, -): Promise> { - const url = `https://${SUSHISWAP_V2_SUBGRAPH_URL[chainId]}` - - const result = await request( - { url, document: SushiV2PoolQuery, variables }, - options, - ) - - if (result.pool) { - return transformPoolV2ToBase(result.pool, chainId) - } - - throw new FetchError( - chainId, - `Failed to fetch pool ${chainId}:${variables.id}`, - ) -} - -export type SushiV2Pool = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v2/queries/pools.ts b/packages/graph-client/src/subgraphs/sushi-v2/queries/pools.ts deleted file mode 100644 index d9cf360d55..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/queries/pools.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV2ChainId } from 'sushi/config' -import { SUSHISWAP_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' -import type { PoolBase, PoolV2 } from 'sushi/types' - -import { FetchError } from 'src/lib/fetch-error' -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { transformPoolV2ToBase } from 'src/subgraphs/sushi-v2/transforms/pool-v2-to-base' -import { PoolFieldsFragment } from '../fragments/pool-fields' -import { graphql } from '../graphql' - -export const SushiV2PoolsQuery = graphql( - ` - query Pools($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Pair_orderBy, $orderDirection: OrderDirection, $where: Pair_filter) { - pairs(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - ...PoolFields - } - } -`, - [PoolFieldsFragment], -) - -export type GetSushiV2Pools = VariablesOf & - ChainIdVariable - -export type SushiV2Pools = PoolV2[] - -export async function getSushiV2Pools( - { chainId, ...variables }: GetSushiV2Pools, - options?: RequestOptions, -): Promise { - const url = `https://${SUSHISWAP_V2_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV2PoolsQuery, - variables, - options, - }) - - if (result) { - return result.pairs.map((pool) => transformPoolV2ToBase(pool, chainId)) - } - - throw new FetchError(chainId, 'Failed to fetch pools') -} diff --git a/packages/graph-client/src/subgraphs/sushi-v2/queries/swaps.ts b/packages/graph-client/src/subgraphs/sushi-v2/queries/swaps.ts deleted file mode 100644 index ad128c5b90..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/queries/swaps.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV2ChainId } from 'sushi/config' -import { SUSHISWAP_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV2SwapsQuery = graphql(` - query Swaps($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Swap_orderBy, $orderDirection: OrderDirection, $where: Swap_filter) { - swaps(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - sender - to - amount0In - amount1In - amount0Out - amount1Out - amountUSD - logIndex - amountUSD - logIndex - transaction { - id - createdAtTimestamp: timestamp - createdAtBlock: blockNumber - } - } - } -`) - -export type GetSushiV2Swaps = VariablesOf & - ChainIdVariable - -export async function getSushiV2Swaps( - { chainId, ...variables }: GetSushiV2Swaps, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V2_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV2SwapsQuery, - variables, - options, - }) - - return result.swaps -} - -export type SushiV2Swaps = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v2/queries/tokens.ts b/packages/graph-client/src/subgraphs/sushi-v2/queries/tokens.ts deleted file mode 100644 index c7bcd61c82..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/queries/tokens.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV2ChainId } from 'sushi/config' -import { SUSHISWAP_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import { addChainId } from 'src/lib/modifiers/add-chain-id' -import { convertIdToMultichainId } from 'src/lib/modifiers/convert-id-to-multichain-id' -import { copyIdToAddress } from 'src/lib/modifiers/copy-id-to-address' -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV2TokensQuery = graphql(` - query Tokens($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Token_orderBy, $orderDirection: OrderDirection, $where: Token_filter) { - tokens(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - name - symbol - decimals - volumeUSD: tradeVolumeUSD - totalLiquidity - } - } -`) - -export type GetSushiV2Tokens = VariablesOf & - ChainIdVariable - -export async function getSushiV2Tokens( - { chainId, ...variables }: GetSushiV2Tokens, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V2_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV2TokensQuery, - variables, - options, - }) - - return result.tokens.map((token) => - convertIdToMultichainId(copyIdToAddress(addChainId(chainId, token))), - ) -} - -export type SushiV2Tokens = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v2/queries/transactions.ts b/packages/graph-client/src/subgraphs/sushi-v2/queries/transactions.ts deleted file mode 100644 index eb9ab4744f..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/queries/transactions.ts +++ /dev/null @@ -1,73 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV2ChainId } from 'sushi/config' -import { SUSHISWAP_V2_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV2TransactionsQuery = graphql(` - query Transactions($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Transaction_orderBy, $orderDirection: OrderDirection, $where: Transaction_filter) { - transactions(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - createdAtTimestamp: timestamp - createdAtBlock: blockNumber - mints { - id - sender - liquidity - amount0 - amount1 - amountUSD - logIndex - } - burns { - id - sender - liquidity - amount0 - amount1 - amountUSD - logIndex - } - swaps { - id - sender - to - amount0In - amount1In - amount0Out - amount1Out - amountUSD - logIndex - } - } - } -`) - -export type GetSushiV2Transactions = VariablesOf< - typeof SushiV2TransactionsQuery -> & - ChainIdVariable - -export async function getSushiV2Transactions( - { chainId, ...variables }: GetSushiV2Transactions, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V2_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV2TransactionsQuery, - variables, - options, - }) - - return result.transactions -} - -export type SushiV2Transactions = Awaited< - ReturnType -> diff --git a/packages/graph-client/src/subgraphs/sushi-v2/schema.graphql b/packages/graph-client/src/subgraphs/sushi-v2/schema.graphql deleted file mode 100644 index c000f6a9c3..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/schema.graphql +++ /dev/null @@ -1,3197 +0,0 @@ -""" -Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive. -""" -directive @entity on OBJECT - -"""Defined a Subgraph ID for an object type""" -directive @subgraphId(id: String!) on OBJECT - -""" -creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API. -""" -directive @derivedFrom(field: String!) on FIELD_DEFINITION - -enum Aggregation_interval { - hour - day -} - -scalar BigDecimal - -scalar BigInt - -input BlockChangedFilter { - number_gte: Int! -} - -input Block_height { - hash: Bytes - number: Int - number_gte: Int -} - -type Bundle { - id: ID! - ethPrice: BigDecimal! -} - -input Bundle_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - ethPrice: BigDecimal - ethPrice_not: BigDecimal - ethPrice_gt: BigDecimal - ethPrice_lt: BigDecimal - ethPrice_gte: BigDecimal - ethPrice_lte: BigDecimal - ethPrice_in: [BigDecimal!] - ethPrice_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Bundle_filter] - or: [Bundle_filter] -} - -enum Bundle_orderBy { - id - ethPrice -} - -type Burn { - id: Bytes! - transaction: Transaction! - timestamp: BigInt! - pair: Pair! - liquidity: BigDecimal! - sender: Bytes - amount0: BigDecimal - amount1: BigDecimal - to: Bytes - logIndex: BigInt - amountUSD: BigDecimal - needsComplete: Boolean! - feeTo: Bytes - feeLiquidity: BigDecimal -} - -input Burn_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - pair: String - pair_not: String - pair_gt: String - pair_lt: String - pair_gte: String - pair_lte: String - pair_in: [String!] - pair_not_in: [String!] - pair_contains: String - pair_contains_nocase: String - pair_not_contains: String - pair_not_contains_nocase: String - pair_starts_with: String - pair_starts_with_nocase: String - pair_not_starts_with: String - pair_not_starts_with_nocase: String - pair_ends_with: String - pair_ends_with_nocase: String - pair_not_ends_with: String - pair_not_ends_with_nocase: String - pair_: Pair_filter - liquidity: BigDecimal - liquidity_not: BigDecimal - liquidity_gt: BigDecimal - liquidity_lt: BigDecimal - liquidity_gte: BigDecimal - liquidity_lte: BigDecimal - liquidity_in: [BigDecimal!] - liquidity_not_in: [BigDecimal!] - sender: Bytes - sender_not: Bytes - sender_gt: Bytes - sender_lt: Bytes - sender_gte: Bytes - sender_lte: Bytes - sender_in: [Bytes!] - sender_not_in: [Bytes!] - sender_contains: Bytes - sender_not_contains: Bytes - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - to: Bytes - to_not: Bytes - to_gt: Bytes - to_lt: Bytes - to_gte: Bytes - to_lte: Bytes - to_in: [Bytes!] - to_not_in: [Bytes!] - to_contains: Bytes - to_not_contains: Bytes - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - needsComplete: Boolean - needsComplete_not: Boolean - needsComplete_in: [Boolean!] - needsComplete_not_in: [Boolean!] - feeTo: Bytes - feeTo_not: Bytes - feeTo_gt: Bytes - feeTo_lt: Bytes - feeTo_gte: Bytes - feeTo_lte: Bytes - feeTo_in: [Bytes!] - feeTo_not_in: [Bytes!] - feeTo_contains: Bytes - feeTo_not_contains: Bytes - feeLiquidity: BigDecimal - feeLiquidity_not: BigDecimal - feeLiquidity_gt: BigDecimal - feeLiquidity_lt: BigDecimal - feeLiquidity_gte: BigDecimal - feeLiquidity_lte: BigDecimal - feeLiquidity_in: [BigDecimal!] - feeLiquidity_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Burn_filter] - or: [Burn_filter] -} - -enum Burn_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - timestamp - pair - pair__id - pair__reserve0 - pair__reserve1 - pair__totalSupply - pair__reserveETH - pair__reserveUSD - pair__trackedReserveETH - pair__token0Price - pair__token1Price - pair__volumeToken0 - pair__volumeToken1 - pair__volumeUSD - pair__untrackedVolumeUSD - pair__txCount - pair__createdAtTimestamp - pair__createdAtBlockNumber - pair__liquidityProviderCount - liquidity - sender - amount0 - amount1 - to - logIndex - amountUSD - needsComplete - feeTo - feeLiquidity -} - -scalar Bytes - -"8 bytes signed integer\n" -scalar Int8 - -type LiquidityPosition { - id: Bytes! - user: User! - pair: Pair! - liquidityTokenBalance: BigDecimal! -} - -type LiquidityPositionSnapshot { - id: Bytes! - liquidityPosition: LiquidityPosition! - timestamp: Int! - block: Int! - user: User! - pair: Pair! - token0PriceUSD: BigDecimal! - token1PriceUSD: BigDecimal! - reserve0: BigDecimal! - reserve1: BigDecimal! - reserveUSD: BigDecimal! - liquidityTokenTotalSupply: BigDecimal! - liquidityTokenBalance: BigDecimal! -} - -input LiquidityPositionSnapshot_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - liquidityPosition: String - liquidityPosition_not: String - liquidityPosition_gt: String - liquidityPosition_lt: String - liquidityPosition_gte: String - liquidityPosition_lte: String - liquidityPosition_in: [String!] - liquidityPosition_not_in: [String!] - liquidityPosition_contains: String - liquidityPosition_contains_nocase: String - liquidityPosition_not_contains: String - liquidityPosition_not_contains_nocase: String - liquidityPosition_starts_with: String - liquidityPosition_starts_with_nocase: String - liquidityPosition_not_starts_with: String - liquidityPosition_not_starts_with_nocase: String - liquidityPosition_ends_with: String - liquidityPosition_ends_with_nocase: String - liquidityPosition_not_ends_with: String - liquidityPosition_not_ends_with_nocase: String - liquidityPosition_: LiquidityPosition_filter - timestamp: Int - timestamp_not: Int - timestamp_gt: Int - timestamp_lt: Int - timestamp_gte: Int - timestamp_lte: Int - timestamp_in: [Int!] - timestamp_not_in: [Int!] - block: Int - block_not: Int - block_gt: Int - block_lt: Int - block_gte: Int - block_lte: Int - block_in: [Int!] - block_not_in: [Int!] - user: String - user_not: String - user_gt: String - user_lt: String - user_gte: String - user_lte: String - user_in: [String!] - user_not_in: [String!] - user_contains: String - user_contains_nocase: String - user_not_contains: String - user_not_contains_nocase: String - user_starts_with: String - user_starts_with_nocase: String - user_not_starts_with: String - user_not_starts_with_nocase: String - user_ends_with: String - user_ends_with_nocase: String - user_not_ends_with: String - user_not_ends_with_nocase: String - user_: User_filter - pair: String - pair_not: String - pair_gt: String - pair_lt: String - pair_gte: String - pair_lte: String - pair_in: [String!] - pair_not_in: [String!] - pair_contains: String - pair_contains_nocase: String - pair_not_contains: String - pair_not_contains_nocase: String - pair_starts_with: String - pair_starts_with_nocase: String - pair_not_starts_with: String - pair_not_starts_with_nocase: String - pair_ends_with: String - pair_ends_with_nocase: String - pair_not_ends_with: String - pair_not_ends_with_nocase: String - pair_: Pair_filter - token0PriceUSD: BigDecimal - token0PriceUSD_not: BigDecimal - token0PriceUSD_gt: BigDecimal - token0PriceUSD_lt: BigDecimal - token0PriceUSD_gte: BigDecimal - token0PriceUSD_lte: BigDecimal - token0PriceUSD_in: [BigDecimal!] - token0PriceUSD_not_in: [BigDecimal!] - token1PriceUSD: BigDecimal - token1PriceUSD_not: BigDecimal - token1PriceUSD_gt: BigDecimal - token1PriceUSD_lt: BigDecimal - token1PriceUSD_gte: BigDecimal - token1PriceUSD_lte: BigDecimal - token1PriceUSD_in: [BigDecimal!] - token1PriceUSD_not_in: [BigDecimal!] - reserve0: BigDecimal - reserve0_not: BigDecimal - reserve0_gt: BigDecimal - reserve0_lt: BigDecimal - reserve0_gte: BigDecimal - reserve0_lte: BigDecimal - reserve0_in: [BigDecimal!] - reserve0_not_in: [BigDecimal!] - reserve1: BigDecimal - reserve1_not: BigDecimal - reserve1_gt: BigDecimal - reserve1_lt: BigDecimal - reserve1_gte: BigDecimal - reserve1_lte: BigDecimal - reserve1_in: [BigDecimal!] - reserve1_not_in: [BigDecimal!] - reserveUSD: BigDecimal - reserveUSD_not: BigDecimal - reserveUSD_gt: BigDecimal - reserveUSD_lt: BigDecimal - reserveUSD_gte: BigDecimal - reserveUSD_lte: BigDecimal - reserveUSD_in: [BigDecimal!] - reserveUSD_not_in: [BigDecimal!] - liquidityTokenTotalSupply: BigDecimal - liquidityTokenTotalSupply_not: BigDecimal - liquidityTokenTotalSupply_gt: BigDecimal - liquidityTokenTotalSupply_lt: BigDecimal - liquidityTokenTotalSupply_gte: BigDecimal - liquidityTokenTotalSupply_lte: BigDecimal - liquidityTokenTotalSupply_in: [BigDecimal!] - liquidityTokenTotalSupply_not_in: [BigDecimal!] - liquidityTokenBalance: BigDecimal - liquidityTokenBalance_not: BigDecimal - liquidityTokenBalance_gt: BigDecimal - liquidityTokenBalance_lt: BigDecimal - liquidityTokenBalance_gte: BigDecimal - liquidityTokenBalance_lte: BigDecimal - liquidityTokenBalance_in: [BigDecimal!] - liquidityTokenBalance_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [LiquidityPositionSnapshot_filter] - or: [LiquidityPositionSnapshot_filter] -} - -enum LiquidityPositionSnapshot_orderBy { - id - liquidityPosition - liquidityPosition__id - liquidityPosition__liquidityTokenBalance - timestamp - block - user - user__id - user__usdSwapped - pair - pair__id - pair__reserve0 - pair__reserve1 - pair__totalSupply - pair__reserveETH - pair__reserveUSD - pair__trackedReserveETH - pair__token0Price - pair__token1Price - pair__volumeToken0 - pair__volumeToken1 - pair__volumeUSD - pair__untrackedVolumeUSD - pair__txCount - pair__createdAtTimestamp - pair__createdAtBlockNumber - pair__liquidityProviderCount - token0PriceUSD - token1PriceUSD - reserve0 - reserve1 - reserveUSD - liquidityTokenTotalSupply - liquidityTokenBalance -} - -input LiquidityPosition_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - user: String - user_not: String - user_gt: String - user_lt: String - user_gte: String - user_lte: String - user_in: [String!] - user_not_in: [String!] - user_contains: String - user_contains_nocase: String - user_not_contains: String - user_not_contains_nocase: String - user_starts_with: String - user_starts_with_nocase: String - user_not_starts_with: String - user_not_starts_with_nocase: String - user_ends_with: String - user_ends_with_nocase: String - user_not_ends_with: String - user_not_ends_with_nocase: String - user_: User_filter - pair: String - pair_not: String - pair_gt: String - pair_lt: String - pair_gte: String - pair_lte: String - pair_in: [String!] - pair_not_in: [String!] - pair_contains: String - pair_contains_nocase: String - pair_not_contains: String - pair_not_contains_nocase: String - pair_starts_with: String - pair_starts_with_nocase: String - pair_not_starts_with: String - pair_not_starts_with_nocase: String - pair_ends_with: String - pair_ends_with_nocase: String - pair_not_ends_with: String - pair_not_ends_with_nocase: String - pair_: Pair_filter - liquidityTokenBalance: BigDecimal - liquidityTokenBalance_not: BigDecimal - liquidityTokenBalance_gt: BigDecimal - liquidityTokenBalance_lt: BigDecimal - liquidityTokenBalance_gte: BigDecimal - liquidityTokenBalance_lte: BigDecimal - liquidityTokenBalance_in: [BigDecimal!] - liquidityTokenBalance_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [LiquidityPosition_filter] - or: [LiquidityPosition_filter] -} - -enum LiquidityPosition_orderBy { - id - user - user__id - user__usdSwapped - pair - pair__id - pair__reserve0 - pair__reserve1 - pair__totalSupply - pair__reserveETH - pair__reserveUSD - pair__trackedReserveETH - pair__token0Price - pair__token1Price - pair__volumeToken0 - pair__volumeToken1 - pair__volumeUSD - pair__untrackedVolumeUSD - pair__txCount - pair__createdAtTimestamp - pair__createdAtBlockNumber - pair__liquidityProviderCount - liquidityTokenBalance -} - -type Mint { - id: Bytes! - transaction: Transaction! - timestamp: BigInt! - pair: Pair! - to: Bytes! - liquidity: BigDecimal! - sender: Bytes - amount0: BigDecimal - amount1: BigDecimal - logIndex: BigInt - amountUSD: BigDecimal - feeTo: Bytes - feeLiquidity: BigDecimal -} - -input Mint_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - pair: String - pair_not: String - pair_gt: String - pair_lt: String - pair_gte: String - pair_lte: String - pair_in: [String!] - pair_not_in: [String!] - pair_contains: String - pair_contains_nocase: String - pair_not_contains: String - pair_not_contains_nocase: String - pair_starts_with: String - pair_starts_with_nocase: String - pair_not_starts_with: String - pair_not_starts_with_nocase: String - pair_ends_with: String - pair_ends_with_nocase: String - pair_not_ends_with: String - pair_not_ends_with_nocase: String - pair_: Pair_filter - to: Bytes - to_not: Bytes - to_gt: Bytes - to_lt: Bytes - to_gte: Bytes - to_lte: Bytes - to_in: [Bytes!] - to_not_in: [Bytes!] - to_contains: Bytes - to_not_contains: Bytes - liquidity: BigDecimal - liquidity_not: BigDecimal - liquidity_gt: BigDecimal - liquidity_lt: BigDecimal - liquidity_gte: BigDecimal - liquidity_lte: BigDecimal - liquidity_in: [BigDecimal!] - liquidity_not_in: [BigDecimal!] - sender: Bytes - sender_not: Bytes - sender_gt: Bytes - sender_lt: Bytes - sender_gte: Bytes - sender_lte: Bytes - sender_in: [Bytes!] - sender_not_in: [Bytes!] - sender_contains: Bytes - sender_not_contains: Bytes - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - feeTo: Bytes - feeTo_not: Bytes - feeTo_gt: Bytes - feeTo_lt: Bytes - feeTo_gte: Bytes - feeTo_lte: Bytes - feeTo_in: [Bytes!] - feeTo_not_in: [Bytes!] - feeTo_contains: Bytes - feeTo_not_contains: Bytes - feeLiquidity: BigDecimal - feeLiquidity_not: BigDecimal - feeLiquidity_gt: BigDecimal - feeLiquidity_lt: BigDecimal - feeLiquidity_gte: BigDecimal - feeLiquidity_lte: BigDecimal - feeLiquidity_in: [BigDecimal!] - feeLiquidity_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Mint_filter] - or: [Mint_filter] -} - -enum Mint_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - timestamp - pair - pair__id - pair__reserve0 - pair__reserve1 - pair__totalSupply - pair__reserveETH - pair__reserveUSD - pair__trackedReserveETH - pair__token0Price - pair__token1Price - pair__volumeToken0 - pair__volumeToken1 - pair__volumeUSD - pair__untrackedVolumeUSD - pair__txCount - pair__createdAtTimestamp - pair__createdAtBlockNumber - pair__liquidityProviderCount - to - liquidity - sender - amount0 - amount1 - logIndex - amountUSD - feeTo - feeLiquidity -} - -"""Defines the order direction, either ascending or descending""" -enum OrderDirection { - asc - desc -} - -type Pair { - id: Bytes! - token0: Token! - token1: Token! - reserve0: BigDecimal! - reserve1: BigDecimal! - totalSupply: BigDecimal! - reserveETH: BigDecimal! - reserveUSD: BigDecimal! - trackedReserveETH: BigDecimal! - token0Price: BigDecimal! - token1Price: BigDecimal! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - txCount: BigInt! - createdAtTimestamp: BigInt! - createdAtBlockNumber: BigInt! - liquidityProviderCount: BigInt! - pairHourData(skip: Int = 0, first: Int = 100, orderBy: PairHourData_orderBy, orderDirection: OrderDirection, where: PairHourData_filter): [PairHourData!]! - liquidityPositions(skip: Int = 0, first: Int = 100, orderBy: LiquidityPosition_orderBy, orderDirection: OrderDirection, where: LiquidityPosition_filter): [LiquidityPosition!]! - liquidityPositionSnapshots(skip: Int = 0, first: Int = 100, orderBy: LiquidityPositionSnapshot_orderBy, orderDirection: OrderDirection, where: LiquidityPositionSnapshot_filter): [LiquidityPositionSnapshot!]! - mints(skip: Int = 0, first: Int = 100, orderBy: Mint_orderBy, orderDirection: OrderDirection, where: Mint_filter): [Mint!]! - burns(skip: Int = 0, first: Int = 100, orderBy: Burn_orderBy, orderDirection: OrderDirection, where: Burn_filter): [Burn!]! - swaps(skip: Int = 0, first: Int = 100, orderBy: Swap_orderBy, orderDirection: OrderDirection, where: Swap_filter): [Swap!]! -} - -type PairDayData { - id: Bytes! - date: Int! - pairAddress: Bytes! - token0: Token! - token1: Token! - reserve0: BigDecimal! - reserve1: BigDecimal! - totalSupply: BigDecimal - reserveUSD: BigDecimal! - dailyVolumeToken0: BigDecimal! - dailyVolumeToken1: BigDecimal! - dailyVolumeUSD: BigDecimal! - dailyTxns: BigInt! -} - -input PairDayData_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - pairAddress: Bytes - pairAddress_not: Bytes - pairAddress_gt: Bytes - pairAddress_lt: Bytes - pairAddress_gte: Bytes - pairAddress_lte: Bytes - pairAddress_in: [Bytes!] - pairAddress_not_in: [Bytes!] - pairAddress_contains: Bytes - pairAddress_not_contains: Bytes - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - reserve0: BigDecimal - reserve0_not: BigDecimal - reserve0_gt: BigDecimal - reserve0_lt: BigDecimal - reserve0_gte: BigDecimal - reserve0_lte: BigDecimal - reserve0_in: [BigDecimal!] - reserve0_not_in: [BigDecimal!] - reserve1: BigDecimal - reserve1_not: BigDecimal - reserve1_gt: BigDecimal - reserve1_lt: BigDecimal - reserve1_gte: BigDecimal - reserve1_lte: BigDecimal - reserve1_in: [BigDecimal!] - reserve1_not_in: [BigDecimal!] - totalSupply: BigDecimal - totalSupply_not: BigDecimal - totalSupply_gt: BigDecimal - totalSupply_lt: BigDecimal - totalSupply_gte: BigDecimal - totalSupply_lte: BigDecimal - totalSupply_in: [BigDecimal!] - totalSupply_not_in: [BigDecimal!] - reserveUSD: BigDecimal - reserveUSD_not: BigDecimal - reserveUSD_gt: BigDecimal - reserveUSD_lt: BigDecimal - reserveUSD_gte: BigDecimal - reserveUSD_lte: BigDecimal - reserveUSD_in: [BigDecimal!] - reserveUSD_not_in: [BigDecimal!] - dailyVolumeToken0: BigDecimal - dailyVolumeToken0_not: BigDecimal - dailyVolumeToken0_gt: BigDecimal - dailyVolumeToken0_lt: BigDecimal - dailyVolumeToken0_gte: BigDecimal - dailyVolumeToken0_lte: BigDecimal - dailyVolumeToken0_in: [BigDecimal!] - dailyVolumeToken0_not_in: [BigDecimal!] - dailyVolumeToken1: BigDecimal - dailyVolumeToken1_not: BigDecimal - dailyVolumeToken1_gt: BigDecimal - dailyVolumeToken1_lt: BigDecimal - dailyVolumeToken1_gte: BigDecimal - dailyVolumeToken1_lte: BigDecimal - dailyVolumeToken1_in: [BigDecimal!] - dailyVolumeToken1_not_in: [BigDecimal!] - dailyVolumeUSD: BigDecimal - dailyVolumeUSD_not: BigDecimal - dailyVolumeUSD_gt: BigDecimal - dailyVolumeUSD_lt: BigDecimal - dailyVolumeUSD_gte: BigDecimal - dailyVolumeUSD_lte: BigDecimal - dailyVolumeUSD_in: [BigDecimal!] - dailyVolumeUSD_not_in: [BigDecimal!] - dailyTxns: BigInt - dailyTxns_not: BigInt - dailyTxns_gt: BigInt - dailyTxns_lt: BigInt - dailyTxns_gte: BigInt - dailyTxns_lte: BigInt - dailyTxns_in: [BigInt!] - dailyTxns_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PairDayData_filter] - or: [PairDayData_filter] -} - -enum PairDayData_orderBy { - id - date - pairAddress - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__tradeVolume - token0__tradeVolumeUSD - token0__untrackedVolumeUSD - token0__txCount - token0__totalLiquidity - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__tradeVolume - token1__tradeVolumeUSD - token1__untrackedVolumeUSD - token1__txCount - token1__totalLiquidity - token1__derivedETH - reserve0 - reserve1 - totalSupply - reserveUSD - dailyVolumeToken0 - dailyVolumeToken1 - dailyVolumeUSD - dailyTxns -} - -type PairHourData { - id: Bytes! - hourStartUnix: Int! - pair: Pair! - reserve0: BigDecimal! - reserve1: BigDecimal! - totalSupply: BigDecimal - reserveUSD: BigDecimal! - hourlyVolumeToken0: BigDecimal! - hourlyVolumeToken1: BigDecimal! - hourlyVolumeUSD: BigDecimal! - hourlyTxns: BigInt! -} - -input PairHourData_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - hourStartUnix: Int - hourStartUnix_not: Int - hourStartUnix_gt: Int - hourStartUnix_lt: Int - hourStartUnix_gte: Int - hourStartUnix_lte: Int - hourStartUnix_in: [Int!] - hourStartUnix_not_in: [Int!] - pair: String - pair_not: String - pair_gt: String - pair_lt: String - pair_gte: String - pair_lte: String - pair_in: [String!] - pair_not_in: [String!] - pair_contains: String - pair_contains_nocase: String - pair_not_contains: String - pair_not_contains_nocase: String - pair_starts_with: String - pair_starts_with_nocase: String - pair_not_starts_with: String - pair_not_starts_with_nocase: String - pair_ends_with: String - pair_ends_with_nocase: String - pair_not_ends_with: String - pair_not_ends_with_nocase: String - pair_: Pair_filter - reserve0: BigDecimal - reserve0_not: BigDecimal - reserve0_gt: BigDecimal - reserve0_lt: BigDecimal - reserve0_gte: BigDecimal - reserve0_lte: BigDecimal - reserve0_in: [BigDecimal!] - reserve0_not_in: [BigDecimal!] - reserve1: BigDecimal - reserve1_not: BigDecimal - reserve1_gt: BigDecimal - reserve1_lt: BigDecimal - reserve1_gte: BigDecimal - reserve1_lte: BigDecimal - reserve1_in: [BigDecimal!] - reserve1_not_in: [BigDecimal!] - totalSupply: BigDecimal - totalSupply_not: BigDecimal - totalSupply_gt: BigDecimal - totalSupply_lt: BigDecimal - totalSupply_gte: BigDecimal - totalSupply_lte: BigDecimal - totalSupply_in: [BigDecimal!] - totalSupply_not_in: [BigDecimal!] - reserveUSD: BigDecimal - reserveUSD_not: BigDecimal - reserveUSD_gt: BigDecimal - reserveUSD_lt: BigDecimal - reserveUSD_gte: BigDecimal - reserveUSD_lte: BigDecimal - reserveUSD_in: [BigDecimal!] - reserveUSD_not_in: [BigDecimal!] - hourlyVolumeToken0: BigDecimal - hourlyVolumeToken0_not: BigDecimal - hourlyVolumeToken0_gt: BigDecimal - hourlyVolumeToken0_lt: BigDecimal - hourlyVolumeToken0_gte: BigDecimal - hourlyVolumeToken0_lte: BigDecimal - hourlyVolumeToken0_in: [BigDecimal!] - hourlyVolumeToken0_not_in: [BigDecimal!] - hourlyVolumeToken1: BigDecimal - hourlyVolumeToken1_not: BigDecimal - hourlyVolumeToken1_gt: BigDecimal - hourlyVolumeToken1_lt: BigDecimal - hourlyVolumeToken1_gte: BigDecimal - hourlyVolumeToken1_lte: BigDecimal - hourlyVolumeToken1_in: [BigDecimal!] - hourlyVolumeToken1_not_in: [BigDecimal!] - hourlyVolumeUSD: BigDecimal - hourlyVolumeUSD_not: BigDecimal - hourlyVolumeUSD_gt: BigDecimal - hourlyVolumeUSD_lt: BigDecimal - hourlyVolumeUSD_gte: BigDecimal - hourlyVolumeUSD_lte: BigDecimal - hourlyVolumeUSD_in: [BigDecimal!] - hourlyVolumeUSD_not_in: [BigDecimal!] - hourlyTxns: BigInt - hourlyTxns_not: BigInt - hourlyTxns_gt: BigInt - hourlyTxns_lt: BigInt - hourlyTxns_gte: BigInt - hourlyTxns_lte: BigInt - hourlyTxns_in: [BigInt!] - hourlyTxns_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PairHourData_filter] - or: [PairHourData_filter] -} - -enum PairHourData_orderBy { - id - hourStartUnix - pair - pair__id - pair__reserve0 - pair__reserve1 - pair__totalSupply - pair__reserveETH - pair__reserveUSD - pair__trackedReserveETH - pair__token0Price - pair__token1Price - pair__volumeToken0 - pair__volumeToken1 - pair__volumeUSD - pair__untrackedVolumeUSD - pair__txCount - pair__createdAtTimestamp - pair__createdAtBlockNumber - pair__liquidityProviderCount - reserve0 - reserve1 - totalSupply - reserveUSD - hourlyVolumeToken0 - hourlyVolumeToken1 - hourlyVolumeUSD - hourlyTxns -} - -input Pair_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - reserve0: BigDecimal - reserve0_not: BigDecimal - reserve0_gt: BigDecimal - reserve0_lt: BigDecimal - reserve0_gte: BigDecimal - reserve0_lte: BigDecimal - reserve0_in: [BigDecimal!] - reserve0_not_in: [BigDecimal!] - reserve1: BigDecimal - reserve1_not: BigDecimal - reserve1_gt: BigDecimal - reserve1_lt: BigDecimal - reserve1_gte: BigDecimal - reserve1_lte: BigDecimal - reserve1_in: [BigDecimal!] - reserve1_not_in: [BigDecimal!] - totalSupply: BigDecimal - totalSupply_not: BigDecimal - totalSupply_gt: BigDecimal - totalSupply_lt: BigDecimal - totalSupply_gte: BigDecimal - totalSupply_lte: BigDecimal - totalSupply_in: [BigDecimal!] - totalSupply_not_in: [BigDecimal!] - reserveETH: BigDecimal - reserveETH_not: BigDecimal - reserveETH_gt: BigDecimal - reserveETH_lt: BigDecimal - reserveETH_gte: BigDecimal - reserveETH_lte: BigDecimal - reserveETH_in: [BigDecimal!] - reserveETH_not_in: [BigDecimal!] - reserveUSD: BigDecimal - reserveUSD_not: BigDecimal - reserveUSD_gt: BigDecimal - reserveUSD_lt: BigDecimal - reserveUSD_gte: BigDecimal - reserveUSD_lte: BigDecimal - reserveUSD_in: [BigDecimal!] - reserveUSD_not_in: [BigDecimal!] - trackedReserveETH: BigDecimal - trackedReserveETH_not: BigDecimal - trackedReserveETH_gt: BigDecimal - trackedReserveETH_lt: BigDecimal - trackedReserveETH_gte: BigDecimal - trackedReserveETH_lte: BigDecimal - trackedReserveETH_in: [BigDecimal!] - trackedReserveETH_not_in: [BigDecimal!] - token0Price: BigDecimal - token0Price_not: BigDecimal - token0Price_gt: BigDecimal - token0Price_lt: BigDecimal - token0Price_gte: BigDecimal - token0Price_lte: BigDecimal - token0Price_in: [BigDecimal!] - token0Price_not_in: [BigDecimal!] - token1Price: BigDecimal - token1Price_not: BigDecimal - token1Price_gt: BigDecimal - token1Price_lt: BigDecimal - token1Price_gte: BigDecimal - token1Price_lte: BigDecimal - token1Price_in: [BigDecimal!] - token1Price_not_in: [BigDecimal!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - createdAtTimestamp: BigInt - createdAtTimestamp_not: BigInt - createdAtTimestamp_gt: BigInt - createdAtTimestamp_lt: BigInt - createdAtTimestamp_gte: BigInt - createdAtTimestamp_lte: BigInt - createdAtTimestamp_in: [BigInt!] - createdAtTimestamp_not_in: [BigInt!] - createdAtBlockNumber: BigInt - createdAtBlockNumber_not: BigInt - createdAtBlockNumber_gt: BigInt - createdAtBlockNumber_lt: BigInt - createdAtBlockNumber_gte: BigInt - createdAtBlockNumber_lte: BigInt - createdAtBlockNumber_in: [BigInt!] - createdAtBlockNumber_not_in: [BigInt!] - liquidityProviderCount: BigInt - liquidityProviderCount_not: BigInt - liquidityProviderCount_gt: BigInt - liquidityProviderCount_lt: BigInt - liquidityProviderCount_gte: BigInt - liquidityProviderCount_lte: BigInt - liquidityProviderCount_in: [BigInt!] - liquidityProviderCount_not_in: [BigInt!] - pairHourData_: PairHourData_filter - liquidityPositions_: LiquidityPosition_filter - liquidityPositionSnapshots_: LiquidityPositionSnapshot_filter - mints_: Mint_filter - burns_: Burn_filter - swaps_: Swap_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Pair_filter] - or: [Pair_filter] -} - -enum Pair_orderBy { - id - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__tradeVolume - token0__tradeVolumeUSD - token0__untrackedVolumeUSD - token0__txCount - token0__totalLiquidity - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__tradeVolume - token1__tradeVolumeUSD - token1__untrackedVolumeUSD - token1__txCount - token1__totalLiquidity - token1__derivedETH - reserve0 - reserve1 - totalSupply - reserveETH - reserveUSD - trackedReserveETH - token0Price - token1Price - volumeToken0 - volumeToken1 - volumeUSD - untrackedVolumeUSD - txCount - createdAtTimestamp - createdAtBlockNumber - liquidityProviderCount - pairHourData - liquidityPositions - liquidityPositionSnapshots - mints - burns - swaps -} - -type Query { - uniswapFactory( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): UniswapFactory - uniswapFactories( - skip: Int = 0 - first: Int = 100 - orderBy: UniswapFactory_orderBy - orderDirection: OrderDirection - where: UniswapFactory_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [UniswapFactory!]! - token( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Token - tokens( - skip: Int = 0 - first: Int = 100 - orderBy: Token_orderBy - orderDirection: OrderDirection - where: Token_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Token!]! - pair( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pair - pairs( - skip: Int = 0 - first: Int = 100 - orderBy: Pair_orderBy - orderDirection: OrderDirection - where: Pair_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pair!]! - user( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): User - users( - skip: Int = 0 - first: Int = 100 - orderBy: User_orderBy - orderDirection: OrderDirection - where: User_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [User!]! - liquidityPosition( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): LiquidityPosition - liquidityPositions( - skip: Int = 0 - first: Int = 100 - orderBy: LiquidityPosition_orderBy - orderDirection: OrderDirection - where: LiquidityPosition_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [LiquidityPosition!]! - liquidityPositionSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): LiquidityPositionSnapshot - liquidityPositionSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: LiquidityPositionSnapshot_orderBy - orderDirection: OrderDirection - where: LiquidityPositionSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [LiquidityPositionSnapshot!]! - transaction( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Transaction - transactions( - skip: Int = 0 - first: Int = 100 - orderBy: Transaction_orderBy - orderDirection: OrderDirection - where: Transaction_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Transaction!]! - mint( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Mint - mints( - skip: Int = 0 - first: Int = 100 - orderBy: Mint_orderBy - orderDirection: OrderDirection - where: Mint_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Mint!]! - burn( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Burn - burns( - skip: Int = 0 - first: Int = 100 - orderBy: Burn_orderBy - orderDirection: OrderDirection - where: Burn_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Burn!]! - swap( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Swap - swaps( - skip: Int = 0 - first: Int = 100 - orderBy: Swap_orderBy - orderDirection: OrderDirection - where: Swap_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Swap!]! - bundle( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Bundle - bundles( - skip: Int = 0 - first: Int = 100 - orderBy: Bundle_orderBy - orderDirection: OrderDirection - where: Bundle_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Bundle!]! - uniswapDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): UniswapDayData - uniswapDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: UniswapDayData_orderBy - orderDirection: OrderDirection - where: UniswapDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [UniswapDayData!]! - pairHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PairHourData - pairHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PairHourData_orderBy - orderDirection: OrderDirection - where: PairHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PairHourData!]! - pairDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PairDayData - pairDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PairDayData_orderBy - orderDirection: OrderDirection - where: PairDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PairDayData!]! - tokenDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TokenDayData - tokenDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TokenDayData_orderBy - orderDirection: OrderDirection - where: TokenDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TokenDayData!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type Subscription { - uniswapFactory( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): UniswapFactory - uniswapFactories( - skip: Int = 0 - first: Int = 100 - orderBy: UniswapFactory_orderBy - orderDirection: OrderDirection - where: UniswapFactory_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [UniswapFactory!]! - token( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Token - tokens( - skip: Int = 0 - first: Int = 100 - orderBy: Token_orderBy - orderDirection: OrderDirection - where: Token_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Token!]! - pair( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pair - pairs( - skip: Int = 0 - first: Int = 100 - orderBy: Pair_orderBy - orderDirection: OrderDirection - where: Pair_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pair!]! - user( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): User - users( - skip: Int = 0 - first: Int = 100 - orderBy: User_orderBy - orderDirection: OrderDirection - where: User_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [User!]! - liquidityPosition( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): LiquidityPosition - liquidityPositions( - skip: Int = 0 - first: Int = 100 - orderBy: LiquidityPosition_orderBy - orderDirection: OrderDirection - where: LiquidityPosition_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [LiquidityPosition!]! - liquidityPositionSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): LiquidityPositionSnapshot - liquidityPositionSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: LiquidityPositionSnapshot_orderBy - orderDirection: OrderDirection - where: LiquidityPositionSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [LiquidityPositionSnapshot!]! - transaction( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Transaction - transactions( - skip: Int = 0 - first: Int = 100 - orderBy: Transaction_orderBy - orderDirection: OrderDirection - where: Transaction_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Transaction!]! - mint( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Mint - mints( - skip: Int = 0 - first: Int = 100 - orderBy: Mint_orderBy - orderDirection: OrderDirection - where: Mint_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Mint!]! - burn( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Burn - burns( - skip: Int = 0 - first: Int = 100 - orderBy: Burn_orderBy - orderDirection: OrderDirection - where: Burn_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Burn!]! - swap( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Swap - swaps( - skip: Int = 0 - first: Int = 100 - orderBy: Swap_orderBy - orderDirection: OrderDirection - where: Swap_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Swap!]! - bundle( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Bundle - bundles( - skip: Int = 0 - first: Int = 100 - orderBy: Bundle_orderBy - orderDirection: OrderDirection - where: Bundle_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Bundle!]! - uniswapDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): UniswapDayData - uniswapDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: UniswapDayData_orderBy - orderDirection: OrderDirection - where: UniswapDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [UniswapDayData!]! - pairHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PairHourData - pairHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PairHourData_orderBy - orderDirection: OrderDirection - where: PairHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PairHourData!]! - pairDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PairDayData - pairDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PairDayData_orderBy - orderDirection: OrderDirection - where: PairDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PairDayData!]! - tokenDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TokenDayData - tokenDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TokenDayData_orderBy - orderDirection: OrderDirection - where: TokenDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TokenDayData!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type Swap { - id: Bytes! - transaction: Transaction! - timestamp: BigInt! - pair: Pair! - sender: Bytes! - from: Bytes! - amount0In: BigDecimal! - amount1In: BigDecimal! - amount0Out: BigDecimal! - amount1Out: BigDecimal! - to: Bytes! - logIndex: BigInt - amountUSD: BigDecimal! -} - -input Swap_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - pair: String - pair_not: String - pair_gt: String - pair_lt: String - pair_gte: String - pair_lte: String - pair_in: [String!] - pair_not_in: [String!] - pair_contains: String - pair_contains_nocase: String - pair_not_contains: String - pair_not_contains_nocase: String - pair_starts_with: String - pair_starts_with_nocase: String - pair_not_starts_with: String - pair_not_starts_with_nocase: String - pair_ends_with: String - pair_ends_with_nocase: String - pair_not_ends_with: String - pair_not_ends_with_nocase: String - pair_: Pair_filter - sender: Bytes - sender_not: Bytes - sender_gt: Bytes - sender_lt: Bytes - sender_gte: Bytes - sender_lte: Bytes - sender_in: [Bytes!] - sender_not_in: [Bytes!] - sender_contains: Bytes - sender_not_contains: Bytes - from: Bytes - from_not: Bytes - from_gt: Bytes - from_lt: Bytes - from_gte: Bytes - from_lte: Bytes - from_in: [Bytes!] - from_not_in: [Bytes!] - from_contains: Bytes - from_not_contains: Bytes - amount0In: BigDecimal - amount0In_not: BigDecimal - amount0In_gt: BigDecimal - amount0In_lt: BigDecimal - amount0In_gte: BigDecimal - amount0In_lte: BigDecimal - amount0In_in: [BigDecimal!] - amount0In_not_in: [BigDecimal!] - amount1In: BigDecimal - amount1In_not: BigDecimal - amount1In_gt: BigDecimal - amount1In_lt: BigDecimal - amount1In_gte: BigDecimal - amount1In_lte: BigDecimal - amount1In_in: [BigDecimal!] - amount1In_not_in: [BigDecimal!] - amount0Out: BigDecimal - amount0Out_not: BigDecimal - amount0Out_gt: BigDecimal - amount0Out_lt: BigDecimal - amount0Out_gte: BigDecimal - amount0Out_lte: BigDecimal - amount0Out_in: [BigDecimal!] - amount0Out_not_in: [BigDecimal!] - amount1Out: BigDecimal - amount1Out_not: BigDecimal - amount1Out_gt: BigDecimal - amount1Out_lt: BigDecimal - amount1Out_gte: BigDecimal - amount1Out_lte: BigDecimal - amount1Out_in: [BigDecimal!] - amount1Out_not_in: [BigDecimal!] - to: Bytes - to_not: Bytes - to_gt: Bytes - to_lt: Bytes - to_gte: Bytes - to_lte: Bytes - to_in: [Bytes!] - to_not_in: [Bytes!] - to_contains: Bytes - to_not_contains: Bytes - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Swap_filter] - or: [Swap_filter] -} - -enum Swap_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - timestamp - pair - pair__id - pair__reserve0 - pair__reserve1 - pair__totalSupply - pair__reserveETH - pair__reserveUSD - pair__trackedReserveETH - pair__token0Price - pair__token1Price - pair__volumeToken0 - pair__volumeToken1 - pair__volumeUSD - pair__untrackedVolumeUSD - pair__txCount - pair__createdAtTimestamp - pair__createdAtBlockNumber - pair__liquidityProviderCount - sender - from - amount0In - amount1In - amount0Out - amount1Out - to - logIndex - amountUSD -} - -"A string representation of microseconds UNIX timestamp (16 digits)\n" -scalar Timestamp - -type Token { - id: Bytes! - symbol: String! - name: String! - decimals: BigInt! - totalSupply: BigInt! - tradeVolume: BigDecimal! - tradeVolumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - txCount: BigInt! - totalLiquidity: BigDecimal! - derivedETH: BigDecimal! - tokenDayData(skip: Int = 0, first: Int = 100, orderBy: TokenDayData_orderBy, orderDirection: OrderDirection, where: TokenDayData_filter): [TokenDayData!]! - pairDayDataBase(skip: Int = 0, first: Int = 100, orderBy: PairDayData_orderBy, orderDirection: OrderDirection, where: PairDayData_filter): [PairDayData!]! - pairDayDataQuote(skip: Int = 0, first: Int = 100, orderBy: PairDayData_orderBy, orderDirection: OrderDirection, where: PairDayData_filter): [PairDayData!]! - pairBase(skip: Int = 0, first: Int = 100, orderBy: Pair_orderBy, orderDirection: OrderDirection, where: Pair_filter): [Pair!]! - pairQuote(skip: Int = 0, first: Int = 100, orderBy: Pair_orderBy, orderDirection: OrderDirection, where: Pair_filter): [Pair!]! -} - -type TokenDayData { - id: Bytes! - date: Int! - token: Token! - dailyVolumeToken: BigDecimal! - dailyVolumeETH: BigDecimal! - dailyVolumeUSD: BigDecimal! - dailyTxns: BigInt! - totalLiquidityToken: BigDecimal! - totalLiquidityETH: BigDecimal! - totalLiquidityUSD: BigDecimal! - priceUSD: BigDecimal! -} - -input TokenDayData_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - token: String - token_not: String - token_gt: String - token_lt: String - token_gte: String - token_lte: String - token_in: [String!] - token_not_in: [String!] - token_contains: String - token_contains_nocase: String - token_not_contains: String - token_not_contains_nocase: String - token_starts_with: String - token_starts_with_nocase: String - token_not_starts_with: String - token_not_starts_with_nocase: String - token_ends_with: String - token_ends_with_nocase: String - token_not_ends_with: String - token_not_ends_with_nocase: String - token_: Token_filter - dailyVolumeToken: BigDecimal - dailyVolumeToken_not: BigDecimal - dailyVolumeToken_gt: BigDecimal - dailyVolumeToken_lt: BigDecimal - dailyVolumeToken_gte: BigDecimal - dailyVolumeToken_lte: BigDecimal - dailyVolumeToken_in: [BigDecimal!] - dailyVolumeToken_not_in: [BigDecimal!] - dailyVolumeETH: BigDecimal - dailyVolumeETH_not: BigDecimal - dailyVolumeETH_gt: BigDecimal - dailyVolumeETH_lt: BigDecimal - dailyVolumeETH_gte: BigDecimal - dailyVolumeETH_lte: BigDecimal - dailyVolumeETH_in: [BigDecimal!] - dailyVolumeETH_not_in: [BigDecimal!] - dailyVolumeUSD: BigDecimal - dailyVolumeUSD_not: BigDecimal - dailyVolumeUSD_gt: BigDecimal - dailyVolumeUSD_lt: BigDecimal - dailyVolumeUSD_gte: BigDecimal - dailyVolumeUSD_lte: BigDecimal - dailyVolumeUSD_in: [BigDecimal!] - dailyVolumeUSD_not_in: [BigDecimal!] - dailyTxns: BigInt - dailyTxns_not: BigInt - dailyTxns_gt: BigInt - dailyTxns_lt: BigInt - dailyTxns_gte: BigInt - dailyTxns_lte: BigInt - dailyTxns_in: [BigInt!] - dailyTxns_not_in: [BigInt!] - totalLiquidityToken: BigDecimal - totalLiquidityToken_not: BigDecimal - totalLiquidityToken_gt: BigDecimal - totalLiquidityToken_lt: BigDecimal - totalLiquidityToken_gte: BigDecimal - totalLiquidityToken_lte: BigDecimal - totalLiquidityToken_in: [BigDecimal!] - totalLiquidityToken_not_in: [BigDecimal!] - totalLiquidityETH: BigDecimal - totalLiquidityETH_not: BigDecimal - totalLiquidityETH_gt: BigDecimal - totalLiquidityETH_lt: BigDecimal - totalLiquidityETH_gte: BigDecimal - totalLiquidityETH_lte: BigDecimal - totalLiquidityETH_in: [BigDecimal!] - totalLiquidityETH_not_in: [BigDecimal!] - totalLiquidityUSD: BigDecimal - totalLiquidityUSD_not: BigDecimal - totalLiquidityUSD_gt: BigDecimal - totalLiquidityUSD_lt: BigDecimal - totalLiquidityUSD_gte: BigDecimal - totalLiquidityUSD_lte: BigDecimal - totalLiquidityUSD_in: [BigDecimal!] - totalLiquidityUSD_not_in: [BigDecimal!] - priceUSD: BigDecimal - priceUSD_not: BigDecimal - priceUSD_gt: BigDecimal - priceUSD_lt: BigDecimal - priceUSD_gte: BigDecimal - priceUSD_lte: BigDecimal - priceUSD_in: [BigDecimal!] - priceUSD_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [TokenDayData_filter] - or: [TokenDayData_filter] -} - -enum TokenDayData_orderBy { - id - date - token - token__id - token__symbol - token__name - token__decimals - token__totalSupply - token__tradeVolume - token__tradeVolumeUSD - token__untrackedVolumeUSD - token__txCount - token__totalLiquidity - token__derivedETH - dailyVolumeToken - dailyVolumeETH - dailyVolumeUSD - dailyTxns - totalLiquidityToken - totalLiquidityETH - totalLiquidityUSD - priceUSD -} - -input Token_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - symbol: String - symbol_not: String - symbol_gt: String - symbol_lt: String - symbol_gte: String - symbol_lte: String - symbol_in: [String!] - symbol_not_in: [String!] - symbol_contains: String - symbol_contains_nocase: String - symbol_not_contains: String - symbol_not_contains_nocase: String - symbol_starts_with: String - symbol_starts_with_nocase: String - symbol_not_starts_with: String - symbol_not_starts_with_nocase: String - symbol_ends_with: String - symbol_ends_with_nocase: String - symbol_not_ends_with: String - symbol_not_ends_with_nocase: String - name: String - name_not: String - name_gt: String - name_lt: String - name_gte: String - name_lte: String - name_in: [String!] - name_not_in: [String!] - name_contains: String - name_contains_nocase: String - name_not_contains: String - name_not_contains_nocase: String - name_starts_with: String - name_starts_with_nocase: String - name_not_starts_with: String - name_not_starts_with_nocase: String - name_ends_with: String - name_ends_with_nocase: String - name_not_ends_with: String - name_not_ends_with_nocase: String - decimals: BigInt - decimals_not: BigInt - decimals_gt: BigInt - decimals_lt: BigInt - decimals_gte: BigInt - decimals_lte: BigInt - decimals_in: [BigInt!] - decimals_not_in: [BigInt!] - totalSupply: BigInt - totalSupply_not: BigInt - totalSupply_gt: BigInt - totalSupply_lt: BigInt - totalSupply_gte: BigInt - totalSupply_lte: BigInt - totalSupply_in: [BigInt!] - totalSupply_not_in: [BigInt!] - tradeVolume: BigDecimal - tradeVolume_not: BigDecimal - tradeVolume_gt: BigDecimal - tradeVolume_lt: BigDecimal - tradeVolume_gte: BigDecimal - tradeVolume_lte: BigDecimal - tradeVolume_in: [BigDecimal!] - tradeVolume_not_in: [BigDecimal!] - tradeVolumeUSD: BigDecimal - tradeVolumeUSD_not: BigDecimal - tradeVolumeUSD_gt: BigDecimal - tradeVolumeUSD_lt: BigDecimal - tradeVolumeUSD_gte: BigDecimal - tradeVolumeUSD_lte: BigDecimal - tradeVolumeUSD_in: [BigDecimal!] - tradeVolumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - totalLiquidity: BigDecimal - totalLiquidity_not: BigDecimal - totalLiquidity_gt: BigDecimal - totalLiquidity_lt: BigDecimal - totalLiquidity_gte: BigDecimal - totalLiquidity_lte: BigDecimal - totalLiquidity_in: [BigDecimal!] - totalLiquidity_not_in: [BigDecimal!] - derivedETH: BigDecimal - derivedETH_not: BigDecimal - derivedETH_gt: BigDecimal - derivedETH_lt: BigDecimal - derivedETH_gte: BigDecimal - derivedETH_lte: BigDecimal - derivedETH_in: [BigDecimal!] - derivedETH_not_in: [BigDecimal!] - tokenDayData_: TokenDayData_filter - pairDayDataBase_: PairDayData_filter - pairDayDataQuote_: PairDayData_filter - pairBase_: Pair_filter - pairQuote_: Pair_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Token_filter] - or: [Token_filter] -} - -enum Token_orderBy { - id - symbol - name - decimals - totalSupply - tradeVolume - tradeVolumeUSD - untrackedVolumeUSD - txCount - totalLiquidity - derivedETH - tokenDayData - pairDayDataBase - pairDayDataQuote - pairBase - pairQuote -} - -type Transaction { - id: Bytes! - blockNumber: BigInt! - timestamp: BigInt! - mints(skip: Int = 0, first: Int = 100, orderBy: Mint_orderBy, orderDirection: OrderDirection, where: Mint_filter): [Mint!]! - burns(skip: Int = 0, first: Int = 100, orderBy: Burn_orderBy, orderDirection: OrderDirection, where: Burn_filter): [Burn!]! - swaps(skip: Int = 0, first: Int = 100, orderBy: Swap_orderBy, orderDirection: OrderDirection, where: Swap_filter): [Swap!]! -} - -input Transaction_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - blockNumber: BigInt - blockNumber_not: BigInt - blockNumber_gt: BigInt - blockNumber_lt: BigInt - blockNumber_gte: BigInt - blockNumber_lte: BigInt - blockNumber_in: [BigInt!] - blockNumber_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - mints: [String!] - mints_not: [String!] - mints_contains: [String!] - mints_contains_nocase: [String!] - mints_not_contains: [String!] - mints_not_contains_nocase: [String!] - mints_: Mint_filter - burns: [String!] - burns_not: [String!] - burns_contains: [String!] - burns_contains_nocase: [String!] - burns_not_contains: [String!] - burns_not_contains_nocase: [String!] - burns_: Burn_filter - swaps: [String!] - swaps_not: [String!] - swaps_contains: [String!] - swaps_contains_nocase: [String!] - swaps_not_contains: [String!] - swaps_not_contains_nocase: [String!] - swaps_: Swap_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Transaction_filter] - or: [Transaction_filter] -} - -enum Transaction_orderBy { - id - blockNumber - timestamp - mints - burns - swaps -} - -type UniswapDayData { - id: Bytes! - date: Int! - dailyVolumeETH: BigDecimal! - dailyVolumeUSD: BigDecimal! - dailyVolumeUntracked: BigDecimal! - totalVolumeETH: BigDecimal! - totalLiquidityETH: BigDecimal! - totalVolumeUSD: BigDecimal! - totalLiquidityUSD: BigDecimal! - txCount: BigInt! -} - -input UniswapDayData_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - dailyVolumeETH: BigDecimal - dailyVolumeETH_not: BigDecimal - dailyVolumeETH_gt: BigDecimal - dailyVolumeETH_lt: BigDecimal - dailyVolumeETH_gte: BigDecimal - dailyVolumeETH_lte: BigDecimal - dailyVolumeETH_in: [BigDecimal!] - dailyVolumeETH_not_in: [BigDecimal!] - dailyVolumeUSD: BigDecimal - dailyVolumeUSD_not: BigDecimal - dailyVolumeUSD_gt: BigDecimal - dailyVolumeUSD_lt: BigDecimal - dailyVolumeUSD_gte: BigDecimal - dailyVolumeUSD_lte: BigDecimal - dailyVolumeUSD_in: [BigDecimal!] - dailyVolumeUSD_not_in: [BigDecimal!] - dailyVolumeUntracked: BigDecimal - dailyVolumeUntracked_not: BigDecimal - dailyVolumeUntracked_gt: BigDecimal - dailyVolumeUntracked_lt: BigDecimal - dailyVolumeUntracked_gte: BigDecimal - dailyVolumeUntracked_lte: BigDecimal - dailyVolumeUntracked_in: [BigDecimal!] - dailyVolumeUntracked_not_in: [BigDecimal!] - totalVolumeETH: BigDecimal - totalVolumeETH_not: BigDecimal - totalVolumeETH_gt: BigDecimal - totalVolumeETH_lt: BigDecimal - totalVolumeETH_gte: BigDecimal - totalVolumeETH_lte: BigDecimal - totalVolumeETH_in: [BigDecimal!] - totalVolumeETH_not_in: [BigDecimal!] - totalLiquidityETH: BigDecimal - totalLiquidityETH_not: BigDecimal - totalLiquidityETH_gt: BigDecimal - totalLiquidityETH_lt: BigDecimal - totalLiquidityETH_gte: BigDecimal - totalLiquidityETH_lte: BigDecimal - totalLiquidityETH_in: [BigDecimal!] - totalLiquidityETH_not_in: [BigDecimal!] - totalVolumeUSD: BigDecimal - totalVolumeUSD_not: BigDecimal - totalVolumeUSD_gt: BigDecimal - totalVolumeUSD_lt: BigDecimal - totalVolumeUSD_gte: BigDecimal - totalVolumeUSD_lte: BigDecimal - totalVolumeUSD_in: [BigDecimal!] - totalVolumeUSD_not_in: [BigDecimal!] - totalLiquidityUSD: BigDecimal - totalLiquidityUSD_not: BigDecimal - totalLiquidityUSD_gt: BigDecimal - totalLiquidityUSD_lt: BigDecimal - totalLiquidityUSD_gte: BigDecimal - totalLiquidityUSD_lte: BigDecimal - totalLiquidityUSD_in: [BigDecimal!] - totalLiquidityUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [UniswapDayData_filter] - or: [UniswapDayData_filter] -} - -enum UniswapDayData_orderBy { - id - date - dailyVolumeETH - dailyVolumeUSD - dailyVolumeUntracked - totalVolumeETH - totalLiquidityETH - totalVolumeUSD - totalLiquidityUSD - txCount -} - -type UniswapFactory { - id: Bytes! - pairCount: Int! - totalVolumeUSD: BigDecimal! - totalVolumeETH: BigDecimal! - untrackedVolumeUSD: BigDecimal! - totalLiquidityUSD: BigDecimal! - totalLiquidityETH: BigDecimal! - txCount: BigInt! -} - -input UniswapFactory_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - pairCount: Int - pairCount_not: Int - pairCount_gt: Int - pairCount_lt: Int - pairCount_gte: Int - pairCount_lte: Int - pairCount_in: [Int!] - pairCount_not_in: [Int!] - totalVolumeUSD: BigDecimal - totalVolumeUSD_not: BigDecimal - totalVolumeUSD_gt: BigDecimal - totalVolumeUSD_lt: BigDecimal - totalVolumeUSD_gte: BigDecimal - totalVolumeUSD_lte: BigDecimal - totalVolumeUSD_in: [BigDecimal!] - totalVolumeUSD_not_in: [BigDecimal!] - totalVolumeETH: BigDecimal - totalVolumeETH_not: BigDecimal - totalVolumeETH_gt: BigDecimal - totalVolumeETH_lt: BigDecimal - totalVolumeETH_gte: BigDecimal - totalVolumeETH_lte: BigDecimal - totalVolumeETH_in: [BigDecimal!] - totalVolumeETH_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - totalLiquidityUSD: BigDecimal - totalLiquidityUSD_not: BigDecimal - totalLiquidityUSD_gt: BigDecimal - totalLiquidityUSD_lt: BigDecimal - totalLiquidityUSD_gte: BigDecimal - totalLiquidityUSD_lte: BigDecimal - totalLiquidityUSD_in: [BigDecimal!] - totalLiquidityUSD_not_in: [BigDecimal!] - totalLiquidityETH: BigDecimal - totalLiquidityETH_not: BigDecimal - totalLiquidityETH_gt: BigDecimal - totalLiquidityETH_lt: BigDecimal - totalLiquidityETH_gte: BigDecimal - totalLiquidityETH_lte: BigDecimal - totalLiquidityETH_in: [BigDecimal!] - totalLiquidityETH_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [UniswapFactory_filter] - or: [UniswapFactory_filter] -} - -enum UniswapFactory_orderBy { - id - pairCount - totalVolumeUSD - totalVolumeETH - untrackedVolumeUSD - totalLiquidityUSD - totalLiquidityETH - txCount -} - -type User { - id: Bytes! - liquidityPositions(skip: Int = 0, first: Int = 100, orderBy: LiquidityPosition_orderBy, orderDirection: OrderDirection, where: LiquidityPosition_filter): [LiquidityPosition!] - usdSwapped: BigDecimal! -} - -input User_filter { - id: Bytes - id_not: Bytes - id_gt: Bytes - id_lt: Bytes - id_gte: Bytes - id_lte: Bytes - id_in: [Bytes!] - id_not_in: [Bytes!] - id_contains: Bytes - id_not_contains: Bytes - liquidityPositions_: LiquidityPosition_filter - usdSwapped: BigDecimal - usdSwapped_not: BigDecimal - usdSwapped_gt: BigDecimal - usdSwapped_lt: BigDecimal - usdSwapped_gte: BigDecimal - usdSwapped_lte: BigDecimal - usdSwapped_in: [BigDecimal!] - usdSwapped_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [User_filter] - or: [User_filter] -} - -enum User_orderBy { - id - liquidityPositions - usdSwapped -} - -type _Block_ { - """The hash of the block""" - hash: Bytes - - """The block number""" - number: Int! - - """Integer representation of the timestamp stored in blocks for the chain""" - timestamp: Int - - """The hash of the parent block""" - parentHash: Bytes -} - -"""The type for the top-level _meta field""" -type _Meta_ { - "Information about a specific subgraph block. The hash of the block\nwill be null if the _meta field has a block constraint that asks for\na block number. It will be filled if the _meta field has no block constraint\nand therefore asks for the latest block\n" - block: _Block_! - - """The deployment ID""" - deployment: String! - - """If `true`, the subgraph encountered indexing errors at some past block""" - hasIndexingErrors: Boolean! -} - -enum _SubgraphErrorPolicy_ { - """Data will be returned even if the subgraph has indexing errors""" - allow - - """ - If the subgraph has indexing errors, data will be omitted. The default. - """ - deny -} \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/sushi-v2/transforms/bucket-v2-to-std.ts b/packages/graph-client/src/subgraphs/sushi-v2/transforms/bucket-v2-to-std.ts deleted file mode 100644 index 9da42677a1..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/transforms/bucket-v2-to-std.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { ResultOf } from 'gql.tada' -import type { SushiV2PoolBucketsQuery } from 'src/subgraphs/sushi-v2/queries/pool-with-buckets' -import type { PoolBucket } from 'sushi/types' - -type FetchedBucket = NonNullable< - ResultOf['pair'] ->['poolHourData'][number] - -export function transformBucketsV2ToStd( - buckets: FetchedBucket[], -): PoolBucket[] { - return buckets.map(transformBucketV2ToStd) -} - -export function transformBucketV2ToStd(bucket: FetchedBucket): PoolBucket { - return { - id: bucket.id, - date: Number(bucket.date), - liquidityUSD: Number(bucket.liquidityUSD), - volumeUSD: Number(bucket.volumeUSD), - feesUSD: Number(bucket.volumeUSD) * 0.003, - txCount: Number(bucket.txCount), - } -} diff --git a/packages/graph-client/src/subgraphs/sushi-v2/transforms/pool-v2-to-base.ts b/packages/graph-client/src/subgraphs/sushi-v2/transforms/pool-v2-to-base.ts deleted file mode 100644 index c7ac8aa876..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v2/transforms/pool-v2-to-base.ts +++ /dev/null @@ -1,83 +0,0 @@ -import type { ResultOf } from 'gql.tada' -import type { PoolFieldsFragment } from 'src/subgraphs/sushi-v2/fragments/pool-fields' -import type { SushiSwapV2ChainId } from 'sushi/config' -import { - getIdFromChainIdAddress, - withoutScientificNotation, -} from 'sushi/format' -import { type PoolBase, type PoolV2, SushiSwapProtocol } from 'sushi/types' - -type ToPick = - | 'id' - | 'token0' - | 'token1' - | 'reserve0' - | 'reserve1' - | 'totalSupply' - | 'liquidityUSD' - | 'volumeUSD' - | 'txCount' - | 'token0Price' - | 'token1Price' - -type RequiredBase = Pick, ToPick> - -export function transformPoolV2ToBase( - pool: T, - chainId: SushiSwapV2ChainId, -): PoolV2 { - return { - id: getIdFromChainIdAddress(chainId, pool.id), - address: pool.id, - chainId, - name: `${pool.token0.symbol}-${pool.token1.symbol}`, - - swapFee: 0.003, - - protocol: SushiSwapProtocol.SUSHISWAP_V2, - - // reserve0: BigInt(pool.reserve0), - // reserve1: BigInt(pool.reserve1), - - reserve0: BigInt( - withoutScientificNotation( - (Number(pool.reserve0) * 10 ** Number(pool.token0.decimals)).toFixed(), - )!, - ), - reserve1: BigInt( - withoutScientificNotation( - (Number(pool.reserve1) * 10 ** Number(pool.token1.decimals)).toFixed(), - )!, - ), - - liquidity: BigInt( - withoutScientificNotation( - (Number(pool.totalSupply) * 10 ** 18).toFixed(), - )!, - ), - liquidityUSD: Number(pool.liquidityUSD), - - volumeUSD: Number(pool.volumeUSD), - feesUSD: Number(pool.volumeUSD) * 0.003, - - token0: { - id: getIdFromChainIdAddress(chainId, pool.token0.id), - address: pool.token0.id, - chainId, - decimals: Number(pool.token0.decimals), - name: pool.token0.name, - symbol: pool.token0.symbol, - }, - token1: { - id: getIdFromChainIdAddress(chainId, pool.token1.id), - address: pool.token1.id, - chainId, - decimals: Number(pool.token1.decimals), - name: pool.token1.name, - symbol: pool.token1.symbol, - }, - token0Price: Number(pool.token0Price), - token1Price: Number(pool.token1Price), - txCount: Number(pool.txCount), - } -} diff --git a/packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts b/packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts deleted file mode 100644 index 5cd943dbbd..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { graphql } from '../graphql' - -export const PoolFieldsFragment = graphql(` - fragment PoolFields on Pool @_unmask { - id - token0 { - id - symbol - name - decimals - } - token1 { - id - symbol - name - decimals - } - - swapFee: feeTier - - liquidity - sqrtPrice - feeGrowthGlobal0X128 - feeGrowthGlobal1X128 - token0Price - token1Price - tick - observationIndex - - volumeToken0 - volumeToken1 - volumeUSD - untrackedVolumeUSD - - feesUSD - collectedFeesToken0 - collectedFeesToken1 - collectedFeesUSD - - reserve0: totalValueLockedToken0 - reserve1: totalValueLockedToken1 - liquidityUSD: totalValueLockedUSD - untrackedLiquidityUSD: totalValueLockedUSDUntracked - - liquidityProviderCount - txCount - - createdAtTimestamp - createdAtBlockNumber - } -`) diff --git a/packages/graph-client/src/subgraphs/sushi-v3/graphql.ts b/packages/graph-client/src/subgraphs/sushi-v3/graphql.ts deleted file mode 100644 index 09d313d696..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/graphql.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { initGraphQLTada } from 'gql.tada' -import type { Scalars } from 'src/lib/types/scalars.js' -import type { introspection } from './sushi-v3-env.js' - -export const graphql = initGraphQLTada<{ - introspection: introspection - scalars: Scalars -}>() diff --git a/packages/graph-client/src/subgraphs/sushi-v3/index.ts b/packages/graph-client/src/subgraphs/sushi-v3/index.ts deleted file mode 100644 index 01ca79084e..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './queries/burns' -export * from './queries/collects' -export * from './queries/day-datas' -export * from './queries/factory' -export * from './queries/mints' -export * from './queries/pool-with-buckets' -export * from './queries/pool' -export * from './queries/pools' -export * from './queries/pools-by-token-pair' -export * from './queries/swaps' -export * from './queries/transactions' diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/burns.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/burns.ts deleted file mode 100644 index 65be7966bb..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/burns.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV3BurnsQuery = graphql(` - query Burns($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Burn_orderBy, $orderDirection: OrderDirection, $where: Burn_filter) { - burns(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - owner - origin - amount - amount0 - amount1 - amountUSD - logIndex - transaction { - id - timestamp - blockNumber - } - } - } -`) - -export type GetSushiV3Burns = VariablesOf & - ChainIdVariable - -export async function getSushiV3Burns( - { chainId, ...variables }: GetSushiV3Burns, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV3BurnsQuery, - variables, - options, - }) - - return result.burns -} - -export type SushiV3Burns = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/collects.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/collects.ts deleted file mode 100644 index b578d88731..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/collects.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV3CollectsQuery = graphql(` - query Collects($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Collect_orderBy, $orderDirection: OrderDirection, $where: Collect_filter) { - collects(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - owner - amount0 - amount1 - amountUSD - logIndex - transaction { - id - timestamp - blockNumber - } - } - } -`) - -export type GetSushiV3Collects = VariablesOf & - ChainIdVariable - -export async function getSushiV3Collects( - { chainId, ...variables }: GetSushiV3Collects, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV3CollectsQuery, - variables, - options, - }) - - return result.collects -} - -export type SushiV3Collects = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/day-datas.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/day-datas.ts deleted file mode 100644 index 8a77a18b63..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/day-datas.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV3DayDatasQuery = graphql(` - query DayDatas($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: UniswapDayData_orderBy, $orderDirection: OrderDirection, $where: UniswapDayData_filter) { - uniswapDayDatas(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - date - volumeUSD - volumeUSDUntracked - tvlUSD - feesUSD - txCount - } - } -`) - -export type GetSushiV3DayDatas = VariablesOf & - ChainIdVariable - -export async function getSushiV3DayDatas( - { chainId, ...variables }: GetSushiV3DayDatas, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV3DayDatasQuery, - variables, - options, - }) - - return result.uniswapDayDatas.map((dayData) => ({ - id: dayData.id, - date: dayData.date, - volumeUSD: Number(dayData.volumeUSD), - volumeUSDUntracked: Number(dayData.volumeUSDUntracked), - liquidityUSD: Number(dayData.tvlUSD), - feesUSD: Number(dayData.feesUSD), - txCount: Number(dayData.txCount), - })) -} - -export type SushiV3DayDatas = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/factory.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/factory.ts deleted file mode 100644 index 94a15007f5..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/factory.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import { FetchError } from 'src/lib/fetch-error' -import { addChainId } from 'src/lib/modifiers/add-chain-id' -import { convertIdToMultichainId } from 'src/lib/modifiers/convert-id-to-multichain-id' -import { copyIdToAddress } from 'src/lib/modifiers/copy-id-to-address' -import { type RequestOptions, request } from 'src/lib/request' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import type { Hex } from 'src/lib/types/hex' -import { graphql } from '../graphql' - -export const SushiV3FactoriesQuery = graphql(` - query Factories { - factories(first: 1) { - id - totalValueLockedUSD - totalVolumeUSD - poolCount - } - } -`) - -export type GetSushiV3Factory = VariablesOf & - ChainIdVariable - -export async function getSushiV3Factory( - { chainId, ...variables }: GetSushiV3Factory, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const result = await request( - { - url, - document: SushiV3FactoriesQuery, - variables, - }, - options, - ) - - if (result.factories[0]) { - const factory = result.factories[0] - - return convertIdToMultichainId( - copyIdToAddress( - addChainId(chainId, factory as typeof factory & { id: Hex }), - ), - ) - } - - throw new FetchError(chainId, 'Failed to fetch factory') -} - -export type SushiV3Factory = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/mints.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/mints.ts deleted file mode 100644 index 8ed800fda2..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/mints.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import { FetchError } from 'src/lib/fetch-error' -import { addChainId } from 'src/lib/modifiers/add-chain-id' -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV3MintsQuery = graphql(` - query Mints($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Mint_orderBy, $orderDirection: OrderDirection, $where: Mint_filter) { - mints(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - owner - sender - origin - amount - amount0 - amount1 - amountUSD - logIndex - transaction { - id - timestamp - blockNumber - } - } - } -`) - -export type GetSushiV3Mints = VariablesOf & - ChainIdVariable - -export async function getSushiV3Mints( - { chainId, ...variables }: GetSushiV3Mints, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV3MintsQuery, - variables, - options, - }) - - if (result) { - return result.mints.map((mint) => addChainId(chainId, mint)) - } - - throw new FetchError(chainId, 'Failed to fetch mints') -} - -export type SushiV3Mints = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/pool-with-buckets.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/pool-with-buckets.ts deleted file mode 100644 index 403ce4d7a3..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/pool-with-buckets.ts +++ /dev/null @@ -1,73 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' -import type { PoolBase, PoolV3, PoolWithBuckets } from 'sushi/types' - -import { FetchError } from 'src/lib/fetch-error' -import { type RequestOptions, request } from 'src/lib/request' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { PoolFieldsFragment } from 'src/subgraphs/sushi-v3/fragments/pool-fields' -import { transformBucketsV3ToStd } from 'src/subgraphs/sushi-v3/transforms/bucket-v3-to-std' -import { transformPoolV3ToBase } from 'src/subgraphs/sushi-v3/transforms/pool-v3-to-base' -import { graphql } from '../graphql' - -export const SushiV3PoolBucketsQuery = graphql( - ` - query Pool($id: ID!, $block: Block_height, $hourDataFirst: Int = 168, $dayDataFirst: Int = 1000) { - pool(id: $id, block: $block) { - ...PoolFields - - poolHourData(first: $hourDataFirst, orderBy: periodStartUnix, orderDirection: desc) { - id - date: periodStartUnix - liquidityUSD: tvlUSD - volumeUSD - feesUSD - txCount - } - - poolDayData(first: $dayDataFirst, orderBy: date, orderDirection: desc) { - id - date - liquidityUSD: tvlUSD - volumeUSD - feesUSD - txCount - } - } - } -`, - [PoolFieldsFragment], -) - -export type GetSushiV3PoolBuckets = VariablesOf< - typeof SushiV3PoolBucketsQuery -> & - ChainIdVariable - -export type SushiV3PoolBuckets = PoolWithBuckets> - -export async function getSushiV3PoolBuckets( - { chainId, ...variables }: GetSushiV3PoolBuckets, - options?: RequestOptions, -): Promise { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const result = await request( - { url, document: SushiV3PoolBucketsQuery, variables }, - options, - ) - - if (result.pool) { - return { - ...transformPoolV3ToBase(result.pool, chainId), - poolHourData: transformBucketsV3ToStd(result.pool.poolHourData), - poolDayData: transformBucketsV3ToStd(result.pool.poolDayData), - } - } - - throw new FetchError( - chainId, - `Failed to fetch pool ${chainId}:${variables.id}`, - ) -} diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/pool.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/pool.ts deleted file mode 100644 index 29c6fc25e1..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/pool.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' -import type { PoolBase, PoolV3 } from 'sushi/types' - -import { FetchError } from 'src/lib/fetch-error' -import { type RequestOptions, request } from 'src/lib/request' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { PoolFieldsFragment } from 'src/subgraphs/sushi-v3/fragments/pool-fields' -import { transformPoolV3ToBase } from 'src/subgraphs/sushi-v3/transforms/pool-v3-to-base' -import { graphql } from '../graphql' - -export const SushiV3PoolQuery = graphql( - ` - query Pool($id: ID!, $block: Block_height) { - pool(id: $id, block: $block) { - ...PoolFields - } - } -`, - [PoolFieldsFragment], -) - -export type GetSushiV3Pool = VariablesOf & - ChainIdVariable - -export type SushiV3Pool = PoolV3 - -export async function getSushiV3Pool( - { chainId, ...variables }: GetSushiV3Pool, - options?: RequestOptions, -): Promise { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const result = await request( - { url, document: SushiV3PoolQuery, variables }, - options, - ) - - if (result.pool) { - return transformPoolV3ToBase(result.pool, chainId) - } - - throw new FetchError( - chainId, - `Failed to fetch pool ${chainId}:${variables.id}`, - ) -} diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/pools-by-token-pair.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/pools-by-token-pair.ts deleted file mode 100644 index ac93505260..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/pools-by-token-pair.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import { type RequestOptions, request } from 'src/lib/request' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { PoolFieldsFragment } from 'src/subgraphs/sushi-v3/fragments/pool-fields' -import { transformPoolV3ToBase } from 'src/subgraphs/sushi-v3/transforms/pool-v3-to-base' -import type { PoolBase, PoolV3 } from 'sushi/types' -import { graphql } from '../graphql' - -export const SushiV3PoolsByTokenPairQuery = graphql( - ` - query PoolsByTokenPair($where: Pool_filter!) { - pools(first: 1000, where: $where) { - ...PoolFields - } - } -`, - [PoolFieldsFragment], -) - -export type GetSushiV3PoolsByTokenPair = { - token0: `0x${string}` - token1: `0x${string}` -} & ChainIdVariable - -export type SushiV3PoolsByTokenPair = PoolV3 - -export async function getSushiV3PoolsByTokenPair( - { chainId, ..._variables }: GetSushiV3PoolsByTokenPair, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const tokens = [_variables.token0, _variables.token1].sort() as [ - `0x${string}`, - `0x${string}`, - ] - - const variables: VariablesOf = { - where: { - token0: tokens[0].toLowerCase(), - token1: tokens[1].toLowerCase(), - }, - } - - const result = await request( - { - url, - document: SushiV3PoolsByTokenPairQuery, - variables, - }, - options, - ) - - return result.pools.map((pool) => transformPoolV3ToBase(pool, chainId)) -} diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts deleted file mode 100644 index 79b82bacb9..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import { FetchError } from 'src/lib/fetch-error' -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { transformPoolV3ToBase } from 'src/subgraphs/sushi-v3/transforms/pool-v3-to-base' -import { PoolFieldsFragment } from '../fragments/pool-fields' -import { graphql } from '../graphql' - -export const SushiV3PoolsQuery = graphql( - ` - query Pools($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Pool_orderBy, $orderDirection: OrderDirection, $where: Pool_filter) { - pools(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - ...PoolFields - } - } -`, - [PoolFieldsFragment], -) - -export type GetSushiV3Pools = VariablesOf & - ChainIdVariable - -export async function getSushiV3Pools( - { chainId, ...variables }: GetSushiV3Pools, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV3PoolsQuery, - variables, - options, - }) - - if (result) { - return result.pools.map((pool) => transformPoolV3ToBase(pool, chainId)) - } - - throw new FetchError(chainId, 'Failed to fetch pools') -} - -export type SushiV3Pools = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/swaps.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/swaps.ts deleted file mode 100644 index 4cf276a570..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/swaps.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV3SwapsQuery = graphql(` - query Swaps($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Swap_orderBy, $orderDirection: OrderDirection, $where: Swap_filter) { - swaps(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - sender - recipient - origin - amount0 - amount1 - amountUSD - logIndex - transaction { - id - timestamp - blockNumber - } - } - } -`) - -export type GetSushiV3Swaps = VariablesOf & - ChainIdVariable - -export async function getSushiV3Swaps( - { chainId, ...variables }: GetSushiV3Swaps, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV3SwapsQuery, - variables, - options, - }) - - return result.swaps -} - -export type SushiV3Swaps = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/transactions.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/transactions.ts deleted file mode 100644 index a5a5a6d86d..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/transactions.ts +++ /dev/null @@ -1,83 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { graphql } from '../graphql' - -export const SushiV3TransactionsQuery = graphql(` - query Transactions($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Transaction_orderBy, $orderDirection: OrderDirection, $where: Transaction_filter) { - transactions(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - id - timestamp - blockNumber - mints { - id - owner - sender - origin - amount - amount0 - amount1 - amountUSD - logIndex - } - burns { - id - owner - origin - amount - amount0 - amount1 - amountUSD - logIndex - } - swaps { - id - sender - recipient - origin - amount0 - amount1 - amountUSD - logIndex - } - collects { - id - owner - amount0 - amount1 - amountUSD - logIndex - } - } - } -`) - -export type GetSushiV3Transactions = VariablesOf< - typeof SushiV3TransactionsQuery -> & - ChainIdVariable - -export async function getSushiV3Transactions( - { chainId, ...variables }: GetSushiV3Transactions, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV3TransactionsQuery, - variables, - options, - }) - - return result.transactions -} - -export type SushiV3Transactions = Awaited< - ReturnType -> diff --git a/packages/graph-client/src/subgraphs/sushi-v3/schema.graphql b/packages/graph-client/src/subgraphs/sushi-v3/schema.graphql deleted file mode 100644 index 81ac3333f6..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/schema.graphql +++ /dev/null @@ -1,6541 +0,0 @@ -""" -Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive. -""" -directive @entity on OBJECT - -"""Defined a Subgraph ID for an object type""" -directive @subgraphId(id: String!) on OBJECT - -""" -creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API. -""" -directive @derivedFrom(field: String!) on FIELD_DEFINITION - -enum Aggregation_interval { - hour - day -} - -scalar BigDecimal - -scalar BigInt - -input BlockChangedFilter { - number_gte: Int! -} - -input Block_height { - hash: Bytes - number: Int - number_gte: Int -} - -type Bundle { - id: ID! - ethPriceUSD: BigDecimal! -} - -input Bundle_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - ethPriceUSD: BigDecimal - ethPriceUSD_not: BigDecimal - ethPriceUSD_gt: BigDecimal - ethPriceUSD_lt: BigDecimal - ethPriceUSD_gte: BigDecimal - ethPriceUSD_lte: BigDecimal - ethPriceUSD_in: [BigDecimal!] - ethPriceUSD_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Bundle_filter] - or: [Bundle_filter] -} - -enum Bundle_orderBy { - id - ethPriceUSD -} - -type Burn { - id: ID! - transaction: Transaction! - pool: Pool! - token0: Token! - token1: Token! - timestamp: BigInt! - owner: Bytes - origin: Bytes! - amount: BigInt! - amount0: BigDecimal! - amount1: BigDecimal! - amountUSD: BigDecimal - tickLower: BigInt! - tickUpper: BigInt! - logIndex: BigInt -} - -input Burn_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - owner: Bytes - owner_not: Bytes - owner_gt: Bytes - owner_lt: Bytes - owner_gte: Bytes - owner_lte: Bytes - owner_in: [Bytes!] - owner_not_in: [Bytes!] - owner_contains: Bytes - owner_not_contains: Bytes - origin: Bytes - origin_not: Bytes - origin_gt: Bytes - origin_lt: Bytes - origin_gte: Bytes - origin_lte: Bytes - origin_in: [Bytes!] - origin_not_in: [Bytes!] - origin_contains: Bytes - origin_not_contains: Bytes - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - tickLower: BigInt - tickLower_not: BigInt - tickLower_gt: BigInt - tickLower_lt: BigInt - tickLower_gte: BigInt - tickLower_lte: BigInt - tickLower_in: [BigInt!] - tickLower_not_in: [BigInt!] - tickUpper: BigInt - tickUpper_not: BigInt - tickUpper_gt: BigInt - tickUpper_lt: BigInt - tickUpper_gte: BigInt - tickUpper_lte: BigInt - tickUpper_in: [BigInt!] - tickUpper_not_in: [BigInt!] - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Burn_filter] - or: [Burn_filter] -} - -enum Burn_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - timestamp - owner - origin - amount - amount0 - amount1 - amountUSD - tickLower - tickUpper - logIndex -} - -scalar Bytes - -type Collect { - id: ID! - transaction: Transaction! - timestamp: BigInt! - pool: Pool! - owner: Bytes - amount0: BigDecimal! - amount1: BigDecimal! - amountUSD: BigDecimal - tickLower: BigInt! - tickUpper: BigInt! - logIndex: BigInt -} - -input Collect_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - owner: Bytes - owner_not: Bytes - owner_gt: Bytes - owner_lt: Bytes - owner_gte: Bytes - owner_lte: Bytes - owner_in: [Bytes!] - owner_not_in: [Bytes!] - owner_contains: Bytes - owner_not_contains: Bytes - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - tickLower: BigInt - tickLower_not: BigInt - tickLower_gt: BigInt - tickLower_lt: BigInt - tickLower_gte: BigInt - tickLower_lte: BigInt - tickLower_in: [BigInt!] - tickLower_not_in: [BigInt!] - tickUpper: BigInt - tickUpper_not: BigInt - tickUpper_gt: BigInt - tickUpper_lt: BigInt - tickUpper_gte: BigInt - tickUpper_lte: BigInt - tickUpper_in: [BigInt!] - tickUpper_not_in: [BigInt!] - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Collect_filter] - or: [Collect_filter] -} - -enum Collect_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - timestamp - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - owner - amount0 - amount1 - amountUSD - tickLower - tickUpper - logIndex -} - -type DecreaseEvent { - id: ID! - pool: Pool! - tokenID: BigInt! - position: Position! - amount0: BigInt! - amount1: BigInt! - token0: Token! - token1: Token! - timeStamp: BigInt! - transaction: Transaction! -} - -input DecreaseEvent_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - tokenID: BigInt - tokenID_not: BigInt - tokenID_gt: BigInt - tokenID_lt: BigInt - tokenID_gte: BigInt - tokenID_lte: BigInt - tokenID_in: [BigInt!] - tokenID_not_in: [BigInt!] - position: String - position_not: String - position_gt: String - position_lt: String - position_gte: String - position_lte: String - position_in: [String!] - position_not_in: [String!] - position_contains: String - position_contains_nocase: String - position_not_contains: String - position_not_contains_nocase: String - position_starts_with: String - position_starts_with_nocase: String - position_not_starts_with: String - position_not_starts_with_nocase: String - position_ends_with: String - position_ends_with_nocase: String - position_not_ends_with: String - position_not_ends_with_nocase: String - position_: Position_filter - amount0: BigInt - amount0_not: BigInt - amount0_gt: BigInt - amount0_lt: BigInt - amount0_gte: BigInt - amount0_lte: BigInt - amount0_in: [BigInt!] - amount0_not_in: [BigInt!] - amount1: BigInt - amount1_not: BigInt - amount1_gt: BigInt - amount1_lt: BigInt - amount1_gte: BigInt - amount1_lte: BigInt - amount1_in: [BigInt!] - amount1_not_in: [BigInt!] - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [DecreaseEvent_filter] - or: [DecreaseEvent_filter] -} - -enum DecreaseEvent_orderBy { - id - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - tokenID - position - position__id - position__owner - position__liquidity - position__depositedToken0 - position__depositedToken1 - position__withdrawnToken0 - position__withdrawnToken1 - position__collectedToken0 - position__collectedToken1 - position__collectedFeesToken0 - position__collectedFeesToken1 - position__amountDepositedUSD - position__amountWithdrawnUSD - position__amountCollectedUSD - position__feeGrowthInside0LastX128 - position__feeGrowthInside1LastX128 - amount0 - amount1 - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - timeStamp - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice -} - -type Factory { - id: ID! - poolCount: BigInt! - txCount: BigInt! - totalVolumeUSD: BigDecimal! - totalVolumeETH: BigDecimal! - totalFeesUSD: BigDecimal! - totalFeesETH: BigDecimal! - untrackedVolumeUSD: BigDecimal! - totalValueLockedUSD: BigDecimal! - totalValueLockedETH: BigDecimal! - totalValueLockedUSDUntracked: BigDecimal! - totalValueLockedETHUntracked: BigDecimal! - owner: ID! -} - -input Factory_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - poolCount: BigInt - poolCount_not: BigInt - poolCount_gt: BigInt - poolCount_lt: BigInt - poolCount_gte: BigInt - poolCount_lte: BigInt - poolCount_in: [BigInt!] - poolCount_not_in: [BigInt!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - totalVolumeUSD: BigDecimal - totalVolumeUSD_not: BigDecimal - totalVolumeUSD_gt: BigDecimal - totalVolumeUSD_lt: BigDecimal - totalVolumeUSD_gte: BigDecimal - totalVolumeUSD_lte: BigDecimal - totalVolumeUSD_in: [BigDecimal!] - totalVolumeUSD_not_in: [BigDecimal!] - totalVolumeETH: BigDecimal - totalVolumeETH_not: BigDecimal - totalVolumeETH_gt: BigDecimal - totalVolumeETH_lt: BigDecimal - totalVolumeETH_gte: BigDecimal - totalVolumeETH_lte: BigDecimal - totalVolumeETH_in: [BigDecimal!] - totalVolumeETH_not_in: [BigDecimal!] - totalFeesUSD: BigDecimal - totalFeesUSD_not: BigDecimal - totalFeesUSD_gt: BigDecimal - totalFeesUSD_lt: BigDecimal - totalFeesUSD_gte: BigDecimal - totalFeesUSD_lte: BigDecimal - totalFeesUSD_in: [BigDecimal!] - totalFeesUSD_not_in: [BigDecimal!] - totalFeesETH: BigDecimal - totalFeesETH_not: BigDecimal - totalFeesETH_gt: BigDecimal - totalFeesETH_lt: BigDecimal - totalFeesETH_gte: BigDecimal - totalFeesETH_lte: BigDecimal - totalFeesETH_in: [BigDecimal!] - totalFeesETH_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - totalValueLockedUSD: BigDecimal - totalValueLockedUSD_not: BigDecimal - totalValueLockedUSD_gt: BigDecimal - totalValueLockedUSD_lt: BigDecimal - totalValueLockedUSD_gte: BigDecimal - totalValueLockedUSD_lte: BigDecimal - totalValueLockedUSD_in: [BigDecimal!] - totalValueLockedUSD_not_in: [BigDecimal!] - totalValueLockedETH: BigDecimal - totalValueLockedETH_not: BigDecimal - totalValueLockedETH_gt: BigDecimal - totalValueLockedETH_lt: BigDecimal - totalValueLockedETH_gte: BigDecimal - totalValueLockedETH_lte: BigDecimal - totalValueLockedETH_in: [BigDecimal!] - totalValueLockedETH_not_in: [BigDecimal!] - totalValueLockedUSDUntracked: BigDecimal - totalValueLockedUSDUntracked_not: BigDecimal - totalValueLockedUSDUntracked_gt: BigDecimal - totalValueLockedUSDUntracked_lt: BigDecimal - totalValueLockedUSDUntracked_gte: BigDecimal - totalValueLockedUSDUntracked_lte: BigDecimal - totalValueLockedUSDUntracked_in: [BigDecimal!] - totalValueLockedUSDUntracked_not_in: [BigDecimal!] - totalValueLockedETHUntracked: BigDecimal - totalValueLockedETHUntracked_not: BigDecimal - totalValueLockedETHUntracked_gt: BigDecimal - totalValueLockedETHUntracked_lt: BigDecimal - totalValueLockedETHUntracked_gte: BigDecimal - totalValueLockedETHUntracked_lte: BigDecimal - totalValueLockedETHUntracked_in: [BigDecimal!] - totalValueLockedETHUntracked_not_in: [BigDecimal!] - owner: ID - owner_not: ID - owner_gt: ID - owner_lt: ID - owner_gte: ID - owner_lte: ID - owner_in: [ID!] - owner_not_in: [ID!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Factory_filter] - or: [Factory_filter] -} - -enum Factory_orderBy { - id - poolCount - txCount - totalVolumeUSD - totalVolumeETH - totalFeesUSD - totalFeesETH - untrackedVolumeUSD - totalValueLockedUSD - totalValueLockedETH - totalValueLockedUSDUntracked - totalValueLockedETHUntracked - owner -} - -type Flash { - id: ID! - transaction: Transaction! - timestamp: BigInt! - pool: Pool! - sender: Bytes! - recipient: Bytes! - amount0: BigDecimal! - amount1: BigDecimal! - amountUSD: BigDecimal! - amount0Paid: BigDecimal! - amount1Paid: BigDecimal! - logIndex: BigInt -} - -input Flash_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - sender: Bytes - sender_not: Bytes - sender_gt: Bytes - sender_lt: Bytes - sender_gte: Bytes - sender_lte: Bytes - sender_in: [Bytes!] - sender_not_in: [Bytes!] - sender_contains: Bytes - sender_not_contains: Bytes - recipient: Bytes - recipient_not: Bytes - recipient_gt: Bytes - recipient_lt: Bytes - recipient_gte: Bytes - recipient_lte: Bytes - recipient_in: [Bytes!] - recipient_not_in: [Bytes!] - recipient_contains: Bytes - recipient_not_contains: Bytes - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - amount0Paid: BigDecimal - amount0Paid_not: BigDecimal - amount0Paid_gt: BigDecimal - amount0Paid_lt: BigDecimal - amount0Paid_gte: BigDecimal - amount0Paid_lte: BigDecimal - amount0Paid_in: [BigDecimal!] - amount0Paid_not_in: [BigDecimal!] - amount1Paid: BigDecimal - amount1Paid_not: BigDecimal - amount1Paid_gt: BigDecimal - amount1Paid_lt: BigDecimal - amount1Paid_gte: BigDecimal - amount1Paid_lte: BigDecimal - amount1Paid_in: [BigDecimal!] - amount1Paid_not_in: [BigDecimal!] - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Flash_filter] - or: [Flash_filter] -} - -enum Flash_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - timestamp - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - sender - recipient - amount0 - amount1 - amountUSD - amount0Paid - amount1Paid - logIndex -} - -type IncreaseEvent { - id: ID! - pool: Pool! - tokenID: BigInt! - position: Position! - amount0: BigInt! - amount1: BigInt! - token0: Token! - token1: Token! - timeStamp: BigInt! - transaction: Transaction! -} - -input IncreaseEvent_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - tokenID: BigInt - tokenID_not: BigInt - tokenID_gt: BigInt - tokenID_lt: BigInt - tokenID_gte: BigInt - tokenID_lte: BigInt - tokenID_in: [BigInt!] - tokenID_not_in: [BigInt!] - position: String - position_not: String - position_gt: String - position_lt: String - position_gte: String - position_lte: String - position_in: [String!] - position_not_in: [String!] - position_contains: String - position_contains_nocase: String - position_not_contains: String - position_not_contains_nocase: String - position_starts_with: String - position_starts_with_nocase: String - position_not_starts_with: String - position_not_starts_with_nocase: String - position_ends_with: String - position_ends_with_nocase: String - position_not_ends_with: String - position_not_ends_with_nocase: String - position_: Position_filter - amount0: BigInt - amount0_not: BigInt - amount0_gt: BigInt - amount0_lt: BigInt - amount0_gte: BigInt - amount0_lte: BigInt - amount0_in: [BigInt!] - amount0_not_in: [BigInt!] - amount1: BigInt - amount1_not: BigInt - amount1_gt: BigInt - amount1_lt: BigInt - amount1_gte: BigInt - amount1_lte: BigInt - amount1_in: [BigInt!] - amount1_not_in: [BigInt!] - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [IncreaseEvent_filter] - or: [IncreaseEvent_filter] -} - -enum IncreaseEvent_orderBy { - id - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - tokenID - position - position__id - position__owner - position__liquidity - position__depositedToken0 - position__depositedToken1 - position__withdrawnToken0 - position__withdrawnToken1 - position__collectedToken0 - position__collectedToken1 - position__collectedFeesToken0 - position__collectedFeesToken1 - position__amountDepositedUSD - position__amountWithdrawnUSD - position__amountCollectedUSD - position__feeGrowthInside0LastX128 - position__feeGrowthInside1LastX128 - amount0 - amount1 - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - timeStamp - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice -} - -"8 bytes signed integer\n" -scalar Int8 - -type Mint { - id: ID! - transaction: Transaction! - timestamp: BigInt! - pool: Pool! - token0: Token! - token1: Token! - owner: Bytes! - sender: Bytes - origin: Bytes! - amount: BigInt! - amount0: BigDecimal! - amount1: BigDecimal! - amountUSD: BigDecimal - tickLower: BigInt! - tickUpper: BigInt! - logIndex: BigInt -} - -input Mint_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - owner: Bytes - owner_not: Bytes - owner_gt: Bytes - owner_lt: Bytes - owner_gte: Bytes - owner_lte: Bytes - owner_in: [Bytes!] - owner_not_in: [Bytes!] - owner_contains: Bytes - owner_not_contains: Bytes - sender: Bytes - sender_not: Bytes - sender_gt: Bytes - sender_lt: Bytes - sender_gte: Bytes - sender_lte: Bytes - sender_in: [Bytes!] - sender_not_in: [Bytes!] - sender_contains: Bytes - sender_not_contains: Bytes - origin: Bytes - origin_not: Bytes - origin_gt: Bytes - origin_lt: Bytes - origin_gte: Bytes - origin_lte: Bytes - origin_in: [Bytes!] - origin_not_in: [Bytes!] - origin_contains: Bytes - origin_not_contains: Bytes - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - tickLower: BigInt - tickLower_not: BigInt - tickLower_gt: BigInt - tickLower_lt: BigInt - tickLower_gte: BigInt - tickLower_lte: BigInt - tickLower_in: [BigInt!] - tickLower_not_in: [BigInt!] - tickUpper: BigInt - tickUpper_not: BigInt - tickUpper_gt: BigInt - tickUpper_lt: BigInt - tickUpper_gte: BigInt - tickUpper_lte: BigInt - tickUpper_in: [BigInt!] - tickUpper_not_in: [BigInt!] - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Mint_filter] - or: [Mint_filter] -} - -enum Mint_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - timestamp - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - owner - sender - origin - amount - amount0 - amount1 - amountUSD - tickLower - tickUpper - logIndex -} - -"""Defines the order direction, either ascending or descending""" -enum OrderDirection { - asc - desc -} - -type Pool { - id: ID! - createdAtTimestamp: BigInt! - createdAtBlockNumber: BigInt! - token0: Token! - token1: Token! - feeTier: BigInt! - liquidity: BigInt! - sqrtPrice: BigInt! - feeGrowthGlobal0X128: BigInt! - feeGrowthGlobal1X128: BigInt! - token0Price: BigDecimal! - token1Price: BigDecimal! - tick: BigInt - observationIndex: BigInt! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - feesUSD: BigDecimal! - txCount: BigInt! - collectedFeesToken0: BigDecimal! - collectedFeesToken1: BigDecimal! - collectedFeesUSD: BigDecimal! - totalValueLockedToken0: BigDecimal! - totalValueLockedToken1: BigDecimal! - totalValueLockedETH: BigDecimal! - totalValueLockedUSD: BigDecimal! - totalValueLockedUSDUntracked: BigDecimal! - isProtocolFeeEnabled: Boolean! - liquidityProviderCount: BigInt! - poolHourData(skip: Int = 0, first: Int = 100, orderBy: PoolHourData_orderBy, orderDirection: OrderDirection, where: PoolHourData_filter): [PoolHourData!]! - poolDayData(skip: Int = 0, first: Int = 100, orderBy: PoolDayData_orderBy, orderDirection: OrderDirection, where: PoolDayData_filter): [PoolDayData!]! - mints(skip: Int = 0, first: Int = 100, orderBy: Mint_orderBy, orderDirection: OrderDirection, where: Mint_filter): [Mint!]! - burns(skip: Int = 0, first: Int = 100, orderBy: Burn_orderBy, orderDirection: OrderDirection, where: Burn_filter): [Burn!]! - swaps(skip: Int = 0, first: Int = 100, orderBy: Swap_orderBy, orderDirection: OrderDirection, where: Swap_filter): [Swap!]! - collects(skip: Int = 0, first: Int = 100, orderBy: Collect_orderBy, orderDirection: OrderDirection, where: Collect_filter): [Collect!]! - ticks(skip: Int = 0, first: Int = 100, orderBy: Tick_orderBy, orderDirection: OrderDirection, where: Tick_filter): [Tick!]! -} - -type PoolDayData { - id: ID! - date: Int! - pool: Pool! - liquidity: BigInt! - sqrtPrice: BigInt! - token0Price: BigDecimal! - token1Price: BigDecimal! - tick: BigInt - feeGrowthGlobal0X128: BigInt! - feeGrowthGlobal1X128: BigInt! - tvlUSD: BigDecimal! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - feesUSD: BigDecimal! - txCount: BigInt! - open: BigDecimal! - high: BigDecimal! - low: BigDecimal! - close: BigDecimal! -} - -input PoolDayData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - liquidity: BigInt - liquidity_not: BigInt - liquidity_gt: BigInt - liquidity_lt: BigInt - liquidity_gte: BigInt - liquidity_lte: BigInt - liquidity_in: [BigInt!] - liquidity_not_in: [BigInt!] - sqrtPrice: BigInt - sqrtPrice_not: BigInt - sqrtPrice_gt: BigInt - sqrtPrice_lt: BigInt - sqrtPrice_gte: BigInt - sqrtPrice_lte: BigInt - sqrtPrice_in: [BigInt!] - sqrtPrice_not_in: [BigInt!] - token0Price: BigDecimal - token0Price_not: BigDecimal - token0Price_gt: BigDecimal - token0Price_lt: BigDecimal - token0Price_gte: BigDecimal - token0Price_lte: BigDecimal - token0Price_in: [BigDecimal!] - token0Price_not_in: [BigDecimal!] - token1Price: BigDecimal - token1Price_not: BigDecimal - token1Price_gt: BigDecimal - token1Price_lt: BigDecimal - token1Price_gte: BigDecimal - token1Price_lte: BigDecimal - token1Price_in: [BigDecimal!] - token1Price_not_in: [BigDecimal!] - tick: BigInt - tick_not: BigInt - tick_gt: BigInt - tick_lt: BigInt - tick_gte: BigInt - tick_lte: BigInt - tick_in: [BigInt!] - tick_not_in: [BigInt!] - feeGrowthGlobal0X128: BigInt - feeGrowthGlobal0X128_not: BigInt - feeGrowthGlobal0X128_gt: BigInt - feeGrowthGlobal0X128_lt: BigInt - feeGrowthGlobal0X128_gte: BigInt - feeGrowthGlobal0X128_lte: BigInt - feeGrowthGlobal0X128_in: [BigInt!] - feeGrowthGlobal0X128_not_in: [BigInt!] - feeGrowthGlobal1X128: BigInt - feeGrowthGlobal1X128_not: BigInt - feeGrowthGlobal1X128_gt: BigInt - feeGrowthGlobal1X128_lt: BigInt - feeGrowthGlobal1X128_gte: BigInt - feeGrowthGlobal1X128_lte: BigInt - feeGrowthGlobal1X128_in: [BigInt!] - feeGrowthGlobal1X128_not_in: [BigInt!] - tvlUSD: BigDecimal - tvlUSD_not: BigDecimal - tvlUSD_gt: BigDecimal - tvlUSD_lt: BigDecimal - tvlUSD_gte: BigDecimal - tvlUSD_lte: BigDecimal - tvlUSD_in: [BigDecimal!] - tvlUSD_not_in: [BigDecimal!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - open: BigDecimal - open_not: BigDecimal - open_gt: BigDecimal - open_lt: BigDecimal - open_gte: BigDecimal - open_lte: BigDecimal - open_in: [BigDecimal!] - open_not_in: [BigDecimal!] - high: BigDecimal - high_not: BigDecimal - high_gt: BigDecimal - high_lt: BigDecimal - high_gte: BigDecimal - high_lte: BigDecimal - high_in: [BigDecimal!] - high_not_in: [BigDecimal!] - low: BigDecimal - low_not: BigDecimal - low_gt: BigDecimal - low_lt: BigDecimal - low_gte: BigDecimal - low_lte: BigDecimal - low_in: [BigDecimal!] - low_not_in: [BigDecimal!] - close: BigDecimal - close_not: BigDecimal - close_gt: BigDecimal - close_lt: BigDecimal - close_gte: BigDecimal - close_lte: BigDecimal - close_in: [BigDecimal!] - close_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PoolDayData_filter] - or: [PoolDayData_filter] -} - -enum PoolDayData_orderBy { - id - date - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - liquidity - sqrtPrice - token0Price - token1Price - tick - feeGrowthGlobal0X128 - feeGrowthGlobal1X128 - tvlUSD - volumeToken0 - volumeToken1 - volumeUSD - feesUSD - txCount - open - high - low - close -} - -type PoolHourData { - id: ID! - periodStartUnix: Int! - pool: Pool! - liquidity: BigInt! - sqrtPrice: BigInt! - token0Price: BigDecimal! - token1Price: BigDecimal! - tick: BigInt - feeGrowthGlobal0X128: BigInt! - feeGrowthGlobal1X128: BigInt! - tvlUSD: BigDecimal! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - feesUSD: BigDecimal! - txCount: BigInt! - open: BigDecimal! - high: BigDecimal! - low: BigDecimal! - close: BigDecimal! -} - -input PoolHourData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - periodStartUnix: Int - periodStartUnix_not: Int - periodStartUnix_gt: Int - periodStartUnix_lt: Int - periodStartUnix_gte: Int - periodStartUnix_lte: Int - periodStartUnix_in: [Int!] - periodStartUnix_not_in: [Int!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - liquidity: BigInt - liquidity_not: BigInt - liquidity_gt: BigInt - liquidity_lt: BigInt - liquidity_gte: BigInt - liquidity_lte: BigInt - liquidity_in: [BigInt!] - liquidity_not_in: [BigInt!] - sqrtPrice: BigInt - sqrtPrice_not: BigInt - sqrtPrice_gt: BigInt - sqrtPrice_lt: BigInt - sqrtPrice_gte: BigInt - sqrtPrice_lte: BigInt - sqrtPrice_in: [BigInt!] - sqrtPrice_not_in: [BigInt!] - token0Price: BigDecimal - token0Price_not: BigDecimal - token0Price_gt: BigDecimal - token0Price_lt: BigDecimal - token0Price_gte: BigDecimal - token0Price_lte: BigDecimal - token0Price_in: [BigDecimal!] - token0Price_not_in: [BigDecimal!] - token1Price: BigDecimal - token1Price_not: BigDecimal - token1Price_gt: BigDecimal - token1Price_lt: BigDecimal - token1Price_gte: BigDecimal - token1Price_lte: BigDecimal - token1Price_in: [BigDecimal!] - token1Price_not_in: [BigDecimal!] - tick: BigInt - tick_not: BigInt - tick_gt: BigInt - tick_lt: BigInt - tick_gte: BigInt - tick_lte: BigInt - tick_in: [BigInt!] - tick_not_in: [BigInt!] - feeGrowthGlobal0X128: BigInt - feeGrowthGlobal0X128_not: BigInt - feeGrowthGlobal0X128_gt: BigInt - feeGrowthGlobal0X128_lt: BigInt - feeGrowthGlobal0X128_gte: BigInt - feeGrowthGlobal0X128_lte: BigInt - feeGrowthGlobal0X128_in: [BigInt!] - feeGrowthGlobal0X128_not_in: [BigInt!] - feeGrowthGlobal1X128: BigInt - feeGrowthGlobal1X128_not: BigInt - feeGrowthGlobal1X128_gt: BigInt - feeGrowthGlobal1X128_lt: BigInt - feeGrowthGlobal1X128_gte: BigInt - feeGrowthGlobal1X128_lte: BigInt - feeGrowthGlobal1X128_in: [BigInt!] - feeGrowthGlobal1X128_not_in: [BigInt!] - tvlUSD: BigDecimal - tvlUSD_not: BigDecimal - tvlUSD_gt: BigDecimal - tvlUSD_lt: BigDecimal - tvlUSD_gte: BigDecimal - tvlUSD_lte: BigDecimal - tvlUSD_in: [BigDecimal!] - tvlUSD_not_in: [BigDecimal!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - open: BigDecimal - open_not: BigDecimal - open_gt: BigDecimal - open_lt: BigDecimal - open_gte: BigDecimal - open_lte: BigDecimal - open_in: [BigDecimal!] - open_not_in: [BigDecimal!] - high: BigDecimal - high_not: BigDecimal - high_gt: BigDecimal - high_lt: BigDecimal - high_gte: BigDecimal - high_lte: BigDecimal - high_in: [BigDecimal!] - high_not_in: [BigDecimal!] - low: BigDecimal - low_not: BigDecimal - low_gt: BigDecimal - low_lt: BigDecimal - low_gte: BigDecimal - low_lte: BigDecimal - low_in: [BigDecimal!] - low_not_in: [BigDecimal!] - close: BigDecimal - close_not: BigDecimal - close_gt: BigDecimal - close_lt: BigDecimal - close_gte: BigDecimal - close_lte: BigDecimal - close_in: [BigDecimal!] - close_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PoolHourData_filter] - or: [PoolHourData_filter] -} - -enum PoolHourData_orderBy { - id - periodStartUnix - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - liquidity - sqrtPrice - token0Price - token1Price - tick - feeGrowthGlobal0X128 - feeGrowthGlobal1X128 - tvlUSD - volumeToken0 - volumeToken1 - volumeUSD - feesUSD - txCount - open - high - low - close -} - -input Pool_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - createdAtTimestamp: BigInt - createdAtTimestamp_not: BigInt - createdAtTimestamp_gt: BigInt - createdAtTimestamp_lt: BigInt - createdAtTimestamp_gte: BigInt - createdAtTimestamp_lte: BigInt - createdAtTimestamp_in: [BigInt!] - createdAtTimestamp_not_in: [BigInt!] - createdAtBlockNumber: BigInt - createdAtBlockNumber_not: BigInt - createdAtBlockNumber_gt: BigInt - createdAtBlockNumber_lt: BigInt - createdAtBlockNumber_gte: BigInt - createdAtBlockNumber_lte: BigInt - createdAtBlockNumber_in: [BigInt!] - createdAtBlockNumber_not_in: [BigInt!] - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - feeTier: BigInt - feeTier_not: BigInt - feeTier_gt: BigInt - feeTier_lt: BigInt - feeTier_gte: BigInt - feeTier_lte: BigInt - feeTier_in: [BigInt!] - feeTier_not_in: [BigInt!] - liquidity: BigInt - liquidity_not: BigInt - liquidity_gt: BigInt - liquidity_lt: BigInt - liquidity_gte: BigInt - liquidity_lte: BigInt - liquidity_in: [BigInt!] - liquidity_not_in: [BigInt!] - sqrtPrice: BigInt - sqrtPrice_not: BigInt - sqrtPrice_gt: BigInt - sqrtPrice_lt: BigInt - sqrtPrice_gte: BigInt - sqrtPrice_lte: BigInt - sqrtPrice_in: [BigInt!] - sqrtPrice_not_in: [BigInt!] - feeGrowthGlobal0X128: BigInt - feeGrowthGlobal0X128_not: BigInt - feeGrowthGlobal0X128_gt: BigInt - feeGrowthGlobal0X128_lt: BigInt - feeGrowthGlobal0X128_gte: BigInt - feeGrowthGlobal0X128_lte: BigInt - feeGrowthGlobal0X128_in: [BigInt!] - feeGrowthGlobal0X128_not_in: [BigInt!] - feeGrowthGlobal1X128: BigInt - feeGrowthGlobal1X128_not: BigInt - feeGrowthGlobal1X128_gt: BigInt - feeGrowthGlobal1X128_lt: BigInt - feeGrowthGlobal1X128_gte: BigInt - feeGrowthGlobal1X128_lte: BigInt - feeGrowthGlobal1X128_in: [BigInt!] - feeGrowthGlobal1X128_not_in: [BigInt!] - token0Price: BigDecimal - token0Price_not: BigDecimal - token0Price_gt: BigDecimal - token0Price_lt: BigDecimal - token0Price_gte: BigDecimal - token0Price_lte: BigDecimal - token0Price_in: [BigDecimal!] - token0Price_not_in: [BigDecimal!] - token1Price: BigDecimal - token1Price_not: BigDecimal - token1Price_gt: BigDecimal - token1Price_lt: BigDecimal - token1Price_gte: BigDecimal - token1Price_lte: BigDecimal - token1Price_in: [BigDecimal!] - token1Price_not_in: [BigDecimal!] - tick: BigInt - tick_not: BigInt - tick_gt: BigInt - tick_lt: BigInt - tick_gte: BigInt - tick_lte: BigInt - tick_in: [BigInt!] - tick_not_in: [BigInt!] - observationIndex: BigInt - observationIndex_not: BigInt - observationIndex_gt: BigInt - observationIndex_lt: BigInt - observationIndex_gte: BigInt - observationIndex_lte: BigInt - observationIndex_in: [BigInt!] - observationIndex_not_in: [BigInt!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - collectedFeesToken0: BigDecimal - collectedFeesToken0_not: BigDecimal - collectedFeesToken0_gt: BigDecimal - collectedFeesToken0_lt: BigDecimal - collectedFeesToken0_gte: BigDecimal - collectedFeesToken0_lte: BigDecimal - collectedFeesToken0_in: [BigDecimal!] - collectedFeesToken0_not_in: [BigDecimal!] - collectedFeesToken1: BigDecimal - collectedFeesToken1_not: BigDecimal - collectedFeesToken1_gt: BigDecimal - collectedFeesToken1_lt: BigDecimal - collectedFeesToken1_gte: BigDecimal - collectedFeesToken1_lte: BigDecimal - collectedFeesToken1_in: [BigDecimal!] - collectedFeesToken1_not_in: [BigDecimal!] - collectedFeesUSD: BigDecimal - collectedFeesUSD_not: BigDecimal - collectedFeesUSD_gt: BigDecimal - collectedFeesUSD_lt: BigDecimal - collectedFeesUSD_gte: BigDecimal - collectedFeesUSD_lte: BigDecimal - collectedFeesUSD_in: [BigDecimal!] - collectedFeesUSD_not_in: [BigDecimal!] - totalValueLockedToken0: BigDecimal - totalValueLockedToken0_not: BigDecimal - totalValueLockedToken0_gt: BigDecimal - totalValueLockedToken0_lt: BigDecimal - totalValueLockedToken0_gte: BigDecimal - totalValueLockedToken0_lte: BigDecimal - totalValueLockedToken0_in: [BigDecimal!] - totalValueLockedToken0_not_in: [BigDecimal!] - totalValueLockedToken1: BigDecimal - totalValueLockedToken1_not: BigDecimal - totalValueLockedToken1_gt: BigDecimal - totalValueLockedToken1_lt: BigDecimal - totalValueLockedToken1_gte: BigDecimal - totalValueLockedToken1_lte: BigDecimal - totalValueLockedToken1_in: [BigDecimal!] - totalValueLockedToken1_not_in: [BigDecimal!] - totalValueLockedETH: BigDecimal - totalValueLockedETH_not: BigDecimal - totalValueLockedETH_gt: BigDecimal - totalValueLockedETH_lt: BigDecimal - totalValueLockedETH_gte: BigDecimal - totalValueLockedETH_lte: BigDecimal - totalValueLockedETH_in: [BigDecimal!] - totalValueLockedETH_not_in: [BigDecimal!] - totalValueLockedUSD: BigDecimal - totalValueLockedUSD_not: BigDecimal - totalValueLockedUSD_gt: BigDecimal - totalValueLockedUSD_lt: BigDecimal - totalValueLockedUSD_gte: BigDecimal - totalValueLockedUSD_lte: BigDecimal - totalValueLockedUSD_in: [BigDecimal!] - totalValueLockedUSD_not_in: [BigDecimal!] - totalValueLockedUSDUntracked: BigDecimal - totalValueLockedUSDUntracked_not: BigDecimal - totalValueLockedUSDUntracked_gt: BigDecimal - totalValueLockedUSDUntracked_lt: BigDecimal - totalValueLockedUSDUntracked_gte: BigDecimal - totalValueLockedUSDUntracked_lte: BigDecimal - totalValueLockedUSDUntracked_in: [BigDecimal!] - totalValueLockedUSDUntracked_not_in: [BigDecimal!] - isProtocolFeeEnabled: Boolean - isProtocolFeeEnabled_not: Boolean - isProtocolFeeEnabled_in: [Boolean!] - isProtocolFeeEnabled_not_in: [Boolean!] - liquidityProviderCount: BigInt - liquidityProviderCount_not: BigInt - liquidityProviderCount_gt: BigInt - liquidityProviderCount_lt: BigInt - liquidityProviderCount_gte: BigInt - liquidityProviderCount_lte: BigInt - liquidityProviderCount_in: [BigInt!] - liquidityProviderCount_not_in: [BigInt!] - poolHourData_: PoolHourData_filter - poolDayData_: PoolDayData_filter - mints_: Mint_filter - burns_: Burn_filter - swaps_: Swap_filter - collects_: Collect_filter - ticks_: Tick_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Pool_filter] - or: [Pool_filter] -} - -enum Pool_orderBy { - id - createdAtTimestamp - createdAtBlockNumber - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - feeTier - liquidity - sqrtPrice - feeGrowthGlobal0X128 - feeGrowthGlobal1X128 - token0Price - token1Price - tick - observationIndex - volumeToken0 - volumeToken1 - volumeUSD - untrackedVolumeUSD - feesUSD - txCount - collectedFeesToken0 - collectedFeesToken1 - collectedFeesUSD - totalValueLockedToken0 - totalValueLockedToken1 - totalValueLockedETH - totalValueLockedUSD - totalValueLockedUSDUntracked - isProtocolFeeEnabled - liquidityProviderCount - poolHourData - poolDayData - mints - burns - swaps - collects - ticks -} - -type Position { - id: ID! - owner: Bytes! - pool: Pool! - token0: Token! - token1: Token! - tickLower: Tick! - tickUpper: Tick! - liquidity: BigInt! - depositedToken0: BigDecimal! - depositedToken1: BigDecimal! - withdrawnToken0: BigDecimal! - withdrawnToken1: BigDecimal! - collectedToken0: BigDecimal! - collectedToken1: BigDecimal! - collectedFeesToken0: BigDecimal! - collectedFeesToken1: BigDecimal! - amountDepositedUSD: BigDecimal! - amountWithdrawnUSD: BigDecimal! - amountCollectedUSD: BigDecimal! - transaction: Transaction! - feeGrowthInside0LastX128: BigInt! - feeGrowthInside1LastX128: BigInt! - increaseEvents(skip: Int = 0, first: Int = 100, orderBy: IncreaseEvent_orderBy, orderDirection: OrderDirection, where: IncreaseEvent_filter): [IncreaseEvent!]! - decreaseEvents(skip: Int = 0, first: Int = 100, orderBy: IncreaseEvent_orderBy, orderDirection: OrderDirection, where: IncreaseEvent_filter): [IncreaseEvent!]! -} - -type PositionSnapshot { - id: ID! - owner: Bytes! - pool: Pool! - position: Position! - blockNumber: BigInt! - timestamp: BigInt! - liquidity: BigInt! - depositedToken0: BigDecimal! - depositedToken1: BigDecimal! - withdrawnToken0: BigDecimal! - withdrawnToken1: BigDecimal! - collectedFeesToken0: BigDecimal! - collectedFeesToken1: BigDecimal! - transaction: Transaction! - feeGrowthInside0LastX128: BigInt! - feeGrowthInside1LastX128: BigInt! -} - -input PositionSnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - owner: Bytes - owner_not: Bytes - owner_gt: Bytes - owner_lt: Bytes - owner_gte: Bytes - owner_lte: Bytes - owner_in: [Bytes!] - owner_not_in: [Bytes!] - owner_contains: Bytes - owner_not_contains: Bytes - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - position: String - position_not: String - position_gt: String - position_lt: String - position_gte: String - position_lte: String - position_in: [String!] - position_not_in: [String!] - position_contains: String - position_contains_nocase: String - position_not_contains: String - position_not_contains_nocase: String - position_starts_with: String - position_starts_with_nocase: String - position_not_starts_with: String - position_not_starts_with_nocase: String - position_ends_with: String - position_ends_with_nocase: String - position_not_ends_with: String - position_not_ends_with_nocase: String - position_: Position_filter - blockNumber: BigInt - blockNumber_not: BigInt - blockNumber_gt: BigInt - blockNumber_lt: BigInt - blockNumber_gte: BigInt - blockNumber_lte: BigInt - blockNumber_in: [BigInt!] - blockNumber_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - liquidity: BigInt - liquidity_not: BigInt - liquidity_gt: BigInt - liquidity_lt: BigInt - liquidity_gte: BigInt - liquidity_lte: BigInt - liquidity_in: [BigInt!] - liquidity_not_in: [BigInt!] - depositedToken0: BigDecimal - depositedToken0_not: BigDecimal - depositedToken0_gt: BigDecimal - depositedToken0_lt: BigDecimal - depositedToken0_gte: BigDecimal - depositedToken0_lte: BigDecimal - depositedToken0_in: [BigDecimal!] - depositedToken0_not_in: [BigDecimal!] - depositedToken1: BigDecimal - depositedToken1_not: BigDecimal - depositedToken1_gt: BigDecimal - depositedToken1_lt: BigDecimal - depositedToken1_gte: BigDecimal - depositedToken1_lte: BigDecimal - depositedToken1_in: [BigDecimal!] - depositedToken1_not_in: [BigDecimal!] - withdrawnToken0: BigDecimal - withdrawnToken0_not: BigDecimal - withdrawnToken0_gt: BigDecimal - withdrawnToken0_lt: BigDecimal - withdrawnToken0_gte: BigDecimal - withdrawnToken0_lte: BigDecimal - withdrawnToken0_in: [BigDecimal!] - withdrawnToken0_not_in: [BigDecimal!] - withdrawnToken1: BigDecimal - withdrawnToken1_not: BigDecimal - withdrawnToken1_gt: BigDecimal - withdrawnToken1_lt: BigDecimal - withdrawnToken1_gte: BigDecimal - withdrawnToken1_lte: BigDecimal - withdrawnToken1_in: [BigDecimal!] - withdrawnToken1_not_in: [BigDecimal!] - collectedFeesToken0: BigDecimal - collectedFeesToken0_not: BigDecimal - collectedFeesToken0_gt: BigDecimal - collectedFeesToken0_lt: BigDecimal - collectedFeesToken0_gte: BigDecimal - collectedFeesToken0_lte: BigDecimal - collectedFeesToken0_in: [BigDecimal!] - collectedFeesToken0_not_in: [BigDecimal!] - collectedFeesToken1: BigDecimal - collectedFeesToken1_not: BigDecimal - collectedFeesToken1_gt: BigDecimal - collectedFeesToken1_lt: BigDecimal - collectedFeesToken1_gte: BigDecimal - collectedFeesToken1_lte: BigDecimal - collectedFeesToken1_in: [BigDecimal!] - collectedFeesToken1_not_in: [BigDecimal!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - feeGrowthInside0LastX128: BigInt - feeGrowthInside0LastX128_not: BigInt - feeGrowthInside0LastX128_gt: BigInt - feeGrowthInside0LastX128_lt: BigInt - feeGrowthInside0LastX128_gte: BigInt - feeGrowthInside0LastX128_lte: BigInt - feeGrowthInside0LastX128_in: [BigInt!] - feeGrowthInside0LastX128_not_in: [BigInt!] - feeGrowthInside1LastX128: BigInt - feeGrowthInside1LastX128_not: BigInt - feeGrowthInside1LastX128_gt: BigInt - feeGrowthInside1LastX128_lt: BigInt - feeGrowthInside1LastX128_gte: BigInt - feeGrowthInside1LastX128_lte: BigInt - feeGrowthInside1LastX128_in: [BigInt!] - feeGrowthInside1LastX128_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PositionSnapshot_filter] - or: [PositionSnapshot_filter] -} - -enum PositionSnapshot_orderBy { - id - owner - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - position - position__id - position__owner - position__liquidity - position__depositedToken0 - position__depositedToken1 - position__withdrawnToken0 - position__withdrawnToken1 - position__collectedToken0 - position__collectedToken1 - position__collectedFeesToken0 - position__collectedFeesToken1 - position__amountDepositedUSD - position__amountWithdrawnUSD - position__amountCollectedUSD - position__feeGrowthInside0LastX128 - position__feeGrowthInside1LastX128 - blockNumber - timestamp - liquidity - depositedToken0 - depositedToken1 - withdrawnToken0 - withdrawnToken1 - collectedFeesToken0 - collectedFeesToken1 - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - feeGrowthInside0LastX128 - feeGrowthInside1LastX128 -} - -input Position_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - owner: Bytes - owner_not: Bytes - owner_gt: Bytes - owner_lt: Bytes - owner_gte: Bytes - owner_lte: Bytes - owner_in: [Bytes!] - owner_not_in: [Bytes!] - owner_contains: Bytes - owner_not_contains: Bytes - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - tickLower: String - tickLower_not: String - tickLower_gt: String - tickLower_lt: String - tickLower_gte: String - tickLower_lte: String - tickLower_in: [String!] - tickLower_not_in: [String!] - tickLower_contains: String - tickLower_contains_nocase: String - tickLower_not_contains: String - tickLower_not_contains_nocase: String - tickLower_starts_with: String - tickLower_starts_with_nocase: String - tickLower_not_starts_with: String - tickLower_not_starts_with_nocase: String - tickLower_ends_with: String - tickLower_ends_with_nocase: String - tickLower_not_ends_with: String - tickLower_not_ends_with_nocase: String - tickLower_: Tick_filter - tickUpper: String - tickUpper_not: String - tickUpper_gt: String - tickUpper_lt: String - tickUpper_gte: String - tickUpper_lte: String - tickUpper_in: [String!] - tickUpper_not_in: [String!] - tickUpper_contains: String - tickUpper_contains_nocase: String - tickUpper_not_contains: String - tickUpper_not_contains_nocase: String - tickUpper_starts_with: String - tickUpper_starts_with_nocase: String - tickUpper_not_starts_with: String - tickUpper_not_starts_with_nocase: String - tickUpper_ends_with: String - tickUpper_ends_with_nocase: String - tickUpper_not_ends_with: String - tickUpper_not_ends_with_nocase: String - tickUpper_: Tick_filter - liquidity: BigInt - liquidity_not: BigInt - liquidity_gt: BigInt - liquidity_lt: BigInt - liquidity_gte: BigInt - liquidity_lte: BigInt - liquidity_in: [BigInt!] - liquidity_not_in: [BigInt!] - depositedToken0: BigDecimal - depositedToken0_not: BigDecimal - depositedToken0_gt: BigDecimal - depositedToken0_lt: BigDecimal - depositedToken0_gte: BigDecimal - depositedToken0_lte: BigDecimal - depositedToken0_in: [BigDecimal!] - depositedToken0_not_in: [BigDecimal!] - depositedToken1: BigDecimal - depositedToken1_not: BigDecimal - depositedToken1_gt: BigDecimal - depositedToken1_lt: BigDecimal - depositedToken1_gte: BigDecimal - depositedToken1_lte: BigDecimal - depositedToken1_in: [BigDecimal!] - depositedToken1_not_in: [BigDecimal!] - withdrawnToken0: BigDecimal - withdrawnToken0_not: BigDecimal - withdrawnToken0_gt: BigDecimal - withdrawnToken0_lt: BigDecimal - withdrawnToken0_gte: BigDecimal - withdrawnToken0_lte: BigDecimal - withdrawnToken0_in: [BigDecimal!] - withdrawnToken0_not_in: [BigDecimal!] - withdrawnToken1: BigDecimal - withdrawnToken1_not: BigDecimal - withdrawnToken1_gt: BigDecimal - withdrawnToken1_lt: BigDecimal - withdrawnToken1_gte: BigDecimal - withdrawnToken1_lte: BigDecimal - withdrawnToken1_in: [BigDecimal!] - withdrawnToken1_not_in: [BigDecimal!] - collectedToken0: BigDecimal - collectedToken0_not: BigDecimal - collectedToken0_gt: BigDecimal - collectedToken0_lt: BigDecimal - collectedToken0_gte: BigDecimal - collectedToken0_lte: BigDecimal - collectedToken0_in: [BigDecimal!] - collectedToken0_not_in: [BigDecimal!] - collectedToken1: BigDecimal - collectedToken1_not: BigDecimal - collectedToken1_gt: BigDecimal - collectedToken1_lt: BigDecimal - collectedToken1_gte: BigDecimal - collectedToken1_lte: BigDecimal - collectedToken1_in: [BigDecimal!] - collectedToken1_not_in: [BigDecimal!] - collectedFeesToken0: BigDecimal - collectedFeesToken0_not: BigDecimal - collectedFeesToken0_gt: BigDecimal - collectedFeesToken0_lt: BigDecimal - collectedFeesToken0_gte: BigDecimal - collectedFeesToken0_lte: BigDecimal - collectedFeesToken0_in: [BigDecimal!] - collectedFeesToken0_not_in: [BigDecimal!] - collectedFeesToken1: BigDecimal - collectedFeesToken1_not: BigDecimal - collectedFeesToken1_gt: BigDecimal - collectedFeesToken1_lt: BigDecimal - collectedFeesToken1_gte: BigDecimal - collectedFeesToken1_lte: BigDecimal - collectedFeesToken1_in: [BigDecimal!] - collectedFeesToken1_not_in: [BigDecimal!] - amountDepositedUSD: BigDecimal - amountDepositedUSD_not: BigDecimal - amountDepositedUSD_gt: BigDecimal - amountDepositedUSD_lt: BigDecimal - amountDepositedUSD_gte: BigDecimal - amountDepositedUSD_lte: BigDecimal - amountDepositedUSD_in: [BigDecimal!] - amountDepositedUSD_not_in: [BigDecimal!] - amountWithdrawnUSD: BigDecimal - amountWithdrawnUSD_not: BigDecimal - amountWithdrawnUSD_gt: BigDecimal - amountWithdrawnUSD_lt: BigDecimal - amountWithdrawnUSD_gte: BigDecimal - amountWithdrawnUSD_lte: BigDecimal - amountWithdrawnUSD_in: [BigDecimal!] - amountWithdrawnUSD_not_in: [BigDecimal!] - amountCollectedUSD: BigDecimal - amountCollectedUSD_not: BigDecimal - amountCollectedUSD_gt: BigDecimal - amountCollectedUSD_lt: BigDecimal - amountCollectedUSD_gte: BigDecimal - amountCollectedUSD_lte: BigDecimal - amountCollectedUSD_in: [BigDecimal!] - amountCollectedUSD_not_in: [BigDecimal!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - feeGrowthInside0LastX128: BigInt - feeGrowthInside0LastX128_not: BigInt - feeGrowthInside0LastX128_gt: BigInt - feeGrowthInside0LastX128_lt: BigInt - feeGrowthInside0LastX128_gte: BigInt - feeGrowthInside0LastX128_lte: BigInt - feeGrowthInside0LastX128_in: [BigInt!] - feeGrowthInside0LastX128_not_in: [BigInt!] - feeGrowthInside1LastX128: BigInt - feeGrowthInside1LastX128_not: BigInt - feeGrowthInside1LastX128_gt: BigInt - feeGrowthInside1LastX128_lt: BigInt - feeGrowthInside1LastX128_gte: BigInt - feeGrowthInside1LastX128_lte: BigInt - feeGrowthInside1LastX128_in: [BigInt!] - feeGrowthInside1LastX128_not_in: [BigInt!] - increaseEvents_: IncreaseEvent_filter - decreaseEvents_: IncreaseEvent_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Position_filter] - or: [Position_filter] -} - -enum Position_orderBy { - id - owner - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - tickLower - tickLower__id - tickLower__poolAddress - tickLower__tickIdx - tickLower__liquidityGross - tickLower__liquidityNet - tickLower__price0 - tickLower__price1 - tickLower__volumeToken0 - tickLower__volumeToken1 - tickLower__volumeUSD - tickLower__untrackedVolumeUSD - tickLower__feesUSD - tickLower__collectedFeesToken0 - tickLower__collectedFeesToken1 - tickLower__collectedFeesUSD - tickLower__createdAtTimestamp - tickLower__createdAtBlockNumber - tickLower__liquidityProviderCount - tickLower__feeGrowthOutside0X128 - tickLower__feeGrowthOutside1X128 - tickUpper - tickUpper__id - tickUpper__poolAddress - tickUpper__tickIdx - tickUpper__liquidityGross - tickUpper__liquidityNet - tickUpper__price0 - tickUpper__price1 - tickUpper__volumeToken0 - tickUpper__volumeToken1 - tickUpper__volumeUSD - tickUpper__untrackedVolumeUSD - tickUpper__feesUSD - tickUpper__collectedFeesToken0 - tickUpper__collectedFeesToken1 - tickUpper__collectedFeesUSD - tickUpper__createdAtTimestamp - tickUpper__createdAtBlockNumber - tickUpper__liquidityProviderCount - tickUpper__feeGrowthOutside0X128 - tickUpper__feeGrowthOutside1X128 - liquidity - depositedToken0 - depositedToken1 - withdrawnToken0 - withdrawnToken1 - collectedToken0 - collectedToken1 - collectedFeesToken0 - collectedFeesToken1 - amountDepositedUSD - amountWithdrawnUSD - amountCollectedUSD - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - feeGrowthInside0LastX128 - feeGrowthInside1LastX128 - increaseEvents - decreaseEvents -} - -type Query { - factory( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Factory - factories( - skip: Int = 0 - first: Int = 100 - orderBy: Factory_orderBy - orderDirection: OrderDirection - where: Factory_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Factory!]! - bundle( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Bundle - bundles( - skip: Int = 0 - first: Int = 100 - orderBy: Bundle_orderBy - orderDirection: OrderDirection - where: Bundle_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Bundle!]! - token( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Token - tokens( - skip: Int = 0 - first: Int = 100 - orderBy: Token_orderBy - orderDirection: OrderDirection - where: Token_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Token!]! - pool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pool - pools( - skip: Int = 0 - first: Int = 100 - orderBy: Pool_orderBy - orderDirection: OrderDirection - where: Pool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pool!]! - tick( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Tick - ticks( - skip: Int = 0 - first: Int = 100 - orderBy: Tick_orderBy - orderDirection: OrderDirection - where: Tick_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Tick!]! - position( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Position - positions( - skip: Int = 0 - first: Int = 100 - orderBy: Position_orderBy - orderDirection: OrderDirection - where: Position_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Position!]! - positionSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PositionSnapshot - positionSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PositionSnapshot_orderBy - orderDirection: OrderDirection - where: PositionSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PositionSnapshot!]! - transaction( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Transaction - transactions( - skip: Int = 0 - first: Int = 100 - orderBy: Transaction_orderBy - orderDirection: OrderDirection - where: Transaction_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Transaction!]! - mint( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Mint - mints( - skip: Int = 0 - first: Int = 100 - orderBy: Mint_orderBy - orderDirection: OrderDirection - where: Mint_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Mint!]! - burn( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Burn - burns( - skip: Int = 0 - first: Int = 100 - orderBy: Burn_orderBy - orderDirection: OrderDirection - where: Burn_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Burn!]! - swap( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Swap - swaps( - skip: Int = 0 - first: Int = 100 - orderBy: Swap_orderBy - orderDirection: OrderDirection - where: Swap_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Swap!]! - collect( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Collect - collects( - skip: Int = 0 - first: Int = 100 - orderBy: Collect_orderBy - orderDirection: OrderDirection - where: Collect_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Collect!]! - flash( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Flash - flashes( - skip: Int = 0 - first: Int = 100 - orderBy: Flash_orderBy - orderDirection: OrderDirection - where: Flash_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Flash!]! - uniswapDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): UniswapDayData - uniswapDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: UniswapDayData_orderBy - orderDirection: OrderDirection - where: UniswapDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [UniswapDayData!]! - poolDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PoolDayData - poolDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PoolDayData_orderBy - orderDirection: OrderDirection - where: PoolDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PoolDayData!]! - poolHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PoolHourData - poolHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PoolHourData_orderBy - orderDirection: OrderDirection - where: PoolHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PoolHourData!]! - tickHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TickHourData - tickHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TickHourData_orderBy - orderDirection: OrderDirection - where: TickHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TickHourData!]! - tickDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TickDayData - tickDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TickDayData_orderBy - orderDirection: OrderDirection - where: TickDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TickDayData!]! - tokenDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TokenDayData - tokenDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TokenDayData_orderBy - orderDirection: OrderDirection - where: TokenDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TokenDayData!]! - tokenHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TokenHourData - tokenHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TokenHourData_orderBy - orderDirection: OrderDirection - where: TokenHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TokenHourData!]! - increaseEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): IncreaseEvent - increaseEvents( - skip: Int = 0 - first: Int = 100 - orderBy: IncreaseEvent_orderBy - orderDirection: OrderDirection - where: IncreaseEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [IncreaseEvent!]! - decreaseEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): DecreaseEvent - decreaseEvents( - skip: Int = 0 - first: Int = 100 - orderBy: DecreaseEvent_orderBy - orderDirection: OrderDirection - where: DecreaseEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [DecreaseEvent!]! - setProtocolFeeEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): SetProtocolFeeEvent - setProtocolFeeEvents( - skip: Int = 0 - first: Int = 100 - orderBy: SetProtocolFeeEvent_orderBy - orderDirection: OrderDirection - where: SetProtocolFeeEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [SetProtocolFeeEvent!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type SetProtocolFeeEvent { - id: ID! - pool: Pool! - logIndex: BigInt! - new0: BigInt! - new1: BigInt! - old0: BigInt! - old1: BigInt! - timestamp: BigInt! -} - -input SetProtocolFeeEvent_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - new0: BigInt - new0_not: BigInt - new0_gt: BigInt - new0_lt: BigInt - new0_gte: BigInt - new0_lte: BigInt - new0_in: [BigInt!] - new0_not_in: [BigInt!] - new1: BigInt - new1_not: BigInt - new1_gt: BigInt - new1_lt: BigInt - new1_gte: BigInt - new1_lte: BigInt - new1_in: [BigInt!] - new1_not_in: [BigInt!] - old0: BigInt - old0_not: BigInt - old0_gt: BigInt - old0_lt: BigInt - old0_gte: BigInt - old0_lte: BigInt - old0_in: [BigInt!] - old0_not_in: [BigInt!] - old1: BigInt - old1_not: BigInt - old1_gt: BigInt - old1_lt: BigInt - old1_gte: BigInt - old1_lte: BigInt - old1_in: [BigInt!] - old1_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [SetProtocolFeeEvent_filter] - or: [SetProtocolFeeEvent_filter] -} - -enum SetProtocolFeeEvent_orderBy { - id - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - logIndex - new0 - new1 - old0 - old1 - timestamp -} - -type Subscription { - factory( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Factory - factories( - skip: Int = 0 - first: Int = 100 - orderBy: Factory_orderBy - orderDirection: OrderDirection - where: Factory_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Factory!]! - bundle( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Bundle - bundles( - skip: Int = 0 - first: Int = 100 - orderBy: Bundle_orderBy - orderDirection: OrderDirection - where: Bundle_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Bundle!]! - token( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Token - tokens( - skip: Int = 0 - first: Int = 100 - orderBy: Token_orderBy - orderDirection: OrderDirection - where: Token_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Token!]! - pool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pool - pools( - skip: Int = 0 - first: Int = 100 - orderBy: Pool_orderBy - orderDirection: OrderDirection - where: Pool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pool!]! - tick( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Tick - ticks( - skip: Int = 0 - first: Int = 100 - orderBy: Tick_orderBy - orderDirection: OrderDirection - where: Tick_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Tick!]! - position( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Position - positions( - skip: Int = 0 - first: Int = 100 - orderBy: Position_orderBy - orderDirection: OrderDirection - where: Position_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Position!]! - positionSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PositionSnapshot - positionSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PositionSnapshot_orderBy - orderDirection: OrderDirection - where: PositionSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PositionSnapshot!]! - transaction( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Transaction - transactions( - skip: Int = 0 - first: Int = 100 - orderBy: Transaction_orderBy - orderDirection: OrderDirection - where: Transaction_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Transaction!]! - mint( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Mint - mints( - skip: Int = 0 - first: Int = 100 - orderBy: Mint_orderBy - orderDirection: OrderDirection - where: Mint_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Mint!]! - burn( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Burn - burns( - skip: Int = 0 - first: Int = 100 - orderBy: Burn_orderBy - orderDirection: OrderDirection - where: Burn_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Burn!]! - swap( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Swap - swaps( - skip: Int = 0 - first: Int = 100 - orderBy: Swap_orderBy - orderDirection: OrderDirection - where: Swap_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Swap!]! - collect( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Collect - collects( - skip: Int = 0 - first: Int = 100 - orderBy: Collect_orderBy - orderDirection: OrderDirection - where: Collect_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Collect!]! - flash( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Flash - flashes( - skip: Int = 0 - first: Int = 100 - orderBy: Flash_orderBy - orderDirection: OrderDirection - where: Flash_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Flash!]! - uniswapDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): UniswapDayData - uniswapDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: UniswapDayData_orderBy - orderDirection: OrderDirection - where: UniswapDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [UniswapDayData!]! - poolDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PoolDayData - poolDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PoolDayData_orderBy - orderDirection: OrderDirection - where: PoolDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PoolDayData!]! - poolHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PoolHourData - poolHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PoolHourData_orderBy - orderDirection: OrderDirection - where: PoolHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PoolHourData!]! - tickHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TickHourData - tickHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TickHourData_orderBy - orderDirection: OrderDirection - where: TickHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TickHourData!]! - tickDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TickDayData - tickDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TickDayData_orderBy - orderDirection: OrderDirection - where: TickDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TickDayData!]! - tokenDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TokenDayData - tokenDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TokenDayData_orderBy - orderDirection: OrderDirection - where: TokenDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TokenDayData!]! - tokenHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TokenHourData - tokenHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TokenHourData_orderBy - orderDirection: OrderDirection - where: TokenHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TokenHourData!]! - increaseEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): IncreaseEvent - increaseEvents( - skip: Int = 0 - first: Int = 100 - orderBy: IncreaseEvent_orderBy - orderDirection: OrderDirection - where: IncreaseEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [IncreaseEvent!]! - decreaseEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): DecreaseEvent - decreaseEvents( - skip: Int = 0 - first: Int = 100 - orderBy: DecreaseEvent_orderBy - orderDirection: OrderDirection - where: DecreaseEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [DecreaseEvent!]! - setProtocolFeeEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): SetProtocolFeeEvent - setProtocolFeeEvents( - skip: Int = 0 - first: Int = 100 - orderBy: SetProtocolFeeEvent_orderBy - orderDirection: OrderDirection - where: SetProtocolFeeEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [SetProtocolFeeEvent!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type Swap { - id: ID! - transaction: Transaction! - timestamp: BigInt! - pool: Pool! - token0: Token! - token1: Token! - sender: Bytes! - recipient: Bytes! - origin: Bytes! - amount0: BigDecimal! - amount1: BigDecimal! - amountUSD: BigDecimal! - sqrtPriceX96: BigInt! - tick: BigInt! - logIndex: BigInt -} - -input Swap_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - sender: Bytes - sender_not: Bytes - sender_gt: Bytes - sender_lt: Bytes - sender_gte: Bytes - sender_lte: Bytes - sender_in: [Bytes!] - sender_not_in: [Bytes!] - sender_contains: Bytes - sender_not_contains: Bytes - recipient: Bytes - recipient_not: Bytes - recipient_gt: Bytes - recipient_lt: Bytes - recipient_gte: Bytes - recipient_lte: Bytes - recipient_in: [Bytes!] - recipient_not_in: [Bytes!] - recipient_contains: Bytes - recipient_not_contains: Bytes - origin: Bytes - origin_not: Bytes - origin_gt: Bytes - origin_lt: Bytes - origin_gte: Bytes - origin_lte: Bytes - origin_in: [Bytes!] - origin_not_in: [Bytes!] - origin_contains: Bytes - origin_not_contains: Bytes - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - sqrtPriceX96: BigInt - sqrtPriceX96_not: BigInt - sqrtPriceX96_gt: BigInt - sqrtPriceX96_lt: BigInt - sqrtPriceX96_gte: BigInt - sqrtPriceX96_lte: BigInt - sqrtPriceX96_in: [BigInt!] - sqrtPriceX96_not_in: [BigInt!] - tick: BigInt - tick_not: BigInt - tick_gt: BigInt - tick_lt: BigInt - tick_gte: BigInt - tick_lte: BigInt - tick_in: [BigInt!] - tick_not_in: [BigInt!] - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Swap_filter] - or: [Swap_filter] -} - -enum Swap_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - timestamp - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - sender - recipient - origin - amount0 - amount1 - amountUSD - sqrtPriceX96 - tick - logIndex -} - -type Tick { - id: ID! - poolAddress: String - tickIdx: BigInt! - pool: Pool! - liquidityGross: BigInt! - liquidityNet: BigInt! - price0: BigDecimal! - price1: BigDecimal! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - feesUSD: BigDecimal! - collectedFeesToken0: BigDecimal! - collectedFeesToken1: BigDecimal! - collectedFeesUSD: BigDecimal! - createdAtTimestamp: BigInt! - createdAtBlockNumber: BigInt! - liquidityProviderCount: BigInt! - feeGrowthOutside0X128: BigInt! - feeGrowthOutside1X128: BigInt! -} - -type TickDayData { - id: ID! - date: Int! - pool: Pool! - tick: Tick! - liquidityGross: BigInt! - liquidityNet: BigInt! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - feesUSD: BigDecimal! - feeGrowthOutside0X128: BigInt! - feeGrowthOutside1X128: BigInt! -} - -input TickDayData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - tick: String - tick_not: String - tick_gt: String - tick_lt: String - tick_gte: String - tick_lte: String - tick_in: [String!] - tick_not_in: [String!] - tick_contains: String - tick_contains_nocase: String - tick_not_contains: String - tick_not_contains_nocase: String - tick_starts_with: String - tick_starts_with_nocase: String - tick_not_starts_with: String - tick_not_starts_with_nocase: String - tick_ends_with: String - tick_ends_with_nocase: String - tick_not_ends_with: String - tick_not_ends_with_nocase: String - tick_: Tick_filter - liquidityGross: BigInt - liquidityGross_not: BigInt - liquidityGross_gt: BigInt - liquidityGross_lt: BigInt - liquidityGross_gte: BigInt - liquidityGross_lte: BigInt - liquidityGross_in: [BigInt!] - liquidityGross_not_in: [BigInt!] - liquidityNet: BigInt - liquidityNet_not: BigInt - liquidityNet_gt: BigInt - liquidityNet_lt: BigInt - liquidityNet_gte: BigInt - liquidityNet_lte: BigInt - liquidityNet_in: [BigInt!] - liquidityNet_not_in: [BigInt!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - feeGrowthOutside0X128: BigInt - feeGrowthOutside0X128_not: BigInt - feeGrowthOutside0X128_gt: BigInt - feeGrowthOutside0X128_lt: BigInt - feeGrowthOutside0X128_gte: BigInt - feeGrowthOutside0X128_lte: BigInt - feeGrowthOutside0X128_in: [BigInt!] - feeGrowthOutside0X128_not_in: [BigInt!] - feeGrowthOutside1X128: BigInt - feeGrowthOutside1X128_not: BigInt - feeGrowthOutside1X128_gt: BigInt - feeGrowthOutside1X128_lt: BigInt - feeGrowthOutside1X128_gte: BigInt - feeGrowthOutside1X128_lte: BigInt - feeGrowthOutside1X128_in: [BigInt!] - feeGrowthOutside1X128_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [TickDayData_filter] - or: [TickDayData_filter] -} - -enum TickDayData_orderBy { - id - date - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - tick - tick__id - tick__poolAddress - tick__tickIdx - tick__liquidityGross - tick__liquidityNet - tick__price0 - tick__price1 - tick__volumeToken0 - tick__volumeToken1 - tick__volumeUSD - tick__untrackedVolumeUSD - tick__feesUSD - tick__collectedFeesToken0 - tick__collectedFeesToken1 - tick__collectedFeesUSD - tick__createdAtTimestamp - tick__createdAtBlockNumber - tick__liquidityProviderCount - tick__feeGrowthOutside0X128 - tick__feeGrowthOutside1X128 - liquidityGross - liquidityNet - volumeToken0 - volumeToken1 - volumeUSD - feesUSD - feeGrowthOutside0X128 - feeGrowthOutside1X128 -} - -type TickHourData { - id: ID! - periodStartUnix: Int! - pool: Pool! - tick: Tick! - liquidityGross: BigInt! - liquidityNet: BigInt! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - feesUSD: BigDecimal! -} - -input TickHourData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - periodStartUnix: Int - periodStartUnix_not: Int - periodStartUnix_gt: Int - periodStartUnix_lt: Int - periodStartUnix_gte: Int - periodStartUnix_lte: Int - periodStartUnix_in: [Int!] - periodStartUnix_not_in: [Int!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - tick: String - tick_not: String - tick_gt: String - tick_lt: String - tick_gte: String - tick_lte: String - tick_in: [String!] - tick_not_in: [String!] - tick_contains: String - tick_contains_nocase: String - tick_not_contains: String - tick_not_contains_nocase: String - tick_starts_with: String - tick_starts_with_nocase: String - tick_not_starts_with: String - tick_not_starts_with_nocase: String - tick_ends_with: String - tick_ends_with_nocase: String - tick_not_ends_with: String - tick_not_ends_with_nocase: String - tick_: Tick_filter - liquidityGross: BigInt - liquidityGross_not: BigInt - liquidityGross_gt: BigInt - liquidityGross_lt: BigInt - liquidityGross_gte: BigInt - liquidityGross_lte: BigInt - liquidityGross_in: [BigInt!] - liquidityGross_not_in: [BigInt!] - liquidityNet: BigInt - liquidityNet_not: BigInt - liquidityNet_gt: BigInt - liquidityNet_lt: BigInt - liquidityNet_gte: BigInt - liquidityNet_lte: BigInt - liquidityNet_in: [BigInt!] - liquidityNet_not_in: [BigInt!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [TickHourData_filter] - or: [TickHourData_filter] -} - -enum TickHourData_orderBy { - id - periodStartUnix - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - tick - tick__id - tick__poolAddress - tick__tickIdx - tick__liquidityGross - tick__liquidityNet - tick__price0 - tick__price1 - tick__volumeToken0 - tick__volumeToken1 - tick__volumeUSD - tick__untrackedVolumeUSD - tick__feesUSD - tick__collectedFeesToken0 - tick__collectedFeesToken1 - tick__collectedFeesUSD - tick__createdAtTimestamp - tick__createdAtBlockNumber - tick__liquidityProviderCount - tick__feeGrowthOutside0X128 - tick__feeGrowthOutside1X128 - liquidityGross - liquidityNet - volumeToken0 - volumeToken1 - volumeUSD - feesUSD -} - -input Tick_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - poolAddress: String - poolAddress_not: String - poolAddress_gt: String - poolAddress_lt: String - poolAddress_gte: String - poolAddress_lte: String - poolAddress_in: [String!] - poolAddress_not_in: [String!] - poolAddress_contains: String - poolAddress_contains_nocase: String - poolAddress_not_contains: String - poolAddress_not_contains_nocase: String - poolAddress_starts_with: String - poolAddress_starts_with_nocase: String - poolAddress_not_starts_with: String - poolAddress_not_starts_with_nocase: String - poolAddress_ends_with: String - poolAddress_ends_with_nocase: String - poolAddress_not_ends_with: String - poolAddress_not_ends_with_nocase: String - tickIdx: BigInt - tickIdx_not: BigInt - tickIdx_gt: BigInt - tickIdx_lt: BigInt - tickIdx_gte: BigInt - tickIdx_lte: BigInt - tickIdx_in: [BigInt!] - tickIdx_not_in: [BigInt!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - liquidityGross: BigInt - liquidityGross_not: BigInt - liquidityGross_gt: BigInt - liquidityGross_lt: BigInt - liquidityGross_gte: BigInt - liquidityGross_lte: BigInt - liquidityGross_in: [BigInt!] - liquidityGross_not_in: [BigInt!] - liquidityNet: BigInt - liquidityNet_not: BigInt - liquidityNet_gt: BigInt - liquidityNet_lt: BigInt - liquidityNet_gte: BigInt - liquidityNet_lte: BigInt - liquidityNet_in: [BigInt!] - liquidityNet_not_in: [BigInt!] - price0: BigDecimal - price0_not: BigDecimal - price0_gt: BigDecimal - price0_lt: BigDecimal - price0_gte: BigDecimal - price0_lte: BigDecimal - price0_in: [BigDecimal!] - price0_not_in: [BigDecimal!] - price1: BigDecimal - price1_not: BigDecimal - price1_gt: BigDecimal - price1_lt: BigDecimal - price1_gte: BigDecimal - price1_lte: BigDecimal - price1_in: [BigDecimal!] - price1_not_in: [BigDecimal!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - collectedFeesToken0: BigDecimal - collectedFeesToken0_not: BigDecimal - collectedFeesToken0_gt: BigDecimal - collectedFeesToken0_lt: BigDecimal - collectedFeesToken0_gte: BigDecimal - collectedFeesToken0_lte: BigDecimal - collectedFeesToken0_in: [BigDecimal!] - collectedFeesToken0_not_in: [BigDecimal!] - collectedFeesToken1: BigDecimal - collectedFeesToken1_not: BigDecimal - collectedFeesToken1_gt: BigDecimal - collectedFeesToken1_lt: BigDecimal - collectedFeesToken1_gte: BigDecimal - collectedFeesToken1_lte: BigDecimal - collectedFeesToken1_in: [BigDecimal!] - collectedFeesToken1_not_in: [BigDecimal!] - collectedFeesUSD: BigDecimal - collectedFeesUSD_not: BigDecimal - collectedFeesUSD_gt: BigDecimal - collectedFeesUSD_lt: BigDecimal - collectedFeesUSD_gte: BigDecimal - collectedFeesUSD_lte: BigDecimal - collectedFeesUSD_in: [BigDecimal!] - collectedFeesUSD_not_in: [BigDecimal!] - createdAtTimestamp: BigInt - createdAtTimestamp_not: BigInt - createdAtTimestamp_gt: BigInt - createdAtTimestamp_lt: BigInt - createdAtTimestamp_gte: BigInt - createdAtTimestamp_lte: BigInt - createdAtTimestamp_in: [BigInt!] - createdAtTimestamp_not_in: [BigInt!] - createdAtBlockNumber: BigInt - createdAtBlockNumber_not: BigInt - createdAtBlockNumber_gt: BigInt - createdAtBlockNumber_lt: BigInt - createdAtBlockNumber_gte: BigInt - createdAtBlockNumber_lte: BigInt - createdAtBlockNumber_in: [BigInt!] - createdAtBlockNumber_not_in: [BigInt!] - liquidityProviderCount: BigInt - liquidityProviderCount_not: BigInt - liquidityProviderCount_gt: BigInt - liquidityProviderCount_lt: BigInt - liquidityProviderCount_gte: BigInt - liquidityProviderCount_lte: BigInt - liquidityProviderCount_in: [BigInt!] - liquidityProviderCount_not_in: [BigInt!] - feeGrowthOutside0X128: BigInt - feeGrowthOutside0X128_not: BigInt - feeGrowthOutside0X128_gt: BigInt - feeGrowthOutside0X128_lt: BigInt - feeGrowthOutside0X128_gte: BigInt - feeGrowthOutside0X128_lte: BigInt - feeGrowthOutside0X128_in: [BigInt!] - feeGrowthOutside0X128_not_in: [BigInt!] - feeGrowthOutside1X128: BigInt - feeGrowthOutside1X128_not: BigInt - feeGrowthOutside1X128_gt: BigInt - feeGrowthOutside1X128_lt: BigInt - feeGrowthOutside1X128_gte: BigInt - feeGrowthOutside1X128_lte: BigInt - feeGrowthOutside1X128_in: [BigInt!] - feeGrowthOutside1X128_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Tick_filter] - or: [Tick_filter] -} - -enum Tick_orderBy { - id - poolAddress - tickIdx - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - liquidityGross - liquidityNet - price0 - price1 - volumeToken0 - volumeToken1 - volumeUSD - untrackedVolumeUSD - feesUSD - collectedFeesToken0 - collectedFeesToken1 - collectedFeesUSD - createdAtTimestamp - createdAtBlockNumber - liquidityProviderCount - feeGrowthOutside0X128 - feeGrowthOutside1X128 -} - -"A string representation of microseconds UNIX timestamp (16 digits)\n" -scalar Timestamp - -type Token { - id: ID! - symbol: String! - name: String! - decimals: BigInt! - totalSupply: BigInt! - volume: BigDecimal! - volumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - feesUSD: BigDecimal! - txCount: BigInt! - poolCount: BigInt! - totalValueLocked: BigDecimal! - totalValueLockedUSD: BigDecimal! - totalValueLockedUSDUntracked: BigDecimal! - derivedETH: BigDecimal! - whitelistPools(skip: Int = 0, first: Int = 100, orderBy: Pool_orderBy, orderDirection: OrderDirection, where: Pool_filter): [Pool!]! - tokenDayData(skip: Int = 0, first: Int = 100, orderBy: TokenDayData_orderBy, orderDirection: OrderDirection, where: TokenDayData_filter): [TokenDayData!]! -} - -type TokenDayData { - id: ID! - date: Int! - token: Token! - volume: BigDecimal! - volumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - totalValueLocked: BigDecimal! - totalValueLockedUSD: BigDecimal! - priceUSD: BigDecimal! - feesUSD: BigDecimal! - open: BigDecimal! - high: BigDecimal! - low: BigDecimal! - close: BigDecimal! -} - -input TokenDayData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - token: String - token_not: String - token_gt: String - token_lt: String - token_gte: String - token_lte: String - token_in: [String!] - token_not_in: [String!] - token_contains: String - token_contains_nocase: String - token_not_contains: String - token_not_contains_nocase: String - token_starts_with: String - token_starts_with_nocase: String - token_not_starts_with: String - token_not_starts_with_nocase: String - token_ends_with: String - token_ends_with_nocase: String - token_not_ends_with: String - token_not_ends_with_nocase: String - token_: Token_filter - volume: BigDecimal - volume_not: BigDecimal - volume_gt: BigDecimal - volume_lt: BigDecimal - volume_gte: BigDecimal - volume_lte: BigDecimal - volume_in: [BigDecimal!] - volume_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - totalValueLocked: BigDecimal - totalValueLocked_not: BigDecimal - totalValueLocked_gt: BigDecimal - totalValueLocked_lt: BigDecimal - totalValueLocked_gte: BigDecimal - totalValueLocked_lte: BigDecimal - totalValueLocked_in: [BigDecimal!] - totalValueLocked_not_in: [BigDecimal!] - totalValueLockedUSD: BigDecimal - totalValueLockedUSD_not: BigDecimal - totalValueLockedUSD_gt: BigDecimal - totalValueLockedUSD_lt: BigDecimal - totalValueLockedUSD_gte: BigDecimal - totalValueLockedUSD_lte: BigDecimal - totalValueLockedUSD_in: [BigDecimal!] - totalValueLockedUSD_not_in: [BigDecimal!] - priceUSD: BigDecimal - priceUSD_not: BigDecimal - priceUSD_gt: BigDecimal - priceUSD_lt: BigDecimal - priceUSD_gte: BigDecimal - priceUSD_lte: BigDecimal - priceUSD_in: [BigDecimal!] - priceUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - open: BigDecimal - open_not: BigDecimal - open_gt: BigDecimal - open_lt: BigDecimal - open_gte: BigDecimal - open_lte: BigDecimal - open_in: [BigDecimal!] - open_not_in: [BigDecimal!] - high: BigDecimal - high_not: BigDecimal - high_gt: BigDecimal - high_lt: BigDecimal - high_gte: BigDecimal - high_lte: BigDecimal - high_in: [BigDecimal!] - high_not_in: [BigDecimal!] - low: BigDecimal - low_not: BigDecimal - low_gt: BigDecimal - low_lt: BigDecimal - low_gte: BigDecimal - low_lte: BigDecimal - low_in: [BigDecimal!] - low_not_in: [BigDecimal!] - close: BigDecimal - close_not: BigDecimal - close_gt: BigDecimal - close_lt: BigDecimal - close_gte: BigDecimal - close_lte: BigDecimal - close_in: [BigDecimal!] - close_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [TokenDayData_filter] - or: [TokenDayData_filter] -} - -enum TokenDayData_orderBy { - id - date - token - token__id - token__symbol - token__name - token__decimals - token__totalSupply - token__volume - token__volumeUSD - token__untrackedVolumeUSD - token__feesUSD - token__txCount - token__poolCount - token__totalValueLocked - token__totalValueLockedUSD - token__totalValueLockedUSDUntracked - token__derivedETH - volume - volumeUSD - untrackedVolumeUSD - totalValueLocked - totalValueLockedUSD - priceUSD - feesUSD - open - high - low - close -} - -type TokenHourData { - id: ID! - periodStartUnix: Int! - token: Token! - volume: BigDecimal! - volumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - totalValueLocked: BigDecimal! - totalValueLockedUSD: BigDecimal! - priceUSD: BigDecimal! - feesUSD: BigDecimal! - open: BigDecimal! - high: BigDecimal! - low: BigDecimal! - close: BigDecimal! -} - -input TokenHourData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - periodStartUnix: Int - periodStartUnix_not: Int - periodStartUnix_gt: Int - periodStartUnix_lt: Int - periodStartUnix_gte: Int - periodStartUnix_lte: Int - periodStartUnix_in: [Int!] - periodStartUnix_not_in: [Int!] - token: String - token_not: String - token_gt: String - token_lt: String - token_gte: String - token_lte: String - token_in: [String!] - token_not_in: [String!] - token_contains: String - token_contains_nocase: String - token_not_contains: String - token_not_contains_nocase: String - token_starts_with: String - token_starts_with_nocase: String - token_not_starts_with: String - token_not_starts_with_nocase: String - token_ends_with: String - token_ends_with_nocase: String - token_not_ends_with: String - token_not_ends_with_nocase: String - token_: Token_filter - volume: BigDecimal - volume_not: BigDecimal - volume_gt: BigDecimal - volume_lt: BigDecimal - volume_gte: BigDecimal - volume_lte: BigDecimal - volume_in: [BigDecimal!] - volume_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - totalValueLocked: BigDecimal - totalValueLocked_not: BigDecimal - totalValueLocked_gt: BigDecimal - totalValueLocked_lt: BigDecimal - totalValueLocked_gte: BigDecimal - totalValueLocked_lte: BigDecimal - totalValueLocked_in: [BigDecimal!] - totalValueLocked_not_in: [BigDecimal!] - totalValueLockedUSD: BigDecimal - totalValueLockedUSD_not: BigDecimal - totalValueLockedUSD_gt: BigDecimal - totalValueLockedUSD_lt: BigDecimal - totalValueLockedUSD_gte: BigDecimal - totalValueLockedUSD_lte: BigDecimal - totalValueLockedUSD_in: [BigDecimal!] - totalValueLockedUSD_not_in: [BigDecimal!] - priceUSD: BigDecimal - priceUSD_not: BigDecimal - priceUSD_gt: BigDecimal - priceUSD_lt: BigDecimal - priceUSD_gte: BigDecimal - priceUSD_lte: BigDecimal - priceUSD_in: [BigDecimal!] - priceUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - open: BigDecimal - open_not: BigDecimal - open_gt: BigDecimal - open_lt: BigDecimal - open_gte: BigDecimal - open_lte: BigDecimal - open_in: [BigDecimal!] - open_not_in: [BigDecimal!] - high: BigDecimal - high_not: BigDecimal - high_gt: BigDecimal - high_lt: BigDecimal - high_gte: BigDecimal - high_lte: BigDecimal - high_in: [BigDecimal!] - high_not_in: [BigDecimal!] - low: BigDecimal - low_not: BigDecimal - low_gt: BigDecimal - low_lt: BigDecimal - low_gte: BigDecimal - low_lte: BigDecimal - low_in: [BigDecimal!] - low_not_in: [BigDecimal!] - close: BigDecimal - close_not: BigDecimal - close_gt: BigDecimal - close_lt: BigDecimal - close_gte: BigDecimal - close_lte: BigDecimal - close_in: [BigDecimal!] - close_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [TokenHourData_filter] - or: [TokenHourData_filter] -} - -enum TokenHourData_orderBy { - id - periodStartUnix - token - token__id - token__symbol - token__name - token__decimals - token__totalSupply - token__volume - token__volumeUSD - token__untrackedVolumeUSD - token__feesUSD - token__txCount - token__poolCount - token__totalValueLocked - token__totalValueLockedUSD - token__totalValueLockedUSDUntracked - token__derivedETH - volume - volumeUSD - untrackedVolumeUSD - totalValueLocked - totalValueLockedUSD - priceUSD - feesUSD - open - high - low - close -} - -input Token_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - symbol: String - symbol_not: String - symbol_gt: String - symbol_lt: String - symbol_gte: String - symbol_lte: String - symbol_in: [String!] - symbol_not_in: [String!] - symbol_contains: String - symbol_contains_nocase: String - symbol_not_contains: String - symbol_not_contains_nocase: String - symbol_starts_with: String - symbol_starts_with_nocase: String - symbol_not_starts_with: String - symbol_not_starts_with_nocase: String - symbol_ends_with: String - symbol_ends_with_nocase: String - symbol_not_ends_with: String - symbol_not_ends_with_nocase: String - name: String - name_not: String - name_gt: String - name_lt: String - name_gte: String - name_lte: String - name_in: [String!] - name_not_in: [String!] - name_contains: String - name_contains_nocase: String - name_not_contains: String - name_not_contains_nocase: String - name_starts_with: String - name_starts_with_nocase: String - name_not_starts_with: String - name_not_starts_with_nocase: String - name_ends_with: String - name_ends_with_nocase: String - name_not_ends_with: String - name_not_ends_with_nocase: String - decimals: BigInt - decimals_not: BigInt - decimals_gt: BigInt - decimals_lt: BigInt - decimals_gte: BigInt - decimals_lte: BigInt - decimals_in: [BigInt!] - decimals_not_in: [BigInt!] - totalSupply: BigInt - totalSupply_not: BigInt - totalSupply_gt: BigInt - totalSupply_lt: BigInt - totalSupply_gte: BigInt - totalSupply_lte: BigInt - totalSupply_in: [BigInt!] - totalSupply_not_in: [BigInt!] - volume: BigDecimal - volume_not: BigDecimal - volume_gt: BigDecimal - volume_lt: BigDecimal - volume_gte: BigDecimal - volume_lte: BigDecimal - volume_in: [BigDecimal!] - volume_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - poolCount: BigInt - poolCount_not: BigInt - poolCount_gt: BigInt - poolCount_lt: BigInt - poolCount_gte: BigInt - poolCount_lte: BigInt - poolCount_in: [BigInt!] - poolCount_not_in: [BigInt!] - totalValueLocked: BigDecimal - totalValueLocked_not: BigDecimal - totalValueLocked_gt: BigDecimal - totalValueLocked_lt: BigDecimal - totalValueLocked_gte: BigDecimal - totalValueLocked_lte: BigDecimal - totalValueLocked_in: [BigDecimal!] - totalValueLocked_not_in: [BigDecimal!] - totalValueLockedUSD: BigDecimal - totalValueLockedUSD_not: BigDecimal - totalValueLockedUSD_gt: BigDecimal - totalValueLockedUSD_lt: BigDecimal - totalValueLockedUSD_gte: BigDecimal - totalValueLockedUSD_lte: BigDecimal - totalValueLockedUSD_in: [BigDecimal!] - totalValueLockedUSD_not_in: [BigDecimal!] - totalValueLockedUSDUntracked: BigDecimal - totalValueLockedUSDUntracked_not: BigDecimal - totalValueLockedUSDUntracked_gt: BigDecimal - totalValueLockedUSDUntracked_lt: BigDecimal - totalValueLockedUSDUntracked_gte: BigDecimal - totalValueLockedUSDUntracked_lte: BigDecimal - totalValueLockedUSDUntracked_in: [BigDecimal!] - totalValueLockedUSDUntracked_not_in: [BigDecimal!] - derivedETH: BigDecimal - derivedETH_not: BigDecimal - derivedETH_gt: BigDecimal - derivedETH_lt: BigDecimal - derivedETH_gte: BigDecimal - derivedETH_lte: BigDecimal - derivedETH_in: [BigDecimal!] - derivedETH_not_in: [BigDecimal!] - whitelistPools: [String!] - whitelistPools_not: [String!] - whitelistPools_contains: [String!] - whitelistPools_contains_nocase: [String!] - whitelistPools_not_contains: [String!] - whitelistPools_not_contains_nocase: [String!] - whitelistPools_: Pool_filter - tokenDayData_: TokenDayData_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Token_filter] - or: [Token_filter] -} - -enum Token_orderBy { - id - symbol - name - decimals - totalSupply - volume - volumeUSD - untrackedVolumeUSD - feesUSD - txCount - poolCount - totalValueLocked - totalValueLockedUSD - totalValueLockedUSDUntracked - derivedETH - whitelistPools - tokenDayData -} - -type Transaction { - id: ID! - blockNumber: BigInt! - timestamp: BigInt! - gasUsed: BigInt! - gasPrice: BigInt! - mints(skip: Int = 0, first: Int = 100, orderBy: Mint_orderBy, orderDirection: OrderDirection, where: Mint_filter): [Mint!]! - burns(skip: Int = 0, first: Int = 100, orderBy: Burn_orderBy, orderDirection: OrderDirection, where: Burn_filter): [Burn!]! - swaps(skip: Int = 0, first: Int = 100, orderBy: Swap_orderBy, orderDirection: OrderDirection, where: Swap_filter): [Swap!]! - flashed(skip: Int = 0, first: Int = 100, orderBy: Flash_orderBy, orderDirection: OrderDirection, where: Flash_filter): [Flash!]! - collects(skip: Int = 0, first: Int = 100, orderBy: Collect_orderBy, orderDirection: OrderDirection, where: Collect_filter): [Collect!]! -} - -input Transaction_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - blockNumber: BigInt - blockNumber_not: BigInt - blockNumber_gt: BigInt - blockNumber_lt: BigInt - blockNumber_gte: BigInt - blockNumber_lte: BigInt - blockNumber_in: [BigInt!] - blockNumber_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - gasUsed: BigInt - gasUsed_not: BigInt - gasUsed_gt: BigInt - gasUsed_lt: BigInt - gasUsed_gte: BigInt - gasUsed_lte: BigInt - gasUsed_in: [BigInt!] - gasUsed_not_in: [BigInt!] - gasPrice: BigInt - gasPrice_not: BigInt - gasPrice_gt: BigInt - gasPrice_lt: BigInt - gasPrice_gte: BigInt - gasPrice_lte: BigInt - gasPrice_in: [BigInt!] - gasPrice_not_in: [BigInt!] - mints_: Mint_filter - burns_: Burn_filter - swaps_: Swap_filter - flashed_: Flash_filter - collects_: Collect_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Transaction_filter] - or: [Transaction_filter] -} - -enum Transaction_orderBy { - id - blockNumber - timestamp - gasUsed - gasPrice - mints - burns - swaps - flashed - collects -} - -type UniswapDayData { - id: ID! - date: Int! - volumeETH: BigDecimal! - volumeUSD: BigDecimal! - volumeUSDUntracked: BigDecimal! - feesUSD: BigDecimal! - txCount: BigInt! - tvlUSD: BigDecimal! -} - -input UniswapDayData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - volumeETH: BigDecimal - volumeETH_not: BigDecimal - volumeETH_gt: BigDecimal - volumeETH_lt: BigDecimal - volumeETH_gte: BigDecimal - volumeETH_lte: BigDecimal - volumeETH_in: [BigDecimal!] - volumeETH_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - volumeUSDUntracked: BigDecimal - volumeUSDUntracked_not: BigDecimal - volumeUSDUntracked_gt: BigDecimal - volumeUSDUntracked_lt: BigDecimal - volumeUSDUntracked_gte: BigDecimal - volumeUSDUntracked_lte: BigDecimal - volumeUSDUntracked_in: [BigDecimal!] - volumeUSDUntracked_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - tvlUSD: BigDecimal - tvlUSD_not: BigDecimal - tvlUSD_gt: BigDecimal - tvlUSD_lt: BigDecimal - tvlUSD_gte: BigDecimal - tvlUSD_lte: BigDecimal - tvlUSD_in: [BigDecimal!] - tvlUSD_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [UniswapDayData_filter] - or: [UniswapDayData_filter] -} - -enum UniswapDayData_orderBy { - id - date - volumeETH - volumeUSD - volumeUSDUntracked - feesUSD - txCount - tvlUSD -} - -type _Block_ { - """The hash of the block""" - hash: Bytes - - """The block number""" - number: Int! - - """Integer representation of the timestamp stored in blocks for the chain""" - timestamp: Int - - """The hash of the parent block""" - parentHash: Bytes -} - -"""The type for the top-level _meta field""" -type _Meta_ { - "Information about a specific subgraph block. The hash of the block\nwill be null if the _meta field has a block constraint that asks for\na block number. It will be filled if the _meta field has no block constraint\nand therefore asks for the latest block\n" - block: _Block_! - - """The deployment ID""" - deployment: String! - - """If `true`, the subgraph encountered indexing errors at some past block""" - hasIndexingErrors: Boolean! -} - -enum _SubgraphErrorPolicy_ { - """Data will be returned even if the subgraph has indexing errors""" - allow - - """ - If the subgraph has indexing errors, data will be omitted. The default. - """ - deny -} \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/sushi-v3/transforms/bucket-v3-to-std.ts b/packages/graph-client/src/subgraphs/sushi-v3/transforms/bucket-v3-to-std.ts deleted file mode 100644 index a49e14b8ec..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/transforms/bucket-v3-to-std.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { ResultOf } from 'gql.tada' -import type { SushiV3PoolBucketsQuery } from 'src/subgraphs/sushi-v3/queries/pool-with-buckets' -import type { PoolBucket } from 'sushi/types' - -type FetchedBucket = NonNullable< - ResultOf['pool'] ->['poolHourData'][number] - -export function transformBucketsV3ToStd( - buckets: FetchedBucket[], -): PoolBucket[] { - return buckets.map(transformBucketV3ToStd) -} - -export function transformBucketV3ToStd(bucket: FetchedBucket): PoolBucket { - return { - id: bucket.id, - date: Number(bucket.date), - liquidityUSD: Number(bucket.liquidityUSD), - volumeUSD: Number(bucket.volumeUSD), - feesUSD: Number(bucket.feesUSD), - txCount: Number(bucket.txCount), - } -} diff --git a/packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts b/packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts deleted file mode 100644 index d59971cf54..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts +++ /dev/null @@ -1,97 +0,0 @@ -import type { ResultOf } from 'gql.tada' -import type { PoolFieldsFragment } from 'src/subgraphs/sushi-v3/fragments/pool-fields' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { - getIdFromChainIdAddress, - withoutScientificNotation, -} from 'sushi/format' -import { - type Address, - type PoolBase, - type PoolV3, - SushiSwapProtocol, -} from 'sushi/types' - -type ToPick = - | 'id' - | 'token0' - | 'token1' - | 'reserve0' - | 'reserve1' - | 'liquidityUSD' - | 'volumeUSD' - | 'txCount' - | 'swapFee' - | 'liquidity' - | 'feeGrowthGlobal0X128' - | 'feeGrowthGlobal1X128' - | 'observationIndex' - | 'sqrtPrice' - | 'tick' - | 'token0Price' - | 'token1Price' - -type RequiredBase = Pick, ToPick> - -export function transformPoolV3ToBase( - pool: T, - chainId: SushiSwapV3ChainId, -): PoolV3 { - const swapFee = Number(pool.swapFee) / 1000000 - - return { - id: getIdFromChainIdAddress(chainId, pool.id as Address), - address: pool.id as Address, - chainId, - name: `${pool.token0.symbol}-${pool.token1.symbol}`, - - swapFee: swapFee, - // twapEnabled: pool.twapEnabled, - - feeGrowthGlobal0X128: BigInt(pool.feeGrowthGlobal0X128), - feeGrowthGlobal1X128: BigInt(pool.feeGrowthGlobal1X128), - observationIndex: BigInt(pool.observationIndex), - sqrtPrice: BigInt(pool.sqrtPrice), - tick: BigInt(pool.tick ?? 0), - - protocol: SushiSwapProtocol.SUSHISWAP_V3, - - reserve0: BigInt( - withoutScientificNotation( - (Number(pool.reserve0) * 10 ** Number(pool.token0.decimals)).toFixed(), - )!, - ), - reserve1: BigInt( - withoutScientificNotation( - (Number(pool.reserve1) * 10 ** Number(pool.token1.decimals)).toFixed(), - )!, - ), - liquidity: BigInt(pool.liquidity), - liquidityUSD: Number(pool.liquidityUSD), - - volumeUSD: Number(pool.volumeUSD), - feesUSD: Number(pool.volumeUSD) * swapFee, - - token0: { - id: getIdFromChainIdAddress(chainId, pool.token0.id as Address), - address: pool.token0.id as Address, - chainId, - decimals: Number(pool.token0.decimals), - name: pool.token0.name, - symbol: pool.token0.symbol, - }, - token1: { - id: getIdFromChainIdAddress(chainId, pool.token1.id as Address), - address: pool.token1.id as Address, - chainId, - decimals: Number(pool.token1.decimals), - name: pool.token1.name, - symbol: pool.token1.symbol, - }, - - token0Price: Number(pool.token0Price), - token1Price: Number(pool.token1Price), - - txCount: Number(pool.txCount), - } -} diff --git a/packages/graph-client/tsconfig.json b/packages/graph-client/tsconfig.json index 087c1c8676..08f8548baa 100644 --- a/packages/graph-client/tsconfig.json +++ b/packages/graph-client/tsconfig.json @@ -17,12 +17,6 @@ { "name": "@0no-co/graphqlsp", "schemas": [ - { - "name": "blocks", - "schema": "./src/subgraphs/blocks/schema.graphql", - "tadaOutputLocation": "./src/subgraphs/blocks/blocks-env.d.ts", - "tadaTurboLocation": "./src/subgraphs/blocks/blocks-cache.d.ts" - }, { "name": "bonds", "schema": "./src/subgraphs/bonds/schema.graphql", @@ -47,48 +41,6 @@ "tadaOutputLocation": "./src/subgraphs/furo/furo-env.d.ts", "tadaTurboLocation": "./src/subgraphs/furo/furo-cache.d.ts" }, - { - "name": "master-chef-v1", - "schema": "./src/subgraphs/master-chef-v1/schema.graphql", - "tadaOutputLocation": "./src/subgraphs/master-chef-v1/master-chef-v1-env.d.ts", - "tadaTurboLocation": "./src/subgraphs/master-chef-v1/master-chef-v1-cache.d.ts" - }, - { - "name": "master-chef-v2", - "schema": "./src/subgraphs/master-chef-v2/schema.graphql", - "tadaOutputLocation": "./src/subgraphs/master-chef-v2/master-chef-v2-env.d.ts", - "tadaTurboLocation": "./src/subgraphs/master-chef-v2/master-chef-v2-cache.d.ts" - }, - { - "name": "mini-chef", - "schema": "./src/subgraphs/mini-chef/schema.graphql", - "tadaOutputLocation": "./src/subgraphs/mini-chef/mini-chef-env.d.ts", - "tadaTurboLocation": "./src/subgraphs/mini-chef/mini-chef-cache.d.ts" - }, - { - "name": "steer", - "schema": "./src/subgraphs/steer/schema.graphql", - "tadaOutputLocation": "./src/subgraphs/steer/steer-env.d.ts", - "tadaTurboLocation": "./src/subgraphs/steer/steer-cache.d.ts" - }, - { - "name": "sushi-bar", - "schema": "./src/subgraphs/sushi-bar/schema.graphql", - "tadaOutputLocation": "./src/subgraphs/sushi-bar/sushi-bar-env.d.ts", - "tadaTurboLocation": "./src/subgraphs/sushi-bar/sushi-bar-cache.d.ts" - }, - { - "name": "sushi-v2", - "schema": "./src/subgraphs/sushi-v2/schema.graphql", - "tadaOutputLocation": "./src/subgraphs/sushi-v2/sushi-v2-env.d.ts", - "tadaTurboLocation": "./src/subgraphs/sushi-v2/sushi-v2-cache.d.ts" - }, - { - "name": "sushi-v3", - "schema": "./src/subgraphs/sushi-v3/schema.graphql", - "tadaOutputLocation": "./src/subgraphs/sushi-v3/sushi-v3-env.d.ts", - "tadaTurboLocation": "./src/subgraphs/sushi-v3/sushi-v3-cache.d.ts" - }, { "name": "data-api", "schema": "./src/subgraphs/data-api/schema.graphql", diff --git a/packages/react-query/package.json b/packages/react-query/package.json index 24c3bf6643..9c302f84b6 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -53,6 +53,7 @@ }, "devDependencies": { "@sentry/nextjs": "7.110.0", + "@sushiswap/graph-client": "workspace:*", "@sushiswap/client": "workspace:*", "@sushiswap/database": "workspace:*", "@sushiswap/jest-config": "workspace:*", diff --git a/packages/react-query/src/hooks/pools/useConcentratedLiquidityPoolStats.ts b/packages/react-query/src/hooks/pools/useConcentratedLiquidityPoolStats.ts index e5dde6d5b4..7d4409857f 100644 --- a/packages/react-query/src/hooks/pools/useConcentratedLiquidityPoolStats.ts +++ b/packages/react-query/src/hooks/pools/useConcentratedLiquidityPoolStats.ts @@ -1,6 +1,5 @@ import '@sushiswap/database' - -import { getPool } from '@sushiswap/client' +import { getV3Pool } from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' import { ChainId } from 'sushi/chain' import { Amount, Token } from 'sushi/currency' @@ -22,7 +21,7 @@ export const useConcentratedLiquidityPoolStats = ({ queryFn: async () => { if (!chainId || !address) return undefined - const data = await getPool({ chainId, address }) + const data = await getV3Pool({ chainId: Number(chainId), address }) if (data) { return { ...data, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b72f7883ae..8b130fc093 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1094,97 +1094,6 @@ importers: specifier: 5.4.5 version: 5.4.5 - jobs/pool: - dependencies: - '@ethersproject/address': - specifier: 5.7.0 - version: 5.7.0 - '@ethersproject/bignumber': - specifier: 5.7.0 - version: 5.7.0 - '@sushiswap/bonds-sdk': - specifier: workspace:* - version: link:../../packages/bonds-sdk - '@sushiswap/client': - specifier: workspace:* - version: link:../../packages/client - '@sushiswap/database': - specifier: workspace:* - version: link:../../packages/database - '@sushiswap/graph-client': - specifier: workspace:* - version: link:../../packages/graph-client - '@sushiswap/steer-sdk': - specifier: workspace:* - version: link:../../packages/steer-sdk - '@sushiswap/wagmi-config': - specifier: workspace:* - version: link:../../config/wagmi - '@wagmi/core': - specifier: 2.10.6 - version: 2.10.6(@types/react@18.2.14)(react@18.2.0)(typescript@5.4.5)(viem@2.10.11)(zod@3.21.4) - '@whatwg-node/fetch': - specifier: 0.8.4 - version: 0.8.4 - connect-timeout: - specifier: 1.9.0 - version: 1.9.0 - date-fns: - specifier: 2.29.3 - version: 2.29.3 - ethers: - specifier: 5.7.2 - version: 5.7.2 - express: - specifier: 4.18.2 - version: 4.18.2 - lodash.zip: - specifier: 4.2.0 - version: 4.2.0 - sushi: - specifier: workspace:* - version: link:../../packages/sushi - tsx: - specifier: ^4.7.1 - version: 4.7.1 - viem: - specifier: 2.10.11 - version: 2.10.11(typescript@5.4.5)(zod@3.21.4) - zod: - specifier: 3.21.4 - version: 3.21.4 - devDependencies: - '@sushiswap/jest-config': - specifier: workspace:* - version: link:../../config/jest - '@swc/core': - specifier: 1.4.2 - version: 1.4.2(@swc/helpers@0.5.6) - '@swc/helpers': - specifier: 0.5.6 - version: 0.5.6 - '@tsconfig/esm': - specifier: 1.0.4 - version: 1.0.4 - '@tsconfig/node18': - specifier: 18.2.2 - version: 18.2.2 - '@types/connect-timeout': - specifier: 0.0.36 - version: 0.0.36 - '@types/express': - specifier: 4.17.15 - version: 4.17.15 - '@types/lodash.zip': - specifier: 4.2.7 - version: 4.2.7 - dotenv: - specifier: 16.0.3 - version: 16.0.3 - typescript: - specifier: 5.4.5 - version: 5.4.5 - packages/bonds-sdk: dependencies: react: @@ -1556,6 +1465,9 @@ importers: '@sushiswap/database': specifier: workspace:* version: link:../database + '@sushiswap/graph-client': + specifier: workspace:* + version: link:../graph-client '@sushiswap/jest-config': specifier: workspace:* version: link:../../config/jest @@ -16043,122 +15955,6 @@ packages: - supports-color dev: false - /@swc/core-darwin-arm64@1.4.2: - resolution: {integrity: sha512-1uSdAn1MRK5C1m/TvLZ2RDvr0zLvochgrZ2xL+lRzugLlCTlSA+Q4TWtrZaOz+vnnFVliCpw7c7qu0JouhgQIw==} - engines: {node: '>=10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@swc/core-darwin-x64@1.4.2: - resolution: {integrity: sha512-TYD28+dCQKeuxxcy7gLJUCFLqrwDZnHtC2z7cdeGfZpbI2mbfppfTf2wUPzqZk3gEC96zHd4Yr37V3Tvzar+lQ==} - engines: {node: '>=10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-arm-gnueabihf@1.4.2: - resolution: {integrity: sha512-Eyqipf7ZPGj0vplKHo8JUOoU1un2sg5PjJMpEesX0k+6HKE2T8pdyeyXODN0YTFqzndSa/J43EEPXm+rHAsLFQ==} - engines: {node: '>=10'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-arm64-gnu@1.4.2: - resolution: {integrity: sha512-wZn02DH8VYPv3FC0ub4my52Rttsus/rFw+UUfzdb3tHMHXB66LqN+rR0ssIOZrH6K+VLN6qpTw9VizjyoH0BxA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-arm64-musl@1.4.2: - resolution: {integrity: sha512-3G0D5z9hUj9bXNcwmA1eGiFTwe5rWkuL3DsoviTj73TKLpk7u64ND0XjEfO0huVv4vVu9H1jodrKb7nvln/dlw==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-x64-gnu@1.4.2: - resolution: {integrity: sha512-LFxn9U8cjmYHw3jrdPNqPAkBGglKE3tCZ8rA7hYyp0BFxuo7L2ZcEnPm4RFpmSCCsExFH+LEJWuMGgWERoktvg==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-x64-musl@1.4.2: - resolution: {integrity: sha512-dp0fAmreeVVYTUcb4u9njTPrYzKnbIH0EhH2qvC9GOYNNREUu2GezSIDgonjOXkHiTCvopG4xU7y56XtXj4VrQ==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@swc/core-win32-arm64-msvc@1.4.2: - resolution: {integrity: sha512-HlVIiLMQkzthAdqMslQhDkoXJ5+AOLUSTV6fm6shFKZKqc/9cJvr4S8UveNERL9zUficA36yM3bbfo36McwnvQ==} - engines: {node: '>=10'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@swc/core-win32-ia32-msvc@1.4.2: - resolution: {integrity: sha512-WCF8faPGjCl4oIgugkp+kL9nl3nUATlzKXCEGFowMEmVVCFM0GsqlmGdPp1pjZoWc9tpYanoXQDnp5IvlDSLhA==} - engines: {node: '>=10'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@swc/core-win32-x64-msvc@1.4.2: - resolution: {integrity: sha512-oV71rwiSpA5xre2C5570BhCsg1HF97SNLsZ/12xv7zayGzqr3yvFALFJN8tHKpqUdCB4FGPjoP3JFdV3i+1wUw==} - engines: {node: '>=10'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@swc/core@1.4.2(@swc/helpers@0.5.6): - resolution: {integrity: sha512-vWgY07R/eqj1/a0vsRKLI9o9klGZfpLNOVEnrv4nrccxBgYPjcf22IWwAoaBJ+wpA7Q4fVjCUM8lP0m01dpxcg==} - engines: {node: '>=10'} - requiresBuild: true - peerDependencies: - '@swc/helpers': ^0.5.0 - peerDependenciesMeta: - '@swc/helpers': - optional: true - dependencies: - '@swc/counter': 0.1.3 - '@swc/helpers': 0.5.6 - '@swc/types': 0.1.6 - optionalDependencies: - '@swc/core-darwin-arm64': 1.4.2 - '@swc/core-darwin-x64': 1.4.2 - '@swc/core-linux-arm-gnueabihf': 1.4.2 - '@swc/core-linux-arm64-gnu': 1.4.2 - '@swc/core-linux-arm64-musl': 1.4.2 - '@swc/core-linux-x64-gnu': 1.4.2 - '@swc/core-linux-x64-musl': 1.4.2 - '@swc/core-win32-arm64-msvc': 1.4.2 - '@swc/core-win32-ia32-msvc': 1.4.2 - '@swc/core-win32-x64-msvc': 1.4.2 - dev: true - /@swc/counter@0.1.3: resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} @@ -16168,18 +15964,6 @@ packages: '@swc/counter': 0.1.3 tslib: 2.6.3 - /@swc/helpers@0.5.6: - resolution: {integrity: sha512-aYX01Ke9hunpoCexYAgQucEpARGQ5w/cqHFrIR+e9gdKb1QWTsVJuTJ2ozQzIAxLyRQe/m+2RqzkyOOGiMKRQA==} - dependencies: - tslib: 2.6.2 - dev: true - - /@swc/types@0.1.6: - resolution: {integrity: sha512-/JLo/l2JsT/LRd80C3HfbmVpxOAJ11FO2RCEslFrgzLltoP9j8XIbsyDcfCt2WWyX+CM96rBoNM+IToAkFOugg==} - dependencies: - '@swc/counter': 0.1.3 - dev: true - /@szmarczak/http-timer@1.1.2: resolution: {integrity: sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==} engines: {node: '>=6'} @@ -16599,12 +16383,6 @@ packages: '@types/node': 20.12.7 dev: false - /@types/connect-timeout@0.0.36: - resolution: {integrity: sha512-rfw+RJU9gd0JeOJSkfRVixCETnw1ezx6Uo3exetKBeIKY4GaL/MVb4XCjmB4dgeZQ5vkcLlpYLVSbYIeqDu25g==} - dependencies: - '@types/express': 4.17.17 - dev: true - /@types/connect@3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: @@ -16899,15 +16677,6 @@ packages: '@types/range-parser': 1.2.4 '@types/send': 0.17.1 - /@types/express@4.17.15: - resolution: {integrity: sha512-Yv0k4bXGOH+8a+7bELd2PqHQsuiANB+A8a4gnQrkRWzrkKlb6KHaVvyXhqs04sVW/OWlbPyYxRgYlIXLfrufMQ==} - dependencies: - '@types/body-parser': 1.19.2 - '@types/express-serve-static-core': 4.17.35 - '@types/qs': 6.9.8 - '@types/serve-static': 1.15.2 - dev: true - /@types/express@4.17.17: resolution: {integrity: sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==} dependencies: @@ -17104,12 +16873,6 @@ packages: '@types/lodash': 4.14.197 dev: true - /@types/lodash.zip@4.2.7: - resolution: {integrity: sha512-wRtK2bZ0HYXkJkeldrD35qOquGn5GOmp8+o886N18Aqw2DGFLP7JCTEb00j3xQZ+PCMTyfMS2OMbLUwah+bcyg==} - dependencies: - '@types/lodash': 4.14.197 - dev: true - /@types/lodash.zip@4.2.9: resolution: {integrity: sha512-cJvqtEzLgHUPF6H6v7K6Q/yIc1DAYpsUkHD1Q7bUOAcCE0b7drzoUMi/Toj0MjQI3WeM6rI6v295mkenAQ+R7A==} dependencies: @@ -22646,16 +22409,6 @@ packages: engines: {node: '>=0.8'} dev: false - /connect-timeout@1.9.0: - resolution: {integrity: sha512-q4bsBIPd+eSGtnh/u6EBOKfuG+4YvwsN0idlOsg6KAw71Qpi0DCf2eCc/Va63QU9qdOeYC8katxoC+rHMNygZg==} - engines: {node: '>= 0.8'} - dependencies: - http-errors: 1.6.3 - ms: 2.0.0 - on-finished: 2.3.0 - on-headers: 1.0.2 - dev: false - /connect@3.7.0: resolution: {integrity: sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==} engines: {node: '>= 0.10.0'} @@ -23610,11 +23363,6 @@ packages: resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==} dev: true - /date-fns@2.29.3: - resolution: {integrity: sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==} - engines: {node: '>=0.11'} - dev: false - /date-fns@2.30.0: resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} engines: {node: '>=0.11'} From d47c5cb99721fa9bf3bccf4a0ed8dd6616525334 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Fri, 26 Jul 2024 00:52:05 +0200 Subject: [PATCH 033/139] fix: types/build error --- apps/web/src/lib/hooks/api/useGraphPool.ts | 31 ++++----------------- apps/web/src/lib/hooks/useTokensFromPool.ts | 8 +++--- apps/web/src/ui/pool/columns.tsx | 1 + apps/web/src/ui/stake/SushiBarProvider.tsx | 4 +-- 4 files changed, 12 insertions(+), 32 deletions(-) diff --git a/apps/web/src/lib/hooks/api/useGraphPool.ts b/apps/web/src/lib/hooks/api/useGraphPool.ts index 15add6d2a5..977d572b93 100644 --- a/apps/web/src/lib/hooks/api/useGraphPool.ts +++ b/apps/web/src/lib/hooks/api/useGraphPool.ts @@ -1,30 +1,25 @@ 'use client' import 'sushi/bigint-serializer' - -import { SushiV2Pool } from '@sushiswap/graph-client/sushi-v2' import { useMemo } from 'react' import { Amount } from 'sushi/currency' import { useQuery } from '@tanstack/react-query' import type { PoolId } from 'sushi' import { getTokensFromPool } from '../useTokensFromPool' +import { getV2Pool, V2Pool } from '@sushiswap/graph-client/data-api' -export function getGraphPoolUrl(poolId: string) { - return `/pools/api/graphPool/${poolId}` -} export const useGraphPool = (pool: PoolId) => { const { data: graphPool, isLoading, error, - } = useQuery({ - queryKey: [getGraphPoolUrl(pool.id)], + } = useQuery({ + queryKey: ['v2-pool', {...pool}], queryFn: async () => { - const res = await fetch(getGraphPoolUrl(pool.id)) - - return JSON.parse(await res.text()) + const result = await getV2Pool({chainId: pool.chainId, address: pool.address}) + return result }, }) @@ -47,23 +42,7 @@ export const useGraphPool = (pool: PoolId) => { token0, token1, liquidityToken, - // liquidityNative: graphPool ? Number(graphPool?.reserveETH) : null, liquidityUSD: graphPool ? Number(graphPool?.liquidityUSD) : null, - // liquidity1dChange: graphPool - // ? Number(graphPool?.liquidity1dChange ?? 0) - // : null, - // fees1d: graphPool ? Number(graphPool?.fees1d ?? 0) : null, - // fees1dChange: graphPool ? Number(graphPool?.fees1dChange ?? 0) : null, - // volume1d: graphPool ? Number(graphPool?.volume1d ?? 0) : null, - // volume1dChange: graphPool - // ? Number(graphPool?.volume1dChange ?? 0) - // : null, - // txCount1d: graphPool ? Number(graphPool?.txCount1d ?? 0) : null, - // txCount1dChange: graphPool - // ? Number(graphPool?.txCount1dChange ?? 0) - // : null, - // hourSnapshots: graphPool?.hourSnapshots ?? null, - // daySnapshots: graphPool?.daySnapshots ?? null, reserve0: token0 && graphPool ? Amount.fromRawAmount(token0, graphPool.reserve0) diff --git a/apps/web/src/lib/hooks/useTokensFromPool.ts b/apps/web/src/lib/hooks/useTokensFromPool.ts index dfc6d298e1..61843cd4c1 100644 --- a/apps/web/src/lib/hooks/useTokensFromPool.ts +++ b/apps/web/src/lib/hooks/useTokensFromPool.ts @@ -5,8 +5,8 @@ import { Native, Token } from 'sushi/currency' export const getTokensFromPool = (pool: { id: string - token0: { address: string; name: string; decimals: string; symbol: string } - token1: { address: string; name: string; decimals: string; symbol: string } + token0: { address: string; name: string; decimals: number; symbol: string } + token1: { address: string; name: string; decimals: number; symbol: string } chainId: number }) => { const _token0 = new Token({ @@ -50,8 +50,8 @@ export const getTokensFromPool = (pool: { export const useTokensFromPool = (pool: { id: string - token0: { address: string; name: string; decimals: string; symbol: string } - token1: { address: string; name: string; decimals: string; symbol: string } + token0: { address: string; name: string; decimals: number; symbol: string } + token1: { address: string; name: string; decimals: number; symbol: string } chainId: number }) => { return useMemo(() => { diff --git a/apps/web/src/ui/pool/columns.tsx b/apps/web/src/ui/pool/columns.tsx index 79853a7e26..aa91b6ae99 100644 --- a/apps/web/src/ui/pool/columns.tsx +++ b/apps/web/src/ui/pool/columns.tsx @@ -50,6 +50,7 @@ import { import { PriceRangeCell } from './PriceRangeCell' import { RewardsV3ClaimableCell } from './RewardsV3ClaimableCell' import { RewardsV3NameCell } from './RewardsV3NameCell' +import { V2Position } from '@sushiswap/graph-client/data-api' export const REWARDS_V3_NAME_COLUMN: ColumnDef = { id: 'poolName', diff --git a/apps/web/src/ui/stake/SushiBarProvider.tsx b/apps/web/src/ui/stake/SushiBarProvider.tsx index aea14c893a..2d5945d893 100644 --- a/apps/web/src/ui/stake/SushiBarProvider.tsx +++ b/apps/web/src/ui/stake/SushiBarProvider.tsx @@ -23,8 +23,8 @@ export const SushiBarProvider: FC<{ const [sushiBalance, totalSupply, apy] = useMemo( () => [ - tryParseAmount(data?.sushiSupply, SUSHI[ChainId.ETHEREUM]), - tryParseAmount(data?.xSushiSupply, XSUSHI[ChainId.ETHEREUM]), + tryParseAmount((data?.sushiSupply ?? 0).toString(), SUSHI[ChainId.ETHEREUM]), + tryParseAmount((data?.xSushiSupply ?? 0).toString(), XSUSHI[ChainId.ETHEREUM]), data && data?.apr1m !== undefined ? Number(data.apr1m) * 12 : undefined, ], [data], From 4925fd5d5cd8cd8e268862a087dd4355451b3f72 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Fri, 26 Jul 2024 01:00:58 +0200 Subject: [PATCH 034/139] chore: pnpm 8.15.8 again --- .github/actions/install/action.yml | 2 +- .github/workflows/apps-web-e2e.yml | 2 +- .github/workflows/release.yml | 2 +- package.json | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index 875f3f3ff5..cb3d841e87 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -7,7 +7,7 @@ runs: - name: Set up pnpm uses: pnpm/action-setup@v4 with: - version: 8.15.9 + version: 8.15.8 - name: Set up node uses: actions/setup-node@v4 diff --git a/.github/workflows/apps-web-e2e.yml b/.github/workflows/apps-web-e2e.yml index 3c30e86d29..b6e4eb3c1f 100644 --- a/.github/workflows/apps-web-e2e.yml +++ b/.github/workflows/apps-web-e2e.yml @@ -33,7 +33,7 @@ jobs: block-number: [55359656] chain-id: [137] node-version: [20] - pnpm-version: [8.15.9] + pnpm-version: [8.15.8] steps: - name: Clone repository uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 759e1e3ae0..afe1a83c47 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: - uses: pnpm/action-setup@v4 with: - version: 8.15.9 + version: 8.15.8 - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/package.json b/package.json index 89d19a018f..ac70ce510a 100644 --- a/package.json +++ b/package.json @@ -37,10 +37,10 @@ "ts-jest": "29.1.1", "turbo": "2.0.5" }, - "packageManager": "pnpm@8.15.9", + "packageManager": "pnpm@8.15.8", "engines": { "node": ">=20.x", - "pnpm": "8.15.9" + "pnpm": "8.15.8" }, "pnpm": { "overrides": { From ca0f8dac57fa3a0b9b88aedffacc7f94bc502450 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Mon, 29 Jul 2024 11:22:59 +0200 Subject: [PATCH 035/139] refactor: types --- .../api/pools/[chainId]/[address]/route.ts | 40 - apps/web/src/lib/hooks/api/index.ts | 2 +- apps/web/src/lib/hooks/api/useGraphPool.ts | 61 - apps/web/src/lib/hooks/api/useV2Pool.ts | 63 + .../master-chef/use-master-chef-deposit.ts | 3 +- .../master-chef/use-master-chef-withdraw.ts | 3 +- .../hooks/master-chef/use-master-chef.ts | 2 +- .../wagmi/hooks/master-chef/use-rewarder.ts | 2 +- apps/web/src/ui/pool/AddSectionLegacy.tsx | 4 +- apps/web/src/ui/pool/AddSectionMyPosition.tsx | 5 +- apps/web/src/ui/pool/AddSectionStake.tsx | 24 +- .../web/src/ui/pool/ManageV2LiquidityCard.tsx | 8 +- apps/web/src/ui/pool/MigrateTab.tsx | 10 +- apps/web/src/ui/pool/PoolButtons.tsx | 4 +- apps/web/src/ui/pool/PoolMyRewards.tsx | 4 +- apps/web/src/ui/pool/PoolPosition.tsx | 4 +- apps/web/src/ui/pool/PoolPositionDesktop.tsx | 4 +- apps/web/src/ui/pool/PoolPositionProvider.tsx | 4 +- .../ui/pool/PoolPositionRewardsProvider.tsx | 3 +- .../src/ui/pool/PoolPositionStakedDesktop.tsx | 4 +- .../ui/pool/PoolPositionStakedProvider.tsx | 7 +- .../web/src/ui/pool/PoolQuickHoverTooltip.tsx | 10 +- apps/web/src/ui/pool/PoolsFiltersProvider.tsx | 5 +- apps/web/src/ui/pool/RemoveSectionLegacy.tsx | 4 +- apps/web/src/ui/pool/RemoveSectionUnstake.tsx | 12 +- apps/web/src/ui/pool/TableFiltersPoolType.tsx | 30 +- jobs/pool/src/merkl-incentives.ts | 434 - jobs/pool/src/steer.ts | 306 - package-lock.json | 9720 +++++++++++++++++ 29 files changed, 9857 insertions(+), 925 deletions(-) delete mode 100644 apps/web/src/app/(evm)/pool/api/pools/[chainId]/[address]/route.ts delete mode 100644 apps/web/src/lib/hooks/api/useGraphPool.ts create mode 100644 apps/web/src/lib/hooks/api/useV2Pool.ts delete mode 100644 jobs/pool/src/merkl-incentives.ts delete mode 100644 jobs/pool/src/steer.ts create mode 100644 package-lock.json diff --git a/apps/web/src/app/(evm)/pool/api/pools/[chainId]/[address]/route.ts b/apps/web/src/app/(evm)/pool/api/pools/[chainId]/[address]/route.ts deleted file mode 100644 index bd1a67c603..0000000000 --- a/apps/web/src/app/(evm)/pool/api/pools/[chainId]/[address]/route.ts +++ /dev/null @@ -1,40 +0,0 @@ -import 'sushi/bigint-serializer' - -import { PoolApiSchema, getPoolFromDB } from '@sushiswap/client/api' -import { NextResponse } from 'next/server.js' -import { ChefType } from 'sushi' -import { CORS } from '../../../cors' - -export const revalidate = 15 - -export async function GET( - _request: Request, - { params }: { params: { chainId: string; address: string } }, -) { - const result = PoolApiSchema.safeParse({ - chainId: params.chainId, - address: params.address, - }) - - if (!result.success) { - return NextResponse.json(result.error.format(), { status: 400 }) - } - - let pool - - try { - pool = await getPoolFromDB(result.data).then((pool) => ({ - ...pool, - incentives: pool.incentives.sort((a) => - a.chefType === ChefType.MasterChefV2 ? -1 : 0, - ), - })) - } catch (error) { - console.error(error) - return NextResponse.json({ error: 'Failed to fetch pool' }, { status: 500 }) - } - - return NextResponse.json(pool, { - headers: CORS, - }) -} diff --git a/apps/web/src/lib/hooks/api/index.ts b/apps/web/src/lib/hooks/api/index.ts index 9226a4d09f..13e99f4256 100644 --- a/apps/web/src/lib/hooks/api/index.ts +++ b/apps/web/src/lib/hooks/api/index.ts @@ -1,4 +1,4 @@ -export * from './useGraphPool' +export * from './useV2Pool' export * from './usePoolGraphData' export * from './useSkaleEuropaFaucet' export * from './useSushiV2UserPositions' diff --git a/apps/web/src/lib/hooks/api/useGraphPool.ts b/apps/web/src/lib/hooks/api/useGraphPool.ts deleted file mode 100644 index 977d572b93..0000000000 --- a/apps/web/src/lib/hooks/api/useGraphPool.ts +++ /dev/null @@ -1,61 +0,0 @@ -'use client' - -import 'sushi/bigint-serializer' -import { useMemo } from 'react' -import { Amount } from 'sushi/currency' - -import { useQuery } from '@tanstack/react-query' -import type { PoolId } from 'sushi' -import { getTokensFromPool } from '../useTokensFromPool' -import { getV2Pool, V2Pool } from '@sushiswap/graph-client/data-api' - - -export const useGraphPool = (pool: PoolId) => { - const { - data: graphPool, - isLoading, - error, - } = useQuery({ - queryKey: ['v2-pool', {...pool}], - queryFn: async () => { - const result = await getV2Pool({chainId: pool.chainId, address: pool.address}) - return result - }, - }) - - const { token0, token1, liquidityToken } = useMemo(() => { - if (!graphPool) - return { - token0: undefined, - token1: undefined, - liquidityToken: undefined, - } - - return getTokensFromPool(graphPool) - }, [graphPool]) - - return useMemo(() => { - return { - isLoading, - error, - data: { - token0, - token1, - liquidityToken, - liquidityUSD: graphPool ? Number(graphPool?.liquidityUSD) : null, - reserve0: - token0 && graphPool - ? Amount.fromRawAmount(token0, graphPool.reserve0) - : null, - reserve1: - token1 && graphPool - ? Amount.fromRawAmount(token1, graphPool.reserve1) - : null, - totalSupply: - liquidityToken && graphPool - ? Amount.fromRawAmount(liquidityToken, graphPool.liquidity) - : null, - }, - } - }, [error, graphPool, isLoading, liquidityToken, token0, token1]) -} diff --git a/apps/web/src/lib/hooks/api/useV2Pool.ts b/apps/web/src/lib/hooks/api/useV2Pool.ts new file mode 100644 index 0000000000..a8e737b371 --- /dev/null +++ b/apps/web/src/lib/hooks/api/useV2Pool.ts @@ -0,0 +1,63 @@ +'use client' + +import { useMemo } from 'react' +import 'sushi/bigint-serializer' +import { Amount } from 'sushi/currency' + +import { V2Pool, getV2Pool } from '@sushiswap/graph-client/data-api' +import { useQuery } from '@tanstack/react-query' +import { getTokensFromPool } from '../useTokensFromPool' +import { PoolId } from 'sushi' + +export const useV2Pool = (poolId: PoolId) => { + const { + data: pool, + isLoading, + error, + } = useQuery({ + queryKey: ['v2-pool', poolId], + queryFn: async () => { + const result = await getV2Pool({ + chainId: poolId.chainId, + address: poolId.address, + }) + return result + }, + }) + + const { token0, token1, liquidityToken } = useMemo(() => { + if (!pool) + return { + token0: undefined, + token1: undefined, + liquidityToken: undefined, + } + + return getTokensFromPool(pool) + }, [pool]) + + return useMemo(() => { + return { + isLoading, + error, + data: { + token0, + token1, + liquidityToken, + liquidityUSD: pool ? Number(pool?.liquidityUSD) : null, + reserve0: + token0 && pool + ? Amount.fromRawAmount(token0, pool.reserve0) + : null, + reserve1: + token1 && pool + ? Amount.fromRawAmount(token1, pool.reserve1) + : null, + totalSupply: + liquidityToken && pool + ? Amount.fromRawAmount(liquidityToken, pool.liquidity) + : null, + }, + } + }, [error, pool, isLoading, liquidityToken, token0, token1]) +} diff --git a/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef-deposit.ts b/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef-deposit.ts index 11c0afc87a..643d2d332e 100644 --- a/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef-deposit.ts +++ b/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef-deposit.ts @@ -1,6 +1,5 @@ 'use client' -import { ChefType } from '@sushiswap/client' import { createErrorToast, createToast } from '@sushiswap/notifications' import { useCallback, useMemo } from 'react' import { masterChefV1Abi, masterChefV2Abi } from 'sushi/abi' @@ -15,7 +14,7 @@ import { } from 'wagmi' import { SendTransactionReturnType } from 'wagmi/actions' -import { ChainId } from 'sushi' +import { ChainId, ChefType } from 'sushi' import { useMasterChefContract } from './use-master-chef-contract' interface UseMasterChefDepositParams { diff --git a/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef-withdraw.ts b/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef-withdraw.ts index 88a6343271..7ed28839ba 100644 --- a/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef-withdraw.ts +++ b/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef-withdraw.ts @@ -1,9 +1,8 @@ 'use client' -import { ChefType } from '@sushiswap/client' import { createErrorToast, createToast } from '@sushiswap/notifications' import { useCallback, useMemo } from 'react' -import { ChainId } from 'sushi' +import { ChainId, ChefType } from 'sushi' import { masterChefV1Abi, masterChefV2Abi, miniChefV2Abi } from 'sushi/abi' import { Amount, Token } from 'sushi/currency' import { UserRejectedRequestError } from 'viem' diff --git a/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts b/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts index 54a95109a7..d4f6fd90e4 100644 --- a/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts +++ b/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts @@ -1,6 +1,5 @@ 'use client' -import { ChefType } from '@sushiswap/client' import { createErrorToast, createToast } from '@sushiswap/notifications' import { useQueryClient } from '@tanstack/react-query' import { useCallback, useEffect, useMemo } from 'react' @@ -24,6 +23,7 @@ import { MINICHEF_ADDRESS, useMasterChefContract, } from './use-master-chef-contract' +import { ChefType } from 'sushi' interface UseMasterChefReturn extends Pick, 'isLoading' | 'isError'> { diff --git a/apps/web/src/lib/wagmi/hooks/master-chef/use-rewarder.ts b/apps/web/src/lib/wagmi/hooks/master-chef/use-rewarder.ts index 75d53d93c8..2281d2b517 100644 --- a/apps/web/src/lib/wagmi/hooks/master-chef/use-rewarder.ts +++ b/apps/web/src/lib/wagmi/hooks/master-chef/use-rewarder.ts @@ -1,6 +1,5 @@ 'use client' -import { ChefType } from '@sushiswap/client' import { useQueryClient } from '@tanstack/react-query' import { useEffect, useMemo } from 'react' import { ChainId } from 'sushi/chain' @@ -8,6 +7,7 @@ import { Amount, Token } from 'sushi/currency' import { Address } from 'viem' import { useBlockNumber, useReadContracts } from 'wagmi' import { getMasterChefContractConfig } from './use-master-chef-contract' +import { ChefType } from 'sushi' interface UseRewarderPayload { account: string | undefined diff --git a/apps/web/src/ui/pool/AddSectionLegacy.tsx b/apps/web/src/ui/pool/AddSectionLegacy.tsx index 72033ad0d3..3973ae6e78 100644 --- a/apps/web/src/ui/pool/AddSectionLegacy.tsx +++ b/apps/web/src/ui/pool/AddSectionLegacy.tsx @@ -1,6 +1,5 @@ 'use client' -import { Pool } from '@sushiswap/client' import { useIsMounted } from '@sushiswap/hooks' import { Button } from '@sushiswap/ui' import { FC, useCallback, useMemo, useState } from 'react' @@ -19,8 +18,9 @@ import { Checker } from 'src/lib/wagmi/systems/Checker' import { CheckerProvider } from 'src/lib/wagmi/systems/Checker/Provider' import { AddSectionReviewModalLegacy } from './AddSectionReviewModalLegacy' import { AddSectionWidget } from './AddSectionWidget' +import { V2Pool } from '@sushiswap/graph-client/data-api' -export const AddSectionLegacy: FC<{ pool: Pool }> = ({ pool: _pool }) => { +export const AddSectionLegacy: FC<{ pool: V2Pool }> = ({ pool: _pool }) => { const chainId = _pool.chainId as SushiSwapV2ChainId const isMounted = useIsMounted() const { token0, token1 } = useTokensFromPool(_pool) diff --git a/apps/web/src/ui/pool/AddSectionMyPosition.tsx b/apps/web/src/ui/pool/AddSectionMyPosition.tsx index b4c07155b3..64bb92ed47 100644 --- a/apps/web/src/ui/pool/AddSectionMyPosition.tsx +++ b/apps/web/src/ui/pool/AddSectionMyPosition.tsx @@ -1,4 +1,4 @@ -import { Pool } from '@sushiswap/client' + import { classNames } from '@sushiswap/ui' import { Currency as UICurrency } from '@sushiswap/ui' import React, { FC } from 'react' @@ -8,8 +8,9 @@ import { formatPercent } from 'sushi/format' import { AddSectionMyPositionStaked } from './AddSectionMyPositionStaked' import { AddSectionMyPositionUnstaked } from './AddSectionMyPositionUnstaked' +import { V2Pool } from '@sushiswap/graph-client/data-api' -export const AddSectionMyPosition: FC<{ pool: Pool }> = ({ pool }) => { +export const AddSectionMyPosition: FC<{ pool: V2Pool }> = ({ pool }) => { return (
diff --git a/apps/web/src/ui/pool/AddSectionStake.tsx b/apps/web/src/ui/pool/AddSectionStake.tsx index 5e4252fdfa..5f86009dc3 100644 --- a/apps/web/src/ui/pool/AddSectionStake.tsx +++ b/apps/web/src/ui/pool/AddSectionStake.tsx @@ -1,18 +1,15 @@ 'use client' -import { ChefType, Pool } from '@sushiswap/client' -import { usePool } from '@sushiswap/client/hooks' import { useIsMounted } from '@sushiswap/hooks' -import { Button } from '@sushiswap/ui' -import { Dots } from '@sushiswap/ui' +import { Button, Dots } from '@sushiswap/ui' import { FC, useMemo, useState } from 'react' import { APPROVE_TAG_STAKE } from 'src/lib/constants' -import { useGraphPool } from 'src/lib/hooks' +import { useV2Pool } from 'src/lib/hooks' import { ChainId } from 'sushi/chain' import { tryParseAmount } from 'sushi/currency' import { ZERO } from 'sushi/math' -import { useSWRConfig } from 'swr' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { getMasterChefContractConfig } from 'src/lib/wagmi/hooks/master-chef/use-master-chef-contract' import { useMasterChefDeposit } from 'src/lib/wagmi/hooks/master-chef/use-master-chef-deposit' import { Checker } from 'src/lib/wagmi/systems/Checker' @@ -20,22 +17,21 @@ import { useApproved, withCheckerRoot, } from 'src/lib/wagmi/systems/Checker/Provider' +import { ChefType } from 'sushi' import { AddSectionStakeWidget } from './AddSectionStakeWidget' interface AddSectionStakeProps { - pool: Pool + pool: V2Pool chefType: ChefType title?: string farmId: number } -export const AddSectionStake: FC<{ poolId: string; title?: string }> = ({ - poolId, - title, -}) => { +export const AddSectionStake: FC<{ + pool: V2Pool + title?: string +}> = ({ pool, title }) => { const isMounted = useIsMounted() - const { data: pool } = usePool({ args: poolId, swrConfig: useSWRConfig() }) - if (!pool) return <> if (!pool?.incentives || pool.incentives.length === 0 || !isMounted) @@ -57,7 +53,7 @@ const _AddSectionStake: FC = withCheckerRoot( const [value, setValue] = useState('') const { data: { reserve1, reserve0, liquidityToken }, - } = useGraphPool(pool) + } = useV2Pool(pool) const amounts = useMemo(() => { return [tryParseAmount(value, liquidityToken)] diff --git a/apps/web/src/ui/pool/ManageV2LiquidityCard.tsx b/apps/web/src/ui/pool/ManageV2LiquidityCard.tsx index 7102196944..13b02924ba 100644 --- a/apps/web/src/ui/pool/ManageV2LiquidityCard.tsx +++ b/apps/web/src/ui/pool/ManageV2LiquidityCard.tsx @@ -1,6 +1,5 @@ 'use client' -import { Pool } from '@sushiswap/client' import { Card, CardContent, @@ -24,9 +23,10 @@ import { PoolPositionRewardsProvider } from './PoolPositionRewardsProvider' import { PoolPositionStakedProvider } from './PoolPositionStakedProvider' import { RemoveSectionLegacy } from './RemoveSectionLegacy' import { RemoveSectionUnstake } from './RemoveSectionUnstake' +import { V2Pool } from '@sushiswap/graph-client/data-api' interface ManageV2LiquidityCardProps { - pool: Pool + pool: V2Pool tab?: 'stake' | 'unstake' | 'add' | 'remove' } @@ -129,7 +129,7 @@ export const ManageV2LiquidityCard: FC = ({ {isFarm ? ( - + ) : ( = ({ {isFarm ? ( - + ) : ( = withCheckerRoot(({ pool }) => { +export const MigrateTab: FC<{ pool: V2Pool }> = withCheckerRoot(({ pool }) => { const { address } = useAccount() const [feeAmount, setFeeAmount] = useState( SushiSwapV3FeeAmount.LOWEST, @@ -208,7 +208,7 @@ export const MigrateTab: FC<{ pool: Pool }> = withCheckerRoot(({ pool }) => { const { data: { token0: _token0, token1: _token1, liquidityToken }, - } = useGraphPool(pool) + } = useV2Pool(pool) const { value0: _value0, diff --git a/apps/web/src/ui/pool/PoolButtons.tsx b/apps/web/src/ui/pool/PoolButtons.tsx index 38e3cc3bb0..4b226e7d52 100644 --- a/apps/web/src/ui/pool/PoolButtons.tsx +++ b/apps/web/src/ui/pool/PoolButtons.tsx @@ -1,4 +1,3 @@ -import { Pool } from '@sushiswap/client' import { LinkInternal } from '@sushiswap/ui' import { Button } from '@sushiswap/ui' import Link from 'next/link' @@ -8,9 +7,10 @@ import { getAddress } from 'viem' import { usePoolPosition } from './PoolPositionProvider' import { usePoolPositionStaked } from './PoolPositionStakedProvider' +import { V2Pool } from '@sushiswap/graph-client/data-api' interface PoolButtonsProps { - pool: Pool + pool: V2Pool } export const PoolButtons: FC = ({ pool }) => { diff --git a/apps/web/src/ui/pool/PoolMyRewards.tsx b/apps/web/src/ui/pool/PoolMyRewards.tsx index cbd57cda76..7326bc6cdb 100644 --- a/apps/web/src/ui/pool/PoolMyRewards.tsx +++ b/apps/web/src/ui/pool/PoolMyRewards.tsx @@ -1,6 +1,5 @@ 'use client' -import { Pool } from '@sushiswap/client' import { Button } from '@sushiswap/ui' import { Card, @@ -19,9 +18,10 @@ import { formatUSD } from 'sushi/format' import { Checker } from 'src/lib/wagmi/systems/Checker' import { type ChainId } from 'sushi/chain' import { usePoolPositionRewards } from './PoolPositionRewardsProvider' +import { V2Pool } from '@sushiswap/graph-client/data-api' interface PoolMyRewardsProps { - pool: Pool + pool: V2Pool } export const PoolMyRewards: FC = ({ pool }) => { diff --git a/apps/web/src/ui/pool/PoolPosition.tsx b/apps/web/src/ui/pool/PoolPosition.tsx index 49a1fcae22..dbc13c442f 100644 --- a/apps/web/src/ui/pool/PoolPosition.tsx +++ b/apps/web/src/ui/pool/PoolPosition.tsx @@ -1,6 +1,5 @@ 'use client' -import { Pool } from '@sushiswap/client' import { Card, CardContent, @@ -18,9 +17,10 @@ import { PoolPositionDesktop } from './PoolPositionDesktop' import { usePoolPosition } from './PoolPositionProvider' import { PoolPositionStakedDesktop } from './PoolPositionStakedDesktop' import { usePoolPositionStaked } from './PoolPositionStakedProvider' +import { V2Pool } from '@sushiswap/graph-client/data-api' interface PoolPositionProps { - pool: Pool + pool: V2Pool } const PoolPositionDisconnected: FC = () => { diff --git a/apps/web/src/ui/pool/PoolPositionDesktop.tsx b/apps/web/src/ui/pool/PoolPositionDesktop.tsx index 858bbf361a..5adaa2e9ad 100644 --- a/apps/web/src/ui/pool/PoolPositionDesktop.tsx +++ b/apps/web/src/ui/pool/PoolPositionDesktop.tsx @@ -1,12 +1,12 @@ -import { Pool } from '@sushiswap/client' import { CardCurrencyAmountItem, CardGroup, CardLabel } from '@sushiswap/ui' import { FC } from 'react' import { formatUSD } from 'sushi/format' import { usePoolPosition } from './PoolPositionProvider' +import { V2Pool } from '@sushiswap/graph-client/data-api' interface PoolPositionProps { - pool: Pool + pool: V2Pool } export const PoolPositionDesktop: FC = () => { diff --git a/apps/web/src/ui/pool/PoolPositionProvider.tsx b/apps/web/src/ui/pool/PoolPositionProvider.tsx index 808719a82e..054b495175 100644 --- a/apps/web/src/ui/pool/PoolPositionProvider.tsx +++ b/apps/web/src/ui/pool/PoolPositionProvider.tsx @@ -2,9 +2,9 @@ import { FC, ReactNode, createContext, useContext, useMemo } from 'react' import { - useGraphPool, useTokenAmountDollarValues, useUnderlyingTokenBalanceFromPool, + useV2Pool, } from 'src/lib/hooks' import { useBalanceWeb3 } from 'src/lib/wagmi/hooks/balances/useBalanceWeb3' import { ChainId } from 'sushi/chain' @@ -33,7 +33,7 @@ export const PoolPositionProvider: FC<{ const { data: { reserve0, reserve1, totalSupply, liquidityToken }, - } = useGraphPool(pool) + } = useV2Pool(pool) const { data: balance, diff --git a/apps/web/src/ui/pool/PoolPositionRewardsProvider.tsx b/apps/web/src/ui/pool/PoolPositionRewardsProvider.tsx index 0557938dc3..9797f1a4c7 100644 --- a/apps/web/src/ui/pool/PoolPositionRewardsProvider.tsx +++ b/apps/web/src/ui/pool/PoolPositionRewardsProvider.tsx @@ -1,6 +1,5 @@ 'use client' -import { ChefType } from '@sushiswap/client' import { FC, ReactNode, createContext, useContext, useMemo } from 'react' import { incentiveRewardToToken } from 'src/lib/functions' import { useTokenAmountDollarValues, useTokensFromPool } from 'src/lib/hooks' @@ -11,7 +10,7 @@ import { } from 'src/lib/wagmi/hooks/master-chef/use-rewarder' import { ChainId } from 'sushi/chain' import { Amount, Token } from 'sushi/currency' -import type { Incentive, PoolBase, PoolWithIncentives } from 'sushi/types' +import type { ChefType, Incentive, PoolBase, PoolWithIncentives } from 'sushi/types' import { useAccount } from 'wagmi' interface PoolPositionRewardsContext { diff --git a/apps/web/src/ui/pool/PoolPositionStakedDesktop.tsx b/apps/web/src/ui/pool/PoolPositionStakedDesktop.tsx index 16bc5367ac..121b53dc5f 100644 --- a/apps/web/src/ui/pool/PoolPositionStakedDesktop.tsx +++ b/apps/web/src/ui/pool/PoolPositionStakedDesktop.tsx @@ -1,12 +1,12 @@ -import { Pool } from '@sushiswap/client' import { CardCurrencyAmountItem, CardGroup, CardLabel } from '@sushiswap/ui' import { FC } from 'react' import { formatUSD } from 'sushi/format' import { usePoolPositionStaked } from './PoolPositionStakedProvider' +import { V2Pool } from '@sushiswap/graph-client/data-api' interface PoolPositionStakedDesktopProps { - pool: Pool + pool: V2Pool } export const PoolPositionStakedDesktop: FC = ({ diff --git a/apps/web/src/ui/pool/PoolPositionStakedProvider.tsx b/apps/web/src/ui/pool/PoolPositionStakedProvider.tsx index 8b5c4db0d0..9f05d0127a 100644 --- a/apps/web/src/ui/pool/PoolPositionStakedProvider.tsx +++ b/apps/web/src/ui/pool/PoolPositionStakedProvider.tsx @@ -1,14 +1,13 @@ 'use client' -import { ChefType } from '@sushiswap/client' import { FC, ReactNode, createContext, useContext, useMemo } from 'react' import { - useGraphPool, useTokenAmountDollarValues, useUnderlyingTokenBalanceFromPool, + useV2Pool, } from 'src/lib/hooks' import { useMasterChef } from 'src/lib/wagmi/hooks/master-chef/use-master-chef' -import type { PoolId, PoolWithIncentives } from 'sushi' +import type { ChefType, PoolId, PoolWithIncentives } from 'sushi' import { ChainId } from 'sushi/chain' import { Amount, Currency, Token } from 'sushi/currency' @@ -82,7 +81,7 @@ const _PoolPositionStakedProvider: FC<_PoolPositionStakedProviderProps> = ({ }) => { const { data: { reserve0, reserve1, totalSupply, liquidityToken }, - } = useGraphPool(pool) + } = useV2Pool(pool) const { balance, isLoading, isError, isWritePending, isWriteError } = useMasterChef({ diff --git a/apps/web/src/ui/pool/PoolQuickHoverTooltip.tsx b/apps/web/src/ui/pool/PoolQuickHoverTooltip.tsx index 5304660922..06a5aba86a 100644 --- a/apps/web/src/ui/pool/PoolQuickHoverTooltip.tsx +++ b/apps/web/src/ui/pool/PoolQuickHoverTooltip.tsx @@ -1,16 +1,18 @@ import { PlusIcon, UserCircleIcon } from '@heroicons/react-v1/solid' -import { Pool, Protocol } from '@sushiswap/client' +import { V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' + import { LinkInternal } from '@sushiswap/ui' import { Button } from '@sushiswap/ui' import { Currency } from '@sushiswap/ui' import { List } from '@sushiswap/ui' import React, { FC } from 'react' import { incentiveRewardToToken } from 'src/lib/functions' +import { SushiSwapProtocol } from 'sushi' import { ChainId } from 'sushi/chain' import { formatNumber, formatPercent } from 'sushi/format' interface PoolQuickHoverTooltipProps { - row: Pool + row: V2Pool | V3Pool } export const PoolQuickHoverTooltip: FC = ({ @@ -36,7 +38,7 @@ export const PoolQuickHoverTooltip: FC = ({ - {row.protocol === Protocol.SUSHISWAP_V3 && ( + {row.protocol === SushiSwapProtocol.SUSHISWAP_V3 && ( diff --git a/apps/web/src/ui/pool/PoolsFiltersProvider.tsx b/apps/web/src/ui/pool/PoolsFiltersProvider.tsx index 3dde44c6f3..c5e9359afe 100644 --- a/apps/web/src/ui/pool/PoolsFiltersProvider.tsx +++ b/apps/web/src/ui/pool/PoolsFiltersProvider.tsx @@ -1,6 +1,6 @@ 'use client' -import { Protocol, parseArgs } from '@sushiswap/client' +import { parseArgs } from '@sushiswap/client' import { useRouter } from 'next/navigation' import { Dispatch, @@ -16,6 +16,7 @@ import { z } from 'zod' import { useTypedSearchParams } from '../../lib/hooks' import { POOL_TYPES } from './TableFiltersPoolType' +import { SushiSwapProtocol } from 'sushi' type FilterContext = z.TypeOf @@ -45,7 +46,7 @@ export const poolFiltersSchema = z.object({ .string() .transform((protocols) => protocols !== null && protocols !== ',' - ? (protocols.split(',') as Protocol[]) + ? (protocols.split(',') as SushiSwapProtocol[]) : [], ), farmsOnly: z diff --git a/apps/web/src/ui/pool/RemoveSectionLegacy.tsx b/apps/web/src/ui/pool/RemoveSectionLegacy.tsx index ff391474f1..ad35586798 100644 --- a/apps/web/src/ui/pool/RemoveSectionLegacy.tsx +++ b/apps/web/src/ui/pool/RemoveSectionLegacy.tsx @@ -1,6 +1,5 @@ 'use client' -import { Pool } from '@sushiswap/client' import { SlippageToleranceStorageKey, TTLStorageKey, @@ -58,6 +57,7 @@ import { } from 'wagmi' import { usePoolPosition } from './PoolPositionProvider' import { RemoveSectionWidget } from './RemoveSectionWidget' +import { V2Pool } from '@sushiswap/graph-client/data-api' const REMOVE_V2_LIQUIDITY_PERMIT_INFO: PermitInfo = { version: '1', @@ -66,7 +66,7 @@ const REMOVE_V2_LIQUIDITY_PERMIT_INFO: PermitInfo = { } interface RemoveSectionLegacyProps { - pool: Pool + pool: V2Pool } export const RemoveSectionLegacy: FC = diff --git a/apps/web/src/ui/pool/RemoveSectionUnstake.tsx b/apps/web/src/ui/pool/RemoveSectionUnstake.tsx index 063a561707..466512e345 100644 --- a/apps/web/src/ui/pool/RemoveSectionUnstake.tsx +++ b/apps/web/src/ui/pool/RemoveSectionUnstake.tsx @@ -1,7 +1,5 @@ 'use client' -import { ChefType, Pool } from '@sushiswap/client' -import { usePool } from '@sushiswap/client/hooks' import { useIsMounted } from '@sushiswap/hooks' import { Card, @@ -20,23 +18,23 @@ import { Dots } from '@sushiswap/ui' import { FC, useMemo, useState } from 'react' import { ChainId } from 'sushi/chain' import { ZERO } from 'sushi/math' -import { useSWRConfig } from 'swr' import { useMasterChefWithdraw } from 'src/lib/wagmi/hooks/master-chef/use-master-chef-withdraw' import { Checker } from 'src/lib/wagmi/systems/Checker' import { withCheckerRoot } from 'src/lib/wagmi/systems/Checker/Provider' import { usePoolPositionStaked } from './PoolPositionStakedProvider' +import { V2Pool } from '@sushiswap/graph-client/data-api' +import { ChefType } from 'sushi' interface AddSectionStakeProps { chainId: ChainId - pool: Pool + pool: V2Pool chefType: ChefType farmId: number } -export const RemoveSectionUnstake: FC<{ poolId: string }> = ({ poolId }) => { +export const RemoveSectionUnstake: FC<{ pool: V2Pool }> = ({ pool }) => { const isMounted = useIsMounted() - const { data: pool } = usePool({ args: poolId, swrConfig: useSWRConfig() }) if (!pool) return <> @@ -45,7 +43,7 @@ export const RemoveSectionUnstake: FC<{ poolId: string }> = ({ poolId }) => { return ( <_RemoveSectionUnstake - chainId={pool.chainId as ChainId} + chainId={pool.chainId} pool={pool} chefType={pool.incentives[0].chefType} farmId={Number(pool.incentives[0].pid)} diff --git a/apps/web/src/ui/pool/TableFiltersPoolType.tsx b/apps/web/src/ui/pool/TableFiltersPoolType.tsx index 2be1a94e1b..ca752c6d20 100644 --- a/apps/web/src/ui/pool/TableFiltersPoolType.tsx +++ b/apps/web/src/ui/pool/TableFiltersPoolType.tsx @@ -1,7 +1,6 @@ 'use client' import { PlusCircleIcon } from '@heroicons/react/24/outline' -import { Protocol } from '@sushiswap/client' import { useMutationObserver } from '@sushiswap/hooks' import { Chip, @@ -23,21 +22,18 @@ import React, { FC, useCallback, useState, useTransition } from 'react' import { PROTOCOL_MAP } from '../../lib/constants' import { usePoolFilters, useSetPoolFilters } from './PoolsFiltersProvider' +import { SushiSwapProtocol } from 'sushi' -export const POOL_TYPES = [Protocol.SUSHISWAP_V3, Protocol.SUSHISWAP_V2] +export const POOL_TYPES = [SushiSwapProtocol.SUSHISWAP_V3, SushiSwapProtocol.SUSHISWAP_V2] const POOL_DESCRIPTIONS = { - [Protocol.SUSHISWAP_V3]: + [SushiSwapProtocol.SUSHISWAP_V3]: 'A pool type known as concentrated liquidity, which maximizes capital efficiency by providing the liquidity in a pre-defined range around the current price of the pair. If a user’s position moves out of range, it will not be capturing fees and will need to adjust their range or wait for the price to return to it.', - [Protocol.SUSHISWAP_V2]: + [SushiSwapProtocol.SUSHISWAP_V2]: 'The traditional pool type with a fixed fee of .30% that utilizes a constant product formula to ensure a 50/50 composition of each asset in the pool.', - [Protocol.BENTOBOX_STABLE]: - 'A customizable pool type with a user-defined fee tier that is best suited for like-kind assets (eg. stablecoin pairs, ETH/stETH) that efficiently captures fees and utilizes a constant product formula to ensure a 50/50 composition of each asset in the pool.', - [Protocol.BENTOBOX_CLASSIC]: - 'A customizable pool type with a user-defined fee tier that utilizes a constant product formula to ensure a 50/50 composition of each asset in the pool.', } -const isAllThenNone = (protocols: Protocol[]) => +const isAllThenNone = (protocols: SushiSwapProtocol[]) => protocols.length === POOL_TYPES.length ? [] : protocols export const TableFiltersPoolType: FC = () => { @@ -45,16 +41,16 @@ export const TableFiltersPoolType: FC = () => { const [open, setOpen] = useState(false) const { protocols } = usePoolFilters() const setFilters = useSetPoolFilters() - const [peekedProtocol, setPeekedProtocol] = React.useState( + const [peekedProtocol, setPeekedProtocol] = React.useState( POOL_TYPES[0], ) - const [localValue, setValues] = useState(isAllThenNone(protocols)) + const [localValue, setValues] = useState(isAllThenNone(protocols)) const values = pending ? localValue : isAllThenNone(protocols) const protocolHandler = useCallback( - (item: Protocol) => { - let _newValues: Protocol[] + (item: SushiSwapProtocol) => { + let _newValues: SushiSwapProtocol[] if (values?.includes(item)) { _newValues = values.filter((el) => el !== item) } else { @@ -140,7 +136,7 @@ export const TableFiltersPoolType: FC = () => { protocol={el} onPeek={(protocol) => setPeekedProtocol(protocol)} onSelect={() => - protocolHandler(el.toUpperCase() as Protocol) + protocolHandler(el.toUpperCase() as SushiSwapProtocol) } /> ))} @@ -154,10 +150,10 @@ export const TableFiltersPoolType: FC = () => { } interface ProtocolItemProps { - protocol: Protocol + protocol: SushiSwapProtocol onSelect: () => void - selected: Protocol[] - onPeek: (model: Protocol) => void + selected: SushiSwapProtocol[] + onPeek: (model: SushiSwapProtocol) => void } const ProtocolItem: FC = ({ diff --git a/jobs/pool/src/merkl-incentives.ts b/jobs/pool/src/merkl-incentives.ts deleted file mode 100644 index 85cc71632d..0000000000 --- a/jobs/pool/src/merkl-incentives.ts +++ /dev/null @@ -1,434 +0,0 @@ -import 'dotenv/config' -import './lib/wagmi.js' - -import { ChefType, Prisma, RewarderType } from '@sushiswap/database' -import { fetchToken } from '@wagmi/core' -import { fetch } from '@whatwg-node/fetch' -import { performance } from 'perf_hooks' -import { ChainId } from 'sushi/chain' - -import { ID, getIdFromChainIdAddress } from 'sushi' -import { Address, getAddress } from 'viem' -import { filterIncentives } from './etl/incentive/index.js' -import { mergeIncentives } from './etl/incentive/load.js' -import { updatePoolsWithIncentivesTotalApr } from './etl/pool/index.js' -import { createTokens, getMissingTokens } from './etl/token/load.js' -import { client } from './lib/prisma.js' -import { config } from './lib/wagmi.js' - -const TEST_TOKENS = [{ name: 'Angle Merkl', symbol: 'anglaMerkl' }] -const isTestToken = (token: TokenSuccess) => - TEST_TOKENS.every( - (testToken) => - testToken.name === token.token.name || - testToken.symbol === token.token.symbol, - ) - -const isTokenSuccessResponse = ( - token: TokenSuccess | TokenError, -): token is TokenSuccess => token.status === 'ok' -const isTokenErrorResponse = ( - token: TokenSuccess | TokenError, -): token is TokenError => token.status === 'error' - -type MerklResponse = { - [chainId: string]: ChainData -} - -type ChainData = { - pools: { - [poolId: string]: Pool - } -} - -type Pool = { - amm: number - ammAlgo: number - ammAlgoName: string - ammName: string - aprs: Record // Changed from array to Record - chainId: number - decimalsToken0: number - decimalsToken1: number - disputeLive: boolean - distributionData: MerklDistribution[] - endOfDisputePeriod: number - meanAPR: number - pool: string - poolBalanceToken0: number - poolBalanceToken1: number - poolFee: number - poolTotalLiquidity: number - rewardsPerToken: Record // Update this type based on the actual structure - symbolToken0: string - symbolToken1: string - tick: number - token0: string - token1: string - tvl: number -} - -type MerklDistribution = { - amount: number - apr: number - blacklist: string[] - breakdown: Record // Adjust the type based on the actual structure - decimalsRewardToken: number - endTimestamp: number - id: string - isBoosted: boolean - isLive: boolean - isMock: boolean - isOutOfRangeIncentivized: boolean - propFees: number - propToken0: number - propToken1: number - rewardToken: string - startTimestamp: number - symbolRewardToken: string - unclaimed: number - whitelist: string[] -} - -type PriceResponse = { - [token: string]: number -} - -type PriceMap = { - [chainId: number]: PriceResponse -} - -type TokenSuccess = { - status: 'ok' - chainId: number - token: Prisma.TokenCreateManyInput -} - -type TokenError = { - status: 'error' - chainId: number - token: { - id: string - } -} - -const MERKL_SUPPORTED_NETWORKS = [ - ChainId.ETHEREUM, - ChainId.OPTIMISM, - ChainId.BASE, - ChainId.BSC, - ChainId.GNOSIS, - ChainId.POLYGON, - ChainId.ARBITRUM, - ChainId.CELO, - ChainId.AVALANCHE, - ChainId.POLYGON_ZKEVM, - ChainId.THUNDERCORE, - ChainId.CORE, - ChainId.BLAST, - ChainId.SCROLL, - ChainId.LINEA, - ChainId.SKALE_EUROPA, - ChainId.ROOTSTOCK, -] - -export async function execute() { - try { - console.log('Preparing to load merkl farms/incentives') - const startTime = performance.now() - - // EXTRACT - const merkls = await extract() - console.log('EXTRACT - Extracted merkl incentives.') - const prices = ( - await Promise.all( - MERKL_SUPPORTED_NETWORKS.map((chainId) => - fetch(`https://api.sushi.com/price/v1/${chainId}`).then( - (data) => data.json() as Promise, - ), - ), - ) - ).reduce((acc: PriceMap, prices: PriceResponse, index: number) => { - const chainId = MERKL_SUPPORTED_NETWORKS[index] - acc[chainId] = Object.keys(prices).reduce((result, key) => { - result[key.toLowerCase()] = prices[key] - return result - }, {} as PriceResponse) - return acc - }, {}) - - const merklsWithMissingTvls = await addMissingTvls(merkls) - - // TRANSFORM - const { incentivesToCreate, incentivesToUpdate, tokens } = await transform( - merklsWithMissingTvls, - prices, - ) - - console.log( - `TRANSFORM - ${incentivesToCreate.length} incentives to create, ${incentivesToUpdate.length} incentives to update, ${tokens.length} tokens to create.`, - ) - - // LOAD - await createTokens(tokens) - await mergeIncentives(incentivesToCreate, incentivesToUpdate) - await updatePoolsWithIncentivesTotalApr() - - const endTime = performance.now() - console.log( - `COMPLETE - Script ran for ${((endTime - startTime) / 1000).toFixed( - 1, - )} seconds. `, - ) - } catch (e) { - console.error(e) - } -} - -async function addMissingTvls(merkls: MerklResponse) { - const withTvls: MerklResponse = {} - - const poolIdsWithMissingTvl = Object.entries(merkls).reduce( - (acc, [chainId, { pools }]) => { - Object.entries(pools).forEach(([address, pool]) => { - if (pool.tvl === null) { - acc.push( - getIdFromChainIdAddress( - Number(chainId), - address.toLowerCase() as Address, - ), - ) - } - }) - - return acc - }, - [] as ID[], - ) - - const poolsWithMissingTvl = await client.sushiPool.findMany({ - select: { - id: true, - liquidityUSD: true, - }, - where: { - id: { - in: poolIdsWithMissingTvl, - }, - }, - }) - - Object.entries(merkls).forEach(([chainId, { pools }]) => { - withTvls[chainId] = { pools: {} } - - Object.entries(pools).forEach(([_address, pool]) => { - const address = getAddress(_address) - - const poolId = getIdFromChainIdAddress(Number(chainId), address) - const poolWithTvl = poolsWithMissingTvl.find((pool) => pool.id === poolId) - if (poolWithTvl) { - withTvls[chainId].pools[address] = { - ...pool, - tvl: poolWithTvl.liquidityUSD.toNumber(), - } - } else { - withTvls[chainId].pools[address] = pool - } - }) - }) - - return withTvls -} - -async function extract() { - const response = await fetch('https://api.angle.money/v2/merkl') - if (response.status !== 200) { - throw new Error('Failed to fetch merkl incentives.') - } - const merkls = await response.json() - - return merkls as MerklResponse -} - -async function transform( - response: MerklResponse, - prices: PriceMap, -): Promise<{ - incentivesToCreate: Prisma.IncentiveCreateManyInput[] - incentivesToUpdate: Prisma.IncentiveCreateManyInput[] - tokens: Prisma.TokenCreateManyInput[] -}> { - let incentives: Prisma.IncentiveCreateManyInput[] = [] - const tokensToCreate: Prisma.TokenCreateManyInput[] = [] - const rewardTokens: Map = - new Map() - - const pools: { address: string; pool: Pool }[] = [] - - for (const [chainId, value] of Object.entries(response)) { - if ((MERKL_SUPPORTED_NETWORKS as number[]).includes(Number(chainId))) { - const chainPools = Object.entries(value.pools).map(([address, pool]) => ({ - address, - pool, - })) - pools.push(...chainPools) - } - } - - const sushiPools = pools.filter((item) => item.pool.ammName === 'SushiSwapV3') - - if ( - response === undefined || - sushiPools === undefined || - sushiPools.length === 0 - ) { - return { incentivesToCreate: [], incentivesToUpdate: [], tokens: [] } - } - - sushiPools.forEach(({ address, pool }) => { - if (pool.distributionData.length > 0) { - const rewardsByToken: Map = new Map() - // Group rewards by token - for (const distributionData of pool.distributionData) { - if (!rewardsByToken.has(distributionData.rewardToken)) { - rewardsByToken.set(distributionData.rewardToken, []) - } - rewardsByToken.get(distributionData.rewardToken)!.push(distributionData) - } - - for (const [token, rewards] of rewardsByToken) { - const rewardPerDay = rewards.reduce((acc, distData) => { - if ( - !distData.isLive || - distData.isMock || - !(MERKL_SUPPORTED_NETWORKS as number[]).includes(pool.chainId) || - distData.whitelist.length > 0 - ) { - return acc - } - const duration = distData.endTimestamp - distData.startTimestamp - const durationInDays = duration / 86400 - const amountPerDay = distData.amount / durationInDays - return acc + amountPerDay - }, 0) - - const price = prices[pool.chainId][token.toLowerCase()] ?? 0 - const rewardPerYearUSD = 365 * rewardPerDay * price - const apr = pool.tvl ? rewardPerYearUSD / pool.tvl : 0 - - const incentive = Prisma.validator()({ - id: address - .toLowerCase() - .concat(':') - .concat(token.toLowerCase()) - .concat(':') - .concat('merkl'), - chainId: pool.chainId, - chefType: ChefType.Merkl, - apr: Number.isNaN(apr) || apr === Infinity ? 0 : apr, - rewardTokenId: pool.chainId - .toString() - .concat(':') - .concat(token.toLowerCase()), - rewardPerDay: rewardPerDay, - poolId: pool.chainId - .toString() - .concat(':') - .concat(address.toLowerCase()), - pid: 0, // Does not exist for merkl - rewarderAddress: '0x0000000000000000000000000000000000000000', - rewarderType: RewarderType.Primary, - }) - incentives.push(incentive) - rewardTokens.set(`${pool.chainId}:${token.toLowerCase()}`, { - chainId: pool.chainId as ChainId, - address: token.toLowerCase() as Address, - }) - } - } - }) - - const missingTokens = await getMissingTokens( - Array.from(rewardTokens.values()), - ) - if (missingTokens.length > 0) { - const tokens = await Promise.all( - missingTokens.map((token) => fetchTokenFromContract(token)), - ) - const validTokens = tokens - .filter(isTokenSuccessResponse) - .map((token) => token.token) - tokensToCreate.push(...validTokens) - const invalidTokens = tokens.filter(isTokenErrorResponse) - incentives = incentives.filter((incentive) => - invalidTokens.every( - (token) => token.token.id !== incentive.rewardTokenId, - ), - ) - } else { - console.log('TRANSFORM - All reward tokens already exist in db.') - } - - const { incentivesToCreate, incentivesToUpdate } = - await filterIncentives(incentives) - return { incentivesToCreate, incentivesToUpdate, tokens: tokensToCreate } -} - -async function fetchTokenFromContract(token: { - chainId: ChainId - address: Address -}): Promise { - try { - const tokenFromContract = await fetchToken(config, { - chainId: token.chainId, - address: token.address, - }) - const errorResponse: TokenError = { - status: 'error', - chainId: token.chainId, - token: { - id: token.chainId - .toString() - .concat(':') - .concat(token.address.toLowerCase()), - }, - } - - if (tokenFromContract?.decimals) { - const response: TokenSuccess = { - status: 'ok', - chainId: token.chainId, - token: { - id: token.chainId - .toString() - .concat(':') - .concat(tokenFromContract.address.toLowerCase()), - chainId: token.chainId, - address: tokenFromContract.address.toString(), - name: tokenFromContract.name!, - symbol: tokenFromContract.symbol!, - decimals: tokenFromContract.decimals, - }, - } - if (!isTestToken(response)) { - return response - } else { - return errorResponse - } - } - return errorResponse - } catch (e: any) { - const id = token.chainId - .toString() - .concat(':') - .concat(token.address.toLowerCase()) - console.error(`Error fetching token ${id}, error: ${e.message}`) - return { - status: 'error', - chainId: token.chainId, - token: { - id, - }, - } as TokenError - } -} diff --git a/jobs/pool/src/steer.ts b/jobs/pool/src/steer.ts deleted file mode 100644 index 3065e19217..0000000000 --- a/jobs/pool/src/steer.ts +++ /dev/null @@ -1,306 +0,0 @@ -import { Prisma, SteerStrategy } from '@sushiswap/database' -import { getSteerVaults } from '@sushiswap/graph-client/steer' -import { - STEER_SUPPORTED_CHAIN_IDS, - SteerChainId, - getStrategiesPayloads, - getVaultAprs, - getVerifiedVaults, -} from '@sushiswap/steer-sdk' -import { ID, chainName, isPromiseFulfilled } from 'sushi' -import { TickMath } from 'sushi/pool/sushiswap-v3' - -import { updatePoolsWithSteerVaults } from './etl/pool/load.js' -import { - deprecateVaults, - enableVaults, - upsertVaults, -} from './etl/steer/load.js' -import { getTokenPrices } from './lib/price.js' - -export async function steer() { - console.log('Starting steer') - - try { - const startTime = performance.now() - const chainsWithVaults = await extract() - - const transformed = transform(chainsWithVaults) - - await upsertVaults(transformed) - await updatePoolsWithSteerVaults() - - await enable() - await deprecate() - - const endTime = performance.now() - console.log( - `COMPLETE - Script ran for ${((endTime - startTime) / 1000).toFixed( - 1, - )} seconds. `, - ) - } catch (e) { - console.error(e) - } -} - -async function enable() { - const results = await Promise.allSettled( - STEER_SUPPORTED_CHAIN_IDS.map((chainId) => getVerifiedVaults({ chainId })), - ) - - const verifiedVaults = results - .filter(isPromiseFulfilled) - .flatMap((r) => r.value) - - await enableVaults(verifiedVaults) -} - -async function deprecate() { - const deprecatedVaults = await fetch( - 'https://ro81h8hq6b.execute-api.us-east-1.amazonaws.com/deprecated-bundles', - ) - .then((data) => data.json()) - .then((data: { id: string; chainId: number; type: string }[]) => - data.filter((el) => el.type === 'VAULT'), - ) - - await deprecateVaults(deprecatedVaults.map((vault) => vault.id)) -} - -async function extract() { - const result = await Promise.allSettled( - STEER_SUPPORTED_CHAIN_IDS.map((chainId) => - extractChain(chainId).catch((e) => { - console.log( - 'Steer: Extract failed for chain', - chainName[chainId], - e.message, - ) - throw e - }), - ), - ) - - return result.filter(isPromiseFulfilled).map((r) => r.value) -} - -async function extractChain(chainId: SteerChainId) { - const { getPools } = await import('@sushiswap/client') - - const prices = await getTokenPrices({ chainId }) - const vaults = await getSteerVaults( - { - chainId, - first: Infinity, - }, - { retries: 3 }, - ) - - const poolIds = vaults - .filter((vault) => !!vault.pool) - .map((vault) => vault.pool.id) - - const pools = [] as Awaited> - - while (poolIds.length > 0) { - const poolIdsChunk = poolIds.splice(0, 100) - const poolsChunk = await getPools({ - ids: poolIdsChunk as ID[], - chainIds: [chainId], - }) - pools.push(...poolsChunk) - } - - const payloadIpfsHashes = vaults.map((vault) => vault.payloadIpfs) - const payloads: Awaited> = [] - - while (payloadIpfsHashes.length > 0) { - const payloadIpfsHashesChunk = payloadIpfsHashes.splice(0, 10) - const payloadsChunk = await getStrategiesPayloads({ - payloadHashes: payloadIpfsHashesChunk, - }) - payloads.push(...payloadsChunk) - } - - let aprs - - try { - aprs = await getVaultAprs({ chainId }) - } catch (e: any) { - console.error(`Failed to fetch aprs for chainId: ${chainId}`, e.message) - aprs = {} - } - - const vaultsWithPayloads = await Promise.allSettled( - vaults.map(async (vault, i) => { - const pool = pools.find((pool) => pool.id === vault.pool.id) - - const { - apr1d = null, - apr1w = null, - apr1m = null, - apr = null, - } = aprs[vault.id] || {} - - const payload = payloads[i] - - const token0Price = prices[vault.token0.address.toLowerCase()] || 0 - const token1Price = prices[vault.token1.address.toLowerCase()] || 0 - - const reserve0USD = pool - ? (Number(vault.reserve0) / 10 ** pool.token0.decimals) * token0Price - : 0 - const fees0USD = pool - ? (Number(vault.fees0) / 10 ** pool.token0.decimals) * token0Price - : 0 - - const reserve1USD = pool - ? (Number(vault.reserve1) / 10 ** pool.token1.decimals) * token1Price - : 0 - const fees1USD = pool - ? (Number(vault.fees1) / 10 ** pool.token1.decimals) * token1Price - : 0 - - const reserveUSD = reserve0USD + reserve1USD - const feesUSD = Number(fees0USD) + Number(fees1USD) - - return { - ...vault, - payload, - apr1d, - apr1w, - apr1m, - apr, - reserve0USD, - fees0USD, - reserve1USD, - fees1USD, - reserveUSD, - feesUSD, - } - }), - ) - - return { - chainId, - vaults: vaultsWithPayloads.filter(isPromiseFulfilled).map((r) => r.value), - } -} - -const StrategyTypes: Record = { - 'Static Super Wide Strategy': SteerStrategy.SuperWide, - 'Classic Rebalance Strategy': SteerStrategy.ClassicRebalance, - 'Classic Rebalance Strategy V2': SteerStrategy.ClassicRebalance, - 'Delta Neutral - Stables': SteerStrategy.DeltaNeutralStables, - 'Stable Expansion Strategy': SteerStrategy.ElasticExpansion, - 'Elastic Expansion Strategy': SteerStrategy.ElasticExpansion, - 'Elastic Expansion Strategy V2': SteerStrategy.ElasticExpansion, - 'High Low Channel Strategy': SteerStrategy.HighLowChannel, - 'High Low Channel Strategy - Medium Range': SteerStrategy.HighLowChannel, - 'High Low Channel Strategy - Narrow Range': SteerStrategy.HighLowChannel, - 'High Low Channel Strategy V2': SteerStrategy.HighLowChannel, - 'Moving Volatility Channel': SteerStrategy.MovingVolatilityChannel, - 'Moving Volatility Channel Strategy': SteerStrategy.MovingVolatilityChannel, - 'Moving Volatility Channel Strategy - Medium': - SteerStrategy.MovingVolatilityChannel, - 'Moving Volatility Strategy V2': SteerStrategy.MovingVolatilityChannel, - 'Moving Volatility Strategy V2.': SteerStrategy.MovingVolatilityChannel, - 'Moving Volatility Channel Strategy V2': - SteerStrategy.MovingVolatilityChannel, - 'Channel Multiplier Strategy': SteerStrategy.ChannelMultiplier, - 'Algebra Channel Multiplier': SteerStrategy.ChannelMultiplier, - 'MIM-USDC Stable Strategy': SteerStrategy.StaticStable, - 'Relative Static Stable Strategy': SteerStrategy.StaticStable, - 'Generic Static Stable Strategy': SteerStrategy.StaticStable, - 'Static Stable Strategy': SteerStrategy.StaticStable, - 'Static Stable Strategy ': SteerStrategy.StaticStable, - 'Static Stable 1% Strategy': SteerStrategy.StaticStable, - 'Static Stable 0.3% Strategy': SteerStrategy.StaticStable, - 'Static Stable 0.05% Strategy': SteerStrategy.StaticStable, - 'Static Stable Strategy V2': SteerStrategy.StaticStable, - 'Keltner Algo': SteerStrategy.KeltnerAlgo, - 'Bollinger Algo': SteerStrategy.BollingerAlgo, - 'Fixed Percentage Strategy': SteerStrategy.FixedPercentage, - 'Price Multiplier Strategy': SteerStrategy.PriceMultiplier, -} - -function transform( - chainsWithVaults: Awaited>, -): Prisma.SteerVaultCreateManyInput[] { - const vaults = chainsWithVaults.flatMap(({ chainId, vaults }) => - vaults.flatMap((vault) => { - // ! Missing strategies will be ignored - const strategyType = vault?.payload?.strategyConfigData.name - ? StrategyTypes[vault.payload.strategyConfigData.name] - : null - - if (!strategyType) { - return [] - } - - let lastAdjustmentTimestamp = Math.floor( - vault.payload!.strategyConfigData.epochStart, - ) - if (lastAdjustmentTimestamp > 1000000000000) { - lastAdjustmentTimestamp = Math.floor(lastAdjustmentTimestamp / 1000) - } - - return { - id: vault.id.toLowerCase(), - address: vault.address.toLowerCase(), - chainId: chainId, - - poolId: vault.pool.id, - feeTier: Number(vault.feeTier) / 1000000, - - // apr1d, apr1m, apr1y are from the subgraph and inaccurate - apr: vault.apr || 0, - apr1d: vault.apr1d || 0, - apr1w: vault.apr1w || 0, - apr1m: vault.apr1m || 0, - apr1y: 0, - - token0Id: vault.token0.id.toLowerCase(), - reserve0: String(vault.reserve0), - reserve0USD: vault.reserve0USD, - fees0: String(vault.fees0), - fees0USD: vault.fees0USD, - - token1Id: vault.token1.id.toLowerCase(), - reserve1: String(vault.reserve1), - reserve1USD: vault.reserve1USD, - fees1: String(vault.fees1), - fees1USD: vault.fees1USD, - - reserveUSD: vault.reserveUSD, - feesUSD: vault.feesUSD, - - strategy: strategyType, - payloadHash: vault.payloadIpfs, - description: vault.payload!.strategyConfigData.description, - state: 'PendingThreshold', // unused - - performanceFee: 0.15, // currently constant - - lowerTick: vault.lowerTick - ? Number(vault.lowerTick) - : TickMath.MIN_TICK, - upperTick: vault.upperTick - ? Number(vault.upperTick) - : TickMath.MAX_TICK, - - adjustmentFrequency: Number( - vault.payload!.strategyConfigData.epochLength, - ), - lastAdjustmentTimestamp, - - admin: vault.strategyToken.admin, - creator: vault.strategyToken.creator.id, - manager: vault.manager, - } satisfies Prisma.SteerVaultCreateManyInput - }), - ) - console.log(`TRANSFORM: ${vaults.length} vaults`) - return vaults -} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..8760805b7b --- /dev/null +++ b/package-lock.json @@ -0,0 +1,9720 @@ +{ + "name": "sushi", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sushi", + "version": "0.0.0", + "hasInstallScript": true, + "devDependencies": { + "@biomejs/biome": "1.5.2", + "@changesets/changelog-github": "0.4.8", + "@changesets/cli": "2.26.2", + "@types/jest": "29.5.5", + "@types/node": "20", + "dotenv-cli": "6.0.0", + "eslint": "8.43.0", + "eslint-config-turbo": "2.0.5", + "jest": "29.7.0", + "sort-package-json": "2.6.0", + "ts-jest": "29.1.1", + "turbo": "2.0.5" + }, + "engines": { + "node": ">=20.x", + "pnpm": "8.15.8" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.0.tgz", + "integrity": "sha512-P4fwKI2mjEb3ZU5cnMJzvRsRKGBUcs8jvxIoRmr6ufAY9Xk2Bz7JubRTTivkw55c7WQJfTECeqYVa+HZ0FzREg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.24.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.9.tgz", + "integrity": "sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.9", + "@babel/helper-compilation-targets": "^7.24.8", + "@babel/helper-module-transforms": "^7.24.9", + "@babel/helpers": "^7.24.8", + "@babel/parser": "^7.24.8", + "@babel/template": "^7.24.7", + "@babel/traverse": "^7.24.8", + "@babel/types": "^7.24.9", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", + "integrity": "sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.25.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.8.tgz", + "integrity": "sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.24.8", + "@babel/helper-validator-option": "^7.24.8", + "browserslist": "^4.23.1", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", + "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.0.tgz", + "integrity": "sha512-bIkOa2ZJYn7FHnepzr5iX9Kmz8FjIz4UKzJ9zhX3dnYuVW0xul9RuR3skBfoLu+FPTQw90EHW9rJsSZhyLQ3fQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", + "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", + "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", + "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.0.tgz", + "integrity": "sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.0.tgz", + "integrity": "sha512-CzdIU9jdP0dg7HdyB+bHvDJGagUv+qtzZt5rYCWwW6tITNqV9odjp6Qu41gkG0ca5UfdDUWrKkiAnHHdGRnOrA==", + "dev": true, + "license": "MIT", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz", + "integrity": "sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.7.tgz", + "integrity": "sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.0.tgz", + "integrity": "sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.25.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.1.tgz", + "integrity": "sha512-LrHHoWq08ZpmmFqBAzN+hUdWwy5zt7FGa/hVwMcOqW6OVtwqaoD5utfuGYU87JYxdZgLUvktAsn37j/sYR9siA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.0", + "@babel/parser": "^7.25.0", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.0", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/types": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.0.tgz", + "integrity": "sha512-LcnxQSsd9aXOIgmmSpvZ/1yo46ra2ESYyqLcryaBZOghxy5qqOBjvCWP5JfkI8yl9rlxRgdLTTMCQQRcN2hdCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@biomejs/biome": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.5.2.tgz", + "integrity": "sha512-LhycxGQBQLmfv6M3e4tMfn/XKcUWyduDYOlCEBrHXJ2mMth2qzYt1JWypkWp+XmU/7Hl2dKvrP4mZ5W44+nWZw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT OR Apache-2.0", + "bin": { + "biome": "bin/biome" + }, + "engines": { + "node": ">=14.*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/biome" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "1.5.2", + "@biomejs/cli-darwin-x64": "1.5.2", + "@biomejs/cli-linux-arm64": "1.5.2", + "@biomejs/cli-linux-arm64-musl": "1.5.2", + "@biomejs/cli-linux-x64": "1.5.2", + "@biomejs/cli-linux-x64-musl": "1.5.2", + "@biomejs/cli-win32-arm64": "1.5.2", + "@biomejs/cli-win32-x64": "1.5.2" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.5.2.tgz", + "integrity": "sha512-3JVl08aHKsPyf0XL9SEj1lssIMmzOMAn2t1zwZKBiy/mcZdb0vuyMSTM5haMQ/90wEmrkYN7zux777PHEGrGiw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.5.2.tgz", + "integrity": "sha512-QAPW9rZb/AgucUx+ogMg+9eJNipQDqvabktC5Tx4Aqb/mFzS6eDqNP7O0SbGz3DtC5Y2LATEj6o6zKIQ4ZT+3w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.5.2.tgz", + "integrity": "sha512-fVLrUgIlo05rO4cNu+Py5EwwmXnXhWH+8KrNlWkr2weMYjq85SihUsuWWKpmqU+bUVR+m5gwfcIXZVWYVCJMHw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-linux-arm64-musl": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.5.2.tgz", + "integrity": "sha512-Z29SjaOyO4QfajplNXSjLx17S79oPN42D094zjE24z7C7p3NxvLhKLygtSP9emgaXkcoESe2chOzF4IrGy/rlg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-linux-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.5.2.tgz", + "integrity": "sha512-ixqJtUHtF0ho1+1DTZQLAEwHGSqvmvHhAAFXZQoaSdABn+IcITYExlFVA3bGvASy/xtPjRhTx42hVwPtLwMHwg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-linux-x64-musl": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.5.2.tgz", + "integrity": "sha512-ZolquPEjWYUmGeERS8svHOOT7OXEeoriPnV8qptgWJmYF9EO9HUGRn1UtCvdVziDYK+u1A7PxjOdkY1B00ty5A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.5.2.tgz", + "integrity": "sha512-DN4cXSAoFTdjOoh7f+JITj1uQgQSXt+1pVea9bFrpbgip+ZwkONqQq+jUcmFMMehbp9LuiVtNXFz/ReHn6FY7A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.5.2.tgz", + "integrity": "sha512-YvWWXZmk936FdrXqc2jcP6rfsXsNBIs9MKBQQoVXIihwNNRiAaBD9Iwa/ouU1b7Zxq2zETgeuRewVJickFuVOw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT OR Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@changesets/apply-release-plan": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.4.tgz", + "integrity": "sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/config": "^2.3.1", + "@changesets/get-version-range-type": "^0.3.2", + "@changesets/git": "^2.0.0", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "detect-indent": "^6.0.0", + "fs-extra": "^7.0.1", + "lodash.startcase": "^4.4.0", + "outdent": "^0.5.0", + "prettier": "^2.7.1", + "resolve-from": "^5.0.0", + "semver": "^7.5.3" + } + }, + "node_modules/@changesets/assemble-release-plan": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.4.tgz", + "integrity": "sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.3.6", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "semver": "^7.5.3" + } + }, + "node_modules/@changesets/changelog-git": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.1.14.tgz", + "integrity": "sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/types": "^5.2.1" + } + }, + "node_modules/@changesets/changelog-github": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.4.8.tgz", + "integrity": "sha512-jR1DHibkMAb5v/8ym77E4AMNWZKB5NPzw5a5Wtqm1JepAuIF+hrKp2u04NKM14oBZhHglkCfrla9uq8ORnK/dw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/get-github-info": "^0.5.2", + "@changesets/types": "^5.2.1", + "dotenv": "^8.1.0" + } + }, + "node_modules/@changesets/cli": { + "version": "2.26.2", + "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.2.tgz", + "integrity": "sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/apply-release-plan": "^6.1.4", + "@changesets/assemble-release-plan": "^5.2.4", + "@changesets/changelog-git": "^0.1.14", + "@changesets/config": "^2.3.1", + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.3.6", + "@changesets/get-release-plan": "^3.0.17", + "@changesets/git": "^2.0.0", + "@changesets/logger": "^0.0.5", + "@changesets/pre": "^1.0.14", + "@changesets/read": "^0.5.9", + "@changesets/types": "^5.2.1", + "@changesets/write": "^0.2.3", + "@manypkg/get-packages": "^1.1.3", + "@types/is-ci": "^3.0.0", + "@types/semver": "^7.5.0", + "ansi-colors": "^4.1.3", + "chalk": "^2.1.0", + "enquirer": "^2.3.0", + "external-editor": "^3.1.0", + "fs-extra": "^7.0.1", + "human-id": "^1.0.2", + "is-ci": "^3.0.1", + "meow": "^6.0.0", + "outdent": "^0.5.0", + "p-limit": "^2.2.0", + "preferred-pm": "^3.0.0", + "resolve-from": "^5.0.0", + "semver": "^7.5.3", + "spawndamnit": "^2.0.0", + "term-size": "^2.1.0", + "tty-table": "^4.1.5" + }, + "bin": { + "changeset": "bin.js" + } + }, + "node_modules/@changesets/config": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@changesets/config/-/config-2.3.1.tgz", + "integrity": "sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/errors": "^0.1.4", + "@changesets/get-dependents-graph": "^1.3.6", + "@changesets/logger": "^0.0.5", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "fs-extra": "^7.0.1", + "micromatch": "^4.0.2" + } + }, + "node_modules/@changesets/errors": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", + "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "extendable-error": "^0.1.5" + } + }, + "node_modules/@changesets/get-dependents-graph": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.6.tgz", + "integrity": "sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "chalk": "^2.1.0", + "fs-extra": "^7.0.1", + "semver": "^7.5.3" + } + }, + "node_modules/@changesets/get-github-info": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.5.2.tgz", + "integrity": "sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg==", + "dev": true, + "license": "MIT", + "dependencies": { + "dataloader": "^1.4.0", + "node-fetch": "^2.5.0" + } + }, + "node_modules/@changesets/get-release-plan": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.17.tgz", + "integrity": "sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/assemble-release-plan": "^5.2.4", + "@changesets/config": "^2.3.1", + "@changesets/pre": "^1.0.14", + "@changesets/read": "^0.5.9", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3" + } + }, + "node_modules/@changesets/get-version-range-type": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz", + "integrity": "sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@changesets/git": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/git/-/git-2.0.0.tgz", + "integrity": "sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "is-subdir": "^1.1.1", + "micromatch": "^4.0.2", + "spawndamnit": "^2.0.0" + } + }, + "node_modules/@changesets/logger": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz", + "integrity": "sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^2.1.0" + } + }, + "node_modules/@changesets/parse": { + "version": "0.3.16", + "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.3.16.tgz", + "integrity": "sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@changesets/types": "^5.2.1", + "js-yaml": "^3.13.1" + } + }, + "node_modules/@changesets/pre": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.14.tgz", + "integrity": "sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/errors": "^0.1.4", + "@changesets/types": "^5.2.1", + "@manypkg/get-packages": "^1.1.3", + "fs-extra": "^7.0.1" + } + }, + "node_modules/@changesets/read": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.5.9.tgz", + "integrity": "sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/git": "^2.0.0", + "@changesets/logger": "^0.0.5", + "@changesets/parse": "^0.3.16", + "@changesets/types": "^5.2.1", + "chalk": "^2.1.0", + "fs-extra": "^7.0.1", + "p-filter": "^2.1.0" + } + }, + "node_modules/@changesets/types": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", + "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@changesets/write": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.2.3.tgz", + "integrity": "sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.1", + "@changesets/types": "^5.2.1", + "fs-extra": "^7.0.1", + "human-id": "^1.0.2", + "prettier": "^2.7.1" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", + "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/js": { + "version": "8.43.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.43.0.tgz", + "integrity": "sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/console/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/console/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/console/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/console/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/console/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/core/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/core/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/core/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/core/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/reporters/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/reporters/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/reporters/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/reporters/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/reporters/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/reporters/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/transform/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/transform/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/transform/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/transform/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/transform/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/types/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/types/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/types/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@manypkg/find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@manypkg/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.5.5", + "@types/node": "^12.7.1", + "find-up": "^4.1.0", + "fs-extra": "^8.1.0" + } + }, + "node_modules/@manypkg/find-root/node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@manypkg/find-root/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/@manypkg/get-packages": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@manypkg/get-packages/-/get-packages-1.1.3.tgz", + "integrity": "sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.5.5", + "@changesets/types": "^4.0.1", + "@manypkg/find-root": "^1.1.0", + "fs-extra": "^8.1.0", + "globby": "^11.0.0", + "read-yaml-file": "^1.1.0" + } + }, + "node_modules/@manypkg/get-packages/node_modules/@changesets/types": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-4.1.0.tgz", + "integrity": "sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@manypkg/get-packages/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", + "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/is-ci": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/is-ci/-/is-ci-3.0.4.tgz", + "integrity": "sha512-AkCYCmwlXeuH89DagDCzvCAyltI2v9lh3U3DqSg/GrBYoReAaWwxfXCqMx9UV5MajLZ4ZFwZzV4cABGIxk2XRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "ci-info": "^3.1.0" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.5", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.5.tgz", + "integrity": "sha512-ebylz2hnsWR9mYvmBFbXJXr+33UPc4+ZdxyDXh5w0FlPBTfCVN3wPL+kuOiQt3xvrK419v7XWeAs+AeOksafXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "20.14.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.13.tgz", + "integrity": "sha512-+bHoGiZb8UiQ0+WEtmph2IWQCjIqg8MDZMAV+ppRRhUZnquF5mQkP/9vpSwJClEiSM/C7fZZExPzfU0vJTyp8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/yargs": { + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", + "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/babel-jest/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/babel-jest/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/babel-jest/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/babel-jest/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-jest/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/better-path-resolve": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/better-path-resolve/-/better-path-resolve-1.0.0.tgz", + "integrity": "sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-windows": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/breakword": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/breakword/-/breakword-1.0.6.tgz", + "integrity": "sha512-yjxDAYyK/pBvws9H4xKYpLDpYKEH6CzrBPAuXq3x18I+c/2MkVtT3qAr7Oloi6Dss9qNhPVueAAVU1CSeNDIXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "wcwidth": "^1.0.1" + } + }, + "node_modules/browserslist": { + "version": "4.23.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", + "integrity": "sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001640", + "electron-to-chromium": "^1.4.820", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.1.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001643", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz", + "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz", + "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/create-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/create-jest/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/create-jest/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/create-jest/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/create-jest/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/create-jest/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csv": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/csv/-/csv-5.5.3.tgz", + "integrity": "sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "csv-generate": "^3.4.3", + "csv-parse": "^4.16.3", + "csv-stringify": "^5.6.5", + "stream-transform": "^2.1.3" + }, + "engines": { + "node": ">= 0.1.90" + } + }, + "node_modules/csv-generate": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/csv-generate/-/csv-generate-3.4.3.tgz", + "integrity": "sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==", + "dev": true, + "license": "MIT" + }, + "node_modules/csv-parse": { + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-4.16.3.tgz", + "integrity": "sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==", + "dev": true, + "license": "MIT" + }, + "node_modules/csv-stringify": { + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-5.6.5.tgz", + "integrity": "sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==", + "dev": true, + "license": "MIT" + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dataloader": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", + "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dev": true, + "license": "MIT", + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dedent": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", + "integrity": "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/detect-indent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dotenv": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", + "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=10" + } + }, + "node_modules/dotenv-cli": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-6.0.0.tgz", + "integrity": "sha512-qXlCOi3UMDhCWFKe0yq5sg3X+pJAz+RQDiFN38AMSbUrnY3uZshSfDJUAge951OS7J9gwLZGfsBlWRSOYz/TRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "dotenv": "^16.0.0", + "dotenv-expand": "^8.0.1", + "minimist": "^1.2.5" + }, + "bin": { + "dotenv": "cli.js" + } + }, + "node_modules/dotenv-cli/node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dotenv-expand": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-8.0.3.tgz", + "integrity": "sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.2.tgz", + "integrity": "sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "8.43.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.43.0.tgz", + "integrity": "sha512-aaCpf2JqqKesMFGgmRPessmVKjcGXqdlAYLLC3THM8t5nBRZRQ+st5WM/hoJXkdioEXLLbXgclUpM0TXo5HX5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.0.3", + "@eslint/js": "8.43.0", + "@humanwhocodes/config-array": "^0.11.10", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.0", + "eslint-visitor-keys": "^3.4.1", + "espree": "^9.5.2", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-turbo": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/eslint-config-turbo/-/eslint-config-turbo-2.0.5.tgz", + "integrity": "sha512-iE/oD0ZBM6OQFbS/bKnc3UtqhMmJ1IEfqTQ0qCY1CauHm7gj85aRRX/1ydDYKLpu0RupBqzVPybsWxPif9rsig==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-plugin-turbo": "2.0.5" + }, + "peerDependencies": { + "eslint": ">6.6.0" + } + }, + "node_modules/eslint-plugin-turbo": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-turbo/-/eslint-plugin-turbo-2.0.5.tgz", + "integrity": "sha512-nCTXZdaKmdRybBdjnMrDFG+ppLc9toUqB01Hf0pfhkQw8OoC29oJIVPsCSvuL/W58RKD02CNEUrwnVt57t36IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dotenv": "16.0.3" + }, + "peerDependencies": { + "eslint": ">6.6.0" + } + }, + "node_modules/eslint-plugin-turbo/node_modules/dotenv": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/extendable-error": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/extendable-error/-/extendable-error-0.1.7.tgz", + "integrity": "sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-yarn-workspace-root2": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root2/-/find-yarn-workspace-root2-1.2.16.tgz", + "integrity": "sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "micromatch": "^4.0.2", + "pkg-dir": "^4.2.0" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true, + "license": "ISC" + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stdin": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz", + "integrity": "sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/git-hooks-list": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/git-hooks-list/-/git-hooks-list-3.1.0.tgz", + "integrity": "sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/fisker/git-hooks-list?sponsor=1" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true, + "license": "ISC" + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/human-id": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/human-id/-/human-id-1.0.2.tgz", + "integrity": "sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-ci": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", + "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ci-info": "^3.2.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, + "node_modules/is-core-module": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", + "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-subdir": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-subdir/-/is-subdir-1.2.0.tgz", + "integrity": "sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==", + "dev": true, + "license": "MIT", + "dependencies": { + "better-path-resolve": "1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-changed-files/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-circus/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-circus/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-circus/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-circus/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-cli/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-cli/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-cli/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-cli/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-cli/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-config/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-config/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-config/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-diff/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-diff/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-diff/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-diff/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-each/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-each/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-each/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-matcher-utils/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-matcher-utils/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-message-util/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-message-util/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-message-util/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-resolve/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-resolve/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-resolve/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-resolve/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-resolve/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-runner/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runner/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-runner/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-runner/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runner/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-runner/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-runtime/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-runtime/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-runtime/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-snapshot/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-snapshot/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-snapshot/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-snapshot/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-util/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-util/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-util/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-validate/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-validate/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-validate/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-validate/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-validate/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-watcher/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-watcher/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-watcher/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-watcher/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-watcher/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-watcher/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/load-yaml-file": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/load-yaml-file/-/load-yaml-file-0.2.0.tgz", + "integrity": "sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.5", + "js-yaml": "^3.13.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/load-yaml-file/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.startcase": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", + "integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz", + "integrity": "sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "^4.0.2", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/mixme": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/mixme/-/mixme-0.5.10.tgz", + "integrity": "sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/outdent": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/outdent/-/outdent-0.5.0.tgz", + "integrity": "sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/p-filter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz", + "integrity": "sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-map": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/preferred-pm": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.1.4.tgz", + "integrity": "sha512-lEHd+yEm22jXdCphDrkvIJQU66EuLojPPtvZkpKIkiD+l0DMThF/niqZKJSoU8Vl7iuvtmzyMhir9LdVy5WMnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^5.0.0", + "find-yarn-workspace-root2": "1.2.16", + "path-exists": "^4.0.0", + "which-pm": "^2.2.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/preferred-pm/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/preferred-pm/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/preferred-pm/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/preferred-pm/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-yaml-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-1.1.0.tgz", + "integrity": "sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.5", + "js-yaml": "^3.6.1", + "pify": "^4.0.1", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/read-yaml-file/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true, + "license": "MIT" + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true, + "license": "ISC" + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true, + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/smartwrap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/smartwrap/-/smartwrap-2.0.2.tgz", + "integrity": "sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array.prototype.flat": "^1.2.3", + "breakword": "^1.0.5", + "grapheme-splitter": "^1.0.4", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1", + "yargs": "^15.1.0" + }, + "bin": { + "smartwrap": "src/terminal-adapter.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/smartwrap/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/smartwrap/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/smartwrap/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/smartwrap/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/smartwrap/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/smartwrap/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/smartwrap/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/sort-object-keys": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sort-object-keys/-/sort-object-keys-1.1.3.tgz", + "integrity": "sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/sort-package-json": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/sort-package-json/-/sort-package-json-2.6.0.tgz", + "integrity": "sha512-XSQ+lY9bAYA8ZsoChcEoPlgcSMaheziEp1beox1JVxy1SV4F2jSq9+h2rJ+3mC/Dhu9Ius1DLnInD5AWcsDXZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-indent": "^7.0.1", + "detect-newline": "^4.0.0", + "get-stdin": "^9.0.0", + "git-hooks-list": "^3.0.0", + "globby": "^13.1.2", + "is-plain-obj": "^4.1.0", + "sort-object-keys": "^1.1.3" + }, + "bin": { + "sort-package-json": "cli.js" + } + }, + "node_modules/sort-package-json/node_modules/detect-indent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-7.0.1.tgz", + "integrity": "sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + } + }, + "node_modules/sort-package-json/node_modules/detect-newline": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-4.0.1.tgz", + "integrity": "sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sort-package-json/node_modules/globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sort-package-json/node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sort-package-json/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/spawndamnit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawndamnit/-/spawndamnit-2.0.0.tgz", + "integrity": "sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "node_modules/spawndamnit/node_modules/cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "node_modules/spawndamnit/node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "license": "ISC", + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/spawndamnit/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spawndamnit/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spawndamnit/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/spawndamnit/node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", + "dev": true, + "license": "ISC" + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", + "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/stream-transform": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/stream-transform/-/stream-transform-2.1.3.tgz", + "integrity": "sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mixme": "^0.5.1" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/term-size": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", + "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true, + "license": "MIT" + }, + "node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-jest": { + "version": "29.1.1", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", + "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "bs-logger": "0.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "^7.5.3", + "yargs-parser": "^21.0.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "node_modules/ts-jest/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/tty-table": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/tty-table/-/tty-table-4.2.3.tgz", + "integrity": "sha512-Fs15mu0vGzCrj8fmJNP7Ynxt5J7praPXqFN0leZeZBXJwkMxv9cb2D454k1ltrtUSJbZ4yH4e0CynsHLxmUfFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "csv": "^5.5.3", + "kleur": "^4.1.5", + "smartwrap": "^2.0.2", + "strip-ansi": "^6.0.1", + "wcwidth": "^1.0.1", + "yargs": "^17.7.1" + }, + "bin": { + "tty-table": "adapters/terminal-adapter.js" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/tty-table/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/tty-table/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/tty-table/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/tty-table/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tty-table/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/tty-table/node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/tty-table/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/turbo": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/turbo/-/turbo-2.0.5.tgz", + "integrity": "sha512-+6+hcWr4nwuESlKqUc626HMOTd3QT8hUOc9QM45PP1d4nErGkNOgExm4Pcov3in7LTuadMnB0gcd/BuzkEDIPw==", + "dev": true, + "license": "MIT", + "bin": { + "turbo": "bin/turbo" + }, + "optionalDependencies": { + "turbo-darwin-64": "2.0.5", + "turbo-darwin-arm64": "2.0.5", + "turbo-linux-64": "2.0.5", + "turbo-linux-arm64": "2.0.5", + "turbo-windows-64": "2.0.5", + "turbo-windows-arm64": "2.0.5" + } + }, + "node_modules/turbo-darwin-64": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/turbo-darwin-64/-/turbo-darwin-64-2.0.5.tgz", + "integrity": "sha512-t/9XpWYIjOhIHUdwiR47SYBGYHkR1zWLxTkTNKZwCSn8BN0cfjPZ1BR6kcwYGxLGBhtl5GBf6A29nq2K7iwAjg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/turbo-darwin-arm64": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/turbo-darwin-arm64/-/turbo-darwin-arm64-2.0.5.tgz", + "integrity": "sha512-//5y4RJvnal8CttOLBwlaBqblcQb1qTlIxLN+I8O3E3rPuvHOupNKB9ZJxYIQ8oWf8ns8Ec8cxQ0GSBLTJIMtA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/turbo-linux-64": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/turbo-linux-64/-/turbo-linux-64-2.0.5.tgz", + "integrity": "sha512-LDtEDU2Gm8p3lKu//aHXZFRKUCVu68BNF9LQ+HmiCKFpNyK7khpMTxIAAUhDqt+AzlrbxtrxcCpCJaWg1JDjHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/turbo-linux-arm64": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/turbo-linux-arm64/-/turbo-linux-arm64-2.0.5.tgz", + "integrity": "sha512-84wdrzntErBNxkHcwHxiTZdaginQAxGPnwLTyZj8lpUYI7okPoxy3jKpUeMHN3adm3iDedl/x0mYSIvVVkmOiA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/turbo-windows-64": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/turbo-windows-64/-/turbo-windows-64-2.0.5.tgz", + "integrity": "sha512-SgaFZ0VW6kHCJogLNuLEleAauAJx2Y48wazZGVRmBpgSUS2AylXesaBMhJaEScYqLz7mIRn6KOgwM8D4wTxI9g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/turbo-windows-arm64": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/turbo-windows-arm64/-/turbo-windows-arm64-2.0.5.tgz", + "integrity": "sha512-foUxLOZoru0IRNIxm53fkfM4ubas9P0nTFjIcHtd+E8YHeogt8GqTweNre2e6ri1EHDo71emmuQgpuoFCOXZMg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "license": "MIT" + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.1.2", + "picocolors": "^1.0.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/which-pm": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/which-pm/-/which-pm-2.2.0.tgz", + "integrity": "sha512-MOiaDbA5ZZgUjkeMWM5EkJp4loW5ZRoa5bc3/aeMox/PJelMhE6t7S/mLuiY43DBupyxH+S0U1bTui9kWUlmsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-yaml-file": "^0.2.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8.15" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} From e035d08eb6735ffdd3a01013f3e9f506feb7bcfc Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Tue, 30 Jul 2024 13:40:57 +0200 Subject: [PATCH 036/139] refactor: data api url --- .../data-api/queries/analytics/day-buckets.ts | 3 +- .../data-api/queries/pool/top-pools.ts | 9 +- .../data-api/queries/pool/v2-pool.ts | 4 +- .../data-api/queries/pool/v3-pool.ts | 6 +- .../queries/portfolio/portfolio-claimables.ts | 3 +- .../queries/portfolio/portfolio-history.ts | 3 +- .../queries/portfolio/portfolio-positions.ts | 3 +- .../queries/portfolio/portfolio-wallet.ts | 10 ++- .../queries/smart-pool/smart-pools.ts | 7 +- .../data-api/queries/smart-pool/vault.ts | 58 ++++++------ .../data-api/queries/smart-pool/vaults.ts | 4 +- .../data-api/queries/sushi-bar/history.ts | 11 +-- .../data-api/queries/sushi-bar/stats.ts | 11 +-- .../subgraphs/data-api/queries/v2/buckets.ts | 4 +- .../subgraphs/data-api/queries/v2/burns.ts | 3 +- .../subgraphs/data-api/queries/v2/mints.ts | 3 +- .../data-api/queries/v2/positions.ts | 4 +- .../subgraphs/data-api/queries/v2/swaps.ts | 3 +- .../subgraphs/data-api/queries/v3/buckets.ts | 4 +- .../subgraphs/data-api/queries/v3/burns.ts | 3 +- .../subgraphs/data-api/queries/v3/collects.ts | 3 +- .../subgraphs/data-api/queries/v3/mints.ts | 3 +- .../data-api/queries/v3/pools-by-tokens.ts | 90 +++++++++---------- .../subgraphs/data-api/queries/v3/swaps.ts | 3 +- .../src/config/subgraph/subgraphs/data-api.ts | 2 +- 25 files changed, 138 insertions(+), 119 deletions(-) diff --git a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts index 34eab69780..82dacc04eb 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts @@ -2,6 +2,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' import { graphql } from '../../graphql' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' export const AnalyticsDayBucketsQuery = graphql( ` @@ -33,7 +34,7 @@ export async function getAnalyticsDayBuckets( variables: GetAnalyticsDayBuckets, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: AnalyticsDayBucketsQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts index 455b1fc814..67c2207262 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts @@ -1,6 +1,6 @@ import type { VariablesOf } from 'gql.tada' import { type RequestOptions, request } from 'src/lib/request' -// import { SUSHI_DATA_API_V0_URL } from 'sushi/config/subgraph' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const PoolsQuery = graphql( @@ -40,8 +40,11 @@ query Pools($chainId: Int!) { export type GetPools = VariablesOf -export async function getTopPools(variables: GetPools, options?: RequestOptions) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` +export async function getTopPools( + variables: GetPools, + options?: RequestOptions, +) { + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: PoolsQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts index 51714be02f..b24a6e07e4 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts @@ -13,8 +13,10 @@ import { type PoolWithIncentives, } from 'sushi' import { isSushiSwapV2ChainId } from 'sushi/config' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import type { Address } from 'viem' import { graphql } from '../../graphql' + export const V2PoolQuery = graphql( ` query V2Pool($address: String!, $chainId: Int!) { @@ -89,7 +91,7 @@ export async function getV2Pool( variables: GetV2Pool, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const chainId = Number(variables.chainId) as ChainId if (!isSushiSwapV2ChainId(chainId)) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts index 4212942cdf..9778c434d7 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts @@ -14,8 +14,10 @@ import { type PoolWithIncentives, } from 'sushi' import { isSushiSwapV3ChainId } from 'sushi/config' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import type { Address } from 'viem' import { graphql } from '../../graphql' + export const V3PoolQuery = graphql( ` query V3Pool($address: String!, $chainId: Int!) { @@ -98,7 +100,7 @@ export async function getV3Pool( variables: GetV3Pool, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const chainId = Number(variables.chainId) as ChainId if (!isSushiSwapV3ChainId(chainId)) { @@ -202,4 +204,4 @@ export async function getV3Pool( export type MaybeV3Pool = Awaited> -export type V3Pool = NonNullable>> \ No newline at end of file +export type V3Pool = NonNullable>> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-claimables.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-claimables.ts index e254eccc58..1536041d9c 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-claimables.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-claimables.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const PortfolioClaimablesQuery = graphql( @@ -203,7 +204,7 @@ export async function getPortfolioClaimables( variables: GetPortfolioClaimables, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: PortfolioClaimablesQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-history.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-history.ts index 4b8e931610..dbcb7f49ea 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-history.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-history.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const PortfolioHistoryQuery = graphql( @@ -64,7 +65,7 @@ export async function getPortfolioHistory( variables: GetPortfolioHistory, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: PortfolioHistoryQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-positions.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-positions.ts index c1a26192ec..3cd0e7e82c 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-positions.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-positions.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const PortfolioPositionsQuery = graphql( @@ -183,7 +184,7 @@ export async function getPortfolioPositions( variables: GetPortfolioPositions, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: PortfolioPositionsQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-wallet.ts b/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-wallet.ts index ee30b7d852..3d7f87d580 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-wallet.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/portfolio/portfolio-wallet.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const PortfolioWalletQuery = graphql( @@ -36,8 +37,11 @@ export const PortfolioWalletQuery = graphql( export type GetPortfolioWallet = VariablesOf -export async function getPortfolioWallet(variables: GetPortfolioWallet, options?: RequestOptions) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` +export async function getPortfolioWallet( + variables: GetPortfolioWallet, + options?: RequestOptions, +) { + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: PortfolioWalletQuery, variables }, @@ -51,4 +55,4 @@ export async function getPortfolioWallet(variables: GetPortfolioWallet, options? } export type PortfolioWallet = Awaited> -export type PortfolioWalletToken = PortfolioWallet['tokens'][0] \ No newline at end of file +export type PortfolioWalletToken = PortfolioWallet['tokens'][0] diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts index 0307f0f93f..4b11e9c3a9 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts @@ -1,10 +1,11 @@ import type { VariablesOf } from 'gql.tada' -import { request, type RequestOptions } from 'src/lib/request' -import { graphql } from '../../graphql' import { isSteerStrategy, type SteerStrategy } from '@sushiswap/steer-sdk' +import { request, type RequestOptions } from 'src/lib/request' import type { ChainId } from 'sushi' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import type { Address } from 'viem' +import { graphql } from '../../graphql' export const SmartPoolsQuery = graphql( ` @@ -59,7 +60,7 @@ export async function getSmartPools( variables: GetSmartPools, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: SmartPoolsQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts index a503d8ce2c..8884acf007 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts @@ -1,9 +1,10 @@ -import type { VariablesOf } from 'gql.tada' +import type { SteerChainId } from '@sushiswap/steer-sdk' import { SteerStrategy } from '@sushiswap/steer-sdk' +import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' -import { graphql } from '../../graphql' -import type { SteerChainId } from '@sushiswap/steer-sdk' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import type { Address } from 'viem' +import { graphql } from '../../graphql' export const VaultQuery = graphql( ` @@ -65,11 +66,8 @@ export const VaultQuery = graphql( export type GetVault = VariablesOf -export async function getVault( - variables: GetVault, - options?: RequestOptions, -) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` +export async function getVault(variables: GetVault, options?: RequestOptions) { + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: VaultQuery, variables }, @@ -79,29 +77,29 @@ export async function getVault( const vault = result.vault const strategy = SteerStrategy[vault.strategy as keyof typeof SteerStrategy] if (!strategy) throw new Error('No strategy found') - return { - ...vault, + return { + ...vault, + chainId: vault.chainId as SteerChainId, + id: `${vault.chainId}:${vault.id}` as `${string}:0x${string}`, + address: vault.address as Address, + reserve0: BigInt(vault.reserve0), + reserve1: BigInt(vault.reserve1), + fees0: BigInt(vault.fees0), + fees1: BigInt(vault.fees1), + token0: { + ...vault.token0, + id: `${vault.chainId}:${vault.token0.address}` as `${string}:0x${string}`, + address: vault.token0.address as Address, chainId: vault.chainId as SteerChainId, - id: `${vault.chainId}:${vault.id}` as `${string}:0x${string}`, - address: vault.address as Address, - reserve0: BigInt(vault.reserve0), - reserve1: BigInt(vault.reserve1), - fees0: BigInt(vault.fees0), - fees1: BigInt(vault.fees1), - token0: { - ...vault.token0, - id: `${vault.chainId}:${vault.token0.address}` as `${string}:0x${string}`, - address: vault.token0.address as Address, - chainId: vault.chainId as SteerChainId, - }, - token1: { - ...vault.token1, - id: `${vault.chainId}:${vault.token1.address}` as `${string}:0x${string}`, - address: vault.token1.address as Address, - chainId: vault.chainId as SteerChainId, - }, - strategy, - } + }, + token1: { + ...vault.token1, + id: `${vault.chainId}:${vault.token1.address}` as `${string}:0x${string}`, + address: vault.token1.address as Address, + chainId: vault.chainId as SteerChainId, + }, + strategy, + } } throw new Error('No smart pool found') diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts index a44aa8898e..589fa8d434 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts @@ -2,6 +2,7 @@ import type { SteerChainId } from '@sushiswap/steer-sdk' import { SteerStrategy } from '@sushiswap/steer-sdk' import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import type { Address } from 'viem' import { graphql } from '../../graphql' import type { VaultV1 } from './vault' @@ -70,7 +71,7 @@ export async function getVaults( variables: GetVaults, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: VaultsQuery, variables }, @@ -110,4 +111,3 @@ export async function getVaults( throw new Error('No smart pool found') } - diff --git a/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/history.ts b/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/history.ts index c7f4799305..9f49e569dc 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/history.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/history.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const SushiBarHistory = graphql( @@ -39,15 +40,13 @@ export const SushiBarHistory = graphql( `, ) -export type GetSushiBarHistory = VariablesOf< - typeof SushiBarHistory -> +export type GetSushiBarHistory = VariablesOf export async function getSushiBarHistory( variables: GetSushiBarHistory, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: SushiBarHistory, variables }, @@ -60,6 +59,4 @@ export async function getSushiBarHistory( throw new Error('No sushi bar history found') } -export type SushiBarHistory = Awaited< - ReturnType -> +export type SushiBarHistory = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts b/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts index 0a10eac699..4e213fc1c9 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const SushiBarStats = graphql( @@ -22,15 +23,13 @@ query SushiBarStats { `, ) -export type GetSushiBarStats = VariablesOf< - typeof SushiBarStats -> +export type GetSushiBarStats = VariablesOf export async function getSushiBarStats( variables: GetSushiBarStats, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: SushiBarStats, variables }, @@ -43,6 +42,4 @@ export async function getSushiBarStats( throw new Error('No sushi bar stats found') } -export type SushiBarStats = Awaited< - ReturnType -> +export type SushiBarStats = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts index 8b5f7f882b..186ff566cc 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v2/buckets.ts @@ -3,7 +3,9 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' import { ChainId } from 'sushi' import { isSushiSwapV2ChainId } from 'sushi/config' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' + export const V2PoolBucketsQuery = graphql( ` query V2PoolBuckets($address: String!, $chainId: Int!) { @@ -35,7 +37,7 @@ export async function getV2PoolBuckets( variables: GetV2PoolBuckets, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const chainId = Number(variables.chainId) as ChainId if (!isSushiSwapV2ChainId(chainId)) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v2/burns.ts b/packages/graph-client/src/subgraphs/data-api/queries/v2/burns.ts index 111fae0821..26e12178cf 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v2/burns.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v2/burns.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const SushiV2BurnsQuery = graphql(` @@ -28,7 +29,7 @@ export async function getSushiV2Burns( { ...variables }: GetSushiV2Burns, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: SushiV2BurnsQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v2/mints.ts b/packages/graph-client/src/subgraphs/data-api/queries/v2/mints.ts index 7e9fcaa8f7..d3e6b6cbf9 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v2/mints.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v2/mints.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const SushiV2MintsQuery = graphql(` @@ -28,7 +29,7 @@ export async function getSushiV2Mints( { ...variables }: GetSushiV2Mints, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: SushiV2MintsQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v2/positions.ts b/packages/graph-client/src/subgraphs/data-api/queries/v2/positions.ts index 7956d27df2..58a4ce00e6 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v2/positions.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v2/positions.ts @@ -3,7 +3,9 @@ import { request, type RequestOptions } from 'src/lib/request' import { ChainId, ChefType, RewarderType, SushiSwapProtocol } from 'sushi' import { isSushiSwapV2ChainId } from 'sushi/config' import { getAddress, type Address } from 'viem' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' + export const V2PositionsQuery = graphql( ` query V2PositionsQuery($user: String!, $chainId: Int!) { @@ -72,7 +74,7 @@ export async function getV2Positions( variables: GetV2Positions, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const chainId = Number(variables.chainId) as ChainId if (!isSushiSwapV2ChainId(chainId)) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v2/swaps.ts b/packages/graph-client/src/subgraphs/data-api/queries/v2/swaps.ts index bd37d31122..cf1587493f 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v2/swaps.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v2/swaps.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const SushiV2SwapsQuery = graphql(` @@ -30,7 +31,7 @@ export async function getSushiV2Swaps( { ...variables }: GetSushiV2Swaps, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: SushiV2SwapsQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts index 7e54ca1c47..d50bc241ac 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/buckets.ts @@ -3,7 +3,9 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' import { ChainId } from 'sushi' import { isSushiSwapV3ChainId } from 'sushi/config' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' + export const V3PoolBucketsQuery = graphql( ` query V3PoolBuckets($address: String!, $chainId: Int!) { @@ -35,7 +37,7 @@ export async function getV3PoolBuckets( variables: GetV3PoolBuckets, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const chainId = Number(variables.chainId) as ChainId if (!isSushiSwapV3ChainId(chainId)) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/burns.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/burns.ts index f59bf9bc2f..c5d36e02a0 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/burns.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/burns.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const SushiV3BurnsQuery = graphql(` @@ -29,7 +30,7 @@ export async function getSushiV3Burns( { ...variables }: GetSushiV3Burns, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: SushiV3BurnsQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/collects.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/collects.ts index 37dd11f87e..cb6e7fe971 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/collects.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/collects.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const SushiV3CollectsQuery = graphql(` @@ -27,7 +28,7 @@ export async function getSushiV3Collects( { ...variables }: GetSushiV3Collects, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: SushiV3CollectsQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/mints.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/mints.ts index 70937bd3f7..b65dda679b 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/mints.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/mints.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const SushiV3MintsQuery = graphql(` @@ -30,7 +31,7 @@ export async function getSushiV3Mints( { ...variables }: GetSushiV3Mints, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: SushiV3MintsQuery, variables }, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts index f61b83ab81..2bd829088e 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts @@ -1,15 +1,12 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' -import { - ChainId, - SushiSwapProtocol, - type PoolBase, - type PoolV3 -} from 'sushi' +import { ChainId, SushiSwapProtocol, type PoolBase, type PoolV3 } from 'sushi' import { isSushiSwapV3ChainId } from 'sushi/config' import type { Address } from 'viem' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' + export const V3PoolsByTokensQuery = graphql( ` query V3PoolsByTokens($token0: String!, $token1: String!, $chainId: Int!) { @@ -63,7 +60,7 @@ export async function getV3BasePoolsByToken( variables: GetV3BasePools, options?: RequestOptions, ): Promise[]> { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const chainId = Number(variables.chainId) as ChainId if (!isSushiSwapV3ChainId(chainId)) { @@ -75,49 +72,50 @@ export async function getV3BasePoolsByToken( options, ) if (result.v3PoolsByTokens) { - - return result.v3PoolsByTokens.map((pool) => + return result.v3PoolsByTokens.map( + (pool) => ({ - id: pool.id as `${string}:0x${string}`, - address: pool.address as Address, - chainId, - name: pool.name, - swapFee: pool.swapFee, - protocol: SushiSwapProtocol.SUSHISWAP_V3, - token0: { - id: pool.token0.id as `${string}:0x${string}`, - address: pool.token0.address as Address, - chainId, - decimals: pool.token0.decimals, - name: pool.token0.name, - symbol: pool.token0.symbol, - }, - token1: { - id: pool.token1.id as `${string}:0x${string}`, - address: pool.token1.address as Address, - chainId, - decimals: pool.token1.decimals, - name: pool.token1.name, - symbol: pool.token1.symbol, - }, + id: pool.id as `${string}:0x${string}`, + address: pool.address as Address, + chainId, + name: pool.name, + swapFee: pool.swapFee, + protocol: SushiSwapProtocol.SUSHISWAP_V3, + token0: { + id: pool.token0.id as `${string}:0x${string}`, + address: pool.token0.address as Address, + chainId, + decimals: pool.token0.decimals, + name: pool.token0.name, + symbol: pool.token0.symbol, + }, + token1: { + id: pool.token1.id as `${string}:0x${string}`, + address: pool.token1.address as Address, + chainId, + decimals: pool.token1.decimals, + name: pool.token1.name, + symbol: pool.token1.symbol, + }, - reserve0: BigInt(pool.reserve0), - reserve1: BigInt(pool.reserve1), - liquidity: BigInt(pool.liquidity), - token0Price: pool.token0Price, - token1Price: pool.token1Price, + reserve0: BigInt(pool.reserve0), + reserve1: BigInt(pool.reserve1), + liquidity: BigInt(pool.liquidity), + token0Price: pool.token0Price, + token1Price: pool.token1Price, - sqrtPrice: BigInt(pool.sqrtPrice), - tick: BigInt(pool.tick), - observationIndex: BigInt(pool.observationIndex), - feeGrowthGlobal0X128: BigInt(pool.feeGrowthGlobal0X128), - feeGrowthGlobal1X128: BigInt(pool.feeGrowthGlobal1X128), + sqrtPrice: BigInt(pool.sqrtPrice), + tick: BigInt(pool.tick), + observationIndex: BigInt(pool.observationIndex), + feeGrowthGlobal0X128: BigInt(pool.feeGrowthGlobal0X128), + feeGrowthGlobal1X128: BigInt(pool.feeGrowthGlobal1X128), - liquidityUSD: pool.liquidityUSD, - volumeUSD: pool.volumeUSD, - feesUSD: pool.feesUSD, - txCount: pool.txCount, - } satisfies PoolV3)) + liquidityUSD: pool.liquidityUSD, + volumeUSD: pool.volumeUSD, + feesUSD: pool.feesUSD, + txCount: pool.txCount, + }) satisfies PoolV3, + ) } throw new Error('No pool found') diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/swaps.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/swaps.ts index ff101077c1..75fbec7a3e 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/swaps.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/swaps.ts @@ -1,6 +1,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' export const SushiV3SwapsQuery = graphql(` @@ -29,7 +30,7 @@ export async function getSushiV3Swaps( { ...variables }: GetSushiV3Swaps, options?: RequestOptions, ) { - const url = `https://data-api-production-acb1.up.railway.app/graphql/` + const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( { url, document: SushiV3SwapsQuery, variables }, diff --git a/packages/sushi/src/config/subgraph/subgraphs/data-api.ts b/packages/sushi/src/config/subgraph/subgraphs/data-api.ts index 4be9d61298..0973390905 100644 --- a/packages/sushi/src/config/subgraph/subgraphs/data-api.ts +++ b/packages/sushi/src/config/subgraph/subgraphs/data-api.ts @@ -1,3 +1,3 @@ import { SUSHI_DATA_API_HOST } from '../hosts.js' -export const SUSHI_DATA_API_V0_URL = `${SUSHI_DATA_API_HOST}/graphql` +export const SUSHI_DATA_API_URL = `${SUSHI_DATA_API_HOST}/graphql` From d072a9cab80391fc335950053a94a7aad1c0e7be Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Tue, 30 Jul 2024 18:47:46 +0200 Subject: [PATCH 037/139] refactor: steer types --- .../v3/[address]/smart/[vaultId]/layout.tsx | 11 +-- .../v3/[address]/smart/[vaultId]/page.tsx | 18 ++--- apps/web/src/lib/hooks/api/useVault.ts | 16 +++++ .../Add/SteerPositionAdd.tsx | 4 +- .../Add/SteerPositionAddProvider.tsx | 19 +---- .../Add/SteerPositionAddReviewModal.tsx | 4 +- .../ui/pool/Steer/SteerStrategies/index.ts | 6 +- .../data-api/queries/smart-pool/vault.ts | 70 ++++++++++--------- .../data-api/queries/smart-pool/vaults.ts | 2 +- packages/sushi/src/config/subgraph/hosts.ts | 2 +- 10 files changed, 80 insertions(+), 72 deletions(-) create mode 100644 apps/web/src/lib/hooks/api/useVault.ts diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/layout.tsx index 7c4fa21b3d..8ddaabc0d1 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/layout.tsx @@ -15,18 +15,18 @@ export default async function Layout({ }) { const poolAddress = params.address.toLowerCase() const pool = await unstable_cache( - () => - getV3Pool({ + async () => + await getV3Pool({ chainId: Number(params.chainId), address: poolAddress, }), - ['pool', `${params.chainId}:${poolAddress}`], + ['v3-pool', `${params.chainId}:${poolAddress}`], { revalidate: 60 * 15 }, )() const vault = await unstable_cache( - () => - getVault({ + async () => + await getVault({ chainId: Number(params.chainId), vaultAddress: params.vaultId, }), @@ -35,6 +35,7 @@ export default async function Layout({ )() if (!vault || !pool) { + console.log({pool, vault}) notFound() } diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/page.tsx index a265fcb6fb..6ef333bd90 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/page.tsx @@ -80,8 +80,8 @@ export default async function SteerVaultPage({ const poolAddress = params.address.toLowerCase() const pool = await unstable_cache( - () => - getV3Pool({ + async () => + await getV3Pool({ chainId: Number(params.chainId), address: poolAddress, }), @@ -93,14 +93,20 @@ export default async function SteerVaultPage({ const vaultId = unsanitize(params.vaultId) const vault = await unstable_cache( - () => - getVault({ + async () => + await getVault({ chainId: Number(params.chainId), vaultAddress: params.vaultId, }), ['vault', `${params.chainId}:${params.vaultId}`], { revalidate: 60 * 15 }, )() + + if (!pool || !vault) { + console.log({pool, vault}) + return notFound() + } + const generics = await unstable_cache( async () => await getGenerics(vault), ['steer-vault-generics', vaultId], @@ -111,10 +117,6 @@ export default async function SteerVaultPage({ const Component = SteerStrategyComponents[vault.strategy] - if (!pool || !vault) { - return notFound() - } - return ( diff --git a/apps/web/src/lib/hooks/api/useVault.ts b/apps/web/src/lib/hooks/api/useVault.ts new file mode 100644 index 0000000000..c13245c0ee --- /dev/null +++ b/apps/web/src/lib/hooks/api/useVault.ts @@ -0,0 +1,16 @@ +'use client' + +import { + getVault, + GetVault, + VaultV1, +} from '@sushiswap/graph-client/data-api' +import { useQuery } from '@tanstack/react-query' + +export function useVault(args: GetVault, shouldFetch = true) { + return useQuery({ + queryKey: ['vault', { ...args }], + queryFn: async () => await getVault(args), + enabled: Boolean(shouldFetch && args.chainId), + }) +} diff --git a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx index d0b7fa4062..727f69296a 100644 --- a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx +++ b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx @@ -4,7 +4,6 @@ import { PlusIcon } from '@heroicons/react-v1/solid' import { STEER_PERIPHERY_ADDRESS, SteerChainId, - SteerVault, } from '@sushiswap/steer-sdk' import { Button, DialogTrigger, classNames } from '@sushiswap/ui' import React, { FC, useMemo } from 'react' @@ -21,9 +20,10 @@ import { useSteerPositionAddState, } from './SteerPositionAddProvider' import { SteerPositionAddReviewModal } from './SteerPositionAddReviewModal' +import { VaultV1 } from '@sushiswap/graph-client/data-api' interface SteerPositionAddProps { - vault: SteerVault + vault: VaultV1 } export const SteerPositionAdd: FC = ({ vault }) => { diff --git a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx index de59723067..5b2f692850 100644 --- a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx +++ b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx @@ -1,7 +1,5 @@ 'use client' -import { useSteerVault } from '@sushiswap/client/hooks' -import type { SteerVault } from '@sushiswap/steer-sdk' import { FC, ReactNode, @@ -13,6 +11,7 @@ import { import { Field } from 'src/lib/constants' import { useSteerVaultReserves } from 'src/lib/wagmi/hooks/steer/useSteerVaultReserves' import { Amount, Currency, Token, tryParseAmount } from 'sushi/currency' +import { VaultV1 } from '@sushiswap/graph-client/data-api' interface State { independentField: Field @@ -107,25 +106,13 @@ type UseSteerPositionAddInfoProps = { // account: string | undefined } & ( | { - vaultId: string | undefined - vault?: undefined - } - | { - vaultId?: undefined - vault: SteerVault | undefined + vault: VaultV1 | undefined } ) export function useSteerPositionAddDerivedInfo({ - vault: vaultPassed, - vaultId, + vault, }: UseSteerPositionAddInfoProps) { - const { data: vaultFetched } = useSteerVault({ - args: vaultId || '', - shouldFetch: !vaultPassed && !!vaultId, - }) - - const vault = vaultPassed || vaultFetched const { independentField, typedValue } = useSteerPositionAddState() diff --git a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx index c28051a99b..e9f2687add 100644 --- a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx +++ b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx @@ -3,7 +3,6 @@ import { createErrorToast, createToast } from '@sushiswap/notifications' import { STEER_PERIPHERY_ADDRESS, - SteerVault, isSteerChainId, } from '@sushiswap/steer-sdk' import { steerPeripheryAbi } from '@sushiswap/steer-sdk/abi' @@ -45,9 +44,10 @@ import { useWriteContract } from 'wagmi' import { useTokenAmountDollarValues } from '../../../../../lib/hooks' import { SteerStrategyConfig } from '../../constants' import { useSteerPositionAddDerivedInfo } from './SteerPositionAddProvider' +import { VaultV1 } from '@sushiswap/graph-client/data-api' interface SteerPositionAddReviewModalProps { - vault: SteerVault + vault: VaultV1 onSuccess: () => void successLink?: string children: ReactNode diff --git a/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts b/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts index cc3333fc2e..d2c0dead14 100644 --- a/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts +++ b/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts @@ -1,10 +1,8 @@ import { SteerStrategy } from '@sushiswap/steer-sdk' import { FC } from 'react' -import { SteerVault } from '@sushiswap/steer-sdk' - import { SteerBaseStrategy } from './SteerBaseStrategy' -import { V3Pool } from '@sushiswap/graph-client/data-api' +import { V3Pool, VaultV1 } from '@sushiswap/graph-client/data-api' export interface SteerStrategyGeneric { tokenRatios: { @@ -28,7 +26,7 @@ export interface SteerStrategyGeneric { export type SteerStrategyComponent = FC<{ pool: V3Pool - vault: SteerVault + vault: VaultV1 generic: SteerStrategyGeneric }> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts index 8884acf007..2ddc4c894c 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts @@ -68,41 +68,45 @@ export type GetVault = VariablesOf export async function getVault(variables: GetVault, options?: RequestOptions) { const url = `https://${SUSHI_DATA_API_HOST}` - - const result = await request( - { url, document: VaultQuery, variables }, - options, - ) - if (result) { - const vault = result.vault - const strategy = SteerStrategy[vault.strategy as keyof typeof SteerStrategy] - if (!strategy) throw new Error('No strategy found') - return { - ...vault, - chainId: vault.chainId as SteerChainId, - id: `${vault.chainId}:${vault.id}` as `${string}:0x${string}`, - address: vault.address as Address, - reserve0: BigInt(vault.reserve0), - reserve1: BigInt(vault.reserve1), - fees0: BigInt(vault.fees0), - fees1: BigInt(vault.fees1), - token0: { - ...vault.token0, - id: `${vault.chainId}:${vault.token0.address}` as `${string}:0x${string}`, - address: vault.token0.address as Address, - chainId: vault.chainId as SteerChainId, - }, - token1: { - ...vault.token1, - id: `${vault.chainId}:${vault.token1.address}` as `${string}:0x${string}`, - address: vault.token1.address as Address, + try { + const result = await request( + { url, document: VaultQuery, variables }, + options, + ) + if (result) { + const vault = result.vault + const strategy = + SteerStrategy[vault.strategy as keyof typeof SteerStrategy] + if (!strategy) throw new Error('No strategy found') + return { + ...vault, chainId: vault.chainId as SteerChainId, - }, - strategy, + id: vault.id as `${string}:0x${string}`, + address: vault.address as Address, + reserve0: BigInt(vault.reserve0), + reserve1: BigInt(vault.reserve1), + fees0: BigInt(vault.fees0), + fees1: BigInt(vault.fees1), + token0: { + ...vault.token0, + id: `${vault.chainId}:${vault.token0.address}` as `${string}:0x${string}`, + address: vault.token0.address as Address, + chainId: vault.chainId as SteerChainId, + }, + token1: { + ...vault.token1, + id: `${vault.chainId}:${vault.token1.address}` as `${string}:0x${string}`, + address: vault.token1.address as Address, + chainId: vault.chainId as SteerChainId, + }, + strategy, + } } - } - throw new Error('No smart pool found') + throw new Error('No vault found') + } catch { + return null + } } -export type VaultV1 = Awaited> +export type VaultV1 = NonNullable>> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts index 589fa8d434..5e53c32168 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts @@ -84,7 +84,7 @@ export async function getVaults( return { ...v, chainId: v.chainId as SteerChainId, - id: `${v.chainId}:${v.id}` as `${string}:0x${string}`, + id: v.id as `${string}:0x${string}`, address: v.address as Address, reserve0: BigInt(v.reserve0), reserve1: BigInt(v.reserve1), diff --git a/packages/sushi/src/config/subgraph/hosts.ts b/packages/sushi/src/config/subgraph/hosts.ts index d8f2a77be5..a663a09ce2 100644 --- a/packages/sushi/src/config/subgraph/hosts.ts +++ b/packages/sushi/src/config/subgraph/hosts.ts @@ -33,4 +33,4 @@ const DECENTRALIZED_NETWORK_KEY = export const DECENTRALIZED_HOST_BY_SUBGRAPH_ID = `gateway-arbitrum.network.thegraph.com/api/${DECENTRALIZED_NETWORK_KEY}/subgraphs/id` export const DECENTRALIZED_HOST_BY_DEPLOYMENT_ID = `gateway-arbitrum.network.thegraph.com/api/${DECENTRALIZED_NETWORK_KEY}/deployments/id` -export const SUSHI_DATA_API_HOST = 'data-api-production-acb1.up.railway.app' \ No newline at end of file +export const SUSHI_DATA_API_HOST = 'data-api-production-acb1.up.railway.app/graphql' \ No newline at end of file From eaafa666afe79edc39b95ff7a79665ce8932da71 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 1 Aug 2024 17:40:38 +0200 Subject: [PATCH 038/139] chore: update data api url --- packages/sushi/src/config/subgraph/hosts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sushi/src/config/subgraph/hosts.ts b/packages/sushi/src/config/subgraph/hosts.ts index a663a09ce2..1f6561e69e 100644 --- a/packages/sushi/src/config/subgraph/hosts.ts +++ b/packages/sushi/src/config/subgraph/hosts.ts @@ -33,4 +33,4 @@ const DECENTRALIZED_NETWORK_KEY = export const DECENTRALIZED_HOST_BY_SUBGRAPH_ID = `gateway-arbitrum.network.thegraph.com/api/${DECENTRALIZED_NETWORK_KEY}/subgraphs/id` export const DECENTRALIZED_HOST_BY_DEPLOYMENT_ID = `gateway-arbitrum.network.thegraph.com/api/${DECENTRALIZED_NETWORK_KEY}/deployments/id` -export const SUSHI_DATA_API_HOST = 'data-api-production-acb1.up.railway.app/graphql' \ No newline at end of file +export const SUSHI_DATA_API_HOST = 'data.sushi.com/graphql' \ No newline at end of file From 03f16cb9f25685083a661dde6ba69e804568f258 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 2 Aug 2024 19:50:09 +0700 Subject: [PATCH 039/139] wip --- .../src/app/(evm)/[chainId]/explore/hero.tsx | 154 +++++ .../app/(evm)/[chainId]/explore/layout.tsx | 29 + .../src/app/(evm)/[chainId]/explore/page.tsx | 43 ++ apps/web/src/app/(evm)/[chainId]/layout.tsx | 13 +- .../src/app/(evm)/[chainId]/pool/layout.tsx | 20 - .../web/src/app/(evm)/[chainId]/pool/page.tsx | 26 - .../pool/v2/[address]/(landing)/page.tsx | 12 +- .../v2/[address]/{(landing) => }/layout.tsx | 9 +- .../pool/v2/[address]/manage/page.tsx | 49 ++ .../(evm)/[chainId]/pool/v2/add/layout.tsx | 39 ++ .../app/(evm)/[chainId]/pool/v2/add/page.tsx | 394 ++++++++++++ .../(landing)/manage/[positionId]/page.tsx | 20 + .../v3/[address]/(landing)/manage/page.tsx | 34 + .../pool/v3/[address]/(landing)/page.tsx | 12 +- .../smart/{[vaultId] => [vault]}/layout.tsx | 12 +- .../smart/{[vaultId] => [vault]}/loading.tsx | 0 .../smart/{[vaultId] => [vault]}/page.tsx | 45 +- .../(evm)/[chainId]/pool/v3/add/layout.tsx | 39 ++ .../app/(evm)/[chainId]/pool/v3/add/page.tsx | 210 ++++++ .../[chainId]/positions/(landing)/hero.tsx | 14 + .../[chainId]/positions/(landing)/layout.tsx | 76 +++ .../positions/(landing)/migrate/page.tsx | 7 + .../positions/(landing)}/page.tsx | 11 +- .../positions/(landing)/rewards}/page.tsx | 0 .../app/(evm)/[chainId]/positions/layout.tsx | 9 + .../app/(evm)/analytics/api/bentobox/route.ts | 22 - .../(evm)/analytics/api/furoTokens/route.ts | 21 - .../(evm)/analytics/api/pools/count/route.ts | 30 - .../app/(evm)/analytics/api/pools/route.ts | 36 -- apps/web/src/app/(evm)/analytics/header.tsx | 8 - apps/web/src/app/(evm)/analytics/layout.tsx | 81 --- apps/web/src/app/(evm)/analytics/page.tsx | 24 - apps/web/src/app/(evm)/analytics/pay/page.tsx | 25 - .../src/app/(evm)/analytics/vault/page.tsx | 26 - .../src/app/(evm)/analytics/vault/table.tsx | 146 ----- .../analytics/vault/use-bentobox-tokens.ts | 71 --- apps/web/src/app/(evm)/pool/error.tsx | 49 -- .../lib/hooks/api/useSushiV2UserPositions.ts | 4 +- apps/web/src/lib/hooks/api/useVault.ts | 12 +- .../getConcentratedLiquidityPoolReserves.ts | 29 +- .../useConcentratedLiquidityPoolReserves.ts | 7 +- .../web/src/ui/analytics/furo-token-table.tsx | 136 ---- .../src/ui/analytics/token-page-header.tsx | 59 -- .../ui/analytics/token-page-information.tsx | 89 --- .../web/src/ui/analytics/token-page-pairs.tsx | 140 ---- .../web/src/ui/analytics/token-page-stats.tsx | 42 -- apps/web/src/ui/analytics/token-table.tsx | 0 .../src/ui/explore/global-stats-charts.tsx | 33 + .../ui/{analytics => explore}/tvl-chart.tsx | 82 ++- .../{analytics => explore}/volume-chart.tsx | 85 ++- .../ConcentratedPositionsTable.tsx | 18 +- apps/web/src/ui/pool/ManagePosition.tsx | 16 - apps/web/src/ui/pool/NewPoolsTable.tsx | 250 -------- apps/web/src/ui/pool/PoolPageV2.tsx | 45 +- apps/web/src/ui/pool/PoolPageV3.tsx | 27 +- apps/web/src/ui/pool/PoolPositionProvider.tsx | 31 +- .../ui/pool/PoolPositionStakedProvider.tsx | 34 +- apps/web/src/ui/pool/PoolsFiltersProvider.tsx | 18 +- apps/web/src/ui/pool/PoolsTable.tsx | 353 +++++++---- .../src/ui/pool/PositionQuickHoverTooltip.tsx | 49 +- apps/web/src/ui/pool/PositionsTab.tsx | 17 +- apps/web/src/ui/pool/PositionsTable.tsx | 15 +- apps/web/src/ui/pool/RewardsSection.tsx | 42 +- apps/web/src/ui/pool/SmartPoolsTable.tsx | 600 ------------------ apps/web/src/ui/pool/SmartPositionsTable.tsx | 17 +- apps/web/src/ui/pool/TableFiltersNetwork.tsx | 90 +-- .../src/ui/pool/TableFiltersResetButton.tsx | 18 +- .../{PositionView.tsx => V3PositionView.tsx} | 17 +- 68 files changed, 1754 insertions(+), 2437 deletions(-) create mode 100644 apps/web/src/app/(evm)/[chainId]/explore/hero.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/explore/layout.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/explore/page.tsx delete mode 100644 apps/web/src/app/(evm)/[chainId]/pool/layout.tsx delete mode 100644 apps/web/src/app/(evm)/[chainId]/pool/page.tsx rename apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/{(landing) => }/layout.tsx (86%) create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/manage/page.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v2/add/layout.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/[positionId]/page.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/page.tsx rename apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/{[vaultId] => [vault]}/layout.tsx (88%) rename apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/{[vaultId] => [vault]}/loading.tsx (100%) rename apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/{[vaultId] => [vault]}/page.tsx (76%) create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v3/add/layout.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/positions/(landing)/hero.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/positions/(landing)/layout.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/positions/(landing)/migrate/page.tsx rename apps/web/src/app/(evm)/{pool/(landing)/my-positions => [chainId]/positions/(landing)}/page.tsx (69%) rename apps/web/src/app/(evm)/{pool/(landing)/my-rewards => [chainId]/positions/(landing)/rewards}/page.tsx (100%) create mode 100644 apps/web/src/app/(evm)/[chainId]/positions/layout.tsx delete mode 100644 apps/web/src/app/(evm)/analytics/api/bentobox/route.ts delete mode 100644 apps/web/src/app/(evm)/analytics/api/furoTokens/route.ts delete mode 100644 apps/web/src/app/(evm)/analytics/api/pools/count/route.ts delete mode 100644 apps/web/src/app/(evm)/analytics/api/pools/route.ts delete mode 100644 apps/web/src/app/(evm)/analytics/header.tsx delete mode 100644 apps/web/src/app/(evm)/analytics/layout.tsx delete mode 100644 apps/web/src/app/(evm)/analytics/page.tsx delete mode 100644 apps/web/src/app/(evm)/analytics/pay/page.tsx delete mode 100644 apps/web/src/app/(evm)/analytics/vault/page.tsx delete mode 100644 apps/web/src/app/(evm)/analytics/vault/table.tsx delete mode 100644 apps/web/src/app/(evm)/analytics/vault/use-bentobox-tokens.ts delete mode 100644 apps/web/src/app/(evm)/pool/error.tsx delete mode 100644 apps/web/src/ui/analytics/furo-token-table.tsx delete mode 100644 apps/web/src/ui/analytics/token-page-header.tsx delete mode 100644 apps/web/src/ui/analytics/token-page-information.tsx delete mode 100644 apps/web/src/ui/analytics/token-page-pairs.tsx delete mode 100644 apps/web/src/ui/analytics/token-page-stats.tsx delete mode 100644 apps/web/src/ui/analytics/token-table.tsx create mode 100644 apps/web/src/ui/explore/global-stats-charts.tsx rename apps/web/src/ui/{analytics => explore}/tvl-chart.tsx (78%) rename apps/web/src/ui/{analytics => explore}/volume-chart.tsx (76%) delete mode 100644 apps/web/src/ui/pool/ManagePosition.tsx delete mode 100644 apps/web/src/ui/pool/NewPoolsTable.tsx delete mode 100644 apps/web/src/ui/pool/SmartPoolsTable.tsx rename apps/web/src/ui/pool/{PositionView.tsx => V3PositionView.tsx} (98%) diff --git a/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx new file mode 100644 index 0000000000..a1e0ecfda6 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx @@ -0,0 +1,154 @@ +'use client' + +import { GiftIcon } from '@heroicons/react-v1/outline' +import { LinkExternal, LinkInternal, typographyVariants } from '@sushiswap/ui' +import { Button } from '@sushiswap/ui' +import { Chip } from '@sushiswap/ui' +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuItem, + DropdownMenuTrigger, +} from '@sushiswap/ui' +import { SelectIcon } from '@sushiswap/ui' +import { DiscordIcon } from '@sushiswap/ui/icons/DiscordIcon' +import { FC } from 'react' +import { ChainId } from 'sushi/chain' +import { + SushiSwapV3ChainId, + isSushiSwapV2ChainId, + isSushiSwapV3ChainId, +} from 'sushi/config' +import { useChainId } from 'wagmi' + +export const Hero: FC = () => { + const chainId = useChainId() + + return ( +
+
+
+

+ Put your funds to work
+ by providing liquidity. +

+

+ When you add liquidity to a pool, you can receive a share of its + trading volume and potentially snag extra rewards when there are + incentives involved! +

+
+
+
+ + + + + + + + + +
+ V3 Position + + {isSushiSwapV3ChainId(chainId as SushiSwapV3ChainId) + ? 'New 🔥' + : 'Unavailable'} + +
+

+ Provide liquidity to a V3 liquidity pool. +

+
+
+ {isSushiSwapV2ChainId(chainId as ChainId) ? ( + + +
+ V2 Position +
+

+ Provide liquidity to a V2 liquidity pool. +

+
+
+ ) : null} +
+
+
+
+ +
+
+
+
+ + Looking for a partnership with Sushi? + + +
+
+ Need Help? + +
+
+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx new file mode 100644 index 0000000000..cb725bb649 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx @@ -0,0 +1,29 @@ +import { Container } from '@sushiswap/ui' +import { GlobalStatsCharts } from 'src/ui/explore/global-stats-charts' +import { ChainId } from 'sushi/chain' +import { Hero } from './hero' + +export const metadata = { + title: 'Pools 💦', +} + +export default async function ExploreLayout({ + children, + params: { chainId }, +}: { children: React.ReactNode; params: { chainId: string } }) { + return ( + <> + + +
+ +
+
+
+
+ {children} +
+
+ + ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/explore/page.tsx b/apps/web/src/app/(evm)/[chainId]/explore/page.tsx new file mode 100644 index 0000000000..031e191ca0 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/explore/page.tsx @@ -0,0 +1,43 @@ +import { getTopPools } from '@sushiswap/graph-client/data-api' +import { Container } from '@sushiswap/ui' +import { unstable_cache } from 'next/cache' +import React from 'react' +import { PoolsFiltersProvider } from 'src/ui/pool' +import { PoolsTable } from 'src/ui/pool/PoolsTable' +import { TableFiltersSmartPoolsOnly } from 'src/ui/pool/TableFilterSmartPoolsOnly' +import { TableFiltersFarmsOnly } from 'src/ui/pool/TableFiltersFarmsOnly' +import { TableFiltersNetwork } from 'src/ui/pool/TableFiltersNetwork' +import { TableFiltersPoolType } from 'src/ui/pool/TableFiltersPoolType' +import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' +import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' +import { ChainId } from 'sushi/chain' + +export default async function PoolPage({ + params: { chainId }, +}: { + params: { chainId: string } +}) { + const pools = await unstable_cache( + async () => getTopPools({ chainId: +chainId }), + ['pools', chainId.toString()], + { + revalidate: 60 * 3, + }, + )() + + return ( + + +
+ + + + + + +
+ +
+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/layout.tsx index bd46e1474f..293a1baf59 100644 --- a/apps/web/src/app/(evm)/[chainId]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/layout.tsx @@ -1,15 +1,18 @@ import { HotJar } from '@sushiswap/ui' +import { isSupportedChainId } from 'src/config' import { Header } from './header' +import notFound from './not-found' import { Providers } from './providers' -export const metadata = { - title: 'Pool 💦', -} - export default function PoolLayout({ children, -}: { children: React.ReactNode }) { + params: { chainId }, +}: { children: React.ReactNode; params: { chainId: string } }) { + if (!isSupportedChainId(+chainId)) { + return notFound() + } + return ( <> diff --git a/apps/web/src/app/(evm)/[chainId]/pool/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/layout.tsx deleted file mode 100644 index a98cc77a03..0000000000 --- a/apps/web/src/app/(evm)/[chainId]/pool/layout.tsx +++ /dev/null @@ -1,20 +0,0 @@ -// import { Container } from '@sushiswap/ui' - -// import { Hero } from '../../pool/hero' - -export default async function PoolsLayout({ - children, -}: { children: React.ReactNode }) { - return ( - <> - {/* - - */} -
-
- {children} -
-
- - ) -} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/page.tsx deleted file mode 100644 index 35226a4ed6..0000000000 --- a/apps/web/src/app/(evm)/[chainId]/pool/page.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { getTopPools } from '@sushiswap/graph-client/data-api' -import { Container } from '@sushiswap/ui' -import { unstable_cache } from 'next/cache' -import React from 'react' - -import { NewPoolsTable } from 'src/ui/pool/NewPoolsTable' - -export default async function PoolPage({ - params, -}: { - params: { chainId: string } -}) { - const pools = await unstable_cache( - async () => getTopPools({ chainId: Number(params.chainId) }), - ['pools', params.chainId.toString()], - { - revalidate: 60 * 3, - }, - )() - - return ( - - - - ) -} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx index 25e0cd1bed..d5643b5db4 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx @@ -1,6 +1,5 @@ -import { getV2Pool } from '@sushiswap/graph-client/data-api' +import { V2Pool, getV2Pool } from '@sushiswap/graph-client/data-api' import { unstable_cache } from 'next/cache' -import { notFound } from 'next/navigation' import { PoolPageV2 } from 'src/ui/pool/PoolPageV2' @@ -10,18 +9,13 @@ export default async function PoolPage({ params: { chainId: string; address: string } }) { const { chainId, address } = params - const pool = await unstable_cache( + const pool = (await unstable_cache( async () => await getV2Pool({ chainId: Number(chainId), address }), ['pool', `${chainId}:${address}`], { revalidate: 60 * 3, }, - )() - - // Rockstar C&D - if (!pool || pool.id === '42161:0x0a4f9962e24893a4a7567e52c1ce37d5482365de') { - return notFound() - } + )()) as NonNullable return } diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx similarity index 86% rename from apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx rename to apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx index e296cbc259..4ea0e33e55 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx @@ -3,7 +3,7 @@ import { Breadcrumb, Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' import { headers } from 'next/headers' import { PoolHeader } from 'src/ui/pool/PoolHeader' -import notFound from '../../../../not-found' +import notFound from '../../../not-found' export const metadata = { title: 'Pool 💦', @@ -18,18 +18,17 @@ export default async function Layout({ }) { const { chainId, address } = params const pool = await unstable_cache( - async () => - getV2Pool({ chainId: Number(chainId), address }), + async () => getV2Pool({ chainId: Number(chainId), address }), ['pool', `${chainId}:${address}`], { revalidate: 60 * 15, }, )() - if (!pool) { + // Rockstar C&D + if (!pool || pool.id === '42161:0x0a4f9962e24893a4a7567e52c1ce37d5482365de') { return notFound() } - const headersList = headers() const referer = headersList.get('referer') return ( diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/manage/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/manage/page.tsx new file mode 100644 index 0000000000..03ebb5b40f --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/manage/page.tsx @@ -0,0 +1,49 @@ +import { V2Pool, getV2Pool } from '@sushiswap/graph-client/data-api' +import { Container } from '@sushiswap/ui' +import { unstable_cache } from 'next/cache' +import { + PoolPositionProvider, + PoolPositionRewardsProvider, + PoolPositionStakedProvider, +} from 'src/ui/pool' +import { ManageV2LiquidityCard } from 'src/ui/pool/ManageV2LiquidityCard' +import { PoolMyRewards } from 'src/ui/pool/PoolMyRewards' +import { PoolPosition } from 'src/ui/pool/PoolPosition' + +export default async function ManageV2PoolPage({ + params: { chainId, address, tab }, +}: { + params: { + chainId: string + address: string + tab: 'add' | 'remove' | 'unstake' | 'stake' + } +}) { + const pool = (await unstable_cache( + async () => getV2Pool({ chainId: Number(chainId), address }), + ['pool', `${chainId}:${address}`], + { + revalidate: 60 * 15, + }, + )()) as NonNullable + + return ( + +
+
+ +
+
+ + + + + + + + +
+
+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/add/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/add/layout.tsx new file mode 100644 index 0000000000..7a929e95e8 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/add/layout.tsx @@ -0,0 +1,39 @@ +import { Container, typographyVariants } from '@sushiswap/ui' + +import { BackButton } from 'src/ui/pool/BackButton' + +export const metadata = { + title: 'Pool 💦', +} + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( + <> + +
+
+ +

+ Add Liquidity +

+
+

+ Create a new pool or create a liquidity position on an existing + pool. +

+
+
+
+
+ + {children} + +
+
+ + ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx new file mode 100644 index 0000000000..346523cfe3 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx @@ -0,0 +1,394 @@ +'use client' + +import { PlusIcon } from '@heroicons/react-v1/solid' +import { FormSection } from '@sushiswap/ui' +import { Button } from '@sushiswap/ui' +import { Loader } from '@sushiswap/ui' +import { useRouter } from 'next/navigation' +import React, { + Dispatch, + FC, + ReactNode, + SetStateAction, + useCallback, + useEffect, + useMemo, + useState, +} from 'react' +import { DISABLED_CHAIN_IDS } from 'src/config' +import { APPROVE_TAG_ADD_LEGACY } from 'src/lib/constants' +import { isSushiSwapV2Pool } from 'src/lib/functions' +import { ChainId, TESTNET_CHAIN_IDS } from 'sushi/chain' +import { + SUSHISWAP_V2_ROUTER_ADDRESS, + SUSHISWAP_V2_SUPPORTED_CHAIN_IDS, + defaultCurrency, + defaultQuoteCurrency, + isSushiSwapV2ChainId, + isWNativeSupported, +} from 'sushi/config' +import { Amount, Type, tryParseAmount } from 'sushi/currency' +import { ZERO } from 'sushi/math' +import { SushiSwapV2Pool } from 'sushi/pool/sushiswap-v2' +import { SWRConfig } from 'swr' + +import { Web3Input } from 'src/lib/wagmi/components/web3-input' +import { SushiSwapV2PoolState } from 'src/lib/wagmi/hooks/pools/hooks/useSushiSwapV2Pools' +import { Checker } from 'src/lib/wagmi/systems/Checker' +import { CheckerProvider } from 'src/lib/wagmi/systems/Checker/Provider' +import { PoolFinder } from 'src/lib/wagmi/systems/PoolFinder/PoolFinder' +import { AddSectionPoolShareCardV2 } from 'src/ui/pool/AddSectionPoolShareCardV2' +import { AddSectionReviewModalLegacy } from 'src/ui/pool/AddSectionReviewModalLegacy' +import { SelectNetworkWidget } from 'src/ui/pool/SelectNetworkWidget' +import { SelectTokensWidget } from 'src/ui/pool/SelectTokensWidget' +import notFound from '../../../not-found' + +export default function Page({ params }: { params: { chainId: string } }) { + const chainId = +params.chainId as ChainId + if (!isSushiSwapV2ChainId(chainId)) { + return notFound() + } + + const router = useRouter() + const [token0, setToken0] = useState( + defaultCurrency[chainId as keyof typeof defaultCurrency], + ) + const [token1, setToken1] = useState( + defaultQuoteCurrency[chainId as keyof typeof defaultQuoteCurrency], + ) + + useEffect(() => { + setToken0(defaultCurrency[chainId as keyof typeof defaultCurrency]) + setToken1( + defaultQuoteCurrency[chainId as keyof typeof defaultQuoteCurrency], + ) + }, [chainId]) + + return ( + + + + + } + > + {({ pool: [poolState, pool] }) => { + const title = + !token0 || !token1 ? ( + 'Select Tokens' + ) : [SushiSwapV2PoolState.LOADING].includes( + poolState as SushiSwapV2PoolState, + ) ? ( +
+ +
+ ) : [SushiSwapV2PoolState.EXISTS].includes( + poolState as SushiSwapV2PoolState, + ) ? ( + 'Add Liquidity' + ) : ( + 'Create Pool' + ) + + return ( + <_Add + chainId={chainId} + setChainId={(chainId) => { + if (!isSushiSwapV2ChainId(chainId)) return + router.push(`/${chainId}/pool/v2/add`) + }} + pool={pool as SushiSwapV2Pool | null} + poolState={poolState as SushiSwapV2PoolState} + title={title} + token0={token0} + token1={token1} + setToken0={setToken0} + setToken1={setToken1} + /> + ) + }} +
+
+ ) +} + +interface AddProps { + chainId: ChainId + setChainId(chainId: ChainId): void + pool: SushiSwapV2Pool | null + poolState: SushiSwapV2PoolState + title: ReactNode + token0: Type | undefined + token1: Type | undefined + setToken0: Dispatch> + setToken1: Dispatch> +} + +const _Add: FC = ({ + chainId, + setChainId, + pool, + poolState, + title, + token0, + token1, + setToken0, + setToken1, +}) => { + const [independendField, setIndependendField] = useState(0) + + const [{ input0, input1 }, setTypedAmounts] = useState<{ + input0: string + input1: string + }>({ input0: '', input1: '' }) + + const [parsedInput0, parsedInput1] = useMemo(() => { + if (!token0 || !token1) return [undefined, undefined] + + return [ + tryParseAmount(input0, token0) || Amount.fromRawAmount(token0, 0), + tryParseAmount(input1, token1) || Amount.fromRawAmount(token1, 0), + ] + }, [input0, input1, token0, token1]) + + const noLiquidity = useMemo(() => { + return pool?.reserve0.equalTo(ZERO) && pool.reserve1.equalTo(ZERO) + }, [pool]) + + const onChangeToken0TypedAmount = useCallback( + (value: string) => { + setIndependendField(0) + if (poolState === SushiSwapV2PoolState.NOT_EXISTS || noLiquidity) { + setTypedAmounts((prev) => ({ + ...prev, + input0: value, + })) + } else if (token0 && pool) { + setTypedAmounts({ + input0: value, + input1: '', + }) + } + }, + [noLiquidity, pool, poolState, token0], + ) + + const onChangeToken1TypedAmount = useCallback( + (value: string) => { + setIndependendField(1) + if (poolState === SushiSwapV2PoolState.NOT_EXISTS || noLiquidity) { + setTypedAmounts((prev) => ({ + ...prev, + input1: value, + })) + } else if (token1 && pool) { + setTypedAmounts({ + input0: '', + input1: value, + }) + } + }, + [noLiquidity, pool, poolState, token1], + ) + + const networks = useMemo( + () => + SUSHISWAP_V2_SUPPORTED_CHAIN_IDS.filter( + (chainId) => + !TESTNET_CHAIN_IDS.includes( + chainId as (typeof TESTNET_CHAIN_IDS)[number], + ) && + !DISABLED_CHAIN_IDS.includes( + chainId as (typeof DISABLED_CHAIN_IDS)[number], + ), + ), + [], + ) + + const _setToken0 = useCallback( + (token: Type | undefined) => { + if (token?.id === token1?.id) return + setIndependendField(1) + setTypedAmounts((prev) => ({ ...prev, input0: '' })) + setToken0(token) + }, + [setToken0, token1], + ) + + const _setToken1 = useCallback( + (token: Type | undefined) => { + if (token?.id === token0?.id) return + setIndependendField(0) + setTypedAmounts((prev) => ({ ...prev, input1: '' })) + setToken1(token) + }, + [setToken1, token0], + ) + + useEffect(() => { + // Includes !!pool + if ( + pool?.reserve0.greaterThan(0) && + pool.reserve1.greaterThan(0) && + token0 && + token1 + ) { + if (independendField === 0) { + const parsedAmount = tryParseAmount(input0, token0) + setTypedAmounts({ + input0, + input1: parsedAmount + ? pool.priceOf(token0.wrapped).quote(parsedAmount.wrapped).toExact() + : '', + }) + } + + if (independendField === 1) { + const parsedAmount = tryParseAmount(input1, token1) + setTypedAmounts({ + input0: parsedAmount + ? pool.priceOf(token1.wrapped).quote(parsedAmount.wrapped).toExact() + : '', + input1, + }) + } + } + }, [independendField, pool, input0, input1, token0, token1]) + + return ( + <> + + + +
+ +
+ +
+ + + + + + + {(!pool || isSushiSwapV2Pool(pool)) && + isSushiSwapV2ChainId(chainId) && ( + <> + + + + { + setTypedAmounts({ input0: '', input1: '' }) + }} + > + + + + + + + )} + + + + +
+
+ + ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/[positionId]/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/[positionId]/page.tsx new file mode 100644 index 0000000000..38d41d697b --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/[positionId]/page.tsx @@ -0,0 +1,20 @@ +import { Container, LinkInternal } from '@sushiswap/ui' +import { V3PositionView } from 'src/ui/pool/V3PositionView' + +export default async function V3PositionsPage({ + params, +}: { params: { chainId: string; address: string; position: string } }) { + return ( + +
+ + ← View all positions + + +
+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/page.tsx new file mode 100644 index 0000000000..acc3ad404c --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/page.tsx @@ -0,0 +1,34 @@ +import { V3Pool, getV3Pool } from '@sushiswap/graph-client/data-api' +import { Container } from '@sushiswap/ui' +import { unstable_cache } from 'next/cache' +import { PoolsFiltersProvider } from 'src/ui/pool' +import { ConcentratedPositionsTable } from 'src/ui/pool/ConcentratedPositionsTable' + +export default async function ManageV3PoolPage({ + params, +}: { + params: { chainId: string; address: string } +}) { + const { chainId, address } = params + const pool = (await unstable_cache( + async () => await getV3Pool({ chainId: Number(chainId), address }), + ['pool', `${chainId}:${address}`], + { + revalidate: 60 * 3, + }, + )()) as NonNullable + + return ( + +
+ + + +
+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx index 6d65e4e4c1..a7a52dcbbd 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx @@ -1,6 +1,5 @@ -import { getV3Pool } from '@sushiswap/graph-client/data-api' +import { V3Pool, getV3Pool } from '@sushiswap/graph-client/data-api' import { unstable_cache } from 'next/cache' -import { notFound } from 'next/navigation' import { PoolPageV3 } from 'src/ui/pool/PoolPageV3' @@ -10,18 +9,13 @@ export default async function PoolPage({ params: { chainId: string; address: string } }) { const { chainId, address } = params - const pool = await unstable_cache( + const pool = (await unstable_cache( async () => await getV3Pool({ chainId: Number(chainId), address }), ['pool', `${chainId}:${address}`], { revalidate: 60 * 3, }, - )() - - // Rockstar C&D - if (!pool || pool.id === '42161:0x0a4f9962e24893a4a7567e52c1ce37d5482365de') { - return notFound() - } + )()) as NonNullable return } diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/layout.tsx similarity index 88% rename from apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/layout.tsx rename to apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/layout.tsx index 8ddaabc0d1..6e49646bae 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/layout.tsx @@ -11,16 +11,15 @@ export default async function Layout({ params, }: { children: React.ReactNode - params: { chainId: string; vaultId: string, address: string } + params: { chainId: string; vault: string; address: string } }) { - const poolAddress = params.address.toLowerCase() const pool = await unstable_cache( async () => await getV3Pool({ chainId: Number(params.chainId), - address: poolAddress, + address: params.address, }), - ['v3-pool', `${params.chainId}:${poolAddress}`], + ['pool', `${params.chainId}:${params.address}`], { revalidate: 60 * 15 }, )() @@ -28,14 +27,13 @@ export default async function Layout({ async () => await getVault({ chainId: Number(params.chainId), - vaultAddress: params.vaultId, + vaultAddress: params.vault, }), - ['vault', `${params.chainId}:${params.vaultId}`], + ['vault', `${params.chainId}:${params.vault}`], { revalidate: 60 * 15 }, )() if (!vault || !pool) { - console.log({pool, vault}) notFound() } diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/loading.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/loading.tsx similarity index 100% rename from apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/loading.tsx rename to apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/loading.tsx diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/page.tsx similarity index 76% rename from apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/page.tsx rename to apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/page.tsx index 6ef333bd90..ddca05b2a2 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vaultId]/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/page.tsx @@ -1,8 +1,10 @@ -import { getV3Pool, getVault, VaultV1 } from '@sushiswap/graph-client/data-api' import { - getTokenRatios, - getVaultPositions, -} from '@sushiswap/steer-sdk' + V3Pool, + VaultV1, + getV3Pool, + getVault, +} from '@sushiswap/graph-client/data-api' +import { getTokenRatios, getVaultPositions } from '@sushiswap/steer-sdk' import { Container } from '@sushiswap/ui' import formatDistanceStrict from 'date-fns/formatDistanceStrict' import formatDistanceToNow from 'date-fns/formatDistanceToNow' @@ -13,9 +15,8 @@ import { } from 'src/ui/pool/Steer/SteerStrategies' import { publicClientConfig } from 'sushi/config' import { Token } from 'sushi/currency' -import { formatNumber, unsanitize } from 'sushi/format' +import { formatNumber } from 'sushi/format' import { tickToPrice } from 'sushi/pool/sushiswap-v3' -import notFound from '../../../../../not-found' import { PublicClient, createPublicClient } from 'viem' function getPriceExtremes( @@ -76,40 +77,30 @@ async function getGenerics(vault: VaultV1): Promise { export default async function SteerVaultPage({ params, -}: { params: { chainId: string, vaultId: string, address: string } }) { - - const poolAddress = params.address.toLowerCase() - const pool = await unstable_cache( +}: { params: { chainId: string; vault: string; address: string } }) { + const pool = (await unstable_cache( async () => await getV3Pool({ chainId: Number(params.chainId), - address: poolAddress, + address: params.address, }), - ['pool', `${params.chainId}:${poolAddress}`], + ['pool', `${params.chainId}:${params.address}`], { revalidate: 60 * 15 }, - )() - + )()) as NonNullable - const vaultId = unsanitize(params.vaultId) - - const vault = await unstable_cache( + const vault = (await unstable_cache( async () => - await getVault({ + await getVault({ chainId: Number(params.chainId), - vaultAddress: params.vaultId, + vaultAddress: params.vault, }), - ['vault', `${params.chainId}:${params.vaultId}`], + ['vault', `${params.chainId}:${params.vault}`], { revalidate: 60 * 15 }, - )() - - if (!pool || !vault) { - console.log({pool, vault}) - return notFound() - } + )()) as NonNullable const generics = await unstable_cache( async () => await getGenerics(vault), - ['steer-vault-generics', vaultId], + ['steer-vault-generics', `${params.chainId}:${params.vault}`], { revalidate: 60 * 15, }, diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/add/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/add/layout.tsx new file mode 100644 index 0000000000..7a929e95e8 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/add/layout.tsx @@ -0,0 +1,39 @@ +import { Container, typographyVariants } from '@sushiswap/ui' + +import { BackButton } from 'src/ui/pool/BackButton' + +export const metadata = { + title: 'Pool 💦', +} + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( + <> + +
+
+ +

+ Add Liquidity +

+
+

+ Create a new pool or create a liquidity position on an existing + pool. +

+
+
+
+
+ + {children} + +
+
+ + ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx new file mode 100644 index 0000000000..018dc7a660 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx @@ -0,0 +1,210 @@ +'use client' + +import React, { FC, useMemo, useState } from 'react' +import { SUPPORTED_CHAIN_IDS } from 'src/config' +import { useTokenAmountDollarValues } from 'src/lib/hooks' +import { useConcentratedPositionInfo } from 'src/lib/wagmi/hooks/positions/hooks/useConcentratedPositionInfo' +import { ConcentratedLiquidityProvider } from 'src/ui/pool/ConcentratedLiquidityProvider' +import { + ConcentratedLiquidityURLStateProvider, + useConcentratedLiquidityURLState, +} from 'src/ui/pool/ConcentratedLiquidityURLStateProvider' +import { ConcentratedLiquidityWidget } from 'src/ui/pool/ConcentratedLiquidityWidget' +import { SelectFeeConcentratedWidget } from 'src/ui/pool/SelectFeeConcentratedWidget' +import { SelectNetworkWidget } from 'src/ui/pool/SelectNetworkWidget' +import { SelectPricesWidget } from 'src/ui/pool/SelectPricesWidget' +import { SelectTokensWidget } from 'src/ui/pool/SelectTokensWidget' +import { computeSushiSwapV3PoolAddress } from 'sushi' +import { SUSHISWAP_V3_FACTORY_ADDRESS, isWNativeSupported } from 'sushi/config' +import { tryParseAmount } from 'sushi/currency' +import { SWRConfig } from 'swr' +import { useAccount } from 'wagmi' + +export default function Page() { + return ( + + + + <_Add /> + + + + ) +} + +const _Add: FC = () => { + const { address } = useAccount() + const { + chainId, + token0, + token1, + setToken1, + setToken0, + setNetwork, + feeAmount, + setFeeAmount, + tokensLoading, + tokenId, + switchTokens, + } = useConcentratedLiquidityURLState() + + const [_invert, _setInvert] = useState(false) + const { data: position } = useConcentratedPositionInfo({ + chainId, + token0, + tokenId, + token1, + }) + + const poolAddress = useMemo( + () => + token0 && token1 && feeAmount && chainId + ? computeSushiSwapV3PoolAddress({ + factoryAddress: SUSHISWAP_V3_FACTORY_ADDRESS[chainId], + tokenA: token0.wrapped, + tokenB: token1.wrapped, + fee: feeAmount, + }) + : undefined, + [chainId, feeAmount, token0, token1], + ) + + const fiatAmounts = useMemo( + () => [tryParseAmount('1', token0), tryParseAmount('1', token1)], + [token0, token1], + ) + const _fiatAmountsAsNumber = useTokenAmountDollarValues({ + chainId, + amounts: fiatAmounts, + }) + + return ( + <> + {/*
*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/* */} + {/* ) : (*/} + {/*
*/} + {/* )*/} + {/* }*/} + {/* >*/} + {/* */} + {/* {token0 && !tokensLoading ? (*/} + {/* */} + {/* ) : (*/} + {/*
*/} + {/* )}*/} + {/* {token1 && !tokensLoading ? (*/} + {/* */} + {/* ) : (*/} + {/*
*/} + {/* )}*/} + {/* */} + {/* */} + {/*
*/} + {/*
*/} + {/* {token0 && token1 ? (*/} + {/* <>*/} + {/*

*/} + {/* {token0.symbol}/{token1.symbol}*/} + {/*

*/} + {/*

*/} + {/* SushiSwap V3 • {feeAmount / 10000}%*/} + {/*

*/} + {/* */} + {/* ) : tokensLoading ? (*/} + {/* <>*/} + {/* */} + {/* */} + {/* */} + {/* ) : (*/} + {/* <>*/} + {/* )}*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/* Network*/} + {/*
*/} + {/* {Chain.from(chainId)?.name}*/} + {/*
*/} + {/*
*/} + {/*
*/} + {/* Fee Tier*/} + {/*
{feeAmount / 10000}% Fee
*/} + {/*
*/} + {/*
*/} + {/* Pool Type*/} + {/*
Concentrated Liquidity
*/} + {/*
*/} + {/*
*/} + {/* Current Price*/} + {/* {!isInitialLoading && !pool ? (*/} + {/* N/A*/} + {/* ) : isInitialLoading ? (*/} + {/* */} + {/* ) : token0 && token1 && pool ? (*/} + {/*
*/} + {/* */} + {/*
*/} + {/* ) : null}*/} + {/*
*/} + {/*
*/} + {/*
*/} + + + + + + + ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/positions/(landing)/hero.tsx b/apps/web/src/app/(evm)/[chainId]/positions/(landing)/hero.tsx new file mode 100644 index 0000000000..8d26e88433 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/positions/(landing)/hero.tsx @@ -0,0 +1,14 @@ +import { FC } from 'react' + +export const Hero: FC = () => { + return ( +
+

Manage Liquidity Positions

+

+ You can adjust and claim rewards for your liquidity positions on the + connected network. For V2 pools, you can migrate to increase capital + efficiency. +

+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/positions/(landing)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/positions/(landing)/layout.tsx new file mode 100644 index 0000000000..cabc2d8082 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/positions/(landing)/layout.tsx @@ -0,0 +1,76 @@ +'use client' + +import { Container, LinkInternal } from '@sushiswap/ui' +import { useSearchParams } from 'next/navigation' +import { PathnameButton } from 'src/ui/pathname-button' +import { PoolsFiltersProvider } from 'src/ui/pool' +import { Hero } from './hero' + +export default function TabsLayout({ + children, + params: { chainId }, +}: { + children: React.ReactNode + params: { chainId: string } +}) { + const searchParams = useSearchParams() + + return ( + <> + + + + +
+ + + My Positions + + + + + My Rewards + + + + + Migrate + + +
+
+
+
+ {children} +
+
+ + ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/positions/(landing)/migrate/page.tsx b/apps/web/src/app/(evm)/[chainId]/positions/(landing)/migrate/page.tsx new file mode 100644 index 0000000000..02a4ad4dc9 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/positions/(landing)/migrate/page.tsx @@ -0,0 +1,7 @@ +import React from 'react' + +import { MigrateTabContent } from 'src/ui/pool/MigrateTabContent' + +export default function MigratePage() { + return +} diff --git a/apps/web/src/app/(evm)/pool/(landing)/my-positions/page.tsx b/apps/web/src/app/(evm)/[chainId]/positions/(landing)/page.tsx similarity index 69% rename from apps/web/src/app/(evm)/pool/(landing)/my-positions/page.tsx rename to apps/web/src/app/(evm)/[chainId]/positions/(landing)/page.tsx index ce75c7bbcc..c5475622af 100644 --- a/apps/web/src/app/(evm)/pool/(landing)/my-positions/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/positions/(landing)/page.tsx @@ -2,21 +2,26 @@ import { Container } from '@sushiswap/ui' import React from 'react' +import { ChainId } from 'sushi/chain' import { PositionsTab } from 'src/ui/pool/PositionsTab' import { TableFiltersNetwork } from 'src/ui/pool/TableFiltersNetwork' import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' -export default function MyPositionsPage() { +export default function MyPositionsPage({ + params: { chainId }, +}: { + params: { chainId: string } +}) { return (
- +
- +
) } diff --git a/apps/web/src/app/(evm)/pool/(landing)/my-rewards/page.tsx b/apps/web/src/app/(evm)/[chainId]/positions/(landing)/rewards/page.tsx similarity index 100% rename from apps/web/src/app/(evm)/pool/(landing)/my-rewards/page.tsx rename to apps/web/src/app/(evm)/[chainId]/positions/(landing)/rewards/page.tsx diff --git a/apps/web/src/app/(evm)/[chainId]/positions/layout.tsx b/apps/web/src/app/(evm)/[chainId]/positions/layout.tsx new file mode 100644 index 0000000000..bae85f2f59 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/positions/layout.tsx @@ -0,0 +1,9 @@ +export const metadata = { + title: 'Positions 💦', +} + +export default function PoolLayout({ + children, +}: { children: React.ReactNode }) { + return
{children}
+} diff --git a/apps/web/src/app/(evm)/analytics/api/bentobox/route.ts b/apps/web/src/app/(evm)/analytics/api/bentobox/route.ts deleted file mode 100644 index 3159171c2d..0000000000 --- a/apps/web/src/app/(evm)/analytics/api/bentobox/route.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { NextResponse } from 'next/server' -import { bentoBoxTokensSchema } from 'src/lib/schema' - -import { getBentoBoxTokens } from 'src/lib/graph' - -export const revalidate = 3600 - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url) - const tokenSymbols = searchParams.get('tokenSymbols') - const chainIds = searchParams.get('chainIds') - const result = bentoBoxTokensSchema.safeParse({ tokenSymbols, chainIds }) - if (!result.success) { - return new Response(result.error.message, { status: 422 }) - } - const tokens = await getBentoBoxTokens(result.data) - return NextResponse.json(tokens, { - headers: { - 'Cache-Control': 'public, max-age=60, stale-while-revalidate=600', - }, - }) -} diff --git a/apps/web/src/app/(evm)/analytics/api/furoTokens/route.ts b/apps/web/src/app/(evm)/analytics/api/furoTokens/route.ts deleted file mode 100644 index f28b61b78c..0000000000 --- a/apps/web/src/app/(evm)/analytics/api/furoTokens/route.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { NextResponse } from 'next/server' -import { getFuroTokens } from 'src/lib/graph' -import { furoTokensSchema } from 'src/lib/schema' - -export const revalidate = 3600 - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url) - const tokenSymbols = searchParams.get('tokenSymbols') - const chainIds = searchParams.get('chainIds') - const result = furoTokensSchema.safeParse({ tokenSymbols, chainIds }) - if (!result.success) { - return new Response(result.error.message, { status: 422 }) - } - const tokens = await getFuroTokens(result.data) - return NextResponse.json(tokens, { - headers: { - 'Cache-Control': 'public, max-age=60, stale-while-revalidate=600', - }, - }) -} diff --git a/apps/web/src/app/(evm)/analytics/api/pools/count/route.ts b/apps/web/src/app/(evm)/analytics/api/pools/count/route.ts deleted file mode 100644 index 261db7e93f..0000000000 --- a/apps/web/src/app/(evm)/analytics/api/pools/count/route.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { getPoolCount } from '@sushiswap/client' -import { PoolCountApiSchema } from '@sushiswap/client/api' -import { NextResponse } from 'next/server' - -export const revalidate = 3600 - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url) - const chainIds = searchParams.get('chainIds') - const isIncentivized = searchParams.get('isIncentivized') - const isWhitelisted = searchParams.get('isWhitelisted') - const tokenSymbols = searchParams.get('tokenSymbols') - const protocols = searchParams.get('protocols') - const result = PoolCountApiSchema.safeParse({ - chainIds, - isIncentivized, - isWhitelisted, - tokenSymbols, - protocols, - }) - if (!result.success) { - return new Response(result.error.message, { status: 422 }) - } - const count = await getPoolCount(result.data) - return NextResponse.json(count, { - headers: { - 'Cache-Control': 'public, max-age=60, stale-while-revalidate=600', - }, - }) -} diff --git a/apps/web/src/app/(evm)/analytics/api/pools/route.ts b/apps/web/src/app/(evm)/analytics/api/pools/route.ts deleted file mode 100644 index 67e71cd4ab..0000000000 --- a/apps/web/src/app/(evm)/analytics/api/pools/route.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { getPools } from '@sushiswap/client' -import { PoolsApiSchema } from '@sushiswap/client/api' -import { NextResponse } from 'next/server' - -export const revalidate = 3600 - -export async function GET(request: Request) { - const { searchParams } = new URL(request.url) - const chainIds = searchParams.get('chainIds') - const isIncentivized = searchParams.get('isIncentivized') - const isWhitelisted = searchParams.get('isWhitelisted') - const tokenSymbols = searchParams.get('tokenSymbols') - const protocols = searchParams.get('protocols') - const cursor = searchParams.get('cursor') - const orderBy = searchParams.get('orderBy') - const orderDir = searchParams.get('orderDir') - const result = PoolsApiSchema.safeParse({ - chainIds, - isIncentivized, - isWhitelisted, - tokenSymbols, - protocols, - cursor, - orderBy, - orderDir, - }) - if (!result.success) { - return new Response(result.error.message, { status: 422 }) - } - const pools = await getPools(result.data) - return NextResponse.json(pools, { - headers: { - 'Cache-Control': 'public, max-age=60, stale-while-revalidate=600', - }, - }) -} diff --git a/apps/web/src/app/(evm)/analytics/header.tsx b/apps/web/src/app/(evm)/analytics/header.tsx deleted file mode 100644 index f6bcd3ca85..0000000000 --- a/apps/web/src/app/(evm)/analytics/header.tsx +++ /dev/null @@ -1,8 +0,0 @@ -'use client' - -import { Navigation } from '@sushiswap/ui' -import React, { FC } from 'react' - -export const Header: FC = () => { - return -} diff --git a/apps/web/src/app/(evm)/analytics/layout.tsx b/apps/web/src/app/(evm)/analytics/layout.tsx deleted file mode 100644 index f0a66bc1b9..0000000000 --- a/apps/web/src/app/(evm)/analytics/layout.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { Container, LinkInternal, typographyVariants } from '@sushiswap/ui' -import { HotJar } from '@sushiswap/ui' - -import { Header } from './header' - -import { PathnameButton } from 'src/ui/pool' - -export const metadata = { - title: 'Analytics', -} - -export default function AnalyticsLayout({ - children, -}: { children: React.ReactNode }) { - return ( - <> -
- -
- -
-

- Analytics. -

-

- Providing liquidity to a pool allows you to earn a percentage of - the pools traded volume as well as any extra rewards if the pool - is incentivized. -

-
-
-
-
- -
- - - Sushi Pay - - - - - Sushi Vault - - -
-
-
-
- {children} -
-
-
-
- - - ) -} diff --git a/apps/web/src/app/(evm)/analytics/page.tsx b/apps/web/src/app/(evm)/analytics/page.tsx deleted file mode 100644 index 596437925f..0000000000 --- a/apps/web/src/app/(evm)/analytics/page.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Container } from '@sushiswap/ui' -import { Suspense } from 'react' - -import { TableFiltersFarmsOnly } from 'src/ui/pool/TableFiltersFarmsOnly' -import { TableFiltersNetwork } from 'src/ui/pool/TableFiltersNetwork' -import { TableFiltersPoolType } from 'src/ui/pool/TableFiltersPoolType' -import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' -import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' - -export default function AnalyticsPage() { - return ( - - -
- - - - - -
-
-
- ) -} diff --git a/apps/web/src/app/(evm)/analytics/pay/page.tsx b/apps/web/src/app/(evm)/analytics/pay/page.tsx deleted file mode 100644 index 17ea446a52..0000000000 --- a/apps/web/src/app/(evm)/analytics/pay/page.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Container } from '@sushiswap/ui' -import React, { Suspense } from 'react' - -import { FuroTokenTable } from 'src/ui/analytics/furo-token-table' -import { PoolsFiltersProvider } from 'src/ui/pool' -import { TableFiltersNetwork } from 'src/ui/pool/TableFiltersNetwork' -import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' -import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' - -export default function PayPage() { - return ( - - - -
- - - -
- -
-
-
- ) -} diff --git a/apps/web/src/app/(evm)/analytics/vault/page.tsx b/apps/web/src/app/(evm)/analytics/vault/page.tsx deleted file mode 100644 index ee7f2e0695..0000000000 --- a/apps/web/src/app/(evm)/analytics/vault/page.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { Container } from '@sushiswap/ui' -import React, { Suspense } from 'react' - -import { BentoBoxTokenTable } from './table' - -import { PoolsFiltersProvider } from 'src/ui/pool' -import { TableFiltersNetwork } from 'src/ui/pool/TableFiltersNetwork' -import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' -import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' - -export default function VaultPage() { - return ( - - - -
- - - -
- -
-
-
- ) -} diff --git a/apps/web/src/app/(evm)/analytics/vault/table.tsx b/apps/web/src/app/(evm)/analytics/vault/table.tsx deleted file mode 100644 index a86ff3e386..0000000000 --- a/apps/web/src/app/(evm)/analytics/vault/table.tsx +++ /dev/null @@ -1,146 +0,0 @@ -'use client' - -import { - Badge, - Card, - CardContent, - CardHeader, - CardTitle, - Currency, - DataTable, - SkeletonText, -} from '@sushiswap/ui' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' -import { - ColumnDef, - PaginationState, - SortingState, - TableState, -} from '@tanstack/react-table' -import React, { FC, useMemo, useState } from 'react' -import { formatNumber, formatUSD } from 'sushi/format' - -import { - BentoBoxToken, - GetBentoBoxTokenArgs, - useBentoBoxTokens, -} from './use-bentobox-tokens' - -import { usePoolFilters } from 'src/ui/pool' -import { BentoBoxChainId, isBentoBoxChainId } from 'sushi/config' - -const COLUMNS: ColumnDef[] = [ - { - id: 'tokenName', - header: 'Name', - cell: ({ - row: { - original: { token }, - }, - }) => ( -
-
- - } - > - - -
-
-

{token.symbol}

-

{token.name}

-
-
- ), - meta: { - skeleton: , - }, - }, - { - id: 'liquidity', - header: 'Liquidity', - cell: (props) => { - return formatNumber(props.row.original.liquidity) - }, - meta: { - skeleton: , - }, - }, - { - id: 'liquidityUSD', - header: 'Liquidity (USD)', - accessorFn: (row) => row.liquidityUSD, - cell: (props) => { - return formatUSD(props.row.original.liquidityUSD) - }, - meta: { - skeleton: , - }, - }, -] - -export const BentoBoxTokenTable: FC = () => { - const { chainIds, tokenSymbols } = usePoolFilters() - - const [sorting, setSorting] = useState([ - { id: 'liquidityUSD', desc: true }, - ]) - const [pagination, setPagination] = useState({ - pageIndex: 0, - pageSize: 10, - }) - - const args = useMemo( - () => ({ - chainIds: chainIds.filter(isBentoBoxChainId) as BentoBoxChainId[], - tokenSymbols, - }), - [chainIds, tokenSymbols], - ) - - const { data: bentoBoxTokens, isLoading } = useBentoBoxTokens(args) - - const data = useMemo(() => bentoBoxTokens || [], [bentoBoxTokens]) - - const state: Partial = useMemo(() => { - return { - sorting, - pagination, - } - }, [pagination, sorting]) - - return ( - - - - Tokens{' '} - {bentoBoxTokens?.length ? ( - - ({bentoBoxTokens?.length}) - - ) : null} - - - - - - - ) -} diff --git a/apps/web/src/app/(evm)/analytics/vault/use-bentobox-tokens.ts b/apps/web/src/app/(evm)/analytics/vault/use-bentobox-tokens.ts deleted file mode 100644 index 1ca5f728db..0000000000 --- a/apps/web/src/app/(evm)/analytics/vault/use-bentobox-tokens.ts +++ /dev/null @@ -1,71 +0,0 @@ -'use client' - -import { GetApiInputFromOutput, parseArgs } from '@sushiswap/client' -import type { BentoBoxRebases } from '@sushiswap/graph-client/bentobox' -import { useAllPrices } from '@sushiswap/react-query' -import { useMemo } from 'react' -import { Amount, Token } from 'sushi/currency' - -import { useQuery } from '@tanstack/react-query' -import { bentoBoxTokensSchema } from 'src/lib/schema' - -export type GetBentoBoxTokenArgs = GetApiInputFromOutput< - (typeof bentoBoxTokensSchema)['_input'], - (typeof bentoBoxTokensSchema)['_output'] -> - -export type BentoBoxToken = NonNullable< - ReturnType['data'] ->[number] - -export const getBentoBoxTokensUrl = (args: GetBentoBoxTokenArgs) => - `/analytics/api/bentobox${parseArgs(args)}` - -function useBentoBoxTokens(args: GetBentoBoxTokenArgs) { - const { data: rebases, isInitialLoading } = useQuery({ - queryKey: [getBentoBoxTokensUrl(args)], - queryFn: () => - fetch(getBentoBoxTokensUrl(args)).then((data) => data.json()), - }) - - const { data: prices, isLoading } = useAllPrices() - - return { - data: useMemo( - () => - prices && - rebases?.map((rebase) => { - const token = new Token({ - chainId: rebase.chainId, - decimals: rebase.token.decimals, - address: rebase.id.split(':')[1], - symbol: rebase.token.symbol, - name: rebase.token.name, - }) - - const liquidity = Amount.fromRawAmount(token, rebase.elastic) - - const price = prices?.[token.chainId]?.[token.address] - - return { - id: token.id, - token, - liquidity: parseInt(liquidity.toSignificant(6)), - liquidityUSD: price - ? parseInt( - liquidity - .multiply( - prices?.[token.chainId]?.[token.address].asFraction, - ) - .toSignificant(4), - ) - : 0, - } - }), - [rebases, prices], - ), - isLoading: isLoading || isInitialLoading, - } -} - -export { useBentoBoxTokens } diff --git a/apps/web/src/app/(evm)/pool/error.tsx b/apps/web/src/app/(evm)/pool/error.tsx deleted file mode 100644 index 3d442b8007..0000000000 --- a/apps/web/src/app/(evm)/pool/error.tsx +++ /dev/null @@ -1,49 +0,0 @@ -'use client' - -import { ChevronRightIcon } from '@heroicons/react/20/solid' -import * as Sentry from '@sentry/nextjs' -import { Button, LinkInternal, typographyVariants } from '@sushiswap/ui' -import { useEffect } from 'react' - -export default function ErrorPage({ - error, -}: { error: Error & { digest?: string }; reset: () => void }) { - useEffect(() => { - // Log the error to sentry - Sentry.captureException(error) - }, [error]) - return ( -
-
-

- Something went wrong! -

-
- - -
-
-
- ) -} diff --git a/apps/web/src/lib/hooks/api/useSushiV2UserPositions.ts b/apps/web/src/lib/hooks/api/useSushiV2UserPositions.ts index 6986e836fa..67d0dd93bc 100644 --- a/apps/web/src/lib/hooks/api/useSushiV2UserPositions.ts +++ b/apps/web/src/lib/hooks/api/useSushiV2UserPositions.ts @@ -8,12 +8,12 @@ import { import { useQuery } from '@tanstack/react-query' export function useSushiV2UserPositions( - args: GetV2Positions, + args: Partial, shouldFetch = true, ) { return useQuery({ queryKey: ['v2-positions', args], - queryFn: async () => await getV2Positions(args), + queryFn: async () => await getV2Positions(args as GetV2Positions), enabled: Boolean(shouldFetch && args.chainId && args.user), }) } diff --git a/apps/web/src/lib/hooks/api/useVault.ts b/apps/web/src/lib/hooks/api/useVault.ts index c13245c0ee..0bf7caad5b 100644 --- a/apps/web/src/lib/hooks/api/useVault.ts +++ b/apps/web/src/lib/hooks/api/useVault.ts @@ -1,16 +1,12 @@ 'use client' -import { - getVault, - GetVault, - VaultV1, -} from '@sushiswap/graph-client/data-api' +import { GetVault, VaultV1, getVault } from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' export function useVault(args: GetVault, shouldFetch = true) { - return useQuery({ - queryKey: ['vault', { ...args }], - queryFn: async () => await getVault(args), + return useQuery({ + queryKey: ['vault', args], + queryFn: async () => await getVault(args!), enabled: Boolean(shouldFetch && args.chainId), }) } diff --git a/apps/web/src/lib/wagmi/hooks/pools/actions/getConcentratedLiquidityPoolReserves.ts b/apps/web/src/lib/wagmi/hooks/pools/actions/getConcentratedLiquidityPoolReserves.ts index d5a0e4662a..c00d4738a2 100644 --- a/apps/web/src/lib/wagmi/hooks/pools/actions/getConcentratedLiquidityPoolReserves.ts +++ b/apps/web/src/lib/wagmi/hooks/pools/actions/getConcentratedLiquidityPoolReserves.ts @@ -1,43 +1,30 @@ -import { SUSHISWAP_V3_FACTORY_ADDRESS, SushiSwapV3ChainId } from 'sushi/config' -import { Amount } from 'sushi/currency' -import { - SushiSwapV3Pool, - computeSushiSwapV3PoolAddress, -} from 'sushi/pool/sushiswap-v3' - +import { V3Pool } from '@sushiswap/graph-client/data-api' import { PublicWagmiConfig } from '@sushiswap/wagmi-config' import { getBalance } from '@wagmi/core' +import { Amount, Token } from 'sushi/currency' + export const getConcentratedLiquidityPoolReserves = async ({ pool, - chainId, config, }: { - pool: SushiSwapV3Pool - chainId: SushiSwapV3ChainId + pool: V3Pool config: PublicWagmiConfig }) => { - const address = computeSushiSwapV3PoolAddress({ - factoryAddress: SUSHISWAP_V3_FACTORY_ADDRESS[chainId], - tokenA: pool.token0, - tokenB: pool.token1, - fee: pool.fee, - }) - const [balance1, balance2] = await Promise.all([ getBalance(config, { - address, + address: pool.address, chainId: pool.chainId, token: pool.token0.address, }), getBalance(config, { - address, + address: pool.address, chainId: pool.chainId, token: pool.token1.address, }), ]) return [ - Amount.fromRawAmount(pool.token0, balance1.value), - Amount.fromRawAmount(pool.token1, balance2.value), + Amount.fromRawAmount(new Token(pool.token0), balance1.value), + Amount.fromRawAmount(new Token(pool.token1), balance2.value), ] } diff --git a/apps/web/src/lib/wagmi/hooks/pools/hooks/useConcentratedLiquidityPoolReserves.ts b/apps/web/src/lib/wagmi/hooks/pools/hooks/useConcentratedLiquidityPoolReserves.ts index e1316d8fc0..4b648c159f 100644 --- a/apps/web/src/lib/wagmi/hooks/pools/hooks/useConcentratedLiquidityPoolReserves.ts +++ b/apps/web/src/lib/wagmi/hooks/pools/hooks/useConcentratedLiquidityPoolReserves.ts @@ -1,11 +1,11 @@ +import { V3Pool } from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' import { SushiSwapV3ChainId } from 'sushi/config' -import { SushiSwapV3Pool } from 'sushi/pool/sushiswap-v3' import { useConfig } from 'wagmi' import { getConcentratedLiquidityPoolReserves } from '../actions/getConcentratedLiquidityPoolReserves' interface UseConcentratedLiquidityPoolReserves { - pool: SushiSwapV3Pool | null | undefined + pool: V3Pool | null | undefined chainId: SushiSwapV3ChainId enabled?: boolean } @@ -23,7 +23,7 @@ export const useConcentratedLiquidityPoolReserves = ({ { token0: pool?.token0, token1: pool?.token1, - feeAmount: pool?.fee, + feeAmount: pool?.swapFee, chainId, }, ], @@ -31,7 +31,6 @@ export const useConcentratedLiquidityPoolReserves = ({ if (pool) { return getConcentratedLiquidityPoolReserves({ pool, - chainId, config, }) } diff --git a/apps/web/src/ui/analytics/furo-token-table.tsx b/apps/web/src/ui/analytics/furo-token-table.tsx deleted file mode 100644 index f980fd5ec6..0000000000 --- a/apps/web/src/ui/analytics/furo-token-table.tsx +++ /dev/null @@ -1,136 +0,0 @@ -'use client' - -import { - Badge, - Card, - CardContent, - CardHeader, - CardTitle, - Currency, - DataTable, - SkeletonText, -} from '@sushiswap/ui' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' -import { ColumnDef, PaginationState, SortingState } from '@tanstack/react-table' -import React, { FC, useMemo, useState } from 'react' -import { formatNumber, formatUSD } from 'sushi/format' - -import { isFuroChainId } from 'sushi/config' -import { - FuroToken, - GetFuroTokenArgs, - useFuroTokens, -} from '../../lib/analytics/use-furo-tokens' -import { usePoolFilters } from '../pool' - -const COLUMNS: ColumnDef[] = [ - { - id: 'tokenName', - header: 'Name', - cell: ({ - row: { - original: { token }, - }, - }) => ( -
-
- - } - > - - -
-
-

{token.symbol}

-

{token.name}

-
-
- ), - meta: { - skeleton: , - }, - }, - { - id: 'liquidity', - header: 'Liquidity', - cell: (props) => { - const liquidity = formatNumber(props.row.original.liquidity) - return liquidity === 'NaN' ? '0' : liquidity - }, - meta: { - skeleton: , - }, - }, - { - id: 'liquidityUSD', - header: 'Liquidity (USD)', - accessorFn: (row) => row.liquidityUSD, - cell: (props) => { - return formatUSD(props.row.original.liquidityUSD) - }, - meta: { - skeleton: , - }, - }, -] -export const FuroTokenTable: FC = () => { - const { chainIds, tokenSymbols } = usePoolFilters() - - const [sorting, setSorting] = useState([ - { id: 'liquidityUSD', desc: true }, - ]) - const [pagination, setPagination] = useState({ - pageIndex: 0, - pageSize: 10, - }) - - const args = useMemo( - () => ({ - chainIds: chainIds.filter(isFuroChainId), - tokenSymbols, - }), - [chainIds, tokenSymbols], - ) - - const { data: furoTokens, isLoading } = useFuroTokens(args) - - const data = useMemo(() => furoTokens || [], [furoTokens]) - - return ( - - - - Tokens{' '} - {furoTokens?.length ? ( - - ({furoTokens?.length}) - - ) : null} - - - - - - - ) -} diff --git a/apps/web/src/ui/analytics/token-page-header.tsx b/apps/web/src/ui/analytics/token-page-header.tsx deleted file mode 100644 index 23f67ee4c6..0000000000 --- a/apps/web/src/ui/analytics/token-page-header.tsx +++ /dev/null @@ -1,59 +0,0 @@ -// 'use client' - -// import { Bundle, Token as GraphToken } from '@sushiswap/graph-client' -// import { Button } from '@sushiswap/ui' -// import { Chip } from '@sushiswap/ui' -// import { Currency } from '@sushiswap/ui' -// import { useRouter } from 'next/router' -// import { FC } from 'react' -// import { formatUSD } from 'sushi/format' -// import useSWR from 'swr' -// import { getAddress } from 'viem' - -// import { useTokenFromToken } from '../../lib/hooks/useTokenFromToken' - -// interface TokenHeader { -// token: GraphToken -// } -// export const TokenHeader: FC = ({ token }) => { -// const router = useRouter() -// const _token = useTokenFromToken(token) -// const { data: bundles } = useSWR('/analytics/api/bundles', (url) => -// fetch(url).then((response) => response.json()), -// ) - -// const price = formatUSD( -// token.derivedETH * bundles?.[token.chainId]?.ethPrice, -// ) - -// return ( -//
-//
-//
-//
-// -//
-// -// {_token.name} -// -// {_token.symbol} -//
-// -// {price.includes('NaN') ? '$0.00' : price} -// -//
-// -//
-// ) -// } diff --git a/apps/web/src/ui/analytics/token-page-information.tsx b/apps/web/src/ui/analytics/token-page-information.tsx deleted file mode 100644 index b092859fd6..0000000000 --- a/apps/web/src/ui/analytics/token-page-information.tsx +++ /dev/null @@ -1,89 +0,0 @@ -// 'use client' - -// import { ExternalLinkIcon } from '@heroicons/react-v1/solid' -// import { Token as GraphToken } from '@sushiswap/graph-client' -// import { ClipboardController, LinkExternal } from '@sushiswap/ui' -// import { Currency } from '@sushiswap/ui' -// import { -// Table, -// TableBody, -// TableCell, -// TableHead, -// TableHeader, -// TableRow, -// } from '@sushiswap/ui' -// import { FC } from 'react' -// import { Chain } from 'sushi/chain' -// import { shortenAddress } from 'sushi/format' - -// import { useTokenFromToken } from '../../lib/hooks/useTokenFromToken' - -// interface TokenInformation { -// token: GraphToken -// } - -// export const TokenInformation: FC = ({ token }) => { -// const _token = useTokenFromToken(token) -// const chain = Chain.from(_token.chainId) as Chain - -// return ( -//
-//

Token Information

-//
-// -// -//
Symbol
-//
-// -//
Name
-//
-// -//
Address
-//
-// -//
Action
-//
-//
-// -// -// -//

-// {_token.symbol} -//

-//
-// -//
-// -//

-// {_token.name} -//

-//
-//
-// -// -// {({ setCopied }) => ( -// setCopied(_token.wrapped.address)} -// onKeyDown={() => setCopied(_token.wrapped.address)} -// className="text-sm font-medium" -// > -// {shortenAddress(_token.wrapped.address)} -// -// )} -// -// -// -// -//

View

-// -//
-//
-//
-//
-//
-//
-// ) -// } diff --git a/apps/web/src/ui/analytics/token-page-pairs.tsx b/apps/web/src/ui/analytics/token-page-pairs.tsx deleted file mode 100644 index 1852a9db27..0000000000 --- a/apps/web/src/ui/analytics/token-page-pairs.tsx +++ /dev/null @@ -1,140 +0,0 @@ -// 'use client' - -// import { usePools } from '@sushiswap/client/hooks' -// import { Token as GraphToken } from '@sushiswap/graph-client' -// import { LinkExternal, LinkInternal } from '@sushiswap/ui' -// import { Currency } from '@sushiswap/ui' -// import { -// Table, -// TableBody, -// TableCell, -// TableHead, -// TableHeader, -// TableRow, -// } from '@sushiswap/ui' -// import React, { FC } from 'react' -// import chains from 'sushi/chain' -// import { Native, Token } from 'sushi/currency' -// import { formatPercent, formatUSD } from 'sushi/format' -// import { useSWRConfig } from 'swr' - -// interface TokenPairs { -// token: GraphToken -// } - -// export const TokenPairs: FC = ({ token }) => { -// const { data: pools } = usePools({ -// args: { ids: [...token.pairBase.map(({ pair }) => pair.id), ...token.pairQuote.map(({ pair }) => pair.id)] }, -// swrConfig: useSWRConfig(), -// }) - -// return ( -//
-//

Trending Pairs

-// -// -// -//
Name
-//
-// -//
TVL
-//
-// -//
Volume (7d)
-//
-// -//
APY
-//
-//
-// -// {pools && -// token.pairs.map(({ pair }, i) => { -// const _pool = pools.find((pool) => pool.id === pair.id) - -// const [token0, token1] = [ -// pair.token0.id === Native.onChain(token.chainId).wrapped.address -// ? Native.onChain(token.chainId) -// : new Token({ -// address: pair.token0.id, -// chainId: pair.chainId, -// decimals: Number(pair.token0.decimals), -// symbol: pair.token0.symbol, -// }), -// pair.token1.id === Native.onChain(token.chainId).wrapped.address -// ? Native.onChain(token.chainId) -// : new Token({ -// address: pair.token1.id, -// chainId: pair.chainId, -// decimals: Number(pair.token1.decimals), -// symbol: pair.token1.symbol, -// }), -// ] - -// const liquidityUSD = formatUSD(pair.liquidityUSD) -// const volume1w = formatUSD(pair.volume1w) - -// return ( -// -// -// -//
-// -// -// -// -// -//

-// {token0.symbol}{' '} -// /{' '} -// {token1.symbol} -//

-//
-//
-//
-//
-// -// -//

-// {liquidityUSD.includes('NaN') ? '$0.00' : liquidityUSD} -//

-//
-//
-// -// -//

-// {volume1w.includes('NaN') ? '$0.00' : volume1w} -//

-//
-//
-// -// -//

-// {formatPercent(pair.feeApr)}{' '} -// {/*{pool && pool.incentives.length > 0 && pool.incentiveApr > 0 && (*/} -// {/* */} -// {/*)}*/} -//

-//
-//
-//
-// ) -// })} -//
-//
-//
-// ) -// } diff --git a/apps/web/src/ui/analytics/token-page-stats.tsx b/apps/web/src/ui/analytics/token-page-stats.tsx deleted file mode 100644 index 38228a739a..0000000000 --- a/apps/web/src/ui/analytics/token-page-stats.tsx +++ /dev/null @@ -1,42 +0,0 @@ -// import { Token as GraphToken } from '@sushiswap/graph-client' -// import { FC } from 'react' -// import { formatUSD } from 'sushi/format' - -// interface TokenStatsProps { -// token: GraphToken -// } - -// export const TokenStats: FC = ({ token }) => { -// const tvl = formatUSD(token.liquidityUSD) -// const volume = formatUSD(token.volumeUSD) -// const fees = formatUSD(token.feesUSD) - -// return ( -//
-//
-//

Liquidity

-//

-// {tvl.includes('NaN') ? '$0.00' : tvl} -//

-//
-//
-//

Volume

-//

-// {volume.includes('NaN') ? '$0.00' : volume} -//

-//
-//
-//

Fees

-//

-// {fees.includes('NaN') ? '$0.00' : fees} -//

-//
-//
-//

Market Cap

-//

-// {fees.includes('NaN') ? '$0.00' : fees} -//

-//
-//
-// ) -// } diff --git a/apps/web/src/ui/analytics/token-table.tsx b/apps/web/src/ui/analytics/token-table.tsx deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/apps/web/src/ui/explore/global-stats-charts.tsx b/apps/web/src/ui/explore/global-stats-charts.tsx new file mode 100644 index 0000000000..bfc84cec7b --- /dev/null +++ b/apps/web/src/ui/explore/global-stats-charts.tsx @@ -0,0 +1,33 @@ +import { getAnalyticsDayBuckets } from '@sushiswap/graph-client/data-api' +import { Card } from '@sushiswap/ui' +import { unstable_cache } from 'next/cache' +import { FC } from 'react' +import { ChainId } from 'sushi/chain' +import { TVLChart } from './tvl-chart' +import { VolumeChart } from './volume-chart' + +export const GlobalStatsCharts: FC<{ chainId: ChainId }> = async ({ + chainId, +}) => { + const dayBuckets = await unstable_cache( + async () => + getAnalyticsDayBuckets({ + chainId, + }), + ['dayBuckets', `${chainId}`], + { + revalidate: 60 * 3, + }, + )() + + return ( +
+ +
+ + +
+
+
+ ) +} diff --git a/apps/web/src/ui/analytics/tvl-chart.tsx b/apps/web/src/ui/explore/tvl-chart.tsx similarity index 78% rename from apps/web/src/ui/analytics/tvl-chart.tsx rename to apps/web/src/ui/explore/tvl-chart.tsx index c48ca756b4..63868150f2 100644 --- a/apps/web/src/ui/analytics/tvl-chart.tsx +++ b/apps/web/src/ui/explore/tvl-chart.tsx @@ -16,6 +16,7 @@ import { formatUSD } from 'sushi/format' import tailwindConfig from 'tailwind.config.js' import resolveConfig from 'tailwindcss/resolveConfig' +import { AnalyticsDayBuckets } from '@sushiswap/graph-client/data-api' import ReactEchartsCore from 'echarts-for-react' import { EChartsOption } from 'echarts-for-react/lib/types' import 'echarts/lib/chart/bar' @@ -43,21 +44,39 @@ const chartTimespans: Record = { [TvlChartPeriod.All]: Infinity, } -export const TVLChart: FC<{ x: number[]; y: number[] }> = ({ x, y }) => { +export const TVLChart: FC<{ data: AnalyticsDayBuckets }> = ({ data }) => { const [chartPeriod, setChartPeriod] = useState( TvlChartPeriod.Month, ) const [xData, yData] = useMemo(() => { + const v2Data = data.v2.reverse() + const v3Data = data.v3.reverse() + + const _xData = (v2Data.length > v3Data.length ? v2Data : v3Data).map( + (data) => data.date, + ) + const currentDate = Math.round(Date.now()) - const predicates = x?.map( + const predicates = _xData.map( (x) => x * 1000 >= currentDate - chartTimespans[chartPeriod], ) - return [ - x?.filter((_x, i) => predicates[i]).reverse(), - y?.filter((_y, i) => predicates[i]).reverse(), - ] - }, [chartPeriod, x, y]) + + const yData = { + v2: Array(_xData.length - v2Data.length) + .fill(0) + .concat(v2Data.map((data) => data.liquidityUSD)) + .filter((_, i) => predicates[i]), + v3: Array(_xData.length - v3Data.length) + .fill(0) + .concat(v3Data.map((data) => data.liquidityUSD)) + .filter((_, i) => predicates[i]), + } + + const xData = _xData.filter((_, i) => predicates[i]) + + return [xData, yData] + }, [data, chartPeriod]) // Transient update for performance const onMouseOver = useCallback( @@ -94,13 +113,19 @@ export const TVLChart: FC<{ x: number[]; y: number[] }> = ({ x, y }) => { }, }, formatter: (params: any) => { - onMouseOver({ name: params[0].name, value: params[0].value }) + onMouseOver({ + name: params[0].name, + value: params[0].value + params[1].value, + }) const date = new Date(Number(params[0].name * 1000)) return `
${formatUSD( params[0].value, )} + ${formatUSD( + params[1].value, + )} ${ date instanceof Date && !Number.isNaN(date?.getTime()) ? format(date, 'dd MMM yyyy HH:mm') @@ -146,6 +171,14 @@ export const TVLChart: FC<{ x: number[]; y: number[] }> = ({ x, y }) => { max: 'dataMax', min: 'dataMin', }, + { + show: false, + type: 'value', + scale: true, + name: 'Volume', + max: 'dataMax', + min: 'dataMin', + }, ], series: [ { @@ -165,7 +198,26 @@ export const TVLChart: FC<{ x: number[]; y: number[] }> = ({ x, y }) => { }, animationEasing: 'elasticOut', animationDelayUpdate: (idx: number) => idx * 2, - data: yData, + data: yData.v2, + }, + { + name: 'Volume', + type: 'line', + xAxisIndex: 0, + yAxisIndex: 1, + itemStyle: { + color: 'red', + normal: { + barBorderRadius: 2, + }, + }, + areaStyle: { + // @ts-ignore + color: tailwind.theme.colors.red['500'], + }, + animationEasing: 'elasticOut', + animationDelayUpdate: (idx: number) => idx * 2, + data: yData.v3, }, ], }), @@ -235,13 +287,11 @@ export const TVLChart: FC<{ x: number[]; y: number[] }> = ({ x, y }) => { - {yData?.length ? ( - - {formatUSD(yData[yData.length - 1])} - - ) : ( - - )} + + {formatUSD( + yData.v2[yData.v2.length - 1] + yData.v3[yData.v3.length - 1], + )} + {xData?.length ? ( diff --git a/apps/web/src/ui/analytics/volume-chart.tsx b/apps/web/src/ui/explore/volume-chart.tsx similarity index 76% rename from apps/web/src/ui/analytics/volume-chart.tsx rename to apps/web/src/ui/explore/volume-chart.tsx index aafa38856c..2e60f81f85 100644 --- a/apps/web/src/ui/analytics/volume-chart.tsx +++ b/apps/web/src/ui/explore/volume-chart.tsx @@ -1,5 +1,6 @@ 'use client' +import { AnalyticsDayBuckets } from '@sushiswap/graph-client/data-api' import { CardContent, CardDescription, @@ -36,21 +37,39 @@ const chartTimespans: Record = { [TvlChartPeriod.All]: Infinity, } -export const VolumeChart: FC<{ x: number[]; y: number[] }> = ({ x, y }) => { +export const VolumeChart: FC<{ data: AnalyticsDayBuckets }> = ({ data }) => { const [chartPeriod, setChartPeriod] = useState( TvlChartPeriod.Month, ) const [xData, yData] = useMemo(() => { + const v2Data = data.v2.reverse() + const v3Data = data.v3.reverse() + + const _xData = (v2Data.length > v3Data.length ? v2Data : v3Data).map( + (data) => data.date, + ) + const currentDate = Math.round(Date.now()) - const predicates = x?.map( + const predicates = _xData.map( (x) => x * 1000 >= currentDate - chartTimespans[chartPeriod], ) - return [ - x?.filter((_x, i) => predicates[i]).reverse(), - y?.filter((_y, i) => predicates[i]).reverse(), - ] - }, [chartPeriod, x, y]) + + const yData = { + v2: Array(_xData.length - v2Data.length) + .fill(0) + .concat(v2Data.map((data) => data.volumeUSD)) + .filter((_, i) => predicates[i]), + v3: Array(_xData.length - v3Data.length) + .fill(0) + .concat(v3Data.map((data) => data.volumeUSD)) + .filter((_, i) => predicates[i]), + } + + const xData = _xData.filter((_, i) => predicates[i]) + + return [xData, yData] + }, [data, chartPeriod]) // Transient update for performance const onMouseOver = useCallback( @@ -89,13 +108,19 @@ export const VolumeChart: FC<{ x: number[]; y: number[] }> = ({ x, y }) => { }, }, formatter: (params: any) => { - onMouseOver({ name: params[0].name, value: params[0].value }) + onMouseOver({ + name: params[0].name, + value: params[0].value + params[1].value, + }) const date = new Date(Number(params[0].name * 1000)) return `
${formatUSD( params[0].value, )} + ${formatUSD( + params[1].value, + )} ${ date instanceof Date && !Number.isNaN(date?.getTime()) ? format(date, 'dd MMM yyyy HH:mm') @@ -122,7 +147,7 @@ export const VolumeChart: FC<{ x: number[]; y: number[] }> = ({ x, y }) => { visualMap: { show: false, // @ts-ignore - color: [tailwind.theme.colors.blue['500']], + // color: [tailwind.theme.colors.blue['500']], }, xAxis: [ { @@ -141,6 +166,14 @@ export const VolumeChart: FC<{ x: number[]; y: number[] }> = ({ x, y }) => { max: 'dataMax', min: 'dataMin', }, + { + show: false, + type: 'value', + scale: true, + name: 'Volume', + max: 'dataMax', + min: 'dataMin', + }, ], series: [ { @@ -161,7 +194,27 @@ export const VolumeChart: FC<{ x: number[]; y: number[] }> = ({ x, y }) => { }, animationEasing: 'elasticOut', animationDelayUpdate: (idx: number) => idx * 2, - data: yData, + data: yData.v2, + }, + { + name: 'Volume', + type: 'bar', + xAxisIndex: 0, + yAxisIndex: 1, + barWidth: '70%', + itemStyle: { + color: 'red', + normal: { + barBorderRadius: 2, + }, + }, + areaStyle: { + // @ts-ignore + color: tailwind.theme.colors.red['500'], + }, + animationEasing: 'elasticOut', + animationDelayUpdate: (idx: number) => idx * 2, + data: yData.v3, }, ], }), @@ -231,13 +284,11 @@ export const VolumeChart: FC<{ x: number[]; y: number[] }> = ({ x, y }) => { - {yData?.length ? ( - - {formatUSD(yData[yData.length - 1])} - - ) : ( - - )} + + {formatUSD( + yData.v2[yData.v2.length - 1] + yData.v3[yData.v3.length - 1], + )} + {xData?.length ? ( diff --git a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx index 4b1b316273..40159ad1a2 100644 --- a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx +++ b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx @@ -15,9 +15,10 @@ import { ColumnDef, PaginationState, Row } from '@tanstack/react-table' import React, { FC, ReactNode, useCallback, useMemo, useState } from 'react' import { useConcentratedLiquidityPositions } from 'src/lib/wagmi/hooks/positions/hooks/useConcentratedLiquidityPositions' import { ConcentratedLiquidityPositionWithV3Pool } from 'src/lib/wagmi/hooks/positions/types' +import { ChainId } from 'sushi' import { SUSHISWAP_V3_SUPPORTED_CHAIN_IDS, - SushiSwapV3ChainId, + isSushiSwapV3ChainId, } from 'sushi/config' import { useAccount } from 'wagmi' import { usePoolFilters } from '../PoolsFiltersProvider' @@ -38,7 +39,7 @@ const COLUMNS = [ const tableState = { sorting: [{ id: 'positionSize', desc: true }] } interface ConcentratedPositionsTableProps { - chainId?: SushiSwapV3ChainId + chainId?: ChainId poolId?: string onRowClick?(row: ConcentratedLiquidityPositionWithV3Pool): void hideNewSmartPositionButton?: boolean @@ -54,11 +55,13 @@ export const ConcentratedPositionsTable: FC = hideNewPositionButton = false, }) => { const { address } = useAccount() - const { chainIds: filterChainIds, tokenSymbols } = usePoolFilters() + const { tokenSymbols } = usePoolFilters() const [hide, setHide] = useState(true) const chainIds = useMemo(() => { - if (chainId) return [chainId] as SushiSwapV3ChainId[] + if (chainId) { + return isSushiSwapV3ChainId(chainId) ? [chainId] : [] + } return [...SUSHISWAP_V3_SUPPORTED_CHAIN_IDS] }, [chainId]) @@ -76,11 +79,6 @@ export const ConcentratedPositionsTable: FC = const _positions = useMemo(() => { const _tokenSymbols = tokenSymbols?.filter((el) => el !== '') || [] return (positions || []) - ?.filter((el) => - filterChainIds.includes( - el.chainId as (typeof filterChainIds)[number], - ), - ) .filter((el) => _tokenSymbols.length > 0 ? _tokenSymbols.some((symbol) => { @@ -97,7 +95,7 @@ export const ConcentratedPositionsTable: FC = (poolId ? el.address.toLowerCase() === poolId.toLowerCase() : true) ) }) - }, [tokenSymbols, positions, filterChainIds, hide, poolId]) + }, [tokenSymbols, positions, hide, poolId]) const rowRenderer = useCallback( ( diff --git a/apps/web/src/ui/pool/ManagePosition.tsx b/apps/web/src/ui/pool/ManagePosition.tsx deleted file mode 100644 index 3763b975b4..0000000000 --- a/apps/web/src/ui/pool/ManagePosition.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React, { FC } from 'react' -import { PoolsFiltersProvider } from 'src/ui/pool/PoolsFiltersProvider' - -import { ConcentratedPositionsTable } from './ConcentratedPositionsTable/ConcentratedPositionsTable' - -interface ManagePositionProps { - address: string -} - -export const ManagePosition: FC = () => { - return ( - - - - ) -} diff --git a/apps/web/src/ui/pool/NewPoolsTable.tsx b/apps/web/src/ui/pool/NewPoolsTable.tsx deleted file mode 100644 index 23479116ad..0000000000 --- a/apps/web/src/ui/pool/NewPoolsTable.tsx +++ /dev/null @@ -1,250 +0,0 @@ -'use client' - -import { Slot } from '@radix-ui/react-slot' -import { TopPools } from '@sushiswap/graph-client/data-api' - -import { - Badge, - Card, - CardHeader, - CardTitle, - Currency, - DataTable, - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from '@sushiswap/ui' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' -import { ColumnDef, Row, SortingState, TableState } from '@tanstack/react-table' -import React, { FC, ReactNode, useCallback, useMemo, useState } from 'react' -import { ChainId } from 'sushi/chain' -import { Token } from 'sushi/currency' -import { formatNumber, formatUSD } from 'sushi/format' -import { SushiSwapProtocol } from 'sushi/types' -import { ProtocolBadge } from './PoolNameCell' -import { APR_COLUMN, TVL_COLUMN, VOLUME_1D_COLUMN } from './columns' - -const COLUMNS = [ - { - id: 'name', - header: 'Name', - - cell: (props) => { - const [token0, token1] = useMemo( - () => [ - new Token({ - chainId: props.row.original.chainId, - address: props.row.original.token0Address, - decimals: 0, - }), - new Token({ - chainId: props.row.original.chainId, - address: props.row.original.token1Address, - decimals: 0, - }), - ], - [props.row.original], - ) - - return ( -
-
- {token0 && token1 ? ( - - } - > - - - - - - ) : null} -
-
- - {props.row.original.name} - {/* {token0?.symbol}{' '} - - / - {' '} - {token1?.symbol}{' '} */} -
- -
- - - - { - ProtocolBadge[ - props.row.original.protocol as SushiSwapProtocol - ] - } - - -

Protocol version

-
-
-
- - - -
- {formatNumber(props.row.original.swapFee * 100)}% -
-
- -

Swap fee

-
-
-
- {props.row.original.isIncentivized && ( - - - -
- 🧑‍🌾{' '} -
-
- -

Farm rewards available

-
-
-
- )} - {props.row.original.isSmartPool && ( - - - -
- 💡 -
-
- -

Smart Pool available

-
-
-
- )} -
-
-
- ) - }, - size: 300, - }, - TVL_COLUMN, - { - id: 'volumeUSD1h', - header: 'Volume (60min)', - accessorFn: (row) => row.volumeUSD1h, - sortingFn: ({ original: rowA }, { original: rowB }) => - rowA.volumeUSD1h - rowB.volumeUSD1h, - cell: (props) => - formatUSD(props.row.original.volumeUSD1h).includes('NaN') - ? '$0.00' - : formatUSD(props.row.original.volumeUSD1h), - }, - VOLUME_1D_COLUMN, - { - id: 'feeUSD1h', - header: 'Fees (60min)', - accessorFn: (row) => row.feeUSD1h, - sortingFn: ({ original: rowA }, { original: rowB }) => - rowA.feeUSD1h - rowB.feeUSD1h, - cell: (props) => - formatUSD(props.row.original.feeUSD1h).includes('NaN') - ? '$0.00' - : formatUSD(props.row.original.feeUSD1h), - }, - { - id: 'feeUSD1d', - header: 'Fees (24h)', - accessorFn: (row) => row.feeUSD1d, - sortingFn: ({ original: rowA }, { original: rowB }) => - rowA.feeUSD1d - rowB.feeUSD1d, - cell: (props) => - formatUSD(props.row.original.feeUSD1d).includes('NaN') - ? '$0.00' - : formatUSD(props.row.original.feeUSD1d), - }, - APR_COLUMN, -] as ColumnDef[] - -interface PositionsTableProps { - pools: TopPools - onRowClick?(row: TopPools[number]): void -} - -export const NewPoolsTable: FC = ({ - pools, - onRowClick, -}) => { - const [sorting, setSorting] = useState([ - { id: 'liquidityUSD', desc: true }, - ]) - - const data = useMemo(() => pools?.flat() || [], [pools]) - - const state: Partial = useMemo(() => { - return { - sorting, - pagination: { - pageIndex: 0, - pageSize: data?.length, - }, - } - }, [data?.length, sorting]) - - const rowRenderer = useCallback( - (row: Row, rowNode: ReactNode) => { - if (onRowClick) - return ( - onRowClick?.(row.original)} - > - {rowNode} - - ) - return rowNode - }, - [onRowClick], - ) - - return ( - - - - Pools{' '} - {pools.length ? ( - - ({pools.length}) - - ) : null} - - - `pool/${row.protocol === SushiSwapProtocol.SUSHISWAP_V2 ? 'v2' : 'v3'}/${row.address}`} - rowRenderer={rowRenderer} - columns={COLUMNS} - data={data} - /> - - ) -} diff --git a/apps/web/src/ui/pool/PoolPageV2.tsx b/apps/web/src/ui/pool/PoolPageV2.tsx index 4e97921a13..09310082fc 100644 --- a/apps/web/src/ui/pool/PoolPageV2.tsx +++ b/apps/web/src/ui/pool/PoolPageV2.tsx @@ -1,57 +1,36 @@ import { Container, Separator } from '@sushiswap/ui' import { PoolTransactionsV2 } from 'src/ui/pool/PoolTransactionsV2' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { FC } from 'react' import { PoolChartV2 } from './PoolChartV2' import { PoolComposition } from './PoolComposition' import { PoolRewards } from './PoolRewards' import { PoolStats } from './PoolStats' import { UnknownTokenAlert } from './UnknownTokenAlert' -import { V2Pool } from '@sushiswap/graph-client/data-api' interface PoolPageV2 { pool: Awaited - } export const PoolPageV2: FC = ({ pool }) => { return ( -
- {/*
-
- -
-
- - - - - - - - -
-
*/} -
- +
+
+
-
-
- -
-
- - - {pool.isIncentivized ? : null} -
+
+ + + {pool.isIncentivized ? : null}
-
- -
-
+
+ +
+ ) } diff --git a/apps/web/src/ui/pool/PoolPageV3.tsx b/apps/web/src/ui/pool/PoolPageV3.tsx index af0d875f04..b353b67247 100644 --- a/apps/web/src/ui/pool/PoolPageV3.tsx +++ b/apps/web/src/ui/pool/PoolPageV3.tsx @@ -19,16 +19,14 @@ import { } from '@sushiswap/ui' import { FC } from 'react' import { useTokenAmountDollarValues } from 'src/lib/hooks' -import { useConcentratedLiquidityPool } from 'src/lib/wagmi/hooks/pools/hooks/useConcentratedLiquidityPool' import { useConcentratedLiquidityPoolReserves } from 'src/lib/wagmi/hooks/pools/hooks/useConcentratedLiquidityPoolReserves' -import { SushiSwapV3ChainId } from 'sushi/config' import { formatUSD } from 'sushi/format' import { ConcentratedLiquidityProvider } from './ConcentratedLiquidityProvider' import { PoolRewardDistributionsCard } from './PoolRewardDistributionsCard' import { PoolTransactionsV3 } from './PoolTransactionsV3' import { StatisticsChartsV3 } from './StatisticsChartV3' -const PoolPageV3: FC<{ pool: Awaited }> = ({ pool }) => { +const PoolPageV3: FC<{ pool: V3Pool }> = ({ pool }) => { return ( @@ -36,25 +34,17 @@ const PoolPageV3: FC<{ pool: Awaited }> = ({ pool }) => { ) } -const Pool: FC<{ pool: Awaited }> = ({ pool }) => { - const { id } = pool - const [_chainId, address] = id.split(':') - const chainId = +_chainId as SushiSwapV3ChainId +const Pool: FC<{ pool: V3Pool }> = ({ pool }) => { + const { chainId, address } = pool const { data: poolStats } = useConcentratedLiquidityPoolStats({ chainId, address, }) - const { data: cPool } = useConcentratedLiquidityPool({ - chainId, - token0: poolStats?.token0, - token1: poolStats?.token1, - feeAmount: poolStats?.feeAmount, - }) const { data: reserves, isLoading: isReservesLoading } = useConcentratedLiquidityPoolReserves({ - pool: cPool, + pool, chainId, }) const fiatValues = useTokenAmountDollarValues({ chainId, amounts: reserves }) @@ -62,7 +52,7 @@ const Pool: FC<{ pool: Awaited }> = ({ pool }) => { return (
- {pool?.hasEnabledSteerVault && ( + {pool.hasEnabledSteerVault && ( {`This pool has been activated to leverage our smart pool feature. Smart pools are designed to optimize the allocation of liquidity within customized price ranges, thereby improving trading efficiency. They achieve @@ -79,13 +69,6 @@ const Pool: FC<{ pool: Awaited }> = ({ pool }) => { )} - {/* - - */}
diff --git a/apps/web/src/ui/pool/PoolPositionProvider.tsx b/apps/web/src/ui/pool/PoolPositionProvider.tsx index 054b495175..1341d5fe7b 100644 --- a/apps/web/src/ui/pool/PoolPositionProvider.tsx +++ b/apps/web/src/ui/pool/PoolPositionProvider.tsx @@ -1,15 +1,15 @@ 'use client' +import { V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' import { FC, ReactNode, createContext, useContext, useMemo } from 'react' import { + getTokensFromPool, useTokenAmountDollarValues, useUnderlyingTokenBalanceFromPool, - useV2Pool, } from 'src/lib/hooks' import { useBalanceWeb3 } from 'src/lib/wagmi/hooks/balances/useBalanceWeb3' import { ChainId } from 'sushi/chain' import { Amount, Type } from 'sushi/currency' -import type { PoolId } from 'sushi/types' import { useAccount } from 'wagmi' interface PoolPositionContext { @@ -25,15 +25,34 @@ interface PoolPositionContext { const Context = createContext(undefined) export const PoolPositionProvider: FC<{ - pool: PoolId + pool: NonNullable children: ReactNode watch?: boolean }> = ({ pool, children }) => { const { address: account } = useAccount() - const { - data: { reserve0, reserve1, totalSupply, liquidityToken }, - } = useV2Pool(pool) + const { liquidityToken, reserve0, reserve1, totalSupply } = useMemo(() => { + if (!pool) + return { + token0: undefined, + token1: undefined, + liquidityToken: undefined, + } + + const { token0, token1, liquidityToken } = getTokensFromPool(pool) + + return { + liquidityToken, + reserve0: + token0 && pool ? Amount.fromRawAmount(token0, pool.reserve0) : null, + reserve1: + token1 && pool ? Amount.fromRawAmount(token1, pool.reserve1) : null, + totalSupply: + liquidityToken && pool + ? Amount.fromRawAmount(liquidityToken, pool.liquidity) + : null, + } + }, [pool]) const { data: balance, diff --git a/apps/web/src/ui/pool/PoolPositionStakedProvider.tsx b/apps/web/src/ui/pool/PoolPositionStakedProvider.tsx index 9f05d0127a..63e9a6faa4 100644 --- a/apps/web/src/ui/pool/PoolPositionStakedProvider.tsx +++ b/apps/web/src/ui/pool/PoolPositionStakedProvider.tsx @@ -1,13 +1,14 @@ 'use client' +import { V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' import { FC, ReactNode, createContext, useContext, useMemo } from 'react' import { + getTokensFromPool, useTokenAmountDollarValues, useUnderlyingTokenBalanceFromPool, - useV2Pool, } from 'src/lib/hooks' import { useMasterChef } from 'src/lib/wagmi/hooks/master-chef/use-master-chef' -import type { ChefType, PoolId, PoolWithIncentives } from 'sushi' +import type { ChefType } from 'sushi' import { ChainId } from 'sushi/chain' import { Amount, Currency, Token } from 'sushi/currency' @@ -26,7 +27,7 @@ interface PoolPositionStakedContext { const Context = createContext(undefined) interface PoolPositionStakedProviderProps { - pool: PoolWithIncentives + pool: V2Pool | V3Pool children: ReactNode watch?: boolean } @@ -65,7 +66,7 @@ export const PoolPositionStakedProvider: FC = } interface _PoolPositionStakedProviderProps { - pool: PoolId + pool: V2Pool | V3Pool children: ReactNode farmId: number chefType: ChefType @@ -79,9 +80,28 @@ const _PoolPositionStakedProvider: FC<_PoolPositionStakedProviderProps> = ({ chefType, children, }) => { - const { - data: { reserve0, reserve1, totalSupply, liquidityToken }, - } = useV2Pool(pool) + const { liquidityToken, reserve0, reserve1, totalSupply } = useMemo(() => { + if (!pool) + return { + token0: undefined, + token1: undefined, + liquidityToken: undefined, + } + + const { token0, token1, liquidityToken } = getTokensFromPool(pool) + + return { + liquidityToken, + reserve0: + token0 && pool ? Amount.fromRawAmount(token0, pool.reserve0) : null, + reserve1: + token1 && pool ? Amount.fromRawAmount(token1, pool.reserve1) : null, + totalSupply: + liquidityToken && pool + ? Amount.fromRawAmount(liquidityToken, pool.liquidity) + : null, + } + }, [pool]) const { balance, isLoading, isError, isWritePending, isWriteError } = useMasterChef({ diff --git a/apps/web/src/ui/pool/PoolsFiltersProvider.tsx b/apps/web/src/ui/pool/PoolsFiltersProvider.tsx index c5e9359afe..665bd6c499 100644 --- a/apps/web/src/ui/pool/PoolsFiltersProvider.tsx +++ b/apps/web/src/ui/pool/PoolsFiltersProvider.tsx @@ -11,12 +11,11 @@ import { useContext, useMemo, } from 'react' -import { SUPPORTED_CHAIN_IDS, isSupportedChainId } from 'src/config' +import { SushiSwapProtocol } from 'sushi' import { z } from 'zod' import { useTypedSearchParams } from '../../lib/hooks' import { POOL_TYPES } from './TableFiltersPoolType' -import { SushiSwapProtocol } from 'sushi' type FilterContext = z.TypeOf @@ -33,15 +32,6 @@ export const poolFiltersSchema = z.object({ tokenSymbols: z.coerce.string().transform((symbols) => { return symbols.split(',').filter((symbol) => symbol !== '') }), - chainIds: z.coerce - .string() - .default(SUPPORTED_CHAIN_IDS.join(',')) - .transform((chainIds) => - chainIds !== null && chainIds !== ',' - ? chainIds.split(',').map((chainId) => Number(chainId)) - : SUPPORTED_CHAIN_IDS, - ) - .transform((chainIds) => chainIds.filter(isSupportedChainId)), protocols: z .string() .transform((protocols) => @@ -61,20 +51,18 @@ export const PoolsFiltersProvider: FC = ({ children, }) => { const urlFilters = useTypedSearchParams(poolFiltersSchema.partial()) - const { tokenSymbols, chainIds, protocols, farmsOnly, smartPoolsOnly } = - urlFilters + const { tokenSymbols, protocols, farmsOnly, smartPoolsOnly } = urlFilters return ( ({ tokenSymbols: tokenSymbols ? tokenSymbols : [], - chainIds: chainIds ? chainIds : SUPPORTED_CHAIN_IDS, protocols: protocols ? protocols : POOL_TYPES, farmsOnly: farmsOnly ? farmsOnly : false, smartPoolsOnly: smartPoolsOnly ? smartPoolsOnly : false, }), - [chainIds, farmsOnly, protocols, tokenSymbols, smartPoolsOnly], + [farmsOnly, protocols, tokenSymbols, smartPoolsOnly], )} > {children} diff --git a/apps/web/src/ui/pool/PoolsTable.tsx b/apps/web/src/ui/pool/PoolsTable.tsx index 4f0be23ba9..86c6c97b8c 100644 --- a/apps/web/src/ui/pool/PoolsTable.tsx +++ b/apps/web/src/ui/pool/PoolsTable.tsx @@ -1,23 +1,26 @@ 'use client' +import { Slot } from '@radix-ui/react-slot' +import { TopPools } from '@sushiswap/graph-client/data-api' + import { UploadIcon } from '@heroicons/react-v1/outline' import { DownloadIcon } from '@heroicons/react-v1/solid' -import { ArrowDownRightIcon } from '@heroicons/react/20/solid' import { + ArrowDownRightIcon, EllipsisHorizontalIcon, GiftIcon, LightBulbIcon, MinusIcon, PlusIcon, } from '@heroicons/react/24/outline' -import { Slot } from '@radix-ui/react-slot' -import { GetPoolsArgs } from '@sushiswap/client' import { + Badge, Button, Card, CardHeader, CardTitle, Chip, + Currency, DataTable, DropdownMenu, DropdownMenuContent, @@ -27,51 +30,180 @@ import { DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, - Loader, SkeletonText, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '@sushiswap/ui' +import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' import { ColumnDef, Row, SortingState, TableState } from '@tanstack/react-table' import Link from 'next/link' import React, { FC, ReactNode, useCallback, useMemo, useState } from 'react' -import InfiniteScroll from 'react-infinite-scroll-component' -import { Native } from 'sushi/currency' -import { useSWRConfig } from 'swr' - -import { usePoolCount, usePoolsInfinite } from '@sushiswap/client/hooks' -import { PoolHasSteerVaults } from '@sushiswap/steer-sdk' +import { ChainId } from 'sushi/chain' import { isAngleEnabledChainId } from 'sushi/config' -import { - PoolBase, - PoolHistory, - PoolIfIncentivized, - unnestPool, -} from 'sushi/types' +import { Native, Token } from 'sushi/currency' +import { formatNumber, formatUSD } from 'sushi/format' +import { SushiSwapProtocol } from 'sushi/types' +import { ProtocolBadge } from './PoolNameCell' import { usePoolFilters } from './PoolsFiltersProvider' -import { - APR_COLUMN, - FEES_COLUMN, - NAME_COLUMN_POOL, - TVL_COLUMN, - VOLUME_1D_COLUMN, - VOLUME_1M_COLUMN, - VOLUME_1W_COLUMN, -} from './columns' - -type RequiredPool = PoolHasSteerVaults< - PoolIfIncentivized> -> +import { APR_COLUMN, TVL_COLUMN, VOLUME_1D_COLUMN } from './columns' const COLUMNS = [ - NAME_COLUMN_POOL, + { + id: 'name', + header: 'Name', + + cell: (props) => { + const [token0, token1] = useMemo( + () => [ + new Token({ + chainId: props.row.original.chainId, + address: props.row.original.token0Address, + decimals: 0, + }), + new Token({ + chainId: props.row.original.chainId, + address: props.row.original.token1Address, + decimals: 0, + }), + ], + [props.row.original], + ) + + return ( +
+
+ {token0 && token1 ? ( + + } + > + + + + + + ) : null} +
+
+ + {props.row.original.name} + {/* {token0?.symbol}{' '} + + / + {' '} + {token1?.symbol}{' '} */} +
+ +
+ + + + { + ProtocolBadge[ + props.row.original.protocol as SushiSwapProtocol + ] + } + + +

Protocol version

+
+
+
+ + + +
+ {formatNumber(props.row.original.swapFee * 100)}% +
+
+ +

Swap fee

+
+
+
+ {props.row.original.isIncentivized && ( + + + +
+ 🧑‍🌾{' '} +
+
+ +

Farm rewards available

+
+
+
+ )} + {props.row.original.isSmartPool && ( + + + +
+ 💡 +
+
+ +

Smart Pool available

+
+
+
+ )} +
+
+
+ ) + }, + size: 300, + }, TVL_COLUMN, + { + id: 'volumeUSD1h', + header: 'Volume (60min)', + accessorFn: (row) => row.volumeUSD1h, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.volumeUSD1h - rowB.volumeUSD1h, + cell: (props) => + formatUSD(props.row.original.volumeUSD1h).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.volumeUSD1h), + }, VOLUME_1D_COLUMN, - VOLUME_1W_COLUMN, - VOLUME_1M_COLUMN, - FEES_COLUMN, + { + id: 'feeUSD1h', + header: 'Fees (60min)', + accessorFn: (row) => row.feeUSD1h, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.feeUSD1h - rowB.feeUSD1h, + cell: (props) => + formatUSD(props.row.original.feeUSD1h).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.feeUSD1h), + }, + { + id: 'feeUSD1d', + header: 'Fees (24h)', + accessorFn: (row) => row.feeUSD1d, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.feeUSD1d - rowB.feeUSD1d, + cell: (props) => + formatUSD(props.row.original.feeUSD1d).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.feeUSD1d), + }, APR_COLUMN, { id: 'actions', @@ -85,7 +217,7 @@ const COLUMNS = [ - {row.original.token0.symbol} / {row.original.token1.symbol} + {row.original.name} SushiSwap V3 @@ -116,10 +248,10 @@ const COLUMNS = [ - + e.stopPropagation()} @@ -143,7 +275,7 @@ const COLUMNS = [

- {!row.original.hasEnabledSteerVault + {!row.original.isSmartPool ? 'No Steer vaults available for this pool' : `Smart pools optimize liquidity allocation within custom price ranges, enhancing trading efficiency by providing deeper liquidity around the current price, increasing Liquidity Providers (LP) fee earnings.`} @@ -170,15 +302,15 @@ const COLUMNS = [ href={`/pool/incentivize?chainId=${ row.original.chainId }&fromCurrency=${ - row.original.token0.address === + row.original.token0Address === Native.onChain(row.original.chainId).wrapped.address ? 'NATIVE' - : row.original.token0.address + : row.original.token0Address }&toCurrency=${ - row.original.token1.address === + row.original.token1Address === Native.onChain(row.original.chainId).wrapped.address ? 'NATIVE' - : row.original.token1.address + : row.original.token1Address }&feeAmount=${row.original.swapFee * 10_000 * 100}`} > @@ -207,7 +339,7 @@ const COLUMNS = [ - {row.original.token0.symbol} / {row.original.token1.symbol} + {row.original.name} {row.original.protocol === 'SUSHISWAP_V2' && ( SushiSwap V2 @@ -288,67 +420,47 @@ const COLUMNS = [ disableLink: true, skeleton: , }, - } satisfies ColumnDef, -] as ColumnDef[] + } satisfies ColumnDef, +] as ColumnDef[] interface PositionsTableProps { - onRowClick?(row: RequiredPool): void + pools: TopPools + onRowClick?(row: TopPools[number]): void } -export const PoolsTable: FC = ({ onRowClick }) => { - const { chainIds, tokenSymbols, protocols, farmsOnly, smartPoolsOnly } = +export const PoolsTable: FC = ({ pools, onRowClick }) => { + const { tokenSymbols, protocols, farmsOnly, smartPoolsOnly } = usePoolFilters() + const [sorting, setSorting] = useState([ { id: 'liquidityUSD', desc: true }, ]) - const sortingId = useMemo(() => { - switch (sorting[0]?.id) { - case 'volumeUSD1d': - return 'volume1d' - case 'volumeUSD1w': - return 'volume1w' - case 'volumeUSD1m': - return 'volume1m' - default: - return sorting[0]?.id - } - }, [sorting]) + const data = useMemo( + () => + pools?.flat()?.filter((pool) => { + if ( + tokenSymbols.length && + !tokenSymbols.some((tokenSymbol) => + pool.name.toLowerCase().includes(tokenSymbol.toLowerCase()), + ) + ) + return false - const args = useMemo(() => { - return { - chainIds: chainIds, - tokenSymbols, - isIncentivized: farmsOnly || undefined, // will filter farms out if set to false, undefined will be filtered out by the parser - hasEnabledSteerVault: smartPoolsOnly || undefined, // will filter smart pools out if set to false, undefined will be filtered out by the parser - isWhitelisted: true, // can be added to filters later, need to put it here so fallback works - orderBy: sortingId, - orderDir: sorting[0] ? (sorting[0].desc ? 'desc' : 'asc') : 'desc', - protocols, - } - }, [ - chainIds, - tokenSymbols, - farmsOnly, - smartPoolsOnly, - sorting, - sortingId, - protocols, - ]) + if ( + protocols.length && + !protocols.some((protocol) => pool.protocol === protocol) + ) + return false - const { - data: pools, - isValidating, - setSize, - } = usePoolsInfinite({ args, shouldFetch: true, swrConfig: useSWRConfig() }) + if (smartPoolsOnly && !pool.isSmartPool) return false - const { data: poolCount } = usePoolCount({ - args, - shouldFetch: true, - swrConfig: useSWRConfig(), - }) + if (farmsOnly && !pool.isIncentivized) return false - const data = useMemo(() => pools?.flat() || [], [pools]) + return true + }) || [], + [pools, tokenSymbols, protocols, farmsOnly, smartPoolsOnly], + ) const state: Partial = useMemo(() => { return { @@ -361,7 +473,7 @@ export const PoolsTable: FC = ({ onRowClick }) => { }, [data?.length, sorting]) const rowRenderer = useCallback( - (row: Row, rowNode: ReactNode) => { + (row: Row, rowNode: ReactNode) => { if (onRowClick) return ( = ({ onRowClick }) => { ) return ( - setSize((prev) => prev + 1)} - hasMore={data.length < (poolCount?.count || 0)} - loader={ -

- -
- } - > - - - - Pools{' '} - {poolCount?.count ? ( - - ({poolCount.count}) - - ) : null} - - - - `/pool/${unnestPool(row).chainId}%3A${unnestPool(row).address}` - } - rowRenderer={rowRenderer} - columns={COLUMNS} - data={data} - /> - - + + + + Pools{' '} + {data.length ? ( + + ({data.length}) + + ) : null} + + + + `pool/${ + row.protocol === SushiSwapProtocol.SUSHISWAP_V2 ? 'v2' : 'v3' + }/${row.address}` + } + rowRenderer={rowRenderer} + columns={COLUMNS} + data={data} + /> + ) } diff --git a/apps/web/src/ui/pool/PositionQuickHoverTooltip.tsx b/apps/web/src/ui/pool/PositionQuickHoverTooltip.tsx index dc258dd58d..a81d7c1387 100644 --- a/apps/web/src/ui/pool/PositionQuickHoverTooltip.tsx +++ b/apps/web/src/ui/pool/PositionQuickHoverTooltip.tsx @@ -1,21 +1,15 @@ import { ArrowDownIcon, MinusIcon, PlusIcon } from '@heroicons/react-v1/solid' +import { V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' import { Button } from '@sushiswap/ui' import { Currency } from '@sushiswap/ui' import { LinkInternal } from '@sushiswap/ui' import { List } from '@sushiswap/ui' import React, { FC, useCallback } from 'react' +import { ChainId } from 'sushi/chain' import { formatPercent, formatUSD } from 'sushi/format' import { ZERO } from 'sushi/math' - -import type { - PoolBase, - PoolWithAprs, - PoolWithIncentives, - SushiPositionStaked, - SushiPositionWithPool, -} from 'sushi' -import { ChainId } from 'sushi/chain' import { useAccount, useSwitchChain } from 'wagmi' + import { PoolPositionProvider, usePoolPosition } from './PoolPositionProvider' import { PoolPositionRewardsProvider, @@ -27,19 +21,17 @@ import { } from './PoolPositionStakedProvider' interface PositionQuickHoverTooltipProps { - row: SushiPositionStaked< - SushiPositionWithPool>> - > + pool: NonNullable } export const PositionQuickHoverTooltip: FC = ({ - row, + pool, }) => { return ( - - - - <_PositionQuickHoverTooltip row={row} /> + + + + <_PositionQuickHoverTooltip pool={pool} /> @@ -47,7 +39,7 @@ export const PositionQuickHoverTooltip: FC = ({ } const _PositionQuickHoverTooltip: FC = ({ - row, + pool, }) => { const { switchChain } = useSwitchChain() const { chain } = useAccount() @@ -63,12 +55,12 @@ const _PositionQuickHoverTooltip: FC = ({ usePoolPositionRewards() const _harvest = useCallback(() => { - if (row.pool.chainId !== chain?.id) { - switchChain?.({ chainId: row.pool.chainId as ChainId }) + if (pool.chainId !== chain?.id) { + switchChain?.({ chainId: pool.chainId as ChainId }) } else if (harvest) { harvest() } - }, [chain?.id, harvest, row.pool.chainId, switchChain]) + }, [chain?.id, harvest, pool.chainId, switchChain]) return (
@@ -80,21 +72,18 @@ const _PositionQuickHoverTooltip: FC = ({ • Rewards + Fees - {formatPercent(row.pool.totalApr1d)}{' '} + {formatPercent(pool.totalApr1d)}{' '} - {formatPercent(row.pool.incentiveApr)} +{' '} - {formatPercent(row.pool.feeApr1d)} + {formatPercent(pool.incentiveApr)} + {formatPercent(pool.feeApr1d)}
@@ -108,7 +97,7 @@ const _PositionQuickHoverTooltip: FC = ({
- {row.pool.incentives && pendingRewards.length > 0 && ( + {pool.incentives && pendingRewards.length > 0 && ( <> Pending rewards @@ -184,7 +173,7 @@ const _PositionQuickHoverTooltip: FC = ({ - {row.pool.incentives && + {pool.incentives && stakedUnderlying0?.greaterThan(ZERO) && stakedUnderlying1?.greaterThan(ZERO) && ( diff --git a/apps/web/src/ui/pool/PositionsTab.tsx b/apps/web/src/ui/pool/PositionsTab.tsx index 3c466694f6..aed26fd7e6 100644 --- a/apps/web/src/ui/pool/PositionsTab.tsx +++ b/apps/web/src/ui/pool/PositionsTab.tsx @@ -9,8 +9,9 @@ import { TabsList, TabsTrigger, } from '@sushiswap/ui' -import React, { useState } from 'react' +import React, { FC, useState } from 'react' +import { ChainId } from 'sushi/chain' import { ConcentratedPositionsTable } from './ConcentratedPositionsTable/ConcentratedPositionsTable' import { PositionsTable } from './PositionsTable' import { SmartPositionsTable } from './SmartPositionsTable' @@ -52,7 +53,7 @@ const ITEMS: { id: string; value: string; children: React.ReactNode }[] = [ }, ] -export const PositionsTab = () => { +export const PositionsTab: FC<{ chainId: ChainId }> = ({ chainId }) => { const [tab, setTab] = useState('v3') return ( @@ -86,13 +87,19 @@ export const PositionsTab = () => {
- + - `/pool/${row.pool.id}`} /> + `/pool/${row.pool.id}`} + /> - +
diff --git a/apps/web/src/ui/pool/PositionsTable.tsx b/apps/web/src/ui/pool/PositionsTable.tsx index 56d8c84681..dd1c67b332 100644 --- a/apps/web/src/ui/pool/PositionsTable.tsx +++ b/apps/web/src/ui/pool/PositionsTable.tsx @@ -16,6 +16,7 @@ const COLUMNS = [ ] as DisplayColumnDef[] interface PositionsTableProps { + chainId: ChainId onRowClick?(row: V2Position): void rowLink?(row: V2Position): string } @@ -23,23 +24,21 @@ interface PositionsTableProps { const tableState = { sorting: [{ id: 'value', desc: true }] } export const PositionsTable: FC = ({ + chainId, onRowClick, rowLink, }) => { const { address } = useAccount() - // const { chainIds, tokenSymbols } = usePoolFilters() const [paginationState, setPaginationState] = useState({ pageIndex: 0, pageSize: 10, }) - const { data: positions, isLoading } = useSushiV2UserPositions( - { - user: address!, - chainId: ChainId.ARBITRUM, // TODO: fix - }, - !!address, - ) + const { data: positions, isLoading } = useSushiV2UserPositions({ + user: address, + chainId, + }) + const _positions = useMemo(() => { if (!positions) return [] return positions diff --git a/apps/web/src/ui/pool/RewardsSection.tsx b/apps/web/src/ui/pool/RewardsSection.tsx index bda147dd27..b4f56f93d2 100644 --- a/apps/web/src/ui/pool/RewardsSection.tsx +++ b/apps/web/src/ui/pool/RewardsSection.tsx @@ -35,7 +35,7 @@ const COLUMNS = [ export const RewardsSection: FC = () => { const { address } = useAccount() - const { chainIds, tokenSymbols } = usePoolFilters() + const { tokenSymbols } = usePoolFilters() const { data, isInitialLoading } = useAngleRewardsMultipleChains({ chainIds: ANGLE_SUPPORTED_CHAIN_IDS, account: address, @@ -58,28 +58,24 @@ export const RewardsSection: FC = () => { const positions = useMemo(() => { const _tokenSymbols = tokenSymbols?.filter((el) => el !== '') || [] - return (data ?? []) - .filter((el) => - chainIds.includes(el.chainId as (typeof chainIds)[number]), - ) - .flatMap((el) => { - return Object.values(el.pools ?? {}) - .filter( - (el) => - (el?.userBalanceToken0 ?? 0) + (el?.userBalanceToken1 ?? 0) > 0 || - Object.keys(el.rewardsPerToken).length > 0, - ) - .filter((el) => - _tokenSymbols.length > 0 - ? _tokenSymbols.some((symbol) => { - return [el.token0.symbol, el.token1.symbol].includes( - symbol.toUpperCase(), - ) - }) - : true, - ) - }) - }, [chainIds, tokenSymbols, data]) + return (data ?? []).flatMap((el) => { + return Object.values(el.pools ?? {}) + .filter( + (el) => + (el?.userBalanceToken0 ?? 0) + (el?.userBalanceToken1 ?? 0) > 0 || + Object.keys(el.rewardsPerToken).length > 0, + ) + .filter((el) => + _tokenSymbols.length > 0 + ? _tokenSymbols.some((symbol) => { + return [el.token0.symbol, el.token1.symbol].includes( + symbol.toUpperCase(), + ) + }) + : true, + ) + }) + }, [tokenSymbols, data]) const rowLink = useCallback((row: AngleRewardsPool) => { return `/pool/${row.id}` diff --git a/apps/web/src/ui/pool/SmartPoolsTable.tsx b/apps/web/src/ui/pool/SmartPoolsTable.tsx deleted file mode 100644 index 2d5d670c29..0000000000 --- a/apps/web/src/ui/pool/SmartPoolsTable.tsx +++ /dev/null @@ -1,600 +0,0 @@ -'use client' - -import { UploadIcon } from '@heroicons/react-v1/outline' -import { DownloadIcon } from '@heroicons/react-v1/solid' -import { ArrowDownRightIcon } from '@heroicons/react/20/solid' -import { - EllipsisHorizontalIcon, - GiftIcon, - LightBulbIcon, - MinusIcon, - PlusIcon, -} from '@heroicons/react/24/outline' -import { - Badge, - Button, - Card, - CardDescription, - CardHeader, - CardTitle, - Chip, - Currency, - DataTable, - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuGroupLabel, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuTrigger, - LinkExternal, - SkeletonCircle, - SkeletonText, - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, - classNames, -} from '@sushiswap/ui' -import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' -import { - ColumnDef, - PaginationState, - SortingState, - TableState, -} from '@tanstack/react-table' -import { useMemo, useState } from 'react' -import { Native, Token, unwrapToken } from 'sushi/currency' -import { formatPercent, formatUSD } from 'sushi/format' - -import { SmartPoolsV1, getSmartPools } from '@sushiswap/graph-client/data-api' -import { useQuery } from '@tanstack/react-query' -import Link from 'next/link' -import { ChainId, SushiSwapProtocol } from 'sushi' -import { isAngleEnabledChainId } from 'sushi/config' -import { Address } from 'viem' -import { APRHoverCard } from './APRHoverCard' -import { ProtocolBadge } from './PoolNameCell' -import { usePoolFilters } from './PoolsFiltersProvider' -import { SteerStrategyConfig } from './Steer/constants' -import { SteerStrategy } from '@sushiswap/steer-sdk' - -const COLUMNS = [ - { - id: 'poolName', - header: 'Pool name', - cell: ({ row: { original } }) => { - const token0 = new Token({ - chainId: original.chainId, - address: original.token0.address, - decimals: original.token0.decimals, - symbol: original.token0.symbol, - }) - const token1 = new Token({ - chainId: original.chainId, - address: original.token1.address, - decimals: original.token1.decimals, - symbol: original.token1.symbol, - }) - - return ( -
-
- - } - > - - - - - -
-
- - {unwrapToken(token0).symbol}{' '} - - / - {' '} - {unwrapToken(token1).symbol}{' '} -
- -
- - - - {ProtocolBadge[original.protocol as SushiSwapProtocol]} - - -

Protocol version

-
-
-
- - - -
- {formatPercent(original.swapFee)} -
-
- -

Swap fee

-
-
-
- {original.isIncentivized && ( - - - -
- 🧑🌾{' '} -
-
- -

Farm rewards available

-
-
-
- )} - - - -
- 💡 -
-
- -

Smart Pool available

-
-
-
- - {/* {original.isDeprecated && ( -
- Deprecated -
- )} */} -
-
-
- ) - }, - meta: { - skeleton: ( -
-
- - -
-
- -
-
- ), - }, - size: 300, - }, - { - id: 'name', - header: 'Strategy', - cell: ({ row: { original } }) => ( - - - - - {original.strategy.replace(/([a-z0-9])([A-Z])/g, '$1 $2')} - - - -

- {' '} - {SteerStrategyConfig[original.strategy as SteerStrategy] - .description ?? ''} -

-
-
-
- ), - meta: { - skeleton: , - }, - }, - { - id: 'liquidityUSD', - header: 'TVL', - accessorFn: (row) => row.vaultLiquidityUSD, - cell: ({ row: { original } }) => ( - - - {formatUSD(original.liquidityUSD).includes('NaN') - ? '$0.00' - : formatUSD(original.liquidityUSD)} - - - - - - {formatUSD(original.vaultLiquidityUSD).includes('NaN') - ? '$0.00' - : formatUSD(original.vaultLiquidityUSD)} - - - -

Amount of liquidity deposited in the smart pool.

-
-
-
-
- ), - meta: { - skeleton: , - }, - }, - { - id: 'fees1d', - header: 'Fees (24h)', - accessorFn: (row) => row.feeUSD1d, - cell: (props) => - formatUSD(props.row.original.feeUSD1d).includes('NaN') - ? '$0.00' - : formatUSD(props.row.original.feeUSD1d), - meta: { - skeleton: , - }, - }, - { - id: 'totalApr1d', - header: 'APR (24h)', - accessorFn: (row) => row.stakedAndIncentiveApr1d, - cell: (props) => { - return ( -
- - - - - {formatPercent(props.row.original.feeAndIncentiveApr1d)} - - - -

APR when not staked within the vault.

-
-
-
- - - {formatPercent(props.row.original.stakedAndIncentiveApr1d)} - - -
- ) - }, - meta: { - skeleton: , - }, - }, - { - id: 'actions', - cell: ({ row }) => - row.original.protocol === 'SUSHISWAP_V3' ? ( - - - - - - - {row.original.token0.symbol} / {row.original.token1.symbol} - - SushiSwap V3 - - - - - - e.stopPropagation()} - shallow={true} - className="flex items-center" - href={`/pool/${row.original.id}`} - > - - Pool details - - - - e.stopPropagation()} - shallow={true} - className="flex items-center" - href={`/pool/${row.original.id}/positions/create`} - > - - Create position - - - - - - - e.stopPropagation()} - shallow={true} - className="flex items-center" - href={`/pool/${row.original.id}/smart/${row.original.id}`} - > - - - - - - - Create smart position - - - - -

- {`Smart pools optimize liquidity allocation within custom price ranges, enhancing trading efficiency by - providing deeper liquidity around the current price, increasing Liquidity Providers (LP) fee earnings.`} -

-
-
-
-
- - - - - - - e.stopPropagation()} - shallow={true} - className="flex items-center" - href={`/pool/incentivize?chainId=${ - row.original.chainId - }&fromCurrency=${ - row.original.token0.address === - Native.onChain(row.original.chainId).wrapped - .address - ? 'NATIVE' - : row.original.token0.address - }&toCurrency=${ - row.original.token1.address === - Native.onChain(row.original.chainId).wrapped - .address - ? 'NATIVE' - : row.original.token1.address - }&feeAmount=${ - row.original.swapFee * 10_000 * 100 - }`} - > - - Add incentive - - - - -

- {!isAngleEnabledChainId(row.original.chainId) - ? 'Not available on this network' - : 'Add rewards to a pool to incentivize liquidity providers joining in.'} -

-
-
-
-
-
-
- ) : ( - - - - - - - {row.original.token0.symbol} / {row.original.token1.symbol} - {row.original.protocol === 'SUSHISWAP_V2' && ( - - SushiSwap V2 - - )} - - - - - e.stopPropagation()} - shallow={true} - className="flex items-center" - href={`/pool/${row.original.id}/add`} - > - - Add liquidity - - - - e.stopPropagation()} - shallow={true} - className="flex items-center" - href={`/pool/${row.original.id}/remove`} - > - - Remove liquidity - - - - - - Farm rewards - - - - - e.stopPropagation()} - shallow={true} - className="flex items-center" - href={`/pool/${row.original.id}/stake`} - > - - Stake - - - - -

- {!row.original.isIncentivized - ? 'No rewards available on this pool' - : 'After adding liquidity, stake your liquidity tokens to benefit from extra rewards'} -

-
-
-
- - e.stopPropagation()} - shallow={true} - className="flex items-center" - href={`/pool/${row.original.id}/unstake`} - > - - Unstake - - -
-
-
- ), - meta: { - disableLink: true, - skeleton: , - }, - }, -] satisfies ColumnDef[] - -export const SmartPoolsTable = () => { - const { chainIds, protocols, farmsOnly } = usePoolFilters() - const [sorting, setSorting] = useState([ - { id: 'liquidityUSD', desc: true }, - ]) - const [pagination, setPagination] = useState({ - pageIndex: 0, - pageSize: 10, - }) - - const { data: vaults, isLoading: isValidatingVaults } = useQuery({ - queryKey: ['useSmartPools', { chainId: chainIds[0] }], - queryFn: async () => await getSmartPools({ chainId: chainIds[0] }), - keepPreviousData: true, - staleTime: 0, - cacheTime: 86400000, // 24hs - // enabled, - }) - - const state: Partial = useMemo(() => { - return { - sorting, - pagination, - } - }, [sorting, pagination]) - - const _vaults = useMemo( - () => - vaults - ? vaults - .filter((el) => (farmsOnly ? el.isIncentivized : true)) - .filter((el) => - protocols.length > 0 - ? protocols.includes(el.protocol as SushiSwapProtocol) // wont need this when table is refactored - : true, - ) - : [], - [protocols, farmsOnly, vaults], - ) - - return ( - - - - Smart Pools{' '} - {_vaults?.length ? ( - - ({_vaults.length}) - - ) : null} - - - Smart pools optimize liquidity allocation within custom price ranges, - enhancing trading efficiency by providing deeper liquidity around the - current price, increasing Liquidity Providers (LP) fee earnings. To - learn more about Smart Pools, click{' '} - - here - - . - - - `smart-pools-table-${row.id.replace(':', '-')}`} - onPaginationChange={setPagination} - pagination={true} - state={state} - linkFormatter={(row) => `/pool/${row.id}/smart/${row.id}`} - onSortingChange={setSorting} - loading={!vaults && isValidatingVaults} - columns={COLUMNS} - data={_vaults} - /> - - ) -} diff --git a/apps/web/src/ui/pool/SmartPositionsTable.tsx b/apps/web/src/ui/pool/SmartPositionsTable.tsx index 5afde066fd..da894f30f1 100644 --- a/apps/web/src/ui/pool/SmartPositionsTable.tsx +++ b/apps/web/src/ui/pool/SmartPositionsTable.tsx @@ -1,10 +1,7 @@ 'use client' +import { isSteerChainId } from '@sushiswap/steer-sdk' import { Card, CardHeader, CardTitle, DataTable } from '@sushiswap/ui' -import { ColumnDef, PaginationState } from '@tanstack/react-table' -import React, { useMemo, useState } from 'react' - -import { STEER_SUPPORTED_CHAIN_IDS } from '@sushiswap/steer-sdk' import { SkeletonText, Tooltip, @@ -12,11 +9,14 @@ import { TooltipProvider, TooltipTrigger, } from '@sushiswap/ui' +import { ColumnDef, PaginationState } from '@tanstack/react-table' +import React, { FC, useMemo, useState } from 'react' import { SteerAccountPositionExtended, useSteerAccountPositionsExtended, } from 'src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended' -import { ChainId, formatPercent, SushiSwapProtocol } from 'sushi' +import { ChainId, SushiSwapProtocol, formatPercent } from 'sushi' +import { Address } from 'viem' import { useAccount } from 'wagmi' import { APRHoverCard } from './APRHoverCard' import { @@ -24,8 +24,6 @@ import { STEER_POSITION_SIZE_COLUMN, STEER_STRATEGY_COLUMN, } from './ConcentratedPositionsTable/Tables/Smart/columns' -import { usePoolFilters } from './PoolsFiltersProvider' -import { Address } from 'viem' const COLUMNS = [ STEER_NAME_COLUMN, @@ -81,9 +79,8 @@ const COLUMNS = [ const tableState = { sorting: [{ id: 'positionSize', desc: true }] } -export const SmartPositionsTable = () => { +export const SmartPositionsTable: FC<{ chainId: ChainId }> = ({ chainId }) => { const { address } = useAccount() - const { chainIds } = usePoolFilters() const [paginationState, setPaginationState] = useState({ pageIndex: 0, pageSize: 10, @@ -91,7 +88,7 @@ export const SmartPositionsTable = () => { const { data: positions, isLoading } = useSteerAccountPositionsExtended({ account: address, - chainIds: chainIds ? chainIds : [...STEER_SUPPORTED_CHAIN_IDS], + chainIds: isSteerChainId(chainId) ? [chainId] : [], }) const _positions = useMemo(() => (positions ? positions : []), [positions]) diff --git a/apps/web/src/ui/pool/TableFiltersNetwork.tsx b/apps/web/src/ui/pool/TableFiltersNetwork.tsx index 07b4a120e5..55f1f79c17 100644 --- a/apps/web/src/ui/pool/TableFiltersNetwork.tsx +++ b/apps/web/src/ui/pool/TableFiltersNetwork.tsx @@ -1,13 +1,7 @@ 'use client' import { PlusCircleIcon } from '@heroicons/react/24/outline' -import { - Chip, - Popover, - PopoverContent, - PopoverTrigger, - Separator, -} from '@sushiswap/ui' +import { Chip, Popover, PopoverContent, PopoverTrigger } from '@sushiswap/ui' import { Button } from '@sushiswap/ui' import { Command, @@ -18,46 +12,24 @@ import { } from '@sushiswap/ui' import { CheckIcon } from '@sushiswap/ui/icons/CheckIcon' import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' -import React, { FC, useCallback, useState, useTransition } from 'react' +import { usePathname, useRouter } from 'next/navigation' +import React, { FC, useCallback, useState } from 'react' import { SUPPORTED_CHAIN_IDS } from 'src/config' -import { Chain } from 'sushi/chain' - -import { usePoolFilters, useSetPoolFilters } from './PoolsFiltersProvider' +import { Chain, ChainId } from 'sushi/chain' -const isAllThenNone = (chainIds: number[]) => - SUPPORTED_CHAIN_IDS.length === chainIds.length ? [] : chainIds - -export const TableFiltersNetwork: FC = () => { - const [pending, startTransition] = useTransition() +export const TableFiltersNetwork: FC<{ chainId: ChainId }> = ({ chainId }) => { const [open, setOpen] = useState(false) - const { chainIds } = usePoolFilters() - const setFilters = useSetPoolFilters() - const [localValue, setValues] = useState(isAllThenNone(chainIds)) - const values = pending ? localValue : isAllThenNone(chainIds) + const router = useRouter() + const pathname = usePathname() const onClick = useCallback( - (chainId: (typeof chainIds)[number]) => { - let _newValues: number[] - if (localValue.includes(chainId)) { - _newValues = localValue.filter((el) => el !== chainId) - } else { - _newValues = [...(localValue ?? []), chainId] - } - setValues(_newValues) - - startTransition(() => { - setFilters((prev) => { - if (prev.chainIds?.includes(chainId)) { - const chains = prev.chainIds!.filter((el) => el !== chainId) - return { ...prev, chainIds: chains } - } else { - return { ...prev, chainIds: [...(prev.chainIds ?? []), chainId] } - } - }) - }) + (chainId: string) => { + const pathSegments = pathname.split('/') + pathSegments[1] = chainId + router.push(pathSegments.join('/')) }, - [setFilters, localValue], + [pathname, router], ) return ( @@ -72,27 +44,7 @@ export const TableFiltersNetwork: FC = () => { className="!border-dashed" > Networks - {values?.length > 0 && ( - <> - - - {values.length} - -
- {values.length > 2 ? ( - {values.length} selected - ) : ( - SUPPORTED_CHAIN_IDS.filter((option) => - values.includes(option), - ).map((option) => ( - - {Chain.from(option)?.name} - - )) - )} -
- - )} + {Chain.from(chainId)?.name} { /> No network found. - {SUPPORTED_CHAIN_IDS.map((chainId) => ( + {SUPPORTED_CHAIN_IDS.map((_chainId) => ( - onClick(+value.split('__')[1] as (typeof chainIds)[number]) - } + key={_chainId} + value={_chainId.toString()} + onSelect={onClick} className="py-2 pl-8 pr-2" > - {values.includes(chainId) ? ( + {chainId === _chainId ? ( { ) : null} - {Chain.from(chainId)?.name} + {Chain.from(_chainId)?.name} ))} diff --git a/apps/web/src/ui/pool/TableFiltersResetButton.tsx b/apps/web/src/ui/pool/TableFiltersResetButton.tsx index 8fc1ec2fe2..52282c2432 100644 --- a/apps/web/src/ui/pool/TableFiltersResetButton.tsx +++ b/apps/web/src/ui/pool/TableFiltersResetButton.tsx @@ -4,29 +4,21 @@ import { XMarkIcon } from '@heroicons/react/24/solid' import { Button } from '@sushiswap/ui' import React, { FC, useCallback, useMemo, useState, useTransition } from 'react' -import { SUPPORTED_CHAIN_IDS } from '../../config' import { usePoolFilters, useSetPoolFilters } from './PoolsFiltersProvider' import { POOL_TYPES } from './TableFiltersPoolType' export const TableFiltersResetButton: FC = () => { const [isPending, startTransition] = useTransition() - const { protocols, chainIds, tokenSymbols, farmsOnly, smartPoolsOnly } = + const { protocols, tokenSymbols, farmsOnly, smartPoolsOnly } = usePoolFilters() const setFilters = useSetPoolFilters() - const networks = useMemo( - () => (SUPPORTED_CHAIN_IDS.length === chainIds.length ? [] : chainIds), - [chainIds], - ) const types = useMemo( () => (protocols.length === POOL_TYPES.length ? [] : protocols), [protocols], ) const [show, setShow] = useState( - (types?.length ?? 0) + - (networks?.length ?? 0) + - (tokenSymbols?.length ?? 0) > - 0 || + (types?.length ?? 0) + (tokenSymbols?.length ?? 0) > 0 || farmsOnly || smartPoolsOnly, ) @@ -36,7 +28,6 @@ export const TableFiltersResetButton: FC = () => { startTransition(() => { setFilters({ protocols: undefined, - chainIds: undefined, tokenSymbols: undefined, farmsOnly: undefined, smartPoolsOnly: undefined, @@ -47,10 +38,7 @@ export const TableFiltersResetButton: FC = () => { if ( isPending ? show - : (types?.length ?? 0) + - (networks?.length ?? 0) + - (tokenSymbols?.length ?? 0) > - 0 || + : (types?.length ?? 0) + (tokenSymbols?.length ?? 0) > 0 || farmsOnly || smartPoolsOnly ) { diff --git a/apps/web/src/ui/pool/PositionView.tsx b/apps/web/src/ui/pool/V3PositionView.tsx similarity index 98% rename from apps/web/src/ui/pool/PositionView.tsx rename to apps/web/src/ui/pool/V3PositionView.tsx index efd6463927..dbb151604d 100644 --- a/apps/web/src/ui/pool/PositionView.tsx +++ b/apps/web/src/ui/pool/V3PositionView.tsx @@ -63,13 +63,12 @@ import { ConcentratedLiquidityRemoveWidget } from './ConcentratedLiquidityRemove import { ConcentratedLiquidityWidget } from './ConcentratedLiquidityWidget' import { DistributionDataTable } from './DistributionDataTable' -const Component: FC<{ id: string }> = ({ id }) => { +const Component: FC<{ chainId: string; address: string; position: string }> = ({ + chainId: _chainId, + address: poolId, + position: tokenId, +}) => { const { address } = useAccount() - const [_chainId, poolId, tokenId] = id.split('%3A') as [ - SushiSwapV3ChainId, - string, - string, - ] const chainId = Number(_chainId) as SushiSwapV3ChainId const [invert, setInvert] = useState(false) @@ -737,10 +736,12 @@ const Component: FC<{ id: string }> = ({ id }) => { ) } -export const PositionView = ({ params }: { params: { id: string } }) => { +export const V3PositionView = ({ + params: { chainId, address, position }, +}: { params: { chainId: string; address: string; position: string } }) => { return ( - + ) } From 8b828419d2e182cc2cba5e1fd24ea103895b8772 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 6 Aug 2024 21:58:12 +0700 Subject: [PATCH 040/139] chore: update urls --- .../src/app/(evm)/[chainId]/explore/hero.tsx | 1 + .../v2/[address]/{manage => add}/page.tsx | 5 +- .../[chainId]/pool/v2/[address]/layout.tsx | 6 +- .../pool/v2/[address]/remove/page.tsx | 48 +++++++++++ .../pool/v2/[address]/stake/page.tsx | 48 +++++++++++ .../pool/v2/[address]/unstake/page.tsx | 48 +++++++++++ .../v3/[address]/{(landing) => }/layout.tsx | 5 +- .../[position]}/page.tsx | 0 .../v3/[address]/positions/create/page.tsx | 32 ++++++++ .../{(landing)/manage => positions}/page.tsx | 0 .../v3/[address]/smart/(overview)/layout.tsx | 71 ++++------------ .../v3/[address]/smart/(overview)/page.tsx | 10 +-- .../v3/[address]/smart/[vault]/layout.tsx | 81 +++++-------------- apps/web/src/lib/hooks/api/useV2Pool.ts | 12 ++- .../SteerTokenDistributionBar.tsx | 4 +- apps/web/src/ui/pool/Steer/SteerPoolCard.tsx | 6 +- 16 files changed, 239 insertions(+), 138 deletions(-) rename apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/{manage => add}/page.tsx (90%) create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/remove/page.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/stake/page.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/unstake/page.tsx rename apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/{(landing) => }/layout.tsx (92%) rename apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/{(landing)/manage/[positionId] => positions/[position]}/page.tsx (100%) create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx rename apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/{(landing)/manage => positions}/page.tsx (100%) diff --git a/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx index a1e0ecfda6..4f683d0873 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx @@ -13,6 +13,7 @@ import { } from '@sushiswap/ui' import { SelectIcon } from '@sushiswap/ui' import { DiscordIcon } from '@sushiswap/ui/icons/DiscordIcon' +import React from 'react' import { FC } from 'react' import { ChainId } from 'sushi/chain' import { diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/manage/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/add/page.tsx similarity index 90% rename from apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/manage/page.tsx rename to apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/add/page.tsx index 03ebb5b40f..4642db89f8 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/manage/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/add/page.tsx @@ -11,12 +11,11 @@ import { PoolMyRewards } from 'src/ui/pool/PoolMyRewards' import { PoolPosition } from 'src/ui/pool/PoolPosition' export default async function ManageV2PoolPage({ - params: { chainId, address, tab }, + params: { chainId, address }, }: { params: { chainId: string address: string - tab: 'add' | 'remove' | 'unstake' | 'stake' } }) { const pool = (await unstable_cache( @@ -31,7 +30,7 @@ export default async function ManageV2PoolPage({
- +
diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx index 4ea0e33e55..25a0ee1018 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx @@ -38,7 +38,11 @@ export default async function Layout({ getV2Pool({ chainId: Number(chainId), address }), + ['pool', `${chainId}:${address}`], + { + revalidate: 60 * 15, + }, + )()) as NonNullable + + return ( + +
+
+ +
+
+ + + + + + + + +
+
+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/stake/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/stake/page.tsx new file mode 100644 index 0000000000..c93ed7ce98 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/stake/page.tsx @@ -0,0 +1,48 @@ +import { V2Pool, getV2Pool } from '@sushiswap/graph-client/data-api' +import { Container } from '@sushiswap/ui' +import { unstable_cache } from 'next/cache' +import { + PoolPositionProvider, + PoolPositionRewardsProvider, + PoolPositionStakedProvider, +} from 'src/ui/pool' +import { ManageV2LiquidityCard } from 'src/ui/pool/ManageV2LiquidityCard' +import { PoolMyRewards } from 'src/ui/pool/PoolMyRewards' +import { PoolPosition } from 'src/ui/pool/PoolPosition' + +export default async function ManageV2PoolPage({ + params: { chainId, address }, +}: { + params: { + chainId: string + address: string + } +}) { + const pool = (await unstable_cache( + async () => getV2Pool({ chainId: Number(chainId), address }), + ['pool', `${chainId}:${address}`], + { + revalidate: 60 * 15, + }, + )()) as NonNullable + + return ( + +
+
+ +
+
+ + + + + + + + +
+
+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/unstake/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/unstake/page.tsx new file mode 100644 index 0000000000..13eace486e --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/unstake/page.tsx @@ -0,0 +1,48 @@ +import { V2Pool, getV2Pool } from '@sushiswap/graph-client/data-api' +import { Container } from '@sushiswap/ui' +import { unstable_cache } from 'next/cache' +import { + PoolPositionProvider, + PoolPositionRewardsProvider, + PoolPositionStakedProvider, +} from 'src/ui/pool' +import { ManageV2LiquidityCard } from 'src/ui/pool/ManageV2LiquidityCard' +import { PoolMyRewards } from 'src/ui/pool/PoolMyRewards' +import { PoolPosition } from 'src/ui/pool/PoolPosition' + +export default async function ManageV2PoolPage({ + params: { chainId, address }, +}: { + params: { + chainId: string + address: string + } +}) { + const pool = (await unstable_cache( + async () => getV2Pool({ chainId: Number(chainId), address }), + ['pool', `${chainId}:${address}`], + { + revalidate: 60 * 15, + }, + )()) as NonNullable + + return ( + +
+
+ +
+
+ + + + + + + + +
+
+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx similarity index 92% rename from apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/layout.tsx rename to apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx index 92d53afc13..31b61c4a57 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx @@ -3,7 +3,7 @@ import { Breadcrumb, Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' import { headers } from 'next/headers' import { PoolHeader } from 'src/ui/pool/PoolHeader' -import notFound from '../../../../not-found' +import notFound from '../../../not-found' export const metadata = { title: 'Pool 💦', @@ -18,8 +18,7 @@ export default async function Layout({ }) { const { chainId, address } = params const pool = await unstable_cache( - async () => - getV3Pool({ chainId: Number(chainId), address }), + async () => getV3Pool({ chainId: Number(chainId), address }), ['pool', `${chainId}:${address}`], { revalidate: 60 * 15, diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/[positionId]/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/[position]/page.tsx similarity index 100% rename from apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/[positionId]/page.tsx rename to apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/[position]/page.tsx diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx new file mode 100644 index 0000000000..1dff53ff0a --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx @@ -0,0 +1,32 @@ +import { Container, LinkInternal } from '@sushiswap/ui' +import React from 'react' +import { ConcentratedLiquidityProvider } from 'src/ui/pool/ConcentratedLiquidityProvider' +import { NewPosition } from 'src/ui/pool/NewPosition' +import { isSushiSwapV3ChainId } from 'sushi/config' +import { getChainIdAddressFromId, unsanitize } from 'sushi/format' + +export default async function PositionsCreatePage({ + params, +}: { params: { id: string } }) { + const { chainId, address } = getChainIdAddressFromId(unsanitize(params.id)) + + if (!isSushiSwapV3ChainId(chainId)) { + throw new Error('This page only supports SushiSwap V3 pools') + } + + return ( + +
+ + ← Back + + + + +
+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/page.tsx similarity index 100% rename from apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/manage/page.tsx rename to apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/page.tsx diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/layout.tsx index 40b95ed58a..5d2a0a3f32 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/layout.tsx @@ -1,19 +1,12 @@ -import { getV3Pool } from '@sushiswap/graph-client/data-api' import { - Breadcrumb, CardDescription, CardHeader, CardTitle, Container, LinkInternal, } from '@sushiswap/ui' -import { unstable_cache } from 'next/cache' -import { headers } from 'next/headers' -import { notFound } from 'next/navigation' import React from 'react' -import { PoolHeader } from 'src/ui/pool/PoolHeader' - export default async function Layout({ children, params, @@ -21,55 +14,23 @@ export default async function Layout({ children: React.ReactNode params: { chainId: string; address: string } }) { - const { chainId, address } = params - const pool = await unstable_cache( - async () => getV3Pool({ chainId: Number(chainId), address }), - ['pool', `${chainId}:${address}`], - { - revalidate: 60 * 3, - }, - )() - - if (!pool) { - return notFound() - } - - const headersList = headers() - const referer = headersList.get('referer') - return ( - <> - - - - - +
+ + + ← Pool details + + + Available Strategies + + Choose one of the following strategies: + + -
-
-
- - - ← Pool details - - - Available Strategies - - Choose one of the following strategies: - - - - {children} -
-
-
- + {children} +
) } diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx index aa68a4c646..c57d30737c 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx @@ -1,8 +1,7 @@ import { getV3Pool, getVaults } from '@sushiswap/graph-client/data-api' import { unstable_cache } from 'next/cache' -import notFound from '../../../../../not-found' import { SteerCarousel } from 'src/ui/pool/Steer/SteerCarousel' - +import notFound from '../../../../../not-found' export default async function VaultOverviewPage({ params, @@ -10,7 +9,7 @@ export default async function VaultOverviewPage({ params: { chainId: string; address: string } }) { const { chainId, address } = params - const poolP = await unstable_cache( + const pool = await unstable_cache( async () => getV3Pool({ chainId: Number(chainId), address }), ['pool', `${chainId}:${address}`], { @@ -18,7 +17,7 @@ export default async function VaultOverviewPage({ }, )() - const vaultsP = unstable_cache( + const vaults = await unstable_cache( async () => getVaults({ chainId: Number(chainId), poolAddress: address }), ['vaults', `${chainId}:${address}`], { @@ -26,12 +25,9 @@ export default async function VaultOverviewPage({ }, )() - const [pool, vaults] = await Promise.all([poolP, vaultsP]) - if (!pool || !vaults) { return notFound() } - return } diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/layout.tsx index 6e49646bae..c188de03f7 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/[vault]/layout.tsx @@ -1,10 +1,8 @@ -import { getV3Pool, getVault } from '@sushiswap/graph-client/data-api' -import { Breadcrumb, Container, LinkInternal } from '@sushiswap/ui' +import { getVault } from '@sushiswap/graph-client/data-api' +import { Container, LinkInternal } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' -import { headers } from 'next/headers' import { notFound } from 'next/navigation' import React from 'react' -import { PoolHeader } from 'src/ui/pool/PoolHeader' export default async function Layout({ children, @@ -13,16 +11,6 @@ export default async function Layout({ children: React.ReactNode params: { chainId: string; vault: string; address: string } }) { - const pool = await unstable_cache( - async () => - await getV3Pool({ - chainId: Number(params.chainId), - address: params.address, - }), - ['pool', `${params.chainId}:${params.address}`], - { revalidate: 60 * 15 }, - )() - const vault = await unstable_cache( async () => await getVault({ @@ -33,56 +21,31 @@ export default async function Layout({ { revalidate: 60 * 15 }, )() - if (!vault || !pool) { + if (!vault) { notFound() } - const headersList = headers() - const referer = headersList.get('referer') - return ( - <> - - +
+ + {vault.isDeprecated && ( +
+
This vault is deprecated.
+
+ {"It will not accrue any fees and won't be readjusted."} +
+
+ )} + + ← Strategies +
- - + + {children} -
-
- {' '} -
- - {vault.isDeprecated && ( -
-
This vault is deprecated.
-
- {"It will not accrue any fees and won't be readjusted."} -
-
- )} - - ← Strategies - -
- - {children} - -
-
-
- +
) } diff --git a/apps/web/src/lib/hooks/api/useV2Pool.ts b/apps/web/src/lib/hooks/api/useV2Pool.ts index a8e737b371..810f23a251 100644 --- a/apps/web/src/lib/hooks/api/useV2Pool.ts +++ b/apps/web/src/lib/hooks/api/useV2Pool.ts @@ -6,8 +6,9 @@ import { Amount } from 'sushi/currency' import { V2Pool, getV2Pool } from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' -import { getTokensFromPool } from '../useTokensFromPool' import { PoolId } from 'sushi' +import { stringify } from 'sushi/bigint-serializer' +import { getTokensFromPool } from '../useTokensFromPool' export const useV2Pool = (poolId: PoolId) => { const { @@ -23,6 +24,7 @@ export const useV2Pool = (poolId: PoolId) => { }) return result }, + queryKeyHashFn: stringify, }) const { token0, token1, liquidityToken } = useMemo(() => { @@ -46,13 +48,9 @@ export const useV2Pool = (poolId: PoolId) => { liquidityToken, liquidityUSD: pool ? Number(pool?.liquidityUSD) : null, reserve0: - token0 && pool - ? Amount.fromRawAmount(token0, pool.reserve0) - : null, + token0 && pool ? Amount.fromRawAmount(token0, pool.reserve0) : null, reserve1: - token1 && pool - ? Amount.fromRawAmount(token1, pool.reserve1) - : null, + token1 && pool ? Amount.fromRawAmount(token1, pool.reserve1) : null, totalSupply: liquidityToken && pool ? Amount.fromRawAmount(liquidityToken, pool.liquidity) diff --git a/apps/web/src/ui/pool/Steer/SteerLiquidityDistributionWidget/SteerTokenDistributionBar.tsx b/apps/web/src/ui/pool/Steer/SteerLiquidityDistributionWidget/SteerTokenDistributionBar.tsx index d66c5ce0f9..458b576185 100644 --- a/apps/web/src/ui/pool/Steer/SteerLiquidityDistributionWidget/SteerTokenDistributionBar.tsx +++ b/apps/web/src/ui/pool/Steer/SteerLiquidityDistributionWidget/SteerTokenDistributionBar.tsx @@ -4,6 +4,7 @@ import { usePrices } from '@sushiswap/react-query' import { SteerVault, getTokenRatios } from '@sushiswap/steer-sdk' import { useQuery } from '@tanstack/react-query' import React from 'react' +import { stringify } from 'sushi/bigint-serializer' interface SteerTokenDistributionBarProps { vault: SteerVault @@ -14,7 +15,7 @@ export function SteerTokenDistributionBar({ }: SteerTokenDistributionBarProps) { const { data: prices } = usePrices({ chainId: vault.chainId }) const { data: tokenRatios } = useQuery({ - queryKey: ['tokenRatios', JSON.stringify(vault), prices], + queryKey: ['tokenRatios', vault, prices], queryFn: async () => { if (!prices) return @@ -38,6 +39,7 @@ export function SteerTokenDistributionBar({ } }, enabled: !!prices, + queryKeyHashFn: stringify, }) return ( diff --git a/apps/web/src/ui/pool/Steer/SteerPoolCard.tsx b/apps/web/src/ui/pool/Steer/SteerPoolCard.tsx index db9958ef4c..f0a47557d9 100644 --- a/apps/web/src/ui/pool/Steer/SteerPoolCard.tsx +++ b/apps/web/src/ui/pool/Steer/SteerPoolCard.tsx @@ -14,12 +14,12 @@ import { import { FC } from 'react' import { formatPercent, formatUSD } from 'sushi/format' +import { VaultV1 } from '@sushiswap/graph-client/data-api' import type { PoolWithFeeAprs, PoolWithIncentives } from 'sushi/types' import { APRHoverCard } from '../APRHoverCard' import { SteerAPRChart } from './SteerAPRChart' import { SteerLiquidityDistributionWidget } from './SteerLiquidityDistributionWidget/SteerLiquidityDistributionWidget' import { SteerStrategyConfig } from './constants' -import { VaultV1 } from '@sushiswap/graph-client/data-api' interface SteerPoolCardProps { pool: PoolWithIncentives @@ -28,7 +28,9 @@ interface SteerPoolCardProps { export const SteerPoolCard: FC = ({ pool, vault }) => { return ( - + Date: Wed, 7 Aug 2024 00:57:04 +0700 Subject: [PATCH 041/139] fix: links --- .../src/app/(evm)/[chainId]/explore/hero.tsx | 4 ++-- .../v3/[address]/positions/create/page.tsx | 10 ++++---- apps/web/src/ui/pool/PoolsTable.tsx | 23 ++++++++----------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx index 4f683d0873..44bad73ad5 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx @@ -79,7 +79,7 @@ export const Hero: FC = () => { asChild >
@@ -98,7 +98,7 @@ export const Hero: FC = () => { {isSushiSwapV2ChainId(chainId as ChainId) ? (
diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx index 1dff53ff0a..f3ebdacdda 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx @@ -2,13 +2,13 @@ import { Container, LinkInternal } from '@sushiswap/ui' import React from 'react' import { ConcentratedLiquidityProvider } from 'src/ui/pool/ConcentratedLiquidityProvider' import { NewPosition } from 'src/ui/pool/NewPosition' +import { ChainId } from 'sushi' import { isSushiSwapV3ChainId } from 'sushi/config' -import { getChainIdAddressFromId, unsanitize } from 'sushi/format' export default async function PositionsCreatePage({ params, -}: { params: { id: string } }) { - const { chainId, address } = getChainIdAddressFromId(unsanitize(params.id)) +}: { params: { address: string; chainId: string } }) { + const chainId = +params.chainId as ChainId if (!isSushiSwapV3ChainId(chainId)) { throw new Error('This page only supports SushiSwap V3 pools') @@ -18,13 +18,13 @@ export default async function PositionsCreatePage({
← Back - +
diff --git a/apps/web/src/ui/pool/PoolsTable.tsx b/apps/web/src/ui/pool/PoolsTable.tsx index 86c6c97b8c..25702275d2 100644 --- a/apps/web/src/ui/pool/PoolsTable.tsx +++ b/apps/web/src/ui/pool/PoolsTable.tsx @@ -96,11 +96,6 @@ const COLUMNS = [
{props.row.original.name} - {/* {token0?.symbol}{' '} - - / - {' '} - {token1?.symbol}{' '} */}
e.stopPropagation()} shallow={true} className="flex items-center" - href={`/pool/${row.original.id}`} + href={`/${row.original.chainId}/pool/v3/${row.original.address}`} > Pool details @@ -240,7 +235,7 @@ const COLUMNS = [ onClick={(e) => e.stopPropagation()} shallow={true} className="flex items-center" - href={`/pool/${row.original.id}/positions/create`} + href={`/${row.original.chainId}/pool/v3/${row.original.address}/positions/create`} > Create position @@ -257,7 +252,7 @@ const COLUMNS = [ onClick={(e) => e.stopPropagation()} shallow={true} className="flex items-center" - href={`/pool/${row.original.id}/smart`} + href={`/${row.original.chainId}/pool/v3/${row.original.address}/smart`} > e.stopPropagation()} shallow={true} className="flex items-center" - href={`/pool/incentivize?chainId=${ + href={`/${ row.original.chainId - }&fromCurrency=${ + }/pool/incentivize?fromCurrency=${ row.original.token0Address === Native.onChain(row.original.chainId).wrapped.address ? 'NATIVE' @@ -353,7 +348,7 @@ const COLUMNS = [ onClick={(e) => e.stopPropagation()} shallow={true} className="flex items-center" - href={`/pool/${row.original.id}/add`} + href={`/${row.original.chainId}/pool/v2/${row.original.address}/add`} > Add liquidity @@ -364,7 +359,7 @@ const COLUMNS = [ onClick={(e) => e.stopPropagation()} shallow={true} className="flex items-center" - href={`/pool/${row.original.id}/remove`} + href={`/${row.original.chainId}/pool/v2/${row.original.address}/remove`} > Remove liquidity @@ -385,7 +380,7 @@ const COLUMNS = [ onClick={(e) => e.stopPropagation()} shallow={true} className="flex items-center" - href={`/pool/${row.original.id}/stake`} + href={`/${row.original.chainId}/pool/v2/${row.original.address}/stake`} > Stake @@ -406,7 +401,7 @@ const COLUMNS = [ onClick={(e) => e.stopPropagation()} shallow={true} className="flex items-center" - href={`/pool/${row.original.id}/unstake`} + href={`/${row.original.chainId}/pool/v2/${row.original.address}/unstake`} > Unstake From ce2729cf9d8444b81659efed178ade1e251b2948 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Wed, 7 Aug 2024 00:58:33 +0700 Subject: [PATCH 042/139] fix: v3 add & incentive page --- .../src/app/(evm)/[chainId]/explore/page.tsx | 2 +- .../[chainId]/pool/incentivize/layout.tsx | 14 ++- .../(evm)/[chainId]/pool/incentivize/page.tsx | 9 +- .../app/(evm)/[chainId]/pool/v2/layout.tsx | 14 +++ .../app/(evm)/[chainId]/pool/v3/add/page.tsx | 106 +++--------------- .../app/(evm)/[chainId]/pool/v3/layout.tsx | 14 +++ .../ConcentratedLiquidityURLStateProvider.tsx | 76 ++----------- 7 files changed, 74 insertions(+), 161 deletions(-) create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v2/layout.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v3/layout.tsx diff --git a/apps/web/src/app/(evm)/[chainId]/explore/page.tsx b/apps/web/src/app/(evm)/[chainId]/explore/page.tsx index 031e191ca0..c3a226e27d 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/page.tsx @@ -19,7 +19,7 @@ export default async function PoolPage({ }) { const pools = await unstable_cache( async () => getTopPools({ chainId: +chainId }), - ['pools', chainId.toString()], + ['pools', chainId], { revalidate: 60 * 3, }, diff --git a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx index c835e12861..4efa29fcf0 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx @@ -1,12 +1,22 @@ import { Container, typographyVariants } from '@sushiswap/ui' - import { BackButton } from 'src/ui/pool/BackButton' +import { ChainId } from 'sushi/chain' +import { isAngleEnabledChainId } from 'sushi/config' +import notFound from '../../not-found' export const metadata = { title: 'Pool 💦', } -export default function Layout({ children }: { children: React.ReactNode }) { +export default function Layout({ + children, + params, +}: { children: React.ReactNode; params: { chainId: string } }) { + const chainId = +params.chainId as ChainId + if (!isAngleEnabledChainId(chainId)) { + return notFound() + } + return ( <> diff --git a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx index 14d8cfd6a0..e95b73e102 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx @@ -28,6 +28,7 @@ import { typographyVariants, } from '@sushiswap/ui' import format from 'date-fns/format' +import { useRouter } from 'next/navigation' import { useMemo, useState } from 'react' import { Web3Input } from 'src/lib/wagmi/components/web3-input' import { useConcentratedLiquidityPool } from 'src/lib/wagmi/hooks/pools/hooks/useConcentratedLiquidityPool' @@ -52,6 +53,7 @@ import { SelectTokensWidget } from 'src/ui/pool/SelectTokensWidget' import { Chain } from 'sushi/chain' import { ANGLE_SUPPORTED_CHAIN_IDS, + AngleEnabledChainId, SushiSwapV3ChainId, isWNativeSupported, } from 'sushi/config' @@ -62,9 +64,10 @@ import { useAccount, useWaitForTransactionReceipt } from 'wagmi' const APPROVE_TAG = 'approve-incentivize' -export default function Page() { +export default function Page({ params }: { params: { chainId: string } }) { return ( @@ -82,11 +85,11 @@ const Incentivize = withCheckerRoot(() => { token1, setToken1, setToken0, - setNetwork, feeAmount, setFeeAmount, } = useConcentratedLiquidityURLState() + const router = useRouter() const { approved } = useApproved(APPROVE_TAG) const [value, setValue] = useState('') const [customize, setCustomize] = useState(false) @@ -201,7 +204,7 @@ const Incentivize = withCheckerRoot(() => { router.push(`/${chainId}/pool/incentivize`)} networks={ANGLE_SUPPORTED_CHAIN_IDS} /> {children} +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx index 018dc7a660..aa1be38602 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx @@ -1,7 +1,7 @@ 'use client' +import { useRouter } from 'next/navigation' import React, { FC, useMemo, useState } from 'react' -import { SUPPORTED_CHAIN_IDS } from 'src/config' import { useTokenAmountDollarValues } from 'src/lib/hooks' import { useConcentratedPositionInfo } from 'src/lib/wagmi/hooks/positions/hooks/useConcentratedPositionInfo' import { ConcentratedLiquidityProvider } from 'src/ui/pool/ConcentratedLiquidityProvider' @@ -15,14 +15,21 @@ import { SelectNetworkWidget } from 'src/ui/pool/SelectNetworkWidget' import { SelectPricesWidget } from 'src/ui/pool/SelectPricesWidget' import { SelectTokensWidget } from 'src/ui/pool/SelectTokensWidget' import { computeSushiSwapV3PoolAddress } from 'sushi' -import { SUSHISWAP_V3_FACTORY_ADDRESS, isWNativeSupported } from 'sushi/config' +import { + SUSHISWAP_V3_FACTORY_ADDRESS, + SUSHISWAP_V3_SUPPORTED_CHAIN_IDS, + SushiSwapV3ChainId, + isWNativeSupported, +} from 'sushi/config' import { tryParseAmount } from 'sushi/currency' import { SWRConfig } from 'swr' import { useAccount } from 'wagmi' -export default function Page() { +export default function Page({ params }: { params: { chainId: string } }) { return ( - + <_Add /> @@ -40,7 +47,6 @@ const _Add: FC = () => { token1, setToken1, setToken0, - setNetwork, feeAmount, setFeeAmount, tokensLoading, @@ -48,6 +54,8 @@ const _Add: FC = () => { switchTokens, } = useConcentratedLiquidityURLState() + const router = useRouter() + const [_invert, _setInvert] = useState(false) const { data: position } = useConcentratedPositionInfo({ chainId, @@ -80,94 +88,10 @@ const _Add: FC = () => { return ( <> - {/*
*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/* */} - {/* ) : (*/} - {/*
*/} - {/* )*/} - {/* }*/} - {/* >*/} - {/* */} - {/* {token0 && !tokensLoading ? (*/} - {/* */} - {/* ) : (*/} - {/*
*/} - {/* )}*/} - {/* {token1 && !tokensLoading ? (*/} - {/* */} - {/* ) : (*/} - {/*
*/} - {/* )}*/} - {/* */} - {/* */} - {/*
*/} - {/*
*/} - {/* {token0 && token1 ? (*/} - {/* <>*/} - {/*

*/} - {/* {token0.symbol}/{token1.symbol}*/} - {/*

*/} - {/*

*/} - {/* SushiSwap V3 • {feeAmount / 10000}%*/} - {/*

*/} - {/* */} - {/* ) : tokensLoading ? (*/} - {/* <>*/} - {/* */} - {/* */} - {/* */} - {/* ) : (*/} - {/* <>*/} - {/* )}*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/* Network*/} - {/*
*/} - {/* {Chain.from(chainId)?.name}*/} - {/*
*/} - {/*
*/} - {/*
*/} - {/* Fee Tier*/} - {/*
{feeAmount / 10000}% Fee
*/} - {/*
*/} - {/*
*/} - {/* Pool Type*/} - {/*
Concentrated Liquidity
*/} - {/*
*/} - {/*
*/} - {/* Current Price*/} - {/* {!isInitialLoading && !pool ? (*/} - {/* N/A*/} - {/* ) : isInitialLoading ? (*/} - {/* */} - {/* ) : token0 && token1 && pool ? (*/} - {/*
*/} - {/* */} - {/*
*/} - {/* ) : null}*/} - {/*
*/} - {/*
*/} - {/*
*/} router.push(`/${chainId}/pool/v3/add`)} + networks={SUSHISWAP_V3_SUPPORTED_CHAIN_IDS} /> {children} +} diff --git a/apps/web/src/ui/pool/ConcentratedLiquidityURLStateProvider.tsx b/apps/web/src/ui/pool/ConcentratedLiquidityURLStateProvider.tsx index b80dd32b74..58ab88622f 100644 --- a/apps/web/src/ui/pool/ConcentratedLiquidityURLStateProvider.tsx +++ b/apps/web/src/ui/pool/ConcentratedLiquidityURLStateProvider.tsx @@ -10,22 +10,13 @@ import { SushiSwapV3FeeAmount, currencyFromShortCurrencyName, isShortCurrencyName, - isSushiSwapV3ChainId, isWNativeSupported, } from 'sushi/config' import { Native, Token, Type } from 'sushi/currency' import { isAddress } from 'viem' -import { useChainId } from 'wagmi' import { z } from 'zod' export const queryParamsSchema = z.object({ - chainId: z.coerce - .number() - .int() - .gte(0) - .lte(2 ** 256) - .optional() - .transform((chainId) => chainId as SushiSwapV3ChainId | undefined), fromCurrency: z.nullable(z.string()).transform((value) => value ?? 'NATIVE'), toCurrency: z.nullable(z.string()).transform((value) => value ?? 'SUSHI'), feeAmount: z.coerce @@ -48,7 +39,6 @@ type State = { token1: Type | undefined tokensLoading: boolean feeAmount: SushiSwapV3FeeAmount - setNetwork(chainId: SushiSwapV3ChainId): void setToken0(currency: Type): void setToken1(currency: Type): void setFeeAmount(feeAmount: SushiSwapV3FeeAmount): void @@ -61,6 +51,7 @@ export const ConcentratedLiquidityUrlStateContext = createContext( interface ConcentratedLiquidityURLStateProvider { children: ReactNode | ((state: State) => ReactNode) + chainId: SushiSwapV3ChainId supportedNetworks?: ChainId[] } @@ -83,43 +74,24 @@ const getTokenFromUrl = ( } } -const getChainIdFromUrl = ( - urlChainId: ChainId | undefined, - connectedChainId: ChainId | undefined, -): SushiSwapV3ChainId => { - let chainId: SushiSwapV3ChainId = ChainId.ETHEREUM - if (urlChainId && isSushiSwapV3ChainId(urlChainId)) { - chainId = urlChainId - } else if (connectedChainId && isSushiSwapV3ChainId(connectedChainId)) { - chainId = connectedChainId - } - return chainId -} - export const ConcentratedLiquidityURLStateProvider: FC< ConcentratedLiquidityURLStateProvider -> = ({ children, supportedNetworks = SUPPORTED_CHAIN_IDS }) => { +> = ({ children, chainId, supportedNetworks = SUPPORTED_CHAIN_IDS }) => { const { push } = useRouter() const pathname = usePathname() const searchParams = useSearchParams()! - const { - chainId: chainIdFromUrl, - fromCurrency, - toCurrency, - feeAmount, - tokenId, - } = queryParamsSchema.parse({ - chainId: searchParams.get('chainId'), - fromCurrency: searchParams.get('fromCurrency'), - toCurrency: searchParams.get('toCurrency'), - feeAmount: searchParams.get('feeAmount'), - tokenId: searchParams.get('tokenId'), - }) - const chainId = useChainId() + const { fromCurrency, toCurrency, feeAmount, tokenId } = + queryParamsSchema.parse({ + fromCurrency: searchParams.get('fromCurrency'), + toCurrency: searchParams.get('toCurrency'), + feeAmount: searchParams.get('feeAmount'), + tokenId: searchParams.get('tokenId'), + }) - const tmp = getChainIdFromUrl(chainIdFromUrl, chainId as ChainId) - const _chainId = supportedNetworks?.includes(tmp) ? tmp : ChainId.ETHEREUM + const _chainId = supportedNetworks?.includes(chainId) + ? chainId + : ChainId.ETHEREUM const { data: tokenFrom, isInitialLoading: isTokenFromLoading } = useTokenWithCache({ @@ -156,29 +128,6 @@ export const ConcentratedLiquidityURLStateProvider: FC< token1 = undefined } - const setNetwork = (chainId: SushiSwapV3ChainId) => { - const fromCurrency = - state.token0?.chainId === chainId - ? state.token0.isNative - ? 'NATIVE' - : state.token0.wrapped.address - : 'NATIVE' - const toCurrency = - state.token1?.chainId === chainId - ? state.token1.isNative - ? 'NATIVE' - : state.token1.wrapped.address - : undefined - - const _searchParams = new URLSearchParams( - Array.from(searchParams.entries()), - ) - _searchParams.set('chainId', chainId.toString()) - _searchParams.set('fromCurrency', fromCurrency) - if (toCurrency) _searchParams.set('toCurrency', toCurrency) - void push(`${pathname}?${_searchParams.toString()}`, { scroll: false }) - } - const setToken0 = (currency: Type) => { const same = currency.wrapped.address === token1?.wrapped.address const _fromCurrency = currency.isNative @@ -246,7 +195,6 @@ export const ConcentratedLiquidityURLStateProvider: FC< tokensLoading: isTokenFromLoading || isTokenToLoading, setToken0, setToken1, - setNetwork, setFeeAmount, switchTokens, } From 1909f23b2b32f392025fb95e8ff8d4d00f74cd64 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Wed, 7 Aug 2024 01:03:57 +0700 Subject: [PATCH 043/139] chore: SUSHI_DATA_API_HOST env --- apps/web/.env.example | 3 +++ packages/sushi/src/config/subgraph/hosts.ts | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/web/.env.example b/apps/web/.env.example index d2ca464e96..9fe0c9c16a 100644 --- a/apps/web/.env.example +++ b/apps/web/.env.example @@ -11,3 +11,6 @@ ALCHEMY_ID= NEXT_PUBLIC_INFURA_ID= INFURA_ID= DRPC_ID= + +SUSHI_DATA_API_HOST= +NEXT_SUSHI_DATA_API_HOST= diff --git a/packages/sushi/src/config/subgraph/hosts.ts b/packages/sushi/src/config/subgraph/hosts.ts index 1f6561e69e..e93678671a 100644 --- a/packages/sushi/src/config/subgraph/hosts.ts +++ b/packages/sushi/src/config/subgraph/hosts.ts @@ -33,4 +33,7 @@ const DECENTRALIZED_NETWORK_KEY = export const DECENTRALIZED_HOST_BY_SUBGRAPH_ID = `gateway-arbitrum.network.thegraph.com/api/${DECENTRALIZED_NETWORK_KEY}/subgraphs/id` export const DECENTRALIZED_HOST_BY_DEPLOYMENT_ID = `gateway-arbitrum.network.thegraph.com/api/${DECENTRALIZED_NETWORK_KEY}/deployments/id` -export const SUSHI_DATA_API_HOST = 'data.sushi.com/graphql' \ No newline at end of file +export const SUSHI_DATA_API_HOST = + process.env['SUSHI_DATA_API_HOST'] || + process.env['NEXT_PUBLIC_SUSHI_DATA_API_HOST'] || + 'data.sushi.com/graphql' From 3d749a8124675b310f37fb041e86ae0cf7db5b43 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Wed, 7 Aug 2024 01:30:37 +0700 Subject: [PATCH 044/139] fix: build --- apps/web/src/ui/pool/SelectNetworkWidget.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/ui/pool/SelectNetworkWidget.tsx b/apps/web/src/ui/pool/SelectNetworkWidget.tsx index f6f1b72181..0647436ed6 100644 --- a/apps/web/src/ui/pool/SelectNetworkWidget.tsx +++ b/apps/web/src/ui/pool/SelectNetworkWidget.tsx @@ -6,7 +6,7 @@ import React, { FC, memo } from 'react' import { ChainId, chainName } from 'sushi/chain' interface SelectNetworkWidgetProps { - networks: ChainId[] + networks: readonly ChainId[] selectedNetwork: ChainId onSelect(chainId: ChainId): void title?: string From 6c3a869f3b9cdc49a5d75edf7b64e517c60b2de6 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Wed, 7 Aug 2024 09:02:27 +0700 Subject: [PATCH 045/139] fix: .env.example --- apps/web/.env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/.env.example b/apps/web/.env.example index 9fe0c9c16a..d14d60ab3b 100644 --- a/apps/web/.env.example +++ b/apps/web/.env.example @@ -13,4 +13,4 @@ INFURA_ID= DRPC_ID= SUSHI_DATA_API_HOST= -NEXT_SUSHI_DATA_API_HOST= +NEXT_PUBLIC_SUSHI_DATA_API_HOST= From f40059cdcb1ae5fdf14812d3a25df6ba93cf70ee Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Wed, 7 Aug 2024 09:09:55 +0700 Subject: [PATCH 046/139] chore: move /explore -> /explore/pools --- apps/web/src/app/(evm)/[chainId]/explore/hero.tsx | 13 ++++--------- apps/web/src/app/(evm)/[chainId]/explore/layout.tsx | 6 +++--- .../(evm)/[chainId]/explore/{ => pools}/page.tsx | 0 3 files changed, 7 insertions(+), 12 deletions(-) rename apps/web/src/app/(evm)/[chainId]/explore/{ => pools}/page.tsx (100%) diff --git a/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx index 44bad73ad5..9cd1c45b36 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx @@ -1,5 +1,3 @@ -'use client' - import { GiftIcon } from '@heroicons/react-v1/outline' import { LinkExternal, LinkInternal, typographyVariants } from '@sushiswap/ui' import { Button } from '@sushiswap/ui' @@ -21,11 +19,8 @@ import { isSushiSwapV2ChainId, isSushiSwapV3ChainId, } from 'sushi/config' -import { useChainId } from 'wagmi' - -export const Hero: FC = () => { - const chainId = useChainId() +export const Hero: FC<{ chainId: ChainId }> = ({ chainId }) => { return (
@@ -55,9 +50,9 @@ export const Hero: FC = () => { @@ -121,7 +116,7 @@ export const Hero: FC = () => { variant="secondary" size="lg" > - + I want to incentivize a pool diff --git a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx index cb725bb649..443f89da1b 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx @@ -9,14 +9,14 @@ export const metadata = { export default async function ExploreLayout({ children, - params: { chainId }, + params, }: { children: React.ReactNode; params: { chainId: string } }) { return ( <> - +
- +
diff --git a/apps/web/src/app/(evm)/[chainId]/explore/page.tsx b/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx similarity index 100% rename from apps/web/src/app/(evm)/[chainId]/explore/page.tsx rename to apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx From a241ed314fc345ea670570fe61bf38bf1b4e30ef Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Wed, 7 Aug 2024 09:32:39 +0700 Subject: [PATCH 047/139] fix: sort tokens in getV3BasePoolsByToken --- apps/web/src/lib/hooks/usePoolsByTokenPair.ts | 5 +---- .../data-api/queries/v3/pools-by-tokens.ts | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/apps/web/src/lib/hooks/usePoolsByTokenPair.ts b/apps/web/src/lib/hooks/usePoolsByTokenPair.ts index 6bfcc9cf7d..d9abe25a7e 100644 --- a/apps/web/src/lib/hooks/usePoolsByTokenPair.ts +++ b/apps/web/src/lib/hooks/usePoolsByTokenPair.ts @@ -9,10 +9,7 @@ function usePoolsByTokenPair(tokenId0?: string, tokenId1?: string) { queryFn: () => { if (!tokenId0 || !tokenId1) return [] - return getV3PoolsByTokenPair( - tokenId0.toLowerCase(), - tokenId1.toLowerCase(), - ) + return getV3PoolsByTokenPair(tokenId0, tokenId1) }, enabled: !!tokenId0 && !!tokenId1, }) diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts index 2bd829088e..6fae6a819e 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts @@ -61,16 +61,30 @@ export async function getV3BasePoolsByToken( options?: RequestOptions, ): Promise[]> { const url = `https://${SUSHI_DATA_API_HOST}` - const chainId = Number(variables.chainId) as ChainId + const chainId = variables.chainId as ChainId if (!isSushiSwapV3ChainId(chainId)) { throw new Error('Invalid chainId') } + const tokens = [variables.token0, variables.token1].sort() as [ + `0x${string}`, + `0x${string}`, + ] + const result = await request( - { url, document: V3PoolsByTokensQuery, variables }, + { + url, + document: V3PoolsByTokensQuery, + variables: { + chainId: chainId, + token0: tokens[0].toLowerCase(), + token1: tokens[1].toLowerCase(), + }, + }, options, ) + if (result.v3PoolsByTokens) { return result.v3PoolsByTokens.map( (pool) => From 6d691dcd5722f292191f1445f06811e93a6a8286 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Wed, 7 Aug 2024 09:34:23 +0700 Subject: [PATCH 048/139] chore: cleanup --- apps/web/src/app/(evm)/[chainId]/explore/hero.tsx | 3 +-- apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx | 2 +- apps/web/src/ui/pool/ConcentratedLiquidityURLStateProvider.tsx | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx index 9cd1c45b36..870aebfd4e 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx @@ -11,8 +11,7 @@ import { } from '@sushiswap/ui' import { SelectIcon } from '@sushiswap/ui' import { DiscordIcon } from '@sushiswap/ui/icons/DiscordIcon' -import React from 'react' -import { FC } from 'react' +import React, { FC } from 'react' import { ChainId } from 'sushi/chain' import { SushiSwapV3ChainId, diff --git a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx index e95b73e102..28a756328b 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx @@ -724,7 +724,7 @@ const Incentivize = withCheckerRoot(() => { testId="incentivize-confirmation-modal" successMessage={`Successfully incentivized the ${token0.symbol}/${token1.symbol} V3 pool`} buttonText="Go to pool" - buttonLink={`/pools/${pool.chainId}:${v3Address}?activeTab=myPositions`} + buttonLink={`/${pool.chainId}/pool/v3/${v3Address}`} txHash={data} /> ) : null} diff --git a/apps/web/src/ui/pool/ConcentratedLiquidityURLStateProvider.tsx b/apps/web/src/ui/pool/ConcentratedLiquidityURLStateProvider.tsx index 58ab88622f..ce607f5d43 100644 --- a/apps/web/src/ui/pool/ConcentratedLiquidityURLStateProvider.tsx +++ b/apps/web/src/ui/pool/ConcentratedLiquidityURLStateProvider.tsx @@ -136,7 +136,6 @@ export const ConcentratedLiquidityURLStateProvider: FC< const _searchParams = new URLSearchParams( Array.from(searchParams.entries()), ) - _searchParams.set('chainId', currency.chainId.toString()) _searchParams.set('fromCurrency', _fromCurrency) if (toCurrency) { _searchParams.set( @@ -154,7 +153,6 @@ export const ConcentratedLiquidityURLStateProvider: FC< const _searchParams = new URLSearchParams( Array.from(searchParams.entries()), ) - _searchParams.set('chainId', currency.chainId.toString()) _searchParams.set('toCurrency', _toCurrency) if (fromCurrency) { _searchParams.set( From a375ef19734e821eb7d83add1854f3c81a8748ac Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Wed, 7 Aug 2024 15:54:06 +0700 Subject: [PATCH 049/139] chore: update header --- .../src/app/(evm)/_common/header-elements.ts | 94 --------------- .../src/app/(evm)/_common/header-elements.tsx | 68 +++++++++++ apps/web/src/app/_common/header-elements.ts | 7 +- packages/ui/src/components/navigation.tsx | 107 +++++++++++++++++- pnpm-lock.yaml | 4 + 5 files changed, 175 insertions(+), 105 deletions(-) delete mode 100644 apps/web/src/app/(evm)/_common/header-elements.ts create mode 100644 apps/web/src/app/(evm)/_common/header-elements.tsx diff --git a/apps/web/src/app/(evm)/_common/header-elements.ts b/apps/web/src/app/(evm)/_common/header-elements.ts deleted file mode 100644 index ae9a05b80f..0000000000 --- a/apps/web/src/app/(evm)/_common/header-elements.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { - type NavigationElement, - NavigationElementDropdown, - NavigationElementType, -} from '@sushiswap/ui' -import { EXPLORE_NAVIGATION_LINKS } from 'src/app/_common/header-elements' - -const TOOLS_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ - { - title: 'Analytics', - href: '/analytics', - description: 'Find the best opportunities', - }, - { - title: 'Blog', - href: '/blog', - description: - 'Stay up to date with the latest product developments at Sushi.', - }, - { - title: 'Academy', - href: '/academy', - description: 'Everything you need to get up to speed with DeFi.', - }, - { - title: 'Forum & Proposals', - href: 'https://forum.sushi.com', - description: 'View and discuss proposals for SushiSwap.', - }, - { - title: 'Participate', - href: 'https://snapshot.org/#/sushigov.eth', - description: - 'As a Sushi holder, you can vote on proposals to shape the future of SushiSwap.', - }, -] - -const PARTNER_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ - { - title: 'Partner with Sushi', - href: '/partner', - description: 'Incentivize your token with Sushi rewards.', - }, - { - title: 'List enquiry', - href: '/tokenlist-request', - description: 'Get your token on our default token list.', - }, -] - -export const headerElements: NavigationElement[] = [ - { - title: 'Explore', - items: EXPLORE_NAVIGATION_LINKS, - show: 'mobile', - type: NavigationElementType.Dropdown, - }, - { - title: 'Swap', - href: '/swap', - show: 'desktop', - type: NavigationElementType.Single, - }, - { - title: 'Pools', - href: '/pool', - show: 'desktop', - type: NavigationElementType.Single, - }, - { - title: 'Bonds', - href: '/bonds', - show: 'desktop', - type: NavigationElementType.Single, - }, - { - title: 'Stake', - href: '/stake', - show: 'desktop', - type: NavigationElementType.Single, - }, - { - title: 'More', - items: TOOLS_NAVIGATION_LINKS, - show: 'desktop', - type: NavigationElementType.Dropdown, - }, - { - title: 'Partners', - items: PARTNER_NAVIGATION_LINKS, - show: 'desktop', - type: NavigationElementType.Dropdown, - }, -] diff --git a/apps/web/src/app/(evm)/_common/header-elements.tsx b/apps/web/src/app/(evm)/_common/header-elements.tsx new file mode 100644 index 0000000000..e0778c1a3f --- /dev/null +++ b/apps/web/src/app/(evm)/_common/header-elements.tsx @@ -0,0 +1,68 @@ +import { + type NavigationElement, + NavigationElementDropdown, + NavigationElementType, + NavigationMenuLink, + OnramperButton, + navigationMenuTriggerStyle, +} from '@sushiswap/ui' +import { EXPLORE_NAVIGATION_LINKS } from 'src/app/_common/header-elements' + +const MORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ + { + title: 'Pay', + href: 'https://pay.sushi.com', + description: + 'Stream or create a vesting schedule with any ERC20 to any wallet.', + }, + { + title: 'Bonds', + href: 'https://sushi.com/bonds', + description: + 'Buy discounted tokens with vesting to support projects in a sustainable manner.', + }, +] + +export const headerElements: NavigationElement[] = [ + { + title: 'Explore', + items: EXPLORE_NAVIGATION_LINKS, + show: 'mobile', + type: NavigationElementType.Dropdown, + }, + { + title: 'Swap', + href: '/swap', + show: 'desktop', + type: NavigationElementType.Single, + }, + { + title: 'Pools', + href: '/explore/pool', + show: 'desktop', + type: NavigationElementType.Single, + }, + { + title: 'Stake', + href: '/stake', + show: 'desktop', + type: NavigationElementType.Single, + }, + { + type: NavigationElementType.Custom, + item: ( + + + Buy Crypto + + + ), + show: 'desktop', + }, + { + title: 'More', + items: MORE_NAVIGATION_LINKS, + show: 'desktop', + type: NavigationElementType.Dropdown, + }, +] diff --git a/apps/web/src/app/_common/header-elements.ts b/apps/web/src/app/_common/header-elements.ts index e3a864106a..b5f92a3625 100644 --- a/apps/web/src/app/_common/header-elements.ts +++ b/apps/web/src/app/_common/header-elements.ts @@ -8,7 +8,7 @@ export const EXPLORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ }, { title: 'Pools', - href: '/pools', + href: '/explore/pools', description: 'Earn fees by providing liquidity.', }, { @@ -21,11 +21,6 @@ export const EXPLORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ href: '/stake', description: 'Earn protocol fees by staking SUSHI.', }, - { - title: 'Analytics', - href: '/analytics', - description: 'Find the best opportunities', - }, { title: 'Blog', href: '/blog', diff --git a/packages/ui/src/components/navigation.tsx b/packages/ui/src/components/navigation.tsx index 4ec91e5edc..43fc7c592b 100644 --- a/packages/ui/src/components/navigation.tsx +++ b/packages/ui/src/components/navigation.tsx @@ -14,6 +14,47 @@ import { NavigationMenuTrigger, } from './navigation-menu' +const PROTOCOL_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ + { + title: 'Blog', + href: 'https://sushi.com/blog', + description: + 'Stay up to date with the latest product developments at Sushi.', + }, + { + title: 'Forum & Proposals', + href: 'https://forum.sushi.com', + description: 'View and discuss proposals for SushiSwap.', + }, + { + title: 'Vote', + href: 'https://snapshot.org/#/sushigov.eth', + description: + 'As a Sushi holder, you can vote on proposals to shape the future of SushiSwap.', + }, +] + +const PARTNER_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ + { + title: 'Partner with Sushi', + href: 'http://sushi.com/partner', + description: 'Incentivize your token with Sushi rewards.', + }, + { + title: 'List enquiry', + href: 'http://sushi.com/tokenlist-request', + description: 'Get your token on our default token list.', + }, +] + +const SUPPORT_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ + { + title: 'Academy', + href: 'https://sushi.com/academy', + description: 'Everything you need to get up to speed with DeFi.', + }, +] + const navigationContainerVariants = cva( 'px-4 sticky flex items-center flex-grow gap-4 top-0 z-50 min-h-[56px] max-h-[56px] h-[56px]', { @@ -41,7 +82,6 @@ const NavigationContainer: React.FC = ({ }) => { return (
-
{children}
@@ -152,7 +192,7 @@ const Navigation: React.FC = ({ return DropdownItem(el) case NavigationElementType.Custom: return ( -
el.item
+
{el.item}
) } }) @@ -160,9 +200,66 @@ const Navigation: React.FC = ({ return ( - - {leftElements} - +
+ + + + + + + +
    +
    + Protocol +
    + {PROTOCOL_NAVIGATION_LINKS.map((component) => ( + + {component.description} + + ))} +
    +
    +
    + Partnership +
    + {PARTNER_NAVIGATION_LINKS.map((component) => ( + + {component.description} + + ))} +
    +
    +
    + Support +
    + {SUPPORT_NAVIGATION_LINKS.map((component) => ( + + {component.description} + + ))} +
    +
    +
+
+
+
+
+ + {leftElements} + +
{rightElement ? rightElement : null}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c0927ff4f..eeb3dc2a93 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1498,6 +1498,10 @@ importers: specifier: 3.23.8 version: 3.23.8 + packages/sushi/dist/_cjs: {} + + packages/sushi/dist/_esm: {} + packages/telemetry: devDependencies: '@tsconfig/esm': From f012ebfad4f58bebf5c4a46a09d7a4cd29b721a6 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Wed, 7 Aug 2024 12:57:07 +0200 Subject: [PATCH 050/139] feat(packages/graph-client): error handling --- .../data-api/queries/analytics/day-buckets.ts | 11 ++++++++--- .../src/subgraphs/data-api/queries/pool/top-pools.ts | 11 ++++++----- .../src/subgraphs/data-api/queries/pool/v2-pool.ts | 7 +------ .../src/subgraphs/data-api/queries/pool/v3-pool.ts | 6 +----- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts index 82dacc04eb..96426f7004 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts @@ -41,10 +41,15 @@ export async function getAnalyticsDayBuckets( options, ) if (result) { - return result.sushiDayBuckets + return result.sushiDayBuckets ?? { + v2: [], + v3: [], + } + } + return { + v2: [], + v3: [], } - - throw new Error('No sushi day buckets found') } export type AnalyticsDayBuckets = Awaited< diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts index 67c2207262..72603a7d56 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts @@ -5,10 +5,10 @@ import { graphql } from '../../graphql' export const PoolsQuery = graphql( ` -query Pools($chainId: Int!) { + query TopPools($chainId: Int!) { topPools(chainId: $chainId) { - chainId id + chainId name address createdAt @@ -30,9 +30,10 @@ query Pools($chainId: Int!) { feeApr1d totalApr1d incentiveApr - source - isIncentivized isSmartPool + isIncentivized + wasIncentivized + source } } `, @@ -54,7 +55,7 @@ export async function getTopPools( return result.topPools ?? [] } - throw new Error('No pools found') + return [] } export type TopPools = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts index b24a6e07e4..0786dfe483 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts @@ -98,7 +98,6 @@ export async function getV2Pool( throw new Error('Invalid chainId') } - try { const result = await request( { url, document: V2PoolQuery, variables }, options, @@ -177,12 +176,8 @@ export async function getV2Pool( PoolWithIncentives>> > } - - throw new Error('No pool found') - } catch (_e) { - // console.error(e) return null - } + } export type V2Pool = NonNullable>> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts index 9778c434d7..00ff507d98 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts @@ -106,7 +106,7 @@ export async function getV3Pool( if (!isSushiSwapV3ChainId(chainId)) { throw new Error('Invalid chainId') } - try { + const result = await request( { url, document: V3PoolQuery, variables }, options, @@ -195,11 +195,7 @@ export async function getV3Pool( > } - throw new Error('No pool found') - } catch (_e) { - // console.error(e) return null - } } export type MaybeV3Pool = Awaited> From ce940420d692cfcdbbc393fa01bf1ba827c8f725 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Wed, 7 Aug 2024 18:12:12 +0700 Subject: [PATCH 051/139] fix: header --- apps/web/src/app/(cms)/header.tsx | 2 +- apps/web/src/app/(evm)/[chainId]/header.tsx | 3 +- .../web/src/app/(evm)/[chainId]/not-found.tsx | 6 +- .../[chainId]/pool/v2/[address]/layout.tsx | 2 +- .../src/app/(evm)/_common/header-elements.tsx | 28 +++------ apps/web/src/app/(evm)/bonds/header.tsx | 4 +- .../app/(evm)/claims/components/Header.tsx | 4 +- apps/web/src/app/(evm)/stake/header.tsx | 4 +- apps/web/src/app/(evm)/swap/header.tsx | 3 +- apps/web/src/app/_common/header-elements.ts | 61 ++++++++++++++++++- apps/web/src/app/partner/layout.tsx | 4 +- apps/web/src/app/privacy-policy/layout.tsx | 4 +- apps/web/src/app/terms-of-service/layout.tsx | 4 +- packages/ui/src/components/navigation.tsx | 1 - 14 files changed, 90 insertions(+), 40 deletions(-) diff --git a/apps/web/src/app/(cms)/header.tsx b/apps/web/src/app/(cms)/header.tsx index 5f177b4ca8..ffa8b887d7 100644 --- a/apps/web/src/app/(cms)/header.tsx +++ b/apps/web/src/app/(cms)/header.tsx @@ -40,7 +40,7 @@ export async function Header() { const navData: NavigationElement[] = [ { title: 'Explore', - items: EXPLORE_NAVIGATION_LINKS, + items: EXPLORE_NAVIGATION_LINKS(), show: 'everywhere', type: NavigationElementType.Dropdown, }, diff --git a/apps/web/src/app/(evm)/[chainId]/header.tsx b/apps/web/src/app/(evm)/[chainId]/header.tsx index 2b93fa8062..94558372a6 100644 --- a/apps/web/src/app/(evm)/[chainId]/header.tsx +++ b/apps/web/src/app/(evm)/[chainId]/header.tsx @@ -11,9 +11,8 @@ export const Header: FC = () => { const chainId = useChainId() return ( } - chainId={chainId} /> ) } diff --git a/apps/web/src/app/(evm)/[chainId]/not-found.tsx b/apps/web/src/app/(evm)/[chainId]/not-found.tsx index f0b52bf960..cf7690bb08 100644 --- a/apps/web/src/app/(evm)/[chainId]/not-found.tsx +++ b/apps/web/src/app/(evm)/[chainId]/not-found.tsx @@ -1,7 +1,9 @@ import { ChevronRightIcon } from '@heroicons/react/20/solid' import { Button, LinkInternal, typographyVariants } from '@sushiswap/ui' +import { useChainId } from 'wagmi' export default function NotFound() { + const chainId = useChainId() return (
@@ -30,7 +32,9 @@ export default function NotFound() { icon={ChevronRightIcon} iconPosition="end" > - See a list of our pools + + See a list of our pools +
diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx index 25a0ee1018..3cb176f855 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx @@ -41,7 +41,7 @@ export default async function Layout({ backUrl={ referer?.includes('/pool?') ? referer?.toString() - : `/${chainId}/explore` + : `/${chainId}/explore/pools` } address={pool.address} pool={pool} diff --git a/apps/web/src/app/(evm)/_common/header-elements.tsx b/apps/web/src/app/(evm)/_common/header-elements.tsx index e0778c1a3f..bb3f0c0442 100644 --- a/apps/web/src/app/(evm)/_common/header-elements.tsx +++ b/apps/web/src/app/(evm)/_common/header-elements.tsx @@ -1,32 +1,20 @@ import { type NavigationElement, - NavigationElementDropdown, NavigationElementType, NavigationMenuLink, OnramperButton, navigationMenuTriggerStyle, } from '@sushiswap/ui' -import { EXPLORE_NAVIGATION_LINKS } from 'src/app/_common/header-elements' - -const MORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ - { - title: 'Pay', - href: 'https://pay.sushi.com', - description: - 'Stream or create a vesting schedule with any ERC20 to any wallet.', - }, - { - title: 'Bonds', - href: 'https://sushi.com/bonds', - description: - 'Buy discounted tokens with vesting to support projects in a sustainable manner.', - }, -] +import { + EXPLORE_NAVIGATION_LINKS, + MORE_NAVIGATION_LINKS, +} from 'src/app/_common/header-elements' +import { ChainId } from 'sushi' -export const headerElements: NavigationElement[] = [ +export const headerElements = (chainId?: ChainId): NavigationElement[] => [ { title: 'Explore', - items: EXPLORE_NAVIGATION_LINKS, + items: EXPLORE_NAVIGATION_LINKS(chainId), show: 'mobile', type: NavigationElementType.Dropdown, }, @@ -38,7 +26,7 @@ export const headerElements: NavigationElement[] = [ }, { title: 'Pools', - href: '/explore/pool', + href: `/${chainId ?? 1}/explore/pools`, show: 'desktop', type: NavigationElementType.Single, }, diff --git a/apps/web/src/app/(evm)/bonds/header.tsx b/apps/web/src/app/(evm)/bonds/header.tsx index 6ac316f610..94558372a6 100644 --- a/apps/web/src/app/(evm)/bonds/header.tsx +++ b/apps/web/src/app/(evm)/bonds/header.tsx @@ -4,12 +4,14 @@ import { Navigation } from '@sushiswap/ui' import React, { FC } from 'react' import { SUPPORTED_CHAIN_IDS } from 'src/config' import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' +import { useChainId } from 'wagmi' import { headerElements } from '../_common/header-elements' export const Header: FC = () => { + const chainId = useChainId() return ( } /> ) diff --git a/apps/web/src/app/(evm)/claims/components/Header.tsx b/apps/web/src/app/(evm)/claims/components/Header.tsx index 699acc9391..18bf5051d8 100644 --- a/apps/web/src/app/(evm)/claims/components/Header.tsx +++ b/apps/web/src/app/(evm)/claims/components/Header.tsx @@ -4,12 +4,14 @@ import { Navigation } from '@sushiswap/ui' import React, { FC } from 'react' import { SUPPORTED_CHAIN_IDS } from 'src/config' import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' +import { useChainId } from 'wagmi' import { headerElements } from '../../_common/header-elements' export const Header: FC = () => { + const chainId = useChainId() return ( } /> ) diff --git a/apps/web/src/app/(evm)/stake/header.tsx b/apps/web/src/app/(evm)/stake/header.tsx index 6ac316f610..94558372a6 100644 --- a/apps/web/src/app/(evm)/stake/header.tsx +++ b/apps/web/src/app/(evm)/stake/header.tsx @@ -4,12 +4,14 @@ import { Navigation } from '@sushiswap/ui' import React, { FC } from 'react' import { SUPPORTED_CHAIN_IDS } from 'src/config' import { WagmiHeaderComponents } from 'src/lib/wagmi/components/wagmi-header-components' +import { useChainId } from 'wagmi' import { headerElements } from '../_common/header-elements' export const Header: FC = () => { + const chainId = useChainId() return ( } /> ) diff --git a/apps/web/src/app/(evm)/swap/header.tsx b/apps/web/src/app/(evm)/swap/header.tsx index 2b93fa8062..94558372a6 100644 --- a/apps/web/src/app/(evm)/swap/header.tsx +++ b/apps/web/src/app/(evm)/swap/header.tsx @@ -11,9 +11,8 @@ export const Header: FC = () => { const chainId = useChainId() return ( } - chainId={chainId} /> ) } diff --git a/apps/web/src/app/_common/header-elements.ts b/apps/web/src/app/_common/header-elements.ts index b5f92a3625..b6cae9585c 100644 --- a/apps/web/src/app/_common/header-elements.ts +++ b/apps/web/src/app/_common/header-elements.ts @@ -1,6 +1,13 @@ -import type { NavigationElementDropdown } from '@sushiswap/ui' +import { + type NavigationElement, + type NavigationElementDropdown, + NavigationElementType, +} from '@sushiswap/ui' +import { ChainId } from 'sushi' -export const EXPLORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ +export const EXPLORE_NAVIGATION_LINKS = ( + chainId?: ChainId, +): NavigationElementDropdown['items'] => [ { title: 'Swap', href: '/swap', @@ -8,7 +15,7 @@ export const EXPLORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ }, { title: 'Pools', - href: '/explore/pools', + href: `/${chainId ?? 1}/explore/pools`, description: 'Earn fees by providing liquidity.', }, { @@ -43,3 +50,51 @@ export const EXPLORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ description: 'Get your token on our default token list.', }, ] + +export const MORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ + { + title: 'Pay', + href: 'https://pay.sushi.com', + description: + 'Stream or create a vesting schedule with any ERC20 to any wallet.', + }, + { + title: 'Bonds', + href: 'https://sushi.com/bonds', + description: + 'Buy discounted tokens with vesting to support projects in a sustainable manner.', + }, +] + +export const headerElements = (chainId?: ChainId): NavigationElement[] => [ + { + title: 'Explore', + items: EXPLORE_NAVIGATION_LINKS(chainId), + show: 'mobile', + type: NavigationElementType.Dropdown, + }, + { + title: 'Swap', + href: '/swap', + show: 'desktop', + type: NavigationElementType.Single, + }, + { + title: 'Pools', + href: `/${chainId ?? 1}/explore/pools`, + show: 'desktop', + type: NavigationElementType.Single, + }, + { + title: 'Stake', + href: '/stake', + show: 'desktop', + type: NavigationElementType.Single, + }, + { + title: 'More', + items: MORE_NAVIGATION_LINKS, + show: 'desktop', + type: NavigationElementType.Dropdown, + }, +] diff --git a/apps/web/src/app/partner/layout.tsx b/apps/web/src/app/partner/layout.tsx index b7b5bddcd3..9d331dde4e 100644 --- a/apps/web/src/app/partner/layout.tsx +++ b/apps/web/src/app/partner/layout.tsx @@ -1,6 +1,6 @@ import { Navigation } from '@sushiswap/ui' import { Metadata } from 'next' -import { headerElements } from '../(evm)/_common/header-elements' +import { headerElements } from '../_common/header-elements' export const metadata: Metadata = { title: 'Partner', @@ -9,7 +9,7 @@ export const metadata: Metadata = { export default function Layout({ children }: { children: React.ReactNode }) { return ( <> - +
{children}
) diff --git a/apps/web/src/app/privacy-policy/layout.tsx b/apps/web/src/app/privacy-policy/layout.tsx index 774cc651ee..ecfd12e32a 100644 --- a/apps/web/src/app/privacy-policy/layout.tsx +++ b/apps/web/src/app/privacy-policy/layout.tsx @@ -1,6 +1,6 @@ import { Navigation } from '@sushiswap/ui' import { Metadata } from 'next' -import { headerElements } from '../(evm)/_common/header-elements' +import { headerElements } from '../_common/header-elements' export const metadata: Metadata = { title: 'Privacy Policy', @@ -9,7 +9,7 @@ export const metadata: Metadata = { export default function Layout({ children }: { children: React.ReactNode }) { return ( <> - +
{children}
) diff --git a/apps/web/src/app/terms-of-service/layout.tsx b/apps/web/src/app/terms-of-service/layout.tsx index ecf29a4e4d..92ecef7427 100644 --- a/apps/web/src/app/terms-of-service/layout.tsx +++ b/apps/web/src/app/terms-of-service/layout.tsx @@ -1,6 +1,6 @@ import { Navigation } from '@sushiswap/ui' import { Metadata } from 'next' -import { headerElements } from '../(evm)/_common/header-elements' +import { headerElements } from '../_common/header-elements' export const metadata: Metadata = { title: 'Terms Of Service', @@ -9,7 +9,7 @@ export const metadata: Metadata = { export default function Layout({ children }: { children: React.ReactNode }) { return ( <> - +
{children}
) diff --git a/packages/ui/src/components/navigation.tsx b/packages/ui/src/components/navigation.tsx index 43fc7c592b..8dc1186949 100644 --- a/packages/ui/src/components/navigation.tsx +++ b/packages/ui/src/components/navigation.tsx @@ -135,7 +135,6 @@ export type NavigationElement = interface NavProps extends VariantProps { leftElements: NavigationElement[] rightElement?: React.ReactNode - chainId?: number } const Navigation: React.FC = ({ From 3e4e15f40c0509ee4440831830cb85b3c0bd6814 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Wed, 7 Aug 2024 13:21:11 +0200 Subject: [PATCH 052/139] chore(packages/graph-client): update request header for day buckets --- .../src/subgraphs/data-api/queries/analytics/day-buckets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts index 96426f7004..66999eff20 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts @@ -37,7 +37,7 @@ export async function getAnalyticsDayBuckets( const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( - { url, document: AnalyticsDayBucketsQuery, variables }, + { url, document: AnalyticsDayBucketsQuery, variables, requestHeaders: { 'Origin': 'sushi.com' } }, options, ) if (result) { From 6c070b30f8b2a94b0805ca8f95b80e6191e0b992 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Wed, 7 Aug 2024 13:33:52 +0200 Subject: [PATCH 053/139] chore(packages/graph-client): update request headers --- packages/graph-client/src/subgraphs/data-api/index.ts | 1 + .../src/subgraphs/data-api/queries/analytics/day-buckets.ts | 3 ++- .../src/subgraphs/data-api/queries/pool/top-pools.ts | 3 ++- .../src/subgraphs/data-api/queries/pool/v2-pool.ts | 3 ++- .../src/subgraphs/data-api/queries/pool/v3-pool.ts | 3 ++- .../src/subgraphs/data-api/queries/smart-pool/smart-pools.ts | 3 ++- .../src/subgraphs/data-api/queries/smart-pool/vault.ts | 3 ++- .../src/subgraphs/data-api/queries/smart-pool/vaults.ts | 3 ++- .../src/subgraphs/data-api/queries/sushi-bar/history.ts | 3 ++- .../src/subgraphs/data-api/queries/sushi-bar/stats.ts | 3 ++- .../graph-client/src/subgraphs/data-api/request-headers.ts | 3 +++ 11 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 packages/graph-client/src/subgraphs/data-api/request-headers.ts diff --git a/packages/graph-client/src/subgraphs/data-api/index.ts b/packages/graph-client/src/subgraphs/data-api/index.ts index 1fa8372637..1eedbd4efc 100644 --- a/packages/graph-client/src/subgraphs/data-api/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/index.ts @@ -1 +1,2 @@ export * from './queries' +export * from './request-headers' \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts index 66999eff20..78d6f638b8 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts @@ -3,6 +3,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' import { graphql } from '../../graphql' import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' +import { SUSHI_REQUEST_HEADERS } from '../../request-headers' export const AnalyticsDayBucketsQuery = graphql( ` @@ -37,7 +38,7 @@ export async function getAnalyticsDayBuckets( const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( - { url, document: AnalyticsDayBucketsQuery, variables, requestHeaders: { 'Origin': 'sushi.com' } }, + { url, document: AnalyticsDayBucketsQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, options, ) if (result) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts index 72603a7d56..a744466a26 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts @@ -2,6 +2,7 @@ import type { VariablesOf } from 'gql.tada' import { type RequestOptions, request } from 'src/lib/request' import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' +import { SUSHI_REQUEST_HEADERS } from '../../request-headers' export const PoolsQuery = graphql( ` @@ -48,7 +49,7 @@ export async function getTopPools( const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( - { url, document: PoolsQuery, variables }, + { url, document: PoolsQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, options, ) if (result) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts index 0786dfe483..ffcbfd6103 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts @@ -16,6 +16,7 @@ import { isSushiSwapV2ChainId } from 'sushi/config' import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import type { Address } from 'viem' import { graphql } from '../../graphql' +import { SUSHI_REQUEST_HEADERS } from '../../request-headers' export const V2PoolQuery = graphql( ` @@ -99,7 +100,7 @@ export async function getV2Pool( } const result = await request( - { url, document: V2PoolQuery, variables }, + { url, document: V2PoolQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, options, ) if (result.v2Pool) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts index 00ff507d98..e9c23cadee 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts @@ -17,6 +17,7 @@ import { isSushiSwapV3ChainId } from 'sushi/config' import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import type { Address } from 'viem' import { graphql } from '../../graphql' +import { SUSHI_REQUEST_HEADERS } from '../../request-headers' export const V3PoolQuery = graphql( ` @@ -108,7 +109,7 @@ export async function getV3Pool( } const result = await request( - { url, document: V3PoolQuery, variables }, + { url, document: V3PoolQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, options, ) if (result.v3Pool) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts index 4b11e9c3a9..ef5698619e 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/smart-pools.ts @@ -6,6 +6,7 @@ import type { ChainId } from 'sushi' import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import type { Address } from 'viem' import { graphql } from '../../graphql' +import { SUSHI_REQUEST_HEADERS } from '../../request-headers' export const SmartPoolsQuery = graphql( ` @@ -63,7 +64,7 @@ export async function getSmartPools( const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( - { url, document: SmartPoolsQuery, variables }, + { url, document: SmartPoolsQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, options, ) diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts index 2ddc4c894c..f7b2c11594 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vault.ts @@ -5,6 +5,7 @@ import { request, type RequestOptions } from 'src/lib/request' import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import type { Address } from 'viem' import { graphql } from '../../graphql' +import { SUSHI_REQUEST_HEADERS } from '../../request-headers' export const VaultQuery = graphql( ` @@ -70,7 +71,7 @@ export async function getVault(variables: GetVault, options?: RequestOptions) { const url = `https://${SUSHI_DATA_API_HOST}` try { const result = await request( - { url, document: VaultQuery, variables }, + { url, document: VaultQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, options, ) if (result) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts index 5e53c32168..e825180f38 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/smart-pool/vaults.ts @@ -6,6 +6,7 @@ import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import type { Address } from 'viem' import { graphql } from '../../graphql' import type { VaultV1 } from './vault' +import { SUSHI_REQUEST_HEADERS } from '../../request-headers' export const VaultsQuery = graphql( ` @@ -74,7 +75,7 @@ export async function getVaults( const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( - { url, document: VaultsQuery, variables }, + { url, document: VaultsQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, options, ) if (result.vaults) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/history.ts b/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/history.ts index 9f49e569dc..4e9b593dc9 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/history.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/history.ts @@ -3,6 +3,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' +import { SUSHI_REQUEST_HEADERS } from '../../request-headers' export const SushiBarHistory = graphql( ` @@ -49,7 +50,7 @@ export async function getSushiBarHistory( const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( - { url, document: SushiBarHistory, variables }, + { url, document: SushiBarHistory, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, options, ) if (result) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts b/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts index 4e213fc1c9..eddd09de3d 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/sushi-bar/stats.ts @@ -3,6 +3,7 @@ import type { VariablesOf } from 'gql.tada' import { request, type RequestOptions } from 'src/lib/request' import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' +import { SUSHI_REQUEST_HEADERS } from '../../request-headers' export const SushiBarStats = graphql( ` @@ -32,7 +33,7 @@ export async function getSushiBarStats( const url = `https://${SUSHI_DATA_API_HOST}` const result = await request( - { url, document: SushiBarStats, variables }, + { url, document: SushiBarStats, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, options, ) if (result) { diff --git a/packages/graph-client/src/subgraphs/data-api/request-headers.ts b/packages/graph-client/src/subgraphs/data-api/request-headers.ts new file mode 100644 index 0000000000..659b480c6a --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/request-headers.ts @@ -0,0 +1,3 @@ +export const SUSHI_REQUEST_HEADERS = { + 'Origin': 'https://sushi.com' +} \ No newline at end of file From 1fabe9b8cbad19cd349b7433eb2dded3edb5eb88 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Wed, 7 Aug 2024 13:50:13 +0200 Subject: [PATCH 054/139] chore(packages/graph-client): error handling --- .../data-api/queries/analytics/day-buckets.ts | 32 ++++++++++++------- .../data-api/queries/pool/top-pools.ts | 25 +++++++++------ .../data-api/queries/pool/v2-pool.ts | 14 ++++++-- .../data-api/queries/pool/v3-pool.ts | 13 ++++++-- 4 files changed, 59 insertions(+), 25 deletions(-) diff --git a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts index 78d6f638b8..654cdb0f11 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts @@ -36,21 +36,31 @@ export async function getAnalyticsDayBuckets( options?: RequestOptions, ) { const url = `https://${SUSHI_DATA_API_HOST}` - - const result = await request( - { url, document: AnalyticsDayBucketsQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, - options, - ) - if (result) { - return result.sushiDayBuckets ?? { + try { + const result = await request( + { + url, + document: AnalyticsDayBucketsQuery, + variables, + requestHeaders: SUSHI_REQUEST_HEADERS, + }, + options, + ) + if (result) { + return ( + result.sushiDayBuckets ?? { + v2: [], + v3: [], + } + ) + } + } catch { + // TODO: handle error, probably return {data, error}? or message + return { v2: [], v3: [], } } - return { - v2: [], - v3: [], - } } export type AnalyticsDayBuckets = Awaited< diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts index a744466a26..e4668f72ca 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts @@ -47,16 +47,23 @@ export async function getTopPools( options?: RequestOptions, ) { const url = `https://${SUSHI_DATA_API_HOST}` - - const result = await request( - { url, document: PoolsQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, - options, - ) - if (result) { - return result.topPools ?? [] + try { + const result = await request( + { + url, + document: PoolsQuery, + variables, + requestHeaders: SUSHI_REQUEST_HEADERS, + }, + options, + ) + if (result) { + return result.topPools ?? [] + } + } catch (error) { + console.error('getV2Pool error', error) + return [] } - - return [] } export type TopPools = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts index ffcbfd6103..1e8f4d3fea 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts @@ -98,9 +98,14 @@ export async function getV2Pool( if (!isSushiSwapV2ChainId(chainId)) { throw new Error('Invalid chainId') } - + try { const result = await request( - { url, document: V2PoolQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, + { + url, + document: V2PoolQuery, + variables, + requestHeaders: SUSHI_REQUEST_HEADERS, + }, options, ) if (result.v2Pool) { @@ -178,7 +183,10 @@ export async function getV2Pool( > } return null - + } catch (error) { + console.error('getV2Pool error', error) + return null + } } export type V2Pool = NonNullable>> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts index e9c23cadee..4c78605ff4 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts @@ -107,9 +107,14 @@ export async function getV3Pool( if (!isSushiSwapV3ChainId(chainId)) { throw new Error('Invalid chainId') } - + try { const result = await request( - { url, document: V3PoolQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS }, + { + url, + document: V3PoolQuery, + variables, + requestHeaders: SUSHI_REQUEST_HEADERS, + }, options, ) if (result.v3Pool) { @@ -197,6 +202,10 @@ export async function getV3Pool( } return null + } catch (error) { + console.error('getV3Pool error', error) + return null + } } export type MaybeV3Pool = Awaited> From f54c7b9678f4fcb44ff69a86df5d1a3493efec38 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Wed, 7 Aug 2024 13:52:47 +0200 Subject: [PATCH 055/139] chore(packages/graph-client): error handling --- .../data-api/queries/analytics/day-buckets.ts | 15 +++++---------- .../subgraphs/data-api/queries/pool/top-pools.ts | 2 +- .../subgraphs/data-api/queries/pool/v2-pool.ts | 3 +-- .../subgraphs/data-api/queries/pool/v3-pool.ts | 4 +--- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts index 654cdb0f11..3c40add228 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/analytics/day-buckets.ts @@ -47,19 +47,14 @@ export async function getAnalyticsDayBuckets( options, ) if (result) { - return ( - result.sushiDayBuckets ?? { - v2: [], - v3: [], - } - ) + return result.sushiDayBuckets } } catch { // TODO: handle error, probably return {data, error}? or message - return { - v2: [], - v3: [], - } + } + return { + v2: [], + v3: [], } } diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts index e4668f72ca..85d32a030d 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts @@ -62,8 +62,8 @@ export async function getTopPools( } } catch (error) { console.error('getV2Pool error', error) - return [] } + return [] } export type TopPools = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts index 1e8f4d3fea..977dc91308 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v2-pool.ts @@ -182,11 +182,10 @@ export async function getV2Pool( PoolWithIncentives>> > } - return null } catch (error) { console.error('getV2Pool error', error) - return null } + return null } export type V2Pool = NonNullable>> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts index 4c78605ff4..e3c2f1491a 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/v3-pool.ts @@ -200,12 +200,10 @@ export async function getV3Pool( PoolWithAprs>>> > } - - return null } catch (error) { console.error('getV3Pool error', error) - return null } + return null } export type MaybeV3Pool = Awaited> From af5b19db177d9a86936198b4d294a86c4abc1225 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Wed, 7 Aug 2024 20:44:59 +0700 Subject: [PATCH 056/139] chore: update navbar items --- .../src/app/(evm)/_common/header-elements.tsx | 44 ++++++++++++------- apps/web/src/app/_common/header-elements.ts | 10 ++++- .../wagmi/components/user-portfolio/index.tsx | 2 +- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/apps/web/src/app/(evm)/_common/header-elements.tsx b/apps/web/src/app/(evm)/_common/header-elements.tsx index bb3f0c0442..213ceec5b4 100644 --- a/apps/web/src/app/(evm)/_common/header-elements.tsx +++ b/apps/web/src/app/(evm)/_common/header-elements.tsx @@ -1,9 +1,11 @@ import { type NavigationElement, NavigationElementType, - NavigationMenuLink, + NavigationListItem, + NavigationMenuContent, + NavigationMenuItem, + NavigationMenuTrigger, OnramperButton, - navigationMenuTriggerStyle, } from '@sushiswap/ui' import { EXPLORE_NAVIGATION_LINKS, @@ -19,33 +21,43 @@ export const headerElements = (chainId?: ChainId): NavigationElement[] => [ type: NavigationElementType.Dropdown, }, { - title: 'Swap', - href: '/swap', show: 'desktop', - type: NavigationElementType.Single, + type: NavigationElementType.Custom, + item: ( + + Trade + +
    + + The easiest way to trade. + + + + Onramp with fiat. + + +
+
+
+ ), }, { - title: 'Pools', + title: 'Explore', href: `/${chainId ?? 1}/explore/pools`, show: 'desktop', type: NavigationElementType.Single, }, { - title: 'Stake', - href: '/stake', + title: 'Positions', + href: `/${chainId ?? 1}/positions`, show: 'desktop', type: NavigationElementType.Single, }, { - type: NavigationElementType.Custom, - item: ( - - - Buy Crypto - - - ), + title: 'Stake', + href: '/stake', show: 'desktop', + type: NavigationElementType.Single, }, { title: 'More', diff --git a/apps/web/src/app/_common/header-elements.ts b/apps/web/src/app/_common/header-elements.ts index b6cae9585c..9106db9f14 100644 --- a/apps/web/src/app/_common/header-elements.ts +++ b/apps/web/src/app/_common/header-elements.ts @@ -74,17 +74,23 @@ export const headerElements = (chainId?: ChainId): NavigationElement[] => [ type: NavigationElementType.Dropdown, }, { - title: 'Swap', + title: 'Trade', href: '/swap', show: 'desktop', type: NavigationElementType.Single, }, { - title: 'Pools', + title: 'Explore', href: `/${chainId ?? 1}/explore/pools`, show: 'desktop', type: NavigationElementType.Single, }, + { + title: 'Positions', + href: `/${chainId ?? 1}/positions`, + show: 'desktop', + type: NavigationElementType.Single, + }, { title: 'Stake', href: '/stake', diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx index a785ac1758..6023388ad9 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx @@ -89,7 +89,7 @@ export const UserPortfolio = () => { className="rounded-full" /> ) : null} - {shortenAddress(address, isSm ? 3 : 2)} + {shortenAddress(address)} } content={content} From 60422e1c1564f8e13c44b7a059a0ffa63fcbd574 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Wed, 7 Aug 2024 20:55:20 +0700 Subject: [PATCH 057/139] chore: remove breadcrumb from pool pages --- apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx | 3 --- apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx | 3 --- 2 files changed, 6 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx index 3cb176f855..bad0af8d0a 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx @@ -33,9 +33,6 @@ export default async function Layout({ const referer = headersList.get('referer') return ( <> - - - - - - Date: Wed, 7 Aug 2024 21:24:24 +0700 Subject: [PATCH 058/139] fix: links --- .../src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx | 2 +- .../src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx | 2 +- apps/web/src/app/_common/header-elements.ts | 2 +- packages/ui/src/components/navigation.tsx | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx index bad0af8d0a..d45ac089a9 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx @@ -1,5 +1,5 @@ import { getV2Pool } from '@sushiswap/graph-client/data-api' -import { Breadcrumb, Container } from '@sushiswap/ui' +import { Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' import { headers } from 'next/headers' import { PoolHeader } from 'src/ui/pool/PoolHeader' diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx index a3c54dfdc7..85efafa711 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx @@ -1,5 +1,5 @@ import { getV3Pool } from '@sushiswap/graph-client/data-api' -import { Breadcrumb, Container } from '@sushiswap/ui' +import { Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' import { headers } from 'next/headers' import { PoolHeader } from 'src/ui/pool/PoolHeader' diff --git a/apps/web/src/app/_common/header-elements.ts b/apps/web/src/app/_common/header-elements.ts index 9106db9f14..6b8571edfd 100644 --- a/apps/web/src/app/_common/header-elements.ts +++ b/apps/web/src/app/_common/header-elements.ts @@ -60,7 +60,7 @@ export const MORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ }, { title: 'Bonds', - href: 'https://sushi.com/bonds', + href: '/bonds', description: 'Buy discounted tokens with vesting to support projects in a sustainable manner.', }, diff --git a/packages/ui/src/components/navigation.tsx b/packages/ui/src/components/navigation.tsx index 8dc1186949..d9b2e27c8f 100644 --- a/packages/ui/src/components/navigation.tsx +++ b/packages/ui/src/components/navigation.tsx @@ -17,7 +17,7 @@ import { const PROTOCOL_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ { title: 'Blog', - href: 'https://sushi.com/blog', + href: '/blog', description: 'Stay up to date with the latest product developments at Sushi.', }, @@ -37,12 +37,12 @@ const PROTOCOL_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ const PARTNER_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ { title: 'Partner with Sushi', - href: 'http://sushi.com/partner', + href: '/partner', description: 'Incentivize your token with Sushi rewards.', }, { title: 'List enquiry', - href: 'http://sushi.com/tokenlist-request', + href: '/tokenlist-request', description: 'Get your token on our default token list.', }, ] @@ -50,7 +50,7 @@ const PARTNER_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ const SUPPORT_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ { title: 'Academy', - href: 'https://sushi.com/academy', + href: '/academy', description: 'Everything you need to get up to speed with DeFi.', }, ] From 2be1882626a0497ea0ca005aba971cfdd7622d4e Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Wed, 7 Aug 2024 16:51:36 +0200 Subject: [PATCH 059/139] test(apps/web): update pool e2e test --- apps/web/test/helpers/pool.ts | 14 ++- apps/web/test/pool/pool.test.ts | 116 +++++++++------------- apps/web/test/pool/smart.test.ts | 162 ------------------------------- 3 files changed, 53 insertions(+), 239 deletions(-) delete mode 100644 apps/web/test/pool/smart.test.ts diff --git a/apps/web/test/helpers/pool.ts b/apps/web/test/helpers/pool.ts index 9a721d7ea4..f094969e0b 100644 --- a/apps/web/test/helpers/pool.ts +++ b/apps/web/test/helpers/pool.ts @@ -260,10 +260,9 @@ export class PoolPage extends BaseActions { tokenB: fakeToken, fee: SushiSwapV3FeeAmount.HIGH, }) - const removeLiquidityUrl = BASE_URL.concat( - `/${this.chainId}:${poolAddress}`, - ) - await this.page.goto(removeLiquidityUrl) + // TODO: position Number? + const url = BASE_URL.concat(this.chainId.toString()).concat('/pool/v23/').concat(poolAddress).concat('/positions/create') + await this.page.goto(url) await this.page.goto(BASE_URL) await this.connect() await this.page.locator('[testdata-id=my-positions-button]').click() @@ -313,10 +312,9 @@ export class PoolPage extends BaseActions { tokenA: this.nativeToken.wrapped, tokenB: fakeToken, }) - const removeLiquidityUrl = BASE_URL.concat( - `/${this.chainId}:${poolAddress}/remove`, - ) - await this.page.goto(removeLiquidityUrl) + + const url = BASE_URL.concat(this.chainId.toString()).concat('/pool/v2/').concat(poolAddress).concat('/remove') + await this.page.goto(url) await this.connect() await this.switchNetwork(this.chainId) diff --git a/apps/web/test/pool/pool.test.ts b/apps/web/test/pool/pool.test.ts index 7c3efe2596..7163e05142 100644 --- a/apps/web/test/pool/pool.test.ts +++ b/apps/web/test/pool/pool.test.ts @@ -18,16 +18,6 @@ const CHAIN_ID = Number(process.env.NEXT_PUBLIC_CHAIN_ID as string) as 137 const NATIVE_TOKEN = Native.onChain(CHAIN_ID) let FAKE_TOKEN: Token - -// let MOCK_TOKEN_1_DP: Token -// let MOCK_TOKEN_6_DP: Token -// let MOCK_TOKEN_8_DP: Token -// let MOCK_TOKEN_18_DP: Token -// const EVM_APP_BASE_URL = -// process.env['NEXT_PUBLIC_EVM_APP_BASE_URL'] || -// (process.env['NEXT_PUBLIC_VERCEL_URL'] -// ? `https://${process.env['NEXT_PUBLIC_VERCEL_URL']}` -// : 'http://localhost:3000') const BASE_URL = 'http://localhost:3000/pool' test.beforeAll(async () => { @@ -40,30 +30,6 @@ test.beforeAll(async () => { symbol: 'FT', decimals: 18, }) - // MOCK_TOKEN_1_DP = await createERC20({ - // chainId: CHAIN_ID, - // name: 'MOCK_TOKEN_1_DP', - // symbol: '1_DP', - // decimals: 1, - // }) - // MOCK_TOKEN_6_DP = await createERC20({ - // chainId: CHAIN_ID, - // name: 'MOCK_TOKEN_6_DP', - // symbol: '6_DP', - // decimals: 6, - // }) - // MOCK_TOKEN_8_DP = await createERC20({ - // chainId: CHAIN_ID, - // name: 'MOCK_TOKEN_8_DP', - // symbol: '8_DP', - // decimals: 8, - // }) - // MOCK_TOKEN_18_DP = await createERC20({ - // chainId: CHAIN_ID, - // name: 'MOCK_TOKEN_18_DP', - // symbol: '18_DP', - // decimals: 18, - // }) } catch (error) { console.error( 'error creating fake token', @@ -108,43 +74,51 @@ test.beforeEach(async ({ page, next }) => { // TEMP: Mock V2 POOL.. await page.route( - 'http://localhost:3000/pools/api/graphPool/137:0x0b65273d824393e2f43357a4096e5ebd17c89629', + 'https://data.sushi.com', // TODO: update url async (route) => { await route.fulfill({ json: { - id: '137:0x0b65273d824393e2f43357a4096e5ebd17c89629', - address: '0x0b65273d824393e2f43357a4096e5ebd17c89629', - chainId: 137, - name: `WMATIC-FT`, - swapFee: 0.003, - protocol: 'SUSHISWAP_V2', - reserve0: { - __type: 'bigint', - value: '1000000000000000000', - }, - reserve1: { - __type: 'bigint', - value: '1000000000000000000', - }, - liquidity: { - __type: 'bigint', - value: '1000000000000000000', - }, - liquidityUSD: 3537005.8867114577, - volumeUSD: 2636950185.8613586, - feesUSD: 7910850.557584076, - token0: { - id: '137:0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', - address: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', - chainId: 137, - decimals: 18, - name: 'Wrapped Matic', - symbol: 'WMATIC', + data: { + v2Pool: { + id: '137:0x3221022e37029923ace4235d812273c5a42c322d', + chainId: 42161, + name: 'WMATIC / FT', + address: '0x3221022e37029923ace4235d812273c5a42c322d', + createdAt: '1630455405', + swapFee: 0.003, + protocol: 'SUSHISWAP_V2', + token0: { + id: '137:0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', + address: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', + chainId: 137, + decimals: 18, + name: 'Wrapped Matic', + symbol: 'WMATIC', + }, + token1: FAKE_TOKEN, + source: 'SUBGRAPH', + reserve0: '14632715635223519232', + reserve1: '66374911905262165000000', + liquidity: '736541498034438406144', + volumeUSD: 56162969.922308594, + liquidityUSD: 71429.02585542823, + token0Price: 0.0002204555187373958, + token1Price: 4536.062448004257, + volumeUSD1d: 1444.4034653156996, + feeUSD1d: 4.333210395940114, + txCount1d: 104, + feeApr1d: 0.022142564252791732, + totalApr1d: 0.022142564252791732, + volumeUSD1dChange: -0.43870093251068154, + feeUSD1dChange: -0.4387009325124158, + txCount1dChange: -0.11864406779661019, + liquidityUSD1dChange: 0.01395086513190713, + incentiveApr: 0, + isIncentivized: false, + wasIncentivized: false, + incentives: [], + }, }, - token1: FAKE_TOKEN, - token0Price: 5779.222968513871, - token1Price: 0.00017303364231630437, - txCount: 4058470, }, }) }, @@ -175,7 +149,9 @@ test.describe('V3', () => { next, }) => { test.slow() - const url = BASE_URL.concat('/add').concat(`?chainId=${CHAIN_ID}`) + const url = BASE_URL.concat(CHAIN_ID.toString()) + .concat(`/v3`) + .concat('/add') const poolPage = new PoolPage(page, CHAIN_ID) await poolPage.mockPoolApi( @@ -220,7 +196,9 @@ test.describe('V2', () => { test.slow() const poolPage = new PoolPage(page, CHAIN_ID) - const url = BASE_URL.concat(`/add/v2/${CHAIN_ID}`) + const url = BASE_URL.concat(CHAIN_ID.toString()) + .concat(`/v2`) + .concat('/add') await poolPage.goTo(url) await poolPage.connect() await poolPage.switchNetwork(CHAIN_ID) diff --git a/apps/web/test/pool/smart.test.ts b/apps/web/test/pool/smart.test.ts deleted file mode 100644 index 7e939ff602..0000000000 --- a/apps/web/test/pool/smart.test.ts +++ /dev/null @@ -1,162 +0,0 @@ -// import { -// Page, -// // NextFixture, -// expect, -// test, -// } from 'next/experimental/testmode/playwright.js' -// import { SupportedChainId } from 'src/config' -// import { ChainId } from 'sushi/chain' -// import { prepareERC20Balance as setupERC20Balance } from 'test/erc20' -// import { interceptAnvil } from 'test/intercept-anvil' - -// if (typeof process.env.NEXT_PUBLIC_CHAIN_ID !== 'string') { -// new Error('NEXT_PUBLIC_CHAIN_ID not set') -// } -// const BASE_URL = 'http://localhost:3000/pool' - -// const CHAIN_ID = Number( -// process.env.NEXT_PUBLIC_CHAIN_ID as string, -// ) as SupportedChainId - -// test.beforeEach(async ({ page }) => { -// test.skip(CHAIN_ID !== ChainId.POLYGON) - -// try { -// await interceptAnvil(page) -// } catch (error) { -// console.error('error intercepting anvil', error) -// } -// await setupERC20Balance({ -// chainId: CHAIN_ID, -// }) -// }) - -// test.beforeEach(async ({ page, next }) => { -// page.on('pageerror', (error) => { -// console.error(error) -// }) - -// next.onFetch(() => { -// return 'continue' -// }) - -// await page.goto(BASE_URL) -// await switchNetwork(page, CHAIN_ID) -// }) - -// test.afterAll(async () => {}) -// test.afterEach(async () => {}) - -// // TODO: need to setup config to target specific pools depending on the network, however, the user need to change as well if more networks are added - -// test('Create and remove smart pool position', async ({ page }) => { -// test.slow() -// await addSmartPoolPosition(page) -// await page.goto(BASE_URL) -// await removeSmartPoolPosition(page) -// }) - -// async function addSmartPoolPosition(page: Page) { -// const poolId = '137-0x3361bf42cca22dc5fe37c7bd2c6a7284db440dfc' -// await page.locator('[testdata-id=smart-pools-button]').click() - -// const smartPoolRowLocator = page.locator( -// `[testdata-id=smart-pools-table-${poolId}]`, -// ) -// await expect(smartPoolRowLocator).toBeVisible() -// await smartPoolRowLocator.click() - -// await page.locator('[testdata-id=add-liquidity-token0-input]').fill('0.00005') - -// const approveToken0Locator = page.locator( -// '[testdata-id=approve-erc20-0-button]', -// ) -// await expect(approveToken0Locator).toBeVisible() -// await expect(approveToken0Locator).toBeEnabled() -// await approveToken0Locator.click() - -// const approveToken1Locator = page.locator( -// '[testdata-id=approve-erc20-1-button]', -// ) -// await expect(approveToken1Locator).toBeVisible() -// await expect(approveToken1Locator).toBeEnabled() -// await approveToken1Locator.click() - -// const reviewLocator = page.locator( -// '[testdata-id=add-steer-liquidity-preview-button]', -// ) -// await expect(reviewLocator).toBeVisible() -// await expect(reviewLocator).toBeEnabled() -// await reviewLocator.click() - -// const confirmLocator = page.locator( -// '[testdata-id=confirm-add-liquidity-button]', -// ) -// await expect(confirmLocator).toBeVisible() -// await expect(confirmLocator).toBeEnabled() -// await confirmLocator.click() - -// const expectedText = '(Successfully added liquidity to the .* smart pool)' -// const regex = new RegExp(expectedText) -// await expect(page.getByText(regex)).toBeVisible() -// } - -// async function removeSmartPoolPosition(page: Page) { -// // FIXME: Currently disabled until we can make the smart positions table show the position. -// // await page.locator('[testdata-id=my-positions-button]').click() -// // await page.locator('[testdata-id=sushiswap-smart]').click() - -// // const concentratedPositionTableSelector = page.locator( -// // '[testdata-id=smart-positions-loading-0]', -// // ) -// // await expect(concentratedPositionTableSelector).not.toBeVisible() - -// // const firstPositionSelector = page.locator( -// // '[testdata-id=smart-positions-0-0-td]', -// // ) -// // await expect(firstPositionSelector).toBeVisible() -// // await firstPositionSelector.click() - -// const poolId = '137-0x3361bf42cca22dc5fe37c7bd2c6a7284db440dfc' -// await page.locator('[testdata-id=smart-pools-button]').click() -// await switchNetwork(page, CHAIN_ID) - -// const smartPoolRowLocator = page.locator( -// `[testdata-id=smart-pools-table-${poolId}]`, -// ) -// await expect(smartPoolRowLocator).toBeVisible() -// await smartPoolRowLocator.click() - -// const removeLiquidityTabSelector = page.locator('[testdata-id=remove-tab]') -// await expect(removeLiquidityTabSelector).toBeVisible() -// await removeLiquidityTabSelector.click() - -// await page.locator('[testdata-id=liquidity-max-button]').click() - -// const removeLiquidityLocator = page.locator( -// '[testdata-id=remove-or-add-steer-liquidity-button]', -// ) - -// await expect(removeLiquidityLocator).toBeVisible() -// await expect(removeLiquidityLocator).toBeEnabled() -// await removeLiquidityLocator.click() - -// const regex = new RegExp( -// '(Successfully removed liquidity from the .* smart pool)', -// ) -// await expect(page.getByText(regex)).toBeVisible() -// } - -// async function switchNetwork(page: Page, chainId: number) { -// const networkSelector = page.locator('[testdata-id=network-selector-button]') -// await expect(networkSelector).toBeVisible() -// await expect(networkSelector).toBeEnabled() -// await networkSelector.click() - -// const networkToSelect = page.locator( -// `[testdata-id=network-selector-${chainId}]`, -// ) -// await expect(networkToSelect).toBeVisible() -// await expect(networkToSelect).toBeEnabled() -// await networkToSelect.click() -// } From ad2718dd21579c69dc1bc8b22227eb3627cbb46c Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Wed, 7 Aug 2024 17:56:50 +0000 Subject: [PATCH 060/139] chore: format --- apps/web/src/lib/graph.ts | 7 +------ apps/web/src/lib/hooks/api/userSmartPools.ts | 7 ++----- .../steer/useSteerAccountPositionsExtended.ts | 10 +++++----- apps/web/src/ui/pool/AddSectionMyPosition.tsx | 1 - .../Tables/Smart/columns/SteerStrategyCell.tsx | 4 +++- apps/web/src/ui/pool/PoolChartGraph.tsx | 14 +++++++------- apps/web/src/ui/pool/PoolComposition.tsx | 3 ++- .../src/ui/pool/PoolPositionRewardsProvider.tsx | 7 ++++++- apps/web/src/ui/pool/PoolStats.tsx | 1 - apps/web/src/ui/pool/StatisticsChartV3.tsx | 7 ++++++- apps/web/src/ui/pool/Steer/SteerCarousel.tsx | 1 - .../Add/SteerPositionAdd.tsx | 5 +---- .../Add/SteerPositionAddProvider.tsx | 9 +++------ .../Add/SteerPositionAddReviewModal.tsx | 5 +---- .../Steer/SteerStrategies/SteerBaseStrategy.tsx | 4 +--- apps/web/src/ui/pool/TableFiltersPoolType.tsx | 9 +++++++-- apps/web/src/ui/pool/columns.tsx | 2 +- apps/web/src/ui/stake/SushiBarProvider.tsx | 10 ++++++++-- apps/web/test/helpers/pool.ts | 10 ++++++++-- packages/client/src/hooks/steer-vault/index.ts | 1 - packages/client/src/pure/steer-vault/index.ts | 1 - packages/react-query/package.json | 2 +- packages/steer-sdk/src/constants.ts | 2 +- packages/ui/src/components/index.ts | 2 +- 24 files changed, 65 insertions(+), 59 deletions(-) diff --git a/apps/web/src/lib/graph.ts b/apps/web/src/lib/graph.ts index c012583320..4935c61eb7 100644 --- a/apps/web/src/lib/graph.ts +++ b/apps/web/src/lib/graph.ts @@ -2,14 +2,10 @@ import { getRebases as _getRebases } from '@sushiswap/graph-client/bentobox' import { getV3BasePoolsByToken } from '@sushiswap/graph-client/data-api' import { getFuroTokens as _getFuroTokens } from '@sushiswap/graph-client/furo' import { fetchMultichain } from '@sushiswap/graph-client/multichain' -import { - isSushiSwapV3ChainId -} from 'sushi/config' +import { isSushiSwapV3ChainId } from 'sushi/config' import { getChainIdAddressFromId } from 'sushi/format' import { bentoBoxTokensSchema, furoTokensSchema } from './schema' - - export const getV3PoolsByTokenPair = async ( tokenId0: string, tokenId1: string, @@ -95,4 +91,3 @@ export const getBentoBoxTokens = async ( throw new Error(error as string) } } - diff --git a/apps/web/src/lib/hooks/api/userSmartPools.ts b/apps/web/src/lib/hooks/api/userSmartPools.ts index 5ed98b6000..56500c4ade 100644 --- a/apps/web/src/lib/hooks/api/userSmartPools.ts +++ b/apps/web/src/lib/hooks/api/userSmartPools.ts @@ -7,12 +7,9 @@ import { } from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' -export function useSmartPools( - args: GetSmartPools, - shouldFetch = true -) { +export function useSmartPools(args: GetSmartPools, shouldFetch = true) { return useQuery({ - queryKey: ['smart-pools', {...args}], + queryKey: ['smart-pools', { ...args }], queryFn: async () => await getSmartPools(args), enabled: Boolean(shouldFetch && args.chainId), }) diff --git a/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts b/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts index b6f6293eb7..6dc97b70f3 100644 --- a/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts +++ b/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts @@ -6,7 +6,7 @@ import { STEER_SUPPORTED_CHAIN_IDS } from '@sushiswap/steer-sdk' import { useMemo } from 'react' import { useSteerAccountPositions } from './useSteerAccountPosition' import { useSmartPools } from 'src/lib/hooks/api/userSmartPools' -import { ID } from 'sushi' +import { ID } from 'sushi' interface UseSteerAccountPositionsExtended { account: Address | undefined @@ -18,7 +18,6 @@ export type SteerAccountPositionExtended = NonNullable< ReturnType['data'] >[0] - export type SteerAccountPositionVault = NonNullable< ReturnType['data'] >[0]['vault'] @@ -30,14 +29,15 @@ export const useSteerAccountPositionsExtended = ({ }: UseSteerAccountPositionsExtended) => { const { data: prices, isInitialLoading: isPricesLoading } = useAllPrices() - const { data: smartPools, isLoading: isVaultsLoading } = useSmartPools( { chainId: 137 }, // TODO: FIX Boolean(enabled && account), ) - - const vaultIds = useMemo(() => smartPools?.map((el) => el.id as ID) ?? [], [smartPools]) + const vaultIds = useMemo( + () => smartPools?.map((el) => el.id as ID) ?? [], + [smartPools], + ) const { data: positions, isLoading } = useSteerAccountPositions({ account, diff --git a/apps/web/src/ui/pool/AddSectionMyPosition.tsx b/apps/web/src/ui/pool/AddSectionMyPosition.tsx index 64bb92ed47..20caadc468 100644 --- a/apps/web/src/ui/pool/AddSectionMyPosition.tsx +++ b/apps/web/src/ui/pool/AddSectionMyPosition.tsx @@ -1,4 +1,3 @@ - import { classNames } from '@sushiswap/ui' import { Currency as UICurrency } from '@sushiswap/ui' import React, { FC } from 'react' diff --git a/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx b/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx index 94a6d3001b..1180b4b1a2 100644 --- a/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx +++ b/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx @@ -2,6 +2,8 @@ import React, { FC } from 'react' import { SteerStrategyConfig } from '../../../../Steer/constants' import { SteerAccountPositionVault } from 'src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended' -export const SteerStrategyCell: FC<{ vault: SteerAccountPositionVault }> = ({ vault }) => { +export const SteerStrategyCell: FC<{ vault: SteerAccountPositionVault }> = ({ + vault, +}) => { return
{SteerStrategyConfig[vault.strategy].name}
} diff --git a/apps/web/src/ui/pool/PoolChartGraph.tsx b/apps/web/src/ui/pool/PoolChartGraph.tsx index b8b2a74626..af1baea9a9 100644 --- a/apps/web/src/ui/pool/PoolChartGraph.tsx +++ b/apps/web/src/ui/pool/PoolChartGraph.tsx @@ -40,19 +40,19 @@ interface PoolChartProps { const tailwind = resolveConfig(tailwindConfig) -export const PoolChartGraph: FC = ({ chart, period, pool, protocol }) => { - const { - data: buckets, - isInitialLoading: isLoading, - } = usePoolGraphData({ +export const PoolChartGraph: FC = ({ + chart, + period, + pool, + protocol, +}) => { + const { data: buckets, isInitialLoading: isLoading } = usePoolGraphData({ poolAddress: pool.address, chainId: pool.chainId, protocol, }) - const [xData, yData]: [number[], number[]] = useMemo(() => { - const data = (chartPeriods[period] < chartPeriods[PoolChartPeriod.Week] ? buckets?.hourBuckets diff --git a/apps/web/src/ui/pool/PoolComposition.tsx b/apps/web/src/ui/pool/PoolComposition.tsx index 63b33bb521..d9c2124fdc 100644 --- a/apps/web/src/ui/pool/PoolComposition.tsx +++ b/apps/web/src/ui/pool/PoolComposition.tsx @@ -9,7 +9,8 @@ import { CardGroup, CardHeader, CardLabel, - CardTitle, SkeletonText + CardTitle, + SkeletonText, } from '@sushiswap/ui' import { FC, useMemo } from 'react' import { useTokenAmountDollarValues } from 'src/lib/hooks' diff --git a/apps/web/src/ui/pool/PoolPositionRewardsProvider.tsx b/apps/web/src/ui/pool/PoolPositionRewardsProvider.tsx index 9797f1a4c7..9701b8d14a 100644 --- a/apps/web/src/ui/pool/PoolPositionRewardsProvider.tsx +++ b/apps/web/src/ui/pool/PoolPositionRewardsProvider.tsx @@ -10,7 +10,12 @@ import { } from 'src/lib/wagmi/hooks/master-chef/use-rewarder' import { ChainId } from 'sushi/chain' import { Amount, Token } from 'sushi/currency' -import type { ChefType, Incentive, PoolBase, PoolWithIncentives } from 'sushi/types' +import type { + ChefType, + Incentive, + PoolBase, + PoolWithIncentives, +} from 'sushi/types' import { useAccount } from 'wagmi' interface PoolPositionRewardsContext { diff --git a/apps/web/src/ui/pool/PoolStats.tsx b/apps/web/src/ui/pool/PoolStats.tsx index 4a8f75a608..ab6bf5f7ef 100644 --- a/apps/web/src/ui/pool/PoolStats.tsx +++ b/apps/web/src/ui/pool/PoolStats.tsx @@ -17,7 +17,6 @@ interface PoolStats { } export const PoolStats: FC = ({ pool }) => { - return ( diff --git a/apps/web/src/ui/pool/StatisticsChartV3.tsx b/apps/web/src/ui/pool/StatisticsChartV3.tsx index 97cec597e2..da815c4401 100644 --- a/apps/web/src/ui/pool/StatisticsChartV3.tsx +++ b/apps/web/src/ui/pool/StatisticsChartV3.tsx @@ -54,7 +54,12 @@ export const StatisticsChartsV3: FC = ({ address, chainId, pool }) => { {chart === PoolChartType.Depth ? ( ) : ( - + )} ) diff --git a/apps/web/src/ui/pool/Steer/SteerCarousel.tsx b/apps/web/src/ui/pool/Steer/SteerCarousel.tsx index 04e0c3dd59..1123a6f1f2 100644 --- a/apps/web/src/ui/pool/Steer/SteerCarousel.tsx +++ b/apps/web/src/ui/pool/Steer/SteerCarousel.tsx @@ -5,7 +5,6 @@ import { FC, useCallback, useMemo } from 'react' import { SteerPoolCard } from './SteerPoolCard' import { V3Pool, VaultV1 } from '@sushiswap/graph-client/data-api' - interface SteerCarousel { pool: V3Pool vaults: VaultV1[] diff --git a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx index 727f69296a..34f0b7295b 100644 --- a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx +++ b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx @@ -1,10 +1,7 @@ 'use client' import { PlusIcon } from '@heroicons/react-v1/solid' -import { - STEER_PERIPHERY_ADDRESS, - SteerChainId, -} from '@sushiswap/steer-sdk' +import { STEER_PERIPHERY_ADDRESS, SteerChainId } from '@sushiswap/steer-sdk' import { Button, DialogTrigger, classNames } from '@sushiswap/ui' import React, { FC, useMemo } from 'react' import { ChainId } from 'sushi/chain' diff --git a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx index 5b2f692850..1a2ddd7f37 100644 --- a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx +++ b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx @@ -104,16 +104,13 @@ export const useSteerPositionAddActions = () => { type UseSteerPositionAddInfoProps = { // account: string | undefined -} & ( - | { - vault: VaultV1 | undefined - } -) +} & { + vault: VaultV1 | undefined +} export function useSteerPositionAddDerivedInfo({ vault, }: UseSteerPositionAddInfoProps) { - const { independentField, typedValue } = useSteerPositionAddState() const [currencyA, currencyB] = useMemo(() => { diff --git a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx index e8b4bd301f..09e7fe72af 100644 --- a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx +++ b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx @@ -1,10 +1,7 @@ 'use client' import { createErrorToast, createToast } from '@sushiswap/notifications' -import { - STEER_PERIPHERY_ADDRESS, - isSteerChainId, -} from '@sushiswap/steer-sdk' +import { STEER_PERIPHERY_ADDRESS, isSteerChainId } from '@sushiswap/steer-sdk' import { steerPeripheryAbi } from '@sushiswap/steer-sdk/abi' import { Button, diff --git a/apps/web/src/ui/pool/Steer/SteerStrategies/SteerBaseStrategy.tsx b/apps/web/src/ui/pool/Steer/SteerStrategies/SteerBaseStrategy.tsx index 0adc928a8e..fb4e0b29bb 100644 --- a/apps/web/src/ui/pool/Steer/SteerStrategies/SteerBaseStrategy.tsx +++ b/apps/web/src/ui/pool/Steer/SteerStrategies/SteerBaseStrategy.tsx @@ -169,9 +169,7 @@ export const SteerBaseStrategy: SteerStrategyComponent = ({ Liquidity pool fee - - {formatPercent(pool.swapFee)} - + {formatPercent(pool.swapFee)} {/* Time frame diff --git a/apps/web/src/ui/pool/TableFiltersPoolType.tsx b/apps/web/src/ui/pool/TableFiltersPoolType.tsx index ca752c6d20..c6cfcdd329 100644 --- a/apps/web/src/ui/pool/TableFiltersPoolType.tsx +++ b/apps/web/src/ui/pool/TableFiltersPoolType.tsx @@ -24,7 +24,10 @@ import { PROTOCOL_MAP } from '../../lib/constants' import { usePoolFilters, useSetPoolFilters } from './PoolsFiltersProvider' import { SushiSwapProtocol } from 'sushi' -export const POOL_TYPES = [SushiSwapProtocol.SUSHISWAP_V3, SushiSwapProtocol.SUSHISWAP_V2] +export const POOL_TYPES = [ + SushiSwapProtocol.SUSHISWAP_V3, + SushiSwapProtocol.SUSHISWAP_V2, +] const POOL_DESCRIPTIONS = { [SushiSwapProtocol.SUSHISWAP_V3]: @@ -44,7 +47,9 @@ export const TableFiltersPoolType: FC = () => { const [peekedProtocol, setPeekedProtocol] = React.useState( POOL_TYPES[0], ) - const [localValue, setValues] = useState(isAllThenNone(protocols)) + const [localValue, setValues] = useState( + isAllThenNone(protocols), + ) const values = pending ? localValue : isAllThenNone(protocols) diff --git a/apps/web/src/ui/pool/columns.tsx b/apps/web/src/ui/pool/columns.tsx index aa91b6ae99..83ee4388d8 100644 --- a/apps/web/src/ui/pool/columns.tsx +++ b/apps/web/src/ui/pool/columns.tsx @@ -400,7 +400,7 @@ export const TX_AMOUNT_IN_V2_COLUMN = ( />{' '} {row.original.amount0In !== '0' ? row.original.symbol0 - : row.original.symbol1 } + : row.original.symbol1} ) case TransactionType.Mint: diff --git a/apps/web/src/ui/stake/SushiBarProvider.tsx b/apps/web/src/ui/stake/SushiBarProvider.tsx index 2d5945d893..721abafda7 100644 --- a/apps/web/src/ui/stake/SushiBarProvider.tsx +++ b/apps/web/src/ui/stake/SushiBarProvider.tsx @@ -23,8 +23,14 @@ export const SushiBarProvider: FC<{ const [sushiBalance, totalSupply, apy] = useMemo( () => [ - tryParseAmount((data?.sushiSupply ?? 0).toString(), SUSHI[ChainId.ETHEREUM]), - tryParseAmount((data?.xSushiSupply ?? 0).toString(), XSUSHI[ChainId.ETHEREUM]), + tryParseAmount( + (data?.sushiSupply ?? 0).toString(), + SUSHI[ChainId.ETHEREUM], + ), + tryParseAmount( + (data?.xSushiSupply ?? 0).toString(), + XSUSHI[ChainId.ETHEREUM], + ), data && data?.apr1m !== undefined ? Number(data.apr1m) * 12 : undefined, ], [data], diff --git a/apps/web/test/helpers/pool.ts b/apps/web/test/helpers/pool.ts index f094969e0b..58bb426a0a 100644 --- a/apps/web/test/helpers/pool.ts +++ b/apps/web/test/helpers/pool.ts @@ -261,7 +261,10 @@ export class PoolPage extends BaseActions { fee: SushiSwapV3FeeAmount.HIGH, }) // TODO: position Number? - const url = BASE_URL.concat(this.chainId.toString()).concat('/pool/v23/').concat(poolAddress).concat('/positions/create') + const url = BASE_URL.concat(this.chainId.toString()) + .concat('/pool/v23/') + .concat(poolAddress) + .concat('/positions/create') await this.page.goto(url) await this.page.goto(BASE_URL) await this.connect() @@ -313,7 +316,10 @@ export class PoolPage extends BaseActions { tokenB: fakeToken, }) - const url = BASE_URL.concat(this.chainId.toString()).concat('/pool/v2/').concat(poolAddress).concat('/remove') + const url = BASE_URL.concat(this.chainId.toString()) + .concat('/pool/v2/') + .concat(poolAddress) + .concat('/remove') await this.page.goto(url) await this.connect() await this.switchNetwork(this.chainId) diff --git a/packages/client/src/hooks/steer-vault/index.ts b/packages/client/src/hooks/steer-vault/index.ts index 44c3cd8edf..f390259b92 100644 --- a/packages/client/src/hooks/steer-vault/index.ts +++ b/packages/client/src/hooks/steer-vault/index.ts @@ -1,4 +1,3 @@ export * from './count' export * from './vault' export * from './vaults' - diff --git a/packages/client/src/pure/steer-vault/index.ts b/packages/client/src/pure/steer-vault/index.ts index c00a9fd96b..61e5d9b441 100644 --- a/packages/client/src/pure/steer-vault/index.ts +++ b/packages/client/src/pure/steer-vault/index.ts @@ -1,4 +1,3 @@ export * from './count/count' export * from './vault/vault' export * from './vaults/vaults' - diff --git a/packages/react-query/package.json b/packages/react-query/package.json index 2bb2f92411..5019d355db 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -53,9 +53,9 @@ }, "devDependencies": { "@sentry/nextjs": "7.110.0", - "@sushiswap/graph-client": "workspace:*", "@sushiswap/client": "workspace:*", "@sushiswap/database": "workspace:*", + "@sushiswap/graph-client": "workspace:*", "@sushiswap/jest-config": "workspace:*", "@tsconfig/node20": "20.1.4", "@tsconfig/strictest": "2.0.2", diff --git a/packages/steer-sdk/src/constants.ts b/packages/steer-sdk/src/constants.ts index a414da970a..c8a6fed3f4 100644 --- a/packages/steer-sdk/src/constants.ts +++ b/packages/steer-sdk/src/constants.ts @@ -94,4 +94,4 @@ export enum SteerStrategy { } export const isSteerStrategy = (strategy: string): strategy is SteerStrategy => - Object.values(SteerStrategy).includes(strategy as SteerStrategy) \ No newline at end of file + Object.values(SteerStrategy).includes(strategy as SteerStrategy) diff --git a/packages/ui/src/components/index.ts b/packages/ui/src/components/index.ts index 0c01b86677..eaed0e2200 100644 --- a/packages/ui/src/components/index.ts +++ b/packages/ui/src/components/index.ts @@ -59,4 +59,4 @@ export * from './toggle' export * from './tooltip' export * from './typography' export * from './widget' -export * from './sheet' \ No newline at end of file +export * from './sheet' From 276527a94ffd458f3d959b560d43070578e4cc77 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Wed, 7 Aug 2024 20:09:40 +0200 Subject: [PATCH 061/139] chore: enable pool e2e test --- apps/web/test/playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/test/playwright.config.ts b/apps/web/test/playwright.config.ts index 0f42ccddae..93dfbf8074 100644 --- a/apps/web/test/playwright.config.ts +++ b/apps/web/test/playwright.config.ts @@ -20,7 +20,7 @@ const baseURL = `http://localhost:${PORT}` const config: PlaywrightTestConfig = { quiet: !!process.env.CI, testMatch: [ - // 'pool.test.ts', + 'pool.test.ts', 'simple.test.ts', // 'smart.test.ts', // 'cross-chain.test.ts', From 93dae512bf0f16c20a9379411631302c443ed49e Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 8 Aug 2024 16:41:12 +0200 Subject: [PATCH 062/139] test(apps/web): update e2e --- apps/web/test/helpers/pool.ts | 2 +- apps/web/test/playwright.config.ts | 2 +- apps/web/test/pool/pool.test.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/test/helpers/pool.ts b/apps/web/test/helpers/pool.ts index 58bb426a0a..2ac874c7c2 100644 --- a/apps/web/test/helpers/pool.ts +++ b/apps/web/test/helpers/pool.ts @@ -262,7 +262,7 @@ export class PoolPage extends BaseActions { }) // TODO: position Number? const url = BASE_URL.concat(this.chainId.toString()) - .concat('/pool/v23/') + .concat('/pool/v3/') .concat(poolAddress) .concat('/positions/create') await this.page.goto(url) diff --git a/apps/web/test/playwright.config.ts b/apps/web/test/playwright.config.ts index 93dfbf8074..c1500ff29b 100644 --- a/apps/web/test/playwright.config.ts +++ b/apps/web/test/playwright.config.ts @@ -21,7 +21,7 @@ const config: PlaywrightTestConfig = { quiet: !!process.env.CI, testMatch: [ 'pool.test.ts', - 'simple.test.ts', + // 'simple.test.ts', // 'smart.test.ts', // 'cross-chain.test.ts', ], diff --git a/apps/web/test/pool/pool.test.ts b/apps/web/test/pool/pool.test.ts index 7163e05142..4d6d61d6a0 100644 --- a/apps/web/test/pool/pool.test.ts +++ b/apps/web/test/pool/pool.test.ts @@ -149,7 +149,7 @@ test.describe('V3', () => { next, }) => { test.slow() - const url = BASE_URL.concat(CHAIN_ID.toString()) + const url = BASE_URL.concat(`/${CHAIN_ID.toString()}`) .concat(`/v3`) .concat('/add') const poolPage = new PoolPage(page, CHAIN_ID) @@ -196,7 +196,7 @@ test.describe('V2', () => { test.slow() const poolPage = new PoolPage(page, CHAIN_ID) - const url = BASE_URL.concat(CHAIN_ID.toString()) + const url = BASE_URL.concat(`/${CHAIN_ID.toString()}`) .concat(`/v2`) .concat('/add') await poolPage.goTo(url) From bde35570b3d257cc7fb65d2fbb4141699a3944f5 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Thu, 8 Aug 2024 21:54:42 +0700 Subject: [PATCH 063/139] fix: smart positions --- apps/web/src/lib/hooks/api/userSmartPools.ts | 4 ++-- .../steer/useSteerAccountPositionsExtended.ts | 14 ++++++-------- apps/web/src/ui/pool/SmartPositionsTable.tsx | 10 +++------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/apps/web/src/lib/hooks/api/userSmartPools.ts b/apps/web/src/lib/hooks/api/userSmartPools.ts index 56500c4ade..d2792747d3 100644 --- a/apps/web/src/lib/hooks/api/userSmartPools.ts +++ b/apps/web/src/lib/hooks/api/userSmartPools.ts @@ -1,15 +1,15 @@ 'use client' import { - getSmartPools, GetSmartPools, SmartPoolsV1, + getSmartPools, } from '@sushiswap/graph-client/data-api' import { useQuery } from '@tanstack/react-query' export function useSmartPools(args: GetSmartPools, shouldFetch = true) { return useQuery({ - queryKey: ['smart-pools', { ...args }], + queryKey: ['smart-pools', args], queryFn: async () => await getSmartPools(args), enabled: Boolean(shouldFetch && args.chainId), }) diff --git a/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts b/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts index 6dc97b70f3..7ac30fa160 100644 --- a/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts +++ b/apps/web/src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended.ts @@ -1,17 +1,15 @@ import { useAllPrices } from '@sushiswap/react-query' +import { useMemo } from 'react' +import { useSmartPools } from 'src/lib/hooks/api/userSmartPools' +import { ChainId, ID } from 'sushi' import { Amount, Token } from 'sushi/currency' import { Address } from 'viem' - -import { STEER_SUPPORTED_CHAIN_IDS } from '@sushiswap/steer-sdk' -import { useMemo } from 'react' import { useSteerAccountPositions } from './useSteerAccountPosition' -import { useSmartPools } from 'src/lib/hooks/api/userSmartPools' -import { ID } from 'sushi' interface UseSteerAccountPositionsExtended { account: Address | undefined enabled?: boolean - chainIds?: number[] + chainId: ChainId } export type SteerAccountPositionExtended = NonNullable< @@ -25,12 +23,12 @@ export type SteerAccountPositionVault = NonNullable< export const useSteerAccountPositionsExtended = ({ account, enabled = true, - chainIds = [...STEER_SUPPORTED_CHAIN_IDS], + chainId, }: UseSteerAccountPositionsExtended) => { const { data: prices, isInitialLoading: isPricesLoading } = useAllPrices() const { data: smartPools, isLoading: isVaultsLoading } = useSmartPools( - { chainId: 137 }, // TODO: FIX + { chainId }, Boolean(enabled && account), ) diff --git a/apps/web/src/ui/pool/SmartPositionsTable.tsx b/apps/web/src/ui/pool/SmartPositionsTable.tsx index da894f30f1..4944152486 100644 --- a/apps/web/src/ui/pool/SmartPositionsTable.tsx +++ b/apps/web/src/ui/pool/SmartPositionsTable.tsx @@ -1,6 +1,5 @@ 'use client' -import { isSteerChainId } from '@sushiswap/steer-sdk' import { Card, CardHeader, CardTitle, DataTable } from '@sushiswap/ui' import { SkeletonText, @@ -34,8 +33,6 @@ const COLUMNS = [ header: 'APR (24h)', accessorFn: (row) => row.vault.stakedAndIncentiveApr1d, cell: (props) => { - const totalAPR = props.row.original.vault.stakedAndIncentiveApr1d - return (
@@ -55,17 +52,16 @@ const COLUMNS = [ id: props.row.original.id as `${string}:0x${string}`, address: props.row.original.vault.poolAddress as Address, chainId: props.row.original.vault.chainId as ChainId, - protocol: SushiSwapProtocol.SUSHISWAP_V3, feeApr1d: props.row.original.vault.feeApr1d, incentiveApr: props.row.original.vault.incentiveApr, isIncentivized: props.row.original.vault.isIncentivized, wasIncentivized: props.row.original.vault.wasIncentivized, }} - smartPoolAPR={props.row.original.vault.stakedAndIncentiveApr1d} + smartPoolAPR={props.row.original.vault.stakedApr1d} > - {formatPercent(totalAPR / 100)} + {formatPercent(props.row.original.vault.stakedAndIncentiveApr1d)}
@@ -88,7 +84,7 @@ export const SmartPositionsTable: FC<{ chainId: ChainId }> = ({ chainId }) => { const { data: positions, isLoading } = useSteerAccountPositionsExtended({ account: address, - chainIds: isSteerChainId(chainId) ? [chainId] : [], + chainId, }) const _positions = useMemo(() => (positions ? positions : []), [positions]) From 231e7b08f5c8ee4a9fa2af0de7536384b1359951 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Thu, 8 Aug 2024 21:55:29 +0700 Subject: [PATCH 064/139] feat: explore/smart-pools --- .../app/(evm)/[chainId]/explore/layout.tsx | 38 +- .../(evm)/[chainId]/explore/pools/page.tsx | 33 +- .../[chainId]/explore/smart-pools/page.tsx | 38 ++ .../web/src/app/(evm)/[chainId]/not-found.tsx | 2 + apps/web/src/ui/pool/SmartPoolsTable.tsx | 591 ++++++++++++++++++ 5 files changed, 682 insertions(+), 20 deletions(-) create mode 100644 apps/web/src/app/(evm)/[chainId]/explore/smart-pools/page.tsx create mode 100644 apps/web/src/ui/pool/SmartPoolsTable.tsx diff --git a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx index 443f89da1b..0cc243c9bd 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx @@ -1,5 +1,7 @@ -import { Container } from '@sushiswap/ui' +import { Container, LinkInternal } from '@sushiswap/ui' import { GlobalStatsCharts } from 'src/ui/explore/global-stats-charts' +import { PathnameButton } from 'src/ui/pathname-button' +import { PoolsFiltersProvider } from 'src/ui/pool' import { ChainId } from 'sushi/chain' import { Hero } from './hero' @@ -19,9 +21,41 @@ export default async function ExploreLayout({
+ +
+ + + All Pools + + + + + Smart Pools + + +
+
- {children} + {children}
diff --git a/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx b/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx index c3a226e27d..f0b11225b1 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx @@ -2,7 +2,6 @@ import { getTopPools } from '@sushiswap/graph-client/data-api' import { Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' import React from 'react' -import { PoolsFiltersProvider } from 'src/ui/pool' import { PoolsTable } from 'src/ui/pool/PoolsTable' import { TableFiltersSmartPoolsOnly } from 'src/ui/pool/TableFilterSmartPoolsOnly' import { TableFiltersFarmsOnly } from 'src/ui/pool/TableFiltersFarmsOnly' @@ -12,32 +11,30 @@ import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' import { ChainId } from 'sushi/chain' -export default async function PoolPage({ - params: { chainId }, +export default async function PoolsPage({ + params, }: { params: { chainId: string } }) { const pools = await unstable_cache( - async () => getTopPools({ chainId: +chainId }), - ['pools', chainId], + async () => getTopPools({ chainId: +params.chainId }), + ['pools', params.chainId], { revalidate: 60 * 3, }, )() return ( - - -
- - - - - - -
- -
-
+ +
+ + + + + + +
+ +
) } diff --git a/apps/web/src/app/(evm)/[chainId]/explore/smart-pools/page.tsx b/apps/web/src/app/(evm)/[chainId]/explore/smart-pools/page.tsx new file mode 100644 index 0000000000..d4132dea44 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/explore/smart-pools/page.tsx @@ -0,0 +1,38 @@ +import { getSmartPools } from '@sushiswap/graph-client/data-api' +import { Container } from '@sushiswap/ui' +import { unstable_cache } from 'next/cache' +import React from 'react' +import { SmartPoolsTable } from 'src/ui/pool/SmartPoolsTable' +import { TableFiltersFarmsOnly } from 'src/ui/pool/TableFiltersFarmsOnly' +import { TableFiltersNetwork } from 'src/ui/pool/TableFiltersNetwork' +import { TableFiltersPoolType } from 'src/ui/pool/TableFiltersPoolType' +import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' +import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' +import { ChainId } from 'sushi/chain' + +export default async function SmartPoolsPage({ + params, +}: { + params: { chainId: string } +}) { + const smartPools = await unstable_cache( + async () => getSmartPools({ chainId: +params.chainId }), + ['smart-pools', params.chainId], + { + revalidate: 60 * 3, + }, + )() + + return ( + +
+ + + + + +
+ +
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/not-found.tsx b/apps/web/src/app/(evm)/[chainId]/not-found.tsx index cf7690bb08..4dfbd51032 100644 --- a/apps/web/src/app/(evm)/[chainId]/not-found.tsx +++ b/apps/web/src/app/(evm)/[chainId]/not-found.tsx @@ -1,3 +1,5 @@ +'use client' + import { ChevronRightIcon } from '@heroicons/react/20/solid' import { Button, LinkInternal, typographyVariants } from '@sushiswap/ui' import { useChainId } from 'wagmi' diff --git a/apps/web/src/ui/pool/SmartPoolsTable.tsx b/apps/web/src/ui/pool/SmartPoolsTable.tsx new file mode 100644 index 0000000000..592fa22936 --- /dev/null +++ b/apps/web/src/ui/pool/SmartPoolsTable.tsx @@ -0,0 +1,591 @@ +'use client' + +import { UploadIcon } from '@heroicons/react-v1/outline' +import { DownloadIcon } from '@heroicons/react-v1/solid' +import { ArrowDownRightIcon } from '@heroicons/react/20/solid' +import { + EllipsisHorizontalIcon, + GiftIcon, + LightBulbIcon, + MinusIcon, + PlusIcon, +} from '@heroicons/react/24/outline' +import { SmartPoolsV1 } from '@sushiswap/graph-client/data-api' +import { + Badge, + Button, + Card, + CardDescription, + CardHeader, + CardTitle, + Chip, + Currency, + DataTable, + DropdownMenu, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuGroupLabel, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuTrigger, + LinkExternal, + SkeletonCircle, + SkeletonText, + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, + classNames, +} from '@sushiswap/ui' +import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' +import { + ColumnDef, + PaginationState, + SortingState, + TableState, +} from '@tanstack/react-table' +import Link from 'next/link' +import React, { FC, useMemo, useState } from 'react' +import { isAngleEnabledChainId } from 'sushi/config' +import { Native, Token, unwrapToken } from 'sushi/currency' +import { formatPercent, formatUSD } from 'sushi/format' +import { SushiSwapProtocol } from 'sushi/types' +import { APRHoverCard } from './APRHoverCard' +import { ProtocolBadge } from './PoolNameCell' +import { usePoolFilters } from './PoolsFiltersProvider' +import { SteerStrategyConfig } from './Steer/constants' + +const COLUMNS = [ + { + id: 'poolName', + header: 'Pool name', + cell: ({ row: { original } }) => { + const token0 = new Token({ + chainId: original.chainId, + address: original.token0.address, + decimals: original.token0.decimals, + symbol: original.token0.symbol, + }) + const token1 = new Token({ + chainId: original.chainId, + address: original.token1.address, + decimals: original.token1.decimals, + symbol: original.token1.symbol, + }) + + return ( +
+
+ + } + > + + + + + +
+
+ + {unwrapToken(token0).symbol}{' '} + + / + {' '} + {unwrapToken(token1).symbol}{' '} +
+ +
+ + + + {ProtocolBadge[original.protocol as SushiSwapProtocol]} + + +

Protocol version

+
+
+
+ + + +
+ {formatPercent(original.swapFee)} +
+
+ +

Swap fee

+
+
+
+ {original.isIncentivized && ( + + + +
+ 🧑🌾{' '} +
+
+ +

Farm rewards available

+
+
+
+ )} + + + +
+ 💡 +
+
+ +

Smart Pool available

+
+
+
+ {original.isDeprecated && ( +
+ Deprecated +
+ )} +
+
+
+ ) + }, + meta: { + skeleton: ( +
+
+ + +
+
+ +
+
+ ), + }, + size: 300, + }, + { + id: 'name', + header: 'Strategy', + cell: ({ row: { original } }) => ( + + + + + {original.strategy.replace(/([a-z0-9])([A-Z])/g, '$1 $2')} + + + +

{SteerStrategyConfig[original.strategy].description}

+
+
+
+ ), + meta: { + skeleton: , + }, + }, + { + id: 'liquidityUSD', + header: 'TVL', + accessorFn: (row) => row.vaultLiquidityUSD, + cell: ({ row: { original } }) => ( + + + {formatUSD(original.liquidityUSD).includes('NaN') + ? '$0.00' + : formatUSD(original.liquidityUSD)} + + + + + + {formatUSD(original.vaultLiquidityUSD).includes('NaN') + ? '$0.00' + : formatUSD(original.vaultLiquidityUSD)} + + + +

Amount of liquidity deposited in the smart pool.

+
+
+
+
+ ), + meta: { + skeleton: , + }, + }, + { + id: 'fees1d', + header: 'Fees (24h)', + accessorFn: (row) => row.feeUSD1d, + cell: (props) => + formatUSD(props.row.original.feeUSD1d).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.feeUSD1d), + meta: { + skeleton: , + }, + }, + { + id: 'totalApr1d', + header: 'APR (24h)', + accessorFn: (row) => (row.feeApr1d + row.incentiveApr) * 100, + cell: (props) => { + return ( +
+ + + + + {formatPercent(props.row.original.feeAndIncentiveApr1d)} + + + +

APR when not staked within the vault.

+
+
+
+ + + {formatPercent(props.row.original.stakedAndIncentiveApr1d)} + + +
+ ) + }, + meta: { + skeleton: , + }, + }, + { + id: 'actions', + cell: ({ row }) => + row.original.protocol === 'SUSHISWAP_V3' ? ( + + + + + + + {row.original.token0.symbol} / {row.original.token1.symbol} + + SushiSwap V3 + + + + + + e.stopPropagation()} + shallow={true} + className="flex items-center" + href={`/${row.original.chainId}/pool/v3/${row.original.poolAddress}`} + > + + Pool details + + + + e.stopPropagation()} + shallow={true} + className="flex items-center" + href={`/${row.original.chainId}/pool/v3/${row.original.poolAddress}/positions/create`} + > + + Create position + + + + + + + e.stopPropagation()} + shallow={true} + className="flex items-center" + href={`/${row.original.chainId}/pool/v3/${row.original.poolAddress}/smart/${row.original.id}`} + > + + + + + + + Create smart position + + + + +

+ {`Smart pools optimize liquidity allocation within custom price ranges, enhancing trading efficiency by + providing deeper liquidity around the current price, increasing Liquidity Providers (LP) fee earnings.`} +

+
+
+
+
+ + + + + + + {/* FIX */} + e.stopPropagation()} + shallow={true} + className="flex items-center" + href={`/pool/incentivize?chainId=${ + row.original.chainId + }&fromCurrency=${ + row.original.token0.address === + Native.onChain(row.original.chainId).wrapped.address + ? 'NATIVE' + : row.original.token0.address + }&toCurrency=${ + row.original.token1.address === + Native.onChain(row.original.chainId).wrapped.address + ? 'NATIVE' + : row.original.token1.address + }&feeAmount=${row.original.swapFee * 10_000 * 100}`} + > + + Add incentive + + + + +

+ {!isAngleEnabledChainId(row.original.chainId) + ? 'Not available on this network' + : 'Add rewards to a pool to incentivize liquidity providers joining in.'} +

+
+
+
+
+
+
+ ) : ( + + + + + + + {row.original.token0.symbol} / {row.original.token1.symbol} + {row.original.protocol === 'SUSHISWAP_V2' && ( + + SushiSwap V2 + + )} + + + + + e.stopPropagation()} + shallow={true} + className="flex items-center" + href={`/pool/${row.original.id}/add`} + > + + Add liquidity + + + + e.stopPropagation()} + shallow={true} + className="flex items-center" + href={`/pool/${row.original.id}/remove`} + > + + Remove liquidity + + + + + + Farm rewards + + + + + e.stopPropagation()} + shallow={true} + className="flex items-center" + href={`/pool/${row.original.id}/stake`} + > + + Stake + + + + +

+ {!row.original.isIncentivized + ? 'No rewards available on this pool' + : 'After adding liquidity, stake your liquidity tokens to benefit from extra rewards'} +

+
+
+
+ + e.stopPropagation()} + shallow={true} + className="flex items-center" + href={`/pool/${row.original.id}/unstake`} + > + + Unstake + + +
+
+
+ ), + meta: { + disableLink: true, + skeleton: , + }, + }, +] satisfies ColumnDef[] + +export const SmartPoolsTable: FC<{ smartPools: SmartPoolsV1 }> = ({ + smartPools, +}) => { + const { tokenSymbols, protocols, farmsOnly } = usePoolFilters() + const [sorting, setSorting] = useState([ + { id: 'liquidityUSD', desc: true }, + ]) + const [pagination, setPagination] = useState({ + pageIndex: 0, + pageSize: 10, + }) + + const state: Partial = useMemo(() => { + return { + sorting, + pagination, + } + }, [sorting, pagination]) + + const vaults = useMemo( + () => + smartPools?.filter((smartPool) => { + if ( + tokenSymbols.length && + !tokenSymbols.some((tokenSymbol) => + [ + smartPool.token0.symbol.toLowerCase(), + smartPool.token1.symbol.toLowerCase(), + ].includes(tokenSymbol.toLowerCase()), + ) + ) + return false + + if ( + protocols.length && + !protocols.some((protocol) => smartPool.protocol === protocol) + ) + return false + + if (farmsOnly && !smartPool.isIncentivized) return false + + return true + }) ?? [], + [smartPools, tokenSymbols, protocols, farmsOnly], + ) + + return ( + + + + Smart Pools{' '} + {vaults?.length ? ( + + ({vaults.length}) + + ) : null} + + + Smart pools optimize liquidity allocation within custom price ranges, + enhancing trading efficiency by providing deeper liquidity around the + current price, increasing Liquidity Providers (LP) fee earnings. To + learn more about Smart Pools, click{' '} + + here + + . + + + `smart-pools-table-${row.id.replace(':', '-')}`} + onPaginationChange={setPagination} + pagination={true} + state={state} + linkFormatter={(row) => + `/${row.chainId}/pool/v3/${row.poolAddress}/smart/${row.address}` + } + onSortingChange={setSorting} + loading={!vaults} + columns={COLUMNS} + data={vaults} + /> + + ) +} From b944f5b76afbc4025f99284a7bc30395fddc1226 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 8 Aug 2024 16:59:33 +0200 Subject: [PATCH 065/139] fix: lint --- .../src/app/(legal)/privacy-policy/layout.tsx | 4 --- .../app/(legal)/terms-of-service/layout.tsx | 4 --- apps/web/test/playwright.config.ts | 5 --- apps/web/test/pool/pool.test.ts | 35 ------------------- 4 files changed, 48 deletions(-) diff --git a/apps/web/src/app/(legal)/privacy-policy/layout.tsx b/apps/web/src/app/(legal)/privacy-policy/layout.tsx index 16caad8d2a..b771b76604 100644 --- a/apps/web/src/app/(legal)/privacy-policy/layout.tsx +++ b/apps/web/src/app/(legal)/privacy-policy/layout.tsx @@ -1,10 +1,6 @@ import { Navigation } from '@sushiswap/ui' import { Metadata } from 'next' -<<<<<<< HEAD:apps/web/src/app/privacy-policy/layout.tsx -import { headerElements } from '../_common/header-elements' -======= import { headerElements } from '../../(evm)/_common/header-elements' ->>>>>>> master:apps/web/src/app/(legal)/privacy-policy/layout.tsx export const metadata: Metadata = { title: 'Privacy Policy', diff --git a/apps/web/src/app/(legal)/terms-of-service/layout.tsx b/apps/web/src/app/(legal)/terms-of-service/layout.tsx index 127e19deb0..f0c5216b2e 100644 --- a/apps/web/src/app/(legal)/terms-of-service/layout.tsx +++ b/apps/web/src/app/(legal)/terms-of-service/layout.tsx @@ -1,10 +1,6 @@ import { Navigation } from '@sushiswap/ui' import { Metadata } from 'next' -<<<<<<< HEAD:apps/web/src/app/terms-of-service/layout.tsx -import { headerElements } from '../_common/header-elements' -======= import { headerElements } from '../../(evm)/_common/header-elements' ->>>>>>> master:apps/web/src/app/(legal)/terms-of-service/layout.tsx export const metadata: Metadata = { title: 'Terms Of Service', diff --git a/apps/web/test/playwright.config.ts b/apps/web/test/playwright.config.ts index 8da5ea89f7..561fd86b53 100644 --- a/apps/web/test/playwright.config.ts +++ b/apps/web/test/playwright.config.ts @@ -20,13 +20,8 @@ const baseURL = `http://localhost:${PORT}` const config: PlaywrightTestConfig = { quiet: !!process.env.CI, testMatch: [ -<<<<<<< HEAD 'pool.test.ts', // 'simple.test.ts', -======= - 'simple.test.ts', - 'pool.test.ts', ->>>>>>> master // 'smart.test.ts', // 'cross-chain.test.ts', ], diff --git a/apps/web/test/pool/pool.test.ts b/apps/web/test/pool/pool.test.ts index 796eb05dee..da1c201761 100644 --- a/apps/web/test/pool/pool.test.ts +++ b/apps/web/test/pool/pool.test.ts @@ -14,15 +14,6 @@ import { interceptAnvil } from 'test/intercept-anvil' const NATIVE_TOKEN = Native.onChain(chainId) let FAKE_TOKEN: Token -<<<<<<< HEAD -======= - -// let MOCK_TOKEN_1_DP: Token -// let MOCK_TOKEN_6_DP: Token -// let MOCK_TOKEN_8_DP: Token -// let MOCK_TOKEN_18_DP: Token - ->>>>>>> master const BASE_URL = 'http://localhost:3000/pool' test.beforeAll(async () => { @@ -79,7 +70,6 @@ test.beforeEach(async ({ page, next }) => { // TEMP: Mock V2 POOL.. await page.route( -<<<<<<< HEAD 'https://data.sushi.com', // TODO: update url async (route) => { await route.fulfill({ @@ -124,22 +114,6 @@ test.beforeEach(async ({ page, next }) => { wasIncentivized: false, incentives: [], }, -======= - 'http://localhost:3000/pools/api/graphPool/137:0x74c9bcd8a09d8b80a5654ccd6d338965f6937789', - // 'http://localhost:3000/pools/api/graphPool/137:0x0b65273d824393e2f43357a4096e5ebd17c89629', - async (route) => { - await route.fulfill({ - json: { - id: '137:0x74c9bcd8a09d8b80a5654ccd6d338965f6937789', - address: '0x74c9bcd8a09d8b80a5654ccd6d338965f6937789', - chainId: 137, - name: `WMATIC-FT`, - swapFee: 0.003, - protocol: 'SUSHISWAP_V2', - reserve0: { - __type: 'bigint', - value: '1000000000000000000', ->>>>>>> master }, }, }) @@ -171,15 +145,10 @@ test.describe('V3', () => { next, }) => { test.slow() -<<<<<<< HEAD const url = BASE_URL.concat(`/${CHAIN_ID.toString()}`) .concat(`/v3`) .concat('/add') const poolPage = new PoolPage(page, CHAIN_ID) -======= - const url = BASE_URL.concat('/add').concat(`?chainId=${chainId}`) - const poolPage = new PoolPage(page, chainId) ->>>>>>> master await poolPage.mockPoolApi( next, @@ -223,13 +192,9 @@ test.describe('V2', () => { test.slow() const poolPage = new PoolPage(page, chainId) -<<<<<<< HEAD const url = BASE_URL.concat(`/${CHAIN_ID.toString()}`) .concat(`/v2`) .concat('/add') -======= - const url = BASE_URL.concat(`/add/v2/${chainId}`) ->>>>>>> master await poolPage.goTo(url) await poolPage.connect() await poolPage.switchNetwork(chainId) From 42a9523e04ee100db378d1f58488dcc99a23b8b6 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 8 Aug 2024 17:03:47 +0200 Subject: [PATCH 066/139] fix: lint --- .../wagmi/components/header-network-selector.tsx | 13 ------------- .../wagmi/components/wagmi-header-components.tsx | 11 +---------- .../lib/wagmi/hooks/master-chef/use-master-chef.ts | 11 +---------- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/apps/web/src/lib/wagmi/components/header-network-selector.tsx b/apps/web/src/lib/wagmi/components/header-network-selector.tsx index dbcba079aa..8161df5473 100644 --- a/apps/web/src/lib/wagmi/components/header-network-selector.tsx +++ b/apps/web/src/lib/wagmi/components/header-network-selector.tsx @@ -11,13 +11,7 @@ export const HeaderNetworkSelector: FC<{ networks: ChainId[] selectedNetwork?: ChainId onChange?(chainId: ChainId): void -<<<<<<< HEAD - hideNetworkName?: boolean -}> = ({ networks, selectedNetwork, onChange, hideNetworkName = false }) => { - const isMounted = useIsMounted() -======= }> = ({ networks, selectedNetwork, onChange }) => { ->>>>>>> master const { switchChainAsync } = useSwitchChain() const chainId = useChainId() @@ -54,15 +48,8 @@ export const HeaderNetworkSelector: FC<{ > diff --git a/apps/web/src/lib/wagmi/components/wagmi-header-components.tsx b/apps/web/src/lib/wagmi/components/wagmi-header-components.tsx index fd2200b67c..455b975829 100644 --- a/apps/web/src/lib/wagmi/components/wagmi-header-components.tsx +++ b/apps/web/src/lib/wagmi/components/wagmi-header-components.tsx @@ -41,17 +41,8 @@ export const WagmiHeaderComponents: React.FC = ({ return ( <> -<<<<<<< HEAD - - -======= - ->>>>>>> master + ) } diff --git a/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts b/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts index d64c22aef2..83b9276c3f 100644 --- a/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts +++ b/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts @@ -22,17 +22,8 @@ import { } from 'wagmi' import { SendTransactionErrorType } from 'wagmi/actions' import { SendTransactionData } from 'wagmi/query' -<<<<<<< HEAD -import { - MASTERCHEF_ADDRESS, - MASTERCHEF_V2_ADDRESS, - MINICHEF_ADDRESS, - useMasterChefContract, -} from './use-master-chef-contract' -import { ChefType } from 'sushi' -======= import { useMasterChefContract } from './use-master-chef-contract' ->>>>>>> master +import { ChefType } from 'sushi' interface UseMasterChefReturn extends Pick, 'isLoading' | 'isError'> { From 93ed9838c90cd036913638d5eeac91e77cf7c4b3 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 8 Aug 2024 15:04:55 +0000 Subject: [PATCH 067/139] chore: lint --- apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts | 2 +- apps/web/src/ui/pool/AddSectionLegacy.tsx | 2 +- apps/web/src/ui/pool/AddSectionMyPosition.tsx | 2 +- .../Tables/Smart/columns/SteerStrategyCell.tsx | 2 +- .../ConcentratedPositionsTable/Tables/Smart/columns/index.tsx | 2 +- apps/web/src/ui/pool/ManageV2LiquidityCard.tsx | 2 +- apps/web/src/ui/pool/MigrateTab.tsx | 2 +- apps/web/src/ui/pool/PoolButtons.tsx | 2 +- apps/web/src/ui/pool/PoolChartGraph.tsx | 2 +- apps/web/src/ui/pool/PoolChartV2.tsx | 4 ++-- apps/web/src/ui/pool/PoolHeader.tsx | 2 +- apps/web/src/ui/pool/PoolMyRewards.tsx | 2 +- apps/web/src/ui/pool/PoolPosition.tsx | 2 +- apps/web/src/ui/pool/PoolPositionDesktop.tsx | 2 +- apps/web/src/ui/pool/PoolPositionStakedDesktop.tsx | 2 +- apps/web/src/ui/pool/PoolRewardDistributionsCard.tsx | 2 +- apps/web/src/ui/pool/RemoveSectionLegacy.tsx | 2 +- apps/web/src/ui/pool/RemoveSectionUnstake.tsx | 4 ++-- apps/web/src/ui/pool/StatisticsChartV3.tsx | 4 ++-- apps/web/src/ui/pool/Steer/SteerCarousel.tsx | 2 +- .../Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx | 2 +- .../SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx | 2 +- .../Add/SteerPositionAddReviewModal.tsx | 2 +- apps/web/src/ui/pool/Steer/SteerStrategies/index.ts | 2 +- apps/web/src/ui/pool/TableFiltersPoolType.tsx | 2 +- apps/web/src/ui/pool/columns.tsx | 2 +- 26 files changed, 29 insertions(+), 29 deletions(-) diff --git a/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts b/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts index 83b9276c3f..b442b9ad48 100644 --- a/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts +++ b/apps/web/src/lib/wagmi/hooks/master-chef/use-master-chef.ts @@ -3,6 +3,7 @@ import { createErrorToast, createToast } from '@sushiswap/notifications' import { keepPreviousData, useQueryClient } from '@tanstack/react-query' import { useCallback, useEffect, useMemo } from 'react' +import { ChefType } from 'sushi' import { erc20Abi, masterChefV2Abi, miniChefV2Abi } from 'sushi/abi' import { ChainId } from 'sushi/chain' import { @@ -23,7 +24,6 @@ import { import { SendTransactionErrorType } from 'wagmi/actions' import { SendTransactionData } from 'wagmi/query' import { useMasterChefContract } from './use-master-chef-contract' -import { ChefType } from 'sushi' interface UseMasterChefReturn extends Pick, 'isLoading' | 'isError'> { diff --git a/apps/web/src/ui/pool/AddSectionLegacy.tsx b/apps/web/src/ui/pool/AddSectionLegacy.tsx index 3973ae6e78..e045d876bf 100644 --- a/apps/web/src/ui/pool/AddSectionLegacy.tsx +++ b/apps/web/src/ui/pool/AddSectionLegacy.tsx @@ -9,6 +9,7 @@ import { SushiSwapV2ChainId } from 'sushi/config' import { tryParseAmount } from 'sushi/currency' import { useTokensFromPool } from '../../lib/hooks' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { getSushiSwapRouterContractConfig } from 'src/lib/wagmi/hooks/contracts/useSushiSwapRouter' import { SushiSwapV2PoolState, @@ -18,7 +19,6 @@ import { Checker } from 'src/lib/wagmi/systems/Checker' import { CheckerProvider } from 'src/lib/wagmi/systems/Checker/Provider' import { AddSectionReviewModalLegacy } from './AddSectionReviewModalLegacy' import { AddSectionWidget } from './AddSectionWidget' -import { V2Pool } from '@sushiswap/graph-client/data-api' export const AddSectionLegacy: FC<{ pool: V2Pool }> = ({ pool: _pool }) => { const chainId = _pool.chainId as SushiSwapV2ChainId diff --git a/apps/web/src/ui/pool/AddSectionMyPosition.tsx b/apps/web/src/ui/pool/AddSectionMyPosition.tsx index 20caadc468..1dfde2befd 100644 --- a/apps/web/src/ui/pool/AddSectionMyPosition.tsx +++ b/apps/web/src/ui/pool/AddSectionMyPosition.tsx @@ -5,9 +5,9 @@ import { incentiveRewardToToken } from 'src/lib/functions' import { ChainId } from 'sushi/chain' import { formatPercent } from 'sushi/format' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { AddSectionMyPositionStaked } from './AddSectionMyPositionStaked' import { AddSectionMyPositionUnstaked } from './AddSectionMyPositionUnstaked' -import { V2Pool } from '@sushiswap/graph-client/data-api' export const AddSectionMyPosition: FC<{ pool: V2Pool }> = ({ pool }) => { return ( diff --git a/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx b/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx index 1180b4b1a2..0dad48b618 100644 --- a/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx +++ b/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/SteerStrategyCell.tsx @@ -1,6 +1,6 @@ import React, { FC } from 'react' -import { SteerStrategyConfig } from '../../../../Steer/constants' import { SteerAccountPositionVault } from 'src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended' +import { SteerStrategyConfig } from '../../../../Steer/constants' export const SteerStrategyCell: FC<{ vault: SteerAccountPositionVault }> = ({ vault, diff --git a/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/index.tsx b/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/index.tsx index 5d7f13ea21..5033c81cf9 100644 --- a/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/index.tsx +++ b/apps/web/src/ui/pool/ConcentratedPositionsTable/Tables/Smart/columns/index.tsx @@ -14,10 +14,10 @@ import { ColumnDef } from '@tanstack/react-table' import { formatNumber, formatPercent } from 'sushi/format' import { SteerAccountPositionExtended } from 'src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended' +import { SushiSwapProtocol } from 'sushi' import { unwrapToken } from 'sushi/currency' import { ProtocolBadge } from '../../../../PoolNameCell' import { SteerStrategyCell } from './SteerStrategyCell' -import { SushiSwapProtocol } from 'sushi' export const STEER_NAME_COLUMN: ColumnDef< SteerAccountPositionExtended, diff --git a/apps/web/src/ui/pool/ManageV2LiquidityCard.tsx b/apps/web/src/ui/pool/ManageV2LiquidityCard.tsx index 13b02924ba..d00cf58026 100644 --- a/apps/web/src/ui/pool/ManageV2LiquidityCard.tsx +++ b/apps/web/src/ui/pool/ManageV2LiquidityCard.tsx @@ -16,6 +16,7 @@ import { import Link from 'next/link' import { FC } from 'react' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { AddSectionLegacy } from './AddSectionLegacy' import { AddSectionStake } from './AddSectionStake' import { PoolPositionProvider } from './PoolPositionProvider' @@ -23,7 +24,6 @@ import { PoolPositionRewardsProvider } from './PoolPositionRewardsProvider' import { PoolPositionStakedProvider } from './PoolPositionStakedProvider' import { RemoveSectionLegacy } from './RemoveSectionLegacy' import { RemoveSectionUnstake } from './RemoveSectionUnstake' -import { V2Pool } from '@sushiswap/graph-client/data-api' interface ManageV2LiquidityCardProps { pool: V2Pool diff --git a/apps/web/src/ui/pool/MigrateTab.tsx b/apps/web/src/ui/pool/MigrateTab.tsx index 0824b5afdc..d0418ff43d 100644 --- a/apps/web/src/ui/pool/MigrateTab.tsx +++ b/apps/web/src/ui/pool/MigrateTab.tsx @@ -2,6 +2,7 @@ import { CogIcon } from '@heroicons/react-v1/outline' import { SwitchHorizontalIcon } from '@heroicons/react-v1/solid' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { SlippageToleranceStorageKey, TTLStorageKey } from '@sushiswap/hooks' import { Card, @@ -82,7 +83,6 @@ import { usePoolPosition } from './PoolPositionProvider' import { usePoolPositionStaked } from './PoolPositionStakedProvider' import { SelectFeeConcentratedWidget } from './SelectFeeConcentratedWidget' import { SelectPricesWidget } from './SelectPricesWidget' -import { V2Pool } from '@sushiswap/graph-client/data-api' function MigrateUnstakeCard({ pool }: { pool: V2Pool }) { const { diff --git a/apps/web/src/ui/pool/PoolButtons.tsx b/apps/web/src/ui/pool/PoolButtons.tsx index 4b226e7d52..61dd9342b4 100644 --- a/apps/web/src/ui/pool/PoolButtons.tsx +++ b/apps/web/src/ui/pool/PoolButtons.tsx @@ -5,9 +5,9 @@ import { FC } from 'react' import { ZERO } from 'sushi/math' import { getAddress } from 'viem' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { usePoolPosition } from './PoolPositionProvider' import { usePoolPositionStaked } from './PoolPositionStakedProvider' -import { V2Pool } from '@sushiswap/graph-client/data-api' interface PoolButtonsProps { pool: V2Pool diff --git a/apps/web/src/ui/pool/PoolChartGraph.tsx b/apps/web/src/ui/pool/PoolChartGraph.tsx index af1baea9a9..c54b6494b7 100644 --- a/apps/web/src/ui/pool/PoolChartGraph.tsx +++ b/apps/web/src/ui/pool/PoolChartGraph.tsx @@ -19,6 +19,7 @@ import resolveConfig from 'tailwindcss/resolveConfig' import { PoolChartPeriod, chartPeriods } from './PoolChartPeriods' import { PoolChartType } from './PoolChartTypes' +import { V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' import ReactEchartsCore from 'echarts-for-react/lib/core' import { EChartsOption } from 'echarts-for-react/lib/types' import 'echarts/lib/chart/bar' @@ -28,7 +29,6 @@ import 'echarts/lib/component/visualMap' import echarts from 'echarts/lib/echarts' import 'echarts/lib/visual/seriesColor' import { usePoolGraphData } from 'src/lib/hooks' -import { V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' import { SushiSwapProtocol } from 'sushi' interface PoolChartProps { diff --git a/apps/web/src/ui/pool/PoolChartV2.tsx b/apps/web/src/ui/pool/PoolChartV2.tsx index a9e244cb86..992b7f6b08 100644 --- a/apps/web/src/ui/pool/PoolChartV2.tsx +++ b/apps/web/src/ui/pool/PoolChartV2.tsx @@ -1,12 +1,12 @@ 'use client' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { Card } from '@sushiswap/ui' import React, { FC, useState } from 'react' +import { SushiSwapProtocol } from 'sushi' import { PoolChartGraph } from './PoolChartGraph' import { PoolChartPeriod, PoolChartPeriods } from './PoolChartPeriods' import { PoolChartType, PoolChartTypes } from './PoolChartTypes' -import { V2Pool } from '@sushiswap/graph-client/data-api' -import { SushiSwapProtocol } from 'sushi' const charts = [ PoolChartType.Volume, diff --git a/apps/web/src/ui/pool/PoolHeader.tsx b/apps/web/src/ui/pool/PoolHeader.tsx index eb3070c6a9..b6f3038170 100644 --- a/apps/web/src/ui/pool/PoolHeader.tsx +++ b/apps/web/src/ui/pool/PoolHeader.tsx @@ -21,8 +21,8 @@ import { Token, unwrapToken } from 'sushi/currency' import { formatPercent, shortenAddress } from 'sushi/format' import { SushiSwapV3Pool } from 'sushi/pool/sushiswap-v3' -import { APRHoverCard } from './APRHoverCard' import { V2Pool, V3Pool } from '@sushiswap/graph-client/data-api' +import { APRHoverCard } from './APRHoverCard' type PoolHeader = { backUrl: string diff --git a/apps/web/src/ui/pool/PoolMyRewards.tsx b/apps/web/src/ui/pool/PoolMyRewards.tsx index 7326bc6cdb..83d7bf2135 100644 --- a/apps/web/src/ui/pool/PoolMyRewards.tsx +++ b/apps/web/src/ui/pool/PoolMyRewards.tsx @@ -15,10 +15,10 @@ import { import { FC } from 'react' import { formatUSD } from 'sushi/format' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { Checker } from 'src/lib/wagmi/systems/Checker' import { type ChainId } from 'sushi/chain' import { usePoolPositionRewards } from './PoolPositionRewardsProvider' -import { V2Pool } from '@sushiswap/graph-client/data-api' interface PoolMyRewardsProps { pool: V2Pool diff --git a/apps/web/src/ui/pool/PoolPosition.tsx b/apps/web/src/ui/pool/PoolPosition.tsx index dbc13c442f..3824497c60 100644 --- a/apps/web/src/ui/pool/PoolPosition.tsx +++ b/apps/web/src/ui/pool/PoolPosition.tsx @@ -10,6 +10,7 @@ import { import { FC } from 'react' import { formatUSD } from 'sushi/format' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { SkeletonText } from '@sushiswap/ui' import { ConnectButton } from 'src/lib/wagmi/components/connect-button' import { useAccount } from 'wagmi' @@ -17,7 +18,6 @@ import { PoolPositionDesktop } from './PoolPositionDesktop' import { usePoolPosition } from './PoolPositionProvider' import { PoolPositionStakedDesktop } from './PoolPositionStakedDesktop' import { usePoolPositionStaked } from './PoolPositionStakedProvider' -import { V2Pool } from '@sushiswap/graph-client/data-api' interface PoolPositionProps { pool: V2Pool diff --git a/apps/web/src/ui/pool/PoolPositionDesktop.tsx b/apps/web/src/ui/pool/PoolPositionDesktop.tsx index 5adaa2e9ad..8506041e25 100644 --- a/apps/web/src/ui/pool/PoolPositionDesktop.tsx +++ b/apps/web/src/ui/pool/PoolPositionDesktop.tsx @@ -2,8 +2,8 @@ import { CardCurrencyAmountItem, CardGroup, CardLabel } from '@sushiswap/ui' import { FC } from 'react' import { formatUSD } from 'sushi/format' -import { usePoolPosition } from './PoolPositionProvider' import { V2Pool } from '@sushiswap/graph-client/data-api' +import { usePoolPosition } from './PoolPositionProvider' interface PoolPositionProps { pool: V2Pool diff --git a/apps/web/src/ui/pool/PoolPositionStakedDesktop.tsx b/apps/web/src/ui/pool/PoolPositionStakedDesktop.tsx index 121b53dc5f..f4ba98a8c1 100644 --- a/apps/web/src/ui/pool/PoolPositionStakedDesktop.tsx +++ b/apps/web/src/ui/pool/PoolPositionStakedDesktop.tsx @@ -2,8 +2,8 @@ import { CardCurrencyAmountItem, CardGroup, CardLabel } from '@sushiswap/ui' import { FC } from 'react' import { formatUSD } from 'sushi/format' -import { usePoolPositionStaked } from './PoolPositionStakedProvider' import { V2Pool } from '@sushiswap/graph-client/data-api' +import { usePoolPositionStaked } from './PoolPositionStakedProvider' interface PoolPositionStakedDesktopProps { pool: V2Pool diff --git a/apps/web/src/ui/pool/PoolRewardDistributionsCard.tsx b/apps/web/src/ui/pool/PoolRewardDistributionsCard.tsx index ddabbeb129..804effb795 100644 --- a/apps/web/src/ui/pool/PoolRewardDistributionsCard.tsx +++ b/apps/web/src/ui/pool/PoolRewardDistributionsCard.tsx @@ -19,9 +19,9 @@ import { ChainId } from 'sushi/chain' import { Native } from 'sushi/currency' import { getAddress } from 'viem' +import { V3Pool } from '@sushiswap/graph-client/data-api' import { isAngleEnabledChainId } from 'sushi/config' import { DistributionDataTable } from './DistributionDataTable' -import { V3Pool } from '@sushiswap/graph-client/data-api' interface PoolRewardDistributionsCardParams { pool: V3Pool diff --git a/apps/web/src/ui/pool/RemoveSectionLegacy.tsx b/apps/web/src/ui/pool/RemoveSectionLegacy.tsx index 4448de288d..f1234df8b0 100644 --- a/apps/web/src/ui/pool/RemoveSectionLegacy.tsx +++ b/apps/web/src/ui/pool/RemoveSectionLegacy.tsx @@ -28,6 +28,7 @@ import { Amount, Native } from 'sushi/currency' import { Percent } from 'sushi/math' import { SendTransactionReturnType, encodeFunctionData } from 'viem' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { PermitInfo, PermitType, @@ -57,7 +58,6 @@ import { } from 'wagmi' import { usePoolPosition } from './PoolPositionProvider' import { RemoveSectionWidget } from './RemoveSectionWidget' -import { V2Pool } from '@sushiswap/graph-client/data-api' const REMOVE_V2_LIQUIDITY_PERMIT_INFO: PermitInfo = { version: '1', diff --git a/apps/web/src/ui/pool/RemoveSectionUnstake.tsx b/apps/web/src/ui/pool/RemoveSectionUnstake.tsx index 8b5759a59c..8f1ba9c392 100644 --- a/apps/web/src/ui/pool/RemoveSectionUnstake.tsx +++ b/apps/web/src/ui/pool/RemoveSectionUnstake.tsx @@ -19,12 +19,12 @@ import { FC, useMemo, useState } from 'react' import { ChainId } from 'sushi/chain' import { ZERO } from 'sushi/math' +import { V2Pool } from '@sushiswap/graph-client/data-api' import { useMasterChefWithdraw } from 'src/lib/wagmi/hooks/master-chef/use-master-chef-withdraw' import { Checker } from 'src/lib/wagmi/systems/Checker' import { withCheckerRoot } from 'src/lib/wagmi/systems/Checker/Provider' -import { usePoolPositionStaked } from './PoolPositionStakedProvider' -import { V2Pool } from '@sushiswap/graph-client/data-api' import { ChefType } from 'sushi' +import { usePoolPositionStaked } from './PoolPositionStakedProvider' interface AddSectionStakeProps { chainId: ChainId diff --git a/apps/web/src/ui/pool/StatisticsChartV3.tsx b/apps/web/src/ui/pool/StatisticsChartV3.tsx index da815c4401..80b23b1256 100644 --- a/apps/web/src/ui/pool/StatisticsChartV3.tsx +++ b/apps/web/src/ui/pool/StatisticsChartV3.tsx @@ -1,12 +1,12 @@ +import { V3Pool } from '@sushiswap/graph-client/data-api' import { Card } from '@sushiswap/ui' import React, { FC, useMemo, useState } from 'react' +import { SushiSwapProtocol } from 'sushi' import { SushiSwapV3ChainId } from 'sushi/config' import { LiquidityDepthWidget } from './LiquidityDepthWidget' import { PoolChartGraph } from './PoolChartGraph' import { PoolChartPeriod, PoolChartPeriods } from './PoolChartPeriods' import { PoolChartType, PoolChartTypes } from './PoolChartTypes' -import { V3Pool } from '@sushiswap/graph-client/data-api' -import { SushiSwapProtocol } from 'sushi' const statisticsChart = [ PoolChartType.Volume, diff --git a/apps/web/src/ui/pool/Steer/SteerCarousel.tsx b/apps/web/src/ui/pool/Steer/SteerCarousel.tsx index 1123a6f1f2..b0d1381bb6 100644 --- a/apps/web/src/ui/pool/Steer/SteerCarousel.tsx +++ b/apps/web/src/ui/pool/Steer/SteerCarousel.tsx @@ -1,9 +1,9 @@ 'use client' +import { V3Pool, VaultV1 } from '@sushiswap/graph-client/data-api' import { Carousel, SkeletonBox } from '@sushiswap/ui' import { FC, useCallback, useMemo } from 'react' import { SteerPoolCard } from './SteerPoolCard' -import { V3Pool, VaultV1 } from '@sushiswap/graph-client/data-api' interface SteerCarousel { pool: V3Pool diff --git a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx index 34f0b7295b..71580800ea 100644 --- a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx +++ b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAdd.tsx @@ -6,6 +6,7 @@ import { Button, DialogTrigger, classNames } from '@sushiswap/ui' import React, { FC, useMemo } from 'react' import { ChainId } from 'sushi/chain' +import { VaultV1 } from '@sushiswap/graph-client/data-api' import { useIsMounted } from '@sushiswap/hooks' import { APPROVE_TAG_STEER, Field } from 'src/lib/constants' import { Web3Input } from 'src/lib/wagmi/components/web3-input' @@ -17,7 +18,6 @@ import { useSteerPositionAddState, } from './SteerPositionAddProvider' import { SteerPositionAddReviewModal } from './SteerPositionAddReviewModal' -import { VaultV1 } from '@sushiswap/graph-client/data-api' interface SteerPositionAddProps { vault: VaultV1 diff --git a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx index 1a2ddd7f37..a1ffcf4587 100644 --- a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx +++ b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddProvider.tsx @@ -1,5 +1,6 @@ 'use client' +import { VaultV1 } from '@sushiswap/graph-client/data-api' import { FC, ReactNode, @@ -11,7 +12,6 @@ import { import { Field } from 'src/lib/constants' import { useSteerVaultReserves } from 'src/lib/wagmi/hooks/steer/useSteerVaultReserves' import { Amount, Currency, Token, tryParseAmount } from 'sushi/currency' -import { VaultV1 } from '@sushiswap/graph-client/data-api' interface State { independentField: Field diff --git a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx index 09e7fe72af..b8cc61723a 100644 --- a/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx +++ b/apps/web/src/ui/pool/Steer/SteerLiquidityManagement/Add/SteerPositionAddReviewModal.tsx @@ -27,6 +27,7 @@ import { UserRejectedRequestError, } from 'viem' +import { VaultV1 } from '@sushiswap/graph-client/data-api' import { SlippageToleranceStorageKey } from '@sushiswap/hooks' import { APPROVE_TAG_STEER } from 'src/lib/constants' import { useSlippageTolerance } from 'src/lib/hooks/useSlippageTolerance' @@ -41,7 +42,6 @@ import { useWriteContract } from 'wagmi' import { useTokenAmountDollarValues } from '../../../../../lib/hooks' import { SteerStrategyConfig } from '../../constants' import { useSteerPositionAddDerivedInfo } from './SteerPositionAddProvider' -import { VaultV1 } from '@sushiswap/graph-client/data-api' interface SteerPositionAddReviewModalProps { vault: VaultV1 diff --git a/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts b/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts index d2c0dead14..5cab162207 100644 --- a/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts +++ b/apps/web/src/ui/pool/Steer/SteerStrategies/index.ts @@ -1,8 +1,8 @@ import { SteerStrategy } from '@sushiswap/steer-sdk' import { FC } from 'react' -import { SteerBaseStrategy } from './SteerBaseStrategy' import { V3Pool, VaultV1 } from '@sushiswap/graph-client/data-api' +import { SteerBaseStrategy } from './SteerBaseStrategy' export interface SteerStrategyGeneric { tokenRatios: { diff --git a/apps/web/src/ui/pool/TableFiltersPoolType.tsx b/apps/web/src/ui/pool/TableFiltersPoolType.tsx index c6cfcdd329..2e4cb4410a 100644 --- a/apps/web/src/ui/pool/TableFiltersPoolType.tsx +++ b/apps/web/src/ui/pool/TableFiltersPoolType.tsx @@ -20,9 +20,9 @@ import { Command, CommandGroup, CommandItem } from '@sushiswap/ui' import { CheckIcon } from '@sushiswap/ui/icons/CheckIcon' import React, { FC, useCallback, useState, useTransition } from 'react' +import { SushiSwapProtocol } from 'sushi' import { PROTOCOL_MAP } from '../../lib/constants' import { usePoolFilters, useSetPoolFilters } from './PoolsFiltersProvider' -import { SushiSwapProtocol } from 'sushi' export const POOL_TYPES = [ SushiSwapProtocol.SUSHISWAP_V3, diff --git a/apps/web/src/ui/pool/columns.tsx b/apps/web/src/ui/pool/columns.tsx index 83ee4388d8..a1cba00464 100644 --- a/apps/web/src/ui/pool/columns.tsx +++ b/apps/web/src/ui/pool/columns.tsx @@ -1,3 +1,4 @@ +import { V2Position } from '@sushiswap/graph-client/data-api' import { AngleRewardsPool } from '@sushiswap/react-query' import { PoolHasSteerVaults } from '@sushiswap/steer-sdk' import { @@ -50,7 +51,6 @@ import { import { PriceRangeCell } from './PriceRangeCell' import { RewardsV3ClaimableCell } from './RewardsV3ClaimableCell' import { RewardsV3NameCell } from './RewardsV3NameCell' -import { V2Position } from '@sushiswap/graph-client/data-api' export const REWARDS_V3_NAME_COLUMN: ColumnDef = { id: 'poolName', From 133f00301f7dba3d076398dfaaf44495a64ef6d6 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 8 Aug 2024 17:16:56 +0200 Subject: [PATCH 068/139] feat: remove fee page --- apps/web/src/app/(evm)/pool/fees/layout.tsx | 13 -- apps/web/src/app/(evm)/pool/fees/page.tsx | 245 -------------------- 2 files changed, 258 deletions(-) delete mode 100644 apps/web/src/app/(evm)/pool/fees/layout.tsx delete mode 100644 apps/web/src/app/(evm)/pool/fees/page.tsx diff --git a/apps/web/src/app/(evm)/pool/fees/layout.tsx b/apps/web/src/app/(evm)/pool/fees/layout.tsx deleted file mode 100644 index 3b26597c8a..0000000000 --- a/apps/web/src/app/(evm)/pool/fees/layout.tsx +++ /dev/null @@ -1,13 +0,0 @@ -// import { Container } from '@sushiswap/ui' - -// export default function Layout({ children }: { children: React.ReactNode }) { -// return ( -//
-//
-// -// {children} -// -//
-//
-// ) -// } diff --git a/apps/web/src/app/(evm)/pool/fees/page.tsx b/apps/web/src/app/(evm)/pool/fees/page.tsx deleted file mode 100644 index eea86f4aec..0000000000 --- a/apps/web/src/app/(evm)/pool/fees/page.tsx +++ /dev/null @@ -1,245 +0,0 @@ -// 'use client' - -// import { -// Badge, -// Button, -// Card, -// Container, -// Currency, -// DataTable, -// SkeletonCircle, -// SkeletonText, -// Tooltip, -// TooltipContent, -// TooltipProvider, -// TooltipTrigger, -// classNames, -// } from '@sushiswap/ui' -// import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' -// import { ColumnDef, SortingState, TableState } from '@tanstack/react-table' -// import { FC, MouseEventHandler, useCallback, useMemo, useState } from 'react' -// // import { V3PoolsWithFees, useV3PoolsWithFees } from 'src/lib/hooks' -// import { ProtocolBadge } from 'src/ui/pool/PoolNameCell' -// import { Address, Chain } from 'sushi' -// import { uniswapV3PoolAbi } from 'sushi/abi' -// import { SushiSwapV3ChainId, isSushiSwapV3ChainId } from 'sushi/config' -// import { formatNumber, formatUSD } from 'sushi/format' -// import { -// useChainId, -// useWaitForTransactionReceipt, -// useWriteContract, -// } from 'wagmi' - -// const NAME_COLUMN_POOL: ColumnDef = { -// id: 'name', -// header: 'Name', - -// cell: (props) => ( -//
-//
-// -// } -// > -// -// -// -// -// -//
-//
-// -// {props.row.original.token0.symbol}{' '} -// -// / -// {' '} -// {props.row.original.token1.symbol}{' '} -//
-// -//
-// -// -// -// {ProtocolBadge['SUSHISWAP_V3']} -// -// -//

Protocol version

-//
-//
-//
-// -// -// -//
-// {formatNumber(props.row.original.swapFee * 100)}% -//
-//
-// -//

Swap fee

-//
-//
-//
-//
-//
-//
-// ), -// meta: { -// skeleton: ( -//
-//
-// -// -//
-//
-// -//
-//
-// ), -// }, -// size: 300, -// } - -// const TVL_COLUMN: ColumnDef = { -// id: 'liquidityUSD', -// header: 'TVL', -// accessorFn: (row) => row.liquidityUSD, -// sortingFn: ({ original: rowA }, { original: rowB }) => -// rowA.liquidityUSD - rowB.liquidityUSD, -// cell: (props) => -// formatUSD(props.row.original.liquidityUSD).includes('NaN') -// ? '$0.00' -// : formatUSD(props.row.original.liquidityUSD), -// meta: { -// skeleton: , -// }, -// } - -// const VOLUME_COLUMN: ColumnDef = { -// id: 'volumeUSD', -// header: 'Volume', -// accessorFn: (row) => row.volumeUSD, -// sortingFn: ({ original: rowA }, { original: rowB }) => -// rowA.volumeUSD - rowB.volumeUSD, -// cell: (props) => -// formatUSD(props.row.original.volumeUSD).includes('NaN') -// ? '$0.00' -// : formatUSD(props.row.original.volumeUSD), -// meta: { -// skeleton: , -// }, -// } - -// const EnableProtocolFeeButton: FC<{ pool: Address }> = ({ pool }) => { -// const { data: txHash, writeContract, isPending } = useWriteContract() -// const { isLoading, isSuccess } = useWaitForTransactionReceipt({ -// hash: txHash, -// }) - -// const onClick: MouseEventHandler = useCallback( -// (e) => { -// e.preventDefault() -// writeContract({ -// address: pool, -// abi: uniswapV3PoolAbi, -// functionName: 'setFeeProtocol', -// args: [4, 4], -// }) -// }, -// [writeContract, pool], -// ) - -// return isSuccess ? ( -// '✅' -// ) : ( -// -// ) -// } - -// const PROTOCOL_FEE_COLUMN: ColumnDef = { -// id: 'isProtocolFeeEnabled', -// header: 'Fees Enabled', -// accessorFn: (row) => row.volumeUSD, -// sortingFn: ({ original: rowA }, { original: rowB }) => -// +rowA.isProtocolFeeEnabled - +rowB.isProtocolFeeEnabled, -// cell: (props) => ( -//
-// {props.row.original.isProtocolFeeEnabled ? ( -// '✅' -// ) : ( -// -// )} -//
-// ), -// meta: { -// skeleton: , -// }, -// } - -// const COLUMNS = [ -// NAME_COLUMN_POOL, -// TVL_COLUMN, -// VOLUME_COLUMN, -// PROTOCOL_FEE_COLUMN, -// ] - -// export default function Page() { -// const chainId = useChainId() - -// const { data: pools, isLoading } = useV3PoolsWithFees( -// { -// chainId: chainId as SushiSwapV3ChainId, -// }, -// { enabled: isSushiSwapV3ChainId(chainId), staleTime: Infinity }, -// ) - -// const [sorting, setSorting] = useState([ -// { id: 'liquidityUSD', desc: true }, -// ]) - -// const data = useMemo(() => pools?.flat() || [], [pools]) - -// const state: Partial = useMemo(() => { -// return { -// sorting, -// pagination: { -// pageIndex: 0, -// pageSize: data.length, -// }, -// } -// }, [data.length, sorting]) - -// return ( -// -// -// -// Chain.from(chainId).getAccountUrl(row.address) -// } -// /> -// -// -// ) -// } From 94a585f2461c25631462d3c7b6bf9ebfed846911 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 9 Aug 2024 00:19:46 +0700 Subject: [PATCH 069/139] fix: navbar --- .../src/app/(evm)/_common/header-elements.ts | 94 ------------------- .../components/header-network-selector.tsx | 7 +- 2 files changed, 5 insertions(+), 96 deletions(-) delete mode 100644 apps/web/src/app/(evm)/_common/header-elements.ts diff --git a/apps/web/src/app/(evm)/_common/header-elements.ts b/apps/web/src/app/(evm)/_common/header-elements.ts deleted file mode 100644 index bb2274abab..0000000000 --- a/apps/web/src/app/(evm)/_common/header-elements.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { - type NavigationElement, - NavigationElementDropdown, - NavigationElementType, -} from '@sushiswap/ui' -import { EXPLORE_NAVIGATION_LINKS } from 'src/app/_common/header-elements' - -const TOOLS_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ - { - title: 'Analytics', - href: '/analytics', - description: 'Find the best opportunities', - }, - { - title: 'Blog', - href: '/blog', - description: - 'Stay up to date with the latest product developments at Sushi.', - }, - { - title: 'Academy', - href: '/academy', - description: 'Everything you need to get up to speed with DeFi.', - }, - { - title: 'Forum & Proposals', - href: 'https://forum.sushi.com', - description: 'View and discuss proposals for SushiSwap.', - }, - { - title: 'Participate', - href: 'https://snapshot.org/#/sushigov.eth', - description: - 'As a Sushi holder, you can vote on proposals to shape the future of SushiSwap.', - }, -] - -const PARTNER_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ - { - title: 'Partner with Sushi', - href: '/partner', - description: 'Incentivize your token with Sushi rewards.', - }, - { - title: 'List enquiry', - href: '/tokenlist-request', - description: 'Get your token on our default token list.', - }, -] - -export const headerElements: NavigationElement[] = [ - { - title: 'Explore', - items: EXPLORE_NAVIGATION_LINKS, - show: 'mobile', - type: NavigationElementType.Dropdown, - }, - { - title: 'Swap', - href: '/swap', - show: 'desktop', - type: NavigationElementType.Single, - }, - { - title: 'Pools', - href: '/pool', - show: 'desktop', - type: NavigationElementType.Single, - }, - // { - // title: 'Bonds', - // href: '/bonds', - // show: 'desktop', - // type: NavigationElementType.Single, - // }, - { - title: 'Stake', - href: '/stake', - show: 'desktop', - type: NavigationElementType.Single, - }, - { - title: 'More', - items: TOOLS_NAVIGATION_LINKS, - show: 'desktop', - type: NavigationElementType.Dropdown, - }, - { - title: 'Partners', - items: PARTNER_NAVIGATION_LINKS, - show: 'desktop', - type: NavigationElementType.Dropdown, - }, -] diff --git a/apps/web/src/lib/wagmi/components/header-network-selector.tsx b/apps/web/src/lib/wagmi/components/header-network-selector.tsx index 8161df5473..98c96a760a 100644 --- a/apps/web/src/lib/wagmi/components/header-network-selector.tsx +++ b/apps/web/src/lib/wagmi/components/header-network-selector.tsx @@ -11,7 +11,8 @@ export const HeaderNetworkSelector: FC<{ networks: ChainId[] selectedNetwork?: ChainId onChange?(chainId: ChainId): void -}> = ({ networks, selectedNetwork, onChange }) => { + hideNetworkName?: boolean +}> = ({ networks, selectedNetwork, onChange, hideNetworkName = false }) => { const { switchChainAsync } = useSwitchChain() const chainId = useChainId() @@ -49,7 +50,9 @@ export const HeaderNetworkSelector: FC<{ From 4abc038079b1ad4a64f12041838fb58c6350db0d Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 8 Aug 2024 20:18:00 +0200 Subject: [PATCH 070/139] test(apps/web): fix chain id variable --- apps/web/test/pool/pool.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/test/pool/pool.test.ts b/apps/web/test/pool/pool.test.ts index da1c201761..b24f82c3f5 100644 --- a/apps/web/test/pool/pool.test.ts +++ b/apps/web/test/pool/pool.test.ts @@ -145,10 +145,10 @@ test.describe('V3', () => { next, }) => { test.slow() - const url = BASE_URL.concat(`/${CHAIN_ID.toString()}`) + const url = BASE_URL.concat(`/${chainId.toString()}`) .concat(`/v3`) .concat('/add') - const poolPage = new PoolPage(page, CHAIN_ID) + const poolPage = new PoolPage(page, chainId) await poolPage.mockPoolApi( next, @@ -192,7 +192,7 @@ test.describe('V2', () => { test.slow() const poolPage = new PoolPage(page, chainId) - const url = BASE_URL.concat(`/${CHAIN_ID.toString()}`) + const url = BASE_URL.concat(`/${chainId.toString()}`) .concat(`/v2`) .concat('/add') await poolPage.goTo(url) From 5da63adc1970ec9a36b0fc05b40a33c8e076709e Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 9 Aug 2024 01:23:20 +0700 Subject: [PATCH 071/139] fix: v3 fee page --- .../(evm)/[chainId]/pool/v3/fees/layout.tsx | 13 + .../app/(evm)/[chainId]/pool/v3/fees/page.tsx | 31 + apps/web/src/ui/pool/V3FeesTable.tsx | 240 + .../sushi-v3/fragments/pool-fields.ts | 53 + .../src/subgraphs/sushi-v3/graphql.ts | 8 + .../src/subgraphs/sushi-v3/queries/pools.ts | 48 + .../src/subgraphs/sushi-v3/schema.graphql | 6541 +++++++++++++++++ .../sushi-v3/transforms/pool-v3-to-base.ts | 73 + packages/graph-client/tsconfig.json | 8 +- 9 files changed, 7014 insertions(+), 1 deletion(-) create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v3/fees/layout.tsx create mode 100644 apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx create mode 100644 apps/web/src/ui/pool/V3FeesTable.tsx create mode 100644 packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts create mode 100644 packages/graph-client/src/subgraphs/sushi-v3/graphql.ts create mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts create mode 100644 packages/graph-client/src/subgraphs/sushi-v3/schema.graphql create mode 100644 packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/layout.tsx new file mode 100644 index 0000000000..b48a8ebbf2 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/layout.tsx @@ -0,0 +1,13 @@ +import { Container } from '@sushiswap/ui' + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( +
+
+ + {children} + +
+
+ ) +} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx new file mode 100644 index 0000000000..adeec615c4 --- /dev/null +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx @@ -0,0 +1,31 @@ +import { getSushiV3Pools } from '@sushiswap/graph-client/sushi-v3' +import { Card, Container } from '@sushiswap/ui' +import { unstable_cache } from 'next/cache' +import { TableFiltersNetwork } from 'src/ui/pool/TableFiltersNetwork' +import { V3FeesTable } from 'src/ui/pool/V3FeesTable' +import { ChainId } from 'sushi' +import { SushiSwapV3ChainId } from 'sushi/config' + +export default async function Page({ + params, +}: { params: { chainId: string } }) { + const pools = await unstable_cache( + async () => + getSushiV3Pools({ chainId: +params.chainId as SushiSwapV3ChainId }), + ['v3-pools', params.chainId], + { + revalidate: 60 * 15, + }, + )() + + return ( + +
+ +
+ + + +
+ ) +} diff --git a/apps/web/src/ui/pool/V3FeesTable.tsx b/apps/web/src/ui/pool/V3FeesTable.tsx new file mode 100644 index 0000000000..a8a01397ca --- /dev/null +++ b/apps/web/src/ui/pool/V3FeesTable.tsx @@ -0,0 +1,240 @@ +'use client' + +import { type SushiV3Pools } from '@sushiswap/graph-client/sushi-v3' +import { + Badge, + Button, + Currency, + DataTable, + SkeletonCircle, + SkeletonText, + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, + classNames, +} from '@sushiswap/ui' +import { NetworkIcon } from '@sushiswap/ui/icons/NetworkIcon' +import { ColumnDef, SortingState, TableState } from '@tanstack/react-table' +import { FC, MouseEventHandler, useCallback, useMemo, useState } from 'react' +import { ProtocolBadge } from 'src/ui/pool/PoolNameCell' +import { Address, Chain, ChainId } from 'sushi' +import { uniswapV3PoolAbi } from 'sushi/abi' +import { Token } from 'sushi/currency' +import { formatNumber, formatUSD } from 'sushi/format' +import { useWaitForTransactionReceipt, useWriteContract } from 'wagmi' + +type V3Pool = Omit & { + token0: Token + token1: Token +} + +const NAME_COLUMN_POOL: ColumnDef = { + id: 'name', + header: 'Name', + + cell: (props) => ( +
+
+ + } + > + + + + + +
+
+ + {props.row.original.token0.symbol}{' '} + + / + {' '} + {props.row.original.token1.symbol}{' '} +
+ +
+ + + + {ProtocolBadge['SUSHISWAP_V3']} + + +

Protocol version

+
+
+
+ + + +
+ {formatNumber(props.row.original.swapFee * 100)}% +
+
+ +

Swap fee

+
+
+
+
+
+
+ ), + meta: { + skeleton: ( +
+
+ + +
+
+ +
+
+ ), + }, + size: 300, +} + +const TVL_COLUMN: ColumnDef = { + id: 'liquidityUSD', + header: 'TVL', + accessorFn: (row) => row.liquidityUSD, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.liquidityUSD - rowB.liquidityUSD, + cell: (props) => + formatUSD(props.row.original.liquidityUSD).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.liquidityUSD), + meta: { + skeleton: , + }, +} + +const VOLUME_COLUMN: ColumnDef = { + id: 'volumeUSD', + header: 'Volume', + accessorFn: (row) => row.volumeUSD, + sortingFn: ({ original: rowA }, { original: rowB }) => + rowA.volumeUSD - rowB.volumeUSD, + cell: (props) => + formatUSD(props.row.original.volumeUSD).includes('NaN') + ? '$0.00' + : formatUSD(props.row.original.volumeUSD), + meta: { + skeleton: , + }, +} + +const EnableProtocolFeeButton: FC<{ pool: Address }> = ({ pool }) => { + const { data: txHash, writeContract, isPending } = useWriteContract() + const { isLoading, isSuccess } = useWaitForTransactionReceipt({ + hash: txHash, + }) + + const onClick: MouseEventHandler = useCallback( + (e) => { + e.preventDefault() + writeContract({ + address: pool, + abi: uniswapV3PoolAbi, + functionName: 'setFeeProtocol', + args: [4, 4], + }) + }, + [writeContract, pool], + ) + + return isSuccess ? ( + '✅' + ) : ( + + ) +} + +const PROTOCOL_FEE_COLUMN: ColumnDef = { + id: 'isProtocolFeeEnabled', + header: 'Fees Enabled', + accessorFn: (row) => row.volumeUSD, + sortingFn: ({ original: rowA }, { original: rowB }) => + +rowA.isProtocolFeeEnabled - +rowB.isProtocolFeeEnabled, + cell: (props) => ( +
+ {props.row.original.isProtocolFeeEnabled ? ( + '✅' + ) : ( + + )} +
+ ), + meta: { + skeleton: , + }, +} + +const COLUMNS = [ + NAME_COLUMN_POOL, + TVL_COLUMN, + VOLUME_COLUMN, + PROTOCOL_FEE_COLUMN, +] + +export const V3FeesTable: FC<{ pools: SushiV3Pools; chainId: ChainId }> = ({ + pools, + chainId, +}) => { + const [sorting, setSorting] = useState([ + { id: 'liquidityUSD', desc: true }, + ]) + + const data: V3Pool[] = useMemo( + () => + pools?.map((pool) => ({ + ...pool, + token0: new Token(pool.token0), + token1: new Token(pool.token1), + })) ?? [], + [pools], + ) + + const state: Partial = useMemo(() => { + return { + sorting, + pagination: { + pageIndex: 0, + pageSize: data.length, + }, + } + }, [data.length, sorting]) + + return ( + Chain.from(chainId).getAccountUrl(row.address)} + /> + ) +} diff --git a/packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts b/packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts new file mode 100644 index 0000000000..a0e7dad6fa --- /dev/null +++ b/packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts @@ -0,0 +1,53 @@ +import { graphql } from '../graphql' + +export const PoolFieldsFragment = graphql(` + fragment PoolFields on Pool @_unmask { + id + token0 { + id + symbol + name + decimals + } + token1 { + id + symbol + name + decimals + } + + isProtocolFeeEnabled + + swapFee: feeTier + + liquidity + sqrtPrice + feeGrowthGlobal0X128 + feeGrowthGlobal1X128 + token0Price + token1Price + tick + observationIndex + + volumeToken0 + volumeToken1 + volumeUSD + untrackedVolumeUSD + + feesUSD + collectedFeesToken0 + collectedFeesToken1 + collectedFeesUSD + + reserve0: totalValueLockedToken0 + reserve1: totalValueLockedToken1 + liquidityUSD: totalValueLockedUSD + untrackedLiquidityUSD: totalValueLockedUSDUntracked + + liquidityProviderCount + txCount + + createdAtTimestamp + createdAtBlockNumber + } +`) diff --git a/packages/graph-client/src/subgraphs/sushi-v3/graphql.ts b/packages/graph-client/src/subgraphs/sushi-v3/graphql.ts new file mode 100644 index 0000000000..09d313d696 --- /dev/null +++ b/packages/graph-client/src/subgraphs/sushi-v3/graphql.ts @@ -0,0 +1,8 @@ +import { initGraphQLTada } from 'gql.tada' +import type { Scalars } from 'src/lib/types/scalars.js' +import type { introspection } from './sushi-v3-env.js' + +export const graphql = initGraphQLTada<{ + introspection: introspection + scalars: Scalars +}>() diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts new file mode 100644 index 0000000000..ff3a23a27f --- /dev/null +++ b/packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts @@ -0,0 +1,48 @@ +import type { VariablesOf } from 'gql.tada' +import type { SushiSwapV3ChainId } from 'sushi/config' +import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' + +import { FetchError } from 'src/lib/fetch-error' +import type { RequestOptions } from 'src/lib/request' +import { requestPaged } from 'src/lib/request-paged' +import type { ChainIdVariable } from 'src/lib/types/chainId' +import { PoolFieldsFragment } from '../fragments/pool-fields' +import { transformPoolV3ToBase } from '../transforms/pool-v3-to-base' +import { graphql } from '../graphql' + +export const SushiV3PoolsQuery = graphql( + ` + query Pools($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Pool_orderBy, $orderDirection: OrderDirection, $where: Pool_filter) { + pools(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { + ...PoolFields + } + } +`, + [PoolFieldsFragment], +) + +export type GetSushiV3Pools = VariablesOf & + ChainIdVariable + +export async function getSushiV3Pools( + { chainId, ...variables }: GetSushiV3Pools, + options?: RequestOptions, +) { + const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` + + const result = await requestPaged({ + chainId, + url, + query: SushiV3PoolsQuery, + variables, + options, + }) + + if (result) { + return result.pools.map((pool) => transformPoolV3ToBase(pool, chainId)) + } + + throw new FetchError(chainId, 'Failed to fetch pools') +} + +export type SushiV3Pools = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v3/schema.graphql b/packages/graph-client/src/subgraphs/sushi-v3/schema.graphql new file mode 100644 index 0000000000..81ac3333f6 --- /dev/null +++ b/packages/graph-client/src/subgraphs/sushi-v3/schema.graphql @@ -0,0 +1,6541 @@ +""" +Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive. +""" +directive @entity on OBJECT + +"""Defined a Subgraph ID for an object type""" +directive @subgraphId(id: String!) on OBJECT + +""" +creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API. +""" +directive @derivedFrom(field: String!) on FIELD_DEFINITION + +enum Aggregation_interval { + hour + day +} + +scalar BigDecimal + +scalar BigInt + +input BlockChangedFilter { + number_gte: Int! +} + +input Block_height { + hash: Bytes + number: Int + number_gte: Int +} + +type Bundle { + id: ID! + ethPriceUSD: BigDecimal! +} + +input Bundle_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + ethPriceUSD: BigDecimal + ethPriceUSD_not: BigDecimal + ethPriceUSD_gt: BigDecimal + ethPriceUSD_lt: BigDecimal + ethPriceUSD_gte: BigDecimal + ethPriceUSD_lte: BigDecimal + ethPriceUSD_in: [BigDecimal!] + ethPriceUSD_not_in: [BigDecimal!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Bundle_filter] + or: [Bundle_filter] +} + +enum Bundle_orderBy { + id + ethPriceUSD +} + +type Burn { + id: ID! + transaction: Transaction! + pool: Pool! + token0: Token! + token1: Token! + timestamp: BigInt! + owner: Bytes + origin: Bytes! + amount: BigInt! + amount0: BigDecimal! + amount1: BigDecimal! + amountUSD: BigDecimal + tickLower: BigInt! + tickUpper: BigInt! + logIndex: BigInt +} + +input Burn_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + transaction: String + transaction_not: String + transaction_gt: String + transaction_lt: String + transaction_gte: String + transaction_lte: String + transaction_in: [String!] + transaction_not_in: [String!] + transaction_contains: String + transaction_contains_nocase: String + transaction_not_contains: String + transaction_not_contains_nocase: String + transaction_starts_with: String + transaction_starts_with_nocase: String + transaction_not_starts_with: String + transaction_not_starts_with_nocase: String + transaction_ends_with: String + transaction_ends_with_nocase: String + transaction_not_ends_with: String + transaction_not_ends_with_nocase: String + transaction_: Transaction_filter + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + token0: String + token0_not: String + token0_gt: String + token0_lt: String + token0_gte: String + token0_lte: String + token0_in: [String!] + token0_not_in: [String!] + token0_contains: String + token0_contains_nocase: String + token0_not_contains: String + token0_not_contains_nocase: String + token0_starts_with: String + token0_starts_with_nocase: String + token0_not_starts_with: String + token0_not_starts_with_nocase: String + token0_ends_with: String + token0_ends_with_nocase: String + token0_not_ends_with: String + token0_not_ends_with_nocase: String + token0_: Token_filter + token1: String + token1_not: String + token1_gt: String + token1_lt: String + token1_gte: String + token1_lte: String + token1_in: [String!] + token1_not_in: [String!] + token1_contains: String + token1_contains_nocase: String + token1_not_contains: String + token1_not_contains_nocase: String + token1_starts_with: String + token1_starts_with_nocase: String + token1_not_starts_with: String + token1_not_starts_with_nocase: String + token1_ends_with: String + token1_ends_with_nocase: String + token1_not_ends_with: String + token1_not_ends_with_nocase: String + token1_: Token_filter + timestamp: BigInt + timestamp_not: BigInt + timestamp_gt: BigInt + timestamp_lt: BigInt + timestamp_gte: BigInt + timestamp_lte: BigInt + timestamp_in: [BigInt!] + timestamp_not_in: [BigInt!] + owner: Bytes + owner_not: Bytes + owner_gt: Bytes + owner_lt: Bytes + owner_gte: Bytes + owner_lte: Bytes + owner_in: [Bytes!] + owner_not_in: [Bytes!] + owner_contains: Bytes + owner_not_contains: Bytes + origin: Bytes + origin_not: Bytes + origin_gt: Bytes + origin_lt: Bytes + origin_gte: Bytes + origin_lte: Bytes + origin_in: [Bytes!] + origin_not_in: [Bytes!] + origin_contains: Bytes + origin_not_contains: Bytes + amount: BigInt + amount_not: BigInt + amount_gt: BigInt + amount_lt: BigInt + amount_gte: BigInt + amount_lte: BigInt + amount_in: [BigInt!] + amount_not_in: [BigInt!] + amount0: BigDecimal + amount0_not: BigDecimal + amount0_gt: BigDecimal + amount0_lt: BigDecimal + amount0_gte: BigDecimal + amount0_lte: BigDecimal + amount0_in: [BigDecimal!] + amount0_not_in: [BigDecimal!] + amount1: BigDecimal + amount1_not: BigDecimal + amount1_gt: BigDecimal + amount1_lt: BigDecimal + amount1_gte: BigDecimal + amount1_lte: BigDecimal + amount1_in: [BigDecimal!] + amount1_not_in: [BigDecimal!] + amountUSD: BigDecimal + amountUSD_not: BigDecimal + amountUSD_gt: BigDecimal + amountUSD_lt: BigDecimal + amountUSD_gte: BigDecimal + amountUSD_lte: BigDecimal + amountUSD_in: [BigDecimal!] + amountUSD_not_in: [BigDecimal!] + tickLower: BigInt + tickLower_not: BigInt + tickLower_gt: BigInt + tickLower_lt: BigInt + tickLower_gte: BigInt + tickLower_lte: BigInt + tickLower_in: [BigInt!] + tickLower_not_in: [BigInt!] + tickUpper: BigInt + tickUpper_not: BigInt + tickUpper_gt: BigInt + tickUpper_lt: BigInt + tickUpper_gte: BigInt + tickUpper_lte: BigInt + tickUpper_in: [BigInt!] + tickUpper_not_in: [BigInt!] + logIndex: BigInt + logIndex_not: BigInt + logIndex_gt: BigInt + logIndex_lt: BigInt + logIndex_gte: BigInt + logIndex_lte: BigInt + logIndex_in: [BigInt!] + logIndex_not_in: [BigInt!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Burn_filter] + or: [Burn_filter] +} + +enum Burn_orderBy { + id + transaction + transaction__id + transaction__blockNumber + transaction__timestamp + transaction__gasUsed + transaction__gasPrice + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + token0 + token0__id + token0__symbol + token0__name + token0__decimals + token0__totalSupply + token0__volume + token0__volumeUSD + token0__untrackedVolumeUSD + token0__feesUSD + token0__txCount + token0__poolCount + token0__totalValueLocked + token0__totalValueLockedUSD + token0__totalValueLockedUSDUntracked + token0__derivedETH + token1 + token1__id + token1__symbol + token1__name + token1__decimals + token1__totalSupply + token1__volume + token1__volumeUSD + token1__untrackedVolumeUSD + token1__feesUSD + token1__txCount + token1__poolCount + token1__totalValueLocked + token1__totalValueLockedUSD + token1__totalValueLockedUSDUntracked + token1__derivedETH + timestamp + owner + origin + amount + amount0 + amount1 + amountUSD + tickLower + tickUpper + logIndex +} + +scalar Bytes + +type Collect { + id: ID! + transaction: Transaction! + timestamp: BigInt! + pool: Pool! + owner: Bytes + amount0: BigDecimal! + amount1: BigDecimal! + amountUSD: BigDecimal + tickLower: BigInt! + tickUpper: BigInt! + logIndex: BigInt +} + +input Collect_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + transaction: String + transaction_not: String + transaction_gt: String + transaction_lt: String + transaction_gte: String + transaction_lte: String + transaction_in: [String!] + transaction_not_in: [String!] + transaction_contains: String + transaction_contains_nocase: String + transaction_not_contains: String + transaction_not_contains_nocase: String + transaction_starts_with: String + transaction_starts_with_nocase: String + transaction_not_starts_with: String + transaction_not_starts_with_nocase: String + transaction_ends_with: String + transaction_ends_with_nocase: String + transaction_not_ends_with: String + transaction_not_ends_with_nocase: String + transaction_: Transaction_filter + timestamp: BigInt + timestamp_not: BigInt + timestamp_gt: BigInt + timestamp_lt: BigInt + timestamp_gte: BigInt + timestamp_lte: BigInt + timestamp_in: [BigInt!] + timestamp_not_in: [BigInt!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + owner: Bytes + owner_not: Bytes + owner_gt: Bytes + owner_lt: Bytes + owner_gte: Bytes + owner_lte: Bytes + owner_in: [Bytes!] + owner_not_in: [Bytes!] + owner_contains: Bytes + owner_not_contains: Bytes + amount0: BigDecimal + amount0_not: BigDecimal + amount0_gt: BigDecimal + amount0_lt: BigDecimal + amount0_gte: BigDecimal + amount0_lte: BigDecimal + amount0_in: [BigDecimal!] + amount0_not_in: [BigDecimal!] + amount1: BigDecimal + amount1_not: BigDecimal + amount1_gt: BigDecimal + amount1_lt: BigDecimal + amount1_gte: BigDecimal + amount1_lte: BigDecimal + amount1_in: [BigDecimal!] + amount1_not_in: [BigDecimal!] + amountUSD: BigDecimal + amountUSD_not: BigDecimal + amountUSD_gt: BigDecimal + amountUSD_lt: BigDecimal + amountUSD_gte: BigDecimal + amountUSD_lte: BigDecimal + amountUSD_in: [BigDecimal!] + amountUSD_not_in: [BigDecimal!] + tickLower: BigInt + tickLower_not: BigInt + tickLower_gt: BigInt + tickLower_lt: BigInt + tickLower_gte: BigInt + tickLower_lte: BigInt + tickLower_in: [BigInt!] + tickLower_not_in: [BigInt!] + tickUpper: BigInt + tickUpper_not: BigInt + tickUpper_gt: BigInt + tickUpper_lt: BigInt + tickUpper_gte: BigInt + tickUpper_lte: BigInt + tickUpper_in: [BigInt!] + tickUpper_not_in: [BigInt!] + logIndex: BigInt + logIndex_not: BigInt + logIndex_gt: BigInt + logIndex_lt: BigInt + logIndex_gte: BigInt + logIndex_lte: BigInt + logIndex_in: [BigInt!] + logIndex_not_in: [BigInt!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Collect_filter] + or: [Collect_filter] +} + +enum Collect_orderBy { + id + transaction + transaction__id + transaction__blockNumber + transaction__timestamp + transaction__gasUsed + transaction__gasPrice + timestamp + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + owner + amount0 + amount1 + amountUSD + tickLower + tickUpper + logIndex +} + +type DecreaseEvent { + id: ID! + pool: Pool! + tokenID: BigInt! + position: Position! + amount0: BigInt! + amount1: BigInt! + token0: Token! + token1: Token! + timeStamp: BigInt! + transaction: Transaction! +} + +input DecreaseEvent_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + tokenID: BigInt + tokenID_not: BigInt + tokenID_gt: BigInt + tokenID_lt: BigInt + tokenID_gte: BigInt + tokenID_lte: BigInt + tokenID_in: [BigInt!] + tokenID_not_in: [BigInt!] + position: String + position_not: String + position_gt: String + position_lt: String + position_gte: String + position_lte: String + position_in: [String!] + position_not_in: [String!] + position_contains: String + position_contains_nocase: String + position_not_contains: String + position_not_contains_nocase: String + position_starts_with: String + position_starts_with_nocase: String + position_not_starts_with: String + position_not_starts_with_nocase: String + position_ends_with: String + position_ends_with_nocase: String + position_not_ends_with: String + position_not_ends_with_nocase: String + position_: Position_filter + amount0: BigInt + amount0_not: BigInt + amount0_gt: BigInt + amount0_lt: BigInt + amount0_gte: BigInt + amount0_lte: BigInt + amount0_in: [BigInt!] + amount0_not_in: [BigInt!] + amount1: BigInt + amount1_not: BigInt + amount1_gt: BigInt + amount1_lt: BigInt + amount1_gte: BigInt + amount1_lte: BigInt + amount1_in: [BigInt!] + amount1_not_in: [BigInt!] + token0: String + token0_not: String + token0_gt: String + token0_lt: String + token0_gte: String + token0_lte: String + token0_in: [String!] + token0_not_in: [String!] + token0_contains: String + token0_contains_nocase: String + token0_not_contains: String + token0_not_contains_nocase: String + token0_starts_with: String + token0_starts_with_nocase: String + token0_not_starts_with: String + token0_not_starts_with_nocase: String + token0_ends_with: String + token0_ends_with_nocase: String + token0_not_ends_with: String + token0_not_ends_with_nocase: String + token0_: Token_filter + token1: String + token1_not: String + token1_gt: String + token1_lt: String + token1_gte: String + token1_lte: String + token1_in: [String!] + token1_not_in: [String!] + token1_contains: String + token1_contains_nocase: String + token1_not_contains: String + token1_not_contains_nocase: String + token1_starts_with: String + token1_starts_with_nocase: String + token1_not_starts_with: String + token1_not_starts_with_nocase: String + token1_ends_with: String + token1_ends_with_nocase: String + token1_not_ends_with: String + token1_not_ends_with_nocase: String + token1_: Token_filter + timeStamp: BigInt + timeStamp_not: BigInt + timeStamp_gt: BigInt + timeStamp_lt: BigInt + timeStamp_gte: BigInt + timeStamp_lte: BigInt + timeStamp_in: [BigInt!] + timeStamp_not_in: [BigInt!] + transaction: String + transaction_not: String + transaction_gt: String + transaction_lt: String + transaction_gte: String + transaction_lte: String + transaction_in: [String!] + transaction_not_in: [String!] + transaction_contains: String + transaction_contains_nocase: String + transaction_not_contains: String + transaction_not_contains_nocase: String + transaction_starts_with: String + transaction_starts_with_nocase: String + transaction_not_starts_with: String + transaction_not_starts_with_nocase: String + transaction_ends_with: String + transaction_ends_with_nocase: String + transaction_not_ends_with: String + transaction_not_ends_with_nocase: String + transaction_: Transaction_filter + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [DecreaseEvent_filter] + or: [DecreaseEvent_filter] +} + +enum DecreaseEvent_orderBy { + id + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + tokenID + position + position__id + position__owner + position__liquidity + position__depositedToken0 + position__depositedToken1 + position__withdrawnToken0 + position__withdrawnToken1 + position__collectedToken0 + position__collectedToken1 + position__collectedFeesToken0 + position__collectedFeesToken1 + position__amountDepositedUSD + position__amountWithdrawnUSD + position__amountCollectedUSD + position__feeGrowthInside0LastX128 + position__feeGrowthInside1LastX128 + amount0 + amount1 + token0 + token0__id + token0__symbol + token0__name + token0__decimals + token0__totalSupply + token0__volume + token0__volumeUSD + token0__untrackedVolumeUSD + token0__feesUSD + token0__txCount + token0__poolCount + token0__totalValueLocked + token0__totalValueLockedUSD + token0__totalValueLockedUSDUntracked + token0__derivedETH + token1 + token1__id + token1__symbol + token1__name + token1__decimals + token1__totalSupply + token1__volume + token1__volumeUSD + token1__untrackedVolumeUSD + token1__feesUSD + token1__txCount + token1__poolCount + token1__totalValueLocked + token1__totalValueLockedUSD + token1__totalValueLockedUSDUntracked + token1__derivedETH + timeStamp + transaction + transaction__id + transaction__blockNumber + transaction__timestamp + transaction__gasUsed + transaction__gasPrice +} + +type Factory { + id: ID! + poolCount: BigInt! + txCount: BigInt! + totalVolumeUSD: BigDecimal! + totalVolumeETH: BigDecimal! + totalFeesUSD: BigDecimal! + totalFeesETH: BigDecimal! + untrackedVolumeUSD: BigDecimal! + totalValueLockedUSD: BigDecimal! + totalValueLockedETH: BigDecimal! + totalValueLockedUSDUntracked: BigDecimal! + totalValueLockedETHUntracked: BigDecimal! + owner: ID! +} + +input Factory_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + poolCount: BigInt + poolCount_not: BigInt + poolCount_gt: BigInt + poolCount_lt: BigInt + poolCount_gte: BigInt + poolCount_lte: BigInt + poolCount_in: [BigInt!] + poolCount_not_in: [BigInt!] + txCount: BigInt + txCount_not: BigInt + txCount_gt: BigInt + txCount_lt: BigInt + txCount_gte: BigInt + txCount_lte: BigInt + txCount_in: [BigInt!] + txCount_not_in: [BigInt!] + totalVolumeUSD: BigDecimal + totalVolumeUSD_not: BigDecimal + totalVolumeUSD_gt: BigDecimal + totalVolumeUSD_lt: BigDecimal + totalVolumeUSD_gte: BigDecimal + totalVolumeUSD_lte: BigDecimal + totalVolumeUSD_in: [BigDecimal!] + totalVolumeUSD_not_in: [BigDecimal!] + totalVolumeETH: BigDecimal + totalVolumeETH_not: BigDecimal + totalVolumeETH_gt: BigDecimal + totalVolumeETH_lt: BigDecimal + totalVolumeETH_gte: BigDecimal + totalVolumeETH_lte: BigDecimal + totalVolumeETH_in: [BigDecimal!] + totalVolumeETH_not_in: [BigDecimal!] + totalFeesUSD: BigDecimal + totalFeesUSD_not: BigDecimal + totalFeesUSD_gt: BigDecimal + totalFeesUSD_lt: BigDecimal + totalFeesUSD_gte: BigDecimal + totalFeesUSD_lte: BigDecimal + totalFeesUSD_in: [BigDecimal!] + totalFeesUSD_not_in: [BigDecimal!] + totalFeesETH: BigDecimal + totalFeesETH_not: BigDecimal + totalFeesETH_gt: BigDecimal + totalFeesETH_lt: BigDecimal + totalFeesETH_gte: BigDecimal + totalFeesETH_lte: BigDecimal + totalFeesETH_in: [BigDecimal!] + totalFeesETH_not_in: [BigDecimal!] + untrackedVolumeUSD: BigDecimal + untrackedVolumeUSD_not: BigDecimal + untrackedVolumeUSD_gt: BigDecimal + untrackedVolumeUSD_lt: BigDecimal + untrackedVolumeUSD_gte: BigDecimal + untrackedVolumeUSD_lte: BigDecimal + untrackedVolumeUSD_in: [BigDecimal!] + untrackedVolumeUSD_not_in: [BigDecimal!] + totalValueLockedUSD: BigDecimal + totalValueLockedUSD_not: BigDecimal + totalValueLockedUSD_gt: BigDecimal + totalValueLockedUSD_lt: BigDecimal + totalValueLockedUSD_gte: BigDecimal + totalValueLockedUSD_lte: BigDecimal + totalValueLockedUSD_in: [BigDecimal!] + totalValueLockedUSD_not_in: [BigDecimal!] + totalValueLockedETH: BigDecimal + totalValueLockedETH_not: BigDecimal + totalValueLockedETH_gt: BigDecimal + totalValueLockedETH_lt: BigDecimal + totalValueLockedETH_gte: BigDecimal + totalValueLockedETH_lte: BigDecimal + totalValueLockedETH_in: [BigDecimal!] + totalValueLockedETH_not_in: [BigDecimal!] + totalValueLockedUSDUntracked: BigDecimal + totalValueLockedUSDUntracked_not: BigDecimal + totalValueLockedUSDUntracked_gt: BigDecimal + totalValueLockedUSDUntracked_lt: BigDecimal + totalValueLockedUSDUntracked_gte: BigDecimal + totalValueLockedUSDUntracked_lte: BigDecimal + totalValueLockedUSDUntracked_in: [BigDecimal!] + totalValueLockedUSDUntracked_not_in: [BigDecimal!] + totalValueLockedETHUntracked: BigDecimal + totalValueLockedETHUntracked_not: BigDecimal + totalValueLockedETHUntracked_gt: BigDecimal + totalValueLockedETHUntracked_lt: BigDecimal + totalValueLockedETHUntracked_gte: BigDecimal + totalValueLockedETHUntracked_lte: BigDecimal + totalValueLockedETHUntracked_in: [BigDecimal!] + totalValueLockedETHUntracked_not_in: [BigDecimal!] + owner: ID + owner_not: ID + owner_gt: ID + owner_lt: ID + owner_gte: ID + owner_lte: ID + owner_in: [ID!] + owner_not_in: [ID!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Factory_filter] + or: [Factory_filter] +} + +enum Factory_orderBy { + id + poolCount + txCount + totalVolumeUSD + totalVolumeETH + totalFeesUSD + totalFeesETH + untrackedVolumeUSD + totalValueLockedUSD + totalValueLockedETH + totalValueLockedUSDUntracked + totalValueLockedETHUntracked + owner +} + +type Flash { + id: ID! + transaction: Transaction! + timestamp: BigInt! + pool: Pool! + sender: Bytes! + recipient: Bytes! + amount0: BigDecimal! + amount1: BigDecimal! + amountUSD: BigDecimal! + amount0Paid: BigDecimal! + amount1Paid: BigDecimal! + logIndex: BigInt +} + +input Flash_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + transaction: String + transaction_not: String + transaction_gt: String + transaction_lt: String + transaction_gte: String + transaction_lte: String + transaction_in: [String!] + transaction_not_in: [String!] + transaction_contains: String + transaction_contains_nocase: String + transaction_not_contains: String + transaction_not_contains_nocase: String + transaction_starts_with: String + transaction_starts_with_nocase: String + transaction_not_starts_with: String + transaction_not_starts_with_nocase: String + transaction_ends_with: String + transaction_ends_with_nocase: String + transaction_not_ends_with: String + transaction_not_ends_with_nocase: String + transaction_: Transaction_filter + timestamp: BigInt + timestamp_not: BigInt + timestamp_gt: BigInt + timestamp_lt: BigInt + timestamp_gte: BigInt + timestamp_lte: BigInt + timestamp_in: [BigInt!] + timestamp_not_in: [BigInt!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + sender: Bytes + sender_not: Bytes + sender_gt: Bytes + sender_lt: Bytes + sender_gte: Bytes + sender_lte: Bytes + sender_in: [Bytes!] + sender_not_in: [Bytes!] + sender_contains: Bytes + sender_not_contains: Bytes + recipient: Bytes + recipient_not: Bytes + recipient_gt: Bytes + recipient_lt: Bytes + recipient_gte: Bytes + recipient_lte: Bytes + recipient_in: [Bytes!] + recipient_not_in: [Bytes!] + recipient_contains: Bytes + recipient_not_contains: Bytes + amount0: BigDecimal + amount0_not: BigDecimal + amount0_gt: BigDecimal + amount0_lt: BigDecimal + amount0_gte: BigDecimal + amount0_lte: BigDecimal + amount0_in: [BigDecimal!] + amount0_not_in: [BigDecimal!] + amount1: BigDecimal + amount1_not: BigDecimal + amount1_gt: BigDecimal + amount1_lt: BigDecimal + amount1_gte: BigDecimal + amount1_lte: BigDecimal + amount1_in: [BigDecimal!] + amount1_not_in: [BigDecimal!] + amountUSD: BigDecimal + amountUSD_not: BigDecimal + amountUSD_gt: BigDecimal + amountUSD_lt: BigDecimal + amountUSD_gte: BigDecimal + amountUSD_lte: BigDecimal + amountUSD_in: [BigDecimal!] + amountUSD_not_in: [BigDecimal!] + amount0Paid: BigDecimal + amount0Paid_not: BigDecimal + amount0Paid_gt: BigDecimal + amount0Paid_lt: BigDecimal + amount0Paid_gte: BigDecimal + amount0Paid_lte: BigDecimal + amount0Paid_in: [BigDecimal!] + amount0Paid_not_in: [BigDecimal!] + amount1Paid: BigDecimal + amount1Paid_not: BigDecimal + amount1Paid_gt: BigDecimal + amount1Paid_lt: BigDecimal + amount1Paid_gte: BigDecimal + amount1Paid_lte: BigDecimal + amount1Paid_in: [BigDecimal!] + amount1Paid_not_in: [BigDecimal!] + logIndex: BigInt + logIndex_not: BigInt + logIndex_gt: BigInt + logIndex_lt: BigInt + logIndex_gte: BigInt + logIndex_lte: BigInt + logIndex_in: [BigInt!] + logIndex_not_in: [BigInt!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Flash_filter] + or: [Flash_filter] +} + +enum Flash_orderBy { + id + transaction + transaction__id + transaction__blockNumber + transaction__timestamp + transaction__gasUsed + transaction__gasPrice + timestamp + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + sender + recipient + amount0 + amount1 + amountUSD + amount0Paid + amount1Paid + logIndex +} + +type IncreaseEvent { + id: ID! + pool: Pool! + tokenID: BigInt! + position: Position! + amount0: BigInt! + amount1: BigInt! + token0: Token! + token1: Token! + timeStamp: BigInt! + transaction: Transaction! +} + +input IncreaseEvent_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + tokenID: BigInt + tokenID_not: BigInt + tokenID_gt: BigInt + tokenID_lt: BigInt + tokenID_gte: BigInt + tokenID_lte: BigInt + tokenID_in: [BigInt!] + tokenID_not_in: [BigInt!] + position: String + position_not: String + position_gt: String + position_lt: String + position_gte: String + position_lte: String + position_in: [String!] + position_not_in: [String!] + position_contains: String + position_contains_nocase: String + position_not_contains: String + position_not_contains_nocase: String + position_starts_with: String + position_starts_with_nocase: String + position_not_starts_with: String + position_not_starts_with_nocase: String + position_ends_with: String + position_ends_with_nocase: String + position_not_ends_with: String + position_not_ends_with_nocase: String + position_: Position_filter + amount0: BigInt + amount0_not: BigInt + amount0_gt: BigInt + amount0_lt: BigInt + amount0_gte: BigInt + amount0_lte: BigInt + amount0_in: [BigInt!] + amount0_not_in: [BigInt!] + amount1: BigInt + amount1_not: BigInt + amount1_gt: BigInt + amount1_lt: BigInt + amount1_gte: BigInt + amount1_lte: BigInt + amount1_in: [BigInt!] + amount1_not_in: [BigInt!] + token0: String + token0_not: String + token0_gt: String + token0_lt: String + token0_gte: String + token0_lte: String + token0_in: [String!] + token0_not_in: [String!] + token0_contains: String + token0_contains_nocase: String + token0_not_contains: String + token0_not_contains_nocase: String + token0_starts_with: String + token0_starts_with_nocase: String + token0_not_starts_with: String + token0_not_starts_with_nocase: String + token0_ends_with: String + token0_ends_with_nocase: String + token0_not_ends_with: String + token0_not_ends_with_nocase: String + token0_: Token_filter + token1: String + token1_not: String + token1_gt: String + token1_lt: String + token1_gte: String + token1_lte: String + token1_in: [String!] + token1_not_in: [String!] + token1_contains: String + token1_contains_nocase: String + token1_not_contains: String + token1_not_contains_nocase: String + token1_starts_with: String + token1_starts_with_nocase: String + token1_not_starts_with: String + token1_not_starts_with_nocase: String + token1_ends_with: String + token1_ends_with_nocase: String + token1_not_ends_with: String + token1_not_ends_with_nocase: String + token1_: Token_filter + timeStamp: BigInt + timeStamp_not: BigInt + timeStamp_gt: BigInt + timeStamp_lt: BigInt + timeStamp_gte: BigInt + timeStamp_lte: BigInt + timeStamp_in: [BigInt!] + timeStamp_not_in: [BigInt!] + transaction: String + transaction_not: String + transaction_gt: String + transaction_lt: String + transaction_gte: String + transaction_lte: String + transaction_in: [String!] + transaction_not_in: [String!] + transaction_contains: String + transaction_contains_nocase: String + transaction_not_contains: String + transaction_not_contains_nocase: String + transaction_starts_with: String + transaction_starts_with_nocase: String + transaction_not_starts_with: String + transaction_not_starts_with_nocase: String + transaction_ends_with: String + transaction_ends_with_nocase: String + transaction_not_ends_with: String + transaction_not_ends_with_nocase: String + transaction_: Transaction_filter + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [IncreaseEvent_filter] + or: [IncreaseEvent_filter] +} + +enum IncreaseEvent_orderBy { + id + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + tokenID + position + position__id + position__owner + position__liquidity + position__depositedToken0 + position__depositedToken1 + position__withdrawnToken0 + position__withdrawnToken1 + position__collectedToken0 + position__collectedToken1 + position__collectedFeesToken0 + position__collectedFeesToken1 + position__amountDepositedUSD + position__amountWithdrawnUSD + position__amountCollectedUSD + position__feeGrowthInside0LastX128 + position__feeGrowthInside1LastX128 + amount0 + amount1 + token0 + token0__id + token0__symbol + token0__name + token0__decimals + token0__totalSupply + token0__volume + token0__volumeUSD + token0__untrackedVolumeUSD + token0__feesUSD + token0__txCount + token0__poolCount + token0__totalValueLocked + token0__totalValueLockedUSD + token0__totalValueLockedUSDUntracked + token0__derivedETH + token1 + token1__id + token1__symbol + token1__name + token1__decimals + token1__totalSupply + token1__volume + token1__volumeUSD + token1__untrackedVolumeUSD + token1__feesUSD + token1__txCount + token1__poolCount + token1__totalValueLocked + token1__totalValueLockedUSD + token1__totalValueLockedUSDUntracked + token1__derivedETH + timeStamp + transaction + transaction__id + transaction__blockNumber + transaction__timestamp + transaction__gasUsed + transaction__gasPrice +} + +"8 bytes signed integer\n" +scalar Int8 + +type Mint { + id: ID! + transaction: Transaction! + timestamp: BigInt! + pool: Pool! + token0: Token! + token1: Token! + owner: Bytes! + sender: Bytes + origin: Bytes! + amount: BigInt! + amount0: BigDecimal! + amount1: BigDecimal! + amountUSD: BigDecimal + tickLower: BigInt! + tickUpper: BigInt! + logIndex: BigInt +} + +input Mint_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + transaction: String + transaction_not: String + transaction_gt: String + transaction_lt: String + transaction_gte: String + transaction_lte: String + transaction_in: [String!] + transaction_not_in: [String!] + transaction_contains: String + transaction_contains_nocase: String + transaction_not_contains: String + transaction_not_contains_nocase: String + transaction_starts_with: String + transaction_starts_with_nocase: String + transaction_not_starts_with: String + transaction_not_starts_with_nocase: String + transaction_ends_with: String + transaction_ends_with_nocase: String + transaction_not_ends_with: String + transaction_not_ends_with_nocase: String + transaction_: Transaction_filter + timestamp: BigInt + timestamp_not: BigInt + timestamp_gt: BigInt + timestamp_lt: BigInt + timestamp_gte: BigInt + timestamp_lte: BigInt + timestamp_in: [BigInt!] + timestamp_not_in: [BigInt!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + token0: String + token0_not: String + token0_gt: String + token0_lt: String + token0_gte: String + token0_lte: String + token0_in: [String!] + token0_not_in: [String!] + token0_contains: String + token0_contains_nocase: String + token0_not_contains: String + token0_not_contains_nocase: String + token0_starts_with: String + token0_starts_with_nocase: String + token0_not_starts_with: String + token0_not_starts_with_nocase: String + token0_ends_with: String + token0_ends_with_nocase: String + token0_not_ends_with: String + token0_not_ends_with_nocase: String + token0_: Token_filter + token1: String + token1_not: String + token1_gt: String + token1_lt: String + token1_gte: String + token1_lte: String + token1_in: [String!] + token1_not_in: [String!] + token1_contains: String + token1_contains_nocase: String + token1_not_contains: String + token1_not_contains_nocase: String + token1_starts_with: String + token1_starts_with_nocase: String + token1_not_starts_with: String + token1_not_starts_with_nocase: String + token1_ends_with: String + token1_ends_with_nocase: String + token1_not_ends_with: String + token1_not_ends_with_nocase: String + token1_: Token_filter + owner: Bytes + owner_not: Bytes + owner_gt: Bytes + owner_lt: Bytes + owner_gte: Bytes + owner_lte: Bytes + owner_in: [Bytes!] + owner_not_in: [Bytes!] + owner_contains: Bytes + owner_not_contains: Bytes + sender: Bytes + sender_not: Bytes + sender_gt: Bytes + sender_lt: Bytes + sender_gte: Bytes + sender_lte: Bytes + sender_in: [Bytes!] + sender_not_in: [Bytes!] + sender_contains: Bytes + sender_not_contains: Bytes + origin: Bytes + origin_not: Bytes + origin_gt: Bytes + origin_lt: Bytes + origin_gte: Bytes + origin_lte: Bytes + origin_in: [Bytes!] + origin_not_in: [Bytes!] + origin_contains: Bytes + origin_not_contains: Bytes + amount: BigInt + amount_not: BigInt + amount_gt: BigInt + amount_lt: BigInt + amount_gte: BigInt + amount_lte: BigInt + amount_in: [BigInt!] + amount_not_in: [BigInt!] + amount0: BigDecimal + amount0_not: BigDecimal + amount0_gt: BigDecimal + amount0_lt: BigDecimal + amount0_gte: BigDecimal + amount0_lte: BigDecimal + amount0_in: [BigDecimal!] + amount0_not_in: [BigDecimal!] + amount1: BigDecimal + amount1_not: BigDecimal + amount1_gt: BigDecimal + amount1_lt: BigDecimal + amount1_gte: BigDecimal + amount1_lte: BigDecimal + amount1_in: [BigDecimal!] + amount1_not_in: [BigDecimal!] + amountUSD: BigDecimal + amountUSD_not: BigDecimal + amountUSD_gt: BigDecimal + amountUSD_lt: BigDecimal + amountUSD_gte: BigDecimal + amountUSD_lte: BigDecimal + amountUSD_in: [BigDecimal!] + amountUSD_not_in: [BigDecimal!] + tickLower: BigInt + tickLower_not: BigInt + tickLower_gt: BigInt + tickLower_lt: BigInt + tickLower_gte: BigInt + tickLower_lte: BigInt + tickLower_in: [BigInt!] + tickLower_not_in: [BigInt!] + tickUpper: BigInt + tickUpper_not: BigInt + tickUpper_gt: BigInt + tickUpper_lt: BigInt + tickUpper_gte: BigInt + tickUpper_lte: BigInt + tickUpper_in: [BigInt!] + tickUpper_not_in: [BigInt!] + logIndex: BigInt + logIndex_not: BigInt + logIndex_gt: BigInt + logIndex_lt: BigInt + logIndex_gte: BigInt + logIndex_lte: BigInt + logIndex_in: [BigInt!] + logIndex_not_in: [BigInt!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Mint_filter] + or: [Mint_filter] +} + +enum Mint_orderBy { + id + transaction + transaction__id + transaction__blockNumber + transaction__timestamp + transaction__gasUsed + transaction__gasPrice + timestamp + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + token0 + token0__id + token0__symbol + token0__name + token0__decimals + token0__totalSupply + token0__volume + token0__volumeUSD + token0__untrackedVolumeUSD + token0__feesUSD + token0__txCount + token0__poolCount + token0__totalValueLocked + token0__totalValueLockedUSD + token0__totalValueLockedUSDUntracked + token0__derivedETH + token1 + token1__id + token1__symbol + token1__name + token1__decimals + token1__totalSupply + token1__volume + token1__volumeUSD + token1__untrackedVolumeUSD + token1__feesUSD + token1__txCount + token1__poolCount + token1__totalValueLocked + token1__totalValueLockedUSD + token1__totalValueLockedUSDUntracked + token1__derivedETH + owner + sender + origin + amount + amount0 + amount1 + amountUSD + tickLower + tickUpper + logIndex +} + +"""Defines the order direction, either ascending or descending""" +enum OrderDirection { + asc + desc +} + +type Pool { + id: ID! + createdAtTimestamp: BigInt! + createdAtBlockNumber: BigInt! + token0: Token! + token1: Token! + feeTier: BigInt! + liquidity: BigInt! + sqrtPrice: BigInt! + feeGrowthGlobal0X128: BigInt! + feeGrowthGlobal1X128: BigInt! + token0Price: BigDecimal! + token1Price: BigDecimal! + tick: BigInt + observationIndex: BigInt! + volumeToken0: BigDecimal! + volumeToken1: BigDecimal! + volumeUSD: BigDecimal! + untrackedVolumeUSD: BigDecimal! + feesUSD: BigDecimal! + txCount: BigInt! + collectedFeesToken0: BigDecimal! + collectedFeesToken1: BigDecimal! + collectedFeesUSD: BigDecimal! + totalValueLockedToken0: BigDecimal! + totalValueLockedToken1: BigDecimal! + totalValueLockedETH: BigDecimal! + totalValueLockedUSD: BigDecimal! + totalValueLockedUSDUntracked: BigDecimal! + isProtocolFeeEnabled: Boolean! + liquidityProviderCount: BigInt! + poolHourData(skip: Int = 0, first: Int = 100, orderBy: PoolHourData_orderBy, orderDirection: OrderDirection, where: PoolHourData_filter): [PoolHourData!]! + poolDayData(skip: Int = 0, first: Int = 100, orderBy: PoolDayData_orderBy, orderDirection: OrderDirection, where: PoolDayData_filter): [PoolDayData!]! + mints(skip: Int = 0, first: Int = 100, orderBy: Mint_orderBy, orderDirection: OrderDirection, where: Mint_filter): [Mint!]! + burns(skip: Int = 0, first: Int = 100, orderBy: Burn_orderBy, orderDirection: OrderDirection, where: Burn_filter): [Burn!]! + swaps(skip: Int = 0, first: Int = 100, orderBy: Swap_orderBy, orderDirection: OrderDirection, where: Swap_filter): [Swap!]! + collects(skip: Int = 0, first: Int = 100, orderBy: Collect_orderBy, orderDirection: OrderDirection, where: Collect_filter): [Collect!]! + ticks(skip: Int = 0, first: Int = 100, orderBy: Tick_orderBy, orderDirection: OrderDirection, where: Tick_filter): [Tick!]! +} + +type PoolDayData { + id: ID! + date: Int! + pool: Pool! + liquidity: BigInt! + sqrtPrice: BigInt! + token0Price: BigDecimal! + token1Price: BigDecimal! + tick: BigInt + feeGrowthGlobal0X128: BigInt! + feeGrowthGlobal1X128: BigInt! + tvlUSD: BigDecimal! + volumeToken0: BigDecimal! + volumeToken1: BigDecimal! + volumeUSD: BigDecimal! + feesUSD: BigDecimal! + txCount: BigInt! + open: BigDecimal! + high: BigDecimal! + low: BigDecimal! + close: BigDecimal! +} + +input PoolDayData_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + date: Int + date_not: Int + date_gt: Int + date_lt: Int + date_gte: Int + date_lte: Int + date_in: [Int!] + date_not_in: [Int!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + liquidity: BigInt + liquidity_not: BigInt + liquidity_gt: BigInt + liquidity_lt: BigInt + liquidity_gte: BigInt + liquidity_lte: BigInt + liquidity_in: [BigInt!] + liquidity_not_in: [BigInt!] + sqrtPrice: BigInt + sqrtPrice_not: BigInt + sqrtPrice_gt: BigInt + sqrtPrice_lt: BigInt + sqrtPrice_gte: BigInt + sqrtPrice_lte: BigInt + sqrtPrice_in: [BigInt!] + sqrtPrice_not_in: [BigInt!] + token0Price: BigDecimal + token0Price_not: BigDecimal + token0Price_gt: BigDecimal + token0Price_lt: BigDecimal + token0Price_gte: BigDecimal + token0Price_lte: BigDecimal + token0Price_in: [BigDecimal!] + token0Price_not_in: [BigDecimal!] + token1Price: BigDecimal + token1Price_not: BigDecimal + token1Price_gt: BigDecimal + token1Price_lt: BigDecimal + token1Price_gte: BigDecimal + token1Price_lte: BigDecimal + token1Price_in: [BigDecimal!] + token1Price_not_in: [BigDecimal!] + tick: BigInt + tick_not: BigInt + tick_gt: BigInt + tick_lt: BigInt + tick_gte: BigInt + tick_lte: BigInt + tick_in: [BigInt!] + tick_not_in: [BigInt!] + feeGrowthGlobal0X128: BigInt + feeGrowthGlobal0X128_not: BigInt + feeGrowthGlobal0X128_gt: BigInt + feeGrowthGlobal0X128_lt: BigInt + feeGrowthGlobal0X128_gte: BigInt + feeGrowthGlobal0X128_lte: BigInt + feeGrowthGlobal0X128_in: [BigInt!] + feeGrowthGlobal0X128_not_in: [BigInt!] + feeGrowthGlobal1X128: BigInt + feeGrowthGlobal1X128_not: BigInt + feeGrowthGlobal1X128_gt: BigInt + feeGrowthGlobal1X128_lt: BigInt + feeGrowthGlobal1X128_gte: BigInt + feeGrowthGlobal1X128_lte: BigInt + feeGrowthGlobal1X128_in: [BigInt!] + feeGrowthGlobal1X128_not_in: [BigInt!] + tvlUSD: BigDecimal + tvlUSD_not: BigDecimal + tvlUSD_gt: BigDecimal + tvlUSD_lt: BigDecimal + tvlUSD_gte: BigDecimal + tvlUSD_lte: BigDecimal + tvlUSD_in: [BigDecimal!] + tvlUSD_not_in: [BigDecimal!] + volumeToken0: BigDecimal + volumeToken0_not: BigDecimal + volumeToken0_gt: BigDecimal + volumeToken0_lt: BigDecimal + volumeToken0_gte: BigDecimal + volumeToken0_lte: BigDecimal + volumeToken0_in: [BigDecimal!] + volumeToken0_not_in: [BigDecimal!] + volumeToken1: BigDecimal + volumeToken1_not: BigDecimal + volumeToken1_gt: BigDecimal + volumeToken1_lt: BigDecimal + volumeToken1_gte: BigDecimal + volumeToken1_lte: BigDecimal + volumeToken1_in: [BigDecimal!] + volumeToken1_not_in: [BigDecimal!] + volumeUSD: BigDecimal + volumeUSD_not: BigDecimal + volumeUSD_gt: BigDecimal + volumeUSD_lt: BigDecimal + volumeUSD_gte: BigDecimal + volumeUSD_lte: BigDecimal + volumeUSD_in: [BigDecimal!] + volumeUSD_not_in: [BigDecimal!] + feesUSD: BigDecimal + feesUSD_not: BigDecimal + feesUSD_gt: BigDecimal + feesUSD_lt: BigDecimal + feesUSD_gte: BigDecimal + feesUSD_lte: BigDecimal + feesUSD_in: [BigDecimal!] + feesUSD_not_in: [BigDecimal!] + txCount: BigInt + txCount_not: BigInt + txCount_gt: BigInt + txCount_lt: BigInt + txCount_gte: BigInt + txCount_lte: BigInt + txCount_in: [BigInt!] + txCount_not_in: [BigInt!] + open: BigDecimal + open_not: BigDecimal + open_gt: BigDecimal + open_lt: BigDecimal + open_gte: BigDecimal + open_lte: BigDecimal + open_in: [BigDecimal!] + open_not_in: [BigDecimal!] + high: BigDecimal + high_not: BigDecimal + high_gt: BigDecimal + high_lt: BigDecimal + high_gte: BigDecimal + high_lte: BigDecimal + high_in: [BigDecimal!] + high_not_in: [BigDecimal!] + low: BigDecimal + low_not: BigDecimal + low_gt: BigDecimal + low_lt: BigDecimal + low_gte: BigDecimal + low_lte: BigDecimal + low_in: [BigDecimal!] + low_not_in: [BigDecimal!] + close: BigDecimal + close_not: BigDecimal + close_gt: BigDecimal + close_lt: BigDecimal + close_gte: BigDecimal + close_lte: BigDecimal + close_in: [BigDecimal!] + close_not_in: [BigDecimal!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [PoolDayData_filter] + or: [PoolDayData_filter] +} + +enum PoolDayData_orderBy { + id + date + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + liquidity + sqrtPrice + token0Price + token1Price + tick + feeGrowthGlobal0X128 + feeGrowthGlobal1X128 + tvlUSD + volumeToken0 + volumeToken1 + volumeUSD + feesUSD + txCount + open + high + low + close +} + +type PoolHourData { + id: ID! + periodStartUnix: Int! + pool: Pool! + liquidity: BigInt! + sqrtPrice: BigInt! + token0Price: BigDecimal! + token1Price: BigDecimal! + tick: BigInt + feeGrowthGlobal0X128: BigInt! + feeGrowthGlobal1X128: BigInt! + tvlUSD: BigDecimal! + volumeToken0: BigDecimal! + volumeToken1: BigDecimal! + volumeUSD: BigDecimal! + feesUSD: BigDecimal! + txCount: BigInt! + open: BigDecimal! + high: BigDecimal! + low: BigDecimal! + close: BigDecimal! +} + +input PoolHourData_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + periodStartUnix: Int + periodStartUnix_not: Int + periodStartUnix_gt: Int + periodStartUnix_lt: Int + periodStartUnix_gte: Int + periodStartUnix_lte: Int + periodStartUnix_in: [Int!] + periodStartUnix_not_in: [Int!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + liquidity: BigInt + liquidity_not: BigInt + liquidity_gt: BigInt + liquidity_lt: BigInt + liquidity_gte: BigInt + liquidity_lte: BigInt + liquidity_in: [BigInt!] + liquidity_not_in: [BigInt!] + sqrtPrice: BigInt + sqrtPrice_not: BigInt + sqrtPrice_gt: BigInt + sqrtPrice_lt: BigInt + sqrtPrice_gte: BigInt + sqrtPrice_lte: BigInt + sqrtPrice_in: [BigInt!] + sqrtPrice_not_in: [BigInt!] + token0Price: BigDecimal + token0Price_not: BigDecimal + token0Price_gt: BigDecimal + token0Price_lt: BigDecimal + token0Price_gte: BigDecimal + token0Price_lte: BigDecimal + token0Price_in: [BigDecimal!] + token0Price_not_in: [BigDecimal!] + token1Price: BigDecimal + token1Price_not: BigDecimal + token1Price_gt: BigDecimal + token1Price_lt: BigDecimal + token1Price_gte: BigDecimal + token1Price_lte: BigDecimal + token1Price_in: [BigDecimal!] + token1Price_not_in: [BigDecimal!] + tick: BigInt + tick_not: BigInt + tick_gt: BigInt + tick_lt: BigInt + tick_gte: BigInt + tick_lte: BigInt + tick_in: [BigInt!] + tick_not_in: [BigInt!] + feeGrowthGlobal0X128: BigInt + feeGrowthGlobal0X128_not: BigInt + feeGrowthGlobal0X128_gt: BigInt + feeGrowthGlobal0X128_lt: BigInt + feeGrowthGlobal0X128_gte: BigInt + feeGrowthGlobal0X128_lte: BigInt + feeGrowthGlobal0X128_in: [BigInt!] + feeGrowthGlobal0X128_not_in: [BigInt!] + feeGrowthGlobal1X128: BigInt + feeGrowthGlobal1X128_not: BigInt + feeGrowthGlobal1X128_gt: BigInt + feeGrowthGlobal1X128_lt: BigInt + feeGrowthGlobal1X128_gte: BigInt + feeGrowthGlobal1X128_lte: BigInt + feeGrowthGlobal1X128_in: [BigInt!] + feeGrowthGlobal1X128_not_in: [BigInt!] + tvlUSD: BigDecimal + tvlUSD_not: BigDecimal + tvlUSD_gt: BigDecimal + tvlUSD_lt: BigDecimal + tvlUSD_gte: BigDecimal + tvlUSD_lte: BigDecimal + tvlUSD_in: [BigDecimal!] + tvlUSD_not_in: [BigDecimal!] + volumeToken0: BigDecimal + volumeToken0_not: BigDecimal + volumeToken0_gt: BigDecimal + volumeToken0_lt: BigDecimal + volumeToken0_gte: BigDecimal + volumeToken0_lte: BigDecimal + volumeToken0_in: [BigDecimal!] + volumeToken0_not_in: [BigDecimal!] + volumeToken1: BigDecimal + volumeToken1_not: BigDecimal + volumeToken1_gt: BigDecimal + volumeToken1_lt: BigDecimal + volumeToken1_gte: BigDecimal + volumeToken1_lte: BigDecimal + volumeToken1_in: [BigDecimal!] + volumeToken1_not_in: [BigDecimal!] + volumeUSD: BigDecimal + volumeUSD_not: BigDecimal + volumeUSD_gt: BigDecimal + volumeUSD_lt: BigDecimal + volumeUSD_gte: BigDecimal + volumeUSD_lte: BigDecimal + volumeUSD_in: [BigDecimal!] + volumeUSD_not_in: [BigDecimal!] + feesUSD: BigDecimal + feesUSD_not: BigDecimal + feesUSD_gt: BigDecimal + feesUSD_lt: BigDecimal + feesUSD_gte: BigDecimal + feesUSD_lte: BigDecimal + feesUSD_in: [BigDecimal!] + feesUSD_not_in: [BigDecimal!] + txCount: BigInt + txCount_not: BigInt + txCount_gt: BigInt + txCount_lt: BigInt + txCount_gte: BigInt + txCount_lte: BigInt + txCount_in: [BigInt!] + txCount_not_in: [BigInt!] + open: BigDecimal + open_not: BigDecimal + open_gt: BigDecimal + open_lt: BigDecimal + open_gte: BigDecimal + open_lte: BigDecimal + open_in: [BigDecimal!] + open_not_in: [BigDecimal!] + high: BigDecimal + high_not: BigDecimal + high_gt: BigDecimal + high_lt: BigDecimal + high_gte: BigDecimal + high_lte: BigDecimal + high_in: [BigDecimal!] + high_not_in: [BigDecimal!] + low: BigDecimal + low_not: BigDecimal + low_gt: BigDecimal + low_lt: BigDecimal + low_gte: BigDecimal + low_lte: BigDecimal + low_in: [BigDecimal!] + low_not_in: [BigDecimal!] + close: BigDecimal + close_not: BigDecimal + close_gt: BigDecimal + close_lt: BigDecimal + close_gte: BigDecimal + close_lte: BigDecimal + close_in: [BigDecimal!] + close_not_in: [BigDecimal!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [PoolHourData_filter] + or: [PoolHourData_filter] +} + +enum PoolHourData_orderBy { + id + periodStartUnix + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + liquidity + sqrtPrice + token0Price + token1Price + tick + feeGrowthGlobal0X128 + feeGrowthGlobal1X128 + tvlUSD + volumeToken0 + volumeToken1 + volumeUSD + feesUSD + txCount + open + high + low + close +} + +input Pool_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + createdAtTimestamp: BigInt + createdAtTimestamp_not: BigInt + createdAtTimestamp_gt: BigInt + createdAtTimestamp_lt: BigInt + createdAtTimestamp_gte: BigInt + createdAtTimestamp_lte: BigInt + createdAtTimestamp_in: [BigInt!] + createdAtTimestamp_not_in: [BigInt!] + createdAtBlockNumber: BigInt + createdAtBlockNumber_not: BigInt + createdAtBlockNumber_gt: BigInt + createdAtBlockNumber_lt: BigInt + createdAtBlockNumber_gte: BigInt + createdAtBlockNumber_lte: BigInt + createdAtBlockNumber_in: [BigInt!] + createdAtBlockNumber_not_in: [BigInt!] + token0: String + token0_not: String + token0_gt: String + token0_lt: String + token0_gte: String + token0_lte: String + token0_in: [String!] + token0_not_in: [String!] + token0_contains: String + token0_contains_nocase: String + token0_not_contains: String + token0_not_contains_nocase: String + token0_starts_with: String + token0_starts_with_nocase: String + token0_not_starts_with: String + token0_not_starts_with_nocase: String + token0_ends_with: String + token0_ends_with_nocase: String + token0_not_ends_with: String + token0_not_ends_with_nocase: String + token0_: Token_filter + token1: String + token1_not: String + token1_gt: String + token1_lt: String + token1_gte: String + token1_lte: String + token1_in: [String!] + token1_not_in: [String!] + token1_contains: String + token1_contains_nocase: String + token1_not_contains: String + token1_not_contains_nocase: String + token1_starts_with: String + token1_starts_with_nocase: String + token1_not_starts_with: String + token1_not_starts_with_nocase: String + token1_ends_with: String + token1_ends_with_nocase: String + token1_not_ends_with: String + token1_not_ends_with_nocase: String + token1_: Token_filter + feeTier: BigInt + feeTier_not: BigInt + feeTier_gt: BigInt + feeTier_lt: BigInt + feeTier_gte: BigInt + feeTier_lte: BigInt + feeTier_in: [BigInt!] + feeTier_not_in: [BigInt!] + liquidity: BigInt + liquidity_not: BigInt + liquidity_gt: BigInt + liquidity_lt: BigInt + liquidity_gte: BigInt + liquidity_lte: BigInt + liquidity_in: [BigInt!] + liquidity_not_in: [BigInt!] + sqrtPrice: BigInt + sqrtPrice_not: BigInt + sqrtPrice_gt: BigInt + sqrtPrice_lt: BigInt + sqrtPrice_gte: BigInt + sqrtPrice_lte: BigInt + sqrtPrice_in: [BigInt!] + sqrtPrice_not_in: [BigInt!] + feeGrowthGlobal0X128: BigInt + feeGrowthGlobal0X128_not: BigInt + feeGrowthGlobal0X128_gt: BigInt + feeGrowthGlobal0X128_lt: BigInt + feeGrowthGlobal0X128_gte: BigInt + feeGrowthGlobal0X128_lte: BigInt + feeGrowthGlobal0X128_in: [BigInt!] + feeGrowthGlobal0X128_not_in: [BigInt!] + feeGrowthGlobal1X128: BigInt + feeGrowthGlobal1X128_not: BigInt + feeGrowthGlobal1X128_gt: BigInt + feeGrowthGlobal1X128_lt: BigInt + feeGrowthGlobal1X128_gte: BigInt + feeGrowthGlobal1X128_lte: BigInt + feeGrowthGlobal1X128_in: [BigInt!] + feeGrowthGlobal1X128_not_in: [BigInt!] + token0Price: BigDecimal + token0Price_not: BigDecimal + token0Price_gt: BigDecimal + token0Price_lt: BigDecimal + token0Price_gte: BigDecimal + token0Price_lte: BigDecimal + token0Price_in: [BigDecimal!] + token0Price_not_in: [BigDecimal!] + token1Price: BigDecimal + token1Price_not: BigDecimal + token1Price_gt: BigDecimal + token1Price_lt: BigDecimal + token1Price_gte: BigDecimal + token1Price_lte: BigDecimal + token1Price_in: [BigDecimal!] + token1Price_not_in: [BigDecimal!] + tick: BigInt + tick_not: BigInt + tick_gt: BigInt + tick_lt: BigInt + tick_gte: BigInt + tick_lte: BigInt + tick_in: [BigInt!] + tick_not_in: [BigInt!] + observationIndex: BigInt + observationIndex_not: BigInt + observationIndex_gt: BigInt + observationIndex_lt: BigInt + observationIndex_gte: BigInt + observationIndex_lte: BigInt + observationIndex_in: [BigInt!] + observationIndex_not_in: [BigInt!] + volumeToken0: BigDecimal + volumeToken0_not: BigDecimal + volumeToken0_gt: BigDecimal + volumeToken0_lt: BigDecimal + volumeToken0_gte: BigDecimal + volumeToken0_lte: BigDecimal + volumeToken0_in: [BigDecimal!] + volumeToken0_not_in: [BigDecimal!] + volumeToken1: BigDecimal + volumeToken1_not: BigDecimal + volumeToken1_gt: BigDecimal + volumeToken1_lt: BigDecimal + volumeToken1_gte: BigDecimal + volumeToken1_lte: BigDecimal + volumeToken1_in: [BigDecimal!] + volumeToken1_not_in: [BigDecimal!] + volumeUSD: BigDecimal + volumeUSD_not: BigDecimal + volumeUSD_gt: BigDecimal + volumeUSD_lt: BigDecimal + volumeUSD_gte: BigDecimal + volumeUSD_lte: BigDecimal + volumeUSD_in: [BigDecimal!] + volumeUSD_not_in: [BigDecimal!] + untrackedVolumeUSD: BigDecimal + untrackedVolumeUSD_not: BigDecimal + untrackedVolumeUSD_gt: BigDecimal + untrackedVolumeUSD_lt: BigDecimal + untrackedVolumeUSD_gte: BigDecimal + untrackedVolumeUSD_lte: BigDecimal + untrackedVolumeUSD_in: [BigDecimal!] + untrackedVolumeUSD_not_in: [BigDecimal!] + feesUSD: BigDecimal + feesUSD_not: BigDecimal + feesUSD_gt: BigDecimal + feesUSD_lt: BigDecimal + feesUSD_gte: BigDecimal + feesUSD_lte: BigDecimal + feesUSD_in: [BigDecimal!] + feesUSD_not_in: [BigDecimal!] + txCount: BigInt + txCount_not: BigInt + txCount_gt: BigInt + txCount_lt: BigInt + txCount_gte: BigInt + txCount_lte: BigInt + txCount_in: [BigInt!] + txCount_not_in: [BigInt!] + collectedFeesToken0: BigDecimal + collectedFeesToken0_not: BigDecimal + collectedFeesToken0_gt: BigDecimal + collectedFeesToken0_lt: BigDecimal + collectedFeesToken0_gte: BigDecimal + collectedFeesToken0_lte: BigDecimal + collectedFeesToken0_in: [BigDecimal!] + collectedFeesToken0_not_in: [BigDecimal!] + collectedFeesToken1: BigDecimal + collectedFeesToken1_not: BigDecimal + collectedFeesToken1_gt: BigDecimal + collectedFeesToken1_lt: BigDecimal + collectedFeesToken1_gte: BigDecimal + collectedFeesToken1_lte: BigDecimal + collectedFeesToken1_in: [BigDecimal!] + collectedFeesToken1_not_in: [BigDecimal!] + collectedFeesUSD: BigDecimal + collectedFeesUSD_not: BigDecimal + collectedFeesUSD_gt: BigDecimal + collectedFeesUSD_lt: BigDecimal + collectedFeesUSD_gte: BigDecimal + collectedFeesUSD_lte: BigDecimal + collectedFeesUSD_in: [BigDecimal!] + collectedFeesUSD_not_in: [BigDecimal!] + totalValueLockedToken0: BigDecimal + totalValueLockedToken0_not: BigDecimal + totalValueLockedToken0_gt: BigDecimal + totalValueLockedToken0_lt: BigDecimal + totalValueLockedToken0_gte: BigDecimal + totalValueLockedToken0_lte: BigDecimal + totalValueLockedToken0_in: [BigDecimal!] + totalValueLockedToken0_not_in: [BigDecimal!] + totalValueLockedToken1: BigDecimal + totalValueLockedToken1_not: BigDecimal + totalValueLockedToken1_gt: BigDecimal + totalValueLockedToken1_lt: BigDecimal + totalValueLockedToken1_gte: BigDecimal + totalValueLockedToken1_lte: BigDecimal + totalValueLockedToken1_in: [BigDecimal!] + totalValueLockedToken1_not_in: [BigDecimal!] + totalValueLockedETH: BigDecimal + totalValueLockedETH_not: BigDecimal + totalValueLockedETH_gt: BigDecimal + totalValueLockedETH_lt: BigDecimal + totalValueLockedETH_gte: BigDecimal + totalValueLockedETH_lte: BigDecimal + totalValueLockedETH_in: [BigDecimal!] + totalValueLockedETH_not_in: [BigDecimal!] + totalValueLockedUSD: BigDecimal + totalValueLockedUSD_not: BigDecimal + totalValueLockedUSD_gt: BigDecimal + totalValueLockedUSD_lt: BigDecimal + totalValueLockedUSD_gte: BigDecimal + totalValueLockedUSD_lte: BigDecimal + totalValueLockedUSD_in: [BigDecimal!] + totalValueLockedUSD_not_in: [BigDecimal!] + totalValueLockedUSDUntracked: BigDecimal + totalValueLockedUSDUntracked_not: BigDecimal + totalValueLockedUSDUntracked_gt: BigDecimal + totalValueLockedUSDUntracked_lt: BigDecimal + totalValueLockedUSDUntracked_gte: BigDecimal + totalValueLockedUSDUntracked_lte: BigDecimal + totalValueLockedUSDUntracked_in: [BigDecimal!] + totalValueLockedUSDUntracked_not_in: [BigDecimal!] + isProtocolFeeEnabled: Boolean + isProtocolFeeEnabled_not: Boolean + isProtocolFeeEnabled_in: [Boolean!] + isProtocolFeeEnabled_not_in: [Boolean!] + liquidityProviderCount: BigInt + liquidityProviderCount_not: BigInt + liquidityProviderCount_gt: BigInt + liquidityProviderCount_lt: BigInt + liquidityProviderCount_gte: BigInt + liquidityProviderCount_lte: BigInt + liquidityProviderCount_in: [BigInt!] + liquidityProviderCount_not_in: [BigInt!] + poolHourData_: PoolHourData_filter + poolDayData_: PoolDayData_filter + mints_: Mint_filter + burns_: Burn_filter + swaps_: Swap_filter + collects_: Collect_filter + ticks_: Tick_filter + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Pool_filter] + or: [Pool_filter] +} + +enum Pool_orderBy { + id + createdAtTimestamp + createdAtBlockNumber + token0 + token0__id + token0__symbol + token0__name + token0__decimals + token0__totalSupply + token0__volume + token0__volumeUSD + token0__untrackedVolumeUSD + token0__feesUSD + token0__txCount + token0__poolCount + token0__totalValueLocked + token0__totalValueLockedUSD + token0__totalValueLockedUSDUntracked + token0__derivedETH + token1 + token1__id + token1__symbol + token1__name + token1__decimals + token1__totalSupply + token1__volume + token1__volumeUSD + token1__untrackedVolumeUSD + token1__feesUSD + token1__txCount + token1__poolCount + token1__totalValueLocked + token1__totalValueLockedUSD + token1__totalValueLockedUSDUntracked + token1__derivedETH + feeTier + liquidity + sqrtPrice + feeGrowthGlobal0X128 + feeGrowthGlobal1X128 + token0Price + token1Price + tick + observationIndex + volumeToken0 + volumeToken1 + volumeUSD + untrackedVolumeUSD + feesUSD + txCount + collectedFeesToken0 + collectedFeesToken1 + collectedFeesUSD + totalValueLockedToken0 + totalValueLockedToken1 + totalValueLockedETH + totalValueLockedUSD + totalValueLockedUSDUntracked + isProtocolFeeEnabled + liquidityProviderCount + poolHourData + poolDayData + mints + burns + swaps + collects + ticks +} + +type Position { + id: ID! + owner: Bytes! + pool: Pool! + token0: Token! + token1: Token! + tickLower: Tick! + tickUpper: Tick! + liquidity: BigInt! + depositedToken0: BigDecimal! + depositedToken1: BigDecimal! + withdrawnToken0: BigDecimal! + withdrawnToken1: BigDecimal! + collectedToken0: BigDecimal! + collectedToken1: BigDecimal! + collectedFeesToken0: BigDecimal! + collectedFeesToken1: BigDecimal! + amountDepositedUSD: BigDecimal! + amountWithdrawnUSD: BigDecimal! + amountCollectedUSD: BigDecimal! + transaction: Transaction! + feeGrowthInside0LastX128: BigInt! + feeGrowthInside1LastX128: BigInt! + increaseEvents(skip: Int = 0, first: Int = 100, orderBy: IncreaseEvent_orderBy, orderDirection: OrderDirection, where: IncreaseEvent_filter): [IncreaseEvent!]! + decreaseEvents(skip: Int = 0, first: Int = 100, orderBy: IncreaseEvent_orderBy, orderDirection: OrderDirection, where: IncreaseEvent_filter): [IncreaseEvent!]! +} + +type PositionSnapshot { + id: ID! + owner: Bytes! + pool: Pool! + position: Position! + blockNumber: BigInt! + timestamp: BigInt! + liquidity: BigInt! + depositedToken0: BigDecimal! + depositedToken1: BigDecimal! + withdrawnToken0: BigDecimal! + withdrawnToken1: BigDecimal! + collectedFeesToken0: BigDecimal! + collectedFeesToken1: BigDecimal! + transaction: Transaction! + feeGrowthInside0LastX128: BigInt! + feeGrowthInside1LastX128: BigInt! +} + +input PositionSnapshot_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + owner: Bytes + owner_not: Bytes + owner_gt: Bytes + owner_lt: Bytes + owner_gte: Bytes + owner_lte: Bytes + owner_in: [Bytes!] + owner_not_in: [Bytes!] + owner_contains: Bytes + owner_not_contains: Bytes + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + position: String + position_not: String + position_gt: String + position_lt: String + position_gte: String + position_lte: String + position_in: [String!] + position_not_in: [String!] + position_contains: String + position_contains_nocase: String + position_not_contains: String + position_not_contains_nocase: String + position_starts_with: String + position_starts_with_nocase: String + position_not_starts_with: String + position_not_starts_with_nocase: String + position_ends_with: String + position_ends_with_nocase: String + position_not_ends_with: String + position_not_ends_with_nocase: String + position_: Position_filter + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] + timestamp: BigInt + timestamp_not: BigInt + timestamp_gt: BigInt + timestamp_lt: BigInt + timestamp_gte: BigInt + timestamp_lte: BigInt + timestamp_in: [BigInt!] + timestamp_not_in: [BigInt!] + liquidity: BigInt + liquidity_not: BigInt + liquidity_gt: BigInt + liquidity_lt: BigInt + liquidity_gte: BigInt + liquidity_lte: BigInt + liquidity_in: [BigInt!] + liquidity_not_in: [BigInt!] + depositedToken0: BigDecimal + depositedToken0_not: BigDecimal + depositedToken0_gt: BigDecimal + depositedToken0_lt: BigDecimal + depositedToken0_gte: BigDecimal + depositedToken0_lte: BigDecimal + depositedToken0_in: [BigDecimal!] + depositedToken0_not_in: [BigDecimal!] + depositedToken1: BigDecimal + depositedToken1_not: BigDecimal + depositedToken1_gt: BigDecimal + depositedToken1_lt: BigDecimal + depositedToken1_gte: BigDecimal + depositedToken1_lte: BigDecimal + depositedToken1_in: [BigDecimal!] + depositedToken1_not_in: [BigDecimal!] + withdrawnToken0: BigDecimal + withdrawnToken0_not: BigDecimal + withdrawnToken0_gt: BigDecimal + withdrawnToken0_lt: BigDecimal + withdrawnToken0_gte: BigDecimal + withdrawnToken0_lte: BigDecimal + withdrawnToken0_in: [BigDecimal!] + withdrawnToken0_not_in: [BigDecimal!] + withdrawnToken1: BigDecimal + withdrawnToken1_not: BigDecimal + withdrawnToken1_gt: BigDecimal + withdrawnToken1_lt: BigDecimal + withdrawnToken1_gte: BigDecimal + withdrawnToken1_lte: BigDecimal + withdrawnToken1_in: [BigDecimal!] + withdrawnToken1_not_in: [BigDecimal!] + collectedFeesToken0: BigDecimal + collectedFeesToken0_not: BigDecimal + collectedFeesToken0_gt: BigDecimal + collectedFeesToken0_lt: BigDecimal + collectedFeesToken0_gte: BigDecimal + collectedFeesToken0_lte: BigDecimal + collectedFeesToken0_in: [BigDecimal!] + collectedFeesToken0_not_in: [BigDecimal!] + collectedFeesToken1: BigDecimal + collectedFeesToken1_not: BigDecimal + collectedFeesToken1_gt: BigDecimal + collectedFeesToken1_lt: BigDecimal + collectedFeesToken1_gte: BigDecimal + collectedFeesToken1_lte: BigDecimal + collectedFeesToken1_in: [BigDecimal!] + collectedFeesToken1_not_in: [BigDecimal!] + transaction: String + transaction_not: String + transaction_gt: String + transaction_lt: String + transaction_gte: String + transaction_lte: String + transaction_in: [String!] + transaction_not_in: [String!] + transaction_contains: String + transaction_contains_nocase: String + transaction_not_contains: String + transaction_not_contains_nocase: String + transaction_starts_with: String + transaction_starts_with_nocase: String + transaction_not_starts_with: String + transaction_not_starts_with_nocase: String + transaction_ends_with: String + transaction_ends_with_nocase: String + transaction_not_ends_with: String + transaction_not_ends_with_nocase: String + transaction_: Transaction_filter + feeGrowthInside0LastX128: BigInt + feeGrowthInside0LastX128_not: BigInt + feeGrowthInside0LastX128_gt: BigInt + feeGrowthInside0LastX128_lt: BigInt + feeGrowthInside0LastX128_gte: BigInt + feeGrowthInside0LastX128_lte: BigInt + feeGrowthInside0LastX128_in: [BigInt!] + feeGrowthInside0LastX128_not_in: [BigInt!] + feeGrowthInside1LastX128: BigInt + feeGrowthInside1LastX128_not: BigInt + feeGrowthInside1LastX128_gt: BigInt + feeGrowthInside1LastX128_lt: BigInt + feeGrowthInside1LastX128_gte: BigInt + feeGrowthInside1LastX128_lte: BigInt + feeGrowthInside1LastX128_in: [BigInt!] + feeGrowthInside1LastX128_not_in: [BigInt!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [PositionSnapshot_filter] + or: [PositionSnapshot_filter] +} + +enum PositionSnapshot_orderBy { + id + owner + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + position + position__id + position__owner + position__liquidity + position__depositedToken0 + position__depositedToken1 + position__withdrawnToken0 + position__withdrawnToken1 + position__collectedToken0 + position__collectedToken1 + position__collectedFeesToken0 + position__collectedFeesToken1 + position__amountDepositedUSD + position__amountWithdrawnUSD + position__amountCollectedUSD + position__feeGrowthInside0LastX128 + position__feeGrowthInside1LastX128 + blockNumber + timestamp + liquidity + depositedToken0 + depositedToken1 + withdrawnToken0 + withdrawnToken1 + collectedFeesToken0 + collectedFeesToken1 + transaction + transaction__id + transaction__blockNumber + transaction__timestamp + transaction__gasUsed + transaction__gasPrice + feeGrowthInside0LastX128 + feeGrowthInside1LastX128 +} + +input Position_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + owner: Bytes + owner_not: Bytes + owner_gt: Bytes + owner_lt: Bytes + owner_gte: Bytes + owner_lte: Bytes + owner_in: [Bytes!] + owner_not_in: [Bytes!] + owner_contains: Bytes + owner_not_contains: Bytes + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + token0: String + token0_not: String + token0_gt: String + token0_lt: String + token0_gte: String + token0_lte: String + token0_in: [String!] + token0_not_in: [String!] + token0_contains: String + token0_contains_nocase: String + token0_not_contains: String + token0_not_contains_nocase: String + token0_starts_with: String + token0_starts_with_nocase: String + token0_not_starts_with: String + token0_not_starts_with_nocase: String + token0_ends_with: String + token0_ends_with_nocase: String + token0_not_ends_with: String + token0_not_ends_with_nocase: String + token0_: Token_filter + token1: String + token1_not: String + token1_gt: String + token1_lt: String + token1_gte: String + token1_lte: String + token1_in: [String!] + token1_not_in: [String!] + token1_contains: String + token1_contains_nocase: String + token1_not_contains: String + token1_not_contains_nocase: String + token1_starts_with: String + token1_starts_with_nocase: String + token1_not_starts_with: String + token1_not_starts_with_nocase: String + token1_ends_with: String + token1_ends_with_nocase: String + token1_not_ends_with: String + token1_not_ends_with_nocase: String + token1_: Token_filter + tickLower: String + tickLower_not: String + tickLower_gt: String + tickLower_lt: String + tickLower_gte: String + tickLower_lte: String + tickLower_in: [String!] + tickLower_not_in: [String!] + tickLower_contains: String + tickLower_contains_nocase: String + tickLower_not_contains: String + tickLower_not_contains_nocase: String + tickLower_starts_with: String + tickLower_starts_with_nocase: String + tickLower_not_starts_with: String + tickLower_not_starts_with_nocase: String + tickLower_ends_with: String + tickLower_ends_with_nocase: String + tickLower_not_ends_with: String + tickLower_not_ends_with_nocase: String + tickLower_: Tick_filter + tickUpper: String + tickUpper_not: String + tickUpper_gt: String + tickUpper_lt: String + tickUpper_gte: String + tickUpper_lte: String + tickUpper_in: [String!] + tickUpper_not_in: [String!] + tickUpper_contains: String + tickUpper_contains_nocase: String + tickUpper_not_contains: String + tickUpper_not_contains_nocase: String + tickUpper_starts_with: String + tickUpper_starts_with_nocase: String + tickUpper_not_starts_with: String + tickUpper_not_starts_with_nocase: String + tickUpper_ends_with: String + tickUpper_ends_with_nocase: String + tickUpper_not_ends_with: String + tickUpper_not_ends_with_nocase: String + tickUpper_: Tick_filter + liquidity: BigInt + liquidity_not: BigInt + liquidity_gt: BigInt + liquidity_lt: BigInt + liquidity_gte: BigInt + liquidity_lte: BigInt + liquidity_in: [BigInt!] + liquidity_not_in: [BigInt!] + depositedToken0: BigDecimal + depositedToken0_not: BigDecimal + depositedToken0_gt: BigDecimal + depositedToken0_lt: BigDecimal + depositedToken0_gte: BigDecimal + depositedToken0_lte: BigDecimal + depositedToken0_in: [BigDecimal!] + depositedToken0_not_in: [BigDecimal!] + depositedToken1: BigDecimal + depositedToken1_not: BigDecimal + depositedToken1_gt: BigDecimal + depositedToken1_lt: BigDecimal + depositedToken1_gte: BigDecimal + depositedToken1_lte: BigDecimal + depositedToken1_in: [BigDecimal!] + depositedToken1_not_in: [BigDecimal!] + withdrawnToken0: BigDecimal + withdrawnToken0_not: BigDecimal + withdrawnToken0_gt: BigDecimal + withdrawnToken0_lt: BigDecimal + withdrawnToken0_gte: BigDecimal + withdrawnToken0_lte: BigDecimal + withdrawnToken0_in: [BigDecimal!] + withdrawnToken0_not_in: [BigDecimal!] + withdrawnToken1: BigDecimal + withdrawnToken1_not: BigDecimal + withdrawnToken1_gt: BigDecimal + withdrawnToken1_lt: BigDecimal + withdrawnToken1_gte: BigDecimal + withdrawnToken1_lte: BigDecimal + withdrawnToken1_in: [BigDecimal!] + withdrawnToken1_not_in: [BigDecimal!] + collectedToken0: BigDecimal + collectedToken0_not: BigDecimal + collectedToken0_gt: BigDecimal + collectedToken0_lt: BigDecimal + collectedToken0_gte: BigDecimal + collectedToken0_lte: BigDecimal + collectedToken0_in: [BigDecimal!] + collectedToken0_not_in: [BigDecimal!] + collectedToken1: BigDecimal + collectedToken1_not: BigDecimal + collectedToken1_gt: BigDecimal + collectedToken1_lt: BigDecimal + collectedToken1_gte: BigDecimal + collectedToken1_lte: BigDecimal + collectedToken1_in: [BigDecimal!] + collectedToken1_not_in: [BigDecimal!] + collectedFeesToken0: BigDecimal + collectedFeesToken0_not: BigDecimal + collectedFeesToken0_gt: BigDecimal + collectedFeesToken0_lt: BigDecimal + collectedFeesToken0_gte: BigDecimal + collectedFeesToken0_lte: BigDecimal + collectedFeesToken0_in: [BigDecimal!] + collectedFeesToken0_not_in: [BigDecimal!] + collectedFeesToken1: BigDecimal + collectedFeesToken1_not: BigDecimal + collectedFeesToken1_gt: BigDecimal + collectedFeesToken1_lt: BigDecimal + collectedFeesToken1_gte: BigDecimal + collectedFeesToken1_lte: BigDecimal + collectedFeesToken1_in: [BigDecimal!] + collectedFeesToken1_not_in: [BigDecimal!] + amountDepositedUSD: BigDecimal + amountDepositedUSD_not: BigDecimal + amountDepositedUSD_gt: BigDecimal + amountDepositedUSD_lt: BigDecimal + amountDepositedUSD_gte: BigDecimal + amountDepositedUSD_lte: BigDecimal + amountDepositedUSD_in: [BigDecimal!] + amountDepositedUSD_not_in: [BigDecimal!] + amountWithdrawnUSD: BigDecimal + amountWithdrawnUSD_not: BigDecimal + amountWithdrawnUSD_gt: BigDecimal + amountWithdrawnUSD_lt: BigDecimal + amountWithdrawnUSD_gte: BigDecimal + amountWithdrawnUSD_lte: BigDecimal + amountWithdrawnUSD_in: [BigDecimal!] + amountWithdrawnUSD_not_in: [BigDecimal!] + amountCollectedUSD: BigDecimal + amountCollectedUSD_not: BigDecimal + amountCollectedUSD_gt: BigDecimal + amountCollectedUSD_lt: BigDecimal + amountCollectedUSD_gte: BigDecimal + amountCollectedUSD_lte: BigDecimal + amountCollectedUSD_in: [BigDecimal!] + amountCollectedUSD_not_in: [BigDecimal!] + transaction: String + transaction_not: String + transaction_gt: String + transaction_lt: String + transaction_gte: String + transaction_lte: String + transaction_in: [String!] + transaction_not_in: [String!] + transaction_contains: String + transaction_contains_nocase: String + transaction_not_contains: String + transaction_not_contains_nocase: String + transaction_starts_with: String + transaction_starts_with_nocase: String + transaction_not_starts_with: String + transaction_not_starts_with_nocase: String + transaction_ends_with: String + transaction_ends_with_nocase: String + transaction_not_ends_with: String + transaction_not_ends_with_nocase: String + transaction_: Transaction_filter + feeGrowthInside0LastX128: BigInt + feeGrowthInside0LastX128_not: BigInt + feeGrowthInside0LastX128_gt: BigInt + feeGrowthInside0LastX128_lt: BigInt + feeGrowthInside0LastX128_gte: BigInt + feeGrowthInside0LastX128_lte: BigInt + feeGrowthInside0LastX128_in: [BigInt!] + feeGrowthInside0LastX128_not_in: [BigInt!] + feeGrowthInside1LastX128: BigInt + feeGrowthInside1LastX128_not: BigInt + feeGrowthInside1LastX128_gt: BigInt + feeGrowthInside1LastX128_lt: BigInt + feeGrowthInside1LastX128_gte: BigInt + feeGrowthInside1LastX128_lte: BigInt + feeGrowthInside1LastX128_in: [BigInt!] + feeGrowthInside1LastX128_not_in: [BigInt!] + increaseEvents_: IncreaseEvent_filter + decreaseEvents_: IncreaseEvent_filter + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Position_filter] + or: [Position_filter] +} + +enum Position_orderBy { + id + owner + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + token0 + token0__id + token0__symbol + token0__name + token0__decimals + token0__totalSupply + token0__volume + token0__volumeUSD + token0__untrackedVolumeUSD + token0__feesUSD + token0__txCount + token0__poolCount + token0__totalValueLocked + token0__totalValueLockedUSD + token0__totalValueLockedUSDUntracked + token0__derivedETH + token1 + token1__id + token1__symbol + token1__name + token1__decimals + token1__totalSupply + token1__volume + token1__volumeUSD + token1__untrackedVolumeUSD + token1__feesUSD + token1__txCount + token1__poolCount + token1__totalValueLocked + token1__totalValueLockedUSD + token1__totalValueLockedUSDUntracked + token1__derivedETH + tickLower + tickLower__id + tickLower__poolAddress + tickLower__tickIdx + tickLower__liquidityGross + tickLower__liquidityNet + tickLower__price0 + tickLower__price1 + tickLower__volumeToken0 + tickLower__volumeToken1 + tickLower__volumeUSD + tickLower__untrackedVolumeUSD + tickLower__feesUSD + tickLower__collectedFeesToken0 + tickLower__collectedFeesToken1 + tickLower__collectedFeesUSD + tickLower__createdAtTimestamp + tickLower__createdAtBlockNumber + tickLower__liquidityProviderCount + tickLower__feeGrowthOutside0X128 + tickLower__feeGrowthOutside1X128 + tickUpper + tickUpper__id + tickUpper__poolAddress + tickUpper__tickIdx + tickUpper__liquidityGross + tickUpper__liquidityNet + tickUpper__price0 + tickUpper__price1 + tickUpper__volumeToken0 + tickUpper__volumeToken1 + tickUpper__volumeUSD + tickUpper__untrackedVolumeUSD + tickUpper__feesUSD + tickUpper__collectedFeesToken0 + tickUpper__collectedFeesToken1 + tickUpper__collectedFeesUSD + tickUpper__createdAtTimestamp + tickUpper__createdAtBlockNumber + tickUpper__liquidityProviderCount + tickUpper__feeGrowthOutside0X128 + tickUpper__feeGrowthOutside1X128 + liquidity + depositedToken0 + depositedToken1 + withdrawnToken0 + withdrawnToken1 + collectedToken0 + collectedToken1 + collectedFeesToken0 + collectedFeesToken1 + amountDepositedUSD + amountWithdrawnUSD + amountCollectedUSD + transaction + transaction__id + transaction__blockNumber + transaction__timestamp + transaction__gasUsed + transaction__gasPrice + feeGrowthInside0LastX128 + feeGrowthInside1LastX128 + increaseEvents + decreaseEvents +} + +type Query { + factory( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Factory + factories( + skip: Int = 0 + first: Int = 100 + orderBy: Factory_orderBy + orderDirection: OrderDirection + where: Factory_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Factory!]! + bundle( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Bundle + bundles( + skip: Int = 0 + first: Int = 100 + orderBy: Bundle_orderBy + orderDirection: OrderDirection + where: Bundle_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Bundle!]! + token( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Token + tokens( + skip: Int = 0 + first: Int = 100 + orderBy: Token_orderBy + orderDirection: OrderDirection + where: Token_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Token!]! + pool( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Pool + pools( + skip: Int = 0 + first: Int = 100 + orderBy: Pool_orderBy + orderDirection: OrderDirection + where: Pool_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Pool!]! + tick( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Tick + ticks( + skip: Int = 0 + first: Int = 100 + orderBy: Tick_orderBy + orderDirection: OrderDirection + where: Tick_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Tick!]! + position( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Position + positions( + skip: Int = 0 + first: Int = 100 + orderBy: Position_orderBy + orderDirection: OrderDirection + where: Position_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Position!]! + positionSnapshot( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PositionSnapshot + positionSnapshots( + skip: Int = 0 + first: Int = 100 + orderBy: PositionSnapshot_orderBy + orderDirection: OrderDirection + where: PositionSnapshot_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PositionSnapshot!]! + transaction( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Transaction + transactions( + skip: Int = 0 + first: Int = 100 + orderBy: Transaction_orderBy + orderDirection: OrderDirection + where: Transaction_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Transaction!]! + mint( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Mint + mints( + skip: Int = 0 + first: Int = 100 + orderBy: Mint_orderBy + orderDirection: OrderDirection + where: Mint_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Mint!]! + burn( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Burn + burns( + skip: Int = 0 + first: Int = 100 + orderBy: Burn_orderBy + orderDirection: OrderDirection + where: Burn_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Burn!]! + swap( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Swap + swaps( + skip: Int = 0 + first: Int = 100 + orderBy: Swap_orderBy + orderDirection: OrderDirection + where: Swap_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Swap!]! + collect( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Collect + collects( + skip: Int = 0 + first: Int = 100 + orderBy: Collect_orderBy + orderDirection: OrderDirection + where: Collect_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Collect!]! + flash( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Flash + flashes( + skip: Int = 0 + first: Int = 100 + orderBy: Flash_orderBy + orderDirection: OrderDirection + where: Flash_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Flash!]! + uniswapDayData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): UniswapDayData + uniswapDayDatas( + skip: Int = 0 + first: Int = 100 + orderBy: UniswapDayData_orderBy + orderDirection: OrderDirection + where: UniswapDayData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [UniswapDayData!]! + poolDayData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PoolDayData + poolDayDatas( + skip: Int = 0 + first: Int = 100 + orderBy: PoolDayData_orderBy + orderDirection: OrderDirection + where: PoolDayData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PoolDayData!]! + poolHourData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PoolHourData + poolHourDatas( + skip: Int = 0 + first: Int = 100 + orderBy: PoolHourData_orderBy + orderDirection: OrderDirection + where: PoolHourData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PoolHourData!]! + tickHourData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): TickHourData + tickHourDatas( + skip: Int = 0 + first: Int = 100 + orderBy: TickHourData_orderBy + orderDirection: OrderDirection + where: TickHourData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [TickHourData!]! + tickDayData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): TickDayData + tickDayDatas( + skip: Int = 0 + first: Int = 100 + orderBy: TickDayData_orderBy + orderDirection: OrderDirection + where: TickDayData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [TickDayData!]! + tokenDayData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): TokenDayData + tokenDayDatas( + skip: Int = 0 + first: Int = 100 + orderBy: TokenDayData_orderBy + orderDirection: OrderDirection + where: TokenDayData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [TokenDayData!]! + tokenHourData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): TokenHourData + tokenHourDatas( + skip: Int = 0 + first: Int = 100 + orderBy: TokenHourData_orderBy + orderDirection: OrderDirection + where: TokenHourData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [TokenHourData!]! + increaseEvent( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): IncreaseEvent + increaseEvents( + skip: Int = 0 + first: Int = 100 + orderBy: IncreaseEvent_orderBy + orderDirection: OrderDirection + where: IncreaseEvent_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [IncreaseEvent!]! + decreaseEvent( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): DecreaseEvent + decreaseEvents( + skip: Int = 0 + first: Int = 100 + orderBy: DecreaseEvent_orderBy + orderDirection: OrderDirection + where: DecreaseEvent_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [DecreaseEvent!]! + setProtocolFeeEvent( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): SetProtocolFeeEvent + setProtocolFeeEvents( + skip: Int = 0 + first: Int = 100 + orderBy: SetProtocolFeeEvent_orderBy + orderDirection: OrderDirection + where: SetProtocolFeeEvent_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [SetProtocolFeeEvent!]! + + """Access to subgraph metadata""" + _meta(block: Block_height): _Meta_ +} + +type SetProtocolFeeEvent { + id: ID! + pool: Pool! + logIndex: BigInt! + new0: BigInt! + new1: BigInt! + old0: BigInt! + old1: BigInt! + timestamp: BigInt! +} + +input SetProtocolFeeEvent_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + logIndex: BigInt + logIndex_not: BigInt + logIndex_gt: BigInt + logIndex_lt: BigInt + logIndex_gte: BigInt + logIndex_lte: BigInt + logIndex_in: [BigInt!] + logIndex_not_in: [BigInt!] + new0: BigInt + new0_not: BigInt + new0_gt: BigInt + new0_lt: BigInt + new0_gte: BigInt + new0_lte: BigInt + new0_in: [BigInt!] + new0_not_in: [BigInt!] + new1: BigInt + new1_not: BigInt + new1_gt: BigInt + new1_lt: BigInt + new1_gte: BigInt + new1_lte: BigInt + new1_in: [BigInt!] + new1_not_in: [BigInt!] + old0: BigInt + old0_not: BigInt + old0_gt: BigInt + old0_lt: BigInt + old0_gte: BigInt + old0_lte: BigInt + old0_in: [BigInt!] + old0_not_in: [BigInt!] + old1: BigInt + old1_not: BigInt + old1_gt: BigInt + old1_lt: BigInt + old1_gte: BigInt + old1_lte: BigInt + old1_in: [BigInt!] + old1_not_in: [BigInt!] + timestamp: BigInt + timestamp_not: BigInt + timestamp_gt: BigInt + timestamp_lt: BigInt + timestamp_gte: BigInt + timestamp_lte: BigInt + timestamp_in: [BigInt!] + timestamp_not_in: [BigInt!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [SetProtocolFeeEvent_filter] + or: [SetProtocolFeeEvent_filter] +} + +enum SetProtocolFeeEvent_orderBy { + id + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + logIndex + new0 + new1 + old0 + old1 + timestamp +} + +type Subscription { + factory( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Factory + factories( + skip: Int = 0 + first: Int = 100 + orderBy: Factory_orderBy + orderDirection: OrderDirection + where: Factory_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Factory!]! + bundle( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Bundle + bundles( + skip: Int = 0 + first: Int = 100 + orderBy: Bundle_orderBy + orderDirection: OrderDirection + where: Bundle_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Bundle!]! + token( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Token + tokens( + skip: Int = 0 + first: Int = 100 + orderBy: Token_orderBy + orderDirection: OrderDirection + where: Token_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Token!]! + pool( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Pool + pools( + skip: Int = 0 + first: Int = 100 + orderBy: Pool_orderBy + orderDirection: OrderDirection + where: Pool_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Pool!]! + tick( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Tick + ticks( + skip: Int = 0 + first: Int = 100 + orderBy: Tick_orderBy + orderDirection: OrderDirection + where: Tick_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Tick!]! + position( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Position + positions( + skip: Int = 0 + first: Int = 100 + orderBy: Position_orderBy + orderDirection: OrderDirection + where: Position_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Position!]! + positionSnapshot( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PositionSnapshot + positionSnapshots( + skip: Int = 0 + first: Int = 100 + orderBy: PositionSnapshot_orderBy + orderDirection: OrderDirection + where: PositionSnapshot_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PositionSnapshot!]! + transaction( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Transaction + transactions( + skip: Int = 0 + first: Int = 100 + orderBy: Transaction_orderBy + orderDirection: OrderDirection + where: Transaction_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Transaction!]! + mint( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Mint + mints( + skip: Int = 0 + first: Int = 100 + orderBy: Mint_orderBy + orderDirection: OrderDirection + where: Mint_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Mint!]! + burn( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Burn + burns( + skip: Int = 0 + first: Int = 100 + orderBy: Burn_orderBy + orderDirection: OrderDirection + where: Burn_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Burn!]! + swap( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Swap + swaps( + skip: Int = 0 + first: Int = 100 + orderBy: Swap_orderBy + orderDirection: OrderDirection + where: Swap_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Swap!]! + collect( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Collect + collects( + skip: Int = 0 + first: Int = 100 + orderBy: Collect_orderBy + orderDirection: OrderDirection + where: Collect_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Collect!]! + flash( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): Flash + flashes( + skip: Int = 0 + first: Int = 100 + orderBy: Flash_orderBy + orderDirection: OrderDirection + where: Flash_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [Flash!]! + uniswapDayData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): UniswapDayData + uniswapDayDatas( + skip: Int = 0 + first: Int = 100 + orderBy: UniswapDayData_orderBy + orderDirection: OrderDirection + where: UniswapDayData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [UniswapDayData!]! + poolDayData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PoolDayData + poolDayDatas( + skip: Int = 0 + first: Int = 100 + orderBy: PoolDayData_orderBy + orderDirection: OrderDirection + where: PoolDayData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PoolDayData!]! + poolHourData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PoolHourData + poolHourDatas( + skip: Int = 0 + first: Int = 100 + orderBy: PoolHourData_orderBy + orderDirection: OrderDirection + where: PoolHourData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PoolHourData!]! + tickHourData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): TickHourData + tickHourDatas( + skip: Int = 0 + first: Int = 100 + orderBy: TickHourData_orderBy + orderDirection: OrderDirection + where: TickHourData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [TickHourData!]! + tickDayData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): TickDayData + tickDayDatas( + skip: Int = 0 + first: Int = 100 + orderBy: TickDayData_orderBy + orderDirection: OrderDirection + where: TickDayData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [TickDayData!]! + tokenDayData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): TokenDayData + tokenDayDatas( + skip: Int = 0 + first: Int = 100 + orderBy: TokenDayData_orderBy + orderDirection: OrderDirection + where: TokenDayData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [TokenDayData!]! + tokenHourData( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): TokenHourData + tokenHourDatas( + skip: Int = 0 + first: Int = 100 + orderBy: TokenHourData_orderBy + orderDirection: OrderDirection + where: TokenHourData_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [TokenHourData!]! + increaseEvent( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): IncreaseEvent + increaseEvents( + skip: Int = 0 + first: Int = 100 + orderBy: IncreaseEvent_orderBy + orderDirection: OrderDirection + where: IncreaseEvent_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [IncreaseEvent!]! + decreaseEvent( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): DecreaseEvent + decreaseEvents( + skip: Int = 0 + first: Int = 100 + orderBy: DecreaseEvent_orderBy + orderDirection: OrderDirection + where: DecreaseEvent_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [DecreaseEvent!]! + setProtocolFeeEvent( + id: ID! + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): SetProtocolFeeEvent + setProtocolFeeEvents( + skip: Int = 0 + first: Int = 100 + orderBy: SetProtocolFeeEvent_orderBy + orderDirection: OrderDirection + where: SetProtocolFeeEvent_filter + + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [SetProtocolFeeEvent!]! + + """Access to subgraph metadata""" + _meta(block: Block_height): _Meta_ +} + +type Swap { + id: ID! + transaction: Transaction! + timestamp: BigInt! + pool: Pool! + token0: Token! + token1: Token! + sender: Bytes! + recipient: Bytes! + origin: Bytes! + amount0: BigDecimal! + amount1: BigDecimal! + amountUSD: BigDecimal! + sqrtPriceX96: BigInt! + tick: BigInt! + logIndex: BigInt +} + +input Swap_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + transaction: String + transaction_not: String + transaction_gt: String + transaction_lt: String + transaction_gte: String + transaction_lte: String + transaction_in: [String!] + transaction_not_in: [String!] + transaction_contains: String + transaction_contains_nocase: String + transaction_not_contains: String + transaction_not_contains_nocase: String + transaction_starts_with: String + transaction_starts_with_nocase: String + transaction_not_starts_with: String + transaction_not_starts_with_nocase: String + transaction_ends_with: String + transaction_ends_with_nocase: String + transaction_not_ends_with: String + transaction_not_ends_with_nocase: String + transaction_: Transaction_filter + timestamp: BigInt + timestamp_not: BigInt + timestamp_gt: BigInt + timestamp_lt: BigInt + timestamp_gte: BigInt + timestamp_lte: BigInt + timestamp_in: [BigInt!] + timestamp_not_in: [BigInt!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + token0: String + token0_not: String + token0_gt: String + token0_lt: String + token0_gte: String + token0_lte: String + token0_in: [String!] + token0_not_in: [String!] + token0_contains: String + token0_contains_nocase: String + token0_not_contains: String + token0_not_contains_nocase: String + token0_starts_with: String + token0_starts_with_nocase: String + token0_not_starts_with: String + token0_not_starts_with_nocase: String + token0_ends_with: String + token0_ends_with_nocase: String + token0_not_ends_with: String + token0_not_ends_with_nocase: String + token0_: Token_filter + token1: String + token1_not: String + token1_gt: String + token1_lt: String + token1_gte: String + token1_lte: String + token1_in: [String!] + token1_not_in: [String!] + token1_contains: String + token1_contains_nocase: String + token1_not_contains: String + token1_not_contains_nocase: String + token1_starts_with: String + token1_starts_with_nocase: String + token1_not_starts_with: String + token1_not_starts_with_nocase: String + token1_ends_with: String + token1_ends_with_nocase: String + token1_not_ends_with: String + token1_not_ends_with_nocase: String + token1_: Token_filter + sender: Bytes + sender_not: Bytes + sender_gt: Bytes + sender_lt: Bytes + sender_gte: Bytes + sender_lte: Bytes + sender_in: [Bytes!] + sender_not_in: [Bytes!] + sender_contains: Bytes + sender_not_contains: Bytes + recipient: Bytes + recipient_not: Bytes + recipient_gt: Bytes + recipient_lt: Bytes + recipient_gte: Bytes + recipient_lte: Bytes + recipient_in: [Bytes!] + recipient_not_in: [Bytes!] + recipient_contains: Bytes + recipient_not_contains: Bytes + origin: Bytes + origin_not: Bytes + origin_gt: Bytes + origin_lt: Bytes + origin_gte: Bytes + origin_lte: Bytes + origin_in: [Bytes!] + origin_not_in: [Bytes!] + origin_contains: Bytes + origin_not_contains: Bytes + amount0: BigDecimal + amount0_not: BigDecimal + amount0_gt: BigDecimal + amount0_lt: BigDecimal + amount0_gte: BigDecimal + amount0_lte: BigDecimal + amount0_in: [BigDecimal!] + amount0_not_in: [BigDecimal!] + amount1: BigDecimal + amount1_not: BigDecimal + amount1_gt: BigDecimal + amount1_lt: BigDecimal + amount1_gte: BigDecimal + amount1_lte: BigDecimal + amount1_in: [BigDecimal!] + amount1_not_in: [BigDecimal!] + amountUSD: BigDecimal + amountUSD_not: BigDecimal + amountUSD_gt: BigDecimal + amountUSD_lt: BigDecimal + amountUSD_gte: BigDecimal + amountUSD_lte: BigDecimal + amountUSD_in: [BigDecimal!] + amountUSD_not_in: [BigDecimal!] + sqrtPriceX96: BigInt + sqrtPriceX96_not: BigInt + sqrtPriceX96_gt: BigInt + sqrtPriceX96_lt: BigInt + sqrtPriceX96_gte: BigInt + sqrtPriceX96_lte: BigInt + sqrtPriceX96_in: [BigInt!] + sqrtPriceX96_not_in: [BigInt!] + tick: BigInt + tick_not: BigInt + tick_gt: BigInt + tick_lt: BigInt + tick_gte: BigInt + tick_lte: BigInt + tick_in: [BigInt!] + tick_not_in: [BigInt!] + logIndex: BigInt + logIndex_not: BigInt + logIndex_gt: BigInt + logIndex_lt: BigInt + logIndex_gte: BigInt + logIndex_lte: BigInt + logIndex_in: [BigInt!] + logIndex_not_in: [BigInt!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Swap_filter] + or: [Swap_filter] +} + +enum Swap_orderBy { + id + transaction + transaction__id + transaction__blockNumber + transaction__timestamp + transaction__gasUsed + transaction__gasPrice + timestamp + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + token0 + token0__id + token0__symbol + token0__name + token0__decimals + token0__totalSupply + token0__volume + token0__volumeUSD + token0__untrackedVolumeUSD + token0__feesUSD + token0__txCount + token0__poolCount + token0__totalValueLocked + token0__totalValueLockedUSD + token0__totalValueLockedUSDUntracked + token0__derivedETH + token1 + token1__id + token1__symbol + token1__name + token1__decimals + token1__totalSupply + token1__volume + token1__volumeUSD + token1__untrackedVolumeUSD + token1__feesUSD + token1__txCount + token1__poolCount + token1__totalValueLocked + token1__totalValueLockedUSD + token1__totalValueLockedUSDUntracked + token1__derivedETH + sender + recipient + origin + amount0 + amount1 + amountUSD + sqrtPriceX96 + tick + logIndex +} + +type Tick { + id: ID! + poolAddress: String + tickIdx: BigInt! + pool: Pool! + liquidityGross: BigInt! + liquidityNet: BigInt! + price0: BigDecimal! + price1: BigDecimal! + volumeToken0: BigDecimal! + volumeToken1: BigDecimal! + volumeUSD: BigDecimal! + untrackedVolumeUSD: BigDecimal! + feesUSD: BigDecimal! + collectedFeesToken0: BigDecimal! + collectedFeesToken1: BigDecimal! + collectedFeesUSD: BigDecimal! + createdAtTimestamp: BigInt! + createdAtBlockNumber: BigInt! + liquidityProviderCount: BigInt! + feeGrowthOutside0X128: BigInt! + feeGrowthOutside1X128: BigInt! +} + +type TickDayData { + id: ID! + date: Int! + pool: Pool! + tick: Tick! + liquidityGross: BigInt! + liquidityNet: BigInt! + volumeToken0: BigDecimal! + volumeToken1: BigDecimal! + volumeUSD: BigDecimal! + feesUSD: BigDecimal! + feeGrowthOutside0X128: BigInt! + feeGrowthOutside1X128: BigInt! +} + +input TickDayData_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + date: Int + date_not: Int + date_gt: Int + date_lt: Int + date_gte: Int + date_lte: Int + date_in: [Int!] + date_not_in: [Int!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + tick: String + tick_not: String + tick_gt: String + tick_lt: String + tick_gte: String + tick_lte: String + tick_in: [String!] + tick_not_in: [String!] + tick_contains: String + tick_contains_nocase: String + tick_not_contains: String + tick_not_contains_nocase: String + tick_starts_with: String + tick_starts_with_nocase: String + tick_not_starts_with: String + tick_not_starts_with_nocase: String + tick_ends_with: String + tick_ends_with_nocase: String + tick_not_ends_with: String + tick_not_ends_with_nocase: String + tick_: Tick_filter + liquidityGross: BigInt + liquidityGross_not: BigInt + liquidityGross_gt: BigInt + liquidityGross_lt: BigInt + liquidityGross_gte: BigInt + liquidityGross_lte: BigInt + liquidityGross_in: [BigInt!] + liquidityGross_not_in: [BigInt!] + liquidityNet: BigInt + liquidityNet_not: BigInt + liquidityNet_gt: BigInt + liquidityNet_lt: BigInt + liquidityNet_gte: BigInt + liquidityNet_lte: BigInt + liquidityNet_in: [BigInt!] + liquidityNet_not_in: [BigInt!] + volumeToken0: BigDecimal + volumeToken0_not: BigDecimal + volumeToken0_gt: BigDecimal + volumeToken0_lt: BigDecimal + volumeToken0_gte: BigDecimal + volumeToken0_lte: BigDecimal + volumeToken0_in: [BigDecimal!] + volumeToken0_not_in: [BigDecimal!] + volumeToken1: BigDecimal + volumeToken1_not: BigDecimal + volumeToken1_gt: BigDecimal + volumeToken1_lt: BigDecimal + volumeToken1_gte: BigDecimal + volumeToken1_lte: BigDecimal + volumeToken1_in: [BigDecimal!] + volumeToken1_not_in: [BigDecimal!] + volumeUSD: BigDecimal + volumeUSD_not: BigDecimal + volumeUSD_gt: BigDecimal + volumeUSD_lt: BigDecimal + volumeUSD_gte: BigDecimal + volumeUSD_lte: BigDecimal + volumeUSD_in: [BigDecimal!] + volumeUSD_not_in: [BigDecimal!] + feesUSD: BigDecimal + feesUSD_not: BigDecimal + feesUSD_gt: BigDecimal + feesUSD_lt: BigDecimal + feesUSD_gte: BigDecimal + feesUSD_lte: BigDecimal + feesUSD_in: [BigDecimal!] + feesUSD_not_in: [BigDecimal!] + feeGrowthOutside0X128: BigInt + feeGrowthOutside0X128_not: BigInt + feeGrowthOutside0X128_gt: BigInt + feeGrowthOutside0X128_lt: BigInt + feeGrowthOutside0X128_gte: BigInt + feeGrowthOutside0X128_lte: BigInt + feeGrowthOutside0X128_in: [BigInt!] + feeGrowthOutside0X128_not_in: [BigInt!] + feeGrowthOutside1X128: BigInt + feeGrowthOutside1X128_not: BigInt + feeGrowthOutside1X128_gt: BigInt + feeGrowthOutside1X128_lt: BigInt + feeGrowthOutside1X128_gte: BigInt + feeGrowthOutside1X128_lte: BigInt + feeGrowthOutside1X128_in: [BigInt!] + feeGrowthOutside1X128_not_in: [BigInt!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [TickDayData_filter] + or: [TickDayData_filter] +} + +enum TickDayData_orderBy { + id + date + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + tick + tick__id + tick__poolAddress + tick__tickIdx + tick__liquidityGross + tick__liquidityNet + tick__price0 + tick__price1 + tick__volumeToken0 + tick__volumeToken1 + tick__volumeUSD + tick__untrackedVolumeUSD + tick__feesUSD + tick__collectedFeesToken0 + tick__collectedFeesToken1 + tick__collectedFeesUSD + tick__createdAtTimestamp + tick__createdAtBlockNumber + tick__liquidityProviderCount + tick__feeGrowthOutside0X128 + tick__feeGrowthOutside1X128 + liquidityGross + liquidityNet + volumeToken0 + volumeToken1 + volumeUSD + feesUSD + feeGrowthOutside0X128 + feeGrowthOutside1X128 +} + +type TickHourData { + id: ID! + periodStartUnix: Int! + pool: Pool! + tick: Tick! + liquidityGross: BigInt! + liquidityNet: BigInt! + volumeToken0: BigDecimal! + volumeToken1: BigDecimal! + volumeUSD: BigDecimal! + feesUSD: BigDecimal! +} + +input TickHourData_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + periodStartUnix: Int + periodStartUnix_not: Int + periodStartUnix_gt: Int + periodStartUnix_lt: Int + periodStartUnix_gte: Int + periodStartUnix_lte: Int + periodStartUnix_in: [Int!] + periodStartUnix_not_in: [Int!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + tick: String + tick_not: String + tick_gt: String + tick_lt: String + tick_gte: String + tick_lte: String + tick_in: [String!] + tick_not_in: [String!] + tick_contains: String + tick_contains_nocase: String + tick_not_contains: String + tick_not_contains_nocase: String + tick_starts_with: String + tick_starts_with_nocase: String + tick_not_starts_with: String + tick_not_starts_with_nocase: String + tick_ends_with: String + tick_ends_with_nocase: String + tick_not_ends_with: String + tick_not_ends_with_nocase: String + tick_: Tick_filter + liquidityGross: BigInt + liquidityGross_not: BigInt + liquidityGross_gt: BigInt + liquidityGross_lt: BigInt + liquidityGross_gte: BigInt + liquidityGross_lte: BigInt + liquidityGross_in: [BigInt!] + liquidityGross_not_in: [BigInt!] + liquidityNet: BigInt + liquidityNet_not: BigInt + liquidityNet_gt: BigInt + liquidityNet_lt: BigInt + liquidityNet_gte: BigInt + liquidityNet_lte: BigInt + liquidityNet_in: [BigInt!] + liquidityNet_not_in: [BigInt!] + volumeToken0: BigDecimal + volumeToken0_not: BigDecimal + volumeToken0_gt: BigDecimal + volumeToken0_lt: BigDecimal + volumeToken0_gte: BigDecimal + volumeToken0_lte: BigDecimal + volumeToken0_in: [BigDecimal!] + volumeToken0_not_in: [BigDecimal!] + volumeToken1: BigDecimal + volumeToken1_not: BigDecimal + volumeToken1_gt: BigDecimal + volumeToken1_lt: BigDecimal + volumeToken1_gte: BigDecimal + volumeToken1_lte: BigDecimal + volumeToken1_in: [BigDecimal!] + volumeToken1_not_in: [BigDecimal!] + volumeUSD: BigDecimal + volumeUSD_not: BigDecimal + volumeUSD_gt: BigDecimal + volumeUSD_lt: BigDecimal + volumeUSD_gte: BigDecimal + volumeUSD_lte: BigDecimal + volumeUSD_in: [BigDecimal!] + volumeUSD_not_in: [BigDecimal!] + feesUSD: BigDecimal + feesUSD_not: BigDecimal + feesUSD_gt: BigDecimal + feesUSD_lt: BigDecimal + feesUSD_gte: BigDecimal + feesUSD_lte: BigDecimal + feesUSD_in: [BigDecimal!] + feesUSD_not_in: [BigDecimal!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [TickHourData_filter] + or: [TickHourData_filter] +} + +enum TickHourData_orderBy { + id + periodStartUnix + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + tick + tick__id + tick__poolAddress + tick__tickIdx + tick__liquidityGross + tick__liquidityNet + tick__price0 + tick__price1 + tick__volumeToken0 + tick__volumeToken1 + tick__volumeUSD + tick__untrackedVolumeUSD + tick__feesUSD + tick__collectedFeesToken0 + tick__collectedFeesToken1 + tick__collectedFeesUSD + tick__createdAtTimestamp + tick__createdAtBlockNumber + tick__liquidityProviderCount + tick__feeGrowthOutside0X128 + tick__feeGrowthOutside1X128 + liquidityGross + liquidityNet + volumeToken0 + volumeToken1 + volumeUSD + feesUSD +} + +input Tick_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + poolAddress: String + poolAddress_not: String + poolAddress_gt: String + poolAddress_lt: String + poolAddress_gte: String + poolAddress_lte: String + poolAddress_in: [String!] + poolAddress_not_in: [String!] + poolAddress_contains: String + poolAddress_contains_nocase: String + poolAddress_not_contains: String + poolAddress_not_contains_nocase: String + poolAddress_starts_with: String + poolAddress_starts_with_nocase: String + poolAddress_not_starts_with: String + poolAddress_not_starts_with_nocase: String + poolAddress_ends_with: String + poolAddress_ends_with_nocase: String + poolAddress_not_ends_with: String + poolAddress_not_ends_with_nocase: String + tickIdx: BigInt + tickIdx_not: BigInt + tickIdx_gt: BigInt + tickIdx_lt: BigInt + tickIdx_gte: BigInt + tickIdx_lte: BigInt + tickIdx_in: [BigInt!] + tickIdx_not_in: [BigInt!] + pool: String + pool_not: String + pool_gt: String + pool_lt: String + pool_gte: String + pool_lte: String + pool_in: [String!] + pool_not_in: [String!] + pool_contains: String + pool_contains_nocase: String + pool_not_contains: String + pool_not_contains_nocase: String + pool_starts_with: String + pool_starts_with_nocase: String + pool_not_starts_with: String + pool_not_starts_with_nocase: String + pool_ends_with: String + pool_ends_with_nocase: String + pool_not_ends_with: String + pool_not_ends_with_nocase: String + pool_: Pool_filter + liquidityGross: BigInt + liquidityGross_not: BigInt + liquidityGross_gt: BigInt + liquidityGross_lt: BigInt + liquidityGross_gte: BigInt + liquidityGross_lte: BigInt + liquidityGross_in: [BigInt!] + liquidityGross_not_in: [BigInt!] + liquidityNet: BigInt + liquidityNet_not: BigInt + liquidityNet_gt: BigInt + liquidityNet_lt: BigInt + liquidityNet_gte: BigInt + liquidityNet_lte: BigInt + liquidityNet_in: [BigInt!] + liquidityNet_not_in: [BigInt!] + price0: BigDecimal + price0_not: BigDecimal + price0_gt: BigDecimal + price0_lt: BigDecimal + price0_gte: BigDecimal + price0_lte: BigDecimal + price0_in: [BigDecimal!] + price0_not_in: [BigDecimal!] + price1: BigDecimal + price1_not: BigDecimal + price1_gt: BigDecimal + price1_lt: BigDecimal + price1_gte: BigDecimal + price1_lte: BigDecimal + price1_in: [BigDecimal!] + price1_not_in: [BigDecimal!] + volumeToken0: BigDecimal + volumeToken0_not: BigDecimal + volumeToken0_gt: BigDecimal + volumeToken0_lt: BigDecimal + volumeToken0_gte: BigDecimal + volumeToken0_lte: BigDecimal + volumeToken0_in: [BigDecimal!] + volumeToken0_not_in: [BigDecimal!] + volumeToken1: BigDecimal + volumeToken1_not: BigDecimal + volumeToken1_gt: BigDecimal + volumeToken1_lt: BigDecimal + volumeToken1_gte: BigDecimal + volumeToken1_lte: BigDecimal + volumeToken1_in: [BigDecimal!] + volumeToken1_not_in: [BigDecimal!] + volumeUSD: BigDecimal + volumeUSD_not: BigDecimal + volumeUSD_gt: BigDecimal + volumeUSD_lt: BigDecimal + volumeUSD_gte: BigDecimal + volumeUSD_lte: BigDecimal + volumeUSD_in: [BigDecimal!] + volumeUSD_not_in: [BigDecimal!] + untrackedVolumeUSD: BigDecimal + untrackedVolumeUSD_not: BigDecimal + untrackedVolumeUSD_gt: BigDecimal + untrackedVolumeUSD_lt: BigDecimal + untrackedVolumeUSD_gte: BigDecimal + untrackedVolumeUSD_lte: BigDecimal + untrackedVolumeUSD_in: [BigDecimal!] + untrackedVolumeUSD_not_in: [BigDecimal!] + feesUSD: BigDecimal + feesUSD_not: BigDecimal + feesUSD_gt: BigDecimal + feesUSD_lt: BigDecimal + feesUSD_gte: BigDecimal + feesUSD_lte: BigDecimal + feesUSD_in: [BigDecimal!] + feesUSD_not_in: [BigDecimal!] + collectedFeesToken0: BigDecimal + collectedFeesToken0_not: BigDecimal + collectedFeesToken0_gt: BigDecimal + collectedFeesToken0_lt: BigDecimal + collectedFeesToken0_gte: BigDecimal + collectedFeesToken0_lte: BigDecimal + collectedFeesToken0_in: [BigDecimal!] + collectedFeesToken0_not_in: [BigDecimal!] + collectedFeesToken1: BigDecimal + collectedFeesToken1_not: BigDecimal + collectedFeesToken1_gt: BigDecimal + collectedFeesToken1_lt: BigDecimal + collectedFeesToken1_gte: BigDecimal + collectedFeesToken1_lte: BigDecimal + collectedFeesToken1_in: [BigDecimal!] + collectedFeesToken1_not_in: [BigDecimal!] + collectedFeesUSD: BigDecimal + collectedFeesUSD_not: BigDecimal + collectedFeesUSD_gt: BigDecimal + collectedFeesUSD_lt: BigDecimal + collectedFeesUSD_gte: BigDecimal + collectedFeesUSD_lte: BigDecimal + collectedFeesUSD_in: [BigDecimal!] + collectedFeesUSD_not_in: [BigDecimal!] + createdAtTimestamp: BigInt + createdAtTimestamp_not: BigInt + createdAtTimestamp_gt: BigInt + createdAtTimestamp_lt: BigInt + createdAtTimestamp_gte: BigInt + createdAtTimestamp_lte: BigInt + createdAtTimestamp_in: [BigInt!] + createdAtTimestamp_not_in: [BigInt!] + createdAtBlockNumber: BigInt + createdAtBlockNumber_not: BigInt + createdAtBlockNumber_gt: BigInt + createdAtBlockNumber_lt: BigInt + createdAtBlockNumber_gte: BigInt + createdAtBlockNumber_lte: BigInt + createdAtBlockNumber_in: [BigInt!] + createdAtBlockNumber_not_in: [BigInt!] + liquidityProviderCount: BigInt + liquidityProviderCount_not: BigInt + liquidityProviderCount_gt: BigInt + liquidityProviderCount_lt: BigInt + liquidityProviderCount_gte: BigInt + liquidityProviderCount_lte: BigInt + liquidityProviderCount_in: [BigInt!] + liquidityProviderCount_not_in: [BigInt!] + feeGrowthOutside0X128: BigInt + feeGrowthOutside0X128_not: BigInt + feeGrowthOutside0X128_gt: BigInt + feeGrowthOutside0X128_lt: BigInt + feeGrowthOutside0X128_gte: BigInt + feeGrowthOutside0X128_lte: BigInt + feeGrowthOutside0X128_in: [BigInt!] + feeGrowthOutside0X128_not_in: [BigInt!] + feeGrowthOutside1X128: BigInt + feeGrowthOutside1X128_not: BigInt + feeGrowthOutside1X128_gt: BigInt + feeGrowthOutside1X128_lt: BigInt + feeGrowthOutside1X128_gte: BigInt + feeGrowthOutside1X128_lte: BigInt + feeGrowthOutside1X128_in: [BigInt!] + feeGrowthOutside1X128_not_in: [BigInt!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Tick_filter] + or: [Tick_filter] +} + +enum Tick_orderBy { + id + poolAddress + tickIdx + pool + pool__id + pool__createdAtTimestamp + pool__createdAtBlockNumber + pool__feeTier + pool__liquidity + pool__sqrtPrice + pool__feeGrowthGlobal0X128 + pool__feeGrowthGlobal1X128 + pool__token0Price + pool__token1Price + pool__tick + pool__observationIndex + pool__volumeToken0 + pool__volumeToken1 + pool__volumeUSD + pool__untrackedVolumeUSD + pool__feesUSD + pool__txCount + pool__collectedFeesToken0 + pool__collectedFeesToken1 + pool__collectedFeesUSD + pool__totalValueLockedToken0 + pool__totalValueLockedToken1 + pool__totalValueLockedETH + pool__totalValueLockedUSD + pool__totalValueLockedUSDUntracked + pool__isProtocolFeeEnabled + pool__liquidityProviderCount + liquidityGross + liquidityNet + price0 + price1 + volumeToken0 + volumeToken1 + volumeUSD + untrackedVolumeUSD + feesUSD + collectedFeesToken0 + collectedFeesToken1 + collectedFeesUSD + createdAtTimestamp + createdAtBlockNumber + liquidityProviderCount + feeGrowthOutside0X128 + feeGrowthOutside1X128 +} + +"A string representation of microseconds UNIX timestamp (16 digits)\n" +scalar Timestamp + +type Token { + id: ID! + symbol: String! + name: String! + decimals: BigInt! + totalSupply: BigInt! + volume: BigDecimal! + volumeUSD: BigDecimal! + untrackedVolumeUSD: BigDecimal! + feesUSD: BigDecimal! + txCount: BigInt! + poolCount: BigInt! + totalValueLocked: BigDecimal! + totalValueLockedUSD: BigDecimal! + totalValueLockedUSDUntracked: BigDecimal! + derivedETH: BigDecimal! + whitelistPools(skip: Int = 0, first: Int = 100, orderBy: Pool_orderBy, orderDirection: OrderDirection, where: Pool_filter): [Pool!]! + tokenDayData(skip: Int = 0, first: Int = 100, orderBy: TokenDayData_orderBy, orderDirection: OrderDirection, where: TokenDayData_filter): [TokenDayData!]! +} + +type TokenDayData { + id: ID! + date: Int! + token: Token! + volume: BigDecimal! + volumeUSD: BigDecimal! + untrackedVolumeUSD: BigDecimal! + totalValueLocked: BigDecimal! + totalValueLockedUSD: BigDecimal! + priceUSD: BigDecimal! + feesUSD: BigDecimal! + open: BigDecimal! + high: BigDecimal! + low: BigDecimal! + close: BigDecimal! +} + +input TokenDayData_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + date: Int + date_not: Int + date_gt: Int + date_lt: Int + date_gte: Int + date_lte: Int + date_in: [Int!] + date_not_in: [Int!] + token: String + token_not: String + token_gt: String + token_lt: String + token_gte: String + token_lte: String + token_in: [String!] + token_not_in: [String!] + token_contains: String + token_contains_nocase: String + token_not_contains: String + token_not_contains_nocase: String + token_starts_with: String + token_starts_with_nocase: String + token_not_starts_with: String + token_not_starts_with_nocase: String + token_ends_with: String + token_ends_with_nocase: String + token_not_ends_with: String + token_not_ends_with_nocase: String + token_: Token_filter + volume: BigDecimal + volume_not: BigDecimal + volume_gt: BigDecimal + volume_lt: BigDecimal + volume_gte: BigDecimal + volume_lte: BigDecimal + volume_in: [BigDecimal!] + volume_not_in: [BigDecimal!] + volumeUSD: BigDecimal + volumeUSD_not: BigDecimal + volumeUSD_gt: BigDecimal + volumeUSD_lt: BigDecimal + volumeUSD_gte: BigDecimal + volumeUSD_lte: BigDecimal + volumeUSD_in: [BigDecimal!] + volumeUSD_not_in: [BigDecimal!] + untrackedVolumeUSD: BigDecimal + untrackedVolumeUSD_not: BigDecimal + untrackedVolumeUSD_gt: BigDecimal + untrackedVolumeUSD_lt: BigDecimal + untrackedVolumeUSD_gte: BigDecimal + untrackedVolumeUSD_lte: BigDecimal + untrackedVolumeUSD_in: [BigDecimal!] + untrackedVolumeUSD_not_in: [BigDecimal!] + totalValueLocked: BigDecimal + totalValueLocked_not: BigDecimal + totalValueLocked_gt: BigDecimal + totalValueLocked_lt: BigDecimal + totalValueLocked_gte: BigDecimal + totalValueLocked_lte: BigDecimal + totalValueLocked_in: [BigDecimal!] + totalValueLocked_not_in: [BigDecimal!] + totalValueLockedUSD: BigDecimal + totalValueLockedUSD_not: BigDecimal + totalValueLockedUSD_gt: BigDecimal + totalValueLockedUSD_lt: BigDecimal + totalValueLockedUSD_gte: BigDecimal + totalValueLockedUSD_lte: BigDecimal + totalValueLockedUSD_in: [BigDecimal!] + totalValueLockedUSD_not_in: [BigDecimal!] + priceUSD: BigDecimal + priceUSD_not: BigDecimal + priceUSD_gt: BigDecimal + priceUSD_lt: BigDecimal + priceUSD_gte: BigDecimal + priceUSD_lte: BigDecimal + priceUSD_in: [BigDecimal!] + priceUSD_not_in: [BigDecimal!] + feesUSD: BigDecimal + feesUSD_not: BigDecimal + feesUSD_gt: BigDecimal + feesUSD_lt: BigDecimal + feesUSD_gte: BigDecimal + feesUSD_lte: BigDecimal + feesUSD_in: [BigDecimal!] + feesUSD_not_in: [BigDecimal!] + open: BigDecimal + open_not: BigDecimal + open_gt: BigDecimal + open_lt: BigDecimal + open_gte: BigDecimal + open_lte: BigDecimal + open_in: [BigDecimal!] + open_not_in: [BigDecimal!] + high: BigDecimal + high_not: BigDecimal + high_gt: BigDecimal + high_lt: BigDecimal + high_gte: BigDecimal + high_lte: BigDecimal + high_in: [BigDecimal!] + high_not_in: [BigDecimal!] + low: BigDecimal + low_not: BigDecimal + low_gt: BigDecimal + low_lt: BigDecimal + low_gte: BigDecimal + low_lte: BigDecimal + low_in: [BigDecimal!] + low_not_in: [BigDecimal!] + close: BigDecimal + close_not: BigDecimal + close_gt: BigDecimal + close_lt: BigDecimal + close_gte: BigDecimal + close_lte: BigDecimal + close_in: [BigDecimal!] + close_not_in: [BigDecimal!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [TokenDayData_filter] + or: [TokenDayData_filter] +} + +enum TokenDayData_orderBy { + id + date + token + token__id + token__symbol + token__name + token__decimals + token__totalSupply + token__volume + token__volumeUSD + token__untrackedVolumeUSD + token__feesUSD + token__txCount + token__poolCount + token__totalValueLocked + token__totalValueLockedUSD + token__totalValueLockedUSDUntracked + token__derivedETH + volume + volumeUSD + untrackedVolumeUSD + totalValueLocked + totalValueLockedUSD + priceUSD + feesUSD + open + high + low + close +} + +type TokenHourData { + id: ID! + periodStartUnix: Int! + token: Token! + volume: BigDecimal! + volumeUSD: BigDecimal! + untrackedVolumeUSD: BigDecimal! + totalValueLocked: BigDecimal! + totalValueLockedUSD: BigDecimal! + priceUSD: BigDecimal! + feesUSD: BigDecimal! + open: BigDecimal! + high: BigDecimal! + low: BigDecimal! + close: BigDecimal! +} + +input TokenHourData_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + periodStartUnix: Int + periodStartUnix_not: Int + periodStartUnix_gt: Int + periodStartUnix_lt: Int + periodStartUnix_gte: Int + periodStartUnix_lte: Int + periodStartUnix_in: [Int!] + periodStartUnix_not_in: [Int!] + token: String + token_not: String + token_gt: String + token_lt: String + token_gte: String + token_lte: String + token_in: [String!] + token_not_in: [String!] + token_contains: String + token_contains_nocase: String + token_not_contains: String + token_not_contains_nocase: String + token_starts_with: String + token_starts_with_nocase: String + token_not_starts_with: String + token_not_starts_with_nocase: String + token_ends_with: String + token_ends_with_nocase: String + token_not_ends_with: String + token_not_ends_with_nocase: String + token_: Token_filter + volume: BigDecimal + volume_not: BigDecimal + volume_gt: BigDecimal + volume_lt: BigDecimal + volume_gte: BigDecimal + volume_lte: BigDecimal + volume_in: [BigDecimal!] + volume_not_in: [BigDecimal!] + volumeUSD: BigDecimal + volumeUSD_not: BigDecimal + volumeUSD_gt: BigDecimal + volumeUSD_lt: BigDecimal + volumeUSD_gte: BigDecimal + volumeUSD_lte: BigDecimal + volumeUSD_in: [BigDecimal!] + volumeUSD_not_in: [BigDecimal!] + untrackedVolumeUSD: BigDecimal + untrackedVolumeUSD_not: BigDecimal + untrackedVolumeUSD_gt: BigDecimal + untrackedVolumeUSD_lt: BigDecimal + untrackedVolumeUSD_gte: BigDecimal + untrackedVolumeUSD_lte: BigDecimal + untrackedVolumeUSD_in: [BigDecimal!] + untrackedVolumeUSD_not_in: [BigDecimal!] + totalValueLocked: BigDecimal + totalValueLocked_not: BigDecimal + totalValueLocked_gt: BigDecimal + totalValueLocked_lt: BigDecimal + totalValueLocked_gte: BigDecimal + totalValueLocked_lte: BigDecimal + totalValueLocked_in: [BigDecimal!] + totalValueLocked_not_in: [BigDecimal!] + totalValueLockedUSD: BigDecimal + totalValueLockedUSD_not: BigDecimal + totalValueLockedUSD_gt: BigDecimal + totalValueLockedUSD_lt: BigDecimal + totalValueLockedUSD_gte: BigDecimal + totalValueLockedUSD_lte: BigDecimal + totalValueLockedUSD_in: [BigDecimal!] + totalValueLockedUSD_not_in: [BigDecimal!] + priceUSD: BigDecimal + priceUSD_not: BigDecimal + priceUSD_gt: BigDecimal + priceUSD_lt: BigDecimal + priceUSD_gte: BigDecimal + priceUSD_lte: BigDecimal + priceUSD_in: [BigDecimal!] + priceUSD_not_in: [BigDecimal!] + feesUSD: BigDecimal + feesUSD_not: BigDecimal + feesUSD_gt: BigDecimal + feesUSD_lt: BigDecimal + feesUSD_gte: BigDecimal + feesUSD_lte: BigDecimal + feesUSD_in: [BigDecimal!] + feesUSD_not_in: [BigDecimal!] + open: BigDecimal + open_not: BigDecimal + open_gt: BigDecimal + open_lt: BigDecimal + open_gte: BigDecimal + open_lte: BigDecimal + open_in: [BigDecimal!] + open_not_in: [BigDecimal!] + high: BigDecimal + high_not: BigDecimal + high_gt: BigDecimal + high_lt: BigDecimal + high_gte: BigDecimal + high_lte: BigDecimal + high_in: [BigDecimal!] + high_not_in: [BigDecimal!] + low: BigDecimal + low_not: BigDecimal + low_gt: BigDecimal + low_lt: BigDecimal + low_gte: BigDecimal + low_lte: BigDecimal + low_in: [BigDecimal!] + low_not_in: [BigDecimal!] + close: BigDecimal + close_not: BigDecimal + close_gt: BigDecimal + close_lt: BigDecimal + close_gte: BigDecimal + close_lte: BigDecimal + close_in: [BigDecimal!] + close_not_in: [BigDecimal!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [TokenHourData_filter] + or: [TokenHourData_filter] +} + +enum TokenHourData_orderBy { + id + periodStartUnix + token + token__id + token__symbol + token__name + token__decimals + token__totalSupply + token__volume + token__volumeUSD + token__untrackedVolumeUSD + token__feesUSD + token__txCount + token__poolCount + token__totalValueLocked + token__totalValueLockedUSD + token__totalValueLockedUSDUntracked + token__derivedETH + volume + volumeUSD + untrackedVolumeUSD + totalValueLocked + totalValueLockedUSD + priceUSD + feesUSD + open + high + low + close +} + +input Token_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + symbol: String + symbol_not: String + symbol_gt: String + symbol_lt: String + symbol_gte: String + symbol_lte: String + symbol_in: [String!] + symbol_not_in: [String!] + symbol_contains: String + symbol_contains_nocase: String + symbol_not_contains: String + symbol_not_contains_nocase: String + symbol_starts_with: String + symbol_starts_with_nocase: String + symbol_not_starts_with: String + symbol_not_starts_with_nocase: String + symbol_ends_with: String + symbol_ends_with_nocase: String + symbol_not_ends_with: String + symbol_not_ends_with_nocase: String + name: String + name_not: String + name_gt: String + name_lt: String + name_gte: String + name_lte: String + name_in: [String!] + name_not_in: [String!] + name_contains: String + name_contains_nocase: String + name_not_contains: String + name_not_contains_nocase: String + name_starts_with: String + name_starts_with_nocase: String + name_not_starts_with: String + name_not_starts_with_nocase: String + name_ends_with: String + name_ends_with_nocase: String + name_not_ends_with: String + name_not_ends_with_nocase: String + decimals: BigInt + decimals_not: BigInt + decimals_gt: BigInt + decimals_lt: BigInt + decimals_gte: BigInt + decimals_lte: BigInt + decimals_in: [BigInt!] + decimals_not_in: [BigInt!] + totalSupply: BigInt + totalSupply_not: BigInt + totalSupply_gt: BigInt + totalSupply_lt: BigInt + totalSupply_gte: BigInt + totalSupply_lte: BigInt + totalSupply_in: [BigInt!] + totalSupply_not_in: [BigInt!] + volume: BigDecimal + volume_not: BigDecimal + volume_gt: BigDecimal + volume_lt: BigDecimal + volume_gte: BigDecimal + volume_lte: BigDecimal + volume_in: [BigDecimal!] + volume_not_in: [BigDecimal!] + volumeUSD: BigDecimal + volumeUSD_not: BigDecimal + volumeUSD_gt: BigDecimal + volumeUSD_lt: BigDecimal + volumeUSD_gte: BigDecimal + volumeUSD_lte: BigDecimal + volumeUSD_in: [BigDecimal!] + volumeUSD_not_in: [BigDecimal!] + untrackedVolumeUSD: BigDecimal + untrackedVolumeUSD_not: BigDecimal + untrackedVolumeUSD_gt: BigDecimal + untrackedVolumeUSD_lt: BigDecimal + untrackedVolumeUSD_gte: BigDecimal + untrackedVolumeUSD_lte: BigDecimal + untrackedVolumeUSD_in: [BigDecimal!] + untrackedVolumeUSD_not_in: [BigDecimal!] + feesUSD: BigDecimal + feesUSD_not: BigDecimal + feesUSD_gt: BigDecimal + feesUSD_lt: BigDecimal + feesUSD_gte: BigDecimal + feesUSD_lte: BigDecimal + feesUSD_in: [BigDecimal!] + feesUSD_not_in: [BigDecimal!] + txCount: BigInt + txCount_not: BigInt + txCount_gt: BigInt + txCount_lt: BigInt + txCount_gte: BigInt + txCount_lte: BigInt + txCount_in: [BigInt!] + txCount_not_in: [BigInt!] + poolCount: BigInt + poolCount_not: BigInt + poolCount_gt: BigInt + poolCount_lt: BigInt + poolCount_gte: BigInt + poolCount_lte: BigInt + poolCount_in: [BigInt!] + poolCount_not_in: [BigInt!] + totalValueLocked: BigDecimal + totalValueLocked_not: BigDecimal + totalValueLocked_gt: BigDecimal + totalValueLocked_lt: BigDecimal + totalValueLocked_gte: BigDecimal + totalValueLocked_lte: BigDecimal + totalValueLocked_in: [BigDecimal!] + totalValueLocked_not_in: [BigDecimal!] + totalValueLockedUSD: BigDecimal + totalValueLockedUSD_not: BigDecimal + totalValueLockedUSD_gt: BigDecimal + totalValueLockedUSD_lt: BigDecimal + totalValueLockedUSD_gte: BigDecimal + totalValueLockedUSD_lte: BigDecimal + totalValueLockedUSD_in: [BigDecimal!] + totalValueLockedUSD_not_in: [BigDecimal!] + totalValueLockedUSDUntracked: BigDecimal + totalValueLockedUSDUntracked_not: BigDecimal + totalValueLockedUSDUntracked_gt: BigDecimal + totalValueLockedUSDUntracked_lt: BigDecimal + totalValueLockedUSDUntracked_gte: BigDecimal + totalValueLockedUSDUntracked_lte: BigDecimal + totalValueLockedUSDUntracked_in: [BigDecimal!] + totalValueLockedUSDUntracked_not_in: [BigDecimal!] + derivedETH: BigDecimal + derivedETH_not: BigDecimal + derivedETH_gt: BigDecimal + derivedETH_lt: BigDecimal + derivedETH_gte: BigDecimal + derivedETH_lte: BigDecimal + derivedETH_in: [BigDecimal!] + derivedETH_not_in: [BigDecimal!] + whitelistPools: [String!] + whitelistPools_not: [String!] + whitelistPools_contains: [String!] + whitelistPools_contains_nocase: [String!] + whitelistPools_not_contains: [String!] + whitelistPools_not_contains_nocase: [String!] + whitelistPools_: Pool_filter + tokenDayData_: TokenDayData_filter + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Token_filter] + or: [Token_filter] +} + +enum Token_orderBy { + id + symbol + name + decimals + totalSupply + volume + volumeUSD + untrackedVolumeUSD + feesUSD + txCount + poolCount + totalValueLocked + totalValueLockedUSD + totalValueLockedUSDUntracked + derivedETH + whitelistPools + tokenDayData +} + +type Transaction { + id: ID! + blockNumber: BigInt! + timestamp: BigInt! + gasUsed: BigInt! + gasPrice: BigInt! + mints(skip: Int = 0, first: Int = 100, orderBy: Mint_orderBy, orderDirection: OrderDirection, where: Mint_filter): [Mint!]! + burns(skip: Int = 0, first: Int = 100, orderBy: Burn_orderBy, orderDirection: OrderDirection, where: Burn_filter): [Burn!]! + swaps(skip: Int = 0, first: Int = 100, orderBy: Swap_orderBy, orderDirection: OrderDirection, where: Swap_filter): [Swap!]! + flashed(skip: Int = 0, first: Int = 100, orderBy: Flash_orderBy, orderDirection: OrderDirection, where: Flash_filter): [Flash!]! + collects(skip: Int = 0, first: Int = 100, orderBy: Collect_orderBy, orderDirection: OrderDirection, where: Collect_filter): [Collect!]! +} + +input Transaction_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + blockNumber: BigInt + blockNumber_not: BigInt + blockNumber_gt: BigInt + blockNumber_lt: BigInt + blockNumber_gte: BigInt + blockNumber_lte: BigInt + blockNumber_in: [BigInt!] + blockNumber_not_in: [BigInt!] + timestamp: BigInt + timestamp_not: BigInt + timestamp_gt: BigInt + timestamp_lt: BigInt + timestamp_gte: BigInt + timestamp_lte: BigInt + timestamp_in: [BigInt!] + timestamp_not_in: [BigInt!] + gasUsed: BigInt + gasUsed_not: BigInt + gasUsed_gt: BigInt + gasUsed_lt: BigInt + gasUsed_gte: BigInt + gasUsed_lte: BigInt + gasUsed_in: [BigInt!] + gasUsed_not_in: [BigInt!] + gasPrice: BigInt + gasPrice_not: BigInt + gasPrice_gt: BigInt + gasPrice_lt: BigInt + gasPrice_gte: BigInt + gasPrice_lte: BigInt + gasPrice_in: [BigInt!] + gasPrice_not_in: [BigInt!] + mints_: Mint_filter + burns_: Burn_filter + swaps_: Swap_filter + flashed_: Flash_filter + collects_: Collect_filter + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [Transaction_filter] + or: [Transaction_filter] +} + +enum Transaction_orderBy { + id + blockNumber + timestamp + gasUsed + gasPrice + mints + burns + swaps + flashed + collects +} + +type UniswapDayData { + id: ID! + date: Int! + volumeETH: BigDecimal! + volumeUSD: BigDecimal! + volumeUSDUntracked: BigDecimal! + feesUSD: BigDecimal! + txCount: BigInt! + tvlUSD: BigDecimal! +} + +input UniswapDayData_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + date: Int + date_not: Int + date_gt: Int + date_lt: Int + date_gte: Int + date_lte: Int + date_in: [Int!] + date_not_in: [Int!] + volumeETH: BigDecimal + volumeETH_not: BigDecimal + volumeETH_gt: BigDecimal + volumeETH_lt: BigDecimal + volumeETH_gte: BigDecimal + volumeETH_lte: BigDecimal + volumeETH_in: [BigDecimal!] + volumeETH_not_in: [BigDecimal!] + volumeUSD: BigDecimal + volumeUSD_not: BigDecimal + volumeUSD_gt: BigDecimal + volumeUSD_lt: BigDecimal + volumeUSD_gte: BigDecimal + volumeUSD_lte: BigDecimal + volumeUSD_in: [BigDecimal!] + volumeUSD_not_in: [BigDecimal!] + volumeUSDUntracked: BigDecimal + volumeUSDUntracked_not: BigDecimal + volumeUSDUntracked_gt: BigDecimal + volumeUSDUntracked_lt: BigDecimal + volumeUSDUntracked_gte: BigDecimal + volumeUSDUntracked_lte: BigDecimal + volumeUSDUntracked_in: [BigDecimal!] + volumeUSDUntracked_not_in: [BigDecimal!] + feesUSD: BigDecimal + feesUSD_not: BigDecimal + feesUSD_gt: BigDecimal + feesUSD_lt: BigDecimal + feesUSD_gte: BigDecimal + feesUSD_lte: BigDecimal + feesUSD_in: [BigDecimal!] + feesUSD_not_in: [BigDecimal!] + txCount: BigInt + txCount_not: BigInt + txCount_gt: BigInt + txCount_lt: BigInt + txCount_gte: BigInt + txCount_lte: BigInt + txCount_in: [BigInt!] + txCount_not_in: [BigInt!] + tvlUSD: BigDecimal + tvlUSD_not: BigDecimal + tvlUSD_gt: BigDecimal + tvlUSD_lt: BigDecimal + tvlUSD_gte: BigDecimal + tvlUSD_lte: BigDecimal + tvlUSD_in: [BigDecimal!] + tvlUSD_not_in: [BigDecimal!] + + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [UniswapDayData_filter] + or: [UniswapDayData_filter] +} + +enum UniswapDayData_orderBy { + id + date + volumeETH + volumeUSD + volumeUSDUntracked + feesUSD + txCount + tvlUSD +} + +type _Block_ { + """The hash of the block""" + hash: Bytes + + """The block number""" + number: Int! + + """Integer representation of the timestamp stored in blocks for the chain""" + timestamp: Int + + """The hash of the parent block""" + parentHash: Bytes +} + +"""The type for the top-level _meta field""" +type _Meta_ { + "Information about a specific subgraph block. The hash of the block\nwill be null if the _meta field has a block constraint that asks for\na block number. It will be filled if the _meta field has no block constraint\nand therefore asks for the latest block\n" + block: _Block_! + + """The deployment ID""" + deployment: String! + + """If `true`, the subgraph encountered indexing errors at some past block""" + hasIndexingErrors: Boolean! +} + +enum _SubgraphErrorPolicy_ { + """Data will be returned even if the subgraph has indexing errors""" + allow + + """ + If the subgraph has indexing errors, data will be omitted. The default. + """ + deny +} \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts b/packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts new file mode 100644 index 0000000000..f17b9c08e2 --- /dev/null +++ b/packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts @@ -0,0 +1,73 @@ +import type { ResultOf } from 'gql.tada' +import type { PoolFieldsFragment } from 'src/subgraphs/sushi-v3/fragments/pool-fields' +import type { SushiSwapV3ChainId } from 'sushi/config' +import { + getIdFromChainIdAddress, + withoutScientificNotation, +} from 'sushi/format' +import { SushiSwapProtocol, type Address } from 'sushi/types' + +export function transformPoolV3ToBase( + pool: ResultOf, + chainId: SushiSwapV3ChainId, +) { + const swapFee = Number(pool.swapFee) / 1000000 + + return { + id: getIdFromChainIdAddress(chainId, pool.id as Address), + address: pool.id as Address, + chainId, + name: `${pool.token0.symbol}-${pool.token1.symbol}`, + + swapFee: swapFee, + // twapEnabled: pool.twapEnabled, + + feeGrowthGlobal0X128: BigInt(pool.feeGrowthGlobal0X128), + feeGrowthGlobal1X128: BigInt(pool.feeGrowthGlobal1X128), + observationIndex: BigInt(pool.observationIndex), + sqrtPrice: BigInt(pool.sqrtPrice), + tick: BigInt(pool.tick ?? 0), + + protocol: SushiSwapProtocol.SUSHISWAP_V3, + + reserve0: BigInt( + withoutScientificNotation( + (Number(pool.reserve0) * 10 ** Number(pool.token0.decimals)).toFixed(), + )!, + ), + reserve1: BigInt( + withoutScientificNotation( + (Number(pool.reserve1) * 10 ** Number(pool.token1.decimals)).toFixed(), + )!, + ), + liquidity: BigInt(pool.liquidity), + liquidityUSD: Number(pool.liquidityUSD), + + volumeUSD: Number(pool.volumeUSD), + feesUSD: Number(pool.volumeUSD) * swapFee, + + token0: { + id: getIdFromChainIdAddress(chainId, pool.token0.id as Address), + address: pool.token0.id as Address, + chainId, + decimals: Number(pool.token0.decimals), + name: pool.token0.name, + symbol: pool.token0.symbol, + }, + token1: { + id: getIdFromChainIdAddress(chainId, pool.token1.id as Address), + address: pool.token1.id as Address, + chainId, + decimals: Number(pool.token1.decimals), + name: pool.token1.name, + symbol: pool.token1.symbol, + }, + + token0Price: Number(pool.token0Price), + token1Price: Number(pool.token1Price), + + txCount: Number(pool.txCount), + + isProtocolFeeEnabled: pool.isProtocolFeeEnabled, + } +} diff --git a/packages/graph-client/tsconfig.json b/packages/graph-client/tsconfig.json index 08f8548baa..38d5b7b489 100644 --- a/packages/graph-client/tsconfig.json +++ b/packages/graph-client/tsconfig.json @@ -46,7 +46,13 @@ "schema": "./src/subgraphs/data-api/schema.graphql", "tadaOutputLocation": "./src/subgraphs/data-api/data-api-env.d.ts", "tadaTurboLocation": "./src/subgraphs/data-api/data-api-cache.d.ts" - } + }, + { + "name": "sushi-v3", + "schema": "./src/subgraphs/sushi-v3/schema.graphql", + "tadaOutputLocation": "./src/subgraphs/sushi-v3/sushi-v3-env.d.ts", + "tadaTurboLocation": "./src/subgraphs/sushi-v3/sushi-v3-cache.d.ts" + }, ] } ] From 9b979a5e1f1d5f0170555a3f995e2719170e1e10 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 8 Aug 2024 20:37:06 +0200 Subject: [PATCH 072/139] test(apps/web): fix chain id variable --- apps/web/test/pool/pool.test.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/web/test/pool/pool.test.ts b/apps/web/test/pool/pool.test.ts index b24f82c3f5..12f17411da 100644 --- a/apps/web/test/pool/pool.test.ts +++ b/apps/web/test/pool/pool.test.ts @@ -145,9 +145,7 @@ test.describe('V3', () => { next, }) => { test.slow() - const url = BASE_URL.concat(`/${chainId.toString()}`) - .concat(`/v3`) - .concat('/add') + const url = BASE_URL.concat(`/${chainId.toString()}/v3/add`) const poolPage = new PoolPage(page, chainId) await poolPage.mockPoolApi( @@ -192,9 +190,7 @@ test.describe('V2', () => { test.slow() const poolPage = new PoolPage(page, chainId) - const url = BASE_URL.concat(`/${chainId.toString()}`) - .concat(`/v2`) - .concat('/add') + const url = BASE_URL.concat(`/${chainId.toString()}/v2/add`) await poolPage.goTo(url) await poolPage.connect() await poolPage.switchNetwork(chainId) From d4e506b1478fb9b5159e18506ccc07fdd4f2dcf5 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 9 Aug 2024 02:00:53 +0700 Subject: [PATCH 073/139] fix: update-schemas --- packages/graph-client/scripts/update-schemas.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/graph-client/scripts/update-schemas.ts b/packages/graph-client/scripts/update-schemas.ts index 75818e3e50..19046bce11 100644 --- a/packages/graph-client/scripts/update-schemas.ts +++ b/packages/graph-client/scripts/update-schemas.ts @@ -9,6 +9,7 @@ const schemas = { strapi: 'sushi-strapi-cms.herokuapp.com/graphql', furo: 'api.studio.thegraph.com/query/32073/furo-ethereum/v0.0.1', 'data-api': 'data-api-production-acb1.up.railway.app/graphql', + 'sushi-v3': 'api.studio.thegraph.com/query/32073/v3-arbitrum/v0.0.1', } as const satisfies Record async function updateSchema(schema: keyof typeof schemas) { From 37d1e76e9cb140e86934c5f4808e61d344db937c Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 9 Aug 2024 02:17:48 +0700 Subject: [PATCH 074/139] feat: allow short chain name --- apps/web/src/middleware.ts | 45 ++++++++++++++------------------------ 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts index 6936dc7d5f..0a4755a8b3 100644 --- a/apps/web/src/middleware.ts +++ b/apps/web/src/middleware.ts @@ -2,11 +2,14 @@ import { type NextRequest, NextResponse } from 'next/server' import { chainShortNameToChainId } from 'sushi/chain' export const config = { - matcher: ['/swap/:path*', '/pool/:path*', '/pools/:path*'], + matcher: [ + '/swap/:path*', + '/:chainId/explore/:path*', + '/:chainId/pool/:path*', + '/:chainId/positions/:path*', + ], } -const shortNameIdRegexp = new RegExp(/(\w+):0x.*?(?=(?:\/|$))/) - export async function middleware(req: NextRequest) { const { pathname, searchParams, search } = req.nextUrl if (pathname === '/swap' && search !== '') { @@ -43,33 +46,19 @@ export async function middleware(req: NextRequest) { } } - if (pathname.startsWith('/pool')) { - if (pathname === '/pool/add' && search === '') { - const url = req.nextUrl.clone() - url.search = '?fromCurrency=NATIVE' - return NextResponse.redirect(url) - } - - if (pathname === '/pool/add/v2' && search === '') { - const url = req.nextUrl.clone() - url.pathname = '/add/v2/1' - return NextResponse.redirect(url) - } + const chainShortNameMatch = pathname.match( + /(\w+)(?:\/explore|\/pool|\/positions)/, + ) + if (chainShortNameMatch?.length) { + const [chainShortName] = chainShortNameMatch[0].split('/') + const chainId = String(chainShortNameToChainId[chainShortName]) - // Matches paths that include /arb1:0x1234abcd/, starts and ends after '/' - const match = pathname.match(shortNameIdRegexp) - if (match?.length) { - const pairId = pathname.match(shortNameIdRegexp)?.[0] as string - const [chainShortName, address] = pairId.split(':') - const chainId = String(chainShortNameToChainId[chainShortName]) + // Already rewritten / invalid chainShortName + if (chainId === 'undefined') return NextResponse.next() - // Already rewritten / invalid chainShortName - if (chainId === 'undefined') return NextResponse.next() - - const url = req.nextUrl.clone() - url.pathname = pathname.replace(pairId, `${chainId}:${address}`) + const url = req.nextUrl.clone() + url.pathname = pathname.replace(chainShortName, chainId) - return NextResponse.redirect(url) - } + return NextResponse.rewrite(url) } } From f8830186f546e36a883a36c0856a5e1e997ddac7 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 8 Aug 2024 21:57:47 +0200 Subject: [PATCH 075/139] refactor: v3 pool fee page --- .../app/(evm)/[chainId]/pool/v3/fees/page.tsx | 7 +- apps/web/src/ui/pool/V3FeesTable.tsx | 8 +- .../subgraphs/data-api/queries/v3/index.ts | 1 + .../data-api/queries/v3/pools-by-tokens.ts | 6 +- .../subgraphs/data-api/queries/v3/pools.ts | 133 + .../src/subgraphs/data-api/schema.graphql | 7 + .../sushi-v3/fragments/pool-fields.ts | 53 - .../src/subgraphs/sushi-v3/graphql.ts | 8 - .../src/subgraphs/sushi-v3/queries/pools.ts | 48 - .../src/subgraphs/sushi-v3/schema.graphql | 6541 ----------------- .../sushi-v3/transforms/pool-v3-to-base.ts | 73 - packages/graph-client/tsconfig.json | 8 +- .../sushi/src/types/sushi-pool/pool-v3.ts | 1 + 13 files changed, 155 insertions(+), 6739 deletions(-) create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/v3/pools.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/graphql.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/schema.graphql delete mode 100644 packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx index adeec615c4..9cc9d9fe60 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx @@ -1,4 +1,5 @@ -import { getSushiV3Pools } from '@sushiswap/graph-client/sushi-v3' + +import { getV3BasePools } from '@sushiswap/graph-client/data-api' import { Card, Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' import { TableFiltersNetwork } from 'src/ui/pool/TableFiltersNetwork' @@ -11,8 +12,8 @@ export default async function Page({ }: { params: { chainId: string } }) { const pools = await unstable_cache( async () => - getSushiV3Pools({ chainId: +params.chainId as SushiSwapV3ChainId }), - ['v3-pools', params.chainId], + getV3BasePools({ chainId: +params.chainId as SushiSwapV3ChainId }), + ['operational-v3-pools', params.chainId], { revalidate: 60 * 15, }, diff --git a/apps/web/src/ui/pool/V3FeesTable.tsx b/apps/web/src/ui/pool/V3FeesTable.tsx index a8a01397ca..621bf5c33a 100644 --- a/apps/web/src/ui/pool/V3FeesTable.tsx +++ b/apps/web/src/ui/pool/V3FeesTable.tsx @@ -1,6 +1,6 @@ 'use client' -import { type SushiV3Pools } from '@sushiswap/graph-client/sushi-v3' +import { V3BasePool } from '@sushiswap/graph-client/data-api' import { Badge, Button, @@ -24,7 +24,7 @@ import { Token } from 'sushi/currency' import { formatNumber, formatUSD } from 'sushi/format' import { useWaitForTransactionReceipt, useWriteContract } from 'wagmi' -type V3Pool = Omit & { +type V3Pool = Omit & { token0: Token token1: Token } @@ -177,7 +177,7 @@ const PROTOCOL_FEE_COLUMN: ColumnDef = { header: 'Fees Enabled', accessorFn: (row) => row.volumeUSD, sortingFn: ({ original: rowA }, { original: rowB }) => - +rowA.isProtocolFeeEnabled - +rowB.isProtocolFeeEnabled, + +rowA.isProtocolFeeEnabled! - +rowB.isProtocolFeeEnabled!, cell: (props) => (
{props.row.original.isProtocolFeeEnabled ? ( @@ -199,7 +199,7 @@ const COLUMNS = [ PROTOCOL_FEE_COLUMN, ] -export const V3FeesTable: FC<{ pools: SushiV3Pools; chainId: ChainId }> = ({ +export const V3FeesTable: FC<{ pools: V3BasePool[]; chainId: ChainId }> = ({ pools, chainId, }) => { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts index 93acb75db4..cedc8d29e1 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/index.ts @@ -2,5 +2,6 @@ export * from './buckets' export * from './burns' export * from './collects' export * from './mints' +export * from './pools' export * from './pools-by-tokens' export * from './swaps' diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts index 6fae6a819e..5011494974 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools-by-tokens.ts @@ -18,6 +18,7 @@ export const V3PoolsByTokensQuery = graphql( name createdAt swapFee + isProtocolFeeEnabled token0 { id chainId @@ -54,10 +55,10 @@ export const V3PoolsByTokensQuery = graphql( `, ) -export type GetV3BasePools = VariablesOf +export type GetV3BasePoolsByTokens = VariablesOf export async function getV3BasePoolsByToken( - variables: GetV3BasePools, + variables: GetV3BasePoolsByTokens, options?: RequestOptions, ): Promise[]> { const url = `https://${SUSHI_DATA_API_HOST}` @@ -95,6 +96,7 @@ export async function getV3BasePoolsByToken( name: pool.name, swapFee: pool.swapFee, protocol: SushiSwapProtocol.SUSHISWAP_V3, + isProtocolFeeEnabled: pool.isProtocolFeeEnabled, token0: { id: pool.token0.id as `${string}:0x${string}`, address: pool.token0.address as Address, diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools.ts new file mode 100644 index 0000000000..cbf5645469 --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools.ts @@ -0,0 +1,133 @@ +import type { VariablesOf } from 'gql.tada' + +import { request, type RequestOptions } from 'src/lib/request' +import { ChainId, SushiSwapProtocol, type PoolBase, type PoolV3 } from 'sushi' +import { isSushiSwapV3ChainId } from 'sushi/config' +import type { Address } from 'viem' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' +import { graphql } from '../../graphql' + +export const V3PoolsQuery = graphql( + ` + query V3Pools($chainId: Int!) { + v3Pools(chainId: $chainId) { + id + address + chainId + protocol + name + createdAt + isProtocolFeeEnabled + swapFee + token0 { + id + chainId + address + name + symbol + decimals + } + token1 { + id + chainId + address + name + symbol + decimals + } + source + reserve0 + reserve1 + liquidity + token0Price + token1Price + sqrtPrice + tick + observationIndex + feeGrowthGlobal0X128 + feeGrowthGlobal1X128 + volumeUSD + liquidityUSD + feesUSD + txCount + } + } +`, +) + +export type GetV3BasePools = VariablesOf + +export async function getV3BasePools( + variables: GetV3BasePools, + options?: RequestOptions, +): Promise[]> { + const url = `https://${SUSHI_DATA_API_HOST}` + const chainId = variables.chainId as ChainId + + if (!isSushiSwapV3ChainId(chainId)) { + throw new Error('Invalid chainId') + } + + const result = await request( + { + url, + document: V3PoolsQuery, + variables: { + chainId: chainId, + }, + }, + options, + ) + + if (result.v3Pools) { + return result.v3Pools.map( + (pool) => + ({ + id: pool.id as `${string}:0x${string}`, + address: pool.address as Address, + chainId, + name: pool.name, + swapFee: pool.swapFee, + protocol: SushiSwapProtocol.SUSHISWAP_V3, + isProtocolFeeEnabled: pool.isProtocolFeeEnabled, + token0: { + id: pool.token0.id as `${string}:0x${string}`, + address: pool.token0.address as Address, + chainId, + decimals: pool.token0.decimals, + name: pool.token0.name, + symbol: pool.token0.symbol, + }, + token1: { + id: pool.token1.id as `${string}:0x${string}`, + address: pool.token1.address as Address, + chainId, + decimals: pool.token1.decimals, + name: pool.token1.name, + symbol: pool.token1.symbol, + }, + + reserve0: BigInt(pool.reserve0), + reserve1: BigInt(pool.reserve1), + liquidity: BigInt(pool.liquidity), + token0Price: pool.token0Price, + token1Price: pool.token1Price, + + sqrtPrice: BigInt(pool.sqrtPrice), + tick: BigInt(pool.tick), + observationIndex: BigInt(pool.observationIndex), + feeGrowthGlobal0X128: BigInt(pool.feeGrowthGlobal0X128), + feeGrowthGlobal1X128: BigInt(pool.feeGrowthGlobal1X128), + + liquidityUSD: pool.liquidityUSD, + volumeUSD: pool.volumeUSD, + feesUSD: pool.feesUSD, + txCount: pool.txCount, + }) satisfies PoolV3, + ) + } + return [] +} + + +export type V3BasePool = NonNullable>>[0] \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index e7b3cbef99..995bb1c206 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -1,3 +1,8 @@ +""" +Indicates exactly one field must be supplied and this field must not be `null`. +""" +directive @oneOf on INPUT_OBJECT + type Bucket { id: ID! date: Int! @@ -21,6 +26,7 @@ type Query { v2PoolBuckets(address: String!, chainId: Int!): PoolBuckets! v3PoolBuckets(address: String!, chainId: Int!): PoolBuckets! v3PoolsByTokens(token0: String!, token1: String!, chainId: Int!): [V3BasePool!]! + v3Pools(chainId: Int!): [V3BasePool!]! portfolioWallet(id: ID!): PortfolioWallet! portfolioLiquidityPositions(id: ID!): PortfolioPositions! portfolioClaimables(id: ID!): PortfolioClaimables! @@ -130,6 +136,7 @@ type V3BasePool { address: String! chainId: Int! protocol: String! + isProtocolFeeEnabled: Boolean! name: String! createdAt: String! swapFee: Float! diff --git a/packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts b/packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts deleted file mode 100644 index a0e7dad6fa..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/fragments/pool-fields.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { graphql } from '../graphql' - -export const PoolFieldsFragment = graphql(` - fragment PoolFields on Pool @_unmask { - id - token0 { - id - symbol - name - decimals - } - token1 { - id - symbol - name - decimals - } - - isProtocolFeeEnabled - - swapFee: feeTier - - liquidity - sqrtPrice - feeGrowthGlobal0X128 - feeGrowthGlobal1X128 - token0Price - token1Price - tick - observationIndex - - volumeToken0 - volumeToken1 - volumeUSD - untrackedVolumeUSD - - feesUSD - collectedFeesToken0 - collectedFeesToken1 - collectedFeesUSD - - reserve0: totalValueLockedToken0 - reserve1: totalValueLockedToken1 - liquidityUSD: totalValueLockedUSD - untrackedLiquidityUSD: totalValueLockedUSDUntracked - - liquidityProviderCount - txCount - - createdAtTimestamp - createdAtBlockNumber - } -`) diff --git a/packages/graph-client/src/subgraphs/sushi-v3/graphql.ts b/packages/graph-client/src/subgraphs/sushi-v3/graphql.ts deleted file mode 100644 index 09d313d696..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/graphql.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { initGraphQLTada } from 'gql.tada' -import type { Scalars } from 'src/lib/types/scalars.js' -import type { introspection } from './sushi-v3-env.js' - -export const graphql = initGraphQLTada<{ - introspection: introspection - scalars: Scalars -}>() diff --git a/packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts b/packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts deleted file mode 100644 index ff3a23a27f..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/queries/pools.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type { VariablesOf } from 'gql.tada' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { SUSHISWAP_V3_SUBGRAPH_URL } from 'sushi/config/subgraph' - -import { FetchError } from 'src/lib/fetch-error' -import type { RequestOptions } from 'src/lib/request' -import { requestPaged } from 'src/lib/request-paged' -import type { ChainIdVariable } from 'src/lib/types/chainId' -import { PoolFieldsFragment } from '../fragments/pool-fields' -import { transformPoolV3ToBase } from '../transforms/pool-v3-to-base' -import { graphql } from '../graphql' - -export const SushiV3PoolsQuery = graphql( - ` - query Pools($first: Int = 1000, $skip: Int = 0, $block: Block_height, $orderBy: Pool_orderBy, $orderDirection: OrderDirection, $where: Pool_filter) { - pools(first: $first, skip: $skip, block: $block, orderBy: $orderBy, orderDirection: $orderDirection, where: $where) { - ...PoolFields - } - } -`, - [PoolFieldsFragment], -) - -export type GetSushiV3Pools = VariablesOf & - ChainIdVariable - -export async function getSushiV3Pools( - { chainId, ...variables }: GetSushiV3Pools, - options?: RequestOptions, -) { - const url = `https://${SUSHISWAP_V3_SUBGRAPH_URL[chainId]}` - - const result = await requestPaged({ - chainId, - url, - query: SushiV3PoolsQuery, - variables, - options, - }) - - if (result) { - return result.pools.map((pool) => transformPoolV3ToBase(pool, chainId)) - } - - throw new FetchError(chainId, 'Failed to fetch pools') -} - -export type SushiV3Pools = Awaited> diff --git a/packages/graph-client/src/subgraphs/sushi-v3/schema.graphql b/packages/graph-client/src/subgraphs/sushi-v3/schema.graphql deleted file mode 100644 index 81ac3333f6..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/schema.graphql +++ /dev/null @@ -1,6541 +0,0 @@ -""" -Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive. -""" -directive @entity on OBJECT - -"""Defined a Subgraph ID for an object type""" -directive @subgraphId(id: String!) on OBJECT - -""" -creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API. -""" -directive @derivedFrom(field: String!) on FIELD_DEFINITION - -enum Aggregation_interval { - hour - day -} - -scalar BigDecimal - -scalar BigInt - -input BlockChangedFilter { - number_gte: Int! -} - -input Block_height { - hash: Bytes - number: Int - number_gte: Int -} - -type Bundle { - id: ID! - ethPriceUSD: BigDecimal! -} - -input Bundle_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - ethPriceUSD: BigDecimal - ethPriceUSD_not: BigDecimal - ethPriceUSD_gt: BigDecimal - ethPriceUSD_lt: BigDecimal - ethPriceUSD_gte: BigDecimal - ethPriceUSD_lte: BigDecimal - ethPriceUSD_in: [BigDecimal!] - ethPriceUSD_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Bundle_filter] - or: [Bundle_filter] -} - -enum Bundle_orderBy { - id - ethPriceUSD -} - -type Burn { - id: ID! - transaction: Transaction! - pool: Pool! - token0: Token! - token1: Token! - timestamp: BigInt! - owner: Bytes - origin: Bytes! - amount: BigInt! - amount0: BigDecimal! - amount1: BigDecimal! - amountUSD: BigDecimal - tickLower: BigInt! - tickUpper: BigInt! - logIndex: BigInt -} - -input Burn_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - owner: Bytes - owner_not: Bytes - owner_gt: Bytes - owner_lt: Bytes - owner_gte: Bytes - owner_lte: Bytes - owner_in: [Bytes!] - owner_not_in: [Bytes!] - owner_contains: Bytes - owner_not_contains: Bytes - origin: Bytes - origin_not: Bytes - origin_gt: Bytes - origin_lt: Bytes - origin_gte: Bytes - origin_lte: Bytes - origin_in: [Bytes!] - origin_not_in: [Bytes!] - origin_contains: Bytes - origin_not_contains: Bytes - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - tickLower: BigInt - tickLower_not: BigInt - tickLower_gt: BigInt - tickLower_lt: BigInt - tickLower_gte: BigInt - tickLower_lte: BigInt - tickLower_in: [BigInt!] - tickLower_not_in: [BigInt!] - tickUpper: BigInt - tickUpper_not: BigInt - tickUpper_gt: BigInt - tickUpper_lt: BigInt - tickUpper_gte: BigInt - tickUpper_lte: BigInt - tickUpper_in: [BigInt!] - tickUpper_not_in: [BigInt!] - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Burn_filter] - or: [Burn_filter] -} - -enum Burn_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - timestamp - owner - origin - amount - amount0 - amount1 - amountUSD - tickLower - tickUpper - logIndex -} - -scalar Bytes - -type Collect { - id: ID! - transaction: Transaction! - timestamp: BigInt! - pool: Pool! - owner: Bytes - amount0: BigDecimal! - amount1: BigDecimal! - amountUSD: BigDecimal - tickLower: BigInt! - tickUpper: BigInt! - logIndex: BigInt -} - -input Collect_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - owner: Bytes - owner_not: Bytes - owner_gt: Bytes - owner_lt: Bytes - owner_gte: Bytes - owner_lte: Bytes - owner_in: [Bytes!] - owner_not_in: [Bytes!] - owner_contains: Bytes - owner_not_contains: Bytes - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - tickLower: BigInt - tickLower_not: BigInt - tickLower_gt: BigInt - tickLower_lt: BigInt - tickLower_gte: BigInt - tickLower_lte: BigInt - tickLower_in: [BigInt!] - tickLower_not_in: [BigInt!] - tickUpper: BigInt - tickUpper_not: BigInt - tickUpper_gt: BigInt - tickUpper_lt: BigInt - tickUpper_gte: BigInt - tickUpper_lte: BigInt - tickUpper_in: [BigInt!] - tickUpper_not_in: [BigInt!] - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Collect_filter] - or: [Collect_filter] -} - -enum Collect_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - timestamp - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - owner - amount0 - amount1 - amountUSD - tickLower - tickUpper - logIndex -} - -type DecreaseEvent { - id: ID! - pool: Pool! - tokenID: BigInt! - position: Position! - amount0: BigInt! - amount1: BigInt! - token0: Token! - token1: Token! - timeStamp: BigInt! - transaction: Transaction! -} - -input DecreaseEvent_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - tokenID: BigInt - tokenID_not: BigInt - tokenID_gt: BigInt - tokenID_lt: BigInt - tokenID_gte: BigInt - tokenID_lte: BigInt - tokenID_in: [BigInt!] - tokenID_not_in: [BigInt!] - position: String - position_not: String - position_gt: String - position_lt: String - position_gte: String - position_lte: String - position_in: [String!] - position_not_in: [String!] - position_contains: String - position_contains_nocase: String - position_not_contains: String - position_not_contains_nocase: String - position_starts_with: String - position_starts_with_nocase: String - position_not_starts_with: String - position_not_starts_with_nocase: String - position_ends_with: String - position_ends_with_nocase: String - position_not_ends_with: String - position_not_ends_with_nocase: String - position_: Position_filter - amount0: BigInt - amount0_not: BigInt - amount0_gt: BigInt - amount0_lt: BigInt - amount0_gte: BigInt - amount0_lte: BigInt - amount0_in: [BigInt!] - amount0_not_in: [BigInt!] - amount1: BigInt - amount1_not: BigInt - amount1_gt: BigInt - amount1_lt: BigInt - amount1_gte: BigInt - amount1_lte: BigInt - amount1_in: [BigInt!] - amount1_not_in: [BigInt!] - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [DecreaseEvent_filter] - or: [DecreaseEvent_filter] -} - -enum DecreaseEvent_orderBy { - id - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - tokenID - position - position__id - position__owner - position__liquidity - position__depositedToken0 - position__depositedToken1 - position__withdrawnToken0 - position__withdrawnToken1 - position__collectedToken0 - position__collectedToken1 - position__collectedFeesToken0 - position__collectedFeesToken1 - position__amountDepositedUSD - position__amountWithdrawnUSD - position__amountCollectedUSD - position__feeGrowthInside0LastX128 - position__feeGrowthInside1LastX128 - amount0 - amount1 - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - timeStamp - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice -} - -type Factory { - id: ID! - poolCount: BigInt! - txCount: BigInt! - totalVolumeUSD: BigDecimal! - totalVolumeETH: BigDecimal! - totalFeesUSD: BigDecimal! - totalFeesETH: BigDecimal! - untrackedVolumeUSD: BigDecimal! - totalValueLockedUSD: BigDecimal! - totalValueLockedETH: BigDecimal! - totalValueLockedUSDUntracked: BigDecimal! - totalValueLockedETHUntracked: BigDecimal! - owner: ID! -} - -input Factory_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - poolCount: BigInt - poolCount_not: BigInt - poolCount_gt: BigInt - poolCount_lt: BigInt - poolCount_gte: BigInt - poolCount_lte: BigInt - poolCount_in: [BigInt!] - poolCount_not_in: [BigInt!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - totalVolumeUSD: BigDecimal - totalVolumeUSD_not: BigDecimal - totalVolumeUSD_gt: BigDecimal - totalVolumeUSD_lt: BigDecimal - totalVolumeUSD_gte: BigDecimal - totalVolumeUSD_lte: BigDecimal - totalVolumeUSD_in: [BigDecimal!] - totalVolumeUSD_not_in: [BigDecimal!] - totalVolumeETH: BigDecimal - totalVolumeETH_not: BigDecimal - totalVolumeETH_gt: BigDecimal - totalVolumeETH_lt: BigDecimal - totalVolumeETH_gte: BigDecimal - totalVolumeETH_lte: BigDecimal - totalVolumeETH_in: [BigDecimal!] - totalVolumeETH_not_in: [BigDecimal!] - totalFeesUSD: BigDecimal - totalFeesUSD_not: BigDecimal - totalFeesUSD_gt: BigDecimal - totalFeesUSD_lt: BigDecimal - totalFeesUSD_gte: BigDecimal - totalFeesUSD_lte: BigDecimal - totalFeesUSD_in: [BigDecimal!] - totalFeesUSD_not_in: [BigDecimal!] - totalFeesETH: BigDecimal - totalFeesETH_not: BigDecimal - totalFeesETH_gt: BigDecimal - totalFeesETH_lt: BigDecimal - totalFeesETH_gte: BigDecimal - totalFeesETH_lte: BigDecimal - totalFeesETH_in: [BigDecimal!] - totalFeesETH_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - totalValueLockedUSD: BigDecimal - totalValueLockedUSD_not: BigDecimal - totalValueLockedUSD_gt: BigDecimal - totalValueLockedUSD_lt: BigDecimal - totalValueLockedUSD_gte: BigDecimal - totalValueLockedUSD_lte: BigDecimal - totalValueLockedUSD_in: [BigDecimal!] - totalValueLockedUSD_not_in: [BigDecimal!] - totalValueLockedETH: BigDecimal - totalValueLockedETH_not: BigDecimal - totalValueLockedETH_gt: BigDecimal - totalValueLockedETH_lt: BigDecimal - totalValueLockedETH_gte: BigDecimal - totalValueLockedETH_lte: BigDecimal - totalValueLockedETH_in: [BigDecimal!] - totalValueLockedETH_not_in: [BigDecimal!] - totalValueLockedUSDUntracked: BigDecimal - totalValueLockedUSDUntracked_not: BigDecimal - totalValueLockedUSDUntracked_gt: BigDecimal - totalValueLockedUSDUntracked_lt: BigDecimal - totalValueLockedUSDUntracked_gte: BigDecimal - totalValueLockedUSDUntracked_lte: BigDecimal - totalValueLockedUSDUntracked_in: [BigDecimal!] - totalValueLockedUSDUntracked_not_in: [BigDecimal!] - totalValueLockedETHUntracked: BigDecimal - totalValueLockedETHUntracked_not: BigDecimal - totalValueLockedETHUntracked_gt: BigDecimal - totalValueLockedETHUntracked_lt: BigDecimal - totalValueLockedETHUntracked_gte: BigDecimal - totalValueLockedETHUntracked_lte: BigDecimal - totalValueLockedETHUntracked_in: [BigDecimal!] - totalValueLockedETHUntracked_not_in: [BigDecimal!] - owner: ID - owner_not: ID - owner_gt: ID - owner_lt: ID - owner_gte: ID - owner_lte: ID - owner_in: [ID!] - owner_not_in: [ID!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Factory_filter] - or: [Factory_filter] -} - -enum Factory_orderBy { - id - poolCount - txCount - totalVolumeUSD - totalVolumeETH - totalFeesUSD - totalFeesETH - untrackedVolumeUSD - totalValueLockedUSD - totalValueLockedETH - totalValueLockedUSDUntracked - totalValueLockedETHUntracked - owner -} - -type Flash { - id: ID! - transaction: Transaction! - timestamp: BigInt! - pool: Pool! - sender: Bytes! - recipient: Bytes! - amount0: BigDecimal! - amount1: BigDecimal! - amountUSD: BigDecimal! - amount0Paid: BigDecimal! - amount1Paid: BigDecimal! - logIndex: BigInt -} - -input Flash_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - sender: Bytes - sender_not: Bytes - sender_gt: Bytes - sender_lt: Bytes - sender_gte: Bytes - sender_lte: Bytes - sender_in: [Bytes!] - sender_not_in: [Bytes!] - sender_contains: Bytes - sender_not_contains: Bytes - recipient: Bytes - recipient_not: Bytes - recipient_gt: Bytes - recipient_lt: Bytes - recipient_gte: Bytes - recipient_lte: Bytes - recipient_in: [Bytes!] - recipient_not_in: [Bytes!] - recipient_contains: Bytes - recipient_not_contains: Bytes - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - amount0Paid: BigDecimal - amount0Paid_not: BigDecimal - amount0Paid_gt: BigDecimal - amount0Paid_lt: BigDecimal - amount0Paid_gte: BigDecimal - amount0Paid_lte: BigDecimal - amount0Paid_in: [BigDecimal!] - amount0Paid_not_in: [BigDecimal!] - amount1Paid: BigDecimal - amount1Paid_not: BigDecimal - amount1Paid_gt: BigDecimal - amount1Paid_lt: BigDecimal - amount1Paid_gte: BigDecimal - amount1Paid_lte: BigDecimal - amount1Paid_in: [BigDecimal!] - amount1Paid_not_in: [BigDecimal!] - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Flash_filter] - or: [Flash_filter] -} - -enum Flash_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - timestamp - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - sender - recipient - amount0 - amount1 - amountUSD - amount0Paid - amount1Paid - logIndex -} - -type IncreaseEvent { - id: ID! - pool: Pool! - tokenID: BigInt! - position: Position! - amount0: BigInt! - amount1: BigInt! - token0: Token! - token1: Token! - timeStamp: BigInt! - transaction: Transaction! -} - -input IncreaseEvent_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - tokenID: BigInt - tokenID_not: BigInt - tokenID_gt: BigInt - tokenID_lt: BigInt - tokenID_gte: BigInt - tokenID_lte: BigInt - tokenID_in: [BigInt!] - tokenID_not_in: [BigInt!] - position: String - position_not: String - position_gt: String - position_lt: String - position_gte: String - position_lte: String - position_in: [String!] - position_not_in: [String!] - position_contains: String - position_contains_nocase: String - position_not_contains: String - position_not_contains_nocase: String - position_starts_with: String - position_starts_with_nocase: String - position_not_starts_with: String - position_not_starts_with_nocase: String - position_ends_with: String - position_ends_with_nocase: String - position_not_ends_with: String - position_not_ends_with_nocase: String - position_: Position_filter - amount0: BigInt - amount0_not: BigInt - amount0_gt: BigInt - amount0_lt: BigInt - amount0_gte: BigInt - amount0_lte: BigInt - amount0_in: [BigInt!] - amount0_not_in: [BigInt!] - amount1: BigInt - amount1_not: BigInt - amount1_gt: BigInt - amount1_lt: BigInt - amount1_gte: BigInt - amount1_lte: BigInt - amount1_in: [BigInt!] - amount1_not_in: [BigInt!] - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - timeStamp: BigInt - timeStamp_not: BigInt - timeStamp_gt: BigInt - timeStamp_lt: BigInt - timeStamp_gte: BigInt - timeStamp_lte: BigInt - timeStamp_in: [BigInt!] - timeStamp_not_in: [BigInt!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [IncreaseEvent_filter] - or: [IncreaseEvent_filter] -} - -enum IncreaseEvent_orderBy { - id - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - tokenID - position - position__id - position__owner - position__liquidity - position__depositedToken0 - position__depositedToken1 - position__withdrawnToken0 - position__withdrawnToken1 - position__collectedToken0 - position__collectedToken1 - position__collectedFeesToken0 - position__collectedFeesToken1 - position__amountDepositedUSD - position__amountWithdrawnUSD - position__amountCollectedUSD - position__feeGrowthInside0LastX128 - position__feeGrowthInside1LastX128 - amount0 - amount1 - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - timeStamp - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice -} - -"8 bytes signed integer\n" -scalar Int8 - -type Mint { - id: ID! - transaction: Transaction! - timestamp: BigInt! - pool: Pool! - token0: Token! - token1: Token! - owner: Bytes! - sender: Bytes - origin: Bytes! - amount: BigInt! - amount0: BigDecimal! - amount1: BigDecimal! - amountUSD: BigDecimal - tickLower: BigInt! - tickUpper: BigInt! - logIndex: BigInt -} - -input Mint_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - owner: Bytes - owner_not: Bytes - owner_gt: Bytes - owner_lt: Bytes - owner_gte: Bytes - owner_lte: Bytes - owner_in: [Bytes!] - owner_not_in: [Bytes!] - owner_contains: Bytes - owner_not_contains: Bytes - sender: Bytes - sender_not: Bytes - sender_gt: Bytes - sender_lt: Bytes - sender_gte: Bytes - sender_lte: Bytes - sender_in: [Bytes!] - sender_not_in: [Bytes!] - sender_contains: Bytes - sender_not_contains: Bytes - origin: Bytes - origin_not: Bytes - origin_gt: Bytes - origin_lt: Bytes - origin_gte: Bytes - origin_lte: Bytes - origin_in: [Bytes!] - origin_not_in: [Bytes!] - origin_contains: Bytes - origin_not_contains: Bytes - amount: BigInt - amount_not: BigInt - amount_gt: BigInt - amount_lt: BigInt - amount_gte: BigInt - amount_lte: BigInt - amount_in: [BigInt!] - amount_not_in: [BigInt!] - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - tickLower: BigInt - tickLower_not: BigInt - tickLower_gt: BigInt - tickLower_lt: BigInt - tickLower_gte: BigInt - tickLower_lte: BigInt - tickLower_in: [BigInt!] - tickLower_not_in: [BigInt!] - tickUpper: BigInt - tickUpper_not: BigInt - tickUpper_gt: BigInt - tickUpper_lt: BigInt - tickUpper_gte: BigInt - tickUpper_lte: BigInt - tickUpper_in: [BigInt!] - tickUpper_not_in: [BigInt!] - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Mint_filter] - or: [Mint_filter] -} - -enum Mint_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - timestamp - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - owner - sender - origin - amount - amount0 - amount1 - amountUSD - tickLower - tickUpper - logIndex -} - -"""Defines the order direction, either ascending or descending""" -enum OrderDirection { - asc - desc -} - -type Pool { - id: ID! - createdAtTimestamp: BigInt! - createdAtBlockNumber: BigInt! - token0: Token! - token1: Token! - feeTier: BigInt! - liquidity: BigInt! - sqrtPrice: BigInt! - feeGrowthGlobal0X128: BigInt! - feeGrowthGlobal1X128: BigInt! - token0Price: BigDecimal! - token1Price: BigDecimal! - tick: BigInt - observationIndex: BigInt! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - feesUSD: BigDecimal! - txCount: BigInt! - collectedFeesToken0: BigDecimal! - collectedFeesToken1: BigDecimal! - collectedFeesUSD: BigDecimal! - totalValueLockedToken0: BigDecimal! - totalValueLockedToken1: BigDecimal! - totalValueLockedETH: BigDecimal! - totalValueLockedUSD: BigDecimal! - totalValueLockedUSDUntracked: BigDecimal! - isProtocolFeeEnabled: Boolean! - liquidityProviderCount: BigInt! - poolHourData(skip: Int = 0, first: Int = 100, orderBy: PoolHourData_orderBy, orderDirection: OrderDirection, where: PoolHourData_filter): [PoolHourData!]! - poolDayData(skip: Int = 0, first: Int = 100, orderBy: PoolDayData_orderBy, orderDirection: OrderDirection, where: PoolDayData_filter): [PoolDayData!]! - mints(skip: Int = 0, first: Int = 100, orderBy: Mint_orderBy, orderDirection: OrderDirection, where: Mint_filter): [Mint!]! - burns(skip: Int = 0, first: Int = 100, orderBy: Burn_orderBy, orderDirection: OrderDirection, where: Burn_filter): [Burn!]! - swaps(skip: Int = 0, first: Int = 100, orderBy: Swap_orderBy, orderDirection: OrderDirection, where: Swap_filter): [Swap!]! - collects(skip: Int = 0, first: Int = 100, orderBy: Collect_orderBy, orderDirection: OrderDirection, where: Collect_filter): [Collect!]! - ticks(skip: Int = 0, first: Int = 100, orderBy: Tick_orderBy, orderDirection: OrderDirection, where: Tick_filter): [Tick!]! -} - -type PoolDayData { - id: ID! - date: Int! - pool: Pool! - liquidity: BigInt! - sqrtPrice: BigInt! - token0Price: BigDecimal! - token1Price: BigDecimal! - tick: BigInt - feeGrowthGlobal0X128: BigInt! - feeGrowthGlobal1X128: BigInt! - tvlUSD: BigDecimal! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - feesUSD: BigDecimal! - txCount: BigInt! - open: BigDecimal! - high: BigDecimal! - low: BigDecimal! - close: BigDecimal! -} - -input PoolDayData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - liquidity: BigInt - liquidity_not: BigInt - liquidity_gt: BigInt - liquidity_lt: BigInt - liquidity_gte: BigInt - liquidity_lte: BigInt - liquidity_in: [BigInt!] - liquidity_not_in: [BigInt!] - sqrtPrice: BigInt - sqrtPrice_not: BigInt - sqrtPrice_gt: BigInt - sqrtPrice_lt: BigInt - sqrtPrice_gte: BigInt - sqrtPrice_lte: BigInt - sqrtPrice_in: [BigInt!] - sqrtPrice_not_in: [BigInt!] - token0Price: BigDecimal - token0Price_not: BigDecimal - token0Price_gt: BigDecimal - token0Price_lt: BigDecimal - token0Price_gte: BigDecimal - token0Price_lte: BigDecimal - token0Price_in: [BigDecimal!] - token0Price_not_in: [BigDecimal!] - token1Price: BigDecimal - token1Price_not: BigDecimal - token1Price_gt: BigDecimal - token1Price_lt: BigDecimal - token1Price_gte: BigDecimal - token1Price_lte: BigDecimal - token1Price_in: [BigDecimal!] - token1Price_not_in: [BigDecimal!] - tick: BigInt - tick_not: BigInt - tick_gt: BigInt - tick_lt: BigInt - tick_gte: BigInt - tick_lte: BigInt - tick_in: [BigInt!] - tick_not_in: [BigInt!] - feeGrowthGlobal0X128: BigInt - feeGrowthGlobal0X128_not: BigInt - feeGrowthGlobal0X128_gt: BigInt - feeGrowthGlobal0X128_lt: BigInt - feeGrowthGlobal0X128_gte: BigInt - feeGrowthGlobal0X128_lte: BigInt - feeGrowthGlobal0X128_in: [BigInt!] - feeGrowthGlobal0X128_not_in: [BigInt!] - feeGrowthGlobal1X128: BigInt - feeGrowthGlobal1X128_not: BigInt - feeGrowthGlobal1X128_gt: BigInt - feeGrowthGlobal1X128_lt: BigInt - feeGrowthGlobal1X128_gte: BigInt - feeGrowthGlobal1X128_lte: BigInt - feeGrowthGlobal1X128_in: [BigInt!] - feeGrowthGlobal1X128_not_in: [BigInt!] - tvlUSD: BigDecimal - tvlUSD_not: BigDecimal - tvlUSD_gt: BigDecimal - tvlUSD_lt: BigDecimal - tvlUSD_gte: BigDecimal - tvlUSD_lte: BigDecimal - tvlUSD_in: [BigDecimal!] - tvlUSD_not_in: [BigDecimal!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - open: BigDecimal - open_not: BigDecimal - open_gt: BigDecimal - open_lt: BigDecimal - open_gte: BigDecimal - open_lte: BigDecimal - open_in: [BigDecimal!] - open_not_in: [BigDecimal!] - high: BigDecimal - high_not: BigDecimal - high_gt: BigDecimal - high_lt: BigDecimal - high_gte: BigDecimal - high_lte: BigDecimal - high_in: [BigDecimal!] - high_not_in: [BigDecimal!] - low: BigDecimal - low_not: BigDecimal - low_gt: BigDecimal - low_lt: BigDecimal - low_gte: BigDecimal - low_lte: BigDecimal - low_in: [BigDecimal!] - low_not_in: [BigDecimal!] - close: BigDecimal - close_not: BigDecimal - close_gt: BigDecimal - close_lt: BigDecimal - close_gte: BigDecimal - close_lte: BigDecimal - close_in: [BigDecimal!] - close_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PoolDayData_filter] - or: [PoolDayData_filter] -} - -enum PoolDayData_orderBy { - id - date - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - liquidity - sqrtPrice - token0Price - token1Price - tick - feeGrowthGlobal0X128 - feeGrowthGlobal1X128 - tvlUSD - volumeToken0 - volumeToken1 - volumeUSD - feesUSD - txCount - open - high - low - close -} - -type PoolHourData { - id: ID! - periodStartUnix: Int! - pool: Pool! - liquidity: BigInt! - sqrtPrice: BigInt! - token0Price: BigDecimal! - token1Price: BigDecimal! - tick: BigInt - feeGrowthGlobal0X128: BigInt! - feeGrowthGlobal1X128: BigInt! - tvlUSD: BigDecimal! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - feesUSD: BigDecimal! - txCount: BigInt! - open: BigDecimal! - high: BigDecimal! - low: BigDecimal! - close: BigDecimal! -} - -input PoolHourData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - periodStartUnix: Int - periodStartUnix_not: Int - periodStartUnix_gt: Int - periodStartUnix_lt: Int - periodStartUnix_gte: Int - periodStartUnix_lte: Int - periodStartUnix_in: [Int!] - periodStartUnix_not_in: [Int!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - liquidity: BigInt - liquidity_not: BigInt - liquidity_gt: BigInt - liquidity_lt: BigInt - liquidity_gte: BigInt - liquidity_lte: BigInt - liquidity_in: [BigInt!] - liquidity_not_in: [BigInt!] - sqrtPrice: BigInt - sqrtPrice_not: BigInt - sqrtPrice_gt: BigInt - sqrtPrice_lt: BigInt - sqrtPrice_gte: BigInt - sqrtPrice_lte: BigInt - sqrtPrice_in: [BigInt!] - sqrtPrice_not_in: [BigInt!] - token0Price: BigDecimal - token0Price_not: BigDecimal - token0Price_gt: BigDecimal - token0Price_lt: BigDecimal - token0Price_gte: BigDecimal - token0Price_lte: BigDecimal - token0Price_in: [BigDecimal!] - token0Price_not_in: [BigDecimal!] - token1Price: BigDecimal - token1Price_not: BigDecimal - token1Price_gt: BigDecimal - token1Price_lt: BigDecimal - token1Price_gte: BigDecimal - token1Price_lte: BigDecimal - token1Price_in: [BigDecimal!] - token1Price_not_in: [BigDecimal!] - tick: BigInt - tick_not: BigInt - tick_gt: BigInt - tick_lt: BigInt - tick_gte: BigInt - tick_lte: BigInt - tick_in: [BigInt!] - tick_not_in: [BigInt!] - feeGrowthGlobal0X128: BigInt - feeGrowthGlobal0X128_not: BigInt - feeGrowthGlobal0X128_gt: BigInt - feeGrowthGlobal0X128_lt: BigInt - feeGrowthGlobal0X128_gte: BigInt - feeGrowthGlobal0X128_lte: BigInt - feeGrowthGlobal0X128_in: [BigInt!] - feeGrowthGlobal0X128_not_in: [BigInt!] - feeGrowthGlobal1X128: BigInt - feeGrowthGlobal1X128_not: BigInt - feeGrowthGlobal1X128_gt: BigInt - feeGrowthGlobal1X128_lt: BigInt - feeGrowthGlobal1X128_gte: BigInt - feeGrowthGlobal1X128_lte: BigInt - feeGrowthGlobal1X128_in: [BigInt!] - feeGrowthGlobal1X128_not_in: [BigInt!] - tvlUSD: BigDecimal - tvlUSD_not: BigDecimal - tvlUSD_gt: BigDecimal - tvlUSD_lt: BigDecimal - tvlUSD_gte: BigDecimal - tvlUSD_lte: BigDecimal - tvlUSD_in: [BigDecimal!] - tvlUSD_not_in: [BigDecimal!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - open: BigDecimal - open_not: BigDecimal - open_gt: BigDecimal - open_lt: BigDecimal - open_gte: BigDecimal - open_lte: BigDecimal - open_in: [BigDecimal!] - open_not_in: [BigDecimal!] - high: BigDecimal - high_not: BigDecimal - high_gt: BigDecimal - high_lt: BigDecimal - high_gte: BigDecimal - high_lte: BigDecimal - high_in: [BigDecimal!] - high_not_in: [BigDecimal!] - low: BigDecimal - low_not: BigDecimal - low_gt: BigDecimal - low_lt: BigDecimal - low_gte: BigDecimal - low_lte: BigDecimal - low_in: [BigDecimal!] - low_not_in: [BigDecimal!] - close: BigDecimal - close_not: BigDecimal - close_gt: BigDecimal - close_lt: BigDecimal - close_gte: BigDecimal - close_lte: BigDecimal - close_in: [BigDecimal!] - close_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PoolHourData_filter] - or: [PoolHourData_filter] -} - -enum PoolHourData_orderBy { - id - periodStartUnix - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - liquidity - sqrtPrice - token0Price - token1Price - tick - feeGrowthGlobal0X128 - feeGrowthGlobal1X128 - tvlUSD - volumeToken0 - volumeToken1 - volumeUSD - feesUSD - txCount - open - high - low - close -} - -input Pool_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - createdAtTimestamp: BigInt - createdAtTimestamp_not: BigInt - createdAtTimestamp_gt: BigInt - createdAtTimestamp_lt: BigInt - createdAtTimestamp_gte: BigInt - createdAtTimestamp_lte: BigInt - createdAtTimestamp_in: [BigInt!] - createdAtTimestamp_not_in: [BigInt!] - createdAtBlockNumber: BigInt - createdAtBlockNumber_not: BigInt - createdAtBlockNumber_gt: BigInt - createdAtBlockNumber_lt: BigInt - createdAtBlockNumber_gte: BigInt - createdAtBlockNumber_lte: BigInt - createdAtBlockNumber_in: [BigInt!] - createdAtBlockNumber_not_in: [BigInt!] - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - feeTier: BigInt - feeTier_not: BigInt - feeTier_gt: BigInt - feeTier_lt: BigInt - feeTier_gte: BigInt - feeTier_lte: BigInt - feeTier_in: [BigInt!] - feeTier_not_in: [BigInt!] - liquidity: BigInt - liquidity_not: BigInt - liquidity_gt: BigInt - liquidity_lt: BigInt - liquidity_gte: BigInt - liquidity_lte: BigInt - liquidity_in: [BigInt!] - liquidity_not_in: [BigInt!] - sqrtPrice: BigInt - sqrtPrice_not: BigInt - sqrtPrice_gt: BigInt - sqrtPrice_lt: BigInt - sqrtPrice_gte: BigInt - sqrtPrice_lte: BigInt - sqrtPrice_in: [BigInt!] - sqrtPrice_not_in: [BigInt!] - feeGrowthGlobal0X128: BigInt - feeGrowthGlobal0X128_not: BigInt - feeGrowthGlobal0X128_gt: BigInt - feeGrowthGlobal0X128_lt: BigInt - feeGrowthGlobal0X128_gte: BigInt - feeGrowthGlobal0X128_lte: BigInt - feeGrowthGlobal0X128_in: [BigInt!] - feeGrowthGlobal0X128_not_in: [BigInt!] - feeGrowthGlobal1X128: BigInt - feeGrowthGlobal1X128_not: BigInt - feeGrowthGlobal1X128_gt: BigInt - feeGrowthGlobal1X128_lt: BigInt - feeGrowthGlobal1X128_gte: BigInt - feeGrowthGlobal1X128_lte: BigInt - feeGrowthGlobal1X128_in: [BigInt!] - feeGrowthGlobal1X128_not_in: [BigInt!] - token0Price: BigDecimal - token0Price_not: BigDecimal - token0Price_gt: BigDecimal - token0Price_lt: BigDecimal - token0Price_gte: BigDecimal - token0Price_lte: BigDecimal - token0Price_in: [BigDecimal!] - token0Price_not_in: [BigDecimal!] - token1Price: BigDecimal - token1Price_not: BigDecimal - token1Price_gt: BigDecimal - token1Price_lt: BigDecimal - token1Price_gte: BigDecimal - token1Price_lte: BigDecimal - token1Price_in: [BigDecimal!] - token1Price_not_in: [BigDecimal!] - tick: BigInt - tick_not: BigInt - tick_gt: BigInt - tick_lt: BigInt - tick_gte: BigInt - tick_lte: BigInt - tick_in: [BigInt!] - tick_not_in: [BigInt!] - observationIndex: BigInt - observationIndex_not: BigInt - observationIndex_gt: BigInt - observationIndex_lt: BigInt - observationIndex_gte: BigInt - observationIndex_lte: BigInt - observationIndex_in: [BigInt!] - observationIndex_not_in: [BigInt!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - collectedFeesToken0: BigDecimal - collectedFeesToken0_not: BigDecimal - collectedFeesToken0_gt: BigDecimal - collectedFeesToken0_lt: BigDecimal - collectedFeesToken0_gte: BigDecimal - collectedFeesToken0_lte: BigDecimal - collectedFeesToken0_in: [BigDecimal!] - collectedFeesToken0_not_in: [BigDecimal!] - collectedFeesToken1: BigDecimal - collectedFeesToken1_not: BigDecimal - collectedFeesToken1_gt: BigDecimal - collectedFeesToken1_lt: BigDecimal - collectedFeesToken1_gte: BigDecimal - collectedFeesToken1_lte: BigDecimal - collectedFeesToken1_in: [BigDecimal!] - collectedFeesToken1_not_in: [BigDecimal!] - collectedFeesUSD: BigDecimal - collectedFeesUSD_not: BigDecimal - collectedFeesUSD_gt: BigDecimal - collectedFeesUSD_lt: BigDecimal - collectedFeesUSD_gte: BigDecimal - collectedFeesUSD_lte: BigDecimal - collectedFeesUSD_in: [BigDecimal!] - collectedFeesUSD_not_in: [BigDecimal!] - totalValueLockedToken0: BigDecimal - totalValueLockedToken0_not: BigDecimal - totalValueLockedToken0_gt: BigDecimal - totalValueLockedToken0_lt: BigDecimal - totalValueLockedToken0_gte: BigDecimal - totalValueLockedToken0_lte: BigDecimal - totalValueLockedToken0_in: [BigDecimal!] - totalValueLockedToken0_not_in: [BigDecimal!] - totalValueLockedToken1: BigDecimal - totalValueLockedToken1_not: BigDecimal - totalValueLockedToken1_gt: BigDecimal - totalValueLockedToken1_lt: BigDecimal - totalValueLockedToken1_gte: BigDecimal - totalValueLockedToken1_lte: BigDecimal - totalValueLockedToken1_in: [BigDecimal!] - totalValueLockedToken1_not_in: [BigDecimal!] - totalValueLockedETH: BigDecimal - totalValueLockedETH_not: BigDecimal - totalValueLockedETH_gt: BigDecimal - totalValueLockedETH_lt: BigDecimal - totalValueLockedETH_gte: BigDecimal - totalValueLockedETH_lte: BigDecimal - totalValueLockedETH_in: [BigDecimal!] - totalValueLockedETH_not_in: [BigDecimal!] - totalValueLockedUSD: BigDecimal - totalValueLockedUSD_not: BigDecimal - totalValueLockedUSD_gt: BigDecimal - totalValueLockedUSD_lt: BigDecimal - totalValueLockedUSD_gte: BigDecimal - totalValueLockedUSD_lte: BigDecimal - totalValueLockedUSD_in: [BigDecimal!] - totalValueLockedUSD_not_in: [BigDecimal!] - totalValueLockedUSDUntracked: BigDecimal - totalValueLockedUSDUntracked_not: BigDecimal - totalValueLockedUSDUntracked_gt: BigDecimal - totalValueLockedUSDUntracked_lt: BigDecimal - totalValueLockedUSDUntracked_gte: BigDecimal - totalValueLockedUSDUntracked_lte: BigDecimal - totalValueLockedUSDUntracked_in: [BigDecimal!] - totalValueLockedUSDUntracked_not_in: [BigDecimal!] - isProtocolFeeEnabled: Boolean - isProtocolFeeEnabled_not: Boolean - isProtocolFeeEnabled_in: [Boolean!] - isProtocolFeeEnabled_not_in: [Boolean!] - liquidityProviderCount: BigInt - liquidityProviderCount_not: BigInt - liquidityProviderCount_gt: BigInt - liquidityProviderCount_lt: BigInt - liquidityProviderCount_gte: BigInt - liquidityProviderCount_lte: BigInt - liquidityProviderCount_in: [BigInt!] - liquidityProviderCount_not_in: [BigInt!] - poolHourData_: PoolHourData_filter - poolDayData_: PoolDayData_filter - mints_: Mint_filter - burns_: Burn_filter - swaps_: Swap_filter - collects_: Collect_filter - ticks_: Tick_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Pool_filter] - or: [Pool_filter] -} - -enum Pool_orderBy { - id - createdAtTimestamp - createdAtBlockNumber - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - feeTier - liquidity - sqrtPrice - feeGrowthGlobal0X128 - feeGrowthGlobal1X128 - token0Price - token1Price - tick - observationIndex - volumeToken0 - volumeToken1 - volumeUSD - untrackedVolumeUSD - feesUSD - txCount - collectedFeesToken0 - collectedFeesToken1 - collectedFeesUSD - totalValueLockedToken0 - totalValueLockedToken1 - totalValueLockedETH - totalValueLockedUSD - totalValueLockedUSDUntracked - isProtocolFeeEnabled - liquidityProviderCount - poolHourData - poolDayData - mints - burns - swaps - collects - ticks -} - -type Position { - id: ID! - owner: Bytes! - pool: Pool! - token0: Token! - token1: Token! - tickLower: Tick! - tickUpper: Tick! - liquidity: BigInt! - depositedToken0: BigDecimal! - depositedToken1: BigDecimal! - withdrawnToken0: BigDecimal! - withdrawnToken1: BigDecimal! - collectedToken0: BigDecimal! - collectedToken1: BigDecimal! - collectedFeesToken0: BigDecimal! - collectedFeesToken1: BigDecimal! - amountDepositedUSD: BigDecimal! - amountWithdrawnUSD: BigDecimal! - amountCollectedUSD: BigDecimal! - transaction: Transaction! - feeGrowthInside0LastX128: BigInt! - feeGrowthInside1LastX128: BigInt! - increaseEvents(skip: Int = 0, first: Int = 100, orderBy: IncreaseEvent_orderBy, orderDirection: OrderDirection, where: IncreaseEvent_filter): [IncreaseEvent!]! - decreaseEvents(skip: Int = 0, first: Int = 100, orderBy: IncreaseEvent_orderBy, orderDirection: OrderDirection, where: IncreaseEvent_filter): [IncreaseEvent!]! -} - -type PositionSnapshot { - id: ID! - owner: Bytes! - pool: Pool! - position: Position! - blockNumber: BigInt! - timestamp: BigInt! - liquidity: BigInt! - depositedToken0: BigDecimal! - depositedToken1: BigDecimal! - withdrawnToken0: BigDecimal! - withdrawnToken1: BigDecimal! - collectedFeesToken0: BigDecimal! - collectedFeesToken1: BigDecimal! - transaction: Transaction! - feeGrowthInside0LastX128: BigInt! - feeGrowthInside1LastX128: BigInt! -} - -input PositionSnapshot_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - owner: Bytes - owner_not: Bytes - owner_gt: Bytes - owner_lt: Bytes - owner_gte: Bytes - owner_lte: Bytes - owner_in: [Bytes!] - owner_not_in: [Bytes!] - owner_contains: Bytes - owner_not_contains: Bytes - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - position: String - position_not: String - position_gt: String - position_lt: String - position_gte: String - position_lte: String - position_in: [String!] - position_not_in: [String!] - position_contains: String - position_contains_nocase: String - position_not_contains: String - position_not_contains_nocase: String - position_starts_with: String - position_starts_with_nocase: String - position_not_starts_with: String - position_not_starts_with_nocase: String - position_ends_with: String - position_ends_with_nocase: String - position_not_ends_with: String - position_not_ends_with_nocase: String - position_: Position_filter - blockNumber: BigInt - blockNumber_not: BigInt - blockNumber_gt: BigInt - blockNumber_lt: BigInt - blockNumber_gte: BigInt - blockNumber_lte: BigInt - blockNumber_in: [BigInt!] - blockNumber_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - liquidity: BigInt - liquidity_not: BigInt - liquidity_gt: BigInt - liquidity_lt: BigInt - liquidity_gte: BigInt - liquidity_lte: BigInt - liquidity_in: [BigInt!] - liquidity_not_in: [BigInt!] - depositedToken0: BigDecimal - depositedToken0_not: BigDecimal - depositedToken0_gt: BigDecimal - depositedToken0_lt: BigDecimal - depositedToken0_gte: BigDecimal - depositedToken0_lte: BigDecimal - depositedToken0_in: [BigDecimal!] - depositedToken0_not_in: [BigDecimal!] - depositedToken1: BigDecimal - depositedToken1_not: BigDecimal - depositedToken1_gt: BigDecimal - depositedToken1_lt: BigDecimal - depositedToken1_gte: BigDecimal - depositedToken1_lte: BigDecimal - depositedToken1_in: [BigDecimal!] - depositedToken1_not_in: [BigDecimal!] - withdrawnToken0: BigDecimal - withdrawnToken0_not: BigDecimal - withdrawnToken0_gt: BigDecimal - withdrawnToken0_lt: BigDecimal - withdrawnToken0_gte: BigDecimal - withdrawnToken0_lte: BigDecimal - withdrawnToken0_in: [BigDecimal!] - withdrawnToken0_not_in: [BigDecimal!] - withdrawnToken1: BigDecimal - withdrawnToken1_not: BigDecimal - withdrawnToken1_gt: BigDecimal - withdrawnToken1_lt: BigDecimal - withdrawnToken1_gte: BigDecimal - withdrawnToken1_lte: BigDecimal - withdrawnToken1_in: [BigDecimal!] - withdrawnToken1_not_in: [BigDecimal!] - collectedFeesToken0: BigDecimal - collectedFeesToken0_not: BigDecimal - collectedFeesToken0_gt: BigDecimal - collectedFeesToken0_lt: BigDecimal - collectedFeesToken0_gte: BigDecimal - collectedFeesToken0_lte: BigDecimal - collectedFeesToken0_in: [BigDecimal!] - collectedFeesToken0_not_in: [BigDecimal!] - collectedFeesToken1: BigDecimal - collectedFeesToken1_not: BigDecimal - collectedFeesToken1_gt: BigDecimal - collectedFeesToken1_lt: BigDecimal - collectedFeesToken1_gte: BigDecimal - collectedFeesToken1_lte: BigDecimal - collectedFeesToken1_in: [BigDecimal!] - collectedFeesToken1_not_in: [BigDecimal!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - feeGrowthInside0LastX128: BigInt - feeGrowthInside0LastX128_not: BigInt - feeGrowthInside0LastX128_gt: BigInt - feeGrowthInside0LastX128_lt: BigInt - feeGrowthInside0LastX128_gte: BigInt - feeGrowthInside0LastX128_lte: BigInt - feeGrowthInside0LastX128_in: [BigInt!] - feeGrowthInside0LastX128_not_in: [BigInt!] - feeGrowthInside1LastX128: BigInt - feeGrowthInside1LastX128_not: BigInt - feeGrowthInside1LastX128_gt: BigInt - feeGrowthInside1LastX128_lt: BigInt - feeGrowthInside1LastX128_gte: BigInt - feeGrowthInside1LastX128_lte: BigInt - feeGrowthInside1LastX128_in: [BigInt!] - feeGrowthInside1LastX128_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [PositionSnapshot_filter] - or: [PositionSnapshot_filter] -} - -enum PositionSnapshot_orderBy { - id - owner - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - position - position__id - position__owner - position__liquidity - position__depositedToken0 - position__depositedToken1 - position__withdrawnToken0 - position__withdrawnToken1 - position__collectedToken0 - position__collectedToken1 - position__collectedFeesToken0 - position__collectedFeesToken1 - position__amountDepositedUSD - position__amountWithdrawnUSD - position__amountCollectedUSD - position__feeGrowthInside0LastX128 - position__feeGrowthInside1LastX128 - blockNumber - timestamp - liquidity - depositedToken0 - depositedToken1 - withdrawnToken0 - withdrawnToken1 - collectedFeesToken0 - collectedFeesToken1 - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - feeGrowthInside0LastX128 - feeGrowthInside1LastX128 -} - -input Position_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - owner: Bytes - owner_not: Bytes - owner_gt: Bytes - owner_lt: Bytes - owner_gte: Bytes - owner_lte: Bytes - owner_in: [Bytes!] - owner_not_in: [Bytes!] - owner_contains: Bytes - owner_not_contains: Bytes - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - tickLower: String - tickLower_not: String - tickLower_gt: String - tickLower_lt: String - tickLower_gte: String - tickLower_lte: String - tickLower_in: [String!] - tickLower_not_in: [String!] - tickLower_contains: String - tickLower_contains_nocase: String - tickLower_not_contains: String - tickLower_not_contains_nocase: String - tickLower_starts_with: String - tickLower_starts_with_nocase: String - tickLower_not_starts_with: String - tickLower_not_starts_with_nocase: String - tickLower_ends_with: String - tickLower_ends_with_nocase: String - tickLower_not_ends_with: String - tickLower_not_ends_with_nocase: String - tickLower_: Tick_filter - tickUpper: String - tickUpper_not: String - tickUpper_gt: String - tickUpper_lt: String - tickUpper_gte: String - tickUpper_lte: String - tickUpper_in: [String!] - tickUpper_not_in: [String!] - tickUpper_contains: String - tickUpper_contains_nocase: String - tickUpper_not_contains: String - tickUpper_not_contains_nocase: String - tickUpper_starts_with: String - tickUpper_starts_with_nocase: String - tickUpper_not_starts_with: String - tickUpper_not_starts_with_nocase: String - tickUpper_ends_with: String - tickUpper_ends_with_nocase: String - tickUpper_not_ends_with: String - tickUpper_not_ends_with_nocase: String - tickUpper_: Tick_filter - liquidity: BigInt - liquidity_not: BigInt - liquidity_gt: BigInt - liquidity_lt: BigInt - liquidity_gte: BigInt - liquidity_lte: BigInt - liquidity_in: [BigInt!] - liquidity_not_in: [BigInt!] - depositedToken0: BigDecimal - depositedToken0_not: BigDecimal - depositedToken0_gt: BigDecimal - depositedToken0_lt: BigDecimal - depositedToken0_gte: BigDecimal - depositedToken0_lte: BigDecimal - depositedToken0_in: [BigDecimal!] - depositedToken0_not_in: [BigDecimal!] - depositedToken1: BigDecimal - depositedToken1_not: BigDecimal - depositedToken1_gt: BigDecimal - depositedToken1_lt: BigDecimal - depositedToken1_gte: BigDecimal - depositedToken1_lte: BigDecimal - depositedToken1_in: [BigDecimal!] - depositedToken1_not_in: [BigDecimal!] - withdrawnToken0: BigDecimal - withdrawnToken0_not: BigDecimal - withdrawnToken0_gt: BigDecimal - withdrawnToken0_lt: BigDecimal - withdrawnToken0_gte: BigDecimal - withdrawnToken0_lte: BigDecimal - withdrawnToken0_in: [BigDecimal!] - withdrawnToken0_not_in: [BigDecimal!] - withdrawnToken1: BigDecimal - withdrawnToken1_not: BigDecimal - withdrawnToken1_gt: BigDecimal - withdrawnToken1_lt: BigDecimal - withdrawnToken1_gte: BigDecimal - withdrawnToken1_lte: BigDecimal - withdrawnToken1_in: [BigDecimal!] - withdrawnToken1_not_in: [BigDecimal!] - collectedToken0: BigDecimal - collectedToken0_not: BigDecimal - collectedToken0_gt: BigDecimal - collectedToken0_lt: BigDecimal - collectedToken0_gte: BigDecimal - collectedToken0_lte: BigDecimal - collectedToken0_in: [BigDecimal!] - collectedToken0_not_in: [BigDecimal!] - collectedToken1: BigDecimal - collectedToken1_not: BigDecimal - collectedToken1_gt: BigDecimal - collectedToken1_lt: BigDecimal - collectedToken1_gte: BigDecimal - collectedToken1_lte: BigDecimal - collectedToken1_in: [BigDecimal!] - collectedToken1_not_in: [BigDecimal!] - collectedFeesToken0: BigDecimal - collectedFeesToken0_not: BigDecimal - collectedFeesToken0_gt: BigDecimal - collectedFeesToken0_lt: BigDecimal - collectedFeesToken0_gte: BigDecimal - collectedFeesToken0_lte: BigDecimal - collectedFeesToken0_in: [BigDecimal!] - collectedFeesToken0_not_in: [BigDecimal!] - collectedFeesToken1: BigDecimal - collectedFeesToken1_not: BigDecimal - collectedFeesToken1_gt: BigDecimal - collectedFeesToken1_lt: BigDecimal - collectedFeesToken1_gte: BigDecimal - collectedFeesToken1_lte: BigDecimal - collectedFeesToken1_in: [BigDecimal!] - collectedFeesToken1_not_in: [BigDecimal!] - amountDepositedUSD: BigDecimal - amountDepositedUSD_not: BigDecimal - amountDepositedUSD_gt: BigDecimal - amountDepositedUSD_lt: BigDecimal - amountDepositedUSD_gte: BigDecimal - amountDepositedUSD_lte: BigDecimal - amountDepositedUSD_in: [BigDecimal!] - amountDepositedUSD_not_in: [BigDecimal!] - amountWithdrawnUSD: BigDecimal - amountWithdrawnUSD_not: BigDecimal - amountWithdrawnUSD_gt: BigDecimal - amountWithdrawnUSD_lt: BigDecimal - amountWithdrawnUSD_gte: BigDecimal - amountWithdrawnUSD_lte: BigDecimal - amountWithdrawnUSD_in: [BigDecimal!] - amountWithdrawnUSD_not_in: [BigDecimal!] - amountCollectedUSD: BigDecimal - amountCollectedUSD_not: BigDecimal - amountCollectedUSD_gt: BigDecimal - amountCollectedUSD_lt: BigDecimal - amountCollectedUSD_gte: BigDecimal - amountCollectedUSD_lte: BigDecimal - amountCollectedUSD_in: [BigDecimal!] - amountCollectedUSD_not_in: [BigDecimal!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - feeGrowthInside0LastX128: BigInt - feeGrowthInside0LastX128_not: BigInt - feeGrowthInside0LastX128_gt: BigInt - feeGrowthInside0LastX128_lt: BigInt - feeGrowthInside0LastX128_gte: BigInt - feeGrowthInside0LastX128_lte: BigInt - feeGrowthInside0LastX128_in: [BigInt!] - feeGrowthInside0LastX128_not_in: [BigInt!] - feeGrowthInside1LastX128: BigInt - feeGrowthInside1LastX128_not: BigInt - feeGrowthInside1LastX128_gt: BigInt - feeGrowthInside1LastX128_lt: BigInt - feeGrowthInside1LastX128_gte: BigInt - feeGrowthInside1LastX128_lte: BigInt - feeGrowthInside1LastX128_in: [BigInt!] - feeGrowthInside1LastX128_not_in: [BigInt!] - increaseEvents_: IncreaseEvent_filter - decreaseEvents_: IncreaseEvent_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Position_filter] - or: [Position_filter] -} - -enum Position_orderBy { - id - owner - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - tickLower - tickLower__id - tickLower__poolAddress - tickLower__tickIdx - tickLower__liquidityGross - tickLower__liquidityNet - tickLower__price0 - tickLower__price1 - tickLower__volumeToken0 - tickLower__volumeToken1 - tickLower__volumeUSD - tickLower__untrackedVolumeUSD - tickLower__feesUSD - tickLower__collectedFeesToken0 - tickLower__collectedFeesToken1 - tickLower__collectedFeesUSD - tickLower__createdAtTimestamp - tickLower__createdAtBlockNumber - tickLower__liquidityProviderCount - tickLower__feeGrowthOutside0X128 - tickLower__feeGrowthOutside1X128 - tickUpper - tickUpper__id - tickUpper__poolAddress - tickUpper__tickIdx - tickUpper__liquidityGross - tickUpper__liquidityNet - tickUpper__price0 - tickUpper__price1 - tickUpper__volumeToken0 - tickUpper__volumeToken1 - tickUpper__volumeUSD - tickUpper__untrackedVolumeUSD - tickUpper__feesUSD - tickUpper__collectedFeesToken0 - tickUpper__collectedFeesToken1 - tickUpper__collectedFeesUSD - tickUpper__createdAtTimestamp - tickUpper__createdAtBlockNumber - tickUpper__liquidityProviderCount - tickUpper__feeGrowthOutside0X128 - tickUpper__feeGrowthOutside1X128 - liquidity - depositedToken0 - depositedToken1 - withdrawnToken0 - withdrawnToken1 - collectedToken0 - collectedToken1 - collectedFeesToken0 - collectedFeesToken1 - amountDepositedUSD - amountWithdrawnUSD - amountCollectedUSD - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - feeGrowthInside0LastX128 - feeGrowthInside1LastX128 - increaseEvents - decreaseEvents -} - -type Query { - factory( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Factory - factories( - skip: Int = 0 - first: Int = 100 - orderBy: Factory_orderBy - orderDirection: OrderDirection - where: Factory_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Factory!]! - bundle( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Bundle - bundles( - skip: Int = 0 - first: Int = 100 - orderBy: Bundle_orderBy - orderDirection: OrderDirection - where: Bundle_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Bundle!]! - token( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Token - tokens( - skip: Int = 0 - first: Int = 100 - orderBy: Token_orderBy - orderDirection: OrderDirection - where: Token_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Token!]! - pool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pool - pools( - skip: Int = 0 - first: Int = 100 - orderBy: Pool_orderBy - orderDirection: OrderDirection - where: Pool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pool!]! - tick( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Tick - ticks( - skip: Int = 0 - first: Int = 100 - orderBy: Tick_orderBy - orderDirection: OrderDirection - where: Tick_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Tick!]! - position( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Position - positions( - skip: Int = 0 - first: Int = 100 - orderBy: Position_orderBy - orderDirection: OrderDirection - where: Position_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Position!]! - positionSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PositionSnapshot - positionSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PositionSnapshot_orderBy - orderDirection: OrderDirection - where: PositionSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PositionSnapshot!]! - transaction( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Transaction - transactions( - skip: Int = 0 - first: Int = 100 - orderBy: Transaction_orderBy - orderDirection: OrderDirection - where: Transaction_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Transaction!]! - mint( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Mint - mints( - skip: Int = 0 - first: Int = 100 - orderBy: Mint_orderBy - orderDirection: OrderDirection - where: Mint_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Mint!]! - burn( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Burn - burns( - skip: Int = 0 - first: Int = 100 - orderBy: Burn_orderBy - orderDirection: OrderDirection - where: Burn_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Burn!]! - swap( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Swap - swaps( - skip: Int = 0 - first: Int = 100 - orderBy: Swap_orderBy - orderDirection: OrderDirection - where: Swap_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Swap!]! - collect( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Collect - collects( - skip: Int = 0 - first: Int = 100 - orderBy: Collect_orderBy - orderDirection: OrderDirection - where: Collect_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Collect!]! - flash( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Flash - flashes( - skip: Int = 0 - first: Int = 100 - orderBy: Flash_orderBy - orderDirection: OrderDirection - where: Flash_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Flash!]! - uniswapDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): UniswapDayData - uniswapDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: UniswapDayData_orderBy - orderDirection: OrderDirection - where: UniswapDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [UniswapDayData!]! - poolDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PoolDayData - poolDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PoolDayData_orderBy - orderDirection: OrderDirection - where: PoolDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PoolDayData!]! - poolHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PoolHourData - poolHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PoolHourData_orderBy - orderDirection: OrderDirection - where: PoolHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PoolHourData!]! - tickHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TickHourData - tickHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TickHourData_orderBy - orderDirection: OrderDirection - where: TickHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TickHourData!]! - tickDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TickDayData - tickDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TickDayData_orderBy - orderDirection: OrderDirection - where: TickDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TickDayData!]! - tokenDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TokenDayData - tokenDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TokenDayData_orderBy - orderDirection: OrderDirection - where: TokenDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TokenDayData!]! - tokenHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TokenHourData - tokenHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TokenHourData_orderBy - orderDirection: OrderDirection - where: TokenHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TokenHourData!]! - increaseEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): IncreaseEvent - increaseEvents( - skip: Int = 0 - first: Int = 100 - orderBy: IncreaseEvent_orderBy - orderDirection: OrderDirection - where: IncreaseEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [IncreaseEvent!]! - decreaseEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): DecreaseEvent - decreaseEvents( - skip: Int = 0 - first: Int = 100 - orderBy: DecreaseEvent_orderBy - orderDirection: OrderDirection - where: DecreaseEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [DecreaseEvent!]! - setProtocolFeeEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): SetProtocolFeeEvent - setProtocolFeeEvents( - skip: Int = 0 - first: Int = 100 - orderBy: SetProtocolFeeEvent_orderBy - orderDirection: OrderDirection - where: SetProtocolFeeEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [SetProtocolFeeEvent!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type SetProtocolFeeEvent { - id: ID! - pool: Pool! - logIndex: BigInt! - new0: BigInt! - new1: BigInt! - old0: BigInt! - old1: BigInt! - timestamp: BigInt! -} - -input SetProtocolFeeEvent_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - new0: BigInt - new0_not: BigInt - new0_gt: BigInt - new0_lt: BigInt - new0_gte: BigInt - new0_lte: BigInt - new0_in: [BigInt!] - new0_not_in: [BigInt!] - new1: BigInt - new1_not: BigInt - new1_gt: BigInt - new1_lt: BigInt - new1_gte: BigInt - new1_lte: BigInt - new1_in: [BigInt!] - new1_not_in: [BigInt!] - old0: BigInt - old0_not: BigInt - old0_gt: BigInt - old0_lt: BigInt - old0_gte: BigInt - old0_lte: BigInt - old0_in: [BigInt!] - old0_not_in: [BigInt!] - old1: BigInt - old1_not: BigInt - old1_gt: BigInt - old1_lt: BigInt - old1_gte: BigInt - old1_lte: BigInt - old1_in: [BigInt!] - old1_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [SetProtocolFeeEvent_filter] - or: [SetProtocolFeeEvent_filter] -} - -enum SetProtocolFeeEvent_orderBy { - id - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - logIndex - new0 - new1 - old0 - old1 - timestamp -} - -type Subscription { - factory( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Factory - factories( - skip: Int = 0 - first: Int = 100 - orderBy: Factory_orderBy - orderDirection: OrderDirection - where: Factory_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Factory!]! - bundle( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Bundle - bundles( - skip: Int = 0 - first: Int = 100 - orderBy: Bundle_orderBy - orderDirection: OrderDirection - where: Bundle_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Bundle!]! - token( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Token - tokens( - skip: Int = 0 - first: Int = 100 - orderBy: Token_orderBy - orderDirection: OrderDirection - where: Token_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Token!]! - pool( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Pool - pools( - skip: Int = 0 - first: Int = 100 - orderBy: Pool_orderBy - orderDirection: OrderDirection - where: Pool_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Pool!]! - tick( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Tick - ticks( - skip: Int = 0 - first: Int = 100 - orderBy: Tick_orderBy - orderDirection: OrderDirection - where: Tick_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Tick!]! - position( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Position - positions( - skip: Int = 0 - first: Int = 100 - orderBy: Position_orderBy - orderDirection: OrderDirection - where: Position_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Position!]! - positionSnapshot( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PositionSnapshot - positionSnapshots( - skip: Int = 0 - first: Int = 100 - orderBy: PositionSnapshot_orderBy - orderDirection: OrderDirection - where: PositionSnapshot_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PositionSnapshot!]! - transaction( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Transaction - transactions( - skip: Int = 0 - first: Int = 100 - orderBy: Transaction_orderBy - orderDirection: OrderDirection - where: Transaction_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Transaction!]! - mint( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Mint - mints( - skip: Int = 0 - first: Int = 100 - orderBy: Mint_orderBy - orderDirection: OrderDirection - where: Mint_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Mint!]! - burn( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Burn - burns( - skip: Int = 0 - first: Int = 100 - orderBy: Burn_orderBy - orderDirection: OrderDirection - where: Burn_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Burn!]! - swap( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Swap - swaps( - skip: Int = 0 - first: Int = 100 - orderBy: Swap_orderBy - orderDirection: OrderDirection - where: Swap_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Swap!]! - collect( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Collect - collects( - skip: Int = 0 - first: Int = 100 - orderBy: Collect_orderBy - orderDirection: OrderDirection - where: Collect_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Collect!]! - flash( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): Flash - flashes( - skip: Int = 0 - first: Int = 100 - orderBy: Flash_orderBy - orderDirection: OrderDirection - where: Flash_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [Flash!]! - uniswapDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): UniswapDayData - uniswapDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: UniswapDayData_orderBy - orderDirection: OrderDirection - where: UniswapDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [UniswapDayData!]! - poolDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PoolDayData - poolDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PoolDayData_orderBy - orderDirection: OrderDirection - where: PoolDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PoolDayData!]! - poolHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): PoolHourData - poolHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: PoolHourData_orderBy - orderDirection: OrderDirection - where: PoolHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [PoolHourData!]! - tickHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TickHourData - tickHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TickHourData_orderBy - orderDirection: OrderDirection - where: TickHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TickHourData!]! - tickDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TickDayData - tickDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TickDayData_orderBy - orderDirection: OrderDirection - where: TickDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TickDayData!]! - tokenDayData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TokenDayData - tokenDayDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TokenDayData_orderBy - orderDirection: OrderDirection - where: TokenDayData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TokenDayData!]! - tokenHourData( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): TokenHourData - tokenHourDatas( - skip: Int = 0 - first: Int = 100 - orderBy: TokenHourData_orderBy - orderDirection: OrderDirection - where: TokenHourData_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [TokenHourData!]! - increaseEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): IncreaseEvent - increaseEvents( - skip: Int = 0 - first: Int = 100 - orderBy: IncreaseEvent_orderBy - orderDirection: OrderDirection - where: IncreaseEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [IncreaseEvent!]! - decreaseEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): DecreaseEvent - decreaseEvents( - skip: Int = 0 - first: Int = 100 - orderBy: DecreaseEvent_orderBy - orderDirection: OrderDirection - where: DecreaseEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [DecreaseEvent!]! - setProtocolFeeEvent( - id: ID! - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): SetProtocolFeeEvent - setProtocolFeeEvents( - skip: Int = 0 - first: Int = 100 - orderBy: SetProtocolFeeEvent_orderBy - orderDirection: OrderDirection - where: SetProtocolFeeEvent_filter - - """ - The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. - """ - block: Block_height - - """ - Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. - """ - subgraphError: _SubgraphErrorPolicy_! = deny - ): [SetProtocolFeeEvent!]! - - """Access to subgraph metadata""" - _meta(block: Block_height): _Meta_ -} - -type Swap { - id: ID! - transaction: Transaction! - timestamp: BigInt! - pool: Pool! - token0: Token! - token1: Token! - sender: Bytes! - recipient: Bytes! - origin: Bytes! - amount0: BigDecimal! - amount1: BigDecimal! - amountUSD: BigDecimal! - sqrtPriceX96: BigInt! - tick: BigInt! - logIndex: BigInt -} - -input Swap_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - transaction: String - transaction_not: String - transaction_gt: String - transaction_lt: String - transaction_gte: String - transaction_lte: String - transaction_in: [String!] - transaction_not_in: [String!] - transaction_contains: String - transaction_contains_nocase: String - transaction_not_contains: String - transaction_not_contains_nocase: String - transaction_starts_with: String - transaction_starts_with_nocase: String - transaction_not_starts_with: String - transaction_not_starts_with_nocase: String - transaction_ends_with: String - transaction_ends_with_nocase: String - transaction_not_ends_with: String - transaction_not_ends_with_nocase: String - transaction_: Transaction_filter - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - token0: String - token0_not: String - token0_gt: String - token0_lt: String - token0_gte: String - token0_lte: String - token0_in: [String!] - token0_not_in: [String!] - token0_contains: String - token0_contains_nocase: String - token0_not_contains: String - token0_not_contains_nocase: String - token0_starts_with: String - token0_starts_with_nocase: String - token0_not_starts_with: String - token0_not_starts_with_nocase: String - token0_ends_with: String - token0_ends_with_nocase: String - token0_not_ends_with: String - token0_not_ends_with_nocase: String - token0_: Token_filter - token1: String - token1_not: String - token1_gt: String - token1_lt: String - token1_gte: String - token1_lte: String - token1_in: [String!] - token1_not_in: [String!] - token1_contains: String - token1_contains_nocase: String - token1_not_contains: String - token1_not_contains_nocase: String - token1_starts_with: String - token1_starts_with_nocase: String - token1_not_starts_with: String - token1_not_starts_with_nocase: String - token1_ends_with: String - token1_ends_with_nocase: String - token1_not_ends_with: String - token1_not_ends_with_nocase: String - token1_: Token_filter - sender: Bytes - sender_not: Bytes - sender_gt: Bytes - sender_lt: Bytes - sender_gte: Bytes - sender_lte: Bytes - sender_in: [Bytes!] - sender_not_in: [Bytes!] - sender_contains: Bytes - sender_not_contains: Bytes - recipient: Bytes - recipient_not: Bytes - recipient_gt: Bytes - recipient_lt: Bytes - recipient_gte: Bytes - recipient_lte: Bytes - recipient_in: [Bytes!] - recipient_not_in: [Bytes!] - recipient_contains: Bytes - recipient_not_contains: Bytes - origin: Bytes - origin_not: Bytes - origin_gt: Bytes - origin_lt: Bytes - origin_gte: Bytes - origin_lte: Bytes - origin_in: [Bytes!] - origin_not_in: [Bytes!] - origin_contains: Bytes - origin_not_contains: Bytes - amount0: BigDecimal - amount0_not: BigDecimal - amount0_gt: BigDecimal - amount0_lt: BigDecimal - amount0_gte: BigDecimal - amount0_lte: BigDecimal - amount0_in: [BigDecimal!] - amount0_not_in: [BigDecimal!] - amount1: BigDecimal - amount1_not: BigDecimal - amount1_gt: BigDecimal - amount1_lt: BigDecimal - amount1_gte: BigDecimal - amount1_lte: BigDecimal - amount1_in: [BigDecimal!] - amount1_not_in: [BigDecimal!] - amountUSD: BigDecimal - amountUSD_not: BigDecimal - amountUSD_gt: BigDecimal - amountUSD_lt: BigDecimal - amountUSD_gte: BigDecimal - amountUSD_lte: BigDecimal - amountUSD_in: [BigDecimal!] - amountUSD_not_in: [BigDecimal!] - sqrtPriceX96: BigInt - sqrtPriceX96_not: BigInt - sqrtPriceX96_gt: BigInt - sqrtPriceX96_lt: BigInt - sqrtPriceX96_gte: BigInt - sqrtPriceX96_lte: BigInt - sqrtPriceX96_in: [BigInt!] - sqrtPriceX96_not_in: [BigInt!] - tick: BigInt - tick_not: BigInt - tick_gt: BigInt - tick_lt: BigInt - tick_gte: BigInt - tick_lte: BigInt - tick_in: [BigInt!] - tick_not_in: [BigInt!] - logIndex: BigInt - logIndex_not: BigInt - logIndex_gt: BigInt - logIndex_lt: BigInt - logIndex_gte: BigInt - logIndex_lte: BigInt - logIndex_in: [BigInt!] - logIndex_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Swap_filter] - or: [Swap_filter] -} - -enum Swap_orderBy { - id - transaction - transaction__id - transaction__blockNumber - transaction__timestamp - transaction__gasUsed - transaction__gasPrice - timestamp - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - token0 - token0__id - token0__symbol - token0__name - token0__decimals - token0__totalSupply - token0__volume - token0__volumeUSD - token0__untrackedVolumeUSD - token0__feesUSD - token0__txCount - token0__poolCount - token0__totalValueLocked - token0__totalValueLockedUSD - token0__totalValueLockedUSDUntracked - token0__derivedETH - token1 - token1__id - token1__symbol - token1__name - token1__decimals - token1__totalSupply - token1__volume - token1__volumeUSD - token1__untrackedVolumeUSD - token1__feesUSD - token1__txCount - token1__poolCount - token1__totalValueLocked - token1__totalValueLockedUSD - token1__totalValueLockedUSDUntracked - token1__derivedETH - sender - recipient - origin - amount0 - amount1 - amountUSD - sqrtPriceX96 - tick - logIndex -} - -type Tick { - id: ID! - poolAddress: String - tickIdx: BigInt! - pool: Pool! - liquidityGross: BigInt! - liquidityNet: BigInt! - price0: BigDecimal! - price1: BigDecimal! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - feesUSD: BigDecimal! - collectedFeesToken0: BigDecimal! - collectedFeesToken1: BigDecimal! - collectedFeesUSD: BigDecimal! - createdAtTimestamp: BigInt! - createdAtBlockNumber: BigInt! - liquidityProviderCount: BigInt! - feeGrowthOutside0X128: BigInt! - feeGrowthOutside1X128: BigInt! -} - -type TickDayData { - id: ID! - date: Int! - pool: Pool! - tick: Tick! - liquidityGross: BigInt! - liquidityNet: BigInt! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - feesUSD: BigDecimal! - feeGrowthOutside0X128: BigInt! - feeGrowthOutside1X128: BigInt! -} - -input TickDayData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - tick: String - tick_not: String - tick_gt: String - tick_lt: String - tick_gte: String - tick_lte: String - tick_in: [String!] - tick_not_in: [String!] - tick_contains: String - tick_contains_nocase: String - tick_not_contains: String - tick_not_contains_nocase: String - tick_starts_with: String - tick_starts_with_nocase: String - tick_not_starts_with: String - tick_not_starts_with_nocase: String - tick_ends_with: String - tick_ends_with_nocase: String - tick_not_ends_with: String - tick_not_ends_with_nocase: String - tick_: Tick_filter - liquidityGross: BigInt - liquidityGross_not: BigInt - liquidityGross_gt: BigInt - liquidityGross_lt: BigInt - liquidityGross_gte: BigInt - liquidityGross_lte: BigInt - liquidityGross_in: [BigInt!] - liquidityGross_not_in: [BigInt!] - liquidityNet: BigInt - liquidityNet_not: BigInt - liquidityNet_gt: BigInt - liquidityNet_lt: BigInt - liquidityNet_gte: BigInt - liquidityNet_lte: BigInt - liquidityNet_in: [BigInt!] - liquidityNet_not_in: [BigInt!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - feeGrowthOutside0X128: BigInt - feeGrowthOutside0X128_not: BigInt - feeGrowthOutside0X128_gt: BigInt - feeGrowthOutside0X128_lt: BigInt - feeGrowthOutside0X128_gte: BigInt - feeGrowthOutside0X128_lte: BigInt - feeGrowthOutside0X128_in: [BigInt!] - feeGrowthOutside0X128_not_in: [BigInt!] - feeGrowthOutside1X128: BigInt - feeGrowthOutside1X128_not: BigInt - feeGrowthOutside1X128_gt: BigInt - feeGrowthOutside1X128_lt: BigInt - feeGrowthOutside1X128_gte: BigInt - feeGrowthOutside1X128_lte: BigInt - feeGrowthOutside1X128_in: [BigInt!] - feeGrowthOutside1X128_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [TickDayData_filter] - or: [TickDayData_filter] -} - -enum TickDayData_orderBy { - id - date - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - tick - tick__id - tick__poolAddress - tick__tickIdx - tick__liquidityGross - tick__liquidityNet - tick__price0 - tick__price1 - tick__volumeToken0 - tick__volumeToken1 - tick__volumeUSD - tick__untrackedVolumeUSD - tick__feesUSD - tick__collectedFeesToken0 - tick__collectedFeesToken1 - tick__collectedFeesUSD - tick__createdAtTimestamp - tick__createdAtBlockNumber - tick__liquidityProviderCount - tick__feeGrowthOutside0X128 - tick__feeGrowthOutside1X128 - liquidityGross - liquidityNet - volumeToken0 - volumeToken1 - volumeUSD - feesUSD - feeGrowthOutside0X128 - feeGrowthOutside1X128 -} - -type TickHourData { - id: ID! - periodStartUnix: Int! - pool: Pool! - tick: Tick! - liquidityGross: BigInt! - liquidityNet: BigInt! - volumeToken0: BigDecimal! - volumeToken1: BigDecimal! - volumeUSD: BigDecimal! - feesUSD: BigDecimal! -} - -input TickHourData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - periodStartUnix: Int - periodStartUnix_not: Int - periodStartUnix_gt: Int - periodStartUnix_lt: Int - periodStartUnix_gte: Int - periodStartUnix_lte: Int - periodStartUnix_in: [Int!] - periodStartUnix_not_in: [Int!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - tick: String - tick_not: String - tick_gt: String - tick_lt: String - tick_gte: String - tick_lte: String - tick_in: [String!] - tick_not_in: [String!] - tick_contains: String - tick_contains_nocase: String - tick_not_contains: String - tick_not_contains_nocase: String - tick_starts_with: String - tick_starts_with_nocase: String - tick_not_starts_with: String - tick_not_starts_with_nocase: String - tick_ends_with: String - tick_ends_with_nocase: String - tick_not_ends_with: String - tick_not_ends_with_nocase: String - tick_: Tick_filter - liquidityGross: BigInt - liquidityGross_not: BigInt - liquidityGross_gt: BigInt - liquidityGross_lt: BigInt - liquidityGross_gte: BigInt - liquidityGross_lte: BigInt - liquidityGross_in: [BigInt!] - liquidityGross_not_in: [BigInt!] - liquidityNet: BigInt - liquidityNet_not: BigInt - liquidityNet_gt: BigInt - liquidityNet_lt: BigInt - liquidityNet_gte: BigInt - liquidityNet_lte: BigInt - liquidityNet_in: [BigInt!] - liquidityNet_not_in: [BigInt!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [TickHourData_filter] - or: [TickHourData_filter] -} - -enum TickHourData_orderBy { - id - periodStartUnix - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - tick - tick__id - tick__poolAddress - tick__tickIdx - tick__liquidityGross - tick__liquidityNet - tick__price0 - tick__price1 - tick__volumeToken0 - tick__volumeToken1 - tick__volumeUSD - tick__untrackedVolumeUSD - tick__feesUSD - tick__collectedFeesToken0 - tick__collectedFeesToken1 - tick__collectedFeesUSD - tick__createdAtTimestamp - tick__createdAtBlockNumber - tick__liquidityProviderCount - tick__feeGrowthOutside0X128 - tick__feeGrowthOutside1X128 - liquidityGross - liquidityNet - volumeToken0 - volumeToken1 - volumeUSD - feesUSD -} - -input Tick_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - poolAddress: String - poolAddress_not: String - poolAddress_gt: String - poolAddress_lt: String - poolAddress_gte: String - poolAddress_lte: String - poolAddress_in: [String!] - poolAddress_not_in: [String!] - poolAddress_contains: String - poolAddress_contains_nocase: String - poolAddress_not_contains: String - poolAddress_not_contains_nocase: String - poolAddress_starts_with: String - poolAddress_starts_with_nocase: String - poolAddress_not_starts_with: String - poolAddress_not_starts_with_nocase: String - poolAddress_ends_with: String - poolAddress_ends_with_nocase: String - poolAddress_not_ends_with: String - poolAddress_not_ends_with_nocase: String - tickIdx: BigInt - tickIdx_not: BigInt - tickIdx_gt: BigInt - tickIdx_lt: BigInt - tickIdx_gte: BigInt - tickIdx_lte: BigInt - tickIdx_in: [BigInt!] - tickIdx_not_in: [BigInt!] - pool: String - pool_not: String - pool_gt: String - pool_lt: String - pool_gte: String - pool_lte: String - pool_in: [String!] - pool_not_in: [String!] - pool_contains: String - pool_contains_nocase: String - pool_not_contains: String - pool_not_contains_nocase: String - pool_starts_with: String - pool_starts_with_nocase: String - pool_not_starts_with: String - pool_not_starts_with_nocase: String - pool_ends_with: String - pool_ends_with_nocase: String - pool_not_ends_with: String - pool_not_ends_with_nocase: String - pool_: Pool_filter - liquidityGross: BigInt - liquidityGross_not: BigInt - liquidityGross_gt: BigInt - liquidityGross_lt: BigInt - liquidityGross_gte: BigInt - liquidityGross_lte: BigInt - liquidityGross_in: [BigInt!] - liquidityGross_not_in: [BigInt!] - liquidityNet: BigInt - liquidityNet_not: BigInt - liquidityNet_gt: BigInt - liquidityNet_lt: BigInt - liquidityNet_gte: BigInt - liquidityNet_lte: BigInt - liquidityNet_in: [BigInt!] - liquidityNet_not_in: [BigInt!] - price0: BigDecimal - price0_not: BigDecimal - price0_gt: BigDecimal - price0_lt: BigDecimal - price0_gte: BigDecimal - price0_lte: BigDecimal - price0_in: [BigDecimal!] - price0_not_in: [BigDecimal!] - price1: BigDecimal - price1_not: BigDecimal - price1_gt: BigDecimal - price1_lt: BigDecimal - price1_gte: BigDecimal - price1_lte: BigDecimal - price1_in: [BigDecimal!] - price1_not_in: [BigDecimal!] - volumeToken0: BigDecimal - volumeToken0_not: BigDecimal - volumeToken0_gt: BigDecimal - volumeToken0_lt: BigDecimal - volumeToken0_gte: BigDecimal - volumeToken0_lte: BigDecimal - volumeToken0_in: [BigDecimal!] - volumeToken0_not_in: [BigDecimal!] - volumeToken1: BigDecimal - volumeToken1_not: BigDecimal - volumeToken1_gt: BigDecimal - volumeToken1_lt: BigDecimal - volumeToken1_gte: BigDecimal - volumeToken1_lte: BigDecimal - volumeToken1_in: [BigDecimal!] - volumeToken1_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - collectedFeesToken0: BigDecimal - collectedFeesToken0_not: BigDecimal - collectedFeesToken0_gt: BigDecimal - collectedFeesToken0_lt: BigDecimal - collectedFeesToken0_gte: BigDecimal - collectedFeesToken0_lte: BigDecimal - collectedFeesToken0_in: [BigDecimal!] - collectedFeesToken0_not_in: [BigDecimal!] - collectedFeesToken1: BigDecimal - collectedFeesToken1_not: BigDecimal - collectedFeesToken1_gt: BigDecimal - collectedFeesToken1_lt: BigDecimal - collectedFeesToken1_gte: BigDecimal - collectedFeesToken1_lte: BigDecimal - collectedFeesToken1_in: [BigDecimal!] - collectedFeesToken1_not_in: [BigDecimal!] - collectedFeesUSD: BigDecimal - collectedFeesUSD_not: BigDecimal - collectedFeesUSD_gt: BigDecimal - collectedFeesUSD_lt: BigDecimal - collectedFeesUSD_gte: BigDecimal - collectedFeesUSD_lte: BigDecimal - collectedFeesUSD_in: [BigDecimal!] - collectedFeesUSD_not_in: [BigDecimal!] - createdAtTimestamp: BigInt - createdAtTimestamp_not: BigInt - createdAtTimestamp_gt: BigInt - createdAtTimestamp_lt: BigInt - createdAtTimestamp_gte: BigInt - createdAtTimestamp_lte: BigInt - createdAtTimestamp_in: [BigInt!] - createdAtTimestamp_not_in: [BigInt!] - createdAtBlockNumber: BigInt - createdAtBlockNumber_not: BigInt - createdAtBlockNumber_gt: BigInt - createdAtBlockNumber_lt: BigInt - createdAtBlockNumber_gte: BigInt - createdAtBlockNumber_lte: BigInt - createdAtBlockNumber_in: [BigInt!] - createdAtBlockNumber_not_in: [BigInt!] - liquidityProviderCount: BigInt - liquidityProviderCount_not: BigInt - liquidityProviderCount_gt: BigInt - liquidityProviderCount_lt: BigInt - liquidityProviderCount_gte: BigInt - liquidityProviderCount_lte: BigInt - liquidityProviderCount_in: [BigInt!] - liquidityProviderCount_not_in: [BigInt!] - feeGrowthOutside0X128: BigInt - feeGrowthOutside0X128_not: BigInt - feeGrowthOutside0X128_gt: BigInt - feeGrowthOutside0X128_lt: BigInt - feeGrowthOutside0X128_gte: BigInt - feeGrowthOutside0X128_lte: BigInt - feeGrowthOutside0X128_in: [BigInt!] - feeGrowthOutside0X128_not_in: [BigInt!] - feeGrowthOutside1X128: BigInt - feeGrowthOutside1X128_not: BigInt - feeGrowthOutside1X128_gt: BigInt - feeGrowthOutside1X128_lt: BigInt - feeGrowthOutside1X128_gte: BigInt - feeGrowthOutside1X128_lte: BigInt - feeGrowthOutside1X128_in: [BigInt!] - feeGrowthOutside1X128_not_in: [BigInt!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Tick_filter] - or: [Tick_filter] -} - -enum Tick_orderBy { - id - poolAddress - tickIdx - pool - pool__id - pool__createdAtTimestamp - pool__createdAtBlockNumber - pool__feeTier - pool__liquidity - pool__sqrtPrice - pool__feeGrowthGlobal0X128 - pool__feeGrowthGlobal1X128 - pool__token0Price - pool__token1Price - pool__tick - pool__observationIndex - pool__volumeToken0 - pool__volumeToken1 - pool__volumeUSD - pool__untrackedVolumeUSD - pool__feesUSD - pool__txCount - pool__collectedFeesToken0 - pool__collectedFeesToken1 - pool__collectedFeesUSD - pool__totalValueLockedToken0 - pool__totalValueLockedToken1 - pool__totalValueLockedETH - pool__totalValueLockedUSD - pool__totalValueLockedUSDUntracked - pool__isProtocolFeeEnabled - pool__liquidityProviderCount - liquidityGross - liquidityNet - price0 - price1 - volumeToken0 - volumeToken1 - volumeUSD - untrackedVolumeUSD - feesUSD - collectedFeesToken0 - collectedFeesToken1 - collectedFeesUSD - createdAtTimestamp - createdAtBlockNumber - liquidityProviderCount - feeGrowthOutside0X128 - feeGrowthOutside1X128 -} - -"A string representation of microseconds UNIX timestamp (16 digits)\n" -scalar Timestamp - -type Token { - id: ID! - symbol: String! - name: String! - decimals: BigInt! - totalSupply: BigInt! - volume: BigDecimal! - volumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - feesUSD: BigDecimal! - txCount: BigInt! - poolCount: BigInt! - totalValueLocked: BigDecimal! - totalValueLockedUSD: BigDecimal! - totalValueLockedUSDUntracked: BigDecimal! - derivedETH: BigDecimal! - whitelistPools(skip: Int = 0, first: Int = 100, orderBy: Pool_orderBy, orderDirection: OrderDirection, where: Pool_filter): [Pool!]! - tokenDayData(skip: Int = 0, first: Int = 100, orderBy: TokenDayData_orderBy, orderDirection: OrderDirection, where: TokenDayData_filter): [TokenDayData!]! -} - -type TokenDayData { - id: ID! - date: Int! - token: Token! - volume: BigDecimal! - volumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - totalValueLocked: BigDecimal! - totalValueLockedUSD: BigDecimal! - priceUSD: BigDecimal! - feesUSD: BigDecimal! - open: BigDecimal! - high: BigDecimal! - low: BigDecimal! - close: BigDecimal! -} - -input TokenDayData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - token: String - token_not: String - token_gt: String - token_lt: String - token_gte: String - token_lte: String - token_in: [String!] - token_not_in: [String!] - token_contains: String - token_contains_nocase: String - token_not_contains: String - token_not_contains_nocase: String - token_starts_with: String - token_starts_with_nocase: String - token_not_starts_with: String - token_not_starts_with_nocase: String - token_ends_with: String - token_ends_with_nocase: String - token_not_ends_with: String - token_not_ends_with_nocase: String - token_: Token_filter - volume: BigDecimal - volume_not: BigDecimal - volume_gt: BigDecimal - volume_lt: BigDecimal - volume_gte: BigDecimal - volume_lte: BigDecimal - volume_in: [BigDecimal!] - volume_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - totalValueLocked: BigDecimal - totalValueLocked_not: BigDecimal - totalValueLocked_gt: BigDecimal - totalValueLocked_lt: BigDecimal - totalValueLocked_gte: BigDecimal - totalValueLocked_lte: BigDecimal - totalValueLocked_in: [BigDecimal!] - totalValueLocked_not_in: [BigDecimal!] - totalValueLockedUSD: BigDecimal - totalValueLockedUSD_not: BigDecimal - totalValueLockedUSD_gt: BigDecimal - totalValueLockedUSD_lt: BigDecimal - totalValueLockedUSD_gte: BigDecimal - totalValueLockedUSD_lte: BigDecimal - totalValueLockedUSD_in: [BigDecimal!] - totalValueLockedUSD_not_in: [BigDecimal!] - priceUSD: BigDecimal - priceUSD_not: BigDecimal - priceUSD_gt: BigDecimal - priceUSD_lt: BigDecimal - priceUSD_gte: BigDecimal - priceUSD_lte: BigDecimal - priceUSD_in: [BigDecimal!] - priceUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - open: BigDecimal - open_not: BigDecimal - open_gt: BigDecimal - open_lt: BigDecimal - open_gte: BigDecimal - open_lte: BigDecimal - open_in: [BigDecimal!] - open_not_in: [BigDecimal!] - high: BigDecimal - high_not: BigDecimal - high_gt: BigDecimal - high_lt: BigDecimal - high_gte: BigDecimal - high_lte: BigDecimal - high_in: [BigDecimal!] - high_not_in: [BigDecimal!] - low: BigDecimal - low_not: BigDecimal - low_gt: BigDecimal - low_lt: BigDecimal - low_gte: BigDecimal - low_lte: BigDecimal - low_in: [BigDecimal!] - low_not_in: [BigDecimal!] - close: BigDecimal - close_not: BigDecimal - close_gt: BigDecimal - close_lt: BigDecimal - close_gte: BigDecimal - close_lte: BigDecimal - close_in: [BigDecimal!] - close_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [TokenDayData_filter] - or: [TokenDayData_filter] -} - -enum TokenDayData_orderBy { - id - date - token - token__id - token__symbol - token__name - token__decimals - token__totalSupply - token__volume - token__volumeUSD - token__untrackedVolumeUSD - token__feesUSD - token__txCount - token__poolCount - token__totalValueLocked - token__totalValueLockedUSD - token__totalValueLockedUSDUntracked - token__derivedETH - volume - volumeUSD - untrackedVolumeUSD - totalValueLocked - totalValueLockedUSD - priceUSD - feesUSD - open - high - low - close -} - -type TokenHourData { - id: ID! - periodStartUnix: Int! - token: Token! - volume: BigDecimal! - volumeUSD: BigDecimal! - untrackedVolumeUSD: BigDecimal! - totalValueLocked: BigDecimal! - totalValueLockedUSD: BigDecimal! - priceUSD: BigDecimal! - feesUSD: BigDecimal! - open: BigDecimal! - high: BigDecimal! - low: BigDecimal! - close: BigDecimal! -} - -input TokenHourData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - periodStartUnix: Int - periodStartUnix_not: Int - periodStartUnix_gt: Int - periodStartUnix_lt: Int - periodStartUnix_gte: Int - periodStartUnix_lte: Int - periodStartUnix_in: [Int!] - periodStartUnix_not_in: [Int!] - token: String - token_not: String - token_gt: String - token_lt: String - token_gte: String - token_lte: String - token_in: [String!] - token_not_in: [String!] - token_contains: String - token_contains_nocase: String - token_not_contains: String - token_not_contains_nocase: String - token_starts_with: String - token_starts_with_nocase: String - token_not_starts_with: String - token_not_starts_with_nocase: String - token_ends_with: String - token_ends_with_nocase: String - token_not_ends_with: String - token_not_ends_with_nocase: String - token_: Token_filter - volume: BigDecimal - volume_not: BigDecimal - volume_gt: BigDecimal - volume_lt: BigDecimal - volume_gte: BigDecimal - volume_lte: BigDecimal - volume_in: [BigDecimal!] - volume_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - totalValueLocked: BigDecimal - totalValueLocked_not: BigDecimal - totalValueLocked_gt: BigDecimal - totalValueLocked_lt: BigDecimal - totalValueLocked_gte: BigDecimal - totalValueLocked_lte: BigDecimal - totalValueLocked_in: [BigDecimal!] - totalValueLocked_not_in: [BigDecimal!] - totalValueLockedUSD: BigDecimal - totalValueLockedUSD_not: BigDecimal - totalValueLockedUSD_gt: BigDecimal - totalValueLockedUSD_lt: BigDecimal - totalValueLockedUSD_gte: BigDecimal - totalValueLockedUSD_lte: BigDecimal - totalValueLockedUSD_in: [BigDecimal!] - totalValueLockedUSD_not_in: [BigDecimal!] - priceUSD: BigDecimal - priceUSD_not: BigDecimal - priceUSD_gt: BigDecimal - priceUSD_lt: BigDecimal - priceUSD_gte: BigDecimal - priceUSD_lte: BigDecimal - priceUSD_in: [BigDecimal!] - priceUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - open: BigDecimal - open_not: BigDecimal - open_gt: BigDecimal - open_lt: BigDecimal - open_gte: BigDecimal - open_lte: BigDecimal - open_in: [BigDecimal!] - open_not_in: [BigDecimal!] - high: BigDecimal - high_not: BigDecimal - high_gt: BigDecimal - high_lt: BigDecimal - high_gte: BigDecimal - high_lte: BigDecimal - high_in: [BigDecimal!] - high_not_in: [BigDecimal!] - low: BigDecimal - low_not: BigDecimal - low_gt: BigDecimal - low_lt: BigDecimal - low_gte: BigDecimal - low_lte: BigDecimal - low_in: [BigDecimal!] - low_not_in: [BigDecimal!] - close: BigDecimal - close_not: BigDecimal - close_gt: BigDecimal - close_lt: BigDecimal - close_gte: BigDecimal - close_lte: BigDecimal - close_in: [BigDecimal!] - close_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [TokenHourData_filter] - or: [TokenHourData_filter] -} - -enum TokenHourData_orderBy { - id - periodStartUnix - token - token__id - token__symbol - token__name - token__decimals - token__totalSupply - token__volume - token__volumeUSD - token__untrackedVolumeUSD - token__feesUSD - token__txCount - token__poolCount - token__totalValueLocked - token__totalValueLockedUSD - token__totalValueLockedUSDUntracked - token__derivedETH - volume - volumeUSD - untrackedVolumeUSD - totalValueLocked - totalValueLockedUSD - priceUSD - feesUSD - open - high - low - close -} - -input Token_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - symbol: String - symbol_not: String - symbol_gt: String - symbol_lt: String - symbol_gte: String - symbol_lte: String - symbol_in: [String!] - symbol_not_in: [String!] - symbol_contains: String - symbol_contains_nocase: String - symbol_not_contains: String - symbol_not_contains_nocase: String - symbol_starts_with: String - symbol_starts_with_nocase: String - symbol_not_starts_with: String - symbol_not_starts_with_nocase: String - symbol_ends_with: String - symbol_ends_with_nocase: String - symbol_not_ends_with: String - symbol_not_ends_with_nocase: String - name: String - name_not: String - name_gt: String - name_lt: String - name_gte: String - name_lte: String - name_in: [String!] - name_not_in: [String!] - name_contains: String - name_contains_nocase: String - name_not_contains: String - name_not_contains_nocase: String - name_starts_with: String - name_starts_with_nocase: String - name_not_starts_with: String - name_not_starts_with_nocase: String - name_ends_with: String - name_ends_with_nocase: String - name_not_ends_with: String - name_not_ends_with_nocase: String - decimals: BigInt - decimals_not: BigInt - decimals_gt: BigInt - decimals_lt: BigInt - decimals_gte: BigInt - decimals_lte: BigInt - decimals_in: [BigInt!] - decimals_not_in: [BigInt!] - totalSupply: BigInt - totalSupply_not: BigInt - totalSupply_gt: BigInt - totalSupply_lt: BigInt - totalSupply_gte: BigInt - totalSupply_lte: BigInt - totalSupply_in: [BigInt!] - totalSupply_not_in: [BigInt!] - volume: BigDecimal - volume_not: BigDecimal - volume_gt: BigDecimal - volume_lt: BigDecimal - volume_gte: BigDecimal - volume_lte: BigDecimal - volume_in: [BigDecimal!] - volume_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - untrackedVolumeUSD: BigDecimal - untrackedVolumeUSD_not: BigDecimal - untrackedVolumeUSD_gt: BigDecimal - untrackedVolumeUSD_lt: BigDecimal - untrackedVolumeUSD_gte: BigDecimal - untrackedVolumeUSD_lte: BigDecimal - untrackedVolumeUSD_in: [BigDecimal!] - untrackedVolumeUSD_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - poolCount: BigInt - poolCount_not: BigInt - poolCount_gt: BigInt - poolCount_lt: BigInt - poolCount_gte: BigInt - poolCount_lte: BigInt - poolCount_in: [BigInt!] - poolCount_not_in: [BigInt!] - totalValueLocked: BigDecimal - totalValueLocked_not: BigDecimal - totalValueLocked_gt: BigDecimal - totalValueLocked_lt: BigDecimal - totalValueLocked_gte: BigDecimal - totalValueLocked_lte: BigDecimal - totalValueLocked_in: [BigDecimal!] - totalValueLocked_not_in: [BigDecimal!] - totalValueLockedUSD: BigDecimal - totalValueLockedUSD_not: BigDecimal - totalValueLockedUSD_gt: BigDecimal - totalValueLockedUSD_lt: BigDecimal - totalValueLockedUSD_gte: BigDecimal - totalValueLockedUSD_lte: BigDecimal - totalValueLockedUSD_in: [BigDecimal!] - totalValueLockedUSD_not_in: [BigDecimal!] - totalValueLockedUSDUntracked: BigDecimal - totalValueLockedUSDUntracked_not: BigDecimal - totalValueLockedUSDUntracked_gt: BigDecimal - totalValueLockedUSDUntracked_lt: BigDecimal - totalValueLockedUSDUntracked_gte: BigDecimal - totalValueLockedUSDUntracked_lte: BigDecimal - totalValueLockedUSDUntracked_in: [BigDecimal!] - totalValueLockedUSDUntracked_not_in: [BigDecimal!] - derivedETH: BigDecimal - derivedETH_not: BigDecimal - derivedETH_gt: BigDecimal - derivedETH_lt: BigDecimal - derivedETH_gte: BigDecimal - derivedETH_lte: BigDecimal - derivedETH_in: [BigDecimal!] - derivedETH_not_in: [BigDecimal!] - whitelistPools: [String!] - whitelistPools_not: [String!] - whitelistPools_contains: [String!] - whitelistPools_contains_nocase: [String!] - whitelistPools_not_contains: [String!] - whitelistPools_not_contains_nocase: [String!] - whitelistPools_: Pool_filter - tokenDayData_: TokenDayData_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Token_filter] - or: [Token_filter] -} - -enum Token_orderBy { - id - symbol - name - decimals - totalSupply - volume - volumeUSD - untrackedVolumeUSD - feesUSD - txCount - poolCount - totalValueLocked - totalValueLockedUSD - totalValueLockedUSDUntracked - derivedETH - whitelistPools - tokenDayData -} - -type Transaction { - id: ID! - blockNumber: BigInt! - timestamp: BigInt! - gasUsed: BigInt! - gasPrice: BigInt! - mints(skip: Int = 0, first: Int = 100, orderBy: Mint_orderBy, orderDirection: OrderDirection, where: Mint_filter): [Mint!]! - burns(skip: Int = 0, first: Int = 100, orderBy: Burn_orderBy, orderDirection: OrderDirection, where: Burn_filter): [Burn!]! - swaps(skip: Int = 0, first: Int = 100, orderBy: Swap_orderBy, orderDirection: OrderDirection, where: Swap_filter): [Swap!]! - flashed(skip: Int = 0, first: Int = 100, orderBy: Flash_orderBy, orderDirection: OrderDirection, where: Flash_filter): [Flash!]! - collects(skip: Int = 0, first: Int = 100, orderBy: Collect_orderBy, orderDirection: OrderDirection, where: Collect_filter): [Collect!]! -} - -input Transaction_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - blockNumber: BigInt - blockNumber_not: BigInt - blockNumber_gt: BigInt - blockNumber_lt: BigInt - blockNumber_gte: BigInt - blockNumber_lte: BigInt - blockNumber_in: [BigInt!] - blockNumber_not_in: [BigInt!] - timestamp: BigInt - timestamp_not: BigInt - timestamp_gt: BigInt - timestamp_lt: BigInt - timestamp_gte: BigInt - timestamp_lte: BigInt - timestamp_in: [BigInt!] - timestamp_not_in: [BigInt!] - gasUsed: BigInt - gasUsed_not: BigInt - gasUsed_gt: BigInt - gasUsed_lt: BigInt - gasUsed_gte: BigInt - gasUsed_lte: BigInt - gasUsed_in: [BigInt!] - gasUsed_not_in: [BigInt!] - gasPrice: BigInt - gasPrice_not: BigInt - gasPrice_gt: BigInt - gasPrice_lt: BigInt - gasPrice_gte: BigInt - gasPrice_lte: BigInt - gasPrice_in: [BigInt!] - gasPrice_not_in: [BigInt!] - mints_: Mint_filter - burns_: Burn_filter - swaps_: Swap_filter - flashed_: Flash_filter - collects_: Collect_filter - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [Transaction_filter] - or: [Transaction_filter] -} - -enum Transaction_orderBy { - id - blockNumber - timestamp - gasUsed - gasPrice - mints - burns - swaps - flashed - collects -} - -type UniswapDayData { - id: ID! - date: Int! - volumeETH: BigDecimal! - volumeUSD: BigDecimal! - volumeUSDUntracked: BigDecimal! - feesUSD: BigDecimal! - txCount: BigInt! - tvlUSD: BigDecimal! -} - -input UniswapDayData_filter { - id: ID - id_not: ID - id_gt: ID - id_lt: ID - id_gte: ID - id_lte: ID - id_in: [ID!] - id_not_in: [ID!] - date: Int - date_not: Int - date_gt: Int - date_lt: Int - date_gte: Int - date_lte: Int - date_in: [Int!] - date_not_in: [Int!] - volumeETH: BigDecimal - volumeETH_not: BigDecimal - volumeETH_gt: BigDecimal - volumeETH_lt: BigDecimal - volumeETH_gte: BigDecimal - volumeETH_lte: BigDecimal - volumeETH_in: [BigDecimal!] - volumeETH_not_in: [BigDecimal!] - volumeUSD: BigDecimal - volumeUSD_not: BigDecimal - volumeUSD_gt: BigDecimal - volumeUSD_lt: BigDecimal - volumeUSD_gte: BigDecimal - volumeUSD_lte: BigDecimal - volumeUSD_in: [BigDecimal!] - volumeUSD_not_in: [BigDecimal!] - volumeUSDUntracked: BigDecimal - volumeUSDUntracked_not: BigDecimal - volumeUSDUntracked_gt: BigDecimal - volumeUSDUntracked_lt: BigDecimal - volumeUSDUntracked_gte: BigDecimal - volumeUSDUntracked_lte: BigDecimal - volumeUSDUntracked_in: [BigDecimal!] - volumeUSDUntracked_not_in: [BigDecimal!] - feesUSD: BigDecimal - feesUSD_not: BigDecimal - feesUSD_gt: BigDecimal - feesUSD_lt: BigDecimal - feesUSD_gte: BigDecimal - feesUSD_lte: BigDecimal - feesUSD_in: [BigDecimal!] - feesUSD_not_in: [BigDecimal!] - txCount: BigInt - txCount_not: BigInt - txCount_gt: BigInt - txCount_lt: BigInt - txCount_gte: BigInt - txCount_lte: BigInt - txCount_in: [BigInt!] - txCount_not_in: [BigInt!] - tvlUSD: BigDecimal - tvlUSD_not: BigDecimal - tvlUSD_gt: BigDecimal - tvlUSD_lt: BigDecimal - tvlUSD_gte: BigDecimal - tvlUSD_lte: BigDecimal - tvlUSD_in: [BigDecimal!] - tvlUSD_not_in: [BigDecimal!] - - """Filter for the block changed event.""" - _change_block: BlockChangedFilter - and: [UniswapDayData_filter] - or: [UniswapDayData_filter] -} - -enum UniswapDayData_orderBy { - id - date - volumeETH - volumeUSD - volumeUSDUntracked - feesUSD - txCount - tvlUSD -} - -type _Block_ { - """The hash of the block""" - hash: Bytes - - """The block number""" - number: Int! - - """Integer representation of the timestamp stored in blocks for the chain""" - timestamp: Int - - """The hash of the parent block""" - parentHash: Bytes -} - -"""The type for the top-level _meta field""" -type _Meta_ { - "Information about a specific subgraph block. The hash of the block\nwill be null if the _meta field has a block constraint that asks for\na block number. It will be filled if the _meta field has no block constraint\nand therefore asks for the latest block\n" - block: _Block_! - - """The deployment ID""" - deployment: String! - - """If `true`, the subgraph encountered indexing errors at some past block""" - hasIndexingErrors: Boolean! -} - -enum _SubgraphErrorPolicy_ { - """Data will be returned even if the subgraph has indexing errors""" - allow - - """ - If the subgraph has indexing errors, data will be omitted. The default. - """ - deny -} \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts b/packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts deleted file mode 100644 index f17b9c08e2..0000000000 --- a/packages/graph-client/src/subgraphs/sushi-v3/transforms/pool-v3-to-base.ts +++ /dev/null @@ -1,73 +0,0 @@ -import type { ResultOf } from 'gql.tada' -import type { PoolFieldsFragment } from 'src/subgraphs/sushi-v3/fragments/pool-fields' -import type { SushiSwapV3ChainId } from 'sushi/config' -import { - getIdFromChainIdAddress, - withoutScientificNotation, -} from 'sushi/format' -import { SushiSwapProtocol, type Address } from 'sushi/types' - -export function transformPoolV3ToBase( - pool: ResultOf, - chainId: SushiSwapV3ChainId, -) { - const swapFee = Number(pool.swapFee) / 1000000 - - return { - id: getIdFromChainIdAddress(chainId, pool.id as Address), - address: pool.id as Address, - chainId, - name: `${pool.token0.symbol}-${pool.token1.symbol}`, - - swapFee: swapFee, - // twapEnabled: pool.twapEnabled, - - feeGrowthGlobal0X128: BigInt(pool.feeGrowthGlobal0X128), - feeGrowthGlobal1X128: BigInt(pool.feeGrowthGlobal1X128), - observationIndex: BigInt(pool.observationIndex), - sqrtPrice: BigInt(pool.sqrtPrice), - tick: BigInt(pool.tick ?? 0), - - protocol: SushiSwapProtocol.SUSHISWAP_V3, - - reserve0: BigInt( - withoutScientificNotation( - (Number(pool.reserve0) * 10 ** Number(pool.token0.decimals)).toFixed(), - )!, - ), - reserve1: BigInt( - withoutScientificNotation( - (Number(pool.reserve1) * 10 ** Number(pool.token1.decimals)).toFixed(), - )!, - ), - liquidity: BigInt(pool.liquidity), - liquidityUSD: Number(pool.liquidityUSD), - - volumeUSD: Number(pool.volumeUSD), - feesUSD: Number(pool.volumeUSD) * swapFee, - - token0: { - id: getIdFromChainIdAddress(chainId, pool.token0.id as Address), - address: pool.token0.id as Address, - chainId, - decimals: Number(pool.token0.decimals), - name: pool.token0.name, - symbol: pool.token0.symbol, - }, - token1: { - id: getIdFromChainIdAddress(chainId, pool.token1.id as Address), - address: pool.token1.id as Address, - chainId, - decimals: Number(pool.token1.decimals), - name: pool.token1.name, - symbol: pool.token1.symbol, - }, - - token0Price: Number(pool.token0Price), - token1Price: Number(pool.token1Price), - - txCount: Number(pool.txCount), - - isProtocolFeeEnabled: pool.isProtocolFeeEnabled, - } -} diff --git a/packages/graph-client/tsconfig.json b/packages/graph-client/tsconfig.json index 38d5b7b489..08f8548baa 100644 --- a/packages/graph-client/tsconfig.json +++ b/packages/graph-client/tsconfig.json @@ -46,13 +46,7 @@ "schema": "./src/subgraphs/data-api/schema.graphql", "tadaOutputLocation": "./src/subgraphs/data-api/data-api-env.d.ts", "tadaTurboLocation": "./src/subgraphs/data-api/data-api-cache.d.ts" - }, - { - "name": "sushi-v3", - "schema": "./src/subgraphs/sushi-v3/schema.graphql", - "tadaOutputLocation": "./src/subgraphs/sushi-v3/sushi-v3-env.d.ts", - "tadaTurboLocation": "./src/subgraphs/sushi-v3/sushi-v3-cache.d.ts" - }, + } ] } ] diff --git a/packages/sushi/src/types/sushi-pool/pool-v3.ts b/packages/sushi/src/types/sushi-pool/pool-v3.ts index 7386c71c6b..cc7374f2ab 100644 --- a/packages/sushi/src/types/sushi-pool/pool-v3.ts +++ b/packages/sushi/src/types/sushi-pool/pool-v3.ts @@ -3,6 +3,7 @@ import type { PoolId } from './pool-id.js' import { SushiSwapProtocol, type SushiSwapV3Protocol } from './protocol.js' type Extension = { + isProtocolFeeEnabled?: boolean sqrtPrice: bigint tick: bigint observationIndex: bigint From 56a423d1d371518d224eb5c45883501496ce08a5 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 8 Aug 2024 19:59:12 +0000 Subject: [PATCH 076/139] chore: lint --- apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx index 9cc9d9fe60..da10d45430 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/fees/page.tsx @@ -1,4 +1,3 @@ - import { getV3BasePools } from '@sushiswap/graph-client/data-api' import { Card, Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' From 3d9c9796340242a55503140547cb73741ef5e215 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 8 Aug 2024 22:09:14 +0200 Subject: [PATCH 077/139] test(apps/web): fix chain id variable --- apps/web/test/pool/pool.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/test/pool/pool.test.ts b/apps/web/test/pool/pool.test.ts index 12f17411da..e6458b02ab 100644 --- a/apps/web/test/pool/pool.test.ts +++ b/apps/web/test/pool/pool.test.ts @@ -14,7 +14,7 @@ import { interceptAnvil } from 'test/intercept-anvil' const NATIVE_TOKEN = Native.onChain(chainId) let FAKE_TOKEN: Token -const BASE_URL = 'http://localhost:3000/pool' +const BASE_URL = 'http://localhost:3000' test.beforeAll(async () => { // console.log('beforeAll pool tests') @@ -145,7 +145,7 @@ test.describe('V3', () => { next, }) => { test.slow() - const url = BASE_URL.concat(`/${chainId.toString()}/v3/add`) + const url = BASE_URL.concat(`/${chainId.toString()}/pool/v3/add`) const poolPage = new PoolPage(page, chainId) await poolPage.mockPoolApi( @@ -190,7 +190,7 @@ test.describe('V2', () => { test.slow() const poolPage = new PoolPage(page, chainId) - const url = BASE_URL.concat(`/${chainId.toString()}/v2/add`) + const url = BASE_URL.concat(`/${chainId.toString()}/pool/v2/add`) await poolPage.goTo(url) await poolPage.connect() await poolPage.switchNetwork(chainId) From c0cfa547766d4bda8851c4ed187c94f98dcfb9f0 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Thu, 8 Aug 2024 22:13:36 +0200 Subject: [PATCH 078/139] fix(packages/graph-client): add request header to v3 query --- .../graph-client/src/subgraphs/data-api/queries/v3/pools.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/graph-client/src/subgraphs/data-api/queries/v3/pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools.ts index cbf5645469..11f7278ff4 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/v3/pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/v3/pools.ts @@ -6,6 +6,7 @@ import { isSushiSwapV3ChainId } from 'sushi/config' import type { Address } from 'viem' import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' +import { SUSHI_REQUEST_HEADERS } from '../../request-headers' export const V3PoolsQuery = graphql( ` @@ -75,6 +76,7 @@ export async function getV3BasePools( variables: { chainId: chainId, }, + requestHeaders: SUSHI_REQUEST_HEADERS, }, options, ) From 5b0b8f0cdccf6e7cf0169331df7853834dca80b0 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Fri, 9 Aug 2024 10:21:05 +0200 Subject: [PATCH 079/139] test(apps/web): fix goTo url --- apps/web/test/helpers/pool.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/test/helpers/pool.ts b/apps/web/test/helpers/pool.ts index 2ac874c7c2..da3fa9a25c 100644 --- a/apps/web/test/helpers/pool.ts +++ b/apps/web/test/helpers/pool.ts @@ -266,7 +266,6 @@ export class PoolPage extends BaseActions { .concat(poolAddress) .concat('/positions/create') await this.page.goto(url) - await this.page.goto(BASE_URL) await this.connect() await this.page.locator('[testdata-id=my-positions-button]').click() From 3799cd2846284c16fbd4ad9ccea30e67b6dcdeb8 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Fri, 9 Aug 2024 10:42:06 +0200 Subject: [PATCH 080/139] test(apps/web): fix e2e --- apps/web/test/helpers/pool.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/apps/web/test/helpers/pool.ts b/apps/web/test/helpers/pool.ts index da3fa9a25c..9c40a3bac0 100644 --- a/apps/web/test/helpers/pool.ts +++ b/apps/web/test/helpers/pool.ts @@ -46,7 +46,7 @@ interface AddV2LiquidityArgs { amount0: string amount1: string } -const BASE_URL = 'http://localhost:3000/pool' +const BASE_URL = 'http://localhost:3000' export class PoolPage extends BaseActions { readonly chainId: number @@ -260,11 +260,7 @@ export class PoolPage extends BaseActions { tokenB: fakeToken, fee: SushiSwapV3FeeAmount.HIGH, }) - // TODO: position Number? - const url = BASE_URL.concat(this.chainId.toString()) - .concat('/pool/v3/') - .concat(poolAddress) - .concat('/positions/create') + const url = BASE_URL.concat(`/${this.chainId.toString()}/pool/v3/${poolAddress}/positions/create`) await this.page.goto(url) await this.connect() await this.page.locator('[testdata-id=my-positions-button]').click() @@ -315,10 +311,7 @@ export class PoolPage extends BaseActions { tokenB: fakeToken, }) - const url = BASE_URL.concat(this.chainId.toString()) - .concat('/pool/v2/') - .concat(poolAddress) - .concat('/remove') + const url = BASE_URL.concat(`/${this.chainId.toString()}/pool/v2/${poolAddress}/remove`) await this.page.goto(url) await this.connect() await this.switchNetwork(this.chainId) From 804c691cf546898213769d4be73ef345635f6a9b Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Fri, 9 Aug 2024 08:43:19 +0000 Subject: [PATCH 081/139] chore: lint --- apps/web/test/helpers/pool.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/web/test/helpers/pool.ts b/apps/web/test/helpers/pool.ts index 9c40a3bac0..ab27f60600 100644 --- a/apps/web/test/helpers/pool.ts +++ b/apps/web/test/helpers/pool.ts @@ -260,7 +260,9 @@ export class PoolPage extends BaseActions { tokenB: fakeToken, fee: SushiSwapV3FeeAmount.HIGH, }) - const url = BASE_URL.concat(`/${this.chainId.toString()}/pool/v3/${poolAddress}/positions/create`) + const url = BASE_URL.concat( + `/${this.chainId.toString()}/pool/v3/${poolAddress}/positions/create`, + ) await this.page.goto(url) await this.connect() await this.page.locator('[testdata-id=my-positions-button]').click() @@ -311,7 +313,9 @@ export class PoolPage extends BaseActions { tokenB: fakeToken, }) - const url = BASE_URL.concat(`/${this.chainId.toString()}/pool/v2/${poolAddress}/remove`) + const url = BASE_URL.concat( + `/${this.chainId.toString()}/pool/v2/${poolAddress}/remove`, + ) await this.page.goto(url) await this.connect() await this.switchNetwork(this.chainId) From 036a432f85d18c0babf68a945ef9e35a2e32a8a0 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Fri, 9 Aug 2024 10:54:38 +0200 Subject: [PATCH 082/139] test(apps/web): disable remove v3 liquidity e2e --- apps/web/test/helpers/pool.ts | 2 +- apps/web/test/pool/pool.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/test/helpers/pool.ts b/apps/web/test/helpers/pool.ts index 9c40a3bac0..12cc05910a 100644 --- a/apps/web/test/helpers/pool.ts +++ b/apps/web/test/helpers/pool.ts @@ -260,7 +260,7 @@ export class PoolPage extends BaseActions { tokenB: fakeToken, fee: SushiSwapV3FeeAmount.HIGH, }) - const url = BASE_URL.concat(`/${this.chainId.toString()}/pool/v3/${poolAddress}/positions/create`) + const url = BASE_URL.concat(`/${this.chainId.toString()}/pool/v3/${poolAddress}/positions/create`) // TODO: fix url, must contain the position ID await this.page.goto(url) await this.connect() await this.page.locator('[testdata-id=my-positions-button]').click() diff --git a/apps/web/test/pool/pool.test.ts b/apps/web/test/pool/pool.test.ts index e6458b02ab..96088c28ed 100644 --- a/apps/web/test/pool/pool.test.ts +++ b/apps/web/test/pool/pool.test.ts @@ -179,7 +179,7 @@ test.describe('V3', () => { amountBelongsToToken0: false, }) - await poolPage.removeLiquidityV3(FAKE_TOKEN) + // await poolPage.removeLiquidityV3(FAKE_TOKEN) // TODO: enable once you can determine what the position ID will be }) }) From b7b09e33be2240bfcd123d7c62d7b0076ce83efe Mon Sep 17 00:00:00 2001 From: Matthew Lilley Date: Fri, 9 Aug 2024 12:46:00 +0100 Subject: [PATCH 083/139] chore: nav cleanup --- .../src/app/(evm)/_common/header-elements.tsx | 14 ++++---- apps/web/src/app/_common/header-elements.ts | 32 ------------------- packages/ui/src/components/navigation.tsx | 21 ++++++++++-- 3 files changed, 26 insertions(+), 41 deletions(-) diff --git a/apps/web/src/app/(evm)/_common/header-elements.tsx b/apps/web/src/app/(evm)/_common/header-elements.tsx index 213ceec5b4..5600acafb5 100644 --- a/apps/web/src/app/(evm)/_common/header-elements.tsx +++ b/apps/web/src/app/(evm)/_common/header-elements.tsx @@ -9,7 +9,7 @@ import { } from '@sushiswap/ui' import { EXPLORE_NAVIGATION_LINKS, - MORE_NAVIGATION_LINKS, + // MORE_NAVIGATION_LINKS, } from 'src/app/_common/header-elements' import { ChainId } from 'sushi' @@ -59,10 +59,10 @@ export const headerElements = (chainId?: ChainId): NavigationElement[] => [ show: 'desktop', type: NavigationElementType.Single, }, - { - title: 'More', - items: MORE_NAVIGATION_LINKS, - show: 'desktop', - type: NavigationElementType.Dropdown, - }, + // { + // title: 'More', + // items: MORE_NAVIGATION_LINKS, + // show: 'desktop', + // type: NavigationElementType.Dropdown, + // }, ] diff --git a/apps/web/src/app/_common/header-elements.ts b/apps/web/src/app/_common/header-elements.ts index 6b8571edfd..1e776182a0 100644 --- a/apps/web/src/app/_common/header-elements.ts +++ b/apps/web/src/app/_common/header-elements.ts @@ -18,37 +18,11 @@ export const EXPLORE_NAVIGATION_LINKS = ( href: `/${chainId ?? 1}/explore/pools`, description: 'Earn fees by providing liquidity.', }, - { - title: 'Bonds', - href: '/bonds', - description: 'Earn interest by locking up your assets.', - }, { title: 'Stake', href: '/stake', description: 'Earn protocol fees by staking SUSHI.', }, - { - title: 'Blog', - href: '/blog', - description: - 'Stay up to date with the latest product developments at Sushi.', - }, - { - title: 'Academy', - href: '/academy', - description: 'Everything you need to get up to speed with DeFi.', - }, - { - title: 'Partner with Sushi', - href: '/partner', - description: 'Incentivize your token with Sushi rewards.', - }, - { - title: 'List enquiry', - href: '/tokenlist-request', - description: 'Get your token on our default token list.', - }, ] export const MORE_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ @@ -97,10 +71,4 @@ export const headerElements = (chainId?: ChainId): NavigationElement[] => [ show: 'desktop', type: NavigationElementType.Single, }, - { - title: 'More', - items: MORE_NAVIGATION_LINKS, - show: 'desktop', - type: NavigationElementType.Dropdown, - }, ] diff --git a/packages/ui/src/components/navigation.tsx b/packages/ui/src/components/navigation.tsx index d9b2e27c8f..e677f9643e 100644 --- a/packages/ui/src/components/navigation.tsx +++ b/packages/ui/src/components/navigation.tsx @@ -14,15 +14,18 @@ import { NavigationMenuTrigger, } from './navigation-menu' -const PROTOCOL_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ +const COMPANY_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ { title: 'Blog', href: '/blog', description: 'Stay up to date with the latest product developments at Sushi.', }, +] + +const PROTOCOL_NAVIGATION_LINKS: NavigationElementDropdown['items'] = [ { - title: 'Forum & Proposals', + title: 'Forum', href: 'https://forum.sushi.com', description: 'View and discuss proposals for SushiSwap.', }, @@ -209,6 +212,20 @@ const Navigation: React.FC = ({
    + Company +
    + {COMPANY_NAVIGATION_LINKS.map((component) => ( + + {component.description} + + ))} +
    +
    +
    Protocol
    {PROTOCOL_NAVIGATION_LINKS.map((component) => ( From f04f30e1314e769b8af11f7707b1d69fb49f7149 Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Fri, 9 Aug 2024 13:47:19 +0200 Subject: [PATCH 084/139] feat: update top pools query (support non evm like aptos) --- apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx | 2 +- packages/graph-client/scripts/update-schemas.ts | 1 - .../src/subgraphs/data-api/queries/pool/top-pools.ts | 4 ++-- packages/graph-client/src/subgraphs/data-api/schema.graphql | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx b/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx index f0b11225b1..6569ba63d6 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx @@ -17,7 +17,7 @@ export default async function PoolsPage({ params: { chainId: string } }) { const pools = await unstable_cache( - async () => getTopPools({ chainId: +params.chainId }), + async () => getTopPools({ chainId: params.chainId }), ['pools', params.chainId], { revalidate: 60 * 3, diff --git a/packages/graph-client/scripts/update-schemas.ts b/packages/graph-client/scripts/update-schemas.ts index 19046bce11..75818e3e50 100644 --- a/packages/graph-client/scripts/update-schemas.ts +++ b/packages/graph-client/scripts/update-schemas.ts @@ -9,7 +9,6 @@ const schemas = { strapi: 'sushi-strapi-cms.herokuapp.com/graphql', furo: 'api.studio.thegraph.com/query/32073/furo-ethereum/v0.0.1', 'data-api': 'data-api-production-acb1.up.railway.app/graphql', - 'sushi-v3': 'api.studio.thegraph.com/query/32073/v3-arbitrum/v0.0.1', } as const satisfies Record async function updateSchema(schema: keyof typeof schemas) { diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts index 85d32a030d..9e2dee5d10 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts @@ -6,7 +6,7 @@ import { SUSHI_REQUEST_HEADERS } from '../../request-headers' export const PoolsQuery = graphql( ` - query TopPools($chainId: Int!) { + query TopPools($chainId: String!) { topPools(chainId: $chainId) { id chainId @@ -61,7 +61,7 @@ export async function getTopPools( return result.topPools ?? [] } } catch (error) { - console.error('getV2Pool error', error) + console.error('getTopPools error', error) } return [] } diff --git a/packages/graph-client/src/subgraphs/data-api/schema.graphql b/packages/graph-client/src/subgraphs/data-api/schema.graphql index 995bb1c206..699c35231e 100644 --- a/packages/graph-client/src/subgraphs/data-api/schema.graphql +++ b/packages/graph-client/src/subgraphs/data-api/schema.graphql @@ -20,7 +20,7 @@ type SushiDayBuckets { type Query { sushiDayBuckets(chainId: Int!): SushiDayBuckets! - topPools(chainId: Int!): [TopPool!]! + topPools(chainId: String!): [TopPool!]! v2Pool(address: String!, chainId: Int!): V2Pool! v3Pool(address: String!, chainId: Int!): V3Pool! v2PoolBuckets(address: String!, chainId: Int!): PoolBuckets! @@ -183,7 +183,7 @@ type PoolBucket { type TopPool { id: ID! - chainId: Int! + chainId: String! name: String! address: String! createdAt: String! From 2278ba2d3b493242b61660877513b716b6b050cc Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Fri, 9 Aug 2024 14:20:31 +0200 Subject: [PATCH 085/139] refactor(packages/graph-client): separate top evm/non evm pools --- .../subgraphs/data-api/queries/pool/index.ts | 3 +- .../data-api/queries/pool/top-evm-pools.ts | 79 +++++++++++++++++++ .../{top-pools.ts => top-non-evm-pools.ts} | 12 +-- 3 files changed, 87 insertions(+), 7 deletions(-) create mode 100644 packages/graph-client/src/subgraphs/data-api/queries/pool/top-evm-pools.ts rename packages/graph-client/src/subgraphs/data-api/queries/pool/{top-pools.ts => top-non-evm-pools.ts} (80%) diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/index.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/index.ts index b513c926d2..4786a074fc 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/index.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/index.ts @@ -1,3 +1,4 @@ -export * from './top-pools' +export * from './top-evm-pools' +export * from './top-non-evm-pools' export * from './v2-pool' export * from './v3-pool' \ No newline at end of file diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-evm-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-evm-pools.ts new file mode 100644 index 0000000000..c291aeae93 --- /dev/null +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-evm-pools.ts @@ -0,0 +1,79 @@ +import type { VariablesOf } from 'gql.tada' +import { type RequestOptions, request } from 'src/lib/request' +import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' +import { graphql } from '../../graphql' +import { SUSHI_REQUEST_HEADERS } from '../../request-headers' +import { ChainId, isChainId } from 'sushi' + +export const PoolsQuery = graphql( + ` + query TopPools($chainId: String!) { + topPools(chainId: $chainId) { + id + chainId + name + address + createdAt + swapFee + protocol + token0Price + token1Price + token0Address + token1Address + token0PriceUSD + token1PriceUSD + liquidityUSD + txCount1h + txCount1d + feeUSD1h + feeUSD1d + volumeUSD1h + volumeUSD1d + feeApr1d + totalApr1d + incentiveApr + isSmartPool + isIncentivized + wasIncentivized + source + } + } +`, +) + +export type GetPools = VariablesOf + +export async function getTopPools( + variables: GetPools, + options?: RequestOptions, +) { + const url = `https://${SUSHI_DATA_API_HOST}` + try { + if (!isChainId(parseInt(variables.chainId))) { + throw new Error(`Invalid chainId: ${variables.chainId}, this only supports evm networks and must be a number.`) + } + const chainId = parseInt(variables.chainId) as ChainId + const result = await request( + { + url, + document: PoolsQuery, + variables, + requestHeaders: SUSHI_REQUEST_HEADERS, + }, + options, + ) + if (result) { + return ( + result.topPools.map((p) => ({ + ...p, + chainId, + })) ?? [] + ) + } + } catch (error) { + console.error('getTopPools error', error) + } + return [] +} + +export type TopPools = Awaited> diff --git a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-non-evm-pools.ts similarity index 80% rename from packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts rename to packages/graph-client/src/subgraphs/data-api/queries/pool/top-non-evm-pools.ts index 9e2dee5d10..060375c871 100644 --- a/packages/graph-client/src/subgraphs/data-api/queries/pool/top-pools.ts +++ b/packages/graph-client/src/subgraphs/data-api/queries/pool/top-non-evm-pools.ts @@ -4,7 +4,7 @@ import { SUSHI_DATA_API_HOST } from 'sushi/config/subgraph' import { graphql } from '../../graphql' import { SUSHI_REQUEST_HEADERS } from '../../request-headers' -export const PoolsQuery = graphql( +export const TopNonEvmPoolsQuery = graphql( ` query TopPools($chainId: String!) { topPools(chainId: $chainId) { @@ -40,10 +40,10 @@ export const PoolsQuery = graphql( `, ) -export type GetPools = VariablesOf +export type GetNonEvmPools = VariablesOf -export async function getTopPools( - variables: GetPools, +export async function getTopNonEvmPools( + variables: GetNonEvmPools, options?: RequestOptions, ) { const url = `https://${SUSHI_DATA_API_HOST}` @@ -51,7 +51,7 @@ export async function getTopPools( const result = await request( { url, - document: PoolsQuery, + document: TopNonEvmPoolsQuery, variables, requestHeaders: SUSHI_REQUEST_HEADERS, }, @@ -66,4 +66,4 @@ export async function getTopPools( return [] } -export type TopPools = Awaited> +export type TopNonEvmPools = Awaited> From d94ecbc5bb9809db85d6c22f5ba37cf45e5d591e Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Fri, 9 Aug 2024 19:30:26 +0200 Subject: [PATCH 086/139] fix: links and pool e2e test --- .../ConcentratedPositionsTable.tsx | 4 +- apps/web/test/helpers/pool.ts | 220 ++++++++++-------- apps/web/test/playwright.config.ts | 2 +- apps/web/test/pool/pool.test.ts | 64 +---- 4 files changed, 132 insertions(+), 158 deletions(-) diff --git a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx index 40159ad1a2..3a193e12e8 100644 --- a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx +++ b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx @@ -150,7 +150,7 @@ export const ConcentratedPositionsTable: FC = {!hideNewPositionButton ? ( - - - - - - - - -
    - V3 Position - - {isSushiSwapV3ChainId(chainId as SushiSwapV3ChainId) - ? 'New 🔥' - : 'Unavailable'} - -
    -

    - Provide liquidity to a V3 liquidity pool. -

    -
    -
    - {isSushiSwapV2ChainId(chainId as ChainId) ? ( - - -
    - V2 Position -
    -

    - Provide liquidity to a V2 liquidity pool. -

    -
    -
    - ) : null} -
    -
    -
    -
    - -
    -
-
-
- - Looking for a partnership with Sushi? - - -
-
- Need Help? - -
-
-
- ) -} diff --git a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx index 0cc243c9bd..1e166817e4 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx @@ -1,9 +1,26 @@ -import { Container, LinkInternal } from '@sushiswap/ui' +import { GiftIcon } from '@heroicons/react-v1/outline' +import { Container } from '@sushiswap/ui' +import { LinkInternal } from '@sushiswap/ui' +import { Button } from '@sushiswap/ui' +import { Chip } from '@sushiswap/ui' +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuItem, + DropdownMenuTrigger, +} from '@sushiswap/ui' +import { SelectIcon } from '@sushiswap/ui' +import React from 'react' import { GlobalStatsCharts } from 'src/ui/explore/global-stats-charts' import { PathnameButton } from 'src/ui/pathname-button' import { PoolsFiltersProvider } from 'src/ui/pool' import { ChainId } from 'sushi/chain' -import { Hero } from './hero' +import { + SushiSwapV3ChainId, + isSushiSwapV2ChainId, + isSushiSwapV3ChainId, +} from 'sushi/config' export const metadata = { title: 'Pools 💦', @@ -13,16 +30,17 @@ export default async function ExploreLayout({ children, params, }: { children: React.ReactNode; params: { chainId: string } }) { + const chainId = +params.chainId as ChainId return ( <> - - -
- -
+ + - -
+ +
+
+
+ + + + + + + + + +
+ V3 Position + + {isSushiSwapV3ChainId(chainId as SushiSwapV3ChainId) + ? 'New 🔥' + : 'Unavailable'} + +
+

+ Provide liquidity to a V3 liquidity pool. +

+
+
+ {isSushiSwapV2ChainId(chainId as ChainId) ? ( + + +
+ V2 Position +
+

+ Provide liquidity to a V2 liquidity pool. +

+
+
+ ) : null} +
+
+
+
+ +
From 1733abaa3a5701565ba0eb010162f71c51833f3d Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 10 Aug 2024 11:53:03 +0700 Subject: [PATCH 088/139] fix: notFound --- apps/web/src/app/(evm)/[chainId]/not-found.tsx | 7 ++----- .../app/(evm)/[chainId]/pool/incentivize/layout.tsx | 2 +- .../app/(evm)/[chainId]/pool/v2/[address]/layout.tsx | 8 +++++--- apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx | 2 +- apps/web/src/app/(evm)/[chainId]/pool/v2/layout.tsx | 5 +++-- .../app/(evm)/[chainId]/pool/v3/[address]/layout.tsx | 10 ++++++---- .../pool/v3/[address]/smart/(overview)/page.tsx | 10 ++++++---- apps/web/src/app/(evm)/[chainId]/pool/v3/layout.tsx | 5 +++-- 8 files changed, 27 insertions(+), 22 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/not-found.tsx b/apps/web/src/app/(evm)/[chainId]/not-found.tsx index 4dfbd51032..050999fed4 100644 --- a/apps/web/src/app/(evm)/[chainId]/not-found.tsx +++ b/apps/web/src/app/(evm)/[chainId]/not-found.tsx @@ -1,11 +1,8 @@ -'use client' - import { ChevronRightIcon } from '@heroicons/react/20/solid' import { Button, LinkInternal, typographyVariants } from '@sushiswap/ui' -import { useChainId } from 'wagmi' +import { ChainId } from 'sushi/chain' -export default function NotFound() { - const chainId = useChainId() +export default function NotFound(chainId: ChainId = ChainId.ETHEREUM) { return (
diff --git a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx index 4efa29fcf0..4fda3c025f 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx @@ -14,7 +14,7 @@ export default function Layout({ }: { children: React.ReactNode; params: { chainId: string } }) { const chainId = +params.chainId as ChainId if (!isAngleEnabledChainId(chainId)) { - return notFound() + return notFound(chainId) } return ( diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx index d45ac089a9..694cf2367f 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx @@ -3,6 +3,7 @@ import { Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' import { headers } from 'next/headers' import { PoolHeader } from 'src/ui/pool/PoolHeader' +import { ChainId } from 'sushi/chain' import notFound from '../../../not-found' export const metadata = { @@ -16,9 +17,10 @@ export default async function Layout({ children: React.ReactNode params: { chainId: string; address: string } }) { - const { chainId, address } = params + const { chainId: _chainId, address } = params + const chainId = +_chainId as ChainId const pool = await unstable_cache( - async () => getV2Pool({ chainId: Number(chainId), address }), + async () => getV2Pool({ chainId, address }), ['pool', `${chainId}:${address}`], { revalidate: 60 * 15, @@ -27,7 +29,7 @@ export default async function Layout({ // Rockstar C&D if (!pool || pool.id === '42161:0x0a4f9962e24893a4a7567e52c1ce37d5482365de') { - return notFound() + return notFound(chainId) } const headersList = headers() const referer = headersList.get('referer') diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx index 346523cfe3..7cd60ce1da 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx @@ -46,7 +46,7 @@ import notFound from '../../../not-found' export default function Page({ params }: { params: { chainId: string } }) { const chainId = +params.chainId as ChainId if (!isSushiSwapV2ChainId(chainId)) { - return notFound() + return notFound(chainId) } const router = useRouter() diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/layout.tsx index fbe8a175e7..1cda237791 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/layout.tsx @@ -6,8 +6,9 @@ export default function Layout({ children, params, }: { children: React.ReactNode; params: { chainId: string } }) { - if (!isSushiSwapV2ChainId(+params.chainId as ChainId)) { - return notFound() + const chainId = +params.chainId as ChainId + if (!isSushiSwapV2ChainId(chainId)) { + return notFound(chainId) } return <>{children} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx index 85efafa711..6e4946bff3 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx @@ -3,6 +3,7 @@ import { Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' import { headers } from 'next/headers' import { PoolHeader } from 'src/ui/pool/PoolHeader' +import { ChainId } from 'sushi/chain' import notFound from '../../../not-found' export const metadata = { @@ -16,9 +17,10 @@ export default async function Layout({ children: React.ReactNode params: { chainId: string; address: string } }) { - const { chainId, address } = params + const { chainId: _chainId, address } = params + const chainId = +_chainId as ChainId const pool = await unstable_cache( - async () => getV3Pool({ chainId: Number(chainId), address }), + async () => getV3Pool({ chainId, address }), ['pool', `${chainId}:${address}`], { revalidate: 60 * 15, @@ -26,7 +28,7 @@ export default async function Layout({ )() if (!pool) { - return notFound() + return notFound(chainId) } const headersList = headers() @@ -38,7 +40,7 @@ export default async function Layout({ backUrl={referer?.includes('/pool?') ? referer?.toString() : '/pool'} address={address} pool={pool} - apy={{ rewards: pool?.incentiveApr, fees: pool?.feeApr1d }} + apy={{ rewards: pool.incentiveApr, fees: pool.feeApr1d }} />
diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx index c57d30737c..25fb4aa5a9 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx @@ -1,6 +1,7 @@ import { getV3Pool, getVaults } from '@sushiswap/graph-client/data-api' import { unstable_cache } from 'next/cache' import { SteerCarousel } from 'src/ui/pool/Steer/SteerCarousel' +import { ChainId } from 'sushi/chain' import notFound from '../../../../../not-found' export default async function VaultOverviewPage({ @@ -8,9 +9,10 @@ export default async function VaultOverviewPage({ }: { params: { chainId: string; address: string } }) { - const { chainId, address } = params + const { chainId: _chainId, address } = params + const chainId = +_chainId as ChainId const pool = await unstable_cache( - async () => getV3Pool({ chainId: Number(chainId), address }), + async () => getV3Pool({ chainId, address }), ['pool', `${chainId}:${address}`], { revalidate: 60 * 3, @@ -18,7 +20,7 @@ export default async function VaultOverviewPage({ )() const vaults = await unstable_cache( - async () => getVaults({ chainId: Number(chainId), poolAddress: address }), + async () => getVaults({ chainId, poolAddress: address }), ['vaults', `${chainId}:${address}`], { revalidate: 60 * 15, @@ -26,7 +28,7 @@ export default async function VaultOverviewPage({ )() if (!pool || !vaults) { - return notFound() + return notFound(chainId) } return diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/layout.tsx index cfce479253..5ebb188540 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/layout.tsx @@ -6,8 +6,9 @@ export default function Layout({ children, params, }: { children: React.ReactNode; params: { chainId: string } }) { - if (!isSushiSwapV3ChainId(+params.chainId as ChainId)) { - return notFound() + const chainId = +params.chainId as ChainId + if (!isSushiSwapV3ChainId(chainId)) { + return notFound(chainId) } return <>{children} From 4a89e7ce37836179056aaf1ab5c1a5ed7fe47556 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Sat, 10 Aug 2024 13:29:59 +0700 Subject: [PATCH 089/139] fix: PoolTable links --- apps/web/src/ui/pool/PoolsTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/ui/pool/PoolsTable.tsx b/apps/web/src/ui/pool/PoolsTable.tsx index 25702275d2..7f3ea388d5 100644 --- a/apps/web/src/ui/pool/PoolsTable.tsx +++ b/apps/web/src/ui/pool/PoolsTable.tsx @@ -500,7 +500,7 @@ export const PoolsTable: FC = ({ pools, onRowClick }) => { onSortingChange={setSorting} loading={!pools} linkFormatter={(row) => - `pool/${ + `/${row.chainId}/pool/${ row.protocol === SushiSwapProtocol.SUSHISWAP_V2 ? 'v2' : 'v3' }/${row.address}` } From da2b3602fe3c35e3fa3e53461164c076762ed54c Mon Sep 17 00:00:00 2001 From: OlaStenberg Date: Sat, 10 Aug 2024 19:03:26 +0200 Subject: [PATCH 090/139] feat: update urls to use network name over chain id --- .../src/app/(evm)/[chainId]/explore/hero.tsx | 12 ++++---- .../app/(evm)/[chainId]/explore/layout.tsx | 10 +++---- .../(evm)/[chainId]/explore/pools/page.tsx | 1 + .../web/src/app/(evm)/[chainId]/not-found.tsx | 3 +- .../(evm)/[chainId]/pool/incentivize/page.tsx | 4 +-- .../[chainId]/pool/v2/[address]/layout.tsx | 9 ++++-- .../app/(evm)/[chainId]/pool/v2/add/page.tsx | 4 +-- .../v3/[address]/positions/create/page.tsx | 4 +-- .../app/(evm)/[chainId]/pool/v3/add/page.tsx | 4 +-- .../[chainId]/positions/(landing)/layout.tsx | 18 ++++++++---- .../src/app/(evm)/_common/header-elements.tsx | 10 +++++-- apps/web/src/app/_common/header-elements.ts | 8 ++--- apps/web/src/middleware.ts | 17 +++++------ .../ConcentratedPositionsTable.tsx | 6 ++-- apps/web/src/ui/pool/PoolsTable.tsx | 4 +-- packages/sushi/src/chain/constants.ts | 7 +++++ packages/sushi/src/chain/index.ts | 29 ++++++++++++++++++- 17 files changed, 99 insertions(+), 51 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx index 870aebfd4e..f3d5a4bc61 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/hero.tsx @@ -12,7 +12,7 @@ import { import { SelectIcon } from '@sushiswap/ui' import { DiscordIcon } from '@sushiswap/ui/icons/DiscordIcon' import React, { FC } from 'react' -import { ChainId } from 'sushi/chain' +import { ChainId, ChainKey } from 'sushi/chain' import { SushiSwapV3ChainId, isSushiSwapV2ChainId, @@ -49,9 +49,9 @@ export const Hero: FC<{ chainId: ChainId }> = ({ chainId }) => { @@ -73,7 +73,7 @@ export const Hero: FC<{ chainId: ChainId }> = ({ chainId }) => { asChild >
@@ -92,7 +92,7 @@ export const Hero: FC<{ chainId: ChainId }> = ({ chainId }) => { {isSushiSwapV2ChainId(chainId as ChainId) ? (
@@ -115,7 +115,7 @@ export const Hero: FC<{ chainId: ChainId }> = ({ chainId }) => { variant="secondary" size="lg" > - + I want to incentivize a pool diff --git a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx index 0cc243c9bd..e3a7d8dab6 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx @@ -2,7 +2,7 @@ import { Container, LinkInternal } from '@sushiswap/ui' import { GlobalStatsCharts } from 'src/ui/explore/global-stats-charts' import { PathnameButton } from 'src/ui/pathname-button' import { PoolsFiltersProvider } from 'src/ui/pool' -import { ChainId } from 'sushi/chain' +import { ChainId, ChainKey } from 'sushi/chain' import { Hero } from './hero' export const metadata = { @@ -26,11 +26,11 @@ export default async function ExploreLayout({ @@ -40,11 +40,11 @@ export default async function ExploreLayout({ diff --git a/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx b/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx index 6569ba63d6..897bec6d44 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx @@ -16,6 +16,7 @@ export default async function PoolsPage({ }: { params: { chainId: string } }) { + const pools = await unstable_cache( async () => getTopPools({ chainId: params.chainId }), ['pools', params.chainId], diff --git a/apps/web/src/app/(evm)/[chainId]/not-found.tsx b/apps/web/src/app/(evm)/[chainId]/not-found.tsx index 4dfbd51032..9d29a3bbfe 100644 --- a/apps/web/src/app/(evm)/[chainId]/not-found.tsx +++ b/apps/web/src/app/(evm)/[chainId]/not-found.tsx @@ -2,6 +2,7 @@ import { ChevronRightIcon } from '@heroicons/react/20/solid' import { Button, LinkInternal, typographyVariants } from '@sushiswap/ui' +import { ChainKey } from 'sushi' import { useChainId } from 'wagmi' export default function NotFound() { @@ -34,7 +35,7 @@ export default function NotFound() { icon={ChevronRightIcon} iconPosition="end" > - + See a list of our pools diff --git a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx index 28a756328b..5e16fc55dd 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx @@ -50,7 +50,7 @@ import { import { SelectFeeConcentratedWidget } from 'src/ui/pool/SelectFeeConcentratedWidget' import { SelectNetworkWidget } from 'src/ui/pool/SelectNetworkWidget' import { SelectTokensWidget } from 'src/ui/pool/SelectTokensWidget' -import { Chain } from 'sushi/chain' +import { Chain, ChainKey } from 'sushi/chain' import { ANGLE_SUPPORTED_CHAIN_IDS, AngleEnabledChainId, @@ -204,7 +204,7 @@ const Incentivize = withCheckerRoot(() => { router.push(`/${chainId}/pool/incentivize`)} + onSelect={(chainId) => router.push(`/${ChainKey[chainId]}/pool/incentivize`)} networks={ANGLE_SUPPORTED_CHAIN_IDS} /> getV2Pool({ chainId: Number(chainId), address }), + async () => getV2Pool({ chainId: _chainId, address }), ['pool', `${chainId}:${address}`], { revalidate: 60 * 15, @@ -38,7 +43,7 @@ export default async function Layout({ backUrl={ referer?.includes('/pool?') ? referer?.toString() - : `/${chainId}/explore/pools` + : `/${ChainKey[_chainId]}/explore/pools` } address={pool.address} pool={pool} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx index 346523cfe3..03102de915 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/add/page.tsx @@ -18,7 +18,7 @@ import React, { import { DISABLED_CHAIN_IDS } from 'src/config' import { APPROVE_TAG_ADD_LEGACY } from 'src/lib/constants' import { isSushiSwapV2Pool } from 'src/lib/functions' -import { ChainId, TESTNET_CHAIN_IDS } from 'sushi/chain' +import { ChainId, ChainKey, TESTNET_CHAIN_IDS } from 'sushi/chain' import { SUSHISWAP_V2_ROUTER_ADDRESS, SUSHISWAP_V2_SUPPORTED_CHAIN_IDS, @@ -101,7 +101,7 @@ export default function Page({ params }: { params: { chainId: string } }) { chainId={chainId} setChainId={(chainId) => { if (!isSushiSwapV2ChainId(chainId)) return - router.push(`/${chainId}/pool/v2/add`) + router.push(`/${ChainKey[chainId]}/pool/v2/add`) }} pool={pool as SushiSwapV2Pool | null} poolState={poolState as SushiSwapV2PoolState} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx index f3ebdacdda..2a42c799df 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx @@ -2,7 +2,7 @@ import { Container, LinkInternal } from '@sushiswap/ui' import React from 'react' import { ConcentratedLiquidityProvider } from 'src/ui/pool/ConcentratedLiquidityProvider' import { NewPosition } from 'src/ui/pool/NewPosition' -import { ChainId } from 'sushi' +import { ChainId, ChainKey } from 'sushi' import { isSushiSwapV3ChainId } from 'sushi/config' export default async function PositionsCreatePage({ @@ -18,7 +18,7 @@ export default async function PositionsCreatePage({
← Back diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx index aa1be38602..ceb58538cf 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/add/page.tsx @@ -14,7 +14,7 @@ import { SelectFeeConcentratedWidget } from 'src/ui/pool/SelectFeeConcentratedWi import { SelectNetworkWidget } from 'src/ui/pool/SelectNetworkWidget' import { SelectPricesWidget } from 'src/ui/pool/SelectPricesWidget' import { SelectTokensWidget } from 'src/ui/pool/SelectTokensWidget' -import { computeSushiSwapV3PoolAddress } from 'sushi' +import { ChainKey, computeSushiSwapV3PoolAddress } from 'sushi' import { SUSHISWAP_V3_FACTORY_ADDRESS, SUSHISWAP_V3_SUPPORTED_CHAIN_IDS, @@ -90,7 +90,7 @@ const _Add: FC = () => { <> router.push(`/${chainId}/pool/v3/add`)} + onSelect={(chainId) => router.push(`/${ChainKey[chainId]}/pool/v3/add`)} networks={SUSHISWAP_V3_SUPPORTED_CHAIN_IDS} /> @@ -25,11 +31,11 @@ export default function TabsLayout({ @@ -39,11 +45,11 @@ export default function TabsLayout({ @@ -53,11 +59,11 @@ export default function TabsLayout({ diff --git a/apps/web/src/app/(evm)/_common/header-elements.tsx b/apps/web/src/app/(evm)/_common/header-elements.tsx index 5600acafb5..561f09d400 100644 --- a/apps/web/src/app/(evm)/_common/header-elements.tsx +++ b/apps/web/src/app/(evm)/_common/header-elements.tsx @@ -11,7 +11,7 @@ import { EXPLORE_NAVIGATION_LINKS, // MORE_NAVIGATION_LINKS, } from 'src/app/_common/header-elements' -import { ChainId } from 'sushi' +import { ChainId, ChainKey, isChainId } from 'sushi' export const headerElements = (chainId?: ChainId): NavigationElement[] => [ { @@ -43,13 +43,17 @@ export const headerElements = (chainId?: ChainId): NavigationElement[] => [ }, { title: 'Explore', - href: `/${chainId ?? 1}/explore/pools`, + href: `/${ + isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum' + }/explore/pools`, show: 'desktop', type: NavigationElementType.Single, }, { title: 'Positions', - href: `/${chainId ?? 1}/positions`, + href: `/${ + isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum' + }/positions`, show: 'desktop', type: NavigationElementType.Single, }, diff --git a/apps/web/src/app/_common/header-elements.ts b/apps/web/src/app/_common/header-elements.ts index 1e776182a0..0b632bcf12 100644 --- a/apps/web/src/app/_common/header-elements.ts +++ b/apps/web/src/app/_common/header-elements.ts @@ -3,7 +3,7 @@ import { type NavigationElementDropdown, NavigationElementType, } from '@sushiswap/ui' -import { ChainId } from 'sushi' +import { ChainId, ChainKey, isChainId } from 'sushi' export const EXPLORE_NAVIGATION_LINKS = ( chainId?: ChainId, @@ -15,7 +15,7 @@ export const EXPLORE_NAVIGATION_LINKS = ( }, { title: 'Pools', - href: `/${chainId ?? 1}/explore/pools`, + href: `/${isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum'}/explore/pools`, description: 'Earn fees by providing liquidity.', }, { @@ -55,13 +55,13 @@ export const headerElements = (chainId?: ChainId): NavigationElement[] => [ }, { title: 'Explore', - href: `/${chainId ?? 1}/explore/pools`, + href: `/${isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum'}/explore/pools`, show: 'desktop', type: NavigationElementType.Single, }, { title: 'Positions', - href: `/${chainId ?? 1}/positions`, + href: `/${isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum'}/positions`, show: 'desktop', type: NavigationElementType.Single, }, diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts index 0a4755a8b3..bf3aa97834 100644 --- a/apps/web/src/middleware.ts +++ b/apps/web/src/middleware.ts @@ -1,5 +1,5 @@ import { type NextRequest, NextResponse } from 'next/server' -import { chainShortNameToChainId } from 'sushi/chain' +import { chainShortNameToChainId, getChainInfo } from 'sushi/chain' export const config = { matcher: [ @@ -46,18 +46,15 @@ export async function middleware(req: NextRequest) { } } - const chainShortNameMatch = pathname.match( - /(\w+)(?:\/explore|\/pool|\/positions)/, + const networkNameMatch = pathname.match( + /(\w+)(?=\/explore|\/pool|\/positions)/, ) - if (chainShortNameMatch?.length) { - const [chainShortName] = chainShortNameMatch[0].split('/') - const chainId = String(chainShortNameToChainId[chainShortName]) - - // Already rewritten / invalid chainShortName - if (chainId === 'undefined') return NextResponse.next() + if (networkNameMatch?.length) { + const { chainId, networkName } = getChainInfo(networkNameMatch[0]) + if (!chainId) return NextResponse.next() const url = req.nextUrl.clone() - url.pathname = pathname.replace(chainShortName, chainId) + url.pathname = pathname.replace(networkName, chainId.toString()) return NextResponse.rewrite(url) } diff --git a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx index 3a193e12e8..b8d557d1c0 100644 --- a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx +++ b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx @@ -15,7 +15,7 @@ import { ColumnDef, PaginationState, Row } from '@tanstack/react-table' import React, { FC, ReactNode, useCallback, useMemo, useState } from 'react' import { useConcentratedLiquidityPositions } from 'src/lib/wagmi/hooks/positions/hooks/useConcentratedLiquidityPositions' import { ConcentratedLiquidityPositionWithV3Pool } from 'src/lib/wagmi/hooks/positions/types' -import { ChainId } from 'sushi' +import { ChainId, ChainKey } from 'sushi' import { SUSHISWAP_V3_SUPPORTED_CHAIN_IDS, isSushiSwapV3ChainId, @@ -140,7 +140,7 @@ export const ConcentratedPositionsTable: FC = {!hideNewSmartPositionButton ? ( From 00193acc5889bd27512b9a7e484650b42448b865 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:18:01 +0000 Subject: [PATCH 092/139] chore: format --- apps/web/src/app/(evm)/[chainId]/explore/layout.tsx | 12 +++++++++--- .../src/app/(evm)/[chainId]/explore/pools/page.tsx | 1 - .../app/(evm)/[chainId]/pool/incentivize/page.tsx | 4 +++- .../(evm)/[chainId]/positions/(landing)/layout.tsx | 8 ++++++-- apps/web/src/app/_common/header-elements.ts | 12 +++++++++--- .../ConcentratedPositionsTable.tsx | 8 ++++++-- packages/sushi/src/chain/constants.ts | 4 ++-- 7 files changed, 35 insertions(+), 14 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx index 3d5faa2f06..34c7a64073 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx @@ -48,7 +48,9 @@ export default async function ExploreLayout({ > @@ -58,11 +60,15 @@ export default async function ExploreLayout({ diff --git a/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx b/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx index 897bec6d44..6569ba63d6 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx @@ -16,7 +16,6 @@ export default async function PoolsPage({ }: { params: { chainId: string } }) { - const pools = await unstable_cache( async () => getTopPools({ chainId: params.chainId }), ['pools', params.chainId], diff --git a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx index 5e16fc55dd..d250959933 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx @@ -204,7 +204,9 @@ const Incentivize = withCheckerRoot(() => { router.push(`/${ChainKey[chainId]}/pool/incentivize`)} + onSelect={(chainId) => + router.push(`/${ChainKey[chainId]}/pool/incentivize`) + } networks={ANGLE_SUPPORTED_CHAIN_IDS} /> [ }, { title: 'Explore', - href: `/${isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum'}/explore/pools`, + href: `/${ + isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum' + }/explore/pools`, show: 'desktop', type: NavigationElementType.Single, }, { title: 'Positions', - href: `/${isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum'}/positions`, + href: `/${ + isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum' + }/positions`, show: 'desktop', type: NavigationElementType.Single, }, diff --git a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx index b8d557d1c0..243c040637 100644 --- a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx +++ b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx @@ -140,7 +140,9 @@ export const ConcentratedPositionsTable: FC = {!hideNewSmartPositionButton ? ( - @@ -113,37 +164,22 @@ export const Hero: FC<{ chainId: ChainId }> = ({ chainId }) => { asChild icon={GiftIcon} variant="secondary" - size="lg" + size="sm" > - + I want to incentivize a pool
-
-
-
- - Looking for a partnership with Sushi? - - -
-
- Need Help? - + +
+
+ {children}
-
-
+
+ ) } diff --git a/apps/web/src/app/(evm)/[chainId]/positions/(landing)/migrate/page.tsx b/apps/web/src/app/(evm)/[chainId]/(positions)/migrate/page.tsx similarity index 100% rename from apps/web/src/app/(evm)/[chainId]/positions/(landing)/migrate/page.tsx rename to apps/web/src/app/(evm)/[chainId]/(positions)/migrate/page.tsx diff --git a/apps/web/src/app/(evm)/[chainId]/positions/(landing)/page.tsx b/apps/web/src/app/(evm)/[chainId]/(positions)/pool/page.tsx similarity index 100% rename from apps/web/src/app/(evm)/[chainId]/positions/(landing)/page.tsx rename to apps/web/src/app/(evm)/[chainId]/(positions)/pool/page.tsx diff --git a/apps/web/src/app/(evm)/[chainId]/positions/(landing)/rewards/page.tsx b/apps/web/src/app/(evm)/[chainId]/(positions)/rewards/page.tsx similarity index 100% rename from apps/web/src/app/(evm)/[chainId]/positions/(landing)/rewards/page.tsx rename to apps/web/src/app/(evm)/[chainId]/(positions)/rewards/page.tsx diff --git a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx index 8cee344625..3c3b2d8c85 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/layout.tsx @@ -1,27 +1,12 @@ -import { GiftIcon } from '@heroicons/react-v1/outline' import { isSteerChainId } from '@sushiswap/steer-sdk' import { Container } from '@sushiswap/ui' import { LinkInternal } from '@sushiswap/ui' -import { Button } from '@sushiswap/ui' -import { Chip } from '@sushiswap/ui' -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuItem, - DropdownMenuTrigger, -} from '@sushiswap/ui' -import { SelectIcon } from '@sushiswap/ui' + import React from 'react' import { GlobalStatsCharts } from 'src/ui/explore/global-stats-charts' import { PathnameButton } from 'src/ui/pathname-button' import { PoolsFiltersProvider } from 'src/ui/pool' import { ChainId, ChainKey } from 'sushi/chain' -import { - SushiSwapV3ChainId, - isSushiSwapV2ChainId, - isSushiSwapV3ChainId, -} from 'sushi/config' export const metadata = { title: 'Pools 💦', @@ -34,14 +19,11 @@ export default async function ExploreLayout({ const chainId = +params.chainId as ChainId return ( <> - + - -
+ +
-
-
- - - - - - - - - -
- V3 Position - - {isSushiSwapV3ChainId(chainId as SushiSwapV3ChainId) - ? 'New 🔥' - : 'Unavailable'} - -
-

- Provide liquidity to a V3 liquidity pool. -

-
-
- {isSushiSwapV2ChainId(chainId as ChainId) ? ( - - -
- V2 Position -
-

- Provide liquidity to a V2 liquidity pool. -

-
-
- ) : null} -
-
-
-
- -
diff --git a/apps/web/src/app/(evm)/[chainId]/positions/(landing)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/positions/(landing)/layout.tsx deleted file mode 100644 index 810d408f6c..0000000000 --- a/apps/web/src/app/(evm)/[chainId]/positions/(landing)/layout.tsx +++ /dev/null @@ -1,86 +0,0 @@ -'use client' - -import { Container, LinkInternal } from '@sushiswap/ui' -import { useSearchParams } from 'next/navigation' -import { PathnameButton } from 'src/ui/pathname-button' -import { PoolsFiltersProvider } from 'src/ui/pool' -import { Hero } from './hero' -import { ChainKey, isChainId } from 'sushi' - -export default function TabsLayout({ - children, - params: { chainId }, -}: { - children: React.ReactNode - params: { chainId: string } -}) { - const _chainId = +chainId - const searchParams = useSearchParams() - - if (!isChainId(_chainId)) { - throw new Error('Must be a valid chain id') - } - - return ( - <> - - - - -
- - - My Positions - - - - - My Rewards - - - - - Migrate - - -
-
-
-
- {children} -
-
- - ) -} diff --git a/apps/web/src/app/(evm)/[chainId]/positions/layout.tsx b/apps/web/src/app/(evm)/[chainId]/positions/layout.tsx deleted file mode 100644 index bae85f2f59..0000000000 --- a/apps/web/src/app/(evm)/[chainId]/positions/layout.tsx +++ /dev/null @@ -1,9 +0,0 @@ -export const metadata = { - title: 'Positions 💦', -} - -export default function PoolLayout({ - children, -}: { children: React.ReactNode }) { - return
{children}
-} diff --git a/apps/web/src/app/(evm)/_common/header-elements.tsx b/apps/web/src/app/(evm)/_common/header-elements.tsx index 561f09d400..ffd9941fd6 100644 --- a/apps/web/src/app/(evm)/_common/header-elements.tsx +++ b/apps/web/src/app/(evm)/_common/header-elements.tsx @@ -50,10 +50,10 @@ export const headerElements = (chainId?: ChainId): NavigationElement[] => [ type: NavigationElementType.Single, }, { - title: 'Positions', + title: 'Pools', href: `/${ isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum' - }/positions`, + }/pool`, show: 'desktop', type: NavigationElementType.Single, }, diff --git a/apps/web/src/app/_common/header-elements.ts b/apps/web/src/app/_common/header-elements.ts index cfe605a3fd..8e1764d589 100644 --- a/apps/web/src/app/_common/header-elements.ts +++ b/apps/web/src/app/_common/header-elements.ts @@ -17,9 +17,16 @@ export const EXPLORE_NAVIGATION_LINKS = ( title: 'Pools', href: `/${ isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum' - }/explore/pools`, + }/pool`, description: 'Earn fees by providing liquidity.', }, + { + title: 'Explore', + href: `/${ + isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum' + }/explore/pools`, + description: 'Explore top pools.', + }, { title: 'Stake', href: '/stake', @@ -64,10 +71,10 @@ export const headerElements = (chainId?: ChainId): NavigationElement[] => [ type: NavigationElementType.Single, }, { - title: 'Positions', + title: 'Pools', href: `/${ isChainId(Number(chainId)) ? ChainKey[chainId as ChainId] : 'ethereum' - }/positions`, + }/pool`, show: 'desktop', type: NavigationElementType.Single, }, diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts index a78d9ed475..d1d3be9ad8 100644 --- a/apps/web/src/middleware.ts +++ b/apps/web/src/middleware.ts @@ -1,5 +1,5 @@ import { type NextRequest, NextResponse } from 'next/server' -import { chainShortNameToChainId, getChainInfo } from 'sushi/chain' +import { getChainInfo } from 'sushi/chain' export const config = { matcher: [ @@ -7,6 +7,8 @@ export const config = { '/:chainId/explore/:path*', '/:chainId/pool/:path*', '/:chainId/positions/:path*', + '/:chainId/migrate', + '/:chainId/rewards', ], } @@ -47,7 +49,7 @@ export async function middleware(req: NextRequest) { } const networkNameMatch = pathname.match( - /([\w-]+)(?=\/explore|\/pool|\/positions)/, + /([\w-]+)(?=\/explore|\/pool|\/positions|\/rewards|\/migrate)/, ) if (networkNameMatch?.length) { const { chainId, networkName } = getChainInfo(networkNameMatch[0]) From 4d342c5429ded7ea00cfca9e1ce0b7099b9a7c78 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Mon, 19 Aug 2024 22:50:25 +0800 Subject: [PATCH 111/139] fix: incentivize page chainId --- .../app/(evm)/[chainId]/pool/incentivize/layout.tsx | 13 +------------ .../app/(evm)/[chainId]/pool/incentivize/page.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx index 4fda3c025f..49afc9279d 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/layout.tsx @@ -1,22 +1,11 @@ import { Container, typographyVariants } from '@sushiswap/ui' import { BackButton } from 'src/ui/pool/BackButton' -import { ChainId } from 'sushi/chain' -import { isAngleEnabledChainId } from 'sushi/config' -import notFound from '../../not-found' export const metadata = { title: 'Pool 💦', } -export default function Layout({ - children, - params, -}: { children: React.ReactNode; params: { chainId: string } }) { - const chainId = +params.chainId as ChainId - if (!isAngleEnabledChainId(chainId)) { - return notFound(chainId) - } - +export default function Layout({ children }: { children: React.ReactNode }) { return ( <> diff --git a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx index d250959933..e4cb213411 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/incentivize/page.tsx @@ -50,11 +50,11 @@ import { import { SelectFeeConcentratedWidget } from 'src/ui/pool/SelectFeeConcentratedWidget' import { SelectNetworkWidget } from 'src/ui/pool/SelectNetworkWidget' import { SelectTokensWidget } from 'src/ui/pool/SelectTokensWidget' -import { Chain, ChainKey } from 'sushi/chain' +import { Chain, ChainId, ChainKey } from 'sushi/chain' import { ANGLE_SUPPORTED_CHAIN_IDS, - AngleEnabledChainId, SushiSwapV3ChainId, + isAngleEnabledChainId, isWNativeSupported, } from 'sushi/config' import { Token, Type, tryParseAmount } from 'sushi/currency' @@ -65,9 +65,10 @@ import { useAccount, useWaitForTransactionReceipt } from 'wagmi' const APPROVE_TAG = 'approve-incentivize' export default function Page({ params }: { params: { chainId: string } }) { + const chainId = +params.chainId as ChainId return ( From 9ff043c626579b2b55d190fc7ed7124b745c8a8b Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:52:01 +0000 Subject: [PATCH 112/139] chore: lint --- apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx | 2 +- packages/sushi/src/chain/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx index e57da099e8..3bed90c1f6 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/layout.tsx @@ -3,8 +3,8 @@ import { Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' import { headers } from 'next/headers' import { PoolHeader } from 'src/ui/pool/PoolHeader' -import notFound from '../../../not-found' import { ChainKey, isChainId } from 'sushi' +import notFound from '../../../not-found' export const metadata = { title: 'Pool 💦', diff --git a/packages/sushi/src/chain/index.ts b/packages/sushi/src/chain/index.ts index 42978191f4..360eccf8ff 100644 --- a/packages/sushi/src/chain/index.ts +++ b/packages/sushi/src/chain/index.ts @@ -1,9 +1,9 @@ import { ChainId, ChainKey, + NetworkNameKey, isChainId, isNetworkNameKey, - NetworkNameKey, } from './constants.js' import raw from './generated.js' From 873bf14193e4b4c6d9a57cad3ebd697f497d9436 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 20 Aug 2024 03:57:11 +0800 Subject: [PATCH 113/139] chore: add avatar placeholder --- .../lib/wagmi/components/user-portfolio/index.tsx | 12 +++++++++--- packages/ui/src/icons/JazzIcon.tsx | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx index 6023388ad9..a042eef653 100644 --- a/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx +++ b/apps/web/src/lib/wagmi/components/user-portfolio/index.tsx @@ -8,8 +8,11 @@ import { Sheet, SheetContent, SheetTrigger, + cloudinaryFetchLoader, useBreakpoint, } from '@sushiswap/ui' +import { JazzIcon } from '@sushiswap/ui/icons/JazzIcon' +import Image from 'next/image' import { FC, ReactNode, useMemo, useState } from 'react' import { ChainId, shortenAddress } from 'sushi' import { useAccount, useEnsAvatar, useEnsName } from 'wagmi' @@ -81,15 +84,18 @@ export const UserPortfolio = () => { trigger={ } content={content} diff --git a/packages/ui/src/icons/JazzIcon.tsx b/packages/ui/src/icons/JazzIcon.tsx index decb567cbb..1b06e438a0 100644 --- a/packages/ui/src/icons/JazzIcon.tsx +++ b/packages/ui/src/icons/JazzIcon.tsx @@ -9,7 +9,7 @@ interface JazzIconProps { address: string } -const Jazzicon = dynamic(() => import('react-jazzicon'), { ssr: false }) +const Jazzicon = dynamic(() => import('react-jazzicon')) export const JazzIcon: FC = ({ diameter, address }) => { return From 6312d9e35f3ffc34d09c19413a0343813850e5bb Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 20 Aug 2024 04:55:00 +0800 Subject: [PATCH 114/139] fix: v3 page --- .../src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx | 8 ++++++-- apps/web/src/ui/pool/PoolPageV3.tsx | 5 +---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx index 6e4946bff3..70d2d1d070 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx @@ -3,7 +3,7 @@ import { Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' import { headers } from 'next/headers' import { PoolHeader } from 'src/ui/pool/PoolHeader' -import { ChainId } from 'sushi/chain' +import { ChainId, ChainKey } from 'sushi/chain' import notFound from '../../../not-found' export const metadata = { @@ -37,7 +37,11 @@ export default async function Layout({ <> = ({ pool }) => {
{pool.hasEnabledSteerVault && ( - + {`This pool has been activated to leverage our smart pool feature. Smart pools are designed to optimize the allocation of liquidity within customized price ranges, thereby improving trading efficiency. They achieve this by enhancing liquidity depth around the current price, which results in higher fee earnings for liquidity @@ -70,9 +70,6 @@ const Pool: FC<{ pool: V3Pool }> = ({ pool }) => { )} -
- -
From 4df6a4ac11b38e97f6dee5c8d49624224a2608d8 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 20 Aug 2024 05:00:51 +0800 Subject: [PATCH 115/139] fix: position table urls --- .../ConcentratedPositionsTable.tsx | 14 ++++---------- apps/web/src/ui/pool/PositionsTab.tsx | 6 ++++-- apps/web/src/ui/pool/SmartPositionsTable.tsx | 6 ++++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx index 243c040637..e8ef00f73f 100644 --- a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx +++ b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx @@ -16,10 +16,7 @@ import React, { FC, ReactNode, useCallback, useMemo, useState } from 'react' import { useConcentratedLiquidityPositions } from 'src/lib/wagmi/hooks/positions/hooks/useConcentratedLiquidityPositions' import { ConcentratedLiquidityPositionWithV3Pool } from 'src/lib/wagmi/hooks/positions/types' import { ChainId, ChainKey } from 'sushi' -import { - SUSHISWAP_V3_SUPPORTED_CHAIN_IDS, - isSushiSwapV3ChainId, -} from 'sushi/config' +import { isSushiSwapV3ChainId } from 'sushi/config' import { useAccount } from 'wagmi' import { usePoolFilters } from '../PoolsFiltersProvider' import { @@ -39,7 +36,7 @@ const COLUMNS = [ const tableState = { sorting: [{ id: 'positionSize', desc: true }] } interface ConcentratedPositionsTableProps { - chainId?: ChainId + chainId: ChainId poolId?: string onRowClick?(row: ConcentratedLiquidityPositionWithV3Pool): void hideNewSmartPositionButton?: boolean @@ -59,10 +56,7 @@ export const ConcentratedPositionsTable: FC = const [hide, setHide] = useState(true) const chainIds = useMemo(() => { - if (chainId) { - return isSushiSwapV3ChainId(chainId) ? [chainId] : [] - } - return [...SUSHISWAP_V3_SUPPORTED_CHAIN_IDS] + return isSushiSwapV3ChainId(chainId) ? [chainId] : [] }, [chainId]) const [paginationState, setPaginationState] = useState({ @@ -73,7 +67,7 @@ export const ConcentratedPositionsTable: FC = const { data: positions, isInitialLoading } = useConcentratedLiquidityPositions({ account: address, - chainIds: chainIds, + chainIds, }) const _positions = useMemo(() => { diff --git a/apps/web/src/ui/pool/PositionsTab.tsx b/apps/web/src/ui/pool/PositionsTab.tsx index aed26fd7e6..245b66b373 100644 --- a/apps/web/src/ui/pool/PositionsTab.tsx +++ b/apps/web/src/ui/pool/PositionsTab.tsx @@ -11,7 +11,7 @@ import { } from '@sushiswap/ui' import React, { FC, useState } from 'react' -import { ChainId } from 'sushi/chain' +import { ChainId, ChainKey } from 'sushi/chain' import { ConcentratedPositionsTable } from './ConcentratedPositionsTable/ConcentratedPositionsTable' import { PositionsTable } from './PositionsTable' import { SmartPositionsTable } from './SmartPositionsTable' @@ -95,7 +95,9 @@ export const PositionsTab: FC<{ chainId: ChainId }> = ({ chainId }) => { `/pool/${row.pool.id}`} + rowLink={(row) => + `/${ChainKey[chainId]}/pool/v2/${row.pool.address}/add` + } /> diff --git a/apps/web/src/ui/pool/SmartPositionsTable.tsx b/apps/web/src/ui/pool/SmartPositionsTable.tsx index 4944152486..17feda6a47 100644 --- a/apps/web/src/ui/pool/SmartPositionsTable.tsx +++ b/apps/web/src/ui/pool/SmartPositionsTable.tsx @@ -14,7 +14,7 @@ import { SteerAccountPositionExtended, useSteerAccountPositionsExtended, } from 'src/lib/wagmi/hooks/steer/useSteerAccountPositionsExtended' -import { ChainId, SushiSwapProtocol, formatPercent } from 'sushi' +import { ChainId, ChainKey, SushiSwapProtocol, formatPercent } from 'sushi' import { Address } from 'viem' import { useAccount } from 'wagmi' import { APRHoverCard } from './APRHoverCard' @@ -102,7 +102,9 @@ export const SmartPositionsTable: FC<{ chainId: ChainId }> = ({ chainId }) => { - `/pool/${row.vault.poolAddress}/smart/${row.vault.id}` + `/${ChainKey[row.chainId]}/pool/v3/${row.vault.poolAddress}/smart/${ + row.address + }` } columns={COLUMNS} data={_positions} From 7bf68f84cc30c4920c050ccc19c9d9f9dfd49e6c Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 20 Aug 2024 21:12:59 +0800 Subject: [PATCH 116/139] chore: add loading state to explore pools table --- .../(evm)/[chainId]/explore/pools/page.tsx | 27 ++++++++++++------- apps/web/src/ui/pool/PoolsTable.tsx | 23 +++++++++++++--- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx b/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx index 6569ba63d6..664db6bf57 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/pools/page.tsx @@ -1,7 +1,7 @@ import { getTopPools } from '@sushiswap/graph-client/data-api' import { Container } from '@sushiswap/ui' import { unstable_cache } from 'next/cache' -import React from 'react' +import React, { FC, Suspense } from 'react' import { PoolsTable } from 'src/ui/pool/PoolsTable' import { TableFiltersSmartPoolsOnly } from 'src/ui/pool/TableFilterSmartPoolsOnly' import { TableFiltersFarmsOnly } from 'src/ui/pool/TableFiltersFarmsOnly' @@ -11,30 +11,37 @@ import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' import { ChainId } from 'sushi/chain' -export default async function PoolsPage({ - params, -}: { - params: { chainId: string } -}) { +const _PoolsTable: FC<{ chainId: ChainId }> = async ({ chainId }) => { const pools = await unstable_cache( - async () => getTopPools({ chainId: params.chainId }), - ['pools', params.chainId], + async () => getTopPools({ chainId: `${chainId}` }), + ['pools', `${chainId}`], { revalidate: 60 * 3, }, )() + return +} + +export default async function PoolsPage({ + params, +}: { + params: { chainId: string } +}) { + const chainId = +params.chainId as ChainId return (
- +
- + }> + <_PoolsTable chainId={chainId} /> +
) } diff --git a/apps/web/src/ui/pool/PoolsTable.tsx b/apps/web/src/ui/pool/PoolsTable.tsx index eca233fb01..142ff7f51e 100644 --- a/apps/web/src/ui/pool/PoolsTable.tsx +++ b/apps/web/src/ui/pool/PoolsTable.tsx @@ -163,6 +163,9 @@ const COLUMNS = [ ) }, size: 300, + meta: { + skeleton: , + }, }, TVL_COLUMN, { @@ -175,6 +178,9 @@ const COLUMNS = [ formatUSD(props.row.original.volumeUSD1h).includes('NaN') ? '$0.00' : formatUSD(props.row.original.volumeUSD1h), + meta: { + skeleton: , + }, }, VOLUME_1D_COLUMN, { @@ -187,6 +193,9 @@ const COLUMNS = [ formatUSD(props.row.original.feeUSD1h).includes('NaN') ? '$0.00' : formatUSD(props.row.original.feeUSD1h), + meta: { + skeleton: , + }, }, { id: 'feeUSD1d', @@ -198,6 +207,9 @@ const COLUMNS = [ formatUSD(props.row.original.feeUSD1d).includes('NaN') ? '$0.00' : formatUSD(props.row.original.feeUSD1d), + meta: { + skeleton: , + }, }, APR_COLUMN, { @@ -419,11 +431,16 @@ const COLUMNS = [ ] as ColumnDef[] interface PositionsTableProps { - pools: TopPools + pools?: TopPools + isLoading?: boolean onRowClick?(row: TopPools[number]): void } -export const PoolsTable: FC = ({ pools, onRowClick }) => { +export const PoolsTable: FC = ({ + pools, + isLoading = false, + onRowClick, +}) => { const { tokenSymbols, protocols, farmsOnly, smartPoolsOnly } = usePoolFilters() @@ -498,7 +515,7 @@ export const PoolsTable: FC = ({ pools, onRowClick }) => { `/${ChainKey[row.chainId]}/pool/${ row.protocol === SushiSwapProtocol.SUSHISWAP_V2 ? 'v2' : 'v3' From 7cc7fb98ee079561c7a09b1be318b0040302e38a Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 20 Aug 2024 21:13:32 +0800 Subject: [PATCH 117/139] fix: v3 pool page back button --- apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx index 70d2d1d070..21121672c6 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx @@ -40,7 +40,7 @@ export default async function Layout({ backUrl={ referer?.includes('/pool?') ? referer?.toString() - : `/${ChainKey[chainId]}/pool` + : `/${ChainKey[chainId]}/explore/pool` } address={address} pool={pool} From 7ce3d7d3ed7096c911eb52f11ab808df4c61561e Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 20 Aug 2024 22:17:41 +0800 Subject: [PATCH 118/139] fix: revalidate --- .../app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx | 2 +- .../app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx | 2 +- .../app/(evm)/[chainId]/pool/v3/[address]/positions/page.tsx | 2 +- .../(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx index d5643b5db4..52eb669873 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v2/[address]/(landing)/page.tsx @@ -13,7 +13,7 @@ export default async function PoolPage({ async () => await getV2Pool({ chainId: Number(chainId), address }), ['pool', `${chainId}:${address}`], { - revalidate: 60 * 3, + revalidate: 60 * 15, }, )()) as NonNullable diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx index a7a52dcbbd..635eca0898 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/(landing)/page.tsx @@ -13,7 +13,7 @@ export default async function PoolPage({ async () => await getV3Pool({ chainId: Number(chainId), address }), ['pool', `${chainId}:${address}`], { - revalidate: 60 * 3, + revalidate: 60 * 15, }, )()) as NonNullable diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/page.tsx index acc3ad404c..ead8644664 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/page.tsx @@ -14,7 +14,7 @@ export default async function ManageV3PoolPage({ async () => await getV3Pool({ chainId: Number(chainId), address }), ['pool', `${chainId}:${address}`], { - revalidate: 60 * 3, + revalidate: 60 * 15, }, )()) as NonNullable diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx index 25fb4aa5a9..53d70d8b12 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/smart/(overview)/page.tsx @@ -15,7 +15,7 @@ export default async function VaultOverviewPage({ async () => getV3Pool({ chainId, address }), ['pool', `${chainId}:${address}`], { - revalidate: 60 * 3, + revalidate: 60 * 15, }, )() From 711adf26523ff1d79c3a17c3217e2a8e03564e3d Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Tue, 20 Aug 2024 22:19:08 +0800 Subject: [PATCH 119/139] fix: links --- .../[chainId]/pool/v3/[address]/layout.tsx | 2 +- .../v3/[address]/positions/[position]/page.tsx | 5 ++++- .../v3/[address]/positions/create/page.tsx | 10 +++------- .../pool/v3/[address]/positions/page.tsx | 2 +- .../ConcentratedPositionsTable.tsx | 18 ++++++++---------- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx index 21121672c6..f7bd79d338 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/layout.tsx @@ -40,7 +40,7 @@ export default async function Layout({ backUrl={ referer?.includes('/pool?') ? referer?.toString() - : `/${ChainKey[chainId]}/explore/pool` + : `/${ChainKey[chainId]}/explore/pools` } address={address} pool={pool} diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/[position]/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/[position]/page.tsx index 38d41d697b..399ab363c2 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/[position]/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/[position]/page.tsx @@ -1,5 +1,6 @@ import { Container, LinkInternal } from '@sushiswap/ui' import { V3PositionView } from 'src/ui/pool/V3PositionView' +import { ChainId, ChainKey } from 'sushi/chain' export default async function V3PositionsPage({ params, @@ -8,7 +9,9 @@ export default async function V3PositionsPage({
← View all positions diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx index 2a42c799df..2322d80584 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/create/page.tsx @@ -2,17 +2,13 @@ import { Container, LinkInternal } from '@sushiswap/ui' import React from 'react' import { ConcentratedLiquidityProvider } from 'src/ui/pool/ConcentratedLiquidityProvider' import { NewPosition } from 'src/ui/pool/NewPosition' -import { ChainId, ChainKey } from 'sushi' -import { isSushiSwapV3ChainId } from 'sushi/config' +import { ChainKey } from 'sushi' +import { SushiSwapV3ChainId } from 'sushi/config' export default async function PositionsCreatePage({ params, }: { params: { address: string; chainId: string } }) { - const chainId = +params.chainId as ChainId - - if (!isSushiSwapV3ChainId(chainId)) { - throw new Error('This page only supports SushiSwap V3 pools') - } + const chainId = +params.chainId as SushiSwapV3ChainId return ( diff --git a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/page.tsx b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/page.tsx index ead8644664..fc09dfe42c 100644 --- a/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/pool/v3/[address]/positions/page.tsx @@ -24,7 +24,7 @@ export default async function ManageV3PoolPage({ diff --git a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx index e8ef00f73f..bd4fba27e0 100644 --- a/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx +++ b/apps/web/src/ui/pool/ConcentratedPositionsTable/ConcentratedPositionsTable.tsx @@ -37,7 +37,7 @@ const tableState = { sorting: [{ id: 'positionSize', desc: true }] } interface ConcentratedPositionsTableProps { chainId: ChainId - poolId?: string + poolAddress?: string onRowClick?(row: ConcentratedLiquidityPositionWithV3Pool): void hideNewSmartPositionButton?: boolean hideNewPositionButton?: boolean @@ -47,7 +47,7 @@ export const ConcentratedPositionsTable: FC = ({ chainId, onRowClick, - poolId, + poolAddress, hideNewSmartPositionButton = true, hideNewPositionButton = false, }) => { @@ -86,10 +86,12 @@ export const ConcentratedPositionsTable: FC = .filter((el) => { return ( (hide ? el.liquidity !== 0n : true) && - (poolId ? el.address.toLowerCase() === poolId.toLowerCase() : true) + (poolAddress + ? el.address.toLowerCase() === poolAddress.toLowerCase() + : true) ) }) - }, [tokenSymbols, positions, hide, poolId]) + }, [tokenSymbols, positions, hide, poolAddress]) const rowRenderer = useCallback( ( @@ -134,9 +136,7 @@ export const ConcentratedPositionsTable: FC = {!hideNewSmartPositionButton ? ( + + + + + + + + +
+ V3 Position + + {isSushiSwapV3ChainId(chainId as SushiSwapV3ChainId) + ? 'New 🔥' + : 'Unavailable'} + +
+

+ Provide liquidity to a V3 liquidity pool. +

+
+
+ {isSushiSwapV2ChainId(chainId as ChainId) ? ( + + +
+ V2 Position +
+

+ Provide liquidity to a V2 liquidity pool. +

+
+
+ ) : null} +
+
+
+
+ +
+
) } diff --git a/apps/web/src/app/(evm)/[chainId]/(positions)/layout.tsx b/apps/web/src/app/(evm)/[chainId]/(positions)/layout.tsx index 54b7112ea8..e99da70f8c 100644 --- a/apps/web/src/app/(evm)/[chainId]/(positions)/layout.tsx +++ b/apps/web/src/app/(evm)/[chainId]/(positions)/layout.tsx @@ -1,26 +1,10 @@ 'use client' -import { GiftIcon } from '@heroicons/react-v1/outline' import { Container, LinkInternal } from '@sushiswap/ui' -import { Button } from '@sushiswap/ui' -import { Chip } from '@sushiswap/ui' -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuItem, - DropdownMenuTrigger, -} from '@sushiswap/ui' -import { SelectIcon } from '@sushiswap/ui' import { useSearchParams } from 'next/navigation' import { PathnameButton } from 'src/ui/pathname-button' import { PoolsFiltersProvider } from 'src/ui/pool' import { ChainId, ChainKey, isChainId } from 'sushi/chain' -import { - SushiSwapV3ChainId, - isSushiSwapV2ChainId, - isSushiSwapV3ChainId, -} from 'sushi/config' import { Hero } from './hero' export default function TabsLayout({ @@ -39,8 +23,8 @@ export default function TabsLayout({ return ( <> - - + +
-
-
- - - - - - - - - -
- V3 Position - - {isSushiSwapV3ChainId(chainId as SushiSwapV3ChainId) - ? 'New 🔥' - : 'Unavailable'} - -
-

- Provide liquidity to a V3 liquidity pool. -

-
-
- {isSushiSwapV2ChainId(chainId as ChainId) ? ( - - -
- V2 Position -
-

- Provide liquidity to a V2 liquidity pool. -

-
-
- ) : null} -
-
-
-
- -
From 597029b2f7f855fba62fe40dbdfc858a99b5fc8b Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 23 Aug 2024 00:57:39 +0800 Subject: [PATCH 138/139] fix: filter smart-pools by isEnabled on explore page --- .../web/src/app/(evm)/[chainId]/explore/smart-pools/page.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/(evm)/[chainId]/explore/smart-pools/page.tsx b/apps/web/src/app/(evm)/[chainId]/explore/smart-pools/page.tsx index 4b4adca09b..6b6907713a 100644 --- a/apps/web/src/app/(evm)/[chainId]/explore/smart-pools/page.tsx +++ b/apps/web/src/app/(evm)/[chainId]/explore/smart-pools/page.tsx @@ -13,7 +13,10 @@ import { ChainId } from 'sushi/chain' const _SmartPoolsTable: FC<{ chainId: ChainId }> = async ({ chainId }) => { const smartPools = await unstable_cache( - async () => getSmartPools({ chainId }), + async () => + getSmartPools({ chainId }).then((smartPools) => + smartPools.filter((smartPool) => smartPool.isEnabled), + ), ['smart-pools', `${chainId}`], { revalidate: 60 * 15, From 2d5a9b2ad5d0b3efd961deb53e8a9ff59ea11056 Mon Sep 17 00:00:00 2001 From: 0xMasayoshi <0xMasayoshi@protonmail.com> Date: Fri, 23 Aug 2024 01:14:21 +0800 Subject: [PATCH 139/139] style: area skeleton --- packages/ui/src/components/skeleton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/src/components/skeleton.tsx b/packages/ui/src/components/skeleton.tsx index d133aeed8c..a76b9ba18c 100644 --- a/packages/ui/src/components/skeleton.tsx +++ b/packages/ui/src/components/skeleton.tsx @@ -97,7 +97,7 @@ function ChartLoadingStateMask({ return (