From 4bb3e396c4b72aab01e3c81a510d95c72a14fb1c Mon Sep 17 00:00:00 2001 From: isEvrythngTkn Date: Wed, 8 Jul 2026 12:29:15 -0700 Subject: [PATCH 1/3] allow custom queries --- .gitignore | 3 + README.md | 294 +- examples/README.md | 8 +- examples/codegen/codegen.ts | 4 +- examples/codegen/src/gql/graphql.ts | 6140 +++++++++++++++++++++++++-- examples/codegen/src/index.ts | 9 +- package.json | 6 +- src/index.ts | 19 + 8 files changed, 6060 insertions(+), 423 deletions(-) diff --git a/.gitignore b/.gitignore index aef3283..0ec10e4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ yarn-error.log # Generated resources (all regenerated at build time) src/resources/ + +# Published copy of the schema (regenerated by fetch:schema) +/schema.graphql diff --git a/README.md b/README.md index c00ab3f..bdd13cf 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ const networks = await sdk.queries.getNetworks({}); console.log(networks.getNetworks); // [{ id: 1, name: "ethereum" }, { id: 1399811149, name: "solana" }, ...] ``` +> **Tip:** The built-in `sdk.queries.*` methods request **every** available field, and Codex pricing is based on the fields your query requests. They're great for exploring the API, but for production we recommend [writing a custom query](#custom-queries-request-only-the-fields-you-need) that selects only the fields you need. + ## Get Token Prices Get the current USD price of any token. Supports up to 25 tokens per request. Prices are liquidity-weighted across all valid pools. @@ -44,8 +46,11 @@ const sdk = new Codex(process.env.CODEX_API_KEY!); const prices = await sdk.queries.getTokenPrices({ inputs: [ - { address: "So11111111111111111111111111111111111111112", networkId: 1399811149 }, // SOL - { address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", networkId: 1 }, // WETH + { + address: "So11111111111111111111111111111111111111112", + networkId: 1399811149, + }, // SOL + { address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", networkId: 1 }, // WETH ], }); @@ -104,16 +109,20 @@ Available resolutions: `1S`, `5S`, `15S`, `30S`, `1`, `5`, `15`, `30`, `60`, `24 Search and filter tokens by price, volume, market cap, liquidity, holder count, trading activity, and more. ```typescript -import { Codex, TokenRankingAttribute, RankingDirection } from "@codex-data/sdk"; +import { + Codex, + TokenRankingAttribute, + RankingDirection, +} from "@codex-data/sdk"; const sdk = new Codex(process.env.CODEX_API_KEY!); const result = await sdk.queries.filterTokens({ filters: { - network: [1], // Ethereum - liquidity: { gte: "100000" }, // $100k+ liquidity - marketCap: { gte: "1000000" }, // $1M+ market cap - txnCount24: { gte: "500" }, // 500+ transactions in 24h + network: [1], // Ethereum + liquidity: { gte: "100000" }, // $100k+ liquidity + marketCap: { gte: "1000000" }, // $1M+ market cap + txnCount24: { gte: "500" }, // 500+ transactions in 24h }, rankings: [ { @@ -125,7 +134,9 @@ const result = await sdk.queries.filterTokens({ }); result.filterTokens?.results?.forEach((token) => { - console.log(`${token?.token?.name} (${token?.token?.symbol}): $${token?.priceUSD}`); + console.log( + `${token?.token?.name} (${token?.token?.symbol}): $${token?.priceUSD}`, + ); }); ``` @@ -149,7 +160,9 @@ const balances = await sdk.queries.balances({ }); balances.balances?.items?.forEach((item) => { - console.log(`${item?.token?.symbol}: ${item?.shiftedBalance} ($${item?.balanceUsd})`); + console.log( + `${item?.token?.symbol}: ${item?.shiftedBalance} ($${item?.balanceUsd})`, + ); }); ``` @@ -173,7 +186,9 @@ console.log(`Total holders: ${holders.holders?.count}`); console.log(`Top 10 hold: ${holders.holders?.top10HoldersPercent}%`); holders.holders?.items?.forEach((holder) => { - console.log(`${holder?.address}: ${holder?.shiftedBalance} ($${holder?.balanceUsd})`); + console.log( + `${holder?.address}: ${holder?.shiftedBalance} ($${holder?.balanceUsd})`, + ); }); ``` @@ -196,7 +211,9 @@ const events = await sdk.queries.getTokenEvents({ }); events.getTokenEvents?.items?.forEach((event) => { - console.log(`${event?.eventDisplayType} by ${event?.maker} — $${event?.token0SwapValueUsd}`); + console.log( + `${event?.eventDisplayType} by ${event?.maker} — $${event?.token0SwapValueUsd}`, + ); }); ``` @@ -248,7 +265,9 @@ const unsubscribe = sdk.subscriptions.onBarsUpdated( next: (result) => { const bar = result.data?.onBarsUpdated; const oneMin = bar?.aggregates?.r1?.usd; - console.log(`1min candle — O: ${oneMin?.o} H: ${oneMin?.h} L: ${oneMin?.l} C: ${oneMin?.c}`); + console.log( + `1min candle — O: ${oneMin?.o} H: ${oneMin?.h} L: ${oneMin?.l} C: ${oneMin?.c}`, + ); }, error: (err) => console.error(err), complete: () => console.log("Stream ended"), @@ -275,7 +294,9 @@ const unsubscribe = sdk.subscriptions.onEventsCreated( { next: (result) => { result.data?.onEventsCreated?.events?.forEach((event) => { - console.log(`${event?.eventDisplayType} by ${event?.maker} — $${event?.token0SwapValueUsd}`); + console.log( + `${event?.eventDisplayType} by ${event?.maker} — $${event?.token0SwapValueUsd}`, + ); }); }, error: (err) => console.error(err), @@ -284,9 +305,15 @@ const unsubscribe = sdk.subscriptions.onEventsCreated( ); ``` -## Raw GraphQL Queries +## Custom Queries: Request Only the Fields You Need + +Codex pricing is based on the fields your query requests, and some nested fields (like the full `token` object) carry their own cost. The built-in `sdk.queries.*` methods select every available field, so the recipes above are the most expensive way to call each endpoint. Writing your own query means you pay only for what you use — and get smaller, faster responses. -Use `sdk.send()` to execute any GraphQL query directly. +There are two ways to do it: + +### Option 1: `sdk.send()` — quick, zero setup + +Write the query yourself and describe the result type inline: ```typescript import { Codex } from "@codex-data/sdk"; @@ -305,17 +332,96 @@ const result = await sdk.send<{ console.log("Networks:", result.getNetworks); ``` +Instead of writing types by hand, you can reuse the SDK's exported query types with `DeepPartial`, which makes every field optional — keeping the compiler honest about fields your query didn't select: + +```typescript +import { Codex, DeepPartial, FilterTokensQuery } from "@codex-data/sdk"; + +const sdk = new Codex(process.env.CODEX_API_KEY!); + +const result = await sdk.send>( + `query FilterTokens($limit: Int) { + filterTokens(limit: $limit) { + results { + priceUSD + volume24 + token { name symbol } + } + } + }`, + { limit: 10 }, +); +``` + +### Option 2: GraphQL Code Generator — exact types and autocomplete + +For production codebases we recommend generating types from your own queries. The SDK ships its schema at `@codex-data/sdk/schema.graphql`, so codegen runs offline against the exact schema version you have installed. + +Install the codegen tooling: + +```bash +npm install -D @graphql-codegen/cli @graphql-codegen/client-preset +``` + +Add a `codegen.ts` to your project root: + +```typescript +import type { CodegenConfig } from "@graphql-codegen/cli"; + +const config: CodegenConfig = { + schema: "./node_modules/@codex-data/sdk/schema.graphql", + documents: "src/**/*.ts", + generates: { + "src/gql/": { + preset: "client", + presetConfig: { fragmentMasking: false }, + }, + }, +}; + +export default config; +``` + +Run `graphql-codegen`, then write queries with the generated `graphql()` helper and pass them to `sdk.query()`. The result type is inferred from exactly the fields you selected: + +```typescript +import { Codex } from "@codex-data/sdk"; +import { graphql } from "./gql"; + +const sdk = new Codex(process.env.CODEX_API_KEY!); + +const trendingTokens = graphql(` + query TrendingTokens($limit: Int) { + filterTokens(limit: $limit) { + results { + priceUSD + volume24 + token { + name + symbol + } + } + } + } +`); + +const result = await sdk.query(trendingTokens, { limit: 10 }); +// result.filterTokens.results[0].priceUSD — fully typed, only what you asked for +``` + +See the [codegen example](./examples/codegen) for a complete working project. + ## Common Network IDs -| Network | ID | -| --- | --- | -| Ethereum | `1` | -| BSC | `56` | -| Polygon | `137` | -| Arbitrum | `42161` | -| Base | `8453` | -| Avalanche | `43114` | -| Solana | `1399811149` | +| Network | ID | +| --------- | ------------ | +| Ethereum | `1` | +| BSC | `56` | +| Polygon | `137` | +| Arbitrum | `42161` | +| Base | `8453` | +| Avalanche | `43114` | +| Solana | `1399811149` | Use `sdk.queries.getNetworks({})` for the full list of 80+ supported networks. @@ -331,78 +437,78 @@ IDs in the Codex API follow the pattern `address:networkId`: ### Queries (`sdk.queries.*`) -| Method | Description | -| --- | --- | -| [`filterTokens`](https://docs.codex.io/api-reference/queries/filtertokens) | Search and filter tokens by price, volume, market cap, liquidity | -| [`getTokenPrices`](https://docs.codex.io/api-reference/queries/gettokenprices) | Get current or historical USD prices for up to 25 tokens | -| [`getBars`](https://docs.codex.io/api-reference/queries/getbars) | Get OHLCV candlestick data for a trading pair | -| [`holders`](https://docs.codex.io/api-reference/queries/holders) | Get token holder list sorted by balance ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`filterPairs`](https://docs.codex.io/api-reference/queries/filterpairs) | Search and filter trading pairs | -| [`balances`](https://docs.codex.io/api-reference/queries/balances) | Get wallet token balances with USD values ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`getTokenEvents`](https://docs.codex.io/api-reference/queries/gettokenevents) | Get buy/sell/mint/burn trade events | -| [`pairMetadata`](https://docs.codex.io/api-reference/queries/pairmetadata) | Get trading pair stats and metadata | -| [`token`](https://docs.codex.io/api-reference/queries/token) | Get metadata for a single token | -| [`listPairsWithMetadataForToken`](https://docs.codex.io/api-reference/queries/listpairswithmetadatafortoken) | List pairs with full metadata | -| [`getTokenEventsForMaker`](https://docs.codex.io/api-reference/queries/gettokeneventsformaker) | Get trade events for a specific wallet | -| [`getDetailedPairStats`](https://docs.codex.io/api-reference/queries/getdetailedpairstats) | Get detailed bucketed stats for a pair | -| [`listPairsForToken`](https://docs.codex.io/api-reference/queries/listpairsfortoken) | List all trading pairs for a token | -| [`tokenTopTraders`](https://docs.codex.io/api-reference/queries/tokentoptraders) | Get top traders for a token | -| [`tokens`](https://docs.codex.io/api-reference/queries/tokens) | Get metadata for multiple tokens | -| [`top10HoldersPercent`](https://docs.codex.io/api-reference/queries/top10holderspercent) | Get percentage held by top 10 wallets | -| [`getDetailedPairsStats`](https://docs.codex.io/api-reference/queries/getdetailedpairsstats) | Get detailed stats for multiple pairs | -| [`filterTokenWallets`](https://docs.codex.io/api-reference/queries/filtertokenwallets) | Get per-wallet trading stats (profit/loss, buy/sell counts) ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`liquidityMetadata`](https://docs.codex.io/api-reference/queries/liquiditymetadata) | Get liquidity pool metadata ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`tokenSparklines`](https://docs.codex.io/api-reference/queries/tokensparklines) | Get sparkline price data for tokens | -| [`filterWallets`](https://docs.codex.io/api-reference/queries/filterwallets) | Filter wallets by trading statistics ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`detailedWalletStats`](https://docs.codex.io/api-reference/queries/detailedwalletstats) | Get comprehensive wallet analytics ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`getExchanges`](https://docs.codex.io/api-reference/queries/getexchanges) | Get DEX information | -| [`getNetworks`](https://docs.codex.io/api-reference/queries/getnetworks) | List all 80+ supported networks | -| [`getTokenBars`](https://docs.codex.io/api-reference/queries/gettokenbars) | Get OHLCV data for a token across all pairs | -| [`chartUrls`](https://docs.codex.io/api-reference/queries/charturls) | Get pre-rendered chart image URLs ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`walletChart`](https://docs.codex.io/api-reference/queries/walletchart) | Get wallet portfolio chart data ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`filterExchanges`](https://docs.codex.io/api-reference/queries/filterexchanges) | Filter decentralized exchanges | -| [`liquidityLocks`](https://docs.codex.io/api-reference/queries/liquiditylocks) | Get liquidity lock information ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`getNetworkConfigs`](https://docs.codex.io/api-reference/queries/getnetworkconfigs) | Get network configuration details | -| [`getNetworkStats`](https://docs.codex.io/api-reference/queries/getnetworkstats) | Get network-level statistics | -| [`getNetworkStatus`](https://docs.codex.io/api-reference/queries/getnetworkstatus) | Get network sync status | -| [`tokenLifecycleEvents`](https://docs.codex.io/api-reference/queries/tokenlifecycleevents) | Get token creation and migration events | -| [`blocks`](https://docs.codex.io/api-reference/queries/blocks) | Get block data by number or timestamp | +| Method | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| [`filterTokens`](https://docs.codex.io/api-reference/queries/filtertokens) | Search and filter tokens by price, volume, market cap, liquidity | +| [`getTokenPrices`](https://docs.codex.io/api-reference/queries/gettokenprices) | Get current or historical USD prices for up to 25 tokens | +| [`getBars`](https://docs.codex.io/api-reference/queries/getbars) | Get OHLCV candlestick data for a trading pair | +| [`holders`](https://docs.codex.io/api-reference/queries/holders) | Get token holder list sorted by balance ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`filterPairs`](https://docs.codex.io/api-reference/queries/filterpairs) | Search and filter trading pairs | +| [`balances`](https://docs.codex.io/api-reference/queries/balances) | Get wallet token balances with USD values ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`getTokenEvents`](https://docs.codex.io/api-reference/queries/gettokenevents) | Get buy/sell/mint/burn trade events | +| [`pairMetadata`](https://docs.codex.io/api-reference/queries/pairmetadata) | Get trading pair stats and metadata | +| [`token`](https://docs.codex.io/api-reference/queries/token) | Get metadata for a single token | +| [`listPairsWithMetadataForToken`](https://docs.codex.io/api-reference/queries/listpairswithmetadatafortoken) | List pairs with full metadata | +| [`getTokenEventsForMaker`](https://docs.codex.io/api-reference/queries/gettokeneventsformaker) | Get trade events for a specific wallet | +| [`getDetailedPairStats`](https://docs.codex.io/api-reference/queries/getdetailedpairstats) | Get detailed bucketed stats for a pair | +| [`listPairsForToken`](https://docs.codex.io/api-reference/queries/listpairsfortoken) | List all trading pairs for a token | +| [`tokenTopTraders`](https://docs.codex.io/api-reference/queries/tokentoptraders) | Get top traders for a token | +| [`tokens`](https://docs.codex.io/api-reference/queries/tokens) | Get metadata for multiple tokens | +| [`top10HoldersPercent`](https://docs.codex.io/api-reference/queries/top10holderspercent) | Get percentage held by top 10 wallets | +| [`getDetailedPairsStats`](https://docs.codex.io/api-reference/queries/getdetailedpairsstats) | Get detailed stats for multiple pairs | +| [`filterTokenWallets`](https://docs.codex.io/api-reference/queries/filtertokenwallets) | Get per-wallet trading stats (profit/loss, buy/sell counts) ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`liquidityMetadata`](https://docs.codex.io/api-reference/queries/liquiditymetadata) | Get liquidity pool metadata ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`tokenSparklines`](https://docs.codex.io/api-reference/queries/tokensparklines) | Get sparkline price data for tokens | +| [`filterWallets`](https://docs.codex.io/api-reference/queries/filterwallets) | Filter wallets by trading statistics ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`detailedWalletStats`](https://docs.codex.io/api-reference/queries/detailedwalletstats) | Get comprehensive wallet analytics ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`getExchanges`](https://docs.codex.io/api-reference/queries/getexchanges) | Get DEX information | +| [`getNetworks`](https://docs.codex.io/api-reference/queries/getnetworks) | List all 80+ supported networks | +| [`getTokenBars`](https://docs.codex.io/api-reference/queries/gettokenbars) | Get OHLCV data for a token across all pairs | +| [`chartUrls`](https://docs.codex.io/api-reference/queries/charturls) | Get pre-rendered chart image URLs ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`walletChart`](https://docs.codex.io/api-reference/queries/walletchart) | Get wallet portfolio chart data ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`filterExchanges`](https://docs.codex.io/api-reference/queries/filterexchanges) | Filter decentralized exchanges | +| [`liquidityLocks`](https://docs.codex.io/api-reference/queries/liquiditylocks) | Get liquidity lock information ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`getNetworkConfigs`](https://docs.codex.io/api-reference/queries/getnetworkconfigs) | Get network configuration details | +| [`getNetworkStats`](https://docs.codex.io/api-reference/queries/getnetworkstats) | Get network-level statistics | +| [`getNetworkStatus`](https://docs.codex.io/api-reference/queries/getnetworkstatus) | Get network sync status | +| [`tokenLifecycleEvents`](https://docs.codex.io/api-reference/queries/tokenlifecycleevents) | Get token creation and migration events | +| [`blocks`](https://docs.codex.io/api-reference/queries/blocks) | Get block data by number or timestamp | ### Subscriptions (`sdk.subscriptions.*`) — [paid plan](https://dashboard.codex.io/dashboard/billing) required -| Method | Description | -| --- | --- | -| [`onPairMetadataUpdated`](https://docs.codex.io/api-reference/subscriptions/onpairmetadataupdated) | Live pair stat updates | -| [`onLaunchpadTokenEventBatch`](https://docs.codex.io/api-reference/subscriptions/onlaunchpadtokeneventbatch) | Batched launchpad events | -| [`onBarsUpdated`](https://docs.codex.io/api-reference/subscriptions/onbarsupdated) | Real-time OHLCV bars for a trading pair | -| [`onPriceUpdated`](https://docs.codex.io/api-reference/subscriptions/onpriceupdated) | Real-time price for a single token | -| [`onHoldersUpdated`](https://docs.codex.io/api-reference/subscriptions/onholdersupdated) | Live holder count and balance changes | -| [`onDetailedStatsUpdated`](https://docs.codex.io/api-reference/subscriptions/ondetailedstatsupdated) | Live detailed stats updates | -| [`onDetailedTokenStatsUpdated`](https://docs.codex.io/api-reference/subscriptions/ondetailedtokenstatsupdated) | Live detailed token stats aggregated across pools | -| [`onEventsCreated`](https://docs.codex.io/api-reference/subscriptions/oneventscreated) | Live buy/sell events for a pair | -| [`onPricesUpdated`](https://docs.codex.io/api-reference/subscriptions/onpricesupdated) | Real-time prices for multiple tokens | -| [`onUnconfirmedEventsCreated`](https://docs.codex.io/api-reference/subscriptions/onunconfirmedeventscreated) | Unconfirmed (mempool) trade events | -| [`onTokenEventsCreated`](https://docs.codex.io/api-reference/subscriptions/ontokeneventscreated) | Live events across all pools for a token | -| [`onLaunchpadTokenEvent`](https://docs.codex.io/api-reference/subscriptions/onlaunchpadtokenevent) | Individual launchpad events (Pump.fun, etc.) | -| [`onTokenBarsUpdated`](https://docs.codex.io/api-reference/subscriptions/ontokenbarsupdated) | Real-time OHLCV bars for a token | -| [`onLatestPairUpdated`](https://docs.codex.io/api-reference/subscriptions/onlatestpairupdated) | New trading pair creation events | -| [`onUnconfirmedBarsUpdated`](https://docs.codex.io/api-reference/subscriptions/onunconfirmedbarsupdated) | Unconfirmed bar updates | -| [`onEventsCreatedByMaker`](https://docs.codex.io/api-reference/subscriptions/oneventscreatedbymaker) | Live events for a specific wallet | -| [`onBalanceUpdated`](https://docs.codex.io/api-reference/subscriptions/onbalanceupdated) | Live wallet balance updates | -| [`onTokenLifecycleEventsCreated`](https://docs.codex.io/api-reference/subscriptions/ontokenlifecycleeventscreated) | Token lifecycle events | -| [`onLatestTokens`](https://docs.codex.io/api-reference/subscriptions/onlatesttokens) | New token creation events | -| [`onNftEventsCreated`](https://docs.codex.io/api-reference/subscriptions/onnfteventscreated) | NFT trade events | +| Method | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | +| [`onPairMetadataUpdated`](https://docs.codex.io/api-reference/subscriptions/onpairmetadataupdated) | Live pair stat updates | +| [`onLaunchpadTokenEventBatch`](https://docs.codex.io/api-reference/subscriptions/onlaunchpadtokeneventbatch) | Batched launchpad events | +| [`onBarsUpdated`](https://docs.codex.io/api-reference/subscriptions/onbarsupdated) | Real-time OHLCV bars for a trading pair | +| [`onPriceUpdated`](https://docs.codex.io/api-reference/subscriptions/onpriceupdated) | Real-time price for a single token | +| [`onHoldersUpdated`](https://docs.codex.io/api-reference/subscriptions/onholdersupdated) | Live holder count and balance changes | +| [`onDetailedStatsUpdated`](https://docs.codex.io/api-reference/subscriptions/ondetailedstatsupdated) | Live detailed stats updates | +| [`onDetailedTokenStatsUpdated`](https://docs.codex.io/api-reference/subscriptions/ondetailedtokenstatsupdated) | Live detailed token stats aggregated across pools | +| [`onEventsCreated`](https://docs.codex.io/api-reference/subscriptions/oneventscreated) | Live buy/sell events for a pair | +| [`onPricesUpdated`](https://docs.codex.io/api-reference/subscriptions/onpricesupdated) | Real-time prices for multiple tokens | +| [`onUnconfirmedEventsCreated`](https://docs.codex.io/api-reference/subscriptions/onunconfirmedeventscreated) | Unconfirmed (mempool) trade events | +| [`onTokenEventsCreated`](https://docs.codex.io/api-reference/subscriptions/ontokeneventscreated) | Live events across all pools for a token | +| [`onLaunchpadTokenEvent`](https://docs.codex.io/api-reference/subscriptions/onlaunchpadtokenevent) | Individual launchpad events (Pump.fun, etc.) | +| [`onTokenBarsUpdated`](https://docs.codex.io/api-reference/subscriptions/ontokenbarsupdated) | Real-time OHLCV bars for a token | +| [`onLatestPairUpdated`](https://docs.codex.io/api-reference/subscriptions/onlatestpairupdated) | New trading pair creation events | +| [`onUnconfirmedBarsUpdated`](https://docs.codex.io/api-reference/subscriptions/onunconfirmedbarsupdated) | Unconfirmed bar updates | +| [`onEventsCreatedByMaker`](https://docs.codex.io/api-reference/subscriptions/oneventscreatedbymaker) | Live events for a specific wallet | +| [`onBalanceUpdated`](https://docs.codex.io/api-reference/subscriptions/onbalanceupdated) | Live wallet balance updates | +| [`onTokenLifecycleEventsCreated`](https://docs.codex.io/api-reference/subscriptions/ontokenlifecycleeventscreated) | Token lifecycle events | +| [`onLatestTokens`](https://docs.codex.io/api-reference/subscriptions/onlatesttokens) | New token creation events | +| [`onNftEventsCreated`](https://docs.codex.io/api-reference/subscriptions/onnfteventscreated) | NFT trade events | ### Mutations (`sdk.mutations.*`) -| Method | Description | -| --- | --- | -| [`createWebhooks`](https://docs.codex.io/api-reference/mutations/createwebhooks) | Create webhook alerts ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`deleteWebhooks`](https://docs.codex.io/api-reference/mutations/deletewebhooks) | Delete webhook alerts ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`backfillWalletAggregates`](https://docs.codex.io/api-reference/mutations/backfillwalletaggregates) | Trigger wallet data backfill ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`createApiTokens`](https://docs.codex.io/api-reference/mutations/createapitokens) | Create short-lived API tokens for client-side use ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`deleteApiToken`](https://docs.codex.io/api-reference/mutations/deleteapitoken) | Delete an API token ([paid](https://dashboard.codex.io/dashboard/billing)) | -| [`refreshBalances`](https://docs.codex.io/api-reference/mutations/refreshbalances) | Refresh wallet balances | +| Method | Description | +| ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| [`createWebhooks`](https://docs.codex.io/api-reference/mutations/createwebhooks) | Create webhook alerts ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`deleteWebhooks`](https://docs.codex.io/api-reference/mutations/deletewebhooks) | Delete webhook alerts ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`backfillWalletAggregates`](https://docs.codex.io/api-reference/mutations/backfillwalletaggregates) | Trigger wallet data backfill ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`createApiTokens`](https://docs.codex.io/api-reference/mutations/createapitokens) | Create short-lived API tokens for client-side use ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`deleteApiToken`](https://docs.codex.io/api-reference/mutations/deleteapitoken) | Delete an API token ([paid](https://dashboard.codex.io/dashboard/billing)) | +| [`refreshBalances`](https://docs.codex.io/api-reference/mutations/refreshbalances) | Refresh wallet balances | ## Configuration @@ -410,9 +516,9 @@ IDs in the Codex API follow the pattern `address:networkId`: import { Codex } from "@codex-data/sdk"; const sdk = new Codex("YOUR_API_KEY", { - apiUrl: "https://graph.codex.io/graphql", // default - apiRealtimeUrl: "wss://graph.codex.io/graphql", // default - ws: true, // enable WebSocket (default: true) + apiUrl: "https://graph.codex.io/graphql", // default + apiRealtimeUrl: "wss://graph.codex.io/graphql", // default + ws: true, // enable WebSocket (default: true) }); // Update config at runtime @@ -443,7 +549,7 @@ pnpm run lint # Lint the codebase ## Releasing -On a branch, make your changes then: +On a branch, make your changes then: - `pnpm run build` - change `package.json` version accordingly diff --git a/examples/README.md b/examples/README.md index 17ec4fd..83026f2 100644 --- a/examples/README.md +++ b/examples/README.md @@ -176,15 +176,19 @@ sdk.subscriptions.onPriceUpdated( ### Custom GraphQL Query +Custom queries let you request only the fields you need — you're billed for the fields your query requests, so this is the recommended pattern for production. Wrap the SDK's exported query types in `DeepPartial` so the compiler stays honest about fields your query didn't select: + ```typescript -import { GetNetworksQuery } from "@codex-data/sdk"; +import { DeepPartial, GetNetworksQuery } from "@codex-data/sdk"; -const result = await sdk.send( +const result = await sdk.send>( `query GetNetworks { getNetworks { id name } }`, {}, ); ``` +For exact types inferred from your query (no `DeepPartial` needed), see the [codegen example](./codegen/). + ### Mutation Example ```typescript diff --git a/examples/codegen/codegen.ts b/examples/codegen/codegen.ts index 432b0e3..2ee9ba6 100644 --- a/examples/codegen/codegen.ts +++ b/examples/codegen/codegen.ts @@ -2,7 +2,9 @@ import type { CodegenConfig } from "@graphql-codegen/cli"; const config: CodegenConfig = { overwrite: true, - schema: "../../src/resources/schema.graphql", + // The SDK ships its schema, so codegen runs offline against the exact + // schema version you have installed. + schema: "./node_modules/@codex-data/sdk/schema.graphql", documents: "src/**/*.ts", generates: { "src/gql/": { diff --git a/examples/codegen/src/gql/graphql.ts b/examples/codegen/src/gql/graphql.ts index 7a7de17..671c350 100644 --- a/examples/codegen/src/gql/graphql.ts +++ b/examples/codegen/src/gql/graphql.ts @@ -66,6 +66,17 @@ export type AddNftPoolEventsOutput = { poolAddress: Scalars['String']['output']; }; +/** Payload for `onPredictionTradesCreated`. */ +export type AddPredictionTradeOutput = { + __typename?: 'AddPredictionTradeOutput'; + /** The ID of the prediction event. */ + eventId: Scalars['String']['output']; + /** The ID of the prediction market. */ + marketId: Scalars['String']['output']; + /** The number of trades. */ + trades: Array>; +}; + /** Response returned by `onTokenEventsCreated`. */ export type AddTokenEventsOutput = { __typename?: 'AddTokenEventsOutput'; @@ -82,7 +93,7 @@ export type AddTokenLifecycleEventsOutput = { id: Scalars['String']['output']; }; -/** Response returned by `onUnconfirmedEventsCreatedByMaker`. */ +/** Response returned by deprecated `onUnconfirmedEventsCreatedByMaker`. Prefer `onEventsCreatedByMaker`. */ export type AddUnconfirmedEventsByMakerOutput = { __typename?: 'AddUnconfirmedEventsByMakerOutput'; /** A list of transactions for the maker. */ @@ -91,7 +102,7 @@ export type AddUnconfirmedEventsByMakerOutput = { makerAddress: Scalars['String']['output']; }; -/** Response returned by `onUnconfirmedEventsCreated`. */ +/** Response returned by deprecated `onUnconfirmedEventsCreated`. Prefer `onEventsCreated`. */ export type AddUnconfirmedEventsOutput = { __typename?: 'AddUnconfirmedEventsOutput'; /** The contract address of the pair. */ @@ -155,6 +166,48 @@ export type ArenaTradeData = { type: Scalars['String']['output']; }; +/** A Grid asset — a canonical representation of an on-chain token or instrument. */ +export type Asset = { + __typename?: 'Asset'; + /** Deployments of this asset across chains. */ + assetDeployments: Array; + /** A description of the asset. */ + description?: Maybe; + /** The asset icon URL. */ + icon?: Maybe; + /** The Grid asset ID. */ + id: Scalars['String']['output']; + /** The asset name. */ + name?: Maybe; + /** The Grid root ID for the parent organization. */ + rootId: Scalars['String']['output']; + /** The asset status. */ + status?: Maybe; + /** The asset ticker symbol. */ + ticker?: Maybe; + /** The asset type (e.g. `token`, `stablecoin`). */ + type?: Maybe; +}; + +/** A deployment of a Grid asset on a specific chain. */ +export type AssetDeployment = { + __typename?: 'AssetDeployment'; + /** The contract address of the deployment. */ + address: Scalars['String']['output']; + /** The Grid asset ID. */ + assetId: Scalars['String']['output']; + /** The deployment ID. */ + id: Scalars['String']['output']; + /** The network ID the asset is deployed on. */ + networkId: Scalars['Int']['output']; + /** The Grid root ID for the parent organization. */ + rootId: Scalars['String']['output']; + /** The token standard (e.g. `ERC20`, `SPL`). */ + standard?: Maybe; + /** The enhanced token this deployment represents. */ + token?: Maybe; +}; + /** Wallet balance of a token. */ export type Balance = { __typename?: 'Balance'; @@ -178,8 +231,12 @@ export type Balance = { tokenAddress: Scalars['String']['output']; /** The ID of the token (`tokenAddress:networkId`). */ tokenId: Scalars['String']['output']; + /** Unix timestamp (seconds) of the token's most recent trade/market event across all pools we track. Token-level (not specific to this wallet). Useful for filtering out dead/worthless tokens, e.g. no activity in months. */ + tokenLastTradedTimestamp?: Maybe; /** The token price in USD. */ tokenPriceUsd?: Maybe; + /** Identity and profile metadata for the wallet holding this balance. Not always available. */ + wallet?: Maybe; /** The ID of the wallet (`walletAddress:networkId`). */ walletId: Scalars['String']['output']; }; @@ -202,6 +259,8 @@ export type BalancesInput = { removeScams?: InputMaybe; /** The attribute to sort the list on. Defaults to BALANCE (raw token amount). */ sortBy?: InputMaybe; + /** The direction to sort the list. Defaults to DESC (highest value first). */ + sortDirection?: InputMaybe; /** The token IDs (`address:networkId`) or addresses to request the balance for. Requires a list of `networks` if only passing addresses. Include native network balances using `native` as the token address. Only applied when using `walletAddress` (not `walletId`). Max 200 tokens. */ tokens?: InputMaybe>; /** The wallet address to filter by. */ @@ -229,9 +288,22 @@ export enum BalancesSortAttribute { UsdValue = 'USD_VALUE' } +/** The commitment level of a streamed bar update for Solana subscriptions. */ +export enum BarCommitmentLevel { + Confirmed = 'Confirmed', + Preprocessed = 'Preprocessed', + Processed = 'Processed' +} + /** Bar chart data to track price changes over time. */ export type BarsResponse = { __typename?: 'BarsResponse'; + /** Average total fee cost per transaction in USD (totalFees / transactions). Null when there are no transactions. */ + averageCostPerTrade?: Maybe>>; + /** The aggregate base fees (gas) in USD */ + baseFees?: Maybe>>; + /** The aggregate builder tips (MEV) in USD */ + builderTips?: Maybe>>; /** The buy volume in USD */ buyVolume: Array>; /** The number of unique buyers */ @@ -240,18 +312,36 @@ export type BarsResponse = { buys: Array>; /** The closing price. */ c: Array>; + /** Dominant fee component: gas-dominated (gas >50% of fees), mev-dominated (tips >20%), or pool-fee-dominated. Null when no fees. */ + feeRegimeClassification?: Maybe>>; + /** Ratio of total fees to volume (totalFees / volume). Null when volume is zero. */ + feeToVolumeRatio?: Maybe>>; + /** Gas cost per dollar of volume ((baseFees + priorityFees + l1DataFees) / volume). Null when volume is zero. */ + gasPerVolume?: Maybe>>; /** The high price. */ h: Array>; /** The low price. */ l: Array>; + /** The aggregate L1 data posting fees in USD (L2 rollups only) */ + l1DataFees?: Maybe>>; /** Liquidity in USD */ liquidity: Array>; + /** MEV risk level for this bar: low (<3% builder tips), medium (3-30%), or high (>30%). Null for pre-genesis bars. */ + mevRiskLevel?: Maybe>>; + /** Ratio of builder tips (MEV) to total fees (builderTips / totalFees). Null when totalFees is zero. */ + mevToTotalFeesRatio?: Maybe>>; /** The opening price. */ o: Array>; /** The pair that is being returned */ pair: Pair; + /** The aggregate pool/DEX fees in USD */ + poolFees?: Maybe>>; + /** The aggregate priority fees in USD */ + priorityFees?: Maybe>>; /** The status code for the batch: `ok` for successful data retrieval and `no_data` for empty responses signaling the end of server data. */ s: Scalars['String']['output']; + /** Rate of sandwich attacks per transaction (sandwichedEventCount / transactions). Null when no transaction data. */ + sandwichRate?: Maybe>>; /** The sell volume in USD */ sellVolume: Array>; /** The number of unique sellers */ @@ -260,6 +350,8 @@ export type BarsResponse = { sells: Array>; /** The timestamp for the bar. */ t: Array; + /** The total fees in USD (sum of poolFees + baseFees + priorityFees + builderTips + l1DataFees) */ + totalFees?: Maybe>>; /** The number of traders */ traders: Array>; /** The number of transactions */ @@ -359,6 +451,22 @@ export type ChartUrlsResponse = { pair: ChartUrl; }; +export type CoinCommunity = { + __typename?: 'CoinCommunity'; + /** The unix timestamp for the creation of the coin community. */ + createdAt: Scalars['Int']['output']; + /** The id of the coin community */ + id: Scalars['String']['output']; + /** The unix timestamp for the most recent post in the coin community. */ + lastPostAt?: Maybe; + /** The number of likes in the coin community. */ + likeCount: Scalars['Int']['output']; + /** The number of members in the coin community. */ + memberCount: Scalars['Int']['output']; + /** The number of posts in the coin community. */ + postCount: Scalars['Int']['output']; +}; + /** Community gathered proposals for an asset. */ export type CommunityNote = { __typename?: 'CommunityNote'; @@ -494,8 +602,8 @@ export enum ContractProposalStatus { /** Type of the contract. */ export enum ContractType { - Nft = 'NFT', - Token = 'TOKEN' + Token = 'TOKEN', + Wallet = 'WALLET' } export type CreateApiTokensInput = { @@ -550,33 +658,18 @@ export type CreateMarketCapWebhooksInput = { webhooks: Array; }; -/** Input for creating an NFT event webhook. */ -export type CreateNftEventWebhookArgs = { +/** Input for creating a prediction market metrics event webhook. */ +export type CreatePredictionMarketMetricsEventWebhookArgs = { /** The recurrence of the webhook. Can be `INDEFINITE` or `ONCE`. */ alertRecurrence: AlertRecurrence; - /** - * Deprecated. Use `bucketKey.bucketId` instead. Existing webhooks created with `bucketId` and `bucketSortkey` will continue to work. - * @deprecated Use bucketKey.bucketId instead. - */ - bucketId?: InputMaybe; /** An optional bucket key for grouping and querying webhooks. Prefer this over the deprecated flat bucket fields. */ bucketKey?: InputMaybe; - /** - * Deprecated. Use `bucketKey.bucketSortKey` instead. Existing webhooks created with `bucketId` and `bucketSortkey` will continue to work. - * @deprecated Use bucketKey.bucketSortKey instead. - */ - bucketSortkey?: InputMaybe; /** The url to which the webhook message should be sent. */ callbackUrl: Scalars['String']['input']; /** The conditions which must be met in order for the webhook to send a message. */ - conditions: NftEventWebhookConditionInput; + conditions: PredictionMarketMetricsEventWebhookConditionInput; /** If enabled, new webhooks won't be created if a webhook with the same parameters already exists. If callbackUrl, conditions, publishingType, and alertRecurrence all match, then we return the existing webhook. */ deduplicate?: InputMaybe; - /** - * A webhook group ID (max 64 characters). Can be used to group webhooks so that their messages are kept in order as a group rather than by individual webhook. - * @deprecated GroupId is deprecated and will be removed in the future. Messages will be grouped by webhookId - */ - groupId?: InputMaybe; /** The name of the webhook (max 128 characters). */ name: Scalars['String']['input']; /** The type of publishing for the webhook. If not set, it defaults to `SINGLE`. */ @@ -587,10 +680,34 @@ export type CreateNftEventWebhookArgs = { securityToken: Scalars['String']['input']; }; -/** Input for creating NFT event webhooks. */ -export type CreateNftEventWebhooksInput = { - /** A list of NFT event webhooks to create. */ - webhooks: Array; +/** Input for creating prediction market metrics event webhooks. */ +export type CreatePredictionMarketMetricsEventWebhooksInput = { + /** A list of prediction market metrics event webhooks to create. */ + webhooks: Array; +}; + +/** Input for creating a prediction trade webhook. */ +export type CreatePredictionTradeWebhookArgs = { + /** The recurrence of the webhook. Can be `INDEFINITE` or `ONCE`. */ + alertRecurrence: AlertRecurrence; + /** An optional bucket key for grouping and querying webhooks. Prefer this over the deprecated flat bucket fields. */ + bucketKey?: InputMaybe; + /** The url to which the webhook message should be sent. */ + callbackUrl: Scalars['String']['input']; + /** The conditions which must be met in order for the webhook to send a message. */ + conditions: PredictionTradeWebhookConditionInput; + /** The name of the webhook (max 128 characters). */ + name: Scalars['String']['input']; + /** The settings for retrying failed webhook messages. */ + retrySettings?: InputMaybe; + /** A string value to hash along with `deduplicationId` using SHA-256. Included in the webhook message for added security. */ + securityToken: Scalars['String']['input']; +}; + +/** Input for creating prediction trade webhooks. */ +export type CreatePredictionTradeWebhooksInput = { + /** A list of prediction trade webhooks to create. */ + webhooks: Array; }; /** Input for creating a price webhook. */ @@ -802,8 +919,10 @@ export type CreateTokenTransferEventWebhooksInput = { export type CreateWebhooksInput = { /** Input for creating market cap webhooks. */ marketCapWebhooksInput?: InputMaybe; - /** Input for creating NFT event webhooks. */ - nftEventWebhooksInput?: InputMaybe; + /** Input for creating prediction market metrics event webhooks. */ + predictionMarketMetricsEventWebhooksInput?: InputMaybe; + /** Input for creating prediction trade webhooks. */ + predictionTradeWebhooksInput?: InputMaybe; /** * Input for creating price webhooks. * @deprecated Use tokenPriceEventWebhooksInput instead. @@ -824,8 +943,10 @@ export type CreateWebhooksOutput = { __typename?: 'CreateWebhooksOutput'; /** The list of market cap event webhooks that were created. */ marketCapWebhooks: Array>; - /** The list of NFT event webhooks that were created. */ - nftEventWebhooks: Array>; + /** The list of prediction market metrics event webhooks that were created. */ + predictionMarketMetricsEventWebhooks: Array>; + /** The list of prediction trade webhooks that were created. */ + predictionTradeWebhooks: Array>; /** The list of price webhooks that were created. */ priceWebhooks: Array>; /** The list of raw transaction webhooks that were created. */ @@ -849,6 +970,35 @@ export type CurrencyBarData = { usd: IndividualBarData; }; +/** OHLC (Open/High/Low/Close) values for a currency pair. */ +export type CurrencyOhlc = { + __typename?: 'CurrencyOHLC'; + /** Closing value. */ + close: CurrencyValuePair; + /** High value. */ + high: CurrencyValuePair; + /** Low value. */ + low: CurrencyValuePair; + /** Opening value. */ + open: CurrencyValuePair; +}; + +/** A currency value pair containing both USD and collateral token values. */ +export type CurrencyValuePair = { + __typename?: 'CurrencyValuePair'; + /** Value in collateral token units. */ + ct: Scalars['String']['output']; + /** Value in USD. */ + usd: Scalars['String']['output']; +}; + +/** Decomposed components extracted from a venue's native event identifier. The parent event's `protocol` field is the source of truth for which sub-block is populated. */ +export type DecomposedVenueTicker = { + __typename?: 'DecomposedVenueTicker'; + /** Populated for Kalshi events whose ticker matches the sports template. */ + kalshiSports?: Maybe; +}; + /** Input for deleting webhooks. */ export type DeleteWebhooksInput = { /** A list of webhook IDs to delete. */ @@ -1013,6 +1163,150 @@ export type DetailedPairStatsStringMetrics = { previousValue?: Maybe; }; +/** Response returned by `detailedPredictionEventStats`. */ +export type DetailedPredictionEventStats = { + __typename?: 'DetailedPredictionEventStats'; + /** All-time aggregate stats. */ + allTimeStats: PredictionEventAllTimeStats; + /** The ID of the prediction event. */ + eventId: Scalars['String']['output']; + /** The timestamp of the last transaction. */ + lastTransactionAt: Scalars['Int']['output']; + /** Lifecycle metadata. */ + lifecycle: PredictionLifecycleStats; + /** The prediction event. */ + predictionEvent: PredictionEvent; + /** The prediction markets. */ + predictionMarkets: Array; + /** Relevance scores across time windows. */ + relevanceScores: DetailedPredictionStatsScores; + /** Stats for the 1-day window. */ + statsDay1?: Maybe; + /** Stats for the 1-hour window. */ + statsHour1?: Maybe; + /** Stats for the 4-hour window. */ + statsHour4?: Maybe; + /** Stats for the 12-hour window. */ + statsHour12?: Maybe; + /** Stats for the 5-minute window. */ + statsMin5?: Maybe; + /** Stats for the 1-week window. */ + statsWeek1?: Maybe; + /** Trending scores across time windows. */ + trendingScores: DetailedPredictionStatsScores; +}; + +/** Input type of `detailedPredictionEventStats`. */ +export type DetailedPredictionEventStatsInput = { + /** The number of stat buckets to return. */ + bucketCount?: InputMaybe; + /** The stat durations to include. */ + durations?: InputMaybe>; + /** The ID of the prediction event. */ + eventId: Scalars['String']['input']; + /** The unix timestamp. */ + timestamp?: InputMaybe; +}; + +/** Response returned by `detailedPredictionMarketStats`. */ +export type DetailedPredictionMarketStats = { + __typename?: 'DetailedPredictionMarketStats'; + /** All-time aggregate stats. */ + allTimeStats: PredictionMarketAllTimeStats; + /** Competitive scores across time windows. */ + competitiveScores: DetailedPredictionStatsScores; + /** The timestamp of the last transaction. */ + lastTransactionAt: Scalars['Int']['output']; + /** Lifecycle metadata. */ + lifecycle: PredictionLifecycleStats; + /** The ID of the prediction market. */ + marketId: Scalars['String']['output']; + /** The prediction event. */ + predictionEvent: PredictionEvent; + /** The prediction market. */ + predictionMarket: PredictionMarket; + /** Relevance scores across time windows. */ + relevanceScores: DetailedPredictionStatsScores; + /** Stats for the 1-day window. */ + statsDay1?: Maybe; + /** Stats for the 1-hour window. */ + statsHour1?: Maybe; + /** Stats for the 4-hour window. */ + statsHour4?: Maybe; + /** Stats for the 12-hour window. */ + statsHour12?: Maybe; + /** Stats for the 5-minute window. */ + statsMin5?: Maybe; + /** Stats for the 1-week window. */ + statsWeek1?: Maybe; + /** Trending scores across time windows. */ + trendingScores: DetailedPredictionStatsScores; +}; + +/** Input type of `detailedPredictionMarketStats`. */ +export type DetailedPredictionMarketStatsInput = { + /** The number of stat buckets to return. */ + bucketCount?: InputMaybe; + /** The stat durations to include. */ + durations?: InputMaybe>; + /** The ID of the prediction market. */ + marketId: Scalars['String']['input']; + /** The unix timestamp. */ + timestamp?: InputMaybe; +}; + +/** Scores across multiple time windows for a prediction entity. */ +export type DetailedPredictionStatsScores = { + __typename?: 'DetailedPredictionStatsScores'; + /** The score1. */ + score1?: Maybe; + /** The score1w. */ + score1w?: Maybe; + /** The score4. */ + score4?: Maybe; + /** The score5m. */ + score5m?: Maybe; + /** The score12. */ + score12?: Maybe; + /** The score24. */ + score24?: Maybe; +}; + +/** Response returned by `detailedPredictionTraderStats`. */ +export type DetailedPredictionTraderStats = { + __typename?: 'DetailedPredictionTraderStats'; + /** All-time aggregate stats. */ + allTimeStats: WindowedPredictionTraderAllTimeStats; + /** The timestamp of the last transaction. */ + lastTransactionAt: Scalars['Int']['output']; + /** Stats for the 1-day window. */ + statsDay1?: Maybe; + /** Stats for the Day30 window. */ + statsDay30?: Maybe; + /** Stats for the 1-hour window. */ + statsHour1?: Maybe; + /** Stats for the 4-hour window. */ + statsHour4?: Maybe; + /** Stats for the 12-hour window. */ + statsHour12?: Maybe; + /** Stats for the 1-week window. */ + statsWeek1?: Maybe; + /** The trader. */ + trader: PredictionTrader; + /** The ID of the prediction trader. */ + traderId: Scalars['String']['output']; +}; + +/** Input type of `detailedPredictionTraderStats`. */ +export type DetailedPredictionTraderStatsInput = { + /** The stat durations to include. */ + durations?: InputMaybe>; + /** The unix timestamp. */ + timestamp?: InputMaybe; + /** The ID of the prediction trader. */ + traderId: Scalars['String']['input']; +}; + /** Detailed stats for a token within a pair. */ export type DetailedStats = { __typename?: 'DetailedStats'; @@ -1078,6 +1372,66 @@ export enum DetailedStatsWindowSize { Min5 = 'min5' } +/** Payload for `onDetailedPredictionEventStatsUpdated`. */ +export type DetailedSubscriptionPredictionEventStats = { + __typename?: 'DetailedSubscriptionPredictionEventStats'; + /** All-time aggregate stats. */ + allTimeStats: PredictionEventAllTimeStats; + /** The ID of the prediction event. */ + eventId: Scalars['String']['output']; + /** The timestamp of the last transaction. */ + lastTransactionAt: Scalars['Int']['output']; + /** Lifecycle metadata. */ + lifecycle: PredictionLifecycleStats; + /** Relevance scores across time windows. */ + relevanceScores: DetailedPredictionStatsScores; + /** Stats for the 1-day window. */ + statsDay1?: Maybe; + /** Stats for the 1-hour window. */ + statsHour1?: Maybe; + /** Stats for the 4-hour window. */ + statsHour4?: Maybe; + /** Stats for the 12-hour window. */ + statsHour12?: Maybe; + /** Stats for the 5-minute window. */ + statsMin5?: Maybe; + /** Stats for the 1-week window. */ + statsWeek1?: Maybe; + /** Trending scores across time windows. */ + trendingScores: DetailedPredictionStatsScores; +}; + +/** Payload for `onDetailedPredictionMarketStatsUpdated`. */ +export type DetailedSubscriptionPredictionMarketStats = { + __typename?: 'DetailedSubscriptionPredictionMarketStats'; + /** All-time aggregate stats. */ + allTimeStats: PredictionMarketAllTimeStats; + /** Competitive scores across time windows. */ + competitiveScores: DetailedPredictionStatsScores; + /** The timestamp of the last transaction. */ + lastTransactionAt: Scalars['Int']['output']; + /** Lifecycle metadata. */ + lifecycle: PredictionLifecycleStats; + /** The ID of the prediction market. */ + marketId: Scalars['String']['output']; + /** Relevance scores across time windows. */ + relevanceScores: DetailedPredictionStatsScores; + /** Stats for the 1-day window. */ + statsDay1?: Maybe; + /** Stats for the 1-hour window. */ + statsHour1?: Maybe; + /** Stats for the 4-hour window. */ + statsHour4?: Maybe; + /** Stats for the 12-hour window. */ + statsHour12?: Maybe; + /** Stats for the 5-minute window. */ + statsMin5?: Maybe; + /** Stats for the 1-week window. */ + statsWeek1?: Maybe; + /** Trending scores across time windows. */ + trendingScores: DetailedPredictionStatsScores; +}; + /** Detailed stats for a token. */ export type DetailedTokenStats = { __typename?: 'DetailedTokenStats'; @@ -1144,6 +1498,11 @@ export type DetailedWalletStats = { /** The stats for the last week */ statsWeek1?: Maybe; /** The stats for the last year */ + statsYear?: Maybe; + /** + * The stats for the last year + * @deprecated statsYear1 is no longer supported and will be removed on 2026-07-10 (we are removing uniqueTokens1y). Use statsYear instead. + */ statsYear1?: Maybe; /** The wallet record */ wallet: Wallet; @@ -1198,6 +1557,10 @@ export type EnhancedToken = { __typename?: 'EnhancedToken'; /** The contract address of the token. */ address: Scalars['String']['output']; + /** The Grid asset associated with this token. */ + asset?: Maybe; + /** The Grid bluechip rating for this token (e.g. `A+`, `B-`). */ + bluechipRating?: Maybe; /** * The circulating supply of the token. * @deprecated Use the TokenInfo type @@ -1205,12 +1568,16 @@ export type EnhancedToken = { circulatingSupply?: Maybe; /** The token ID on CoinMarketCap. */ cmcId?: Maybe; + /** The Coin Community data for the token */ + coinCommunity?: Maybe; /** The block height the token was created at. */ createBlockNumber?: Maybe; /** The transaction hash of the token's creation. */ createTransactionHash?: Maybe; /** The unix timestamp for the creation of the token. */ createdAt?: Maybe; + /** The token creator's wallet identity and profile, resolved from creatorAddress. Null when the token has no known creator. */ + creator?: Maybe; /** The token creator's wallet address. */ creatorAddress?: Maybe; /** The precision to which the token can be divided. For example, the smallest unit for USDC is 0.000001 (6 decimals). */ @@ -1222,8 +1589,12 @@ export type EnhancedToken = { * @deprecated Use the TokenInfo type */ explorerData?: Maybe; + /** All-time high and low price/market cap data for the token. */ + extrema?: Maybe; /** Returns freeze authority address if token is freezable. If null, verify against isFreezableValid. */ freezable?: Maybe; + /** The Grid asset ID, if this token is linked to a Grid asset. */ + gridAssetId?: Maybe; /** The ID of the token (`address:networkId`). */ id: Scalars['String']['output']; /** @@ -1257,11 +1628,15 @@ export type EnhancedToken = { name?: Maybe; /** The network ID the token is deployed on. */ networkId: Scalars['Int']['output']; + /** The Grid organization associated with this token. */ + organization?: Maybe; /** * The amount of this token in the pair. * @deprecated Pooled can be found on the pair instead */ pooled?: Maybe; + /** Whether the token name or symbol contains profanity. */ + profanity?: Maybe; /** Community gathered links for the socials of this token. */ socialLinks?: Maybe; /** The token symbol. For example, `APE`. */ @@ -1275,6 +1650,96 @@ export type EnhancedToken = { totalSupply?: Maybe; }; +/** Enhanced stats for a prediction event over a time window. */ +export type EnhancedWindowedPredictionEventStats = { + __typename?: 'EnhancedWindowedPredictionEventStats'; + /** All-time aggregate stats. */ + allTimeStats: WindowedPredictionAllTimeStats; + /** Buy/sell breakdown (optional). */ + buySell?: Maybe; + /** Core stats (always present). */ + core: WindowedPredictionEventCoreStats; + /** Window end timestamp. */ + end: Scalars['Int']['output']; + /** Timestamp of last transaction in window. */ + lastTransactionAt: Scalars['Int']['output']; + /** Liquidity stats (optional). */ + liquidity?: Maybe; + /** Open interest stats (optional). */ + openInterest?: Maybe; + /** Scores for this window. */ + scores: PredictionEventWindowScores; + /** Window start timestamp. */ + start: Scalars['Int']['output']; + /** Change stats for this window. */ + statsChange: WindowedPredictionEventChangeStats; + /** Unique trader stats (optional). */ + uniqueTraders?: Maybe; +}; + +/** Enhanced stats for a prediction market over a time window. */ +export type EnhancedWindowedPredictionMarketStats = { + __typename?: 'EnhancedWindowedPredictionMarketStats'; + /** All-time aggregate stats. */ + allTimeStats: WindowedPredictionAllTimeStats; + /** Core stats (always present). */ + core: WindowedPredictionMarketCoreStats; + /** Window end timestamp. */ + end: Scalars['Int']['output']; + /** Timestamp of last transaction in window. */ + lastTransactionAt: Scalars['Int']['output']; + /** Liquidity stats (optional). */ + liquidity?: Maybe; + /** Open interest stats (optional). */ + openInterest?: Maybe; + /** Outcome 0 stats. */ + outcome0Stats: EnhancedWindowedPredictionOutcomeStats; + /** Outcome 1 stats. */ + outcome1Stats: EnhancedWindowedPredictionOutcomeStats; + /** Scores for this window. */ + scores: PredictionMarketWindowScores; + /** Window start timestamp. */ + start: Scalars['Int']['output']; + /** Change stats for this window. */ + statsChange: WindowedPredictionMarketChangeStats; + /** Unique trader stats (optional). */ + uniqueTraders?: Maybe; +}; + +/** Enhanced stats for a single outcome over a time window. */ +export type EnhancedWindowedPredictionOutcomeStats = { + __typename?: 'EnhancedWindowedPredictionOutcomeStats'; + /** Buy/sell breakdown (optional). */ + buySell?: Maybe; + /** Core stats (always present). */ + core: WindowedPredictionOutcomeCoreStats; + /** Depth stats (optional). */ + depth?: Maybe; + /** Liquidity stats (optional). */ + liquidity?: Maybe; + /** Orderbook stats (optional). */ + orderbook?: Maybe; + /** Change stats for this window. */ + statsChange: WindowedPredictionOutcomeChangeStats; +}; + +/** Enhanced stats for a prediction trader over a time window, including scores. */ +export type EnhancedWindowedPredictionTraderStats = { + __typename?: 'EnhancedWindowedPredictionTraderStats'; + /** The end. */ + end: Scalars['Int']['output']; + /** The timestamp of the last transaction. */ + lastTransactionAt: Scalars['Int']['output']; + /** The start. */ + start: Scalars['Int']['output']; + /** Change stats for this window. */ + statsChange: WindowedPredictionTraderChangeStats; + /** Currency stats for this window. */ + statsCurrency: WindowedPredictionTraderCurrencyStats; + /** Non-currency stats for this window. */ + statsNonCurrency: WindowedPredictionTraderNonCurrencyStats; +}; + /** A token transaction. */ export type Event = { __typename?: 'Event'; @@ -1286,12 +1751,16 @@ export type Event = { blockHash: Scalars['String']['output']; /** The block number for the transaction. */ blockNumber: Scalars['Int']['output']; + /** The commitment level of the event within the live stream. */ + commitmentLevel: EventCommitmentLevel; /** The event-specific data for the transaction. Can be `BurnEventData` or `MintEventData` or `SwapEventData`. */ data?: Maybe; /** A more specific breakdown of `eventType`. Splits `Swap` into `Buy` or `Sell`. */ eventDisplayType?: Maybe; /** The type of transaction event. Can be `Burn`, `Mint`, `Swap`, `Sync`, `Collect`, or `CollectProtocol`. */ eventType: EventType; + /** Fee breakdown for this event. */ + feeData?: Maybe; /** The ID of the event (`address:networkId`). For example, `0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2:1`. */ id: Scalars['String']['output']; /** Labels attributed to the event. */ @@ -1306,6 +1775,8 @@ export type Event = { networkId: Scalars['Int']['output']; /** The token of interest within the token's top pair. Can be `token0` or `token1`. */ quoteToken?: Maybe; + /** An optional unique identifier describing where the event appears within the transaction. */ + supplementalIndex?: Maybe; /** The unix timestamp for when the transaction occurred. */ timestamp: Scalars['Int']['output']; /** The address of the event's token0. */ @@ -1334,6 +1805,13 @@ export type Event = { walletLabels?: Maybe>; }; +/** The commitment level of a streamed event for Solana subscriptions. */ +export enum EventCommitmentLevel { + Confirmed = 'Confirmed', + Preprocessed = 'Preprocessed', + Processed = 'Processed' +} + /** Response returned by `getTokenEvents`. */ export type EventConnection = { __typename?: 'EventConnection'; @@ -1357,6 +1835,35 @@ export enum EventDisplayType { Sync = 'Sync' } +/** Fee breakdown for a single event. All wei-denominated fields are in the network's native token smallest unit. */ +export type EventFeeData = { + __typename?: 'EventFeeData'; + /** Base fee portion of gas cost in native token smallest unit (wei for EVM, lamports for Solana). baseFeePerGas * gasUsed on EVM, 5000 lamports * signatures on Solana. */ + baseFeeNativeUnit?: Maybe; + /** Direct payment to the block builder in native token smallest unit. Sum of ETH transfers to block.coinbase on EVM, or Jito tip on Solana. */ + builderTipNativeUnit?: Maybe; + /** True when the pool fee is dynamic (e.g. UniswapV4 hooks, AlgebraIntegral plugins). */ + dynamicFee?: Maybe; + /** True when poolFeeBps is a protocol-level estimate rather than an exact per-pool or per-swap value (e.g. MintClub averaged mint/burn royalties). */ + estimatedPoolFee?: Maybe; + /** Gas units consumed by the transaction (EVM gas units or Solana compute units). */ + gasUsed?: Maybe; + /** L1 data posting fee in native token smallest unit (L2 rollups only: Base, Optimism, etc.). */ + l1DataFeeNativeUnit?: Maybe; + /** Pool fee absolute amount in the fee token's smallest unit. */ + poolFeeAmountRaw?: Maybe; + /** Pool fee rate normalized to basis points (1 bps = 0.01%). */ + poolFeeBps?: Maybe; + /** Pool fee rate in the protocol's native encoding. */ + poolFeeRateRaw?: Maybe; + /** Priority fee / gas tip in native token smallest unit. (effectiveGasPrice - baseFeePerGas) * gasUsed on EVM, meta.fee - baseFee on Solana. */ + priorityFeeNativeUnit?: Maybe; + /** Protocol-specific supplemental fee data (e.g. Pump cashback). */ + supplementalFeeData?: Maybe; + /** Number of DEX events in this transaction. Used to pro-rate transaction-level fees per event. */ + txEventCount?: Maybe; +}; + /** Metadata for an event label. */ export type EventLabel = { __typename?: 'EventLabel'; @@ -1404,6 +1911,30 @@ export type EventQueryTimestampInput = { to: Scalars['Int']['input']; }; +/** Response returned by `eventScopedFilterPredictionMarkets`. All markets belong to the same event, so `eventShape` and `eventId` are surfaced once at the connection level rather than repeated on every row. */ +export type EventScopedPredictionMarketFilterConnection = { + __typename?: 'EventScopedPredictionMarketFilterConnection'; + /** Total number of matching results. */ + count: Scalars['Int']['output']; + /** The ID of the prediction event. */ + eventId: Scalars['String']['output']; + /** Event-level shape (one per event; identical for all markets in a single-event query). */ + eventShape: PredictionEventShape; + /** The current page number. */ + page: Scalars['Int']['output']; + /** The list of results. */ + results: Array; +}; + +/** A prediction market scoped to a single event, paired with its structured classification metadata. */ +export type EventScopedPredictionMarketFilterResult = { + __typename?: 'EventScopedPredictionMarketFilterResult'; + /** Structured classification metadata. Discriminated by `classification.role`; carries `segment` (period/stat), `entrant` (with country code / image), `thresholdBucket` (parsed numeric rung + operator), and `dateBucket` (unix timestamp + operator) sub-blocks. See `MarketClassifier/CLASSIFICATION.md` for the consumer guide. */ + classification: PredictionMarketClassification; + /** The prediction market filter result. */ + marketResult: PredictionMarketFilterResult; +}; + /** The event type for a token transaction. */ export enum EventType { Burn = 'Burn', @@ -1675,6 +2206,13 @@ export type FilterNetworkWalletsInput = { wallets?: InputMaybe>>; }; +/** Response returned by `onFilterTokensUpdated`. */ +export type FilterTokenUpdates = { + __typename?: 'FilterTokenUpdates'; + /** The list of updated token results matching the subscription parameters. */ + updates?: Maybe>>; +}; + /** The input for filtering wallets for a token. */ export type FilterTokenWalletsInput = { /** Exclude wallets with these labels. See [`WalletLabel`](/api-reference/enums/walletlabel) for possible values. */ @@ -1714,6 +2252,60 @@ export type FilterTokenWalletsInput = { wallets?: InputMaybe>>; }; +/** Trader metadata within a trader-market filter result. */ +export type FilterTrader = { + __typename?: 'FilterTrader'; + /** The trader alias. */ + alias?: Maybe; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** Labels applied to this entity. */ + labels?: Maybe>; + /** The linked addresses. */ + linkedAddresses?: Maybe>; + /** The primary address. */ + primaryAddress?: Maybe; + /** The profile image url. */ + profileImageUrl?: Maybe; + /** The profile url. */ + profileUrl?: Maybe; + /** The prediction protocol. */ + protocol: PredictionProtocol; + /** The venue trader id. */ + venueTraderId: Scalars['String']['output']; +}; + +/** Market metadata within a trader-market filter result. */ +export type FilterTraderMarket = { + __typename?: 'FilterTraderMarket'; + /** The timestamp when this entity closes. */ + closesAt: Scalars['Int']['output']; + /** The ID of the prediction event. */ + eventId: Scalars['String']['output']; + /** The parent event label. */ + eventLabel?: Maybe; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** URL of the thumbnail image. */ + imageThumbUrl?: Maybe; + /** The display label. */ + label?: Maybe; + /** Outcome 0 label. */ + outcome0Label?: Maybe; + /** Outcome 1 label. */ + outcome1Label?: Maybe; + /** The prediction protocol. */ + protocol: PredictionProtocol; + /** The question or title. */ + question?: Maybe; + /** The actual resolution timestamp. */ + resolvedAt?: Maybe; + /** The current status. */ + status: PredictionEventStatus; + /** The venue-specific market ID. */ + venueMarketId: Scalars['String']['output']; +}; + /** The input for filtering wallets. */ export type FilterWalletsInput = { /** Exclude wallets with these labels. See [`WalletLabel`](/api-reference/enums/walletlabel) for possible values. */ @@ -1726,6 +2318,8 @@ export type FilterWalletsInput = { limit?: InputMaybe; /** Where in the list the server should start when returning items. Use `count`+`offset` from the previous query to request the next page of results. */ offset?: InputMaybe; + /** A phrase to search for. Matches wallet address, display name, or social usernames (Twitter, Discord, Telegram, Farcaster, GitHub). */ + phrase?: InputMaybe; /** A list of ranking attributes to apply. */ rankings?: InputMaybe>>; /** A list of wallet addresses to filter by. */ @@ -1895,6 +2489,7 @@ export type HoldersResponse = { export enum HoldersSortAttribute { Balance = 'BALANCE', + /** @deprecated No longer supported. Use BALANCE instead. */ Date = 'DATE' } @@ -1921,6 +2516,10 @@ export type HoldersUpdate = { /** Bar chart data. */ export type IndividualBarData = { __typename?: 'IndividualBarData'; + /** The USD value of base fees (gas) paid */ + baseFees?: Maybe; + /** The USD value of builder tips (MEV) paid */ + builderTips?: Maybe; /** The buy volume in USD */ buyVolume: Scalars['String']['output']; /** The number of unique buyers */ @@ -1933,10 +2532,16 @@ export type IndividualBarData = { h: Scalars['Float']['output']; /** The low price. */ l: Scalars['Float']['output']; + /** The USD value of L1 data posting fees (L2 rollups only) */ + l1DataFees?: Maybe; /** Liquidity in USD */ liquidity: Scalars['String']['output']; /** The opening price. */ o: Scalars['Float']['output']; + /** The USD value of pool fees collected */ + poolFees?: Maybe; + /** The USD value of priority fees (tips) paid */ + priorityFees?: Maybe; /** The sell volume in USD */ sellVolume: Scalars['String']['output']; /** The number of unique sellers */ @@ -1970,6 +2575,23 @@ export type IntEqualsConditionInput = { eq: Scalars['Int']['input']; }; +/** Structural decomposition of a Kalshi sports event_ticker (e.g. "KXMLBGAME-26MAY091610WSHMIA"). The ticker's ET date/time segments are not exposed here — they are converted to UTC and surfaced on the parent event's `gameStartTime` fields. */ +export type KalshiSportsTickerComponents = { + __typename?: 'KalshiSportsTickerComponents'; + /** Populated only when the parser can confidently split the team tail. */ + awayAbbreviation?: Maybe; + /** Populated only when the parser can confidently split the team tail. */ + homeAbbreviation?: Maybe; + /** Original ticker string. */ + rawTicker: Scalars['String']['output']; + /** Series prefix (e.g. "KXMLBGAME"). */ + seriesPrefix: Scalars['String']['output']; + /** Soft-normalised series sport. */ + seriesSport?: Maybe; + /** Raw uppercase team-tail captured from the ticker (e.g. "1WINTUNDRA"). Present when the parser matched the structural shape. */ + teamTailRaw?: Maybe; +}; + /** Event labels. Can be `sandwich` or `washtrade`. */ export type LabelsForEvent = { __typename?: 'LabelsForEvent'; @@ -1977,77 +2599,6 @@ export type LabelsForEvent = { washtrade?: Maybe; }; -/** Metadata for a newly listed pair. */ -export type LatestPair = { - __typename?: 'LatestPair'; - /** The contract address for the pair. */ - address: Scalars['String']['output']; - /** The contract address for the exchange. */ - exchangeHash: Scalars['String']['output']; - /** The ID of the pair (`address:networkId`). */ - id: Scalars['String']['output']; - /** The listing price, or first known price for the pair, in USD. */ - initialPriceUsd: Scalars['String']['output']; - /** The unix timestamp for when liquidity was added to the pair. */ - liquidAt?: Maybe; - /** The total liquidity in the pair. */ - liquidity: Scalars['String']['output']; - /** The token with higher liquidity within the pair. Can be `token0` or `token1`. */ - liquidityToken?: Maybe; - /** The network ID the pair is deployed on. */ - networkId: Scalars['Int']['output']; - /** The newly added token within the pair. Can be `token0` or `token1`. */ - newToken: Scalars['String']['output']; - /** The token with lower liquidity within the pair. Can be `token0` or `token1`. */ - nonLiquidityToken?: Maybe; - /** The pre-existing token within the pair. Can be `token0` or `token1`. */ - oldToken: Scalars['String']['output']; - /** The percent price change between the listing price and the current price. */ - priceChange: Scalars['Float']['output']; - /** The newly added token price in USD. */ - priceUsd: Scalars['String']['output']; - /** Metadata for `token0`. */ - token0: LatestPairToken; - /** Metadata for `token1`. */ - token1: LatestPairToken; - /** The unique hash for the transaction that added liquidity, if applicable, otherwise the transaction that added the pair. */ - transactionHash: Scalars['String']['output']; -}; - -/** Response returned by `getLatestPairs`. */ -export type LatestPairConnection = { - __typename?: 'LatestPairConnection'; - /** A cursor for use in pagination. */ - cursor?: Maybe; - /** A list of newly listed pairs. */ - items: Array; -}; - -/** Metadata for a token within a newly listed pair. */ -export type LatestPairToken = { - __typename?: 'LatestPairToken'; - /** The contract address for the token. */ - address: Scalars['String']['output']; - /** The amount of `token` currently in the pair. */ - currentPoolAmount: Scalars['String']['output']; - /** The precision to which the token can be divided. For example, the smallest unit for USDC is 0.000001 (6 decimals). */ - decimals: Scalars['Int']['output']; - /** The ID of the token (`address:networkId`). */ - id: Scalars['String']['output']; - /** The initial amount of `token` added to the pair. */ - initialPoolAmount: Scalars['String']['output']; - /** The name of the token. */ - name: Scalars['String']['output']; - /** The network ID the token is deployed on. */ - networkId: Scalars['Int']['output']; - /** The ID of the pair (`pairAddress:networkId`). */ - pairId: Scalars['String']['output']; - /** The percent change `token` remaining in the pair since the initial add. */ - poolVariation: Scalars['Float']['output']; - /** The symbol for the token. */ - symbol: Scalars['String']['output']; -}; - /** Metadata for a newly created token. */ export type LatestToken = { __typename?: 'LatestToken'; @@ -2123,6 +2674,8 @@ export type LatestTokenSimResults = { export type LaunchpadData = { __typename?: 'LaunchpadData'; + /** The token category assigned by the launchpad. Populated by launchpads that publish a category taxonomy (e.g. Scale/Creator, Eitherway). Values include platform, meme, utility, etc. */ + category?: Maybe; /** Indicates if the launchpad is completed. */ completed?: Maybe; /** The unix timestamp when the launchpad was completed. */ @@ -2131,6 +2684,8 @@ export type LaunchpadData = { completedSlot?: Maybe; /** The percentage of the pool that was sold to the public. */ graduationPercent?: Maybe; + /** Whether cashback is enabled for this launchpad token (Pump V1/V2 only). */ + isCashbackEnabled?: Maybe; /** The icon URL of the launchpad. */ launchpadIconUrl?: Maybe; /** The name of the launchpad. */ @@ -2159,6 +2714,10 @@ export type LaunchpadTokenEventOutput = { __typename?: 'LaunchpadTokenEventOutput'; /** The contract address of the token. */ address: Scalars['String']['output']; + /** Network base fees in the last hour, USD. */ + baseFees1?: Maybe; + /** Builder tips (MEV activity indicator) in the last hour, USD. */ + builderTips1?: Maybe; /** The number of bundlers that bought the token */ bundlerCount?: Maybe; /** The percentage of the token that is held by bundlers */ @@ -2167,14 +2726,20 @@ export type LaunchpadTokenEventOutput = { buyCount1?: Maybe; /** The percentage of the token that is held by developers */ devHeldPercentage?: Maybe; + /** Resolved profile and token-creator stats for the deployer wallet. */ + devWallet?: Maybe; /** The type of event. */ eventType: LaunchpadTokenEventType; + /** The ratio of total fees to volume in the last hour. */ + feeToVolumeRatio1?: Maybe; /** The number of holders. */ holders?: Maybe; /** The number of insiders that bought the token */ insiderCount?: Maybe; /** The percentage of the token that is held by insiders */ insiderHeldPercentage?: Maybe; + /** L1 data fees (cost of posting rollup data to L1, applies to all L2 rollups) in the last hour, USD. */ + l1DataFees1?: Maybe; /** The name of the launchpad. */ launchpadName: Scalars['String']['output']; /** The liquidity of the token's top pair. */ @@ -2183,8 +2748,12 @@ export type LaunchpadTokenEventOutput = { marketCap?: Maybe; /** The network ID that the token is deployed on. */ networkId: Scalars['Int']['output']; + /** Pool fees (DEX protocol revenue) in the last hour, USD. */ + poolFees1?: Maybe; /** The price of the token. */ price?: Maybe; + /** EIP-1559 priority fees (tips to validators) in the last hour, USD. */ + priorityFees1?: Maybe; /** The protocol of the token. */ protocol: Scalars['String']['output']; /** The number of sells in the last hour. */ @@ -2193,10 +2762,16 @@ export type LaunchpadTokenEventOutput = { sniperCount?: Maybe; /** The percentage of the token that is held by snipers */ sniperHeldPercentage?: Maybe; + /** The number of suspicious wallets (deduplicated union of snipers, bundlers, and insiders) that bought the token */ + suspiciousCount?: Maybe; + /** The percentage of the token that is held by suspicious wallets */ + suspiciousHeldPercentage?: Maybe; /** Metadata for the token. */ token: EnhancedToken; /** The percentage of total supply held by the top 10 holders. */ top10HoldersPercent?: Maybe; + /** The total fees (pool + base + priority + builder tips + L1 data) in the last hour, denominated in USD. */ + totalFees1?: Maybe; /** The number of transactions in the last hour. */ transactions1?: Maybe; /** The volume of the token in the last hour. */ @@ -2213,6 +2788,8 @@ export enum LaunchpadTokenEventType { Deployed = 'Deployed', /** The token has been migrated */ Migrated = 'Migrated', + /** The token has graduated off its bonding curve (not finalized) */ + UnconfirmedCompleted = 'UnconfirmedCompleted', /** The token has been discovered (not finalized) */ UnconfirmedDeployed = 'UnconfirmedDeployed', /** The token's metadata has been processed (not finalized) */ @@ -2249,6 +2826,8 @@ export enum LaunchpadTokenProtocol { HeavenAmm = 'HeavenAMM', /** Protocol name for Kumbaya. */ Kumbaya = 'Kumbaya', + /** Protocol name for Liquid. */ + Liquid = 'Liquid', /** Protocol name for MeteoraDBC. */ MeteoraDbc = 'MeteoraDBC', /** Protocol name for Moonit (formerly Moonshot). */ @@ -2555,12 +3134,13 @@ export type Mutation = { backfillWalletAggregates: WalletAggregateBackfillStateResponse; /** Create a new set of short-lived api access tokens */ createApiTokens: Array; - /** Create price, raw transaction, token/pair event, and NFT event webhooks. */ + /** Create event webhooks for price, token/pair, transfer, market cap, and prediction market trades. */ createWebhooks: CreateWebhooksOutput; /** Delete a single short-lived api access token by id */ deleteApiToken: Scalars['String']['output']; /** Delete multiple webhooks. */ deleteWebhooks?: Maybe; + /** Force refreshes the balance for a token in a wallet. EVM only. */ refreshBalances: Array; }; @@ -2618,6 +3198,11 @@ export type NetworkBreakdown = { /** The stats for the last week */ statsWeek1?: Maybe; /** The stats for the last year */ + statsYear?: Maybe; + /** + * The stats for the last year + * @deprecated statsYear1 is no longer supported and will be removed on 2026-07-10 (we are removing uniqueTokens1y). Use statsYear instead. + */ statsYear1?: Maybe; }; @@ -2684,12 +3269,22 @@ export type NetworkWalletFilterResult = { averageSwapAmountUsd1y: Scalars['String']['output']; /** Average swap amount in USD in the past 30 days */ averageSwapAmountUsd30d: Scalars['String']['output']; + /** Average hold period, in seconds, for positions sold during the past day. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1d?: Maybe; + /** Average hold period, in seconds, for positions sold during the past week. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1w?: Maybe; + /** Average hold period, in seconds, for positions sold during the past year. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1y?: Maybe; + /** Average hold period, in seconds, for positions sold during the past 30 days. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec30d?: Maybe; /** The backfill state of the wallet. */ backfillState?: Maybe; /** The bot score for the wallet. */ botScore?: Maybe; /** The unix timestamp for the first transaction from this wallet */ firstTransactionAt?: Maybe; + /** Manual or proposal-derived identity vocabulary (e.g. WHALE, KOL). Distinct from behavioral `labels`. */ + identityLabels?: Maybe>; /** The labels associated with the wallet */ labels: Array; /** The unix timestamp for the last transaction from this wallet */ @@ -2736,7 +3331,10 @@ export type NetworkWalletFilterResult = { uniqueTokens1d: Scalars['Int']['output']; /** Number of unique tokens traded in the past week */ uniqueTokens1w: Scalars['Int']['output']; - /** Number of unique tokens traded in the past year */ + /** + * Number of unique tokens traded in the past year + * @deprecated uniqueTokens1y is no longer supported and will be removed on 2026-07-10. + */ uniqueTokens1y: Scalars['Int']['output']; /** Number of unique tokens traded in the past 30 days */ uniqueTokens30d: Scalars['Int']['output']; @@ -2756,6 +3354,8 @@ export type NetworkWalletFilterResult = { volumeUsdAll1y: Scalars['String']['output']; /** Total volume in USD in the past 30 days including all tokens */ volumeUsdAll30d: Scalars['String']['output']; + /** The wallet identity and profile data */ + wallet?: Maybe; /** Win rate in the past day */ winRate1d: Scalars['Float']['output']; /** Win rate in the past week */ @@ -3894,19 +4494,6 @@ export type NftEvent = { transactionIndex: Scalars['Int']['output']; }; -/** NFT marketplaces for a webhook to listen on. */ -export type NftEventFillSourceCondition = { - __typename?: 'NftEventFillSourceCondition'; - /** The list of NFT marketplaces. */ - oneOf: Array; -}; - -/** Input for NFT event fill source condition. */ -export type NftEventFillSourceConditionInput = { - /** The list of NFT marketplace to equal. */ - oneOf: Array; -}; - /** Details for an NFT offered or received as part of an nft trade. */ export type NftEventNftTradeItem = { __typename?: 'NftEventNftTradeItem'; @@ -3979,64 +4566,6 @@ export enum NftEventTradeItemType { Token = 'TOKEN' } -/** An NFT event type for a webhook to listen for. */ -export type NftEventTypeCondition = { - __typename?: 'NftEventTypeCondition'; - /** The NFT event type. */ - eq: WebhookNftEventType; -}; - -/** Input for NFT event type. */ -export type NftEventTypeConditionInput = { - /** The NFT event type to equal. */ - eq: WebhookNftEventType; -}; - -/** Webhook conditions for an NFT event. */ -export type NftEventWebhookCondition = { - __typename?: 'NftEventWebhookCondition'; - /** The NFT collection contract address the webhook is listening for. */ - contractAddress?: Maybe; - /** The NFT event type the webhook is listening for. */ - eventType?: Maybe; - /** The exchange contract address the webhook is listening for. */ - exchangeAddress?: Maybe; - /** The NFT marketplaces the webhook is listening on. */ - fillSource?: Maybe; - /** Option to ignore all nft transfer events */ - ignoreTransfers?: Maybe; - /** The base token price the webhook is listening for. */ - individualBaseTokenPrice?: Maybe; - /** The maker wallet address the webhook is listening for. */ - maker?: Maybe; - /** The list of network IDs the webhook is listening on. */ - networkId?: Maybe; - /** The token contract address the webhook is listening for. */ - tokenAddress?: Maybe; - /** The token ID the webhook is listening for. */ - tokenId?: Maybe; -}; - -/** Input conditions for an NFT event webhook. */ -export type NftEventWebhookConditionInput = { - /** The NFT collection contract address to listen for. */ - contractAddress?: InputMaybe; - /** The NFT event type to listen for. */ - eventType?: InputMaybe; - /** The exchange contract address to listen for. */ - exchangeAddress?: InputMaybe; - /** The NFT marketplaces to listen for. */ - fillSource?: InputMaybe; - /** Option to ignore all nft transfer events */ - ignoreTransfers?: InputMaybe; - /** The maker wallet address to listen for. */ - maker?: InputMaybe; - /** A list of network IDs to listen on. */ - networkId?: InputMaybe; - /** The token ID to listen for. */ - tokenId?: InputMaybe; -}; - /** Response returned by `getNftEvents`. */ export type NftEventsConnection = { __typename?: 'NftEventsConnection'; @@ -5360,7 +5889,7 @@ export type NftStatsWindowWithChange = { usd?: Maybe; }; -/** Input type of `NumberFilter`. */ +/** A numeric range filter with optional upper and lower bounds. */ export type NumberFilter = { /** Greater than. */ gt?: InputMaybe; @@ -5375,8 +5904,10 @@ export type NumberFilter = { /** Response returned by `onBarsUpdated`. */ export type OnBarsUpdatedResponse = { __typename?: 'OnBarsUpdatedResponse'; - /** Price data broken down by resolution. */ + /** Price data broken down by resolution. For processed updates, this is a confirmed-shaped compatibility projection. */ aggregates: ResolutionBarData; + /** The commitment level of the bar update within the live stream. */ + commitmentLevel: BarCommitmentLevel; /** The sortKey for the bar (`blockNumber`#`transactionIndex`#`logIndex`, zero padded). For example, `0000000016414564#00000224#00000413`. */ eventSortKey: Scalars['String']['output']; /** The network ID the pair is deployed on. */ @@ -5404,9 +5935,9 @@ export type OnEventsCreatedByMakerInput = { export type OnLaunchpadTokenEventBatchInput = { /** The type of event. */ eventType?: InputMaybe; - /** The name of the launchpad. One of the following: Pump.fun, Pump Mayhem, Bonk, BONAD.fun, Nad.Fun, Baseapp, Baseapp Creator, Zora, Zora Creator, Four.meme, Four.meme Fair, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Zora Solana, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults, OpenGameProtocol, AMERICA.fun, Kumbaya, Printr, Bankr, Noice, Flaunch, Coinbarrel, Blowfish. */ + /** The name of the launchpad. One of the following: Pump.fun, Pump Mayhem, Bonk, BONAD.fun, Nad.Fun, Baseapp, Baseapp Creator, Zora, Zora Creator, Four.meme, Four.meme Fair, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Meteora Alpha Vault, Zora Solana, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults, OpenGameProtocol, AMERICA.fun, Kumbaya, Printr, Bankr, Liquid, Noice, Flaunch, Coinbarrel, Blowfish, MeMoo, Metaplex, Scale, Eitherway, Livo, Flap. */ launchpadName?: InputMaybe; - /** A list of launchpad names. Any of the following: Pump.fun, Pump Mayhem, Bonk, BONAD.fun, Nad.Fun, Baseapp, Baseapp Creator, Zora, Zora Creator, Four.meme, Four.meme Fair, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Zora Solana, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults, OpenGameProtocol, AMERICA.fun, Kumbaya, Printr, Bankr, Noice, Flaunch, Coinbarrel, Blowfish. */ + /** A list of launchpad names. Any of the following: Pump.fun, Pump Mayhem, Bonk, BONAD.fun, Nad.Fun, Baseapp, Baseapp Creator, Zora, Zora Creator, Four.meme, Four.meme Fair, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Meteora Alpha Vault, Zora Solana, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults, OpenGameProtocol, AMERICA.fun, Kumbaya, Printr, Bankr, Liquid, Noice, Flaunch, Coinbarrel, Blowfish, MeMoo, Metaplex, Scale, Eitherway, Livo, Flap. */ launchpadNames?: InputMaybe>; /** The network ID that the token is deployed on. */ networkId?: InputMaybe; @@ -5422,9 +5953,9 @@ export type OnLaunchpadTokenEventInput = { address?: InputMaybe; /** The type of event. */ eventType?: InputMaybe; - /** The name of the launchpad. One of the following: Pump.fun, Pump Mayhem, Bonk, BONAD.fun, Nad.Fun, Baseapp, Baseapp Creator, Zora, Zora Creator, Four.meme, Four.meme Fair, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Zora Solana, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults, OpenGameProtocol, AMERICA.fun, Kumbaya, Printr, Bankr, Noice, Flaunch, Coinbarrel, Blowfish. */ + /** The name of the launchpad. One of the following: Pump.fun, Pump Mayhem, Bonk, BONAD.fun, Nad.Fun, Baseapp, Baseapp Creator, Zora, Zora Creator, Four.meme, Four.meme Fair, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Meteora Alpha Vault, Zora Solana, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults, OpenGameProtocol, AMERICA.fun, Kumbaya, Printr, Bankr, Liquid, Noice, Flaunch, Coinbarrel, Blowfish, MeMoo, Metaplex, Scale, Eitherway, Livo, Flap. */ launchpadName?: InputMaybe; - /** A list of launchpad names. Any of the following: Pump.fun, Pump Mayhem, Bonk, BONAD.fun, Nad.Fun, Baseapp, Baseapp Creator, Zora, Zora Creator, Four.meme, Four.meme Fair, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Zora Solana, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults, OpenGameProtocol, AMERICA.fun, Kumbaya, Printr, Bankr, Noice, Flaunch, Coinbarrel, Blowfish. */ + /** A list of launchpad names. Any of the following: Pump.fun, Pump Mayhem, Bonk, BONAD.fun, Nad.Fun, Baseapp, Baseapp Creator, Zora, Zora Creator, Four.meme, Four.meme Fair, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Meteora Alpha Vault, Zora Solana, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults, OpenGameProtocol, AMERICA.fun, Kumbaya, Printr, Bankr, Liquid, Noice, Flaunch, Coinbarrel, Blowfish, MeMoo, Metaplex, Scale, Eitherway, Livo, Flap. */ launchpadNames?: InputMaybe>; /** The network ID that the token is deployed on. */ networkId?: InputMaybe; @@ -5434,6 +5965,34 @@ export type OnLaunchpadTokenEventInput = { protocols?: InputMaybe>; }; +/** Payload for `onPredictionEventBarsUpdated`. */ +export type OnPredictionEventBarsUpdatedResponse = { + __typename?: 'OnPredictionEventBarsUpdatedResponse'; + /** The bar data. */ + bars: PredictionEventResolutionBarData; + /** The ID of the prediction event. */ + eventId: Scalars['String']['output']; +}; + +/** Payload for `onPredictionMarketBarsUpdated`. */ +export type OnPredictionMarketBarsUpdatedResponse = { + __typename?: 'OnPredictionMarketBarsUpdatedResponse'; + /** The bar data. */ + bars: PredictionMarketResolutionBarData; + /** The ID of the prediction market. */ + marketId: Scalars['String']['output']; +}; + +/** Input for `onPredictionTradesCreated`. */ +export type OnPredictionTradesCreatedInput = { + /** The ID of the prediction event. */ + eventId?: InputMaybe; + /** The ID of the prediction market. */ + marketId?: InputMaybe; + /** The ID of the prediction trader. */ + traderId?: InputMaybe; +}; + export type OnPricesUpdatedInput = { /** The token contract address. */ address: Scalars['String']['input']; @@ -5448,6 +6007,8 @@ export type OnTokenBarsUpdatedResponse = { __typename?: 'OnTokenBarsUpdatedResponse'; /** Price data broken down by resolution. */ aggregates: ResolutionBarData; + /** The commitment level of the bar within the live stream. */ + commitmentLevel: BarCommitmentLevel; /** The sortKey for the bar (`blockNumber`#`transactionIndex`#`logIndex`, zero padded). For example, `0000000016414564#00000224#00000413`. */ eventSortKey: Scalars['String']['output']; /** The network ID the pair is deployed on. */ @@ -5484,7 +6045,7 @@ export type OnTokenEventsCreatedInput = { tokenAddress?: InputMaybe; }; -/** Response returned by `onUnconfirmedBarsUpdated`. */ +/** Response returned by deprecated `onUnconfirmedBarsUpdated`. Prefer `onBarsUpdated`. */ export type OnUnconfirmedBarsUpdated = { __typename?: 'OnUnconfirmedBarsUpdated'; /** Price data broken down by resolution. */ @@ -5505,7 +6066,7 @@ export type OnUnconfirmedBarsUpdated = { timestamp: Scalars['Int']['output']; }; -/** Input for `onUnconfirmedEventsCreatedByMaker`. */ +/** Input for deprecated `onUnconfirmedEventsCreatedByMaker`. */ export type OnUnconfirmedEventsCreatedByMakerInput = { /** The wallet address of the maker. */ makerAddress: Scalars['String']['input']; @@ -5537,6 +6098,78 @@ export type OneOfTokenTransferDirectionConditionInput = { oneOf: Array; }; +/** A Grid organization — the entity behind one or more on-chain assets. */ +export type Organization = { + __typename?: 'Organization'; + /** Assets managed by this organization. */ + assets: Array; + /** A detailed description of the organization. */ + descriptionLong?: Maybe; + /** A short description of the organization. */ + descriptionShort?: Maybe; + /** The founding date of the organization. */ + foundingDate?: Maybe; + header?: Maybe; + /** The organization's icon URL. */ + icon?: Maybe; + /** The organization's logo URL. */ + logo?: Maybe; + /** The organization name. */ + name: Scalars['String']['output']; + /** The Grid root ID for the organization. */ + rootId: Scalars['String']['output']; + /** The sector the organization operates in. */ + sector?: Maybe; + /** Social links for the organization. */ + socials: Array; + /** The organization's tagline. */ + tagLine?: Maybe; + /** The type of organization (e.g. `protocol`, `company`). */ + type?: Maybe; + /** URLs associated with the organization. */ + urls: Array; +}; + +/** A social link associated with a Grid organization. */ +export type OrganizationSocial = { + __typename?: 'OrganizationSocial'; + /** The type of social link (e.g. `twitter`, `discord`). */ + type?: Maybe; + /** The social URL. */ + url: Scalars['String']['output']; +}; + +/** A URL associated with a Grid organization. */ +export type OrganizationUrl = { + __typename?: 'OrganizationUrl'; + /** The type of URL (e.g. `website`, `docs`). */ + type?: Maybe; + /** The URL. */ + url: Scalars['String']['output']; +}; + +/** Buy/sell volume breakdown including shares. */ +export type OutcomeBuySellVolumeStats = { + __typename?: 'OutcomeBuySellVolumeStats'; + /** Volume in collateral token units. */ + ct: Scalars['String']['output']; + /** Volume in shares. */ + shares: Scalars['String']['output']; + /** Volume in USD. */ + usd: Scalars['String']['output']; +}; + +/** Volume breakdown including shares for an outcome. */ +export type OutcomeVolumeStats = { + __typename?: 'OutcomeVolumeStats'; + /** Volume in collateral token units. */ + ct: Scalars['String']['output']; + /** Volume in shares. */ + shares: Scalars['String']['output']; + /** Volume in USD. */ + usd: Scalars['String']['output']; +}; + /** Metadata for a token pair. */ export type Pair = { __typename?: 'Pair'; @@ -5573,6 +6206,8 @@ export type Pair = { token1: Scalars['String']['output']; /** Metadata for the second token in the pair. */ token1Data?: Maybe; + /** The virtual pooled amounts of each token in the pair. */ + virtualPooled?: Maybe; }; /** Input type of `PairChartInput`. */ @@ -5671,6 +6306,8 @@ export type PairFilterResult = { marketCap?: Maybe; /** Metadata for the pair. */ pair?: Maybe; + /** The reasons the token has been flagged as a potential scam. */ + potentialScamReasons?: Maybe>>; /** The token price in USD. */ price?: Maybe; /** The percent price change in the past hour. Decimal format. */ @@ -6423,76 +7060,3685 @@ export type PooledTokenValues = { token1?: Maybe; }; -/** Sort order for markets within a prediction event */ -export enum PredictionEventMarketSort { - /** No sorting - return markets in original order */ - None = 'NONE', - /** Smart sorting based on market label patterns (dates, prices, etc.) - default */ - Smart = 'SMART' +/** The reason a token has been flagged as a potential scam. */ +export enum PotentialScamReason { + /** The token has an abnormal buyer ratio. */ + AbnormalBuyerRatio = 'AbnormalBuyerRatio', + /** The token has experienced a significant drop in liquidity. */ + LiquidityRugPull = 'LiquidityRugPull', + /** The token does not meet the minimum liquidity threshold. */ + MinimumLiquidity = 'MinimumLiquidity', + /** The token has suspicious wallet activity. */ + SuspiciousWalletActivity = 'SuspiciousWalletActivity' } -/** Real-time or historical prices for a token. */ -export type Price = { - __typename?: 'Price'; - /** The contract address of the token. */ - address: Scalars['String']['output']; - /** The pool that emitted the swap generating this price */ - blockNumber?: Maybe; - /** - * Ratio of how confident we are in the price - * @deprecated Pricing no longer based on specific pools - */ - confidence?: Maybe; - /** The network ID the token is deployed on. */ - networkId: Scalars['Int']['output']; - /** - * The pool that emitted the swap generating this price - * @deprecated Pricing no longer based on specific pools - */ - poolAddress?: Maybe; - /** The token price in USD. */ - priceUsd: Scalars['Float']['output']; - /** The unix timestamp for the price. */ - timestamp?: Maybe; +/** A prediction category with optional nested subcategories. */ +export type PredictionCategory = { + __typename?: 'PredictionCategory'; + /** The display name. */ + name: Scalars['String']['output']; + /** The URL slug. */ + slug: Scalars['String']['output']; + /** Nested subcategories (2nd level). */ + subcategories?: Maybe>; }; -/** Webhook conditions for a price event. */ -export type PriceEventWebhookCondition = { - __typename?: 'PriceEventWebhookCondition'; - /** The liquidity condition (for the source pair) that must be met in order for the webhook to send. */ - liquidityUsd?: Maybe; - /** The network ID the webhook is listening on. */ - networkId: IntEqualsCondition; - /** The pair contract address the webhook is listening for. */ - pairAddress?: Maybe; - /** The price condition that must be met in order for the webhook to send. */ - priceUsd: ComparisonOperator; - /** The token contract address the webhook is listening for. */ - tokenAddress: StringEqualsCondition; - /** The volume condition (for the source pair) that must be met in order for the webhook to send. */ - volumeUsd?: Maybe; -}; +/** Collateral backing a prediction market, either on-chain token or fiat. */ +export type PredictionCollateral = PredictionCollateralFiat | PredictionCollateralToken; -/** Input conditions for a price event webhook. */ -export type PriceEventWebhookConditionInput = { - /** The liquidity conditions to listen for. */ - liquidityUsd?: InputMaybe; - /** The network ID to listen on. */ - networkId: IntEqualsConditionInput; - /** The contract address of the pair to listen for. */ - pairAddress?: InputMaybe; - /** The price conditions to listen for. */ - priceUsd: ComparisonOperatorInput; - /** The contract address of the token to listen for. */ - tokenAddress: StringEqualsConditionInput; - /** The volume conditions to listen for. */ - volumeUsd?: InputMaybe; +/** Fiat currency used as collateral for a prediction market. */ +export type PredictionCollateralFiat = { + __typename?: 'PredictionCollateralFiat'; + /** The token or currency symbol. */ + symbol: Scalars['String']['output']; }; -/** An Echelon Prime Pool. */ -export type PrimePool = { - __typename?: 'PrimePool'; - /** Values calculated by Defined using on-chain data. */ +/** On-chain token used as collateral for a prediction market. */ +export type PredictionCollateralToken = { + __typename?: 'PredictionCollateralToken'; + /** The network ID. */ + networkId: Scalars['Int']['output']; + /** The token or currency symbol. */ + symbol?: Maybe; + /** The token contract address. */ + tokenAddress: Scalars['String']['output']; +}; + +/** A prediction event containing one or more markets. */ +export type PredictionEvent = { + __typename?: 'PredictionEvent'; + /** Categories associated with this entity. */ + categories?: Maybe>; + /** The timestamp when this entity closes. */ + closesAt?: Maybe; + /** The creation timestamp. */ + createdAt: Scalars['Int']['output']; + /** Per-domain structured enrichment (sports league/teams/start times today; new domains added over time). Null when no domain-specific signal extracted. */ + enrichedMetadata?: Maybe; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** URL of the large image. */ + imageLargeUrl?: Maybe; + /** URL of the small image. */ + imageSmallUrl?: Maybe; + /** URL of the thumbnail image. */ + imageThumbUrl?: Maybe; + /** Associated market IDs. */ + marketIds?: Maybe>; + /** The network ID. */ + networkId?: Maybe; + /** The timestamp when this entity opens. */ + opensAt: Scalars['Int']['output']; + /** The prediction protocol. */ + protocol: PredictionProtocol; + /** The question or title. */ + question: Scalars['String']['output']; + /** The resolution details. */ + resolution?: Maybe; + /** The actual resolution timestamp. */ + resolvedAt?: Maybe; + /** The expected resolution timestamp. */ + resolvesAt?: Maybe; + /** Primary rules text. */ + rulesPrimary: Scalars['String']['output']; + /** Secondary rules text. */ + rulesSecondary?: Maybe; + /** The current status. */ + status: PredictionEventStatus; + /** Tags associated with this entity. */ + tags: Array; + /** The last update timestamp. */ + updatedAt: Scalars['Int']['output']; + /** The external URL. */ + url: Scalars['String']['output']; + /** The venue-specific event ID. */ + venueEventId: Scalars['String']['output']; + /** The venue-specific series ID. */ + venueSeriesId?: Maybe; +}; + +/** All-time aggregate stats for a prediction event. */ +export type PredictionEventAllTimeStats = { + __typename?: 'PredictionEventAllTimeStats'; + /** Venue-specific volume (optional). */ + venueVolume?: Maybe; + /** Total volume. */ + volume: CurrencyValuePair; +}; + +/** Bar data for a prediction event at a single point in time. */ +export type PredictionEventBar = { + __typename?: 'PredictionEventBar'; + /** Buy volume in collateral token units. */ + buyVolumeCollateralToken?: Maybe; + /** Buy volume in USD. Null if protocol doesn't provide directional data. */ + buyVolumeUsd?: Maybe; + /** The last event timestamp. */ + lastEventTimestamp: Scalars['Int']['output']; + /** Liquidity OHLC in collateral token (nullable for old aggregates) */ + liquidityCollateralToken?: Maybe; + /** Liquidity in USD. Null if protocol doesn't provide liquidity data. */ + liquidityUsd?: Maybe; + /** Open interest OHLC in collateral token (nullable for old aggregates) */ + openInterestCollateralToken?: Maybe; + /** Open interest in USD. Null if protocol doesn't provide open interest data. */ + openInterestUsd?: Maybe; + /** Sell volume in collateral token units. */ + sellVolumeCollateralToken?: Maybe; + /** Sell volume in USD. Null if protocol doesn't provide directional data. */ + sellVolumeUsd?: Maybe; + /** The unix timestamp for this bar. */ + t: Scalars['Int']['output']; + /** Total volume in collateral token (nullable for old aggregates) */ + totalVolumeCollateralToken?: Maybe; + /** The total volume usd. */ + totalVolumeUsd: Scalars['String']['output']; + /** The number of trades. */ + trades: Scalars['Int']['output']; + /** The number of unique traders. Null if protocol doesn't track unique traders. */ + uniqueTraders?: Maybe; + /** Venue volume in collateral token (nullable for old aggregates) */ + venueVolumeCollateralToken?: Maybe; + /** The venue volume usd. Null if protocol doesn't provide venue volume. */ + venueVolumeUsd?: Maybe; + /** Volume in collateral token units. */ + volumeCollateralToken?: Maybe; + /** Volume in USD. */ + volumeUsd: Scalars['String']['output']; +}; + +/** OHLC price data for a prediction event bar. */ +export type PredictionEventBarOhlc = { + __typename?: 'PredictionEventBarOhlc'; + /** The close value. */ + c: Scalars['String']['output']; + /** The high value. */ + h: Scalars['String']['output']; + /** The low value. */ + l: Scalars['String']['output']; + /** The open value. */ + o: Scalars['String']['output']; +}; + +/** Input type of `predictionEventBars`. */ +export type PredictionEventBarsInput = { + /** Number of bars to return counting back from `to`. */ + countback?: InputMaybe; + /** The ID of the prediction event. */ + eventId: Scalars['String']['input']; + /** The start timestamp (unix seconds). */ + from: Scalars['Int']['input']; + /** Whether to omit bars with no activity. */ + removeEmptyBars?: InputMaybe; + /** The resolution details. */ + resolution: PredictionEventBarsResolution; + /** The end timestamp (unix seconds). */ + to: Scalars['Int']['input']; +}; + +/** The time resolution for prediction event bar data. */ +export enum PredictionEventBarsResolution { + Day1 = 'day1', + Hour1 = 'hour1', + Hour4 = 'hour4', + Hour12 = 'hour12', + Min1 = 'min1', + Min5 = 'min5', + Min15 = 'min15', + Min30 = 'min30', + Week1 = 'week1' +} + +/** Response returned by `predictionEventBars`. */ +export type PredictionEventBarsResponse = { + __typename?: 'PredictionEventBarsResponse'; + /** The bar data. */ + bars: Array; + /** The ID of the prediction event. */ + eventId: Scalars['String']['output']; + /** The prediction event. */ + predictionEvent?: Maybe; + /** The prediction markets. */ + predictionMarkets: Array; +}; + +/** Per-domain enrichment attached to a prediction event. Discriminated by `metadataType`; the corresponding sub-block (e.g. `sports`) is populated. Null when no domain-specific signal can be extracted. */ +export type PredictionEventEnrichedMetadata = { + __typename?: 'PredictionEventEnrichedMetadata'; + /** Discriminator naming which sub-block carries data. */ + metadataType: PredictionMetadataType; + /** Populated when `metadataType = SPORTS`. */ + sports?: Maybe; +}; + +/** Response returned by `filterPredictionEvents`. */ +export type PredictionEventFilterConnection = { + __typename?: 'PredictionEventFilterConnection'; + /** Total number of matching results. */ + count: Scalars['Int']['output']; + /** The current page number. */ + page: Scalars['Int']['output']; + /** The list of results. */ + results: Array; +}; + +/** A prediction event matching a set of filter parameters. */ +export type PredictionEventFilterResult = { + __typename?: 'PredictionEventFilterResult'; + /** The age. */ + age?: Maybe; + /** Categories associated with this entity. */ + categories: Array; + /** The timestamp when this entity closes. */ + closesAt?: Maybe; + /** The creation timestamp. */ + createdAt: Scalars['Int']['output']; + /** Simplified event data from search index. Use predictionEvent for full event details. */ + event: SearchPredictionEvent; + /** The event shape. */ + eventShape?: Maybe; + /** The expected lifespan. */ + expectedLifespan?: Maybe; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** The timestamp of the last transaction. */ + lastTransactionAt: Scalars['Int']['output']; + /** Liquidity in collateral token units. */ + liquidityCT?: Maybe; + /** The percentage change. */ + liquidityChange1h?: Maybe; + /** The percentage change. */ + liquidityChange1w?: Maybe; + /** The percentage change. */ + liquidityChange4h?: Maybe; + /** The percentage change. */ + liquidityChange5m?: Maybe; + /** The percentage change. */ + liquidityChange12h?: Maybe; + /** The percentage change. */ + liquidityChange24h?: Maybe; + /** Liquidity in USD. */ + liquidityUsd?: Maybe; + /** Data for marketCount. */ + marketCount: Scalars['Int']['output']; + /** Data for markets. */ + markets: Array; + /** Open interest in collateral token units. */ + openInterestCT?: Maybe; + /** The percentage change. */ + openInterestChange1h?: Maybe; + /** The percentage change. */ + openInterestChange1w?: Maybe; + /** The percentage change. */ + openInterestChange4h?: Maybe; + /** The percentage change. */ + openInterestChange5m?: Maybe; + /** The percentage change. */ + openInterestChange12h?: Maybe; + /** The percentage change. */ + openInterestChange24h?: Maybe; + /** Open interest in USD. */ + openInterestUsd?: Maybe; + /** The timestamp when this entity opens. */ + opensAt: Scalars['Int']['output']; + /** Full prediction event loaded from database. May be null if event no longer exists. */ + predictionEvent?: Maybe; + /** The prediction protocol. */ + protocol: PredictionProtocol; + /** The related event ids. */ + relatedEventIds: Array; + /** The relevance score. */ + relevanceScore1h?: Maybe; + /** The relevance score. */ + relevanceScore1w?: Maybe; + /** The relevance score. */ + relevanceScore4h?: Maybe; + /** The relevance score. */ + relevanceScore5m?: Maybe; + /** The relevance score. */ + relevanceScore12h?: Maybe; + /** The relevance score. */ + relevanceScore24h?: Maybe; + /** The resolution source. */ + resolutionSource?: Maybe; + /** The actual resolution timestamp. */ + resolvedAt?: Maybe; + /** The expected resolution timestamp. */ + resolvesAt?: Maybe; + /** The current status. */ + status: PredictionEventStatus; + /** The unix timestamp. */ + timestamp: Scalars['Int']['output']; + /** The top markets for this event. */ + topMarkets: Array; + /** The trades1h. */ + trades1h?: Maybe; + /** The trades1w. */ + trades1w?: Maybe; + /** The trades4h. */ + trades4h?: Maybe; + /** The trades5m. */ + trades5m?: Maybe; + /** The trades12h. */ + trades12h?: Maybe; + /** The trades24h. */ + trades24h?: Maybe; + /** The percentage change. */ + tradesChange1h?: Maybe; + /** The percentage change. */ + tradesChange1w?: Maybe; + /** The percentage change. */ + tradesChange4h?: Maybe; + /** The percentage change. */ + tradesChange5m?: Maybe; + /** The percentage change. */ + tradesChange12h?: Maybe; + /** The percentage change. */ + tradesChange24h?: Maybe; + /** The trending score. */ + trendingScore1h?: Maybe; + /** The trending score. */ + trendingScore1w?: Maybe; + /** The trending score. */ + trendingScore4h?: Maybe; + /** The trending score. */ + trendingScore5m?: Maybe; + /** The trending score. */ + trendingScore12h?: Maybe; + /** The trending score. */ + trendingScore24h?: Maybe; + /** The unique traders1h. */ + uniqueTraders1h?: Maybe; + /** The unique traders1w. */ + uniqueTraders1w?: Maybe; + /** The unique traders4h. */ + uniqueTraders4h?: Maybe; + /** The unique traders5m. */ + uniqueTraders5m?: Maybe; + /** The unique traders12h. */ + uniqueTraders12h?: Maybe; + /** The unique traders24h. */ + uniqueTraders24h?: Maybe; + /** The percentage change. */ + uniqueTradersChange1h?: Maybe; + /** The percentage change. */ + uniqueTradersChange1w?: Maybe; + /** The percentage change. */ + uniqueTradersChange4h?: Maybe; + /** The percentage change. */ + uniqueTradersChange5m?: Maybe; + /** The percentage change. */ + uniqueTradersChange12h?: Maybe; + /** The percentage change. */ + uniqueTradersChange24h?: Maybe; + /** The venue volume ct. */ + venueVolumeCT?: Maybe; + /** The venue volume usd. */ + venueVolumeUsd?: Maybe; + /** Volume in collateral token units. */ + volumeCTAll?: Maybe; + /** The percentage change. */ + volumeChange1h?: Maybe; + /** The percentage change. */ + volumeChange1w?: Maybe; + /** The percentage change. */ + volumeChange4h?: Maybe; + /** The percentage change. */ + volumeChange5m?: Maybe; + /** The percentage change. */ + volumeChange12h?: Maybe; + /** The percentage change. */ + volumeChange24h?: Maybe; + /** Volume in USD. */ + volumeUsd1h?: Maybe; + /** Volume in USD. */ + volumeUsd1w?: Maybe; + /** Volume in USD. */ + volumeUsd4h?: Maybe; + /** Volume in USD. */ + volumeUsd5m?: Maybe; + /** Volume in USD. */ + volumeUsd12h?: Maybe; + /** Volume in USD. */ + volumeUsd24h?: Maybe; + /** Volume in USD. */ + volumeUsdAll?: Maybe; +}; + +/** Summary market data within a prediction event filter result. */ +export type PredictionEventFilterResultMarket = { + __typename?: 'PredictionEventFilterResultMarket'; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** The display label. */ + label?: Maybe; +}; + +/** Filters for prediction events. */ +export type PredictionEventFilters = { + /** The age. */ + age?: InputMaybe; + /** Categories associated with this entity. Mutually exclusive with excludeCategories and hasCategories. */ + categories?: InputMaybe>; + /** The timestamp when this entity closes. */ + closesAt?: InputMaybe; + /** The creation timestamp. */ + createdAt?: InputMaybe; + /** Exclude events with these categories. Mutually exclusive with categories and hasCategories. */ + excludeCategories?: InputMaybe>; + /** The expected lifespan. */ + expectedLifespan?: InputMaybe; + /** Filter by whether the event has any categories. Mutually exclusive with categories and excludeCategories. */ + hasCategories?: InputMaybe; + /** The timestamp of the last transaction. */ + lastTransactionAt?: InputMaybe; + /** Liquidity in collateral token units. */ + liquidityCT?: InputMaybe; + /** The percentage change. */ + liquidityChange1h?: InputMaybe; + /** The percentage change. */ + liquidityChange1w?: InputMaybe; + /** The percentage change. */ + liquidityChange4h?: InputMaybe; + /** The percentage change. */ + liquidityChange5m?: InputMaybe; + /** The percentage change. */ + liquidityChange12h?: InputMaybe; + /** The percentage change. */ + liquidityChange24h?: InputMaybe; + /** Liquidity in USD. */ + liquidityUsd?: InputMaybe; + /** Data for marketCount. */ + marketCount?: InputMaybe; + /** Open interest in collateral token units. */ + openInterestCT?: InputMaybe; + /** The percentage change. */ + openInterestChange1h?: InputMaybe; + /** The percentage change. */ + openInterestChange1w?: InputMaybe; + /** The percentage change. */ + openInterestChange4h?: InputMaybe; + /** The percentage change. */ + openInterestChange5m?: InputMaybe; + /** The percentage change. */ + openInterestChange12h?: InputMaybe; + /** The percentage change. */ + openInterestChange24h?: InputMaybe; + /** Open interest in USD. */ + openInterestUsd?: InputMaybe; + /** The timestamp when this entity opens. */ + opensAt?: InputMaybe; + /** The prediction protocol. */ + protocol?: InputMaybe>; + /** The relevance score. */ + relevanceScore1h?: InputMaybe; + /** The relevance score. */ + relevanceScore1w?: InputMaybe; + /** The relevance score. */ + relevanceScore4h?: InputMaybe; + /** The relevance score. */ + relevanceScore5m?: InputMaybe; + /** The relevance score. */ + relevanceScore12h?: InputMaybe; + /** The relevance score. */ + relevanceScore24h?: InputMaybe; + /** The resolution source. */ + resolutionSource?: InputMaybe>; + /** The actual resolution timestamp. */ + resolvedAt?: InputMaybe; + /** The expected resolution timestamp. */ + resolvesAt?: InputMaybe; + /** The current status. */ + status?: InputMaybe>; + /** The unix timestamp. */ + timestamp?: InputMaybe; + /** The trades1h. */ + trades1h?: InputMaybe; + /** The trades1w. */ + trades1w?: InputMaybe; + /** The trades4h. */ + trades4h?: InputMaybe; + /** The trades5m. */ + trades5m?: InputMaybe; + /** The trades12h. */ + trades12h?: InputMaybe; + /** The trades24h. */ + trades24h?: InputMaybe; + /** The percentage change. */ + tradesChange1h?: InputMaybe; + /** The percentage change. */ + tradesChange1w?: InputMaybe; + /** The percentage change. */ + tradesChange4h?: InputMaybe; + /** The percentage change. */ + tradesChange5m?: InputMaybe; + /** The percentage change. */ + tradesChange12h?: InputMaybe; + /** The percentage change. */ + tradesChange24h?: InputMaybe; + /** The trending score. */ + trendingScore1h?: InputMaybe; + /** The trending score. */ + trendingScore1w?: InputMaybe; + /** The trending score. */ + trendingScore4h?: InputMaybe; + /** The trending score. */ + trendingScore5m?: InputMaybe; + /** The trending score. */ + trendingScore12h?: InputMaybe; + /** The trending score. */ + trendingScore24h?: InputMaybe; + /** The unique traders1h. */ + uniqueTraders1h?: InputMaybe; + /** The unique traders1w. */ + uniqueTraders1w?: InputMaybe; + /** The unique traders4h. */ + uniqueTraders4h?: InputMaybe; + /** The unique traders5m. */ + uniqueTraders5m?: InputMaybe; + /** The unique traders12h. */ + uniqueTraders12h?: InputMaybe; + /** The unique traders24h. */ + uniqueTraders24h?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange1h?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange1w?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange4h?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange5m?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange12h?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange24h?: InputMaybe; + /** The venue-specific series ID. */ + venueSeriesId?: InputMaybe>; + /** The venue volume ct. */ + venueVolumeCT?: InputMaybe; + /** The venue volume usd. */ + venueVolumeUsd?: InputMaybe; + /** Volume in collateral token units. */ + volumeCTAll?: InputMaybe; + /** The percentage change. */ + volumeChange1h?: InputMaybe; + /** The percentage change. */ + volumeChange1w?: InputMaybe; + /** The percentage change. */ + volumeChange4h?: InputMaybe; + /** The percentage change. */ + volumeChange5m?: InputMaybe; + /** The percentage change. */ + volumeChange12h?: InputMaybe; + /** The percentage change. */ + volumeChange24h?: InputMaybe; + /** Volume in USD. */ + volumeUsd1h?: InputMaybe; + /** Volume in USD. */ + volumeUsd1w?: InputMaybe; + /** Volume in USD. */ + volumeUsd4h?: InputMaybe; + /** Volume in USD. */ + volumeUsd5m?: InputMaybe; + /** Volume in USD. */ + volumeUsd12h?: InputMaybe; + /** Volume in USD. */ + volumeUsd24h?: InputMaybe; + /** Volume in USD. */ + volumeUsdAll?: InputMaybe; +}; + +/** Deprecated. Sort order for markets within a prediction event. This no longer affects market ordering. */ +export enum PredictionEventMarketSort { + /** + * Deprecated. No longer affects market ordering. + * @deprecated No longer affects market ordering. + */ + None = 'NONE', + /** + * Deprecated. No longer affects market ordering. + * @deprecated No longer affects market ordering. + */ + Smart = 'SMART' +} + +/** A ranking to apply when sorting prediction events. */ +export type PredictionEventRanking = { + /** The attribute to rank by. */ + attribute: PredictionEventRankingAttribute; + /** The sort direction. */ + direction?: InputMaybe; +}; + +/** The attribute used to rank prediction events. */ +export enum PredictionEventRankingAttribute { + Age = 'age', + ClosesAt = 'closesAt', + CreatedAt = 'createdAt', + ExpectedLifespan = 'expectedLifespan', + LastTransactionAt = 'lastTransactionAt', + LiquidityCt = 'liquidityCT', + LiquidityChange1h = 'liquidityChange1h', + LiquidityChange1w = 'liquidityChange1w', + LiquidityChange4h = 'liquidityChange4h', + LiquidityChange5m = 'liquidityChange5m', + LiquidityChange12h = 'liquidityChange12h', + LiquidityChange24h = 'liquidityChange24h', + LiquidityUsd = 'liquidityUsd', + MarketCount = 'marketCount', + OpenInterestCt = 'openInterestCT', + OpenInterestChange1h = 'openInterestChange1h', + OpenInterestChange1w = 'openInterestChange1w', + OpenInterestChange4h = 'openInterestChange4h', + OpenInterestChange5m = 'openInterestChange5m', + OpenInterestChange12h = 'openInterestChange12h', + OpenInterestChange24h = 'openInterestChange24h', + OpenInterestUsd = 'openInterestUsd', + OpensAt = 'opensAt', + /** Score from phrase matching (for search queries) */ + PhraseScore = 'phraseScore', + RelevanceScore1h = 'relevanceScore1h', + RelevanceScore1w = 'relevanceScore1w', + RelevanceScore4h = 'relevanceScore4h', + RelevanceScore5m = 'relevanceScore5m', + RelevanceScore12h = 'relevanceScore12h', + RelevanceScore24h = 'relevanceScore24h', + ResolvedAt = 'resolvedAt', + ResolvesAt = 'resolvesAt', + Timestamp = 'timestamp', + Trades1h = 'trades1h', + Trades1w = 'trades1w', + Trades4h = 'trades4h', + Trades5m = 'trades5m', + Trades12h = 'trades12h', + Trades24h = 'trades24h', + TradesChange1h = 'tradesChange1h', + TradesChange1w = 'tradesChange1w', + TradesChange4h = 'tradesChange4h', + TradesChange5m = 'tradesChange5m', + TradesChange12h = 'tradesChange12h', + TradesChange24h = 'tradesChange24h', + TrendingScore1h = 'trendingScore1h', + TrendingScore1w = 'trendingScore1w', + TrendingScore4h = 'trendingScore4h', + TrendingScore5m = 'trendingScore5m', + TrendingScore12h = 'trendingScore12h', + TrendingScore24h = 'trendingScore24h', + UniqueTraders1h = 'uniqueTraders1h', + UniqueTraders1w = 'uniqueTraders1w', + UniqueTraders4h = 'uniqueTraders4h', + UniqueTraders5m = 'uniqueTraders5m', + UniqueTraders12h = 'uniqueTraders12h', + UniqueTraders24h = 'uniqueTraders24h', + UniqueTradersChange1h = 'uniqueTradersChange1h', + UniqueTradersChange1w = 'uniqueTradersChange1w', + UniqueTradersChange4h = 'uniqueTradersChange4h', + UniqueTradersChange5m = 'uniqueTradersChange5m', + UniqueTradersChange12h = 'uniqueTradersChange12h', + UniqueTradersChange24h = 'uniqueTradersChange24h', + VenueVolumeCt = 'venueVolumeCT', + VenueVolumeUsd = 'venueVolumeUsd', + VolumeCtAll = 'volumeCTAll', + VolumeChange1h = 'volumeChange1h', + VolumeChange1w = 'volumeChange1w', + VolumeChange4h = 'volumeChange4h', + VolumeChange5m = 'volumeChange5m', + VolumeChange12h = 'volumeChange12h', + VolumeChange24h = 'volumeChange24h', + VolumeUsd1h = 'volumeUsd1h', + VolumeUsd1w = 'volumeUsd1w', + VolumeUsd4h = 'volumeUsd4h', + VolumeUsd5m = 'volumeUsd5m', + VolumeUsd12h = 'volumeUsd12h', + VolumeUsd24h = 'volumeUsd24h', + VolumeUsdAll = 'volumeUsdAll' +} + +/** Multi-resolution bar data for a prediction event. */ +export type PredictionEventResolutionBarData = { + __typename?: 'PredictionEventResolutionBarData'; + /** Data for the 1-day resolution. */ + day1?: Maybe; + /** Data for the 1-hour resolution. */ + hour1?: Maybe; + /** Data for the 4-hour resolution. */ + hour4?: Maybe; + /** Data for the 12-hour resolution. */ + hour12?: Maybe; + /** Data for the 1-minute resolution. */ + min1?: Maybe; + /** Data for the 5-minute resolution. */ + min5?: Maybe; + /** Data for the 15-minute resolution. */ + min15?: Maybe; + /** Data for the 30-minute resolution. */ + min30?: Maybe; + /** Data for the 1-week resolution. */ + week1?: Maybe; +}; + +/** Capped event-shape taxonomy. One per event. */ +export enum PredictionEventShape { + /** Awards show / cultural competition outright field — typically one Yes/No market per nominee/entrant (e.g. "Eurovision Winner 2026", Oscars Best Picture, Grammy of the Year). */ + AwardsShow = 'AWARDS_SHOW', + /** Single binary yes/no event. */ + Binary = 'BINARY', + /** Date-bucket ladder (e.g. "Before Jan 21, 2029"). */ + Date = 'DATE', + /** Election / nomination / primary outright field — typically one Yes/No market per candidate (e.g. "Democratic Presidential Nominee 2028"). */ + Election = 'ELECTION', + /** Esports match (e.g. "Dota 2: Aurora vs Heroic", "CS2: FaZe vs Navi"). Similar market roles to traditional sports (moneyline, totals, props) but distinct event category. */ + EsportsMatch = 'ESPORTS_MATCH', + /** FOMC / central-bank rate-decision event. */ + FedDecision = 'FED_DECISION', + /** Multi-select / pick-N field where the entrant set is a list of distinct items (policy items, demands, topics) rather than candidates, dates, or numeric buckets (e.g. "What Iranian demands will Trump agree to?", "What will the bill include?"). */ + MultiSelect = 'MULTI_SELECT', + /** Fallback. */ + Other = 'OTHER', + /** Numeric threshold ladder for a price/value (e.g. "BTC > $X"). */ + PriceThreshold = 'PRICE_THRESHOLD', + /** Season/tournament-level championship (e.g. "Pro Basketball Champion?", Super Bowl winner). */ + SportsChampionship = 'SPORTS_CHAMPIONSHIP', + /** Single team-vs-team match (e.g. "Lakers vs Celtics"). */ + SportsMatch = 'SPORTS_MATCH', + /** Best-of-N series within a tournament (e.g. NBA Finals series, MLB postseason series). */ + SportsSeries = 'SPORTS_SERIES', + /** Weather or climate measure ladder (e.g. daily high temperature in °C, one Yes/No market per bucket or tail). */ + Weather = 'WEATHER' +} + +/** The lifecycle status of a prediction event. */ +export enum PredictionEventStatus { + Cancelled = 'CANCELLED', + Open = 'OPEN', + Pending = 'PENDING', + Resolved = 'RESOLVED', + Suspended = 'SUSPENDED' +} + +/** A top market for a prediction event. */ +export type PredictionEventTopMarket = { + __typename?: 'PredictionEventTopMarket'; + /** ISO 3166-1 alpha-2 country code when the row is a country entrant (Eurovision, World Cup, Olympics, etc.). Null otherwise. Mirrors `classification.entrant.countryCode` from the per-market classification metadata, hoisted onto the top-market row so card clients don't have to issue a follow-up query just to render a flag. */ + countryCode?: Maybe; + /** The label. */ + label: Scalars['String']['output']; + /** The unique identifier of the market. */ + marketId: Scalars['String']['output']; + /** The ask CT of the outcome 0. */ + outcome0AskCT: Scalars['String']['output']; + /** The ask USD of the outcome 0. */ + outcome0AskUSD: Scalars['String']['output']; + /** The bid CT of the outcome 0. */ + outcome0BidCT: Scalars['String']['output']; + /** The bid USD of the outcome 0. */ + outcome0BidUSD: Scalars['String']['output']; + /** The label of the outcome 0. */ + outcome0Label: Scalars['String']['output']; + /** The ask CT of the outcome 1. */ + outcome1AskCT: Scalars['String']['output']; + /** The ask USD of the outcome 1. */ + outcome1AskUSD: Scalars['String']['output']; + /** The bid CT of the outcome 1. */ + outcome1BidCT: Scalars['String']['output']; + /** The bid USD of the outcome 1. */ + outcome1BidUSD: Scalars['String']['output']; + /** The label of the outcome 1. */ + outcome1Label: Scalars['String']['output']; + /** The role of the market. */ + role?: Maybe; + /** The suggested label of the market. */ + suggestedLabel?: Maybe; + /** thumbUrl of the market. */ + thumbUrl?: Maybe; + /** The volume CT of the market in the last 1 day. */ + volumeCT1d: Scalars['String']['output']; + /** The volume CT of the market in the last 1 week. */ + volumeCT1w: Scalars['String']['output']; + /** The volume CT of the market in all time. */ + volumeCTAll: Scalars['String']['output']; + /** The volume USD of the market in the last 1 day. */ + volumeUSD1d: Scalars['String']['output']; + /** The volume USD of the market in the last 1 week. */ + volumeUSD1w: Scalars['String']['output']; + /** The volume USD of the market in all time. */ + volumeUSDAll: Scalars['String']['output']; +}; + +/** Input type of `predictionEventTopMarketsBars`. */ +export type PredictionEventTopMarketsBarsInput = { + /** Number of bars to fetch backwards from 'to' (alternative to 'from') */ + countback?: InputMaybe; + /** The event ID to fetch top markets for */ + eventId: Scalars['String']['input']; + /** Unix timestamp (seconds) for the start of the range */ + from: Scalars['Int']['input']; + /** Maximum number of markets to return (default 5, max 10) */ + limit?: InputMaybe; + /** Explicit list of market IDs to fetch (overrides ranking if provided) */ + marketIds?: InputMaybe>; + /** Market-level attribute to rank by (use this OR rankByOutcome + rankByOutcomeAttribute) */ + rankBy?: InputMaybe; + /** Which outcome to rank by (use with rankByOutcomeAttribute) */ + rankByOutcome?: InputMaybe; + /** Outcome-level attribute to rank by (requires rankByOutcome) */ + rankByOutcomeAttribute?: InputMaybe; + /** Direction to rank (DESC = highest first) */ + rankDirection?: InputMaybe; + /** Whether to remove empty bars from the response */ + removeEmptyBars?: InputMaybe; + /** Resolution for the bars (e.g., min1, min5, hour1, day1) */ + resolution: PredictionMarketBarsResolution; + /** Unix timestamp (seconds) for the end of the range */ + to: Scalars['Int']['input']; + /** Use pre-computed leaderboard ranking (overrides rankBy options when true) */ + useLeaderboard?: InputMaybe; +}; + +/** Response returned by `predictionEventTopMarketsBars`. */ +export type PredictionEventTopMarketsBarsResponse = { + __typename?: 'PredictionEventTopMarketsBarsResponse'; + /** The ID of the prediction event. */ + eventId: Scalars['String']['output']; + /** Array of market bars (max 10) */ + marketBars: Array; + /** The parent prediction event */ + predictionEvent?: Maybe; +}; + +/** Trending, relevance, and competitive scores for an event window. */ +export type PredictionEventWindowScores = { + __typename?: 'PredictionEventWindowScores'; + /** The competitive score. */ + competitive: Scalars['Float']['output']; + /** The relevance score. */ + relevance: Scalars['Float']['output']; + /** The trending score. */ + trending: Scalars['Float']['output']; +}; + +/** Lifecycle metadata for a prediction entity including status and timing. */ +export type PredictionLifecycleStats = { + __typename?: 'PredictionLifecycleStats'; + /** The age seconds. */ + ageSeconds: Scalars['Int']['output']; + /** The expected lifespan seconds. */ + expectedLifespanSeconds?: Maybe; + /** The is resolved. */ + isResolved: Scalars['Boolean']['output']; + /** The time to resolution seconds. */ + timeToResolutionSeconds?: Maybe; + /** The ID of the winning outcome. */ + winningOutcomeId?: Maybe; +}; + +/** A prediction market with outcomes, pricing, and metadata. */ +export type PredictionMarket = { + __typename?: 'PredictionMarket'; + /** Categories associated with this entity. */ + categories?: Maybe>; + /** The timestamp when this entity closes. */ + closesAt?: Maybe; + /** The creation timestamp. */ + createdAt?: Maybe; + /** Per-domain structured enrichment (sports market type/teams/start times today). Null when no domain-specific signal extracted. */ + enrichedMetadata?: Maybe; + /** The ID of the prediction event. */ + eventId?: Maybe; + /** The parent event label. */ + eventLabel?: Maybe; + /** The exchange contract address. */ + exchangeAddress?: Maybe; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** URL of the large image. */ + imageLargeUrl?: Maybe; + /** URL of the small image. */ + imageSmallUrl?: Maybe; + /** URL of the thumbnail image. */ + imageThumbUrl?: Maybe; + /** The display label. */ + label?: Maybe; + /** The network ID. */ + networkId?: Maybe; + /** The last observation timestamp. */ + observedAt: Scalars['Int']['output']; + /** The timestamp when this entity opens. */ + opensAt?: Maybe; + /** Internal outcome IDs. */ + outcomeIds: Array; + /** Labels for each outcome. */ + outcomeLabels?: Maybe>; + /** The prediction protocol. */ + protocol: PredictionProtocol; + /** The question or title. */ + question?: Maybe; + /** The resolution details. */ + resolution?: Maybe; + /** The actual resolution timestamp. */ + resolvedAt?: Maybe; + /** The expected resolution timestamp. */ + resolvesAt?: Maybe; + /** Primary rules text. */ + rules?: Maybe; + /** Secondary rules text. */ + rules2?: Maybe; + /** A clean, UI-ready label derived from `label`/`question` with the parent event name stripped (and Kalshi `Yes:`/`No:` prefixes unwrapped). Falls back to `question` when `label` is missing or `unknown`. */ + suggestedLabel?: Maybe; + /** The last update timestamp. */ + updatedAt?: Maybe; + /** The venue-specific event ID. */ + venueEventId?: Maybe; + /** The venue-specific market ID. */ + venueMarketId: Scalars['String']['output']; + /** The venue-specific market slug. */ + venueMarketSlug?: Maybe; + /** Venue-specific outcome IDs. */ + venueOutcomeIds: Array; + /** The ID of the winning outcome. */ + winningOutcomeId?: Maybe; +}; + +/** All-time aggregate stats for a prediction market. */ +export type PredictionMarketAllTimeStats = { + __typename?: 'PredictionMarketAllTimeStats'; + /** Venue-specific volume (optional). */ + venueVolume?: Maybe; + /** Total volume. */ + volume: CurrencyValuePair; +}; + +/** Bar data for a prediction market at a single point in time. */ +export type PredictionMarketBar = { + __typename?: 'PredictionMarketBar'; + /** The all time venue volume collateral token (reported by venue). */ + allTimeVenueVolumeCollateralToken?: Maybe; + /** The all time venue volume usd (reported by venue). */ + allTimeVenueVolumeUsd?: Maybe; + /** The all time volume collateral token (from on-chain trades). */ + allTimeVolumeCollateralToken?: Maybe; + /** The all time volume usd (from on-chain trades). */ + allTimeVolumeUsd?: Maybe; + /** The last event timestamp. */ + lastEventTimestamp?: Maybe; + /** Open interest in USD. */ + openInterestUsd?: Maybe; + /** Outcome 0 data. */ + outcome0?: Maybe; + /** Outcome 1 data. */ + outcome1?: Maybe; + /** The unix timestamp for this bar. */ + t: Scalars['Int']['output']; + /** The number of trades. */ + trades?: Maybe; + /** The number of unique traders. */ + uniqueTraders?: Maybe; + /** Volume in collateral token units. */ + volumeCollateralToken?: Maybe; + /** Volume in shares. */ + volumeShares?: Maybe; + /** Volume in USD. */ + volumeUsd?: Maybe; +}; + +/** OHLC price data for a prediction market bar. */ +export type PredictionMarketBarOhlc = { + __typename?: 'PredictionMarketBarOhlc'; + /** The close value. */ + c: Scalars['String']['output']; + /** The high value. */ + h: Scalars['String']['output']; + /** The low value. */ + l: Scalars['String']['output']; + /** The open value. */ + o: Scalars['String']['output']; +}; + +/** Input type of `predictionMarketBars`. */ +export type PredictionMarketBarsInput = { + /** Number of bars to return counting back from `to`. */ + countback?: InputMaybe; + /** The start timestamp (unix seconds). */ + from: Scalars['Int']['input']; + /** The ID of the prediction market. */ + marketId: Scalars['String']['input']; + /** Whether to omit bars with no activity. */ + removeEmptyBars?: InputMaybe; + /** The resolution details. */ + resolution: PredictionMarketBarsResolution; + /** The end timestamp (unix seconds). */ + to: Scalars['Int']['input']; +}; + +/** The time resolution for prediction market bar data. */ +export enum PredictionMarketBarsResolution { + Day1 = 'day1', + Hour1 = 'hour1', + Hour4 = 'hour4', + Hour12 = 'hour12', + Min1 = 'min1', + Min5 = 'min5', + Min15 = 'min15', + Min30 = 'min30', + Week1 = 'week1' +} + +/** Response returned by `predictionMarketBars`. */ +export type PredictionMarketBarsResponse = { + __typename?: 'PredictionMarketBarsResponse'; + /** The bar data. */ + bars: Array; + /** The ID of the prediction market. */ + marketId: Scalars['String']['output']; + /** The prediction event. */ + predictionEvent: PredictionEvent; + /** The prediction market. */ + predictionMarket: PredictionMarket; +}; + +/** Structured per-market classification metadata. Replaces the legacy flat fields (`marketSubtype`, `marketRole`, `displayOrder`, `suggestedOrder`) with discriminated, typed sub-objects so clients don't have to re-parse subtype slugs. */ +export type PredictionMarketClassification = { + __typename?: 'PredictionMarketClassification'; + /** Populated when `role = DATE_BUCKET`. Carries the parsed timestamp(s) and operator (BEFORE / AFTER / ON / BETWEEN). */ + dateBucket?: Maybe; + /** Populated when `role = ENTRANT`. Identifies the kind of entrant (person, team, country, ...) and provides type-specific hints (e.g. ISO 3166-1 alpha-2 country code). */ + entrant?: Maybe; + /** Original subtype slug emitted by the classifier (e.g. "first_half_spread", "player_points"). Provided so clients can forward-ship support for new subtypes before this schema gains structured fields for them. */ + rawSubtype?: Maybe; + /** Per-market role within the event (same value as the legacy `marketRole`). */ + role: PredictionMarketRole; + /** Sub-event period (set, half, game, etc.) and/or stat (points, rebounds, ...). Always present; `type = NONE` for non-sports markets and whole-match sports markets. The `groupingKey` field encodes the documented "stat wins over period" precedence so clients don't have to. */ + segment: PredictionMarketSegment; + /** Position of this market within the event's display list (lower = show first). Folds in ladder ordering for `THRESHOLD_BUCKET` / `DATE_BUCKET` events; equivalent to `suggestedOrder ?? displayOrder` on the legacy fields. */ + sortKey?: Maybe; + /** Populated when `role = THRESHOLD_BUCKET`. Carries the parsed numeric rung value, comparison operator, and metric kind (price, temperature, tweets, ...). Saves clients from re-parsing the label. */ + thresholdBucket?: Maybe; +}; + +/** Date-bucket metadata for DATE_BUCKET-role markets. */ +export type PredictionMarketDateBucket = { + __typename?: 'PredictionMarketDateBucket'; + /** Lower bound timestamp (seconds) for BETWEEN buckets. */ + lowerTimestamp?: Maybe; + /** How the rung relates to its date bound(s). */ + operator: PredictionMarketDateOperator; + /** Single unix timestamp (seconds) for BEFORE / AFTER / ON. */ + unixTimestamp?: Maybe; + /** Upper bound timestamp (seconds) for BETWEEN buckets. */ + upperTimestamp?: Maybe; +}; + +/** Comparison operator for a date rung. */ +export enum PredictionMarketDateOperator { + After = 'AFTER', + Before = 'BEFORE', + Between = 'BETWEEN', + On = 'ON' +} + +/** Per-domain enrichment attached to a prediction market. Discriminated by `metadataType`; the corresponding sub-block (e.g. `sports`) is populated. */ +export type PredictionMarketEnrichedMetadata = { + __typename?: 'PredictionMarketEnrichedMetadata'; + /** Discriminator naming which sub-block carries data. */ + metadataType: PredictionMetadataType; + /** Populated when `metadataType = SPORTS`. */ + sports?: Maybe; +}; + +/** Entrant metadata for ENTRANT-role markets. */ +export type PredictionMarketEntrant = { + __typename?: 'PredictionMarketEntrant'; + /** ISO 3166-1 alpha-2 country code (e.g. "SE"). Populated when `kind = COUNTRY` and the label resolves to a known country. */ + countryCode?: Maybe; + /** Cleaned display name for the entrant (mirrors the existing `suggestedLabel` field). */ + displayName: Scalars['String']['output']; + /** Per-market image URL when available (mirrors the existing per-market image). */ + imageUrl?: Maybe; + /** Kind of entity this entrant represents. */ + kind: PredictionMarketEntrantKind; +}; + +/** Closed list of entrant kinds. */ +export enum PredictionMarketEntrantKind { + /** Album. */ + Album = 'ALBUM', + /** Company / corporation / brand. */ + Company = 'COMPANY', + /** Country (Eurovision, Olympics outright, etc.). */ + Country = 'COUNTRY', + /** Movie. */ + Movie = 'MOVIE', + /** Fallback. */ + Other = 'OTHER', + /** Real person — politician, executive, public figure (not a sports player). */ + Person = 'PERSON', + /** Sports player or driver. */ + Player = 'PLAYER', + /** Song. */ + Song = 'SONG', + /** Sports team or franchise. */ + Team = 'TEAM', + /** Multi-select / pick-N topic item (policy item, demand, agenda topic). */ + Topic = 'TOPIC', + /** TV show. */ + TvShow = 'TV_SHOW' +} + +/** Response returned by `filterPredictionMarkets`. */ +export type PredictionMarketFilterConnection = { + __typename?: 'PredictionMarketFilterConnection'; + /** Total number of matching results. */ + count: Scalars['Int']['output']; + /** The current page number. */ + page: Scalars['Int']['output']; + /** The list of results. */ + results: Array; +}; + +/** A prediction market matching a set of filter parameters. */ +export type PredictionMarketFilterResult = { + __typename?: 'PredictionMarketFilterResult'; + /** The age. */ + age?: Maybe; + /** The avg trade size usd1h. */ + avgTradeSizeUsd1h?: Maybe; + /** The avg trade size usd1w. */ + avgTradeSizeUsd1w?: Maybe; + /** The avg trade size usd4h. */ + avgTradeSizeUsd4h?: Maybe; + /** The avg trade size usd5m. */ + avgTradeSizeUsd5m?: Maybe; + /** The avg trade size usd12h. */ + avgTradeSizeUsd12h?: Maybe; + /** The avg trade size usd24h. */ + avgTradeSizeUsd24h?: Maybe; + /** Categories associated with this entity. */ + categories: Array; + /** Structured classification metadata from the search index. Discriminated by `classification.role`; carries `segment`, `entrant`, `thresholdBucket`, and `dateBucket` sub-blocks. */ + classification?: Maybe; + /** The timestamp when this entity closes. */ + closesAt: Scalars['Int']['output']; + /** The competitive score. */ + competitiveScore1h?: Maybe; + /** The competitive score. */ + competitiveScore1w?: Maybe; + /** The competitive score. */ + competitiveScore4h?: Maybe; + /** The competitive score. */ + competitiveScore5m?: Maybe; + /** The competitive score. */ + competitiveScore12h?: Maybe; + /** The competitive score. */ + competitiveScore24h?: Maybe; + /** The parent event label. */ + eventLabel?: Maybe; + /** The expected lifespan. */ + expectedLifespan?: Maybe; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** The implied probability sum. */ + impliedProbabilitySum?: Maybe; + /** The timestamp of the last transaction. */ + lastTransactionAt: Scalars['Int']['output']; + /** The liquidity asymmetry. */ + liquidityAsymmetry?: Maybe; + /** Liquidity in collateral token units. */ + liquidityCT?: Maybe; + /** The percentage change. */ + liquidityChange1h?: Maybe; + /** The percentage change. */ + liquidityChange1w?: Maybe; + /** The percentage change. */ + liquidityChange4h?: Maybe; + /** The percentage change. */ + liquidityChange5m?: Maybe; + /** The percentage change. */ + liquidityChange12h?: Maybe; + /** The percentage change. */ + liquidityChange24h?: Maybe; + /** Liquidity in USD. */ + liquidityUsd?: Maybe; + /** Simplified market data from search index. Use predictionMarket for full market details. */ + market: SearchPredictionMarket; + /** The max price range1h. */ + maxPriceRange1h?: Maybe; + /** The max price range1w. */ + maxPriceRange1w?: Maybe; + /** The max price range4h. */ + maxPriceRange4h?: Maybe; + /** The max price range5m. */ + maxPriceRange5m?: Maybe; + /** The max price range12h. */ + maxPriceRange12h?: Maybe; + /** The max price range24h. */ + maxPriceRange24h?: Maybe; + /** Open interest in collateral token units. */ + openInterestCT?: Maybe; + /** The percentage change. */ + openInterestChange1h?: Maybe; + /** The percentage change. */ + openInterestChange1w?: Maybe; + /** The percentage change. */ + openInterestChange4h?: Maybe; + /** The percentage change. */ + openInterestChange5m?: Maybe; + /** The percentage change. */ + openInterestChange12h?: Maybe; + /** The percentage change. */ + openInterestChange24h?: Maybe; + /** Open interest in USD. */ + openInterestUsd?: Maybe; + /** The timestamp when this entity opens. */ + opensAt: Scalars['Int']['output']; + /** Outcome 0 data. */ + outcome0: PredictionOutcomeFilterResult; + /** Outcome 1 data. */ + outcome1: PredictionOutcomeFilterResult; + /** Full prediction market loaded from database. May be null if market no longer exists. */ + predictionMarket?: Maybe; + /** The price competitiveness. */ + priceCompetitiveness?: Maybe; + /** The prediction protocol. */ + protocol: PredictionProtocol; + /** The relevance score. */ + relevanceScore1h?: Maybe; + /** The relevance score. */ + relevanceScore1w?: Maybe; + /** The relevance score. */ + relevanceScore4h?: Maybe; + /** The relevance score. */ + relevanceScore5m?: Maybe; + /** The relevance score. */ + relevanceScore12h?: Maybe; + /** The relevance score. */ + relevanceScore24h?: Maybe; + /** The resolution source. */ + resolutionSource?: Maybe; + /** The expected resolution timestamp. */ + resolvesAt: Scalars['Int']['output']; + /** The current status. */ + status: PredictionEventStatus; + /** The unix timestamp. */ + timestamp: Scalars['Int']['output']; + /** The trades1h. */ + trades1h?: Maybe; + /** The trades1w. */ + trades1w?: Maybe; + /** The trades4h. */ + trades4h?: Maybe; + /** The trades5m. */ + trades5m?: Maybe; + /** The trades12h. */ + trades12h?: Maybe; + /** The trades24h. */ + trades24h?: Maybe; + /** The percentage change. */ + tradesChange1h?: Maybe; + /** The percentage change. */ + tradesChange1w?: Maybe; + /** The percentage change. */ + tradesChange4h?: Maybe; + /** The percentage change. */ + tradesChange5m?: Maybe; + /** The percentage change. */ + tradesChange12h?: Maybe; + /** The percentage change. */ + tradesChange24h?: Maybe; + /** The trending score. */ + trendingScore1h?: Maybe; + /** The trending score. */ + trendingScore1w?: Maybe; + /** The trending score. */ + trendingScore4h?: Maybe; + /** The trending score. */ + trendingScore5m?: Maybe; + /** The trending score. */ + trendingScore12h?: Maybe; + /** The trending score. */ + trendingScore24h?: Maybe; + /** The unique traders1h. */ + uniqueTraders1h?: Maybe; + /** The unique traders1w. */ + uniqueTraders1w?: Maybe; + /** The unique traders4h. */ + uniqueTraders4h?: Maybe; + /** The unique traders5m. */ + uniqueTraders5m?: Maybe; + /** The unique traders12h. */ + uniqueTraders12h?: Maybe; + /** The unique traders24h. */ + uniqueTraders24h?: Maybe; + /** The percentage change. */ + uniqueTradersChange1h?: Maybe; + /** The percentage change. */ + uniqueTradersChange1w?: Maybe; + /** The percentage change. */ + uniqueTradersChange4h?: Maybe; + /** The percentage change. */ + uniqueTradersChange5m?: Maybe; + /** The percentage change. */ + uniqueTradersChange12h?: Maybe; + /** The percentage change. */ + uniqueTradersChange24h?: Maybe; + /** The venue volume ct. */ + venueVolumeCT?: Maybe; + /** The venue volume usd. */ + venueVolumeUsd?: Maybe; + /** Volume in collateral token units. */ + volumeCTAll?: Maybe; + /** The percentage change. */ + volumeChange1h?: Maybe; + /** The percentage change. */ + volumeChange1w?: Maybe; + /** The percentage change. */ + volumeChange4h?: Maybe; + /** The percentage change. */ + volumeChange5m?: Maybe; + /** The percentage change. */ + volumeChange12h?: Maybe; + /** The percentage change. */ + volumeChange24h?: Maybe; + /** The volume imbalance24h. */ + volumeImbalance24h?: Maybe; + /** Volume in USD. */ + volumeUsd1h?: Maybe; + /** Volume in USD. */ + volumeUsd1w?: Maybe; + /** Volume in USD. */ + volumeUsd4h?: Maybe; + /** Volume in USD. */ + volumeUsd5m?: Maybe; + /** Volume in USD. */ + volumeUsd12h?: Maybe; + /** Volume in USD. */ + volumeUsd24h?: Maybe; + /** Volume in USD. */ + volumeUsdAll?: Maybe; + /** The ID of the winning outcome. */ + winningOutcomeId?: Maybe; +}; + +/** Filters for prediction markets. */ +export type PredictionMarketFilters = { + /** The age. */ + age?: InputMaybe; + /** The avg trade size usd1h. */ + avgTradeSizeUsd1h?: InputMaybe; + /** The avg trade size usd1w. */ + avgTradeSizeUsd1w?: InputMaybe; + /** The avg trade size usd4h. */ + avgTradeSizeUsd4h?: InputMaybe; + /** The avg trade size usd5m. */ + avgTradeSizeUsd5m?: InputMaybe; + /** The avg trade size usd12h. */ + avgTradeSizeUsd12h?: InputMaybe; + /** The avg trade size usd24h. */ + avgTradeSizeUsd24h?: InputMaybe; + /** Categories associated with this entity. Mutually exclusive with excludeCategories and hasCategories. */ + categories?: InputMaybe>; + /** The timestamp when this entity closes. */ + closesAt?: InputMaybe; + /** The competitive score. */ + competitiveScore1h?: InputMaybe; + /** The competitive score. */ + competitiveScore1w?: InputMaybe; + /** The competitive score. */ + competitiveScore4h?: InputMaybe; + /** The competitive score. */ + competitiveScore5m?: InputMaybe; + /** The competitive score. */ + competitiveScore12h?: InputMaybe; + /** The competitive score. */ + competitiveScore24h?: InputMaybe; + /** The timestamp when this entity was created. */ + createdAt?: InputMaybe; + /** Exclude markets with these categories. Mutually exclusive with categories and hasCategories. */ + excludeCategories?: InputMaybe>; + /** The expected lifespan. */ + expectedLifespan?: InputMaybe; + /** Filter by whether the market has any categories. Mutually exclusive with categories and excludeCategories. */ + hasCategories?: InputMaybe; + /** The implied probability sum. */ + impliedProbabilitySum?: InputMaybe; + /** The timestamp of the last transaction. */ + lastTransactionAt?: InputMaybe; + /** The liquidity asymmetry. */ + liquidityAsymmetry?: InputMaybe; + /** Liquidity in collateral token units. */ + liquidityCT?: InputMaybe; + /** The percentage change. */ + liquidityChange1h?: InputMaybe; + /** The percentage change. */ + liquidityChange1w?: InputMaybe; + /** The percentage change. */ + liquidityChange4h?: InputMaybe; + /** The percentage change. */ + liquidityChange5m?: InputMaybe; + /** The percentage change. */ + liquidityChange12h?: InputMaybe; + /** The percentage change. */ + liquidityChange24h?: InputMaybe; + /** Liquidity in USD. */ + liquidityUsd?: InputMaybe; + /** The max price range1h. */ + maxPriceRange1h?: InputMaybe; + /** The max price range1w. */ + maxPriceRange1w?: InputMaybe; + /** The max price range4h. */ + maxPriceRange4h?: InputMaybe; + /** The max price range5m. */ + maxPriceRange5m?: InputMaybe; + /** The max price range12h. */ + maxPriceRange12h?: InputMaybe; + /** The max price range24h. */ + maxPriceRange24h?: InputMaybe; + /** Open interest in collateral token units. */ + openInterestCT?: InputMaybe; + /** The percentage change. */ + openInterestChange1h?: InputMaybe; + /** The percentage change. */ + openInterestChange1w?: InputMaybe; + /** The percentage change. */ + openInterestChange4h?: InputMaybe; + /** The percentage change. */ + openInterestChange5m?: InputMaybe; + /** The percentage change. */ + openInterestChange12h?: InputMaybe; + /** The percentage change. */ + openInterestChange24h?: InputMaybe; + /** Open interest in USD. */ + openInterestUsd?: InputMaybe; + /** The timestamp when this entity opens. */ + opensAt?: InputMaybe; + /** Filter on outcome0 properties. All conditions must be met (AND logic). */ + outcome0?: InputMaybe; + /** Filter on outcome1 properties. All conditions must be met (AND logic). */ + outcome1?: InputMaybe; + /** Filter where ANY outcome matches the conditions (OR logic). Useful for finding markets where either outcome meets criteria. */ + outcomeOr?: InputMaybe; + /** The price competitiveness. */ + priceCompetitiveness?: InputMaybe; + /** The prediction protocol. */ + protocol?: InputMaybe>; + /** The relevance score. */ + relevanceScore1h?: InputMaybe; + /** The relevance score. */ + relevanceScore1w?: InputMaybe; + /** The relevance score. */ + relevanceScore4h?: InputMaybe; + /** The relevance score. */ + relevanceScore5m?: InputMaybe; + /** The relevance score. */ + relevanceScore12h?: InputMaybe; + /** The relevance score. */ + relevanceScore24h?: InputMaybe; + /** The resolution source. */ + resolutionSource?: InputMaybe>; + /** The expected resolution timestamp. */ + resolvesAt?: InputMaybe; + /** The current status. */ + status?: InputMaybe>; + /** The unix timestamp. */ + timestamp?: InputMaybe; + /** The trades1h. */ + trades1h?: InputMaybe; + /** The trades1w. */ + trades1w?: InputMaybe; + /** The trades4h. */ + trades4h?: InputMaybe; + /** The trades5m. */ + trades5m?: InputMaybe; + /** The trades12h. */ + trades12h?: InputMaybe; + /** The trades24h. */ + trades24h?: InputMaybe; + /** The percentage change. */ + tradesChange1h?: InputMaybe; + /** The percentage change. */ + tradesChange1w?: InputMaybe; + /** The percentage change. */ + tradesChange4h?: InputMaybe; + /** The percentage change. */ + tradesChange5m?: InputMaybe; + /** The percentage change. */ + tradesChange12h?: InputMaybe; + /** The percentage change. */ + tradesChange24h?: InputMaybe; + /** The trending score. */ + trendingScore1h?: InputMaybe; + /** The trending score. */ + trendingScore1w?: InputMaybe; + /** The trending score. */ + trendingScore4h?: InputMaybe; + /** The trending score. */ + trendingScore5m?: InputMaybe; + /** The trending score. */ + trendingScore12h?: InputMaybe; + /** The trending score. */ + trendingScore24h?: InputMaybe; + /** The unique traders1h. */ + uniqueTraders1h?: InputMaybe; + /** The unique traders1w. */ + uniqueTraders1w?: InputMaybe; + /** The unique traders4h. */ + uniqueTraders4h?: InputMaybe; + /** The unique traders5m. */ + uniqueTraders5m?: InputMaybe; + /** The unique traders12h. */ + uniqueTraders12h?: InputMaybe; + /** The unique traders24h. */ + uniqueTraders24h?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange1h?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange1w?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange4h?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange5m?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange12h?: InputMaybe; + /** The percentage change. */ + uniqueTradersChange24h?: InputMaybe; + /** The venue volume ct. */ + venueVolumeCT?: InputMaybe; + /** The venue volume usd. */ + venueVolumeUsd?: InputMaybe; + /** Volume in collateral token units. */ + volumeCTAll?: InputMaybe; + /** The percentage change. */ + volumeChange1h?: InputMaybe; + /** The percentage change. */ + volumeChange1w?: InputMaybe; + /** The percentage change. */ + volumeChange4h?: InputMaybe; + /** The percentage change. */ + volumeChange5m?: InputMaybe; + /** The percentage change. */ + volumeChange12h?: InputMaybe; + /** The percentage change. */ + volumeChange24h?: InputMaybe; + /** The volume imbalance24h. */ + volumeImbalance24h?: InputMaybe; + /** Volume in USD. */ + volumeUsd1h?: InputMaybe; + /** Volume in USD. */ + volumeUsd1w?: InputMaybe; + /** Volume in USD. */ + volumeUsd4h?: InputMaybe; + /** Volume in USD. */ + volumeUsd5m?: InputMaybe; + /** Volume in USD. */ + volumeUsd12h?: InputMaybe; + /** Volume in USD. */ + volumeUsd24h?: InputMaybe; + /** Volume in USD. */ + volumeUsdAll?: InputMaybe; +}; + +/** Closed list of metrics for `PredictionMarketThresholdBucket.metric`. */ +export enum PredictionMarketLadderMetric { + /** Movie box-office opening-weekend gross. */ + BoxOffice = 'BOX_OFFICE', + /** Commodity price (oil, gas, metals, etc.). */ + Commodity = 'COMMODITY', + /** Fully-diluted valuation / market cap threshold. */ + Fdv = 'FDV', + /** Follower count. */ + Followers = 'FOLLOWERS', + /** Like count. */ + Likes = 'LIKES', + /** Fallback. */ + Other = 'OTHER', + /** Post count. */ + Posts = 'POSTS', + /** Generic asset price (crypto, commodities-fallback). */ + Price = 'PRICE', + /** Federal Reserve rate change in basis points. */ + RateChangeBps = 'RATE_CHANGE_BPS', + /** Rotten Tomatoes Tomatometer score. */ + RottenTomatoes = 'ROTTEN_TOMATOES', + /** Equity stock price. */ + StockPrice = 'STOCK_PRICE', + /** Subscriber count. */ + Subscribers = 'SUBSCRIBERS', + /** Daily high/low temperature in °C. */ + Temperature = 'TEMPERATURE', + /** Tweet count. */ + Tweets = 'TWEETS', + /** View / stream count. */ + Views = 'VIEWS' +} + +/** Comparison operator for a ladder rung. */ +export enum PredictionMarketLadderOperator { + /** Strictly greater than `numericValue` ("≥" is normalised to ABOVE). */ + Above = 'ABOVE', + /** Strictly less than `numericValue` ("≤" is normalised to BELOW). */ + Below = 'BELOW', + /** Inclusive range between `lowerBound` and `upperBound`. */ + Between = 'BETWEEN', + /** Equal to `numericValue` (single-strike or exact-match bucket). */ + Exactly = 'EXACTLY' +} + +/** Market-level conditions across all windows for a prediction market metrics event webhook. */ +export type PredictionMarketMetricsEventMarketCondition = { + __typename?: 'PredictionMarketMetricsEventMarketCondition'; + /** Conditions for the 1-day window. */ + day1?: Maybe; + /** Conditions for the 1-hour window. */ + hour1?: Maybe; + /** Conditions for the 4-hour window. */ + hour4?: Maybe; + /** Conditions for the 12-hour window. */ + hour12?: Maybe; + /** Conditions for the 5-minute window. */ + min5?: Maybe; + /** Conditions for the 1-week window. */ + week1?: Maybe; +}; + +/** Per-window market-level conditions across all 6 windows. */ +export type PredictionMarketMetricsEventMarketConditionInput = { + day1?: InputMaybe; + hour1?: InputMaybe; + hour4?: InputMaybe; + hour12?: InputMaybe; + min5?: InputMaybe; + week1?: InputMaybe; +}; + +/** Per-outcome conditions for a prediction market metrics event webhook. */ +export type PredictionMarketMetricsEventOutcomeCondition = { + __typename?: 'PredictionMarketMetricsEventOutcomeCondition'; + /** Conditions for the 1-day window. */ + day1?: Maybe; + /** Conditions for the 1-hour window. */ + hour1?: Maybe; + /** Conditions for the 4-hour window. */ + hour4?: Maybe; + /** Conditions for the 12-hour window. */ + hour12?: Maybe; + /** Conditions for the 5-minute window. */ + min5?: Maybe; + /** Conditions for the 1-week window. */ + week1?: Maybe; +}; + +/** Per-outcome conditions for a PredictionMarketMetricsEvent webhook. */ +export type PredictionMarketMetricsEventOutcomeConditionInput = { + /** Conditions for the 1-day window. */ + day1?: InputMaybe; + /** Conditions for the 1-hour window. */ + hour1?: InputMaybe; + /** Conditions for the 4-hour window. */ + hour4?: InputMaybe; + /** Conditions for the 12-hour window. */ + hour12?: InputMaybe; + /** Conditions for the 5-minute window. */ + min5?: InputMaybe; + /** Conditions for the 1-week window. */ + week1?: InputMaybe; +}; + +/** Webhook conditions for a prediction market metrics event. */ +export type PredictionMarketMetricsEventWebhookCondition = { + __typename?: 'PredictionMarketMetricsEventWebhookCondition'; + /** Conditions evaluated against both outcomes; matches if at least one outcome satisfies. ANDed with outcome0 and outcome1 when also present. */ + anyOutcome?: Maybe; + /** Conditions evaluated against market-level aggregate stats. ANDed with other clauses when also present. */ + market?: Maybe; + /** The market ID the webhook is listening for. */ + marketId: StringEqualsCondition; + /** Conditions evaluated against outcome 0's stats. ANDed with outcome1 and anyOutcome when also present. */ + outcome0?: Maybe; + /** Conditions evaluated against outcome 1's stats. ANDed with outcome0 and anyOutcome when also present. */ + outcome1?: Maybe; +}; + +/** Input conditions for a PredictionMarketMetricsEvent webhook. */ +export type PredictionMarketMetricsEventWebhookConditionInput = { + /** Conditions evaluated against both outcomes; matches if at least one outcome satisfies. ANDed with outcome0 and outcome1 when also present. */ + anyOutcome?: InputMaybe; + /** Conditions evaluated against market-level aggregate stats. ANDed with other clauses when also present. */ + market?: InputMaybe; + /** The market ID to listen for. */ + marketId: StringEqualsConditionInput; + /** Conditions evaluated against outcome 0's stats. ANDed with outcome1 and anyOutcome when also present. */ + outcome0?: InputMaybe; + /** Conditions evaluated against outcome 1's stats. ANDed with outcome0 and anyOutcome when also present. */ + outcome1?: InputMaybe; +}; + +/** Price data for a single outcome within a prediction market. */ +export type PredictionMarketOutcomePrice = { + __typename?: 'PredictionMarketOutcomePrice'; + /** The best ask in collateral token units. */ + bestAskCT?: Maybe; + /** The best ask in USD. */ + bestAskUsd?: Maybe; + /** The best bid in collateral token units. */ + bestBidCT?: Maybe; + /** The best bid in USD. */ + bestBidUsd?: Maybe; + /** Live top-of-book best ask in collateral token units, sourced from the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. */ + bestBookAskCT?: Maybe; + /** Live top-of-book best ask in USD, sourced from the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. */ + bestBookAskUsd?: Maybe; + /** Live top-of-book best bid in collateral token units, sourced from the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. */ + bestBookBidCT?: Maybe; + /** Live top-of-book best bid in USD, sourced from the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. */ + bestBookBidUsd?: Maybe; + /** Total bid-side notional liquidity in collateral token units across all bid levels in the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. */ + bookLiquidityCT?: Maybe; + /** Total bid-side notional liquidity in USD across all bid levels in the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. */ + bookLiquidityUsd?: Maybe; + /** The last trade price in collateral token units. */ + lastTradePriceCT?: Maybe; + /** The last trade price in USD. */ + lastTradePriceUsd?: Maybe; + /** The ID of the outcome. */ + outcomeId: Scalars['String']['output']; + /** The spread in collateral token units. */ + spreadCT?: Maybe; + /** The spread in USD. */ + spreadUsd?: Maybe; + /** The timestamp of the price data. */ + timestamp: Scalars['Int']['output']; +}; + +/** Price data for a prediction market. */ +export type PredictionMarketPrice = { + __typename?: 'PredictionMarketPrice'; + /** The ID of the prediction market. */ + marketId: Scalars['String']['output']; + /** The prices for the outcomes. */ + outcomes: Array; + /** The timestamp of the price data. */ + timestamp: Scalars['Int']['output']; +}; + +/** Input for fetching prediction market price data. */ +export type PredictionMarketPriceInput = { + /** The ID of the prediction market. */ + marketId: Scalars['String']['input']; + /** The timestamp (unix seconds). If not provided, the latest price will be returned. */ + timestamp?: InputMaybe; +}; + +/** A ranking to apply when sorting prediction markets. */ +export type PredictionMarketRanking = { + /** Market-level attribute to rank by (use this OR outcome + outcomeAttribute) */ + attribute?: InputMaybe; + /** The sort direction. */ + direction?: InputMaybe; + /** Which outcome to rank by (required when using outcomeAttribute) */ + outcome?: InputMaybe; + /** Outcome-level attribute to rank by (requires outcome to be set) */ + outcomeAttribute?: InputMaybe; +}; + +/** The attribute used to rank prediction markets. */ +export enum PredictionMarketRankingAttribute { + Age = 'age', + AvgTradeSizeUsd1h = 'avgTradeSizeUsd1h', + AvgTradeSizeUsd1w = 'avgTradeSizeUsd1w', + AvgTradeSizeUsd4h = 'avgTradeSizeUsd4h', + AvgTradeSizeUsd5m = 'avgTradeSizeUsd5m', + AvgTradeSizeUsd12h = 'avgTradeSizeUsd12h', + AvgTradeSizeUsd24h = 'avgTradeSizeUsd24h', + ClosesAt = 'closesAt', + CompetitiveScore1h = 'competitiveScore1h', + CompetitiveScore1w = 'competitiveScore1w', + CompetitiveScore4h = 'competitiveScore4h', + CompetitiveScore5m = 'competitiveScore5m', + CompetitiveScore12h = 'competitiveScore12h', + CompetitiveScore24h = 'competitiveScore24h', + CreatedAt = 'createdAt', + ExpectedLifespan = 'expectedLifespan', + ImpliedProbabilitySum = 'impliedProbabilitySum', + LastTransactionAt = 'lastTransactionAt', + LiquidityAsymmetry = 'liquidityAsymmetry', + LiquidityCt = 'liquidityCT', + LiquidityChange1h = 'liquidityChange1h', + LiquidityChange1w = 'liquidityChange1w', + LiquidityChange4h = 'liquidityChange4h', + LiquidityChange5m = 'liquidityChange5m', + LiquidityChange12h = 'liquidityChange12h', + LiquidityChange24h = 'liquidityChange24h', + LiquidityUsd = 'liquidityUsd', + MaxPriceRange1h = 'maxPriceRange1h', + MaxPriceRange1w = 'maxPriceRange1w', + MaxPriceRange4h = 'maxPriceRange4h', + MaxPriceRange5m = 'maxPriceRange5m', + MaxPriceRange12h = 'maxPriceRange12h', + MaxPriceRange24h = 'maxPriceRange24h', + OpenInterestCt = 'openInterestCT', + OpenInterestChange1h = 'openInterestChange1h', + OpenInterestChange1w = 'openInterestChange1w', + OpenInterestChange4h = 'openInterestChange4h', + OpenInterestChange5m = 'openInterestChange5m', + OpenInterestChange12h = 'openInterestChange12h', + OpenInterestChange24h = 'openInterestChange24h', + OpenInterestUsd = 'openInterestUsd', + OpensAt = 'opensAt', + /** Score from phrase matching (for search queries) */ + PhraseScore = 'phraseScore', + PriceCompetitiveness = 'priceCompetitiveness', + RelevanceScore1h = 'relevanceScore1h', + RelevanceScore1w = 'relevanceScore1w', + RelevanceScore4h = 'relevanceScore4h', + RelevanceScore5m = 'relevanceScore5m', + RelevanceScore12h = 'relevanceScore12h', + RelevanceScore24h = 'relevanceScore24h', + ResolvesAt = 'resolvesAt', + Timestamp = 'timestamp', + Trades1h = 'trades1h', + Trades1w = 'trades1w', + Trades4h = 'trades4h', + Trades5m = 'trades5m', + Trades12h = 'trades12h', + Trades24h = 'trades24h', + TradesChange1h = 'tradesChange1h', + TradesChange1w = 'tradesChange1w', + TradesChange4h = 'tradesChange4h', + TradesChange5m = 'tradesChange5m', + TradesChange12h = 'tradesChange12h', + TradesChange24h = 'tradesChange24h', + TrendingScore1h = 'trendingScore1h', + TrendingScore1w = 'trendingScore1w', + TrendingScore4h = 'trendingScore4h', + TrendingScore5m = 'trendingScore5m', + TrendingScore12h = 'trendingScore12h', + TrendingScore24h = 'trendingScore24h', + UniqueTraders1h = 'uniqueTraders1h', + UniqueTraders1w = 'uniqueTraders1w', + UniqueTraders4h = 'uniqueTraders4h', + UniqueTraders5m = 'uniqueTraders5m', + UniqueTraders12h = 'uniqueTraders12h', + UniqueTraders24h = 'uniqueTraders24h', + UniqueTradersChange1h = 'uniqueTradersChange1h', + UniqueTradersChange1w = 'uniqueTradersChange1w', + UniqueTradersChange4h = 'uniqueTradersChange4h', + UniqueTradersChange5m = 'uniqueTradersChange5m', + UniqueTradersChange12h = 'uniqueTradersChange12h', + UniqueTradersChange24h = 'uniqueTradersChange24h', + VenueVolumeCt = 'venueVolumeCT', + VenueVolumeUsd = 'venueVolumeUsd', + VolumeCtAll = 'volumeCTAll', + VolumeChange1h = 'volumeChange1h', + VolumeChange1w = 'volumeChange1w', + VolumeChange4h = 'volumeChange4h', + VolumeChange5m = 'volumeChange5m', + VolumeChange12h = 'volumeChange12h', + VolumeChange24h = 'volumeChange24h', + VolumeImbalance24h = 'volumeImbalance24h', + VolumeUsd1h = 'volumeUsd1h', + VolumeUsd1w = 'volumeUsd1w', + VolumeUsd4h = 'volumeUsd4h', + VolumeUsd5m = 'volumeUsd5m', + VolumeUsd12h = 'volumeUsd12h', + VolumeUsd24h = 'volumeUsd24h', + VolumeUsdAll = 'volumeUsdAll' +} + +/** Multi-resolution bar data for a prediction market. */ +export type PredictionMarketResolutionBarData = { + __typename?: 'PredictionMarketResolutionBarData'; + /** Data for the 1-day resolution. */ + day1?: Maybe; + /** Data for the 1-hour resolution. */ + hour1?: Maybe; + /** Data for the 4-hour resolution. */ + hour4?: Maybe; + /** Data for the 12-hour resolution. */ + hour12?: Maybe; + /** Data for the 1-minute resolution. */ + min1?: Maybe; + /** Data for the 5-minute resolution. */ + min5?: Maybe; + /** Data for the 15-minute resolution. */ + min15?: Maybe; + /** Data for the 30-minute resolution. */ + min30?: Maybe; + /** Data for the 1-week resolution. */ + week1?: Maybe; +}; + +/** Capped per-market role taxonomy. One per market within an event. */ +export enum PredictionMarketRole { + /** One bucket of a date ladder (e.g. "Before 2027"). */ + DateBucket = 'DATE_BUCKET', + /** One entrant in a large-field tournament/championship outright (e.g. Kalshi "NBA Champion?" with one Yes/No market per team in the league). Distinct from MONEYLINE_OUTCOME by field size and event shape. */ + Entrant = 'ENTRANT', + /** Exotic market (BTTS, correct score, method of victory, etc.). */ + Exotic = 'EXOTIC', + /** Single-market outright winner (e.g. Polymarket two-outcome moneyline). */ + Moneyline = 'MONEYLINE', + /** One side of a split head-to-head moneyline (typically 2-3 markets per event: per-team Yes/No for a single game/half/quarter/period, plus optional Tie). Group all markets in an event with this role to reconstruct the logical moneyline. */ + MoneylineOutcome = 'MONEYLINE_OUTCOME', + /** Fallback. */ + Other = 'OTHER', + /** Player or team prop. */ + Prop = 'PROP', + /** Point spread / handicap. */ + Spread = 'SPREAD', + /** One bucket of a price-threshold ladder (e.g. "BTC > $80k"). */ + ThresholdBucket = 'THRESHOLD_BUCKET', + /** Over/under total. */ + Total = 'TOTAL' +} + +/** Sports sub-event segment (period and/or stat). */ +export type PredictionMarketSegment = { + __typename?: 'PredictionMarketSegment'; + /** Convenience grouping key. Equals `stat ?? period ?? "match"`. Use this when partitioning markets within an event into sub-event groups: stat takes precedence over period (a "1H Player Points" market groups with other points markets, not other 1H markets). */ + groupingKey: Scalars['String']['output']; + /** Numeric segment value when the period/stat slug carries an ordinal or numeric component (for example set/game/map/round number). Null when no numeric segment value is available. */ + numberValue?: Maybe; + /** Period token if detected: e.g. "set_1", "1h", "game_2", "map_3", "period_2", "ot". Snake_case slug. Null when the market covers the full match. */ + period?: Maybe; + /** Stat dimension if a stat keyword was detected (points, rebounds, assists, ...). Null otherwise. */ + stat?: Maybe; + /** Which dimension dominates: STAT (a stat is present, regardless of period), PERIOD (only a period is present), or NONE (neither — full-match market). */ + type: PredictionMarketSegmentType; +}; + +/** Discriminator for `PredictionMarketSegment.type`. */ +export enum PredictionMarketSegmentType { + /** Neither stat nor period — full-match market. */ + None = 'NONE', + /** Only a period (set/half/game/...) was detected. */ + Period = 'PERIOD', + /** A stat keyword was detected — group by stat regardless of period. */ + Stat = 'STAT' +} + +/** Closed list of stat dimensions the classifier recognises. */ +export enum PredictionMarketStatType { + Assists = 'ASSISTS', + Blocks = 'BLOCKS', + DoubleDouble = 'DOUBLE_DOUBLE', + FirstInningRuns = 'FIRST_INNING_RUNS', + Fouls = 'FOULS', + Points = 'POINTS', + Rebounds = 'REBOUNDS', + Steals = 'STEALS', + Threes = 'THREES', + TripleDouble = 'TRIPLE_DOUBLE', + Turnovers = 'TURNOVERS' +} + +/** Numeric threshold-bucket metadata for THRESHOLD_BUCKET-role markets. */ +export type PredictionMarketThresholdBucket = { + __typename?: 'PredictionMarketThresholdBucket'; + /** Lower bound for BETWEEN-style range buckets (e.g. "$80k-$90k" → 80000). */ + lowerBound?: Maybe; + /** What the rung is measuring (price, stock price, temperature in °C, social-media count, ...). */ + metric: PredictionMarketLadderMetric; + /** Single comparison value for ABOVE / BELOW / EXACTLY (e.g. 80000 for "BTC > $80k"). */ + numericValue?: Maybe; + /** How the rung relates to its bound(s). */ + operator: PredictionMarketLadderOperator; + /** Upper bound for BETWEEN-style range buckets (e.g. "$80k-$90k" → 90000). */ + upperBound?: Maybe; +}; + +/** Trending, relevance, and competitive scores for a market window. */ +export type PredictionMarketWindowScores = { + __typename?: 'PredictionMarketWindowScores'; + /** The competitive score. */ + competitive: Scalars['Float']['output']; + /** The relevance score. */ + relevance: Scalars['Float']['output']; + /** The trending score. */ + trending: Scalars['Float']['output']; +}; + +/** Input type of `predictionMarkets`. */ +export type PredictionMarketsInput = { + /** Associated market IDs. */ + marketIds: Array; +}; + +/** Discriminator for `enrichedMetadata`. New values added as we ingest new domains. */ +export enum PredictionMetadataType { + /** Sports games (league, teams, start times). */ + Sports = 'SPORTS' +} + +/** A single price level within a prediction outcome's order book. Polymarket and Kalshi. */ +export type PredictionOrderBookLevel = { + __typename?: 'PredictionOrderBookLevel'; + /** The price in collateral token units. */ + price: Scalars['Float']['output']; + /** The size at this price level, in shares. */ + size: Scalars['Float']['output']; +}; + +/** Bar data for a single outcome within a prediction market. */ +export type PredictionOutcomeBar = { + __typename?: 'PredictionOutcomeBar'; + /** The ask collateral token. */ + askCollateralToken?: Maybe; + /** The ask usd. */ + askUsd?: Maybe; + /** The bid collateral token. */ + bidCollateralToken?: Maybe; + /** The bid usd. */ + bidUsd?: Maybe; + /** Buy volume in collateral token units. */ + buyVolumeCollateralToken?: Maybe; + /** Buy volume in shares. */ + buyVolumeShares?: Maybe; + /** Buy volume in USD. */ + buyVolumeUsd?: Maybe; + /** The number of buys. */ + buys?: Maybe; + /** The liquidity collateral token. */ + liquidityCollateralToken?: Maybe; + /** Liquidity in USD. */ + liquidityUsd?: Maybe; + /** The price collateral token. */ + priceCollateralToken?: Maybe; + /** The price usd. */ + priceUsd?: Maybe; + /** Sell volume in collateral token units. */ + sellVolumeCollateralToken?: Maybe; + /** Sell volume in shares. */ + sellVolumeShares?: Maybe; + /** Sell volume in USD. */ + sellVolumeUsd?: Maybe; + /** The number of sells. */ + sells?: Maybe; + /** The number of trades. */ + trades?: Maybe; + /** The two percent ask depth collateral token. */ + twoPercentAskDepthCollateralToken?: Maybe; + /** The two percent ask depth usd. */ + twoPercentAskDepthUsd?: Maybe; + /** The two percent bid depth collateral token. */ + twoPercentBidDepthCollateralToken?: Maybe; + /** The two percent bid depth usd. */ + twoPercentBidDepthUsd?: Maybe; + /** The venue-specific outcome ID. */ + venueOutcomeId: Scalars['String']['output']; + /** Volume in collateral token units. */ + volumeCollateralToken?: Maybe; + /** Volume in shares. */ + volumeShares?: Maybe; + /** Volume in USD. */ + volumeUsd?: Maybe; +}; + +/** A prediction outcome matching a set of filter parameters. */ +export type PredictionOutcomeFilterResult = { + __typename?: 'PredictionOutcomeFilterResult'; + /** The best ask ct. */ + bestAskCT?: Maybe; + /** The best ask usd. */ + bestAskUsd?: Maybe; + /** The best bid ct. */ + bestBidCT?: Maybe; + /** The best bid usd. */ + bestBidUsd?: Maybe; + /** Live top-of-book best ask in collateral token units, sourced from the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. Selecting this caps the filter `limit` at 50. */ + bestBookAskCT?: Maybe; + /** Live top-of-book best ask in USD, sourced from the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. Selecting this caps the filter `limit` at 50. */ + bestBookAskUsd?: Maybe; + /** Live top-of-book best bid in collateral token units, sourced from the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. Selecting this caps the filter `limit` at 50. */ + bestBookBidCT?: Maybe; + /** Live top-of-book best bid in USD, sourced from the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. Selecting this caps the filter `limit` at 50. */ + bestBookBidUsd?: Maybe; + /** Total bid-side notional liquidity in collateral token units across all bid levels in the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. Selecting this caps the filter `limit` at 50. */ + bookLiquidityCT?: Maybe; + /** Total bid-side notional liquidity in USD across all bid levels in the venue's CLOB. Polymarket and Kalshi; null for other venues. Fetched on-demand only when selected. Cached for up to 10s. Selecting this caps the filter `limit` at 50. */ + bookLiquidityUsd?: Maybe; + /** Buy volume. */ + buyVolumeUsd1h?: Maybe; + /** Buy volume. */ + buyVolumeUsd1w?: Maybe; + /** Buy volume. */ + buyVolumeUsd4h?: Maybe; + /** Buy volume. */ + buyVolumeUsd5m?: Maybe; + /** Buy volume. */ + buyVolumeUsd12h?: Maybe; + /** Buy volume. */ + buyVolumeUsd24h?: Maybe; + /** The buys1h. */ + buys1h?: Maybe; + /** The buys1w. */ + buys1w?: Maybe; + /** The buys4h. */ + buys4h?: Maybe; + /** The buys5m. */ + buys5m?: Maybe; + /** The buys12h. */ + buys12h?: Maybe; + /** The buys24h. */ + buys24h?: Maybe; + /** The exchange contract address. */ + exchangeAddress?: Maybe; + /** The high price usd1h. */ + highPriceUsd1h?: Maybe; + /** The high price usd1w. */ + highPriceUsd1w?: Maybe; + /** The high price usd4h. */ + highPriceUsd4h?: Maybe; + /** The high price usd5m. */ + highPriceUsd5m?: Maybe; + /** The high price usd12h. */ + highPriceUsd12h?: Maybe; + /** The high price usd24h. */ + highPriceUsd24h?: Maybe; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** The is winner. */ + isWinner?: Maybe; + /** The display label. */ + label?: Maybe; + /** The last price ct. */ + lastPriceCT?: Maybe; + /** The last price usd. */ + lastPriceUsd?: Maybe; + /** Liquidity in collateral token units. */ + liquidityCT?: Maybe; + /** Liquidity in USD. */ + liquidityUsd?: Maybe; + /** The low price usd1h. */ + lowPriceUsd1h?: Maybe; + /** The low price usd1w. */ + lowPriceUsd1w?: Maybe; + /** The low price usd4h. */ + lowPriceUsd4h?: Maybe; + /** The low price usd5m. */ + lowPriceUsd5m?: Maybe; + /** The low price usd12h. */ + lowPriceUsd12h?: Maybe; + /** The low price usd24h. */ + lowPriceUsd24h?: Maybe; + /** The network ID. */ + networkId?: Maybe; + /** The percentage change. */ + priceChange1h?: Maybe; + /** The percentage change. */ + priceChange1w?: Maybe; + /** The percentage change. */ + priceChange4h?: Maybe; + /** The percentage change. */ + priceChange5m?: Maybe; + /** The percentage change. */ + priceChange12h?: Maybe; + /** The percentage change. */ + priceChange24h?: Maybe; + /** The price range1h. */ + priceRange1h?: Maybe; + /** The price range1w. */ + priceRange1w?: Maybe; + /** The price range4h. */ + priceRange4h?: Maybe; + /** The price range5m. */ + priceRange5m?: Maybe; + /** The price range12h. */ + priceRange12h?: Maybe; + /** The price range24h. */ + priceRange24h?: Maybe; + /** Sell volume. */ + sellVolumeUsd1h?: Maybe; + /** Sell volume. */ + sellVolumeUsd1w?: Maybe; + /** Sell volume. */ + sellVolumeUsd4h?: Maybe; + /** Sell volume. */ + sellVolumeUsd5m?: Maybe; + /** Sell volume. */ + sellVolumeUsd12h?: Maybe; + /** Sell volume. */ + sellVolumeUsd24h?: Maybe; + /** The sells1h. */ + sells1h?: Maybe; + /** The sells1w. */ + sells1w?: Maybe; + /** The sells4h. */ + sells4h?: Maybe; + /** The sells5m. */ + sells5m?: Maybe; + /** The sells12h. */ + sells12h?: Maybe; + /** The sells24h. */ + sells24h?: Maybe; + /** The spread ct. */ + spreadCT?: Maybe; + /** The spread usd. */ + spreadUsd?: Maybe; + /** A best-effort display label for the outcome: the outcome `label` when present and meaningful, otherwise the `question`. If the event name appears inside the label it is stripped out. */ + suggestedLabel?: Maybe; + /** Tags associated with this entity. */ + tags?: Maybe>; + /** The token contract address. */ + tokenAddress?: Maybe; + /** The trades1h. */ + trades1h?: Maybe; + /** The trades1w. */ + trades1w?: Maybe; + /** The trades4h. */ + trades4h?: Maybe; + /** The trades5m. */ + trades5m?: Maybe; + /** The trades12h. */ + trades12h?: Maybe; + /** The trades24h. */ + trades24h?: Maybe; + /** The percentage change. */ + tradesChange1h?: Maybe; + /** The percentage change. */ + tradesChange1w?: Maybe; + /** The percentage change. */ + tradesChange4h?: Maybe; + /** The percentage change. */ + tradesChange5m?: Maybe; + /** The percentage change. */ + tradesChange12h?: Maybe; + /** The percentage change. */ + tradesChange24h?: Maybe; + /** The two percent ask depth ct. */ + twoPercentAskDepthCT?: Maybe; + /** The two percent ask depth usd. */ + twoPercentAskDepthUsd?: Maybe; + /** The two percent bid depth ct. */ + twoPercentBidDepthCT?: Maybe; + /** The two percent bid depth usd. */ + twoPercentBidDepthUsd?: Maybe; + /** The venue-specific outcome ID. */ + venueOutcomeId: Scalars['String']['output']; + /** The percentage change. */ + volumeChange1h?: Maybe; + /** The percentage change. */ + volumeChange1w?: Maybe; + /** The percentage change. */ + volumeChange4h?: Maybe; + /** The percentage change. */ + volumeChange5m?: Maybe; + /** The percentage change. */ + volumeChange12h?: Maybe; + /** The percentage change. */ + volumeChange24h?: Maybe; + /** Volume in shares. */ + volumeShares1h?: Maybe; + /** Volume in shares. */ + volumeShares1w?: Maybe; + /** Volume in shares. */ + volumeShares4h?: Maybe; + /** Volume in shares. */ + volumeShares5m?: Maybe; + /** Volume in shares. */ + volumeShares12h?: Maybe; + /** Volume in shares. */ + volumeShares24h?: Maybe; + /** Volume in USD. */ + volumeUsd1h?: Maybe; + /** Volume in USD. */ + volumeUsd1w?: Maybe; + /** Volume in USD. */ + volumeUsd4h?: Maybe; + /** Volume in USD. */ + volumeUsd5m?: Maybe; + /** Volume in USD. */ + volumeUsd12h?: Maybe; + /** Volume in USD. */ + volumeUsd24h?: Maybe; +}; + +/** Filters for prediction outcomes within a market. */ +export type PredictionOutcomeFilters = { + /** Best ask price in USD */ + bestAskUsd?: InputMaybe; + /** Best bid price in USD */ + bestBidUsd?: InputMaybe; + /** Last traded price in USD */ + lastPriceUsd?: InputMaybe; + /** Price change percentage in the last 1 hour */ + priceChange1h?: InputMaybe; + /** Price change percentage in the last week */ + priceChange1w?: InputMaybe; + /** Price change percentage in the last 4 hours */ + priceChange4h?: InputMaybe; + /** Price change percentage in the last 5 minutes */ + priceChange5m?: InputMaybe; + /** Price change percentage in the last 12 hours */ + priceChange12h?: InputMaybe; + /** Price change percentage in the last 24 hours */ + priceChange24h?: InputMaybe; + /** Spread in USD (difference between best ask and best bid) */ + spreadUsd?: InputMaybe; + /** Number of trades in the last 1 hour */ + trades1h?: InputMaybe; + /** Number of trades in the last week */ + trades1w?: InputMaybe; + /** Number of trades in the last 4 hours */ + trades4h?: InputMaybe; + /** Number of trades in the last 5 minutes */ + trades5m?: InputMaybe; + /** Number of trades in the last 12 hours */ + trades12h?: InputMaybe; + /** Number of trades in the last 24 hours */ + trades24h?: InputMaybe; +}; + +/** The index of an outcome within a prediction market. */ +export enum PredictionOutcomeIndex { + Outcome0 = 'outcome0', + Outcome1 = 'outcome1' +} + +/** A live order book snapshot for a single prediction outcome, sourced from the venue's CLOB. Polymarket and Kalshi; outcomes from other venues return no book. Cached for up to 10s. */ +export type PredictionOutcomeOrderBook = { + __typename?: 'PredictionOutcomeOrderBook'; + /** Asks ordered such that the last element is the best (lowest) ask. Empty when no book is available. */ + asks: Array; + /** Bids ordered such that the last element is the best (highest) bid. Empty when no book is available. */ + bids: Array; + /** Total bid-side notional liquidity in collateral token units across all bid levels in the venue's CLOB. Null when no book is available. */ + bookLiquidityCT?: Maybe; + /** Total bid-side notional liquidity in USD across all bid levels in the venue's CLOB. Null when no book is available. */ + bookLiquidityUsd?: Maybe; + /** The composite outcome ID. */ + outcomeId: Scalars['String']['output']; + /** The protocol that provides this market. */ + protocol: PredictionProtocol; + /** Venue-reported timestamp for the snapshot, in unix seconds. 0 when no book is available. */ + timestamp: Scalars['Int']['output']; + /** The venue-specific outcome / asset / token ID used by the venue's CLOB. */ + venueOutcomeId: Scalars['String']['output']; +}; + +/** The attribute used to rank prediction outcomes. */ +export enum PredictionOutcomeRankingAttribute { + BestAskCt = 'bestAskCT', + BestAskUsd = 'bestAskUsd', + BestBidCt = 'bestBidCT', + BestBidUsd = 'bestBidUsd', + BuyVolumeUsd1h = 'buyVolumeUsd1h', + BuyVolumeUsd1w = 'buyVolumeUsd1w', + BuyVolumeUsd4h = 'buyVolumeUsd4h', + BuyVolumeUsd5m = 'buyVolumeUsd5m', + BuyVolumeUsd12h = 'buyVolumeUsd12h', + BuyVolumeUsd24h = 'buyVolumeUsd24h', + Buys1h = 'buys1h', + Buys1w = 'buys1w', + Buys4h = 'buys4h', + Buys5m = 'buys5m', + Buys12h = 'buys12h', + Buys24h = 'buys24h', + HighPriceUsd1h = 'highPriceUsd1h', + HighPriceUsd1w = 'highPriceUsd1w', + HighPriceUsd4h = 'highPriceUsd4h', + HighPriceUsd5m = 'highPriceUsd5m', + HighPriceUsd12h = 'highPriceUsd12h', + HighPriceUsd24h = 'highPriceUsd24h', + LastPriceCt = 'lastPriceCT', + LastPriceUsd = 'lastPriceUsd', + LiquidityCt = 'liquidityCT', + LiquidityUsd = 'liquidityUsd', + LowPriceUsd1h = 'lowPriceUsd1h', + LowPriceUsd1w = 'lowPriceUsd1w', + LowPriceUsd4h = 'lowPriceUsd4h', + LowPriceUsd5m = 'lowPriceUsd5m', + LowPriceUsd12h = 'lowPriceUsd12h', + LowPriceUsd24h = 'lowPriceUsd24h', + PriceChange1h = 'priceChange1h', + PriceChange1w = 'priceChange1w', + PriceChange4h = 'priceChange4h', + PriceChange5m = 'priceChange5m', + PriceChange12h = 'priceChange12h', + PriceChange24h = 'priceChange24h', + PriceRange1h = 'priceRange1h', + PriceRange1w = 'priceRange1w', + PriceRange4h = 'priceRange4h', + PriceRange5m = 'priceRange5m', + PriceRange12h = 'priceRange12h', + PriceRange24h = 'priceRange24h', + SellVolumeUsd1h = 'sellVolumeUsd1h', + SellVolumeUsd1w = 'sellVolumeUsd1w', + SellVolumeUsd4h = 'sellVolumeUsd4h', + SellVolumeUsd5m = 'sellVolumeUsd5m', + SellVolumeUsd12h = 'sellVolumeUsd12h', + SellVolumeUsd24h = 'sellVolumeUsd24h', + Sells1h = 'sells1h', + Sells1w = 'sells1w', + Sells4h = 'sells4h', + Sells5m = 'sells5m', + Sells12h = 'sells12h', + Sells24h = 'sells24h', + SpreadCt = 'spreadCT', + SpreadUsd = 'spreadUsd', + Trades1h = 'trades1h', + Trades1w = 'trades1w', + Trades4h = 'trades4h', + Trades5m = 'trades5m', + Trades12h = 'trades12h', + Trades24h = 'trades24h', + TradesChange1h = 'tradesChange1h', + TradesChange1w = 'tradesChange1w', + TradesChange4h = 'tradesChange4h', + TradesChange5m = 'tradesChange5m', + TradesChange12h = 'tradesChange12h', + TradesChange24h = 'tradesChange24h', + TwoPercentAskDepthCt = 'twoPercentAskDepthCT', + TwoPercentAskDepthUsd = 'twoPercentAskDepthUsd', + TwoPercentBidDepthCt = 'twoPercentBidDepthCT', + TwoPercentBidDepthUsd = 'twoPercentBidDepthUsd', + VolumeChange1h = 'volumeChange1h', + VolumeChange1w = 'volumeChange1w', + VolumeChange4h = 'volumeChange4h', + VolumeChange5m = 'volumeChange5m', + VolumeChange12h = 'volumeChange12h', + VolumeChange24h = 'volumeChange24h', + VolumeShares1h = 'volumeShares1h', + VolumeShares1w = 'volumeShares1w', + VolumeShares4h = 'volumeShares4h', + VolumeShares5m = 'volumeShares5m', + VolumeShares12h = 'volumeShares12h', + VolumeShares24h = 'volumeShares24h', + VolumeUsd1h = 'volumeUsd1h', + VolumeUsd1w = 'volumeUsd1w', + VolumeUsd4h = 'volumeUsd4h', + VolumeUsd5m = 'volumeUsd5m', + VolumeUsd12h = 'volumeUsd12h', + VolumeUsd24h = 'volumeUsd24h' +} + +/** The prediction protocol or venue. */ +export enum PredictionProtocol { + Kalshi = 'KALSHI', + Polymarket = 'POLYMARKET' +} + +/** Resolution details for a settled prediction market or event. */ +export type PredictionResolution = { + __typename?: 'PredictionResolution'; + /** The resolution result. */ + result?: Maybe; + /** The resolution source. */ + source?: Maybe; +}; + +/** The duration used to request windowed prediction stats. */ +export enum PredictionStatsDuration { + Day1 = 'day1', + Hour1 = 'hour1', + Hour4 = 'hour4', + Hour12 = 'hour12', + Min5 = 'min5', + Week1 = 'week1' +} + +/** A prediction sub-subcategory (3rd level, terminal). */ +export type PredictionSubSubcategory = { + __typename?: 'PredictionSubSubcategory'; + /** The display name. */ + name: Scalars['String']['output']; + /** The URL slug. */ + slug: Scalars['String']['output']; +}; + +/** A prediction subcategory (2nd level). */ +export type PredictionSubcategory = { + __typename?: 'PredictionSubcategory'; + /** The display name. */ + name: Scalars['String']['output']; + /** The URL slug. */ + slug: Scalars['String']['output']; + /** Nested subcategories (3rd level). */ + subcategories?: Maybe>; +}; + +/** A wallet's token balance for a prediction market. */ +export type PredictionTokenBalance = { + __typename?: 'PredictionTokenBalance'; + /** The token amount. */ + amount: Scalars['String']['output']; + /** The associated prediction trader. */ + predictionTrader?: Maybe; + /** The wallet address. */ + walletAddress: Scalars['String']['output']; +}; + +/** A paginated list of prediction token holders. */ +export type PredictionTokenHoldersConnection = { + __typename?: 'PredictionTokenHoldersConnection'; + /** Cursor for pagination. */ + cursor?: Maybe; + /** The list of items. */ + items: Array; + /** The total number of items. */ + total: Scalars['Int']['output']; +}; + +/** Input type of `predictionTokenHolders`. */ +export type PredictionTokenHoldersInput = { + /** Cursor for pagination. */ + cursor?: InputMaybe; + /** Maximum number of results to return. */ + limit?: InputMaybe; + /** The ID of the prediction market. */ + marketId: Scalars['String']['input']; + /** The token ID. */ + tokenId: Scalars['String']['input']; +}; + +/** A single prediction trade. */ +export type PredictionTrade = { + __typename?: 'PredictionTrade'; + /** The token amount. */ + amount?: Maybe; + /** The amount collateral. */ + amountCollateral?: Maybe; + /** The amount usd. */ + amountUsd?: Maybe; + /** The block number. */ + blockNumber?: Maybe; + /** The exchange contract address. */ + exchangeAddress?: Maybe; + /** The maker. */ + maker?: Maybe; + /** The ID of the prediction market. */ + marketId: Scalars['String']['output']; + /** The network ID. */ + networkId?: Maybe; + /** The ID of the prediction outcome. */ + outcomeId: Scalars['String']['output']; + /** The outcome index. */ + outcomeIndex?: Maybe; + /** The label of the outcome. */ + outcomeLabel: Scalars['String']['output']; + /** The prediction market. */ + predictionMarket?: Maybe; + /** The price collateral. */ + priceCollateral?: Maybe; + /** The price usd. */ + priceUsd?: Maybe; + /** The prediction protocol. */ + protocol: PredictionProtocol; + /** The sort key. */ + sortKey: Scalars['String']['output']; + /** The unix timestamp. */ + timestamp: Scalars['Int']['output']; + /** The type of trade. */ + tradeType: PredictionTradeType; + /** The ID of the prediction trader. */ + traderId?: Maybe; + /** The transaction hash. */ + transactionHash?: Maybe; + /** The transaction id. */ + transactionId?: Maybe; +}; + +/** Prediction trade event types. */ +export enum PredictionTradeEventType { + Buy = 'BUY', + BuyCounterparty = 'BUY_COUNTERPARTY', + PayoutRedemption = 'PAYOUT_REDEMPTION', + Sell = 'SELL', + SellCounterparty = 'SELL_COUNTERPARTY', + Trade = 'TRADE' +} + +/** Prediction trade event type condition. */ +export type PredictionTradeEventTypeCondition = { + __typename?: 'PredictionTradeEventTypeCondition'; + /** The list of prediction trade event types. */ + oneOf: Array; +}; + +/** Input for prediction trade event type condition. */ +export type PredictionTradeEventTypeConditionInput = { + /** The list of prediction trade event types to match. */ + oneOf: Array; +}; + +/** The type of a prediction trade. */ +export enum PredictionTradeType { + Buy = 'BUY', + BuyCounterparty = 'BUY_COUNTERPARTY', + PayoutRedemption = 'PAYOUT_REDEMPTION', + Sell = 'SELL', + SellCounterparty = 'SELL_COUNTERPARTY', + Trade = 'TRADE' +} + +/** Webhook conditions for a prediction trade event. */ +export type PredictionTradeWebhookCondition = { + __typename?: 'PredictionTradeWebhookCondition'; + /** The amount of tokens/shares traded condition. */ + amountToken?: Maybe; + /** The event ID the webhook is listening for. */ + eventId?: Maybe; + /** The trade event types the webhook is listening for. */ + eventType?: Maybe; + /** The market ID the webhook is listening for. */ + marketId?: Maybe; + /** The trade value in USD condition. */ + tradeValueUsd?: Maybe; + /** The trader ID the webhook is listening for. */ + traderId?: Maybe; +}; + +/** Input conditions for a prediction trade webhook. */ +export type PredictionTradeWebhookConditionInput = { + /** The amount of tokens/shares traded condition. */ + amountToken?: InputMaybe; + /** The event ID to listen for. */ + eventId?: InputMaybe; + /** The trade event types to listen for. */ + eventType?: InputMaybe; + /** The market ID to listen for. */ + marketId?: InputMaybe; + /** The trade value in USD condition. */ + tradeValueUsd?: InputMaybe; + /** The trader ID to listen for. */ + traderId?: InputMaybe; +}; + +/** A prediction trader with aggregate stats and metadata. */ +export type PredictionTrader = { + __typename?: 'PredictionTrader'; + /** The active markets count. */ + activeMarketsCount: Scalars['Int']['output']; + /** The trader alias. */ + alias?: Maybe; + /** The all time profit ct. */ + allTimeProfitCT: Scalars['String']['output']; + /** The all time profit usd. */ + allTimeProfitUsd: Scalars['String']['output']; + /** The biggest loss ct. */ + biggestLossCT: Scalars['String']['output']; + /** The biggest loss usd. */ + biggestLossUsd: Scalars['String']['output']; + /** The biggest win ct. */ + biggestWinCT: Scalars['String']['output']; + /** The biggest win usd. */ + biggestWinUsd: Scalars['String']['output']; + /** The creation timestamp. */ + createdAt: Scalars['Int']['output']; + /** The timestamp of the first trade. */ + firstTradeTimestamp: Scalars['Int']['output']; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** Labels applied to this entity. */ + labels?: Maybe>; + /** The timestamp of the last trade. */ + lastTradeTimestamp: Scalars['Int']['output']; + /** The linked addresses. */ + linkedAddresses?: Maybe>; + /** The primary address. */ + primaryAddress?: Maybe; + /** The profile image url. */ + profileImageUrl?: Maybe; + /** The profile url. */ + profileUrl?: Maybe; + /** The prediction protocol. */ + protocol: PredictionProtocol; + /** The total trades count. */ + totalTradesCount: Scalars['Int']['output']; + /** The total volume ct. */ + totalVolumeCT: Scalars['String']['output']; + /** The total volume usd. */ + totalVolumeUsd: Scalars['String']['output']; + /** The last update timestamp. */ + updatedAt: Scalars['Int']['output']; + /** The venue trader id. */ + venueTraderId: Scalars['String']['output']; +}; + +/** Bar data for a prediction trader at a single point in time. */ +export type PredictionTraderBar = { + __typename?: 'PredictionTraderBar'; + /** Buy volume in collateral token units. */ + buyVolumeCT?: Maybe; + /** Buy volume in USD. */ + buyVolumeUsd?: Maybe; + /** The number of buys. */ + buys?: Maybe; + /** The cumulative realized pnl ct. */ + cumulativeRealizedPnlCT?: Maybe; + /** The cumulative realized pnl usd. */ + cumulativeRealizedPnlUsd?: Maybe; + /** The losses. */ + losses?: Maybe; + /** The realized pnl ct. */ + realizedPnlCT?: Maybe; + /** The realized pnl usd. */ + realizedPnlUsd?: Maybe; + /** Sell volume in collateral token units. */ + sellVolumeCT?: Maybe; + /** Sell volume in USD. */ + sellVolumeUsd?: Maybe; + /** The number of sells. */ + sells?: Maybe; + /** The unix timestamp for this bar. */ + t: Scalars['Int']['output']; + /** The number of trades. */ + trades?: Maybe; + /** The number of unique markets. */ + uniqueMarkets?: Maybe; + /** Volume in collateral token units. */ + volumeCT?: Maybe; + /** Volume in USD. */ + volumeUsd?: Maybe; + /** The wins. */ + wins?: Maybe; +}; + +/** Input type of `predictionTraderBars`. */ +export type PredictionTraderBarsInput = { + /** Number of bars to return counting back from `to`. */ + countback?: InputMaybe; + /** The start timestamp (unix seconds). */ + from: Scalars['Int']['input']; + /** Whether to omit bars with no activity. */ + removeEmptyBars?: InputMaybe; + /** The resolution details. */ + resolution: PredictionTraderBarsResolution; + /** The end timestamp (unix seconds). */ + to: Scalars['Int']['input']; + /** The ID of the prediction trader. */ + traderId: Scalars['String']['input']; +}; + +/** The time resolution for prediction trader bar data. */ +export enum PredictionTraderBarsResolution { + Day1 = 'day1', + Hour1 = 'hour1', + Hour4 = 'hour4', + Week1 = 'week1' +} + +/** Response returned by `predictionTraderBars`. */ +export type PredictionTraderBarsResponse = { + __typename?: 'PredictionTraderBarsResponse'; + /** The bar data. */ + bars: Array; + /** The trader. */ + trader?: Maybe; + /** The ID of the prediction trader. */ + traderId: Scalars['String']['output']; +}; + +/** Response returned by `filterPredictionTraders`. */ +export type PredictionTraderFilterConnection = { + __typename?: 'PredictionTraderFilterConnection'; + /** Total number of matching results. */ + count: Scalars['Int']['output']; + /** The current page number. */ + page: Scalars['Int']['output']; + /** The list of results. */ + results: Array; +}; + +/** A prediction trader matching a set of filter parameters. */ +export type PredictionTraderFilterResult = { + __typename?: 'PredictionTraderFilterResult'; + /** Active markets count */ + activeMarketsCount: Scalars['Int']['output']; + /** Average profit USD per trade 1m */ + averageProfitUsdPerTrade1m: Scalars['String']['output']; + /** Average profit USD per trade 1w */ + averageProfitUsdPerTrade1w: Scalars['String']['output']; + /** Average profit USD per trade 12h */ + averageProfitUsdPerTrade12h: Scalars['String']['output']; + /** Average profit USD per trade 24h */ + averageProfitUsdPerTrade24h: Scalars['String']['output']; + /** Average swap amount USD 1m */ + averageSwapAmountUsd1m: Scalars['String']['output']; + /** Average swap amount USD 1w */ + averageSwapAmountUsd1w: Scalars['String']['output']; + /** Average swap amount USD 12h */ + averageSwapAmountUsd12h: Scalars['String']['output']; + /** Average swap amount USD 24h */ + averageSwapAmountUsd24h: Scalars['String']['output']; + /** Biggest loss CT */ + biggestLossCT: Scalars['String']['output']; + /** Biggest loss USD */ + biggestLossUsd: Scalars['String']['output']; + /** Biggest win CT */ + biggestWinCT: Scalars['String']['output']; + /** Biggest win USD */ + biggestWinUsd: Scalars['String']['output']; + /** Buy volume USD 1m */ + buyVolumeUsd1m: Scalars['String']['output']; + /** Buy volume USD 1w */ + buyVolumeUsd1w: Scalars['String']['output']; + /** Buy volume USD 12h */ + buyVolumeUsd12h: Scalars['String']['output']; + /** Buy volume USD 24h */ + buyVolumeUsd24h: Scalars['String']['output']; + /** Buys 1m */ + buys1m: Scalars['Int']['output']; + /** Buys 1w */ + buys1w: Scalars['Int']['output']; + /** Buys 12h */ + buys12h: Scalars['Int']['output']; + /** Buys 24h */ + buys24h: Scalars['Int']['output']; + /** First trade timestamp */ + firstTradeTimestamp: Scalars['Int']['output']; + /** Held token acquisition cost CT */ + heldTokenAcquisitionCostCT: Scalars['String']['output']; + /** Held token acquisition cost USD */ + heldTokenAcquisitionCostUsd: Scalars['String']['output']; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** Last trade timestamp */ + lastTradeTimestamp: Scalars['Int']['output']; + /** Losses 1m */ + losses1m: Scalars['Int']['output']; + /** Losses 1w */ + losses1w: Scalars['Int']['output']; + /** Losses 12h */ + losses12h: Scalars['Int']['output']; + /** Losses 24h */ + losses24h: Scalars['Int']['output']; + /** All-time PnL per volume */ + pnlPerVolumeAll: Scalars['Float']['output']; + /** Full trader entity (loaded via DataLoader) */ + predictionTrader?: Maybe; + /** Profit per trade USD all-time */ + profitPerTradeUsdAll: Scalars['String']['output']; + /** Realized PnL CT 1m */ + realizedPnlCT1m: Scalars['String']['output']; + /** Realized PnL CT 1w */ + realizedPnlCT1w: Scalars['String']['output']; + /** Realized PnL CT 12h */ + realizedPnlCT12h: Scalars['String']['output']; + /** Realized PnL CT 24h */ + realizedPnlCT24h: Scalars['String']['output']; + /** Realized PnL change 1m */ + realizedPnlChange1m: Scalars['Float']['output']; + /** Realized PnL change 1w */ + realizedPnlChange1w: Scalars['Float']['output']; + /** Realized PnL change 12h */ + realizedPnlChange12h: Scalars['Float']['output']; + /** Realized PnL change 24h */ + realizedPnlChange24h: Scalars['Float']['output']; + /** Realized PnL USD 1m */ + realizedPnlUsd1m: Scalars['String']['output']; + /** Realized PnL USD 1w */ + realizedPnlUsd1w: Scalars['String']['output']; + /** Realized PnL USD 12h */ + realizedPnlUsd12h: Scalars['String']['output']; + /** Realized PnL USD 24h */ + realizedPnlUsd24h: Scalars['String']['output']; + /** Realized profit percentage 1m */ + realizedProfitPercentage1m: Scalars['Float']['output']; + /** Realized profit percentage 1w */ + realizedProfitPercentage1w: Scalars['Float']['output']; + /** Realized profit percentage 12h */ + realizedProfitPercentage12h: Scalars['Float']['output']; + /** Realized profit percentage 24h */ + realizedProfitPercentage24h: Scalars['Float']['output']; + /** Sell volume USD 1m */ + sellVolumeUsd1m: Scalars['String']['output']; + /** Sell volume USD 1w */ + sellVolumeUsd1w: Scalars['String']['output']; + /** Sell volume USD 12h */ + sellVolumeUsd12h: Scalars['String']['output']; + /** Sell volume USD 24h */ + sellVolumeUsd24h: Scalars['String']['output']; + /** Sells 1m */ + sells1m: Scalars['Int']['output']; + /** Sells 1w */ + sells1w: Scalars['Int']['output']; + /** Sells 12h */ + sells12h: Scalars['Int']['output']; + /** Sells 24h */ + sells24h: Scalars['Int']['output']; + /** The unix timestamp. */ + timestamp: Scalars['Int']['output']; + /** All-time total profit CT */ + totalProfitCTAll: Scalars['String']['output']; + /** All-time total profit USD */ + totalProfitUsdAll: Scalars['String']['output']; + /** All-time total trades */ + totalTradesAll: Scalars['Int']['output']; + /** All-time total volume CT */ + totalVolumeCTAll: Scalars['String']['output']; + /** All-time total volume USD */ + totalVolumeUsdAll: Scalars['String']['output']; + /** Minimal trader info embedded in the result */ + trader: FilterTrader; + /** Trades 1m */ + trades1m: Scalars['Int']['output']; + /** Trades 1w */ + trades1w: Scalars['Int']['output']; + /** Trades 12h */ + trades12h: Scalars['Int']['output']; + /** Trades 24h */ + trades24h: Scalars['Int']['output']; + /** Unique markets 1m */ + uniqueMarkets1m: Scalars['Int']['output']; + /** Unique markets 1w */ + uniqueMarkets1w: Scalars['Int']['output']; + /** Unique markets 12h */ + uniqueMarkets12h: Scalars['Int']['output']; + /** Unique markets 24h */ + uniqueMarkets24h: Scalars['Int']['output']; + /** Volume CT 1m */ + volumeCT1m: Scalars['String']['output']; + /** Volume CT 1w */ + volumeCT1w: Scalars['String']['output']; + /** Volume CT 12h */ + volumeCT12h: Scalars['String']['output']; + /** Volume CT 24h */ + volumeCT24h: Scalars['String']['output']; + /** Volume change 1m */ + volumeChange1m: Scalars['Float']['output']; + /** Volume change 1w */ + volumeChange1w: Scalars['Float']['output']; + /** Volume change 12h */ + volumeChange12h: Scalars['Float']['output']; + /** Volume change 24h */ + volumeChange24h: Scalars['Float']['output']; + /** Volume per trade USD all-time */ + volumePerTradeUsdAll: Scalars['String']['output']; + /** Volume USD 1m */ + volumeUsd1m: Scalars['String']['output']; + /** Volume USD 1w */ + volumeUsd1w: Scalars['String']['output']; + /** Volume USD 12h */ + volumeUsd12h: Scalars['String']['output']; + /** Volume USD 24h */ + volumeUsd24h: Scalars['String']['output']; + /** Win rate 1m (0-1) */ + winRate1m: Scalars['Float']['output']; + /** Win rate 1w (0-1) */ + winRate1w: Scalars['Float']['output']; + /** Win rate 12h (0-1) */ + winRate12h: Scalars['Float']['output']; + /** Win rate 24h (0-1) */ + winRate24h: Scalars['Float']['output']; + /** Wins 1m */ + wins1m: Scalars['Int']['output']; + /** Wins 1w */ + wins1w: Scalars['Int']['output']; + /** Wins 12h */ + wins12h: Scalars['Int']['output']; + /** Wins 24h */ + wins24h: Scalars['Int']['output']; +}; + +/** Filters for prediction traders. */ +export type PredictionTraderFilters = { + /** Filter by active markets count */ + activeMarketsCount?: InputMaybe; + /** Filter by average profit USD per trade 1m */ + averageProfitUsdPerTrade1m?: InputMaybe; + /** Filter by average profit USD per trade 1w */ + averageProfitUsdPerTrade1w?: InputMaybe; + /** Filter by average profit USD per trade 12h */ + averageProfitUsdPerTrade12h?: InputMaybe; + /** Filter by average profit USD per trade 24h */ + averageProfitUsdPerTrade24h?: InputMaybe; + /** Filter by average swap amount USD 1m */ + averageSwapAmountUsd1m?: InputMaybe; + /** Filter by average swap amount USD 1w */ + averageSwapAmountUsd1w?: InputMaybe; + /** Filter by average swap amount USD 12h */ + averageSwapAmountUsd12h?: InputMaybe; + /** Filter by average swap amount USD 24h */ + averageSwapAmountUsd24h?: InputMaybe; + /** Filter by biggest loss CT */ + biggestLossCT?: InputMaybe; + /** Filter by biggest loss USD */ + biggestLossUsd?: InputMaybe; + /** Filter by biggest win CT */ + biggestWinCT?: InputMaybe; + /** Filter by biggest win USD */ + biggestWinUsd?: InputMaybe; + /** Filter by first trade timestamp */ + firstTradeTimestamp?: InputMaybe; + /** Filter by held token acquisition cost CT */ + heldTokenAcquisitionCostCT?: InputMaybe; + /** Filter by held token acquisition cost USD */ + heldTokenAcquisitionCostUsd?: InputMaybe; + /** Filter by labels */ + labels?: InputMaybe>; + /** Filter by last trade timestamp */ + lastTradeTimestamp?: InputMaybe; + /** Filter by losses 1m */ + losses1m?: InputMaybe; + /** Filter by losses 1w */ + losses1w?: InputMaybe; + /** Filter by losses 12h */ + losses12h?: InputMaybe; + /** Filter by losses 24h */ + losses24h?: InputMaybe; + /** Filter by all-time PnL per volume */ + pnlPerVolumeAll?: InputMaybe; + /** Filter by profit per trade USD all-time */ + profitPerTradeUsdAll?: InputMaybe; + /** Filter by protocol (e.g., POLYMARKET, KALSHI) */ + protocol?: InputMaybe>; + /** Filter by realized PnL change 1m */ + realizedPnlChange1m?: InputMaybe; + /** Filter by realized PnL change 1w */ + realizedPnlChange1w?: InputMaybe; + /** Filter by realized PnL change 12h */ + realizedPnlChange12h?: InputMaybe; + /** Filter by realized PnL change 24h */ + realizedPnlChange24h?: InputMaybe; + /** Filter by realized PnL USD 1m */ + realizedPnlUsd1m?: InputMaybe; + /** Filter by realized PnL USD 1w */ + realizedPnlUsd1w?: InputMaybe; + /** Filter by realized PnL USD 12h */ + realizedPnlUsd12h?: InputMaybe; + /** Filter by realized PnL USD 24h */ + realizedPnlUsd24h?: InputMaybe; + /** Filter by realized profit percentage 1m */ + realizedProfitPercentage1m?: InputMaybe; + /** Filter by realized profit percentage 1w */ + realizedProfitPercentage1w?: InputMaybe; + /** Filter by realized profit percentage 12h */ + realizedProfitPercentage12h?: InputMaybe; + /** Filter by realized profit percentage 24h */ + realizedProfitPercentage24h?: InputMaybe; + /** Filter by timestamp */ + timestamp?: InputMaybe; + /** Filter by all-time total profit CT */ + totalProfitCTAll?: InputMaybe; + /** Filter by all-time total profit USD */ + totalProfitUsdAll?: InputMaybe; + /** Filter by all-time total trades */ + totalTradesAll?: InputMaybe; + /** Filter by all-time total volume CT */ + totalVolumeCTAll?: InputMaybe; + /** Filter by all-time total volume USD */ + totalVolumeUsdAll?: InputMaybe; + /** Filter by trades 1m */ + trades1m?: InputMaybe; + /** Filter by trades 1w */ + trades1w?: InputMaybe; + /** Filter by trades 12h */ + trades12h?: InputMaybe; + /** Filter by trades 24h */ + trades24h?: InputMaybe; + /** Filter by unique markets 1m */ + uniqueMarkets1m?: InputMaybe; + /** Filter by unique markets 1w */ + uniqueMarkets1w?: InputMaybe; + /** Filter by unique markets 12h */ + uniqueMarkets12h?: InputMaybe; + /** Filter by unique markets 24h */ + uniqueMarkets24h?: InputMaybe; + /** Filter by volume change 1m */ + volumeChange1m?: InputMaybe; + /** Filter by volume change 1w */ + volumeChange1w?: InputMaybe; + /** Filter by volume change 12h */ + volumeChange12h?: InputMaybe; + /** Filter by volume change 24h */ + volumeChange24h?: InputMaybe; + /** Filter by volume per trade USD all-time */ + volumePerTradeUsdAll?: InputMaybe; + /** Filter by volume USD 1m */ + volumeUsd1m?: InputMaybe; + /** Filter by volume USD 1w */ + volumeUsd1w?: InputMaybe; + /** Filter by volume USD 12h */ + volumeUsd12h?: InputMaybe; + /** Filter by volume USD 24h */ + volumeUsd24h?: InputMaybe; + /** Filter by win rate 1m */ + winRate1m?: InputMaybe; + /** Filter by win rate 1w */ + winRate1w?: InputMaybe; + /** Filter by win rate 12h */ + winRate12h?: InputMaybe; + /** Filter by win rate 24h */ + winRate24h?: InputMaybe; + /** Filter by wins 1m */ + wins1m?: InputMaybe; + /** Filter by wins 1w */ + wins1w?: InputMaybe; + /** Filter by wins 12h */ + wins12h?: InputMaybe; + /** Filter by wins 24h */ + wins24h?: InputMaybe; +}; + +/** A trader's token holding for a prediction outcome. */ +export type PredictionTraderHolding = { + __typename?: 'PredictionTraderHolding'; + /** The token balance amount. */ + amount: Scalars['String']['output']; + /** The prediction market this holding belongs to. */ + market?: Maybe; + /** The outcome index within the market (0 or 1). */ + outcomeIndex?: Maybe; + /** The token ID (venue outcome ID). */ + tokenId: Scalars['String']['output']; + /** The trader ID. */ + traderId: Scalars['String']['output']; + /** The venue trader ID (wallet address). */ + venueTraderId: Scalars['String']['output']; +}; + +/** A paginated list of trader holdings. */ +export type PredictionTraderHoldingsConnection = { + __typename?: 'PredictionTraderHoldingsConnection'; + /** Cursor for pagination. */ + cursor?: Maybe; + /** The list of holdings. */ + items: Array; +}; + +/** Input for `predictionTraderHoldings` query. */ +export type PredictionTraderHoldingsInput = { + /** Cursor for pagination. */ + cursor?: InputMaybe; + /** Maximum number of results to return. */ + limit?: InputMaybe; + /** The trader ID (format: {walletAddress}:{protocol}, e.g. 0x123...abc:Polymarket) */ + traderId: Scalars['String']['input']; +}; + +/** Response returned by `filterPredictionTraderMarkets`. */ +export type PredictionTraderMarketFilterConnection = { + __typename?: 'PredictionTraderMarketFilterConnection'; + /** Total number of matching results. */ + count: Scalars['Int']['output']; + /** The current page number. */ + page: Scalars['Int']['output']; + /** The list of results. */ + results: Array; +}; + +/** A trader-market record matching a set of filter parameters. */ +export type PredictionTraderMarketFilterResult = { + __typename?: 'PredictionTraderMarketFilterResult'; + /** The ID of the prediction event. */ + eventId: Scalars['String']['output']; + /** The timestamp of the first trade. */ + firstTradeTimestamp: Scalars['Int']['output']; + /** Whether the trader has an open position. */ + hasOpenPosition: Scalars['Boolean']['output']; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** The timestamp of the last trade. */ + lastTradeTimestamp: Scalars['Int']['output']; + /** Minimal market info embedded in the result */ + market: FilterTraderMarket; + /** The ID of the prediction market. */ + marketId: Scalars['String']['output']; + /** Outcome 0 data. */ + outcome0: PredictionTraderOutcomeFilterResult; + /** Outcome 1 data. */ + outcome1: PredictionTraderOutcomeFilterResult; + /** The pnl per volume market. */ + pnlPerVolumeMarket: Scalars['String']['output']; + /** Full market entity (loaded via DataLoader) */ + predictionMarket?: Maybe; + /** Full trader entity (loaded via DataLoader) */ + predictionTrader?: Maybe; + /** The profit per trade usd. */ + profitPerTradeUsd: Scalars['String']['output']; + /** The unix timestamp. */ + timestamp: Scalars['Int']['output']; + /** The total buys. */ + totalBuys: Scalars['Int']['output']; + /** The total cost basis ct. */ + totalCostBasisCT: Scalars['String']['output']; + /** The total cost basis usd. */ + totalCostBasisUsd: Scalars['String']['output']; + /** The total current position value in collateral token units. Returns 0 when there are no open held positions; null when any open held position is missing latest price data. */ + totalCurrentPositionValueCT?: Maybe; + /** The total current position value in USD. Returns 0 when there are no open held positions; null when any open held position is missing latest price data. */ + totalCurrentPositionValueUsd?: Maybe; + /** The total realized pnl ct. */ + totalRealizedPnlCT: Scalars['String']['output']; + /** The total realized pnl usd. */ + totalRealizedPnlUsd: Scalars['String']['output']; + /** The total sells. */ + totalSells: Scalars['Int']['output']; + /** The total shares held. */ + totalSharesHeld: Scalars['String']['output']; + /** The total trades. */ + totalTrades: Scalars['Int']['output']; + /** The total unrealized pnl in collateral token units. Returns 0 when there are no open held positions; null when any open held position is missing latest price data. */ + totalUnrealizedPnlCT?: Maybe; + /** The total unrealized pnl in USD. Returns 0 when there are no open held positions; null when any open held position is missing latest price data. */ + totalUnrealizedPnlUsd?: Maybe; + /** The total volume ct. */ + totalVolumeCT: Scalars['String']['output']; + /** The total volume shares. */ + totalVolumeShares: Scalars['String']['output']; + /** The total volume usd. */ + totalVolumeUsd: Scalars['String']['output']; + /** Minimal trader info embedded in the result */ + trader: FilterTrader; + /** The ID of the prediction trader. */ + traderId: Scalars['String']['output']; + /** The ID of the winning outcome. */ + winningOutcomeId?: Maybe; +}; + +/** Filters for trader-market records. */ +export type PredictionTraderMarketFilters = { + /** The timestamp of the first trade. */ + firstTradeTimestamp?: InputMaybe; + /** Filter by whether trader has an open position */ + hasOpenPosition?: InputMaybe; + /** The timestamp of the last trade. */ + lastTradeTimestamp?: InputMaybe; + /** Outcome 0 buys. */ + outcome0Buys?: InputMaybe; + /** Outcome 0 cost basis usd. */ + outcome0CostBasisUsd?: InputMaybe; + /** Filter by outcome 0 PnL status */ + outcome0PnlStatus?: InputMaybe>; + /** Outcome 0 realized pnl usd. */ + outcome0RealizedPnlUsd?: InputMaybe; + /** Outcome 0 sells. */ + outcome0Sells?: InputMaybe; + /** Outcome 0 shares held. */ + outcome0SharesHeld?: InputMaybe; + /** Outcome 1 buys. */ + outcome1Buys?: InputMaybe; + /** Outcome 1 cost basis usd. */ + outcome1CostBasisUsd?: InputMaybe; + /** Filter by outcome 1 PnL status */ + outcome1PnlStatus?: InputMaybe>; + /** Outcome 1 realized pnl usd. */ + outcome1RealizedPnlUsd?: InputMaybe; + /** Outcome 1 sells. */ + outcome1Sells?: InputMaybe; + /** Outcome 1 shares held. */ + outcome1SharesHeld?: InputMaybe; + /** The pnl per volume market. */ + pnlPerVolumeMarket?: InputMaybe; + /** The profit per trade usd. */ + profitPerTradeUsd?: InputMaybe; + /** Filter by prediction protocol */ + protocol?: InputMaybe>; + /** Filter by market status */ + status?: InputMaybe>; + /** The unix timestamp. */ + timestamp?: InputMaybe; + /** The total buys. */ + totalBuys?: InputMaybe; + /** The total cost basis ct. */ + totalCostBasisCT?: InputMaybe; + /** The total cost basis usd. */ + totalCostBasisUsd?: InputMaybe; + /** The total realized pnl ct. */ + totalRealizedPnlCT?: InputMaybe; + /** The total realized pnl usd. */ + totalRealizedPnlUsd?: InputMaybe; + /** The total sells. */ + totalSells?: InputMaybe; + /** The total shares held. */ + totalSharesHeld?: InputMaybe; + /** The total trades. */ + totalTrades?: InputMaybe; + /** The total volume ct. */ + totalVolumeCT?: InputMaybe; + /** The total volume shares. */ + totalVolumeShares?: InputMaybe; + /** The total volume usd. */ + totalVolumeUsd?: InputMaybe; +}; + +/** The PnL status of a trader position in a market. */ +export enum PredictionTraderMarketPnlStatus { + Loss = 'LOSS', + Neutral = 'NEUTRAL', + Win = 'WIN' +} + +/** A ranking to apply when sorting trader-market records. */ +export type PredictionTraderMarketRanking = { + /** The attribute to rank by. */ + attribute: PredictionTraderMarketRankingAttribute; + /** The sort direction. */ + direction?: InputMaybe; +}; + +/** The attribute used to rank trader-market records. */ +export enum PredictionTraderMarketRankingAttribute { + FirstTradeTimestamp = 'firstTradeTimestamp', + LastTradeTimestamp = 'lastTradeTimestamp', + Outcome0Buys = 'outcome0Buys', + Outcome0CostBasisUsd = 'outcome0CostBasisUsd', + Outcome0RealizedPnlUsd = 'outcome0RealizedPnlUsd', + Outcome0Sells = 'outcome0Sells', + Outcome0SharesHeld = 'outcome0SharesHeld', + Outcome1Buys = 'outcome1Buys', + Outcome1CostBasisUsd = 'outcome1CostBasisUsd', + Outcome1RealizedPnlUsd = 'outcome1RealizedPnlUsd', + Outcome1Sells = 'outcome1Sells', + Outcome1SharesHeld = 'outcome1SharesHeld', + PnlPerVolumeMarket = 'pnlPerVolumeMarket', + ProfitPerTradeUsd = 'profitPerTradeUsd', + Timestamp = 'timestamp', + TotalBuys = 'totalBuys', + TotalCostBasisCt = 'totalCostBasisCT', + TotalCostBasisUsd = 'totalCostBasisUsd', + TotalRealizedPnlCt = 'totalRealizedPnlCT', + TotalRealizedPnlUsd = 'totalRealizedPnlUsd', + TotalSells = 'totalSells', + TotalSharesHeld = 'totalSharesHeld', + TotalTrades = 'totalTrades', + TotalVolumeCt = 'totalVolumeCT', + TotalVolumeShares = 'totalVolumeShares', + TotalVolumeUsd = 'totalVolumeUsd' +} + +/** Per-market stats for a trader. */ +export type PredictionTraderMarketStats = { + __typename?: 'PredictionTraderMarketStats'; + /** The creation timestamp. */ + createdAt: Scalars['Int']['output']; + /** Whether the trader has an open position. */ + hasOpenPosition: Scalars['Boolean']['output']; + /** The ID of the prediction market. */ + marketId: Scalars['String']['output']; + /** Outcome 0 stats. */ + outcome0Stats: PredictionTraderOutcomeStats; + /** Outcome 1 stats. */ + outcome1Stats: PredictionTraderOutcomeStats; + /** The prediction market. */ + predictionMarket?: Maybe; + /** The ID of the prediction trader. */ + traderId: Scalars['String']['output']; + /** The last update timestamp. */ + updatedAt: Scalars['Int']['output']; +}; + +/** Response returned by `predictionTraderMarketsStats`. */ +export type PredictionTraderMarketsStatsConnection = { + __typename?: 'PredictionTraderMarketsStatsConnection'; + /** Cursor for pagination. */ + cursor?: Maybe; + /** The list of items. */ + items: Array; +}; + +/** Input type of `predictionTraderMarketsStats`. */ +export type PredictionTraderMarketsStatsInput = { + /** Cursor for pagination. */ + cursor?: InputMaybe; + /** Maximum number of results to return. */ + limit?: InputMaybe; + /** Associated market IDs. */ + marketIds?: InputMaybe>; + /** The ID of the prediction trader. */ + traderId: Scalars['String']['input']; +}; + +/** Per-outcome stats within a trader-market filter result. */ +export type PredictionTraderOutcomeFilterResult = { + __typename?: 'PredictionTraderOutcomeFilterResult'; + /** The avg entry price ct. */ + avgEntryPriceCT: Scalars['String']['output']; + /** The avg entry price usd. */ + avgEntryPriceUsd: Scalars['String']['output']; + /** Buy volume in collateral token units. */ + buyVolumeCT: Scalars['String']['output']; + /** Buy volume in shares. */ + buyVolumeShares: Scalars['String']['output']; + /** Buy volume in USD. */ + buyVolumeUsd: Scalars['String']['output']; + /** The number of buys. */ + buys: Scalars['Int']['output']; + /** The cost basis ct. */ + costBasisCT: Scalars['String']['output']; + /** The cost basis usd. */ + costBasisUsd: Scalars['String']['output']; + /** The current position value in collateral token units. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position. */ + currentPositionValueCT?: Maybe; + /** The current position value in USD. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position. */ + currentPositionValueUsd?: Maybe; + /** The current outcome price in collateral token units. Null when latest price data is unavailable. */ + currentPriceCT?: Maybe; + /** The current outcome price in USD. Null when latest price data is unavailable. */ + currentPriceUsd?: Maybe; + /** The timestamp of the first trade. */ + firstTradeTimestamp: Scalars['Int']['output']; + /** The is winning outcome. */ + isWinningOutcome: Scalars['Boolean']['output']; + /** The timestamp of the last trade. */ + lastTradeTimestamp: Scalars['Int']['output']; + /** The ID of the prediction outcome. */ + outcomeId: Scalars['String']['output']; + /** The pnl status. */ + pnlStatus: PredictionTraderMarketPnlStatus; + /** The realized pnl ct. */ + realizedPnlCT: Scalars['String']['output']; + /** The realized pnl usd. */ + realizedPnlUsd: Scalars['String']['output']; + /** Sell volume in collateral token units. */ + sellVolumeCT: Scalars['String']['output']; + /** Sell volume in shares. */ + sellVolumeShares: Scalars['String']['output']; + /** Sell volume in USD. */ + sellVolumeUsd: Scalars['String']['output']; + /** The number of sells. */ + sells: Scalars['Int']['output']; + /** The shares held. */ + sharesHeld: Scalars['String']['output']; + /** The unrealized pnl in collateral token units. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position. */ + unrealizedPnlCT?: Maybe; + /** The unrealized pnl in USD. Returns 0 for closed/no-share positions; null when latest price data is unavailable for an open position. */ + unrealizedPnlUsd?: Maybe; +}; + +/** Per-outcome stats for a trader within a specific market. */ +export type PredictionTraderOutcomeStats = { + __typename?: 'PredictionTraderOutcomeStats'; + /** The avg entry price ct. */ + avgEntryPriceCT: Scalars['String']['output']; + /** The avg entry price usd. */ + avgEntryPriceUsd: Scalars['String']['output']; + /** Buy volume in collateral token units. */ + buyVolumeCT: Scalars['String']['output']; + /** Buy volume in shares. */ + buyVolumeShares: Scalars['String']['output']; + /** Buy volume in USD. */ + buyVolumeUsd: Scalars['String']['output']; + /** The number of buys. */ + buys: Scalars['Int']['output']; + /** The cost basis ct. */ + costBasisCT: Scalars['String']['output']; + /** The cost basis usd. */ + costBasisUsd: Scalars['String']['output']; + /** The timestamp of the first trade. */ + firstTradeTimestamp: Scalars['Int']['output']; + /** The timestamp of the last trade. */ + lastTradeTimestamp: Scalars['Int']['output']; + /** The ID of the prediction outcome. */ + outcomeId: Scalars['String']['output']; + /** The pnl status. */ + pnlStatus: PredictionTraderMarketPnlStatus; + /** The realized pnl ct. */ + realizedPnlCT: Scalars['String']['output']; + /** The realized pnl usd. */ + realizedPnlUsd: Scalars['String']['output']; + /** Sell volume in collateral token units. */ + sellVolumeCT: Scalars['String']['output']; + /** Sell volume in shares. */ + sellVolumeShares: Scalars['String']['output']; + /** Sell volume in USD. */ + sellVolumeUsd: Scalars['String']['output']; + /** The number of sells. */ + sells: Scalars['Int']['output']; + /** The shares held. */ + sharesHeld: Scalars['String']['output']; +}; + +/** A ranking to apply when sorting prediction traders. */ +export type PredictionTraderRanking = { + /** The attribute to rank by. */ + attribute: PredictionTraderRankingAttribute; + /** The sort direction. */ + direction?: InputMaybe; +}; + +/** The attribute used to rank prediction traders. */ +export enum PredictionTraderRankingAttribute { + ActiveMarketsCount = 'ACTIVE_MARKETS_COUNT', + AverageProfitUsdPerTrade_1M = 'AVERAGE_PROFIT_USD_PER_TRADE_1M', + AverageProfitUsdPerTrade_1W = 'AVERAGE_PROFIT_USD_PER_TRADE_1W', + AverageProfitUsdPerTrade_12H = 'AVERAGE_PROFIT_USD_PER_TRADE_12H', + AverageProfitUsdPerTrade_24H = 'AVERAGE_PROFIT_USD_PER_TRADE_24H', + AverageSwapAmountUsd_1M = 'AVERAGE_SWAP_AMOUNT_USD_1M', + AverageSwapAmountUsd_1W = 'AVERAGE_SWAP_AMOUNT_USD_1W', + AverageSwapAmountUsd_12H = 'AVERAGE_SWAP_AMOUNT_USD_12H', + AverageSwapAmountUsd_24H = 'AVERAGE_SWAP_AMOUNT_USD_24H', + BiggestLossCt = 'BIGGEST_LOSS_CT', + BiggestLossUsd = 'BIGGEST_LOSS_USD', + BiggestWinCt = 'BIGGEST_WIN_CT', + BiggestWinUsd = 'BIGGEST_WIN_USD', + FirstTradeTimestamp = 'FIRST_TRADE_TIMESTAMP', + HeldTokenAcquisitionCostCt = 'HELD_TOKEN_ACQUISITION_COST_CT', + HeldTokenAcquisitionCostUsd = 'HELD_TOKEN_ACQUISITION_COST_USD', + LastTradeTimestamp = 'LAST_TRADE_TIMESTAMP', + Losses_1M = 'LOSSES_1M', + Losses_1W = 'LOSSES_1W', + Losses_12H = 'LOSSES_12H', + Losses_24H = 'LOSSES_24H', + PnlPerVolumeAll = 'PNL_PER_VOLUME_ALL', + ProfitPerTradeUsdAll = 'PROFIT_PER_TRADE_USD_ALL', + RealizedPnlChange_1M = 'REALIZED_PNL_CHANGE_1M', + RealizedPnlChange_1W = 'REALIZED_PNL_CHANGE_1W', + RealizedPnlChange_12H = 'REALIZED_PNL_CHANGE_12H', + RealizedPnlChange_24H = 'REALIZED_PNL_CHANGE_24H', + RealizedPnlUsd_1M = 'REALIZED_PNL_USD_1M', + RealizedPnlUsd_1W = 'REALIZED_PNL_USD_1W', + RealizedPnlUsd_12H = 'REALIZED_PNL_USD_12H', + RealizedPnlUsd_24H = 'REALIZED_PNL_USD_24H', + RealizedProfitPercentage_1M = 'REALIZED_PROFIT_PERCENTAGE_1M', + RealizedProfitPercentage_1W = 'REALIZED_PROFIT_PERCENTAGE_1W', + RealizedProfitPercentage_12H = 'REALIZED_PROFIT_PERCENTAGE_12H', + RealizedProfitPercentage_24H = 'REALIZED_PROFIT_PERCENTAGE_24H', + Timestamp = 'TIMESTAMP', + TotalProfitCtAll = 'TOTAL_PROFIT_CT_ALL', + TotalProfitUsdAll = 'TOTAL_PROFIT_USD_ALL', + TotalTradesAll = 'TOTAL_TRADES_ALL', + TotalVolumeCtAll = 'TOTAL_VOLUME_CT_ALL', + TotalVolumeUsdAll = 'TOTAL_VOLUME_USD_ALL', + Trades_1M = 'TRADES_1M', + Trades_1W = 'TRADES_1W', + Trades_12H = 'TRADES_12H', + Trades_24H = 'TRADES_24H', + UniqueMarkets_1M = 'UNIQUE_MARKETS_1M', + UniqueMarkets_1W = 'UNIQUE_MARKETS_1W', + UniqueMarkets_12H = 'UNIQUE_MARKETS_12H', + UniqueMarkets_24H = 'UNIQUE_MARKETS_24H', + VolumeChange_1M = 'VOLUME_CHANGE_1M', + VolumeChange_1W = 'VOLUME_CHANGE_1W', + VolumeChange_12H = 'VOLUME_CHANGE_12H', + VolumeChange_24H = 'VOLUME_CHANGE_24H', + VolumePerTradeUsdAll = 'VOLUME_PER_TRADE_USD_ALL', + VolumeUsd_1M = 'VOLUME_USD_1M', + VolumeUsd_1W = 'VOLUME_USD_1W', + VolumeUsd_12H = 'VOLUME_USD_12H', + VolumeUsd_24H = 'VOLUME_USD_24H', + Wins_1M = 'WINS_1M', + Wins_1W = 'WINS_1W', + Wins_12H = 'WINS_12H', + Wins_24H = 'WINS_24H', + WinRate_1M = 'WIN_RATE_1M', + WinRate_1W = 'WIN_RATE_1W', + WinRate_12H = 'WIN_RATE_12H', + WinRate_24H = 'WIN_RATE_24H' +} + +/** The duration used to request windowed trader stats. */ +export enum PredictionTraderStatsDuration { + Day1 = 'day1', + Day30 = 'day30', + Hour1 = 'hour1', + Hour4 = 'hour4', + Hour12 = 'hour12', + Week1 = 'week1' +} + +/** Input type of `predictionTraders`. */ +export type PredictionTradersInput = { + /** The trader ids. */ + traderIds: Array; +}; + +/** A paginated list of prediction trades. */ +export type PredictionTradesConnection = { + __typename?: 'PredictionTradesConnection'; + /** Cursor for pagination. */ + cursor?: Maybe; + /** The list of items. */ + items: Array; +}; + +/** Input type of `predictionTrades`. */ +export type PredictionTradesInput = { + /** Cursor for pagination. */ + cursor?: InputMaybe; + /** The ID of the prediction event. */ + eventId?: InputMaybe; + /** Maximum number of results to return. */ + limit?: InputMaybe; + /** The ID of the prediction market. */ + marketId?: InputMaybe; + /** The ID of the prediction trader. */ + traderId?: InputMaybe; +}; + +/** Real-time or historical prices for a token. */ +export type Price = { + __typename?: 'Price'; + /** The contract address of the token. */ + address: Scalars['String']['output']; + /** The pool that emitted the swap generating this price */ + blockNumber?: Maybe; + /** + * Ratio of how confident we are in the price + * @deprecated Pricing no longer based on specific pools + */ + confidence?: Maybe; + /** The network ID the token is deployed on. */ + networkId: Scalars['Int']['output']; + /** + * The pool that emitted the swap generating this price + * @deprecated Pricing no longer based on specific pools + */ + poolAddress?: Maybe; + /** The token price in USD. */ + priceUsd: Scalars['Float']['output']; + /** The unix timestamp for the price. */ + timestamp?: Maybe; +}; + +/** Webhook conditions for a price event. */ +export type PriceEventWebhookCondition = { + __typename?: 'PriceEventWebhookCondition'; + /** The liquidity condition (for the source pair) that must be met in order for the webhook to send. */ + liquidityUsd?: Maybe; + /** The network ID the webhook is listening on. */ + networkId: IntEqualsCondition; + /** The pair contract address the webhook is listening for. */ + pairAddress?: Maybe; + /** The price condition that must be met in order for the webhook to send. */ + priceUsd: ComparisonOperator; + /** The token contract address the webhook is listening for. */ + tokenAddress: StringEqualsCondition; + /** The volume condition (for the source pair) that must be met in order for the webhook to send. */ + volumeUsd?: Maybe; +}; + +/** Input conditions for a price event webhook. */ +export type PriceEventWebhookConditionInput = { + /** The liquidity conditions to listen for. */ + liquidityUsd?: InputMaybe; + /** The network ID to listen on. */ + networkId: IntEqualsConditionInput; + /** The contract address of the pair to listen for. */ + pairAddress?: InputMaybe; + /** The price conditions to listen for. */ + priceUsd: ComparisonOperatorInput; + /** The contract address of the token to listen for. */ + tokenAddress: StringEqualsConditionInput; + /** The volume conditions to listen for. */ + volumeUsd?: InputMaybe; +}; + +/** OHLC (Open/High/Low/Close) values for prices. */ +export type PriceOhlc = { + __typename?: 'PriceOHLC'; + /** Closing price. */ + close: PriceValuePair; + /** High price. */ + high: PriceValuePair; + /** Low price. */ + low: PriceValuePair; + /** Opening price. */ + open: PriceValuePair; +}; + +/** A price value pair containing both USD and collateral token prices. */ +export type PriceValuePair = { + __typename?: 'PriceValuePair'; + /** Price in collateral token units. */ + ct: Scalars['String']['output']; + /** Price in USD. */ + usd: Scalars['String']['output']; +}; + +/** An Echelon Prime Pool. */ +export type PrimePool = { + __typename?: 'PrimePool'; + /** Values calculated by Defined using on-chain data. */ calcData?: Maybe; /** Values obtained directly from the chain. */ chainData?: Maybe; @@ -6979,6 +11225,28 @@ export enum PublishingType { Single = 'SINGLE' } +/** Cashback fee data for Pump AMM swaps. */ +export type PumpAmmCashbackFeeData = { + __typename?: 'PumpAmmCashbackFeeData'; + /** Cashback amount in lamports. */ + cashbackAmountLamports: Scalars['String']['output']; + /** Cashback fee rate in basis points. */ + cashbackFeeBps: Scalars['Int']['output']; + /** Discriminant for the SupplementalFeeData union. */ + type: Scalars['String']['output']; +}; + +/** Cashback fee data for Pump V1 swaps. */ +export type PumpCashbackFeeData = { + __typename?: 'PumpCashbackFeeData'; + /** Cashback amount in lamports. */ + cashbackAmountLamports: Scalars['String']['output']; + /** Cashback fee rate in basis points. */ + cashbackFeeBps: Scalars['Int']['output']; + /** Discriminant for the SupplementalFeeData union. */ + type: Scalars['String']['output']; +}; + export type PumpData = { __typename?: 'PumpData'; /** Creator from create instruction data */ @@ -6998,8 +11266,16 @@ export type Query = { blocks: Array; /** Returns a URL for a pair chart. */ chartUrls?: Maybe; + /** Returns windowed and all-time stats for a prediction event. */ + detailedPredictionEventStats?: Maybe; + /** Returns windowed and all-time stats for a prediction market. */ + detailedPredictionMarketStats?: Maybe; + /** Returns windowed and all-time stats for a prediction trader. */ + detailedPredictionTraderStats?: Maybe; /** Returns detailed stats for a wallet. */ detailedWalletStats?: Maybe; + /** Filters prediction markets within a single event and returns structured classification metadata for each market. Use this instead of `filterPredictionMarkets` when you need entrant/segment/ladder details (country codes, period+stat grouping, parsed numeric/date rungs) without re-parsing labels client-side. */ + eventScopedFilterPredictionMarkets?: Maybe; /** Returns a list of exchanges based on a variety of filters. */ filterExchanges?: Maybe; /** @@ -7029,9 +11305,17 @@ export type Query = { filterNftPools?: Maybe; /** Returns a list of pairs based on a variety of filters. */ filterPairs?: Maybe; + /** Filters prediction events using optional text, IDs, and ranking criteria. */ + filterPredictionEvents?: Maybe; + /** Filters prediction markets using optional text, IDs, event constraints, and ranking criteria. */ + filterPredictionMarkets?: Maybe; + /** Filters trader-market records using trader, market, event, and ranking criteria. */ + filterPredictionTraderMarkets?: Maybe; + /** Filters prediction traders using optional text, IDs, and ranking criteria. */ + filterPredictionTraders?: Maybe; /** Returns a list of wallets with stats narrowed down to a specific token. */ filterTokenWallets: TokenWalletFilterConnection; - /** Returns a list of tokens based on a variety of filters. */ + /** Discover, screen, and rank tokens across every supported network using 100+ on-chain signals: trading activity, liquidity, holder behavior, fee economics, and launchpad lifecycle. */ filterTokens?: Maybe; /** Returns a list of wallets based on a variety of filters. */ filterWallets: WalletFilterConnection; @@ -7059,11 +11343,6 @@ export type Query = { getEventLabels?: Maybe; /** Returns a list of decentralized exchange metadata. */ getExchanges: Array; - /** - * Returns new tokens listed over the last three days. - * @deprecated This query is longer supported. Instead use filterPairs with sort order on createdAt DESC - */ - getLatestPairs?: Maybe; /** * Returns a list of latest tokens. * @deprecated This query is no longer supported. Use `filterTokens` with a createdAt: DESC filter instead. @@ -7154,11 +11433,11 @@ export type Query = { getPrimePools?: Maybe; /** Returns charting metadata for a given pair. Used for implementing a Trading View datafeed. */ getSymbol?: Maybe; - /** Returns bar chart data to track price changes over time. */ + /** Returns aggregated bar chart data to track price changes over time. */ getTokenBars?: Maybe; /** Returns transactions for a pair. */ getTokenEvents?: Maybe; - /** Returns a list of token events for a given maker across all pairs. */ + /** Returns a list of token events for a given maker (wallet address). */ getTokenEventsForMaker?: Maybe; /** Returns real-time or historical prices for a list of tokens, fetched in batches. */ getTokenPrices?: Maybe>>; @@ -7188,6 +11467,32 @@ export type Query = { nftHolders: NftHoldersResponse; /** Returns metadata for a pair of tokens. */ pairMetadata: PairMetadata; + /** Returns available prediction categories and nested subcategories. */ + predictionCategories: Array; + /** Returns bar data for a prediction event. */ + predictionEventBars?: Maybe; + /** Returns bar data for top markets inside a prediction event. */ + predictionEventTopMarketsBars?: Maybe; + /** Returns OHLC-style bar data for a prediction market. */ + predictionMarketBars?: Maybe; + /** Returns price data for a prediction market at a specific timestamp or latest. */ + predictionMarketPrice?: Maybe; + /** Returns prediction markets by ID. */ + predictionMarkets: Array; + /** Returns live order books for a set of prediction outcomes, fetched from the venue's CLOB. Polymarket and Kalshi; outcomes from other venues will return null. Cached for up to 10s. */ + predictionOutcomeOrderBooks: Array>; + /** Returns token holder balances for a prediction market. */ + predictionTokenHolders?: Maybe; + /** Returns bar data for a prediction trader over a time range. */ + predictionTraderBars: PredictionTraderBarsResponse; + /** Returns all prediction token holdings for a specific trader. */ + predictionTraderHoldings?: Maybe; + /** Returns per-market performance stats for a specific trader. */ + predictionTraderMarketsStats: PredictionTraderMarketsStatsConnection; + /** Returns prediction traders by ID. */ + predictionTraders: Array; + /** Returns prediction trades with cursor-based pagination. */ + predictionTrades?: Maybe; /** * Returns a list of NFT collections matching a given query string. * @deprecated NFT data coverage will be removed on March 31, 2026 @@ -7195,7 +11500,10 @@ export type Query = { searchNfts?: Maybe; /** Returns a single token by its address & network id. */ token: EnhancedToken; - /** Returns a list of token lifecycle events. */ + /** + * Returns a list of token lifecycle events. + * @deprecated Token lifecycle events are deprecated and support will be removed on July 15, 2026. + */ tokenLifecycleEvents?: Maybe; /** Returns a list of token simple chart data (sparklines) for the given tokens. */ tokenSparklines: Array; @@ -7209,6 +11517,8 @@ export type Query = { walletAggregateBackfillState: WalletAggregateBackfillStateResponse; /** Returns a chart of a wallet's activity. */ walletChart?: Maybe; + /** Returns the full vocabulary of wallet label types and their metadata. */ + walletLabelTypes: Array; /** * Returns list of NFT assets held by a given wallet for a single collection. * @deprecated NFT data coverage will be removed on March 31, 2026 @@ -7242,11 +11552,38 @@ export type QueryChartUrlsArgs = { }; +export type QueryDetailedPredictionEventStatsArgs = { + input: DetailedPredictionEventStatsInput; +}; + + +export type QueryDetailedPredictionMarketStatsArgs = { + input: DetailedPredictionMarketStatsInput; +}; + + +export type QueryDetailedPredictionTraderStatsArgs = { + input: DetailedPredictionTraderStatsInput; +}; + + export type QueryDetailedWalletStatsArgs = { input: DetailedWalletStatsInput; }; +export type QueryEventScopedFilterPredictionMarketsArgs = { + eventId: Scalars['String']['input']; + excludeMarketIds?: InputMaybe>; + filters?: InputMaybe; + limit?: InputMaybe; + marketIds?: InputMaybe>; + offset?: InputMaybe; + phrase?: InputMaybe; + rankings?: InputMaybe>; +}; + + export type QueryFilterExchangesArgs = { filters?: InputMaybe; limit?: InputMaybe; @@ -7311,6 +11648,57 @@ export type QueryFilterPairsArgs = { }; +export type QueryFilterPredictionEventsArgs = { + eventIds?: InputMaybe>; + excludeEventIds?: InputMaybe>; + filters?: InputMaybe; + limit?: InputMaybe; + marketSort?: InputMaybe; + offset?: InputMaybe; + phrase?: InputMaybe; + rankings?: InputMaybe>; +}; + + +export type QueryFilterPredictionMarketsArgs = { + eventIds?: InputMaybe>; + excludeEventIds?: InputMaybe>; + excludeMarketIds?: InputMaybe>; + filters?: InputMaybe; + limit?: InputMaybe; + marketIds?: InputMaybe>; + offset?: InputMaybe; + phrase?: InputMaybe; + rankings?: InputMaybe>; +}; + + +export type QueryFilterPredictionTraderMarketsArgs = { + eventIds?: InputMaybe>; + excludeEventIds?: InputMaybe>; + excludeMarketIds?: InputMaybe>; + excludeTraderIds?: InputMaybe>; + filters?: InputMaybe; + limit?: InputMaybe; + marketIds?: InputMaybe>; + offset?: InputMaybe; + phrase?: InputMaybe; + rankings?: InputMaybe>; + traderIds?: InputMaybe>; +}; + + +export type QueryFilterPredictionTradersArgs = { + excludeTraderIds?: InputMaybe>; + filters?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + phrase?: InputMaybe; + rankings?: InputMaybe>; + traderIds?: InputMaybe>; +}; + + export type QueryFilterTokenWalletsArgs = { input: FilterTokenWalletsInput; }; @@ -7325,6 +11713,7 @@ export type QueryFilterTokensArgs = { rankings?: InputMaybe>>; statsType?: InputMaybe; tokens?: InputMaybe>>; + useAggregatedStats?: InputMaybe; }; @@ -7412,15 +11801,6 @@ export type QueryGetExchangesArgs = { }; -export type QueryGetLatestPairsArgs = { - cursor?: InputMaybe; - exchangeFilter?: InputMaybe>; - limit?: InputMaybe; - minLiquidityFilter?: InputMaybe; - networkFilter?: InputMaybe>; -}; - - export type QueryGetLatestTokensArgs = { limit?: InputMaybe; networkFilter?: InputMaybe>; @@ -7685,6 +12065,66 @@ export type QueryPairMetadataArgs = { }; +export type QueryPredictionEventBarsArgs = { + input: PredictionEventBarsInput; +}; + + +export type QueryPredictionEventTopMarketsBarsArgs = { + input: PredictionEventTopMarketsBarsInput; +}; + + +export type QueryPredictionMarketBarsArgs = { + input: PredictionMarketBarsInput; +}; + + +export type QueryPredictionMarketPriceArgs = { + input: PredictionMarketPriceInput; +}; + + +export type QueryPredictionMarketsArgs = { + input: PredictionMarketsInput; +}; + + +export type QueryPredictionOutcomeOrderBooksArgs = { + outcomeIds: Array; +}; + + +export type QueryPredictionTokenHoldersArgs = { + input: PredictionTokenHoldersInput; +}; + + +export type QueryPredictionTraderBarsArgs = { + input: PredictionTraderBarsInput; +}; + + +export type QueryPredictionTraderHoldingsArgs = { + input: PredictionTraderHoldingsInput; +}; + + +export type QueryPredictionTraderMarketsStatsArgs = { + input: PredictionTraderMarketsStatsInput; +}; + + +export type QueryPredictionTradersArgs = { + input: PredictionTradersInput; +}; + + +export type QueryPredictionTradesArgs = { + input: PredictionTradesInput; +}; + + export type QuerySearchNftsArgs = { filterWashTrading?: InputMaybe; include?: InputMaybe>; @@ -7787,8 +12227,6 @@ export type RawTransactionWebhookCondition = { __typename?: 'RawTransactionWebhookCondition'; /** The from address to listen for. */ from?: Maybe; - /** Do not trigger the webhook if the raw transaction is handled by the NftEvent webhook. */ - ignoreNftEvents?: Maybe; /** Do not trigger the webhook if the raw transaction is handled by the TokenPairEvent webhook. */ ignoreTokenPairEvents?: Maybe; /** Trigger the webhook if the contains or doesn't contain the specified string. */ @@ -7805,8 +12243,6 @@ export type RawTransactionWebhookCondition = { export type RawTransactionWebhookConditionInput = { /** The from address to listen for. */ from?: InputMaybe; - /** Do not trigger the webhook if the raw transaction is handled by the NftEvent webhook. */ - ignoreNftEvents?: InputMaybe; /** Do not trigger the webhook if the raw transaction is handled by the TokenPairEvent webhook. */ ignoreTokenPairEvents?: InputMaybe; /** Trigger the webhook if the input contains or doesn't contain the specified string. */ @@ -7911,6 +12347,92 @@ export type SandwichedLabelData = { token1DrainedAmount?: Maybe; }; +/** Metadata for a prediction event returned in search results. */ +export type SearchPredictionEvent = { + __typename?: 'SearchPredictionEvent'; + /** The timestamp when this entity closes. */ + closesAt?: Maybe; + /** The creation timestamp. */ + createdAt: Scalars['Int']['output']; + /** The description. */ + description?: Maybe; + /** The exchange contract address. */ + exchangeAddress?: Maybe; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** URL of the thumbnail image. */ + imageThumbUrl?: Maybe; + /** The network ID. */ + networkId?: Maybe; + /** The timestamp when this entity opens. */ + opensAt: Scalars['Int']['output']; + /** The prediction protocol. */ + protocol: PredictionProtocol; + /** The question or title. */ + question: Scalars['String']['output']; + /** The actual resolution timestamp. */ + resolvedAt?: Maybe; + /** The expected resolution timestamp. */ + resolvesAt?: Maybe; + /** The URL slug. */ + slug: Scalars['String']['output']; + /** The current status. */ + status: PredictionEventStatus; + /** Tags associated with this entity. */ + tags: Array; + /** The venue-specific event ID. */ + venueEventId: Scalars['String']['output']; + /** The venue-specific series ID. */ + venueSeriesId?: Maybe; + /** The venue url. */ + venueUrl: Scalars['String']['output']; +}; + +/** Metadata for a prediction market returned in search results. */ +export type SearchPredictionMarket = { + __typename?: 'SearchPredictionMarket'; + /** The timestamp when this entity closes. */ + closesAt?: Maybe; + /** The collateral backing this market. */ + collateral: Scalars['String']['output']; + /** The creation timestamp. */ + createdAt: Scalars['Int']['output']; + /** The ID of the prediction event. */ + eventId: Scalars['String']['output']; + /** The exchange contract address. */ + exchangeAddress?: Maybe; + /** The unique identifier. */ + id: Scalars['String']['output']; + /** URL of the thumbnail image. */ + imageThumbUrl?: Maybe; + /** The display label. */ + label?: Maybe; + /** The network ID. */ + networkId?: Maybe; + /** The timestamp when this entity opens. */ + opensAt?: Maybe; + /** The prediction protocol. */ + protocol: PredictionProtocol; + /** The question or title. */ + question?: Maybe; + /** The actual resolution timestamp. */ + resolvedAt?: Maybe; + /** The expected resolution timestamp. */ + resolvesAt?: Maybe; + /** The current status. */ + status: PredictionEventStatus; + /** A best-effort display label for the market: the market `label` when present and meaningful, otherwise the `question`. If the event name appears inside the label it is stripped out. */ + suggestedLabel?: Maybe; + /** Tags associated with this entity. */ + tags?: Maybe>; + /** The venue-specific event ID. */ + venueEventId?: Maybe; + /** The venue-specific market ID. */ + venueMarketId: Scalars['String']['output']; + /** The venue-specific market slug. */ + venueMarketSlug?: Maybe; +}; + /** Community gathered links for the socials of this contract. */ export type SocialLinks = { __typename?: 'SocialLinks'; @@ -7968,6 +12490,73 @@ export type SparklineValue = { value: Scalars['Float']['output']; }; +/** Sports-domain enrichment for an event (game). */ +export type SportsEventEnrichedMetadata = { + __typename?: 'SportsEventEnrichedMetadata'; + /** Decomposed venue ticker (parsed components from the venue's native event identifier). Useful for cross-venue matching when canonical league/teams fields don't disambiguate. */ + decomposedVenueTicker?: Maybe; + /** Game-start date in UTC ("YYYY-MM-DD"). Derived from `gameStartTime` when present. */ + gameStartDate?: Maybe; + /** Game-start clock value as canonical UTC ISO-8601. */ + gameStartTime?: Maybe; + /** Game-start as Unix seconds (UTC). */ + gameStartTimeSeconds?: Maybe; + /** Timezone discriminator for `gameStartTime` / `gameStartDate`. Always UTC for any record produced after the ET→UTC normalisation rollout. */ + gameStartTimezone?: Maybe; + /** Soft-normalised league/sport identifier (e.g. NBA, NFL, EPL). Free string to tolerate new venues; well-known values match the canonical set. */ + league?: Maybe; + /** Teams participating in the game, when known. Null when the venue does not expose teams. */ + teams?: Maybe>; +}; + +/** Sports-domain enrichment for a market within an event. */ +export type SportsMarketEnrichedMetadata = { + __typename?: 'SportsMarketEnrichedMetadata'; + /** Game-start date in UTC ("YYYY-MM-DD"). Derived from `gameStartTime` when present. */ + gameStartDate?: Maybe; + /** Game-start clock value as canonical UTC ISO-8601. */ + gameStartTime?: Maybe; + /** Game-start as Unix seconds (UTC). */ + gameStartTimeSeconds?: Maybe; + /** Timezone discriminator for `gameStartTime` / `gameStartDate`. Always UTC for any record produced after the ET→UTC normalisation rollout. */ + gameStartTimezone?: Maybe; + /** Soft-normalised league identifier (mirrors the parent event). */ + league?: Maybe; + /** Market template slug (e.g. "moneyline", "spreads", "totals", "ufc_method_of_victory"). Free string — list grows as venues add templates. */ + sportsMarketType?: Maybe; + /** Teams referenced by this market, when known. */ + teams?: Maybe>; +}; + +/** Cross-venue sports team identifier. Only `abbreviation` is required; other fields populated when the venue exposes them. Match teams across venues using `abbreviation ∪ altAbbreviations`. */ +export type SportsTeam = { + __typename?: 'SportsTeam'; + /** Lowercased venue-canonical abbreviation. */ + abbreviation: Scalars['String']['output']; + /** Display alias. */ + alias?: Maybe; + /** Known alternate forms for the same team (rebrands, relocations, 2-vs-3-letter conventions). Excludes `abbreviation`. */ + altAbbreviations?: Maybe>; + /** Brand colour. */ + color?: Maybe; + /** Whether this team is the home team in the event. */ + isHome?: Maybe; + /** Soft-normalised league for this team. */ + league?: Maybe; + /** Logo URL. */ + logo?: Maybe; + /** Display name. */ + name?: Maybe; + /** Provider-side identifier (e.g. Polymarket gamma id). */ + providerId?: Maybe; +}; + +/** How to interpret companion date/time fields. */ +export enum SportsTimezone { + /** UTC. `gameStartTime` is canonical ISO-8601; `gameStartTimeSeconds` populated. */ + Utc = 'UTC' +} + export type StarknetNetworkConfig = { __typename?: 'StarknetNetworkConfig'; baseTokenAddress: Scalars['String']['output']; @@ -8042,12 +12631,17 @@ export type StringFilter = { lte?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type Subscription = { __typename?: 'Subscription'; /** Live-streamed balance updates for a given wallet. */ onBalanceUpdated: Balance; - /** Live-streamed bar chart data to track price changes over time. */ + /** Live-streamed bar chart data to track price changes over time. Processed updates are projected into `aggregates` using the confirmed bar shape. */ onBarsUpdated?: Maybe; + /** Streams updated detailed stats for a specific prediction event. */ + onDetailedPredictionEventStatsUpdated?: Maybe; + /** Streams updated detailed stats for a specific prediction market. */ + onDetailedPredictionMarketStatsUpdated?: Maybe; /** Live-streamed bucketed stats for a given token within a pair. */ onDetailedStatsUpdated?: Maybe; /** Live-streamed bucketed stats for a given token. */ @@ -8058,13 +12652,10 @@ export type Subscription = { onEventsCreated?: Maybe; /** Live-streamed transactions for a maker. */ onEventsCreatedByMaker?: Maybe; + /** Live-streamed filter token updates for the current `filterTokens` result set. */ + onFilterTokensUpdated?: Maybe; /** Live-streamed list of wallets that hold a given token. Also has the unique count of holders for that token. */ onHoldersUpdated?: Maybe; - /** - * Live-streamed updates for newly listed pairs. - * @deprecated No longer supported - */ - onLatestPairUpdated?: Maybe; /** * Live-streamed updates for newly listed tokens. * @deprecated No longer supported @@ -8091,76 +12682,127 @@ export type Subscription = { onNftPoolEventsCreated?: Maybe; /** Live-streamed stat updates for a given token within a pair. */ onPairMetadataUpdated?: Maybe; + /** Live-streamed bar chart data to track price changes over time for a prediction event. */ + onPredictionEventBarsUpdated?: Maybe; + /** Live-streamed bar chart data to track price changes over time for a prediction market. */ + onPredictionMarketBarsUpdated?: Maybe; + /** Streams new prediction trades as they are ingested. */ + onPredictionTradesCreated?: Maybe; /** Live-streamed price updates for a token. */ onPriceUpdated?: Maybe; /** Live-streamed price updates for multiple tokens. */ onPricesUpdated: Price; - /** Live-streamed bar chart data to track price changes over time for a token. */ + /** Live-streamed aggregate bar chart data to track price changes over time for a token. */ onTokenBarsUpdated?: Maybe; /** Live-streamed events for a given token across all it's pools */ onTokenEventsCreated: AddTokenEventsOutput; - /** Live-streamed token lifecycle events (mints and burns). */ + /** + * Live-streamed token lifecycle events (mints and burns). + * @deprecated Token lifecycle events are deprecated and support will be removed on July 15, 2026. + */ onTokenLifecycleEventsCreated: AddTokenLifecycleEventsOutput; - /** Unconfirmed live-streamed bar chart data to track price changes over time. (Solana only) */ + /** + * Deprecated unconfirmed live-streamed bar chart data to track price changes over time. Use `onBarsUpdated` instead. (Solana only) + * @deprecated Use onBarsUpdated instead + */ onUnconfirmedBarsUpdated?: Maybe; - /** Live-streamed unconfirmed transactions for a token. (Solana only) */ + /** + * Deprecated unconfirmed live-streamed transactions for a token. Use `onEventsCreated` instead. (Solana only) + * @deprecated Use onEventsCreated instead + */ onUnconfirmedEventsCreated?: Maybe; - /** Live-streamed unconfirmed transactions for a maker. (Solana only) */ + /** + * Deprecated unconfirmed live-streamed transactions for a maker. Use `onEventsCreatedByMaker` instead. (Solana only) + * @deprecated Use onEventsCreatedByMaker instead + */ onUnconfirmedEventsCreatedByMaker?: Maybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnBalanceUpdatedArgs = { walletAddress: Scalars['String']['input']; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnBarsUpdatedArgs = { + commitmentLevel?: InputMaybe>; pairId?: InputMaybe; quoteToken?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ +export type SubscriptionOnDetailedPredictionEventStatsUpdatedArgs = { + eventId: Scalars['String']['input']; +}; + + +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ +export type SubscriptionOnDetailedPredictionMarketStatsUpdatedArgs = { + marketId: Scalars['String']['input']; +}; + + +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnDetailedStatsUpdatedArgs = { pairId?: InputMaybe; tokenOfInterest?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnDetailedTokenStatsUpdatedArgs = { tokenId?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnEventLabelCreatedArgs = { id?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnEventsCreatedArgs = { address?: InputMaybe; + commitmentLevel?: InputMaybe>; id?: InputMaybe; networkId?: InputMaybe; quoteToken?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnEventsCreatedByMakerArgs = { + commitmentLevel?: InputMaybe>; input: OnEventsCreatedByMakerInput; }; -export type SubscriptionOnHoldersUpdatedArgs = { - tokenId: Scalars['String']['input']; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ +export type SubscriptionOnFilterTokensUpdatedArgs = { + excludeTokens?: InputMaybe>>; + filters?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; + phrase?: InputMaybe; + rankings?: InputMaybe>>; + statsType?: InputMaybe; + tokens?: InputMaybe>>; + updatePeriod?: InputMaybe; + useAggregatedStats?: InputMaybe; }; -export type SubscriptionOnLatestPairUpdatedArgs = { - id?: InputMaybe; - networkId?: InputMaybe; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ +export type SubscriptionOnHoldersUpdatedArgs = { + tokenId: Scalars['String']['input']; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnLatestTokensArgs = { id?: InputMaybe; networkId?: InputMaybe; @@ -8168,16 +12810,19 @@ export type SubscriptionOnLatestTokensArgs = { }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnLaunchpadTokenEventArgs = { input?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnLaunchpadTokenEventBatchArgs = { input?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnNftAssetsCreatedArgs = { address?: InputMaybe; networkId?: InputMaybe; @@ -8185,12 +12830,14 @@ export type SubscriptionOnNftAssetsCreatedArgs = { }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnNftEventsCreatedArgs = { address?: InputMaybe; networkId?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnNftPoolEventsCreatedArgs = { collectionAddress?: InputMaybe; exchangeAddress?: InputMaybe; @@ -8199,6 +12846,7 @@ export type SubscriptionOnNftPoolEventsCreatedArgs = { }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnPairMetadataUpdatedArgs = { id?: InputMaybe; quoteToken?: InputMaybe; @@ -8206,41 +12854,70 @@ export type SubscriptionOnPairMetadataUpdatedArgs = { }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ +export type SubscriptionOnPredictionEventBarsUpdatedArgs = { + eventId: Scalars['String']['input']; +}; + + +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ +export type SubscriptionOnPredictionMarketBarsUpdatedArgs = { + marketId: Scalars['String']['input']; +}; + + +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ +export type SubscriptionOnPredictionTradesCreatedArgs = { + input?: InputMaybe; +}; + + +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnPriceUpdatedArgs = { address?: InputMaybe; networkId?: InputMaybe; sourcePairAddress?: InputMaybe; + useWeightedPrices?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnPricesUpdatedArgs = { input: Array; + useWeightedPrices?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnTokenBarsUpdatedArgs = { + commitmentLevel?: InputMaybe>; networkId?: InputMaybe; tokenId?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnTokenEventsCreatedArgs = { + commitmentLevel?: InputMaybe>; input: OnTokenEventsCreatedInput; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnTokenLifecycleEventsCreatedArgs = { address?: InputMaybe; networkId?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnUnconfirmedBarsUpdatedArgs = { pairId?: InputMaybe; quoteToken?: InputMaybe; }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnUnconfirmedEventsCreatedArgs = { address?: InputMaybe; id?: InputMaybe; @@ -8248,6 +12925,7 @@ export type SubscriptionOnUnconfirmedEventsCreatedArgs = { }; +/** Live-streamed prediction data subscriptions for trades, stats, and bar updates. */ export type SubscriptionOnUnconfirmedEventsCreatedByMakerArgs = { input: OnUnconfirmedEventsCreatedByMakerInput; }; @@ -8274,6 +12952,9 @@ export type SuiNetworkConfig = { wrappedBaseTokenSymbol: Scalars['String']['output']; }; +/** Protocol-specific supplemental fee data. */ +export type SupplementalFeeData = PumpAmmCashbackFeeData | PumpCashbackFeeData; + /** Event data for a token swap event. */ export type SwapEventData = { __typename?: 'SwapEventData'; @@ -8464,6 +13145,12 @@ export enum SymbolType { /** Bar chart data to track price changes over time. */ export type TokenBarsResponse = { __typename?: 'TokenBarsResponse'; + /** Average total fee cost per transaction in USD (totalFees / transactions). Null when there are no transactions. */ + averageCostPerTrade?: Maybe>>; + /** The aggregate base fees (gas) in USD */ + baseFees?: Maybe>>; + /** The aggregate builder tips (MEV) in USD */ + builderTips?: Maybe>>; /** The buy volume in USD */ buyVolume: Array>; /** The number of unique buyers */ @@ -8472,16 +13159,34 @@ export type TokenBarsResponse = { buys: Array>; /** The closing price. */ c: Array>; + /** Dominant fee component: gas-dominated (gas >50% of fees), mev-dominated (tips >20%), or pool-fee-dominated. Null when no fees. */ + feeRegimeClassification?: Maybe>>; + /** Ratio of total fees to volume (totalFees / volume). Null when volume is zero. */ + feeToVolumeRatio?: Maybe>>; + /** Gas cost per dollar of volume ((baseFees + priorityFees + l1DataFees) / volume). Null when volume is zero. */ + gasPerVolume?: Maybe>>; /** The high price. */ h: Array>; /** The low price. */ l: Array>; + /** The aggregate L1 data posting fees in USD (L2 rollups only) */ + l1DataFees?: Maybe>>; /** Liquidity in USD */ liquidity: Array>; + /** MEV risk level for this bar: low (<3% builder tips), medium (3-30%), or high (>30%). Null for pre-genesis bars. */ + mevRiskLevel?: Maybe>>; + /** Ratio of builder tips (MEV) to total fees (builderTips / totalFees). Null when totalFees is zero. */ + mevToTotalFeesRatio?: Maybe>>; /** The opening price. */ o: Array>; + /** The aggregate pool/DEX fees in USD */ + poolFees?: Maybe>>; + /** The aggregate priority fees in USD */ + priorityFees?: Maybe>>; /** The status code for the batch: `ok` for successful data retrieval and `no_data` for empty responses signaling the end of server data. */ s: Scalars['String']['output']; + /** Rate of sandwich attacks per transaction (sandwichedEventCount / transactions). Null when no transaction data. */ + sandwichRate?: Maybe>>; /** The sell volume in USD */ sellVolume: Array>; /** The number of unique sellers */ @@ -8492,6 +13197,8 @@ export type TokenBarsResponse = { t: Array; /** The token that is being returned */ token: EnhancedToken; + /** The total fees in USD (sum of poolFees + baseFees + priorityFees + builderTips + l1DataFees) */ + totalFees?: Maybe>>; /** The number of traders */ traders: Array>; /** The number of transactions */ @@ -8502,6 +13209,16 @@ export type TokenBarsResponse = { volumeNativeToken?: Maybe>>; }; +/** Boolean expression for combining token filters. */ +export type TokenBoolFilter = { + /** All nested filters must match. */ + and?: InputMaybe>; + /** The nested filter must not match. */ + not?: InputMaybe; + /** At least one nested filter must match. */ + or?: InputMaybe>; +}; + /** Token burn event data. */ export type TokenBurnEventData = { __typename?: 'TokenBurnEventData'; @@ -8513,6 +13230,41 @@ export type TokenBurnEventData = { totalSupply?: Maybe; }; +/** All-time high and low price and market cap data for a token. */ +export type TokenExtrema = { + __typename?: 'TokenExtrema'; + /** The contract address of the token. */ + address: Scalars['String']['output']; + /** The all-time high circulating market cap. */ + athCircMc: Scalars['String']['output']; + /** The unix timestamp when the all-time high circulating market cap was reached. */ + athCircMcTimestamp: Scalars['Int']['output']; + /** The all-time high fully diluted market cap. */ + athFdv: Scalars['String']['output']; + /** The unix timestamp when the all-time high FDV was reached. */ + athFdvTimestamp: Scalars['Int']['output']; + /** The all-time high price in USD. */ + athPrice: Scalars['String']['output']; + /** The unix timestamp when the all-time high price was reached. */ + athPriceTimestamp: Scalars['Int']['output']; + /** The all-time low circulating market cap. */ + atlCircMc: Scalars['String']['output']; + /** The unix timestamp when the all-time low circulating market cap was reached. */ + atlCircMcTimestamp: Scalars['Int']['output']; + /** The all-time low fully diluted market cap. */ + atlFdv: Scalars['String']['output']; + /** The unix timestamp when the all-time low FDV was reached. */ + atlFdvTimestamp: Scalars['Int']['output']; + /** The all-time low price in USD. */ + atlPrice: Scalars['String']['output']; + /** The unix timestamp when the all-time low price was reached. */ + atlPriceTimestamp: Scalars['Int']['output']; + /** The token ID (`address:networkId`). */ + id: Scalars['String']['output']; + /** The network ID the token is deployed on. */ + networkId: Scalars['Int']['output']; +}; + /** Response returned by `filterTokens`. */ export type TokenFilterConnection = { __typename?: 'TokenFilterConnection'; @@ -8529,6 +13281,50 @@ export type TokenFilterResult = { __typename?: 'TokenFilterResult'; /** @deprecated Age isn't supported - use createdAt instead */ age?: Maybe; + /** The all-time high circulating market cap. */ + athCircMc?: Maybe; + /** The unix timestamp when the all-time high circulating market cap was reached. */ + athCircMcTimestamp?: Maybe; + /** The all-time high fully diluted market cap. */ + athFdv?: Maybe; + /** The unix timestamp when the all-time high FDV was reached. */ + athFdvTimestamp?: Maybe; + /** The all-time high price in USD. */ + athPrice?: Maybe; + /** The unix timestamp when the all-time high price was reached. */ + athPriceTimestamp?: Maybe; + /** The all-time low circulating market cap. */ + atlCircMc?: Maybe; + /** The unix timestamp when the all-time low circulating market cap was reached. */ + atlCircMcTimestamp?: Maybe; + /** The all-time low fully diluted market cap. */ + atlFdv?: Maybe; + /** The unix timestamp when the all-time low FDV was reached. */ + atlFdvTimestamp?: Maybe; + /** The all-time low price in USD. */ + atlPrice?: Maybe; + /** The unix timestamp when the all-time low price was reached. */ + atlPriceTimestamp?: Maybe; + /** The total base gas fees in USD in the past hour. */ + baseFees1?: Maybe; + /** The total base gas fees in USD in the past 4 hours. */ + baseFees4?: Maybe; + /** The total base gas fees in USD in the past 5 minutes. */ + baseFees5m?: Maybe; + /** The total base gas fees in USD in the past 12 hours. */ + baseFees12?: Maybe; + /** The total base gas fees in USD in the past 24 hours. */ + baseFees24?: Maybe; + /** The total builder tips (MEV) in USD in the past hour. */ + builderTips1?: Maybe; + /** The total builder tips (MEV) in USD in the past 4 hours. */ + builderTips4?: Maybe; + /** The total builder tips (MEV) in USD in the past 5 minutes. */ + builderTips5m?: Maybe; + /** The total builder tips (MEV) in USD in the past 12 hours. */ + builderTips12?: Maybe; + /** The total builder tips (MEV) in USD in the past 24 hours. */ + builderTips24?: Maybe; /** The number of wallets that have bundled the token */ bundlerCount?: Maybe; /** The percentage of tokens held by bundlers */ @@ -8573,6 +13369,16 @@ export type TokenFilterResult = { exchanges?: Maybe>>; /** @deprecated FDV isn't supported - use marketCap instead */ fdv?: Maybe; + /** The ratio of total fees to volume in the past hour. Decimal format. */ + feeToVolumeRatio1?: Maybe; + /** The ratio of total fees to volume in the past 4 hours. Decimal format. */ + feeToVolumeRatio4?: Maybe; + /** The ratio of total fees to volume in the past 5 minutes. Decimal format. */ + feeToVolumeRatio5m?: Maybe; + /** The ratio of total fees to volume in the past 12 hours. Decimal format. */ + feeToVolumeRatio12?: Maybe; + /** The ratio of total fees to volume in the past 24 hours. Decimal format. */ + feeToVolumeRatio24?: Maybe; /** The highest price in USD in the past hour. */ high1?: Maybe; /** The highest price in USD in the past 4 hours. */ @@ -8591,6 +13397,16 @@ export type TokenFilterResult = { insiderHeldPercentage?: Maybe; /** Whether the token has been flagged as a scam. */ isScam?: Maybe; + /** The total L1 data fees in USD in the past hour. */ + l1DataFees1?: Maybe; + /** The total L1 data fees in USD in the past 4 hours. */ + l1DataFees4?: Maybe; + /** The total L1 data fees in USD in the past 5 minutes. */ + l1DataFees5m?: Maybe; + /** The total L1 data fees in USD in the past 12 hours. */ + l1DataFees12?: Maybe; + /** The total L1 data fees in USD in the past 24 hours. */ + l1DataFees24?: Maybe; /** The unix timestamp for the token's last transaction. */ lastTransaction?: Maybe; /** Metadata for the token's most liquid pair */ @@ -8615,8 +13431,30 @@ export type TokenFilterResult = { marketCap?: Maybe; /** Metadata for the token's top pair. */ pair?: Maybe; + /** The total pool fees in USD in the past hour. */ + poolFees1?: Maybe; + /** The total pool fees in USD in the past 4 hours. */ + poolFees4?: Maybe; + /** The total pool fees in USD in the past 5 minutes. */ + poolFees5m?: Maybe; + /** The total pool fees in USD in the past 12 hours. */ + poolFees12?: Maybe; + /** The total pool fees in USD in the past 24 hours. */ + poolFees24?: Maybe; + /** The reasons the token has been flagged as a potential scam. */ + potentialScamReasons?: Maybe>>; /** The token price in USD. */ priceUSD?: Maybe; + /** The total priority fees in USD in the past hour. */ + priorityFees1?: Maybe; + /** The total priority fees in USD in the past 4 hours. */ + priorityFees4?: Maybe; + /** The total priority fees in USD in the past 5 minutes. */ + priorityFees5m?: Maybe; + /** The total priority fees in USD in the past 12 hours. */ + priorityFees12?: Maybe; + /** The total priority fees in USD in the past 24 hours. */ + priorityFees24?: Maybe; /** The token of interest. Can be `token0` or `token1`. */ quoteToken?: Maybe; /** The number of sells in the past hour. */ @@ -8643,6 +13481,10 @@ export type TokenFilterResult = { sniperCount?: Maybe; /** The percentage of tokens held by snipers */ sniperHeldPercentage?: Maybe; + /** The number of suspicious wallets (deduplicated union of snipers, bundlers, and insiders) */ + suspiciousCount?: Maybe; + /** The percentage of tokens held by suspicious wallets */ + suspiciousHeldPercentage?: Maybe; /** The percentage of wallets that are less than 1d old that have traded in the last 24h */ swapPct1dOldWallet?: Maybe; /** The percentage of wallets that are less than 7d old that have traded in the last 24h */ @@ -8651,6 +13493,18 @@ export type TokenFilterResult = { token?: Maybe; /** The percentage of total supply held by the top 10 holders. */ top10HoldersPercent?: Maybe; + /** The total trading fees (pool + gas + tips) in USD in the past hour. */ + totalFees1?: Maybe; + /** The total trading fees (pool + gas + tips) in USD in the past 4 hours. */ + totalFees4?: Maybe; + /** The total trading fees (pool + gas + tips) in USD in the past 5 minutes. */ + totalFees5m?: Maybe; + /** The total trading fees (pool + gas + tips) in USD in the past 12 hours. */ + totalFees12?: Maybe; + /** The total trading fees (pool + gas + tips) in USD in the past 24 hours. */ + totalFees24?: Maybe; + /** A heuristic based on various factors used to rank tokens based on how trending they are. */ + trendingScore?: Maybe; /** The number of transactions in the past hour. */ txnCount1?: Maybe; /** The number of transactions in the past 4 hours. */ @@ -8721,6 +13575,22 @@ export type TokenFilterResult = { export type TokenFilters = { /** @deprecated Age isn't supported - use createdAt instead */ age?: InputMaybe; + /** Filter by all-time high circulating market cap. */ + athCircMc?: InputMaybe; + /** Filter by all-time high FDV. */ + athFdv?: InputMaybe; + /** Filter by all-time high price. */ + athPrice?: InputMaybe; + /** Filter by all-time low circulating market cap. */ + atlCircMc?: InputMaybe; + /** Filter by all-time low FDV. */ + atlFdv?: InputMaybe; + /** Filter by all-time low price. */ + atlPrice?: InputMaybe; + /** Filter by Grid bluechip ratings. Returns tokens matching any of the provided ratings. */ + bluechipRatings?: InputMaybe>; + /** Recursive boolean expression for combining token filters. */ + boolFilter?: InputMaybe; /** Filter by number of wallets that have bundled the token */ bundlerCount?: InputMaybe; /** Filter by percentage of tokens held by bundlers */ @@ -8757,6 +13627,14 @@ export type TokenFilters = { change24?: InputMaybe; /** The circulating market cap. */ circulatingMarketCap?: InputMaybe; + /** Filter by unix timestamp for the most recent post in the token's coin community. */ + coinCommunityLastPostAt?: InputMaybe; + /** Filter by number of likes in the token's coin community. */ + coinCommunityLikeCount?: InputMaybe; + /** Filter by number of members in the token's coin community. */ + coinCommunityMemberCount?: InputMaybe; + /** Filter by number of posts in the token's coin community. */ + coinCommunityPostCount?: InputMaybe; /** The unix timestamp for the creation of the token's first pair. */ createdAt?: InputMaybe; /** @@ -8774,8 +13652,12 @@ export type TokenFilters = { exchangeId?: InputMaybe>>; /** @deprecated FDV isn't supported - use marketCap instead */ fdv?: InputMaybe; + /** Filter by fee to volume ratio in the past 24 hours. */ + feeToVolumeRatio24?: InputMaybe; /** The token is freezable. */ freezable?: InputMaybe; + /** Filter by whether the token has linked Grid asset data. */ + hasGridData?: InputMaybe; /** The highest price in USD in the past hour. */ high1?: InputMaybe; /** The highest price in USD in the past 4 hours. */ @@ -8810,7 +13692,7 @@ export type TokenFilters = { launchpadMigrated?: InputMaybe; /** The timestamp when the launchpad was migrated. */ launchpadMigratedAt?: InputMaybe; - /** A list of launchpad names. Any of the following: Pump.fun, Pump Mayhem, Bonk, BONAD.fun, Nad.Fun, Baseapp, Baseapp Creator, Zora, Zora Creator, Four.meme, Four.meme Fair, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Zora Solana, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults, OpenGameProtocol, AMERICA.fun, Kumbaya, Printr, Bankr, Noice, Flaunch, Coinbarrel, Blowfish. */ + /** A list of launchpad names. Any of the following: Pump.fun, Pump Mayhem, Bonk, BONAD.fun, Nad.Fun, Baseapp, Baseapp Creator, Zora, Zora Creator, Four.meme, Four.meme Fair, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Meteora Alpha Vault, Zora Solana, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults, OpenGameProtocol, AMERICA.fun, Kumbaya, Printr, Bankr, Liquid, Noice, Flaunch, Coinbarrel, Blowfish, MeMoo, Metaplex, Scale, Eitherway, Livo, Flap. */ launchpadName?: InputMaybe>; /** A list of launchpad protocols. */ launchpadProtocol?: InputMaybe>; @@ -8826,16 +13708,20 @@ export type TokenFilters = { low12?: InputMaybe; /** The lowest price in USD in the past 24 hours. */ low24?: InputMaybe; - /** The market cap of circulating supply. */ + /** The fully diluted market cap. */ marketCap?: InputMaybe; /** The token is mintable. */ mintable?: InputMaybe; /** The list of network IDs to filter by. Applied in conjunction with `exchangeId` filter using an OR condition. When used together, the query returns results that match either the specified exchanges or the specified network. */ network?: InputMaybe>>; + /** Filter by pool fees in the past 24 hours. */ + poolFees24?: InputMaybe; /** Filter potential Scams */ potentialScam?: InputMaybe; /** The token price in USD. */ priceUSD?: InputMaybe; + /** Whether the token name or symbol contains profanity. */ + profanity?: InputMaybe; /** The number of sells in the past hour. */ sellCount1?: InputMaybe; /** The number of sells in the past 4 hours. */ @@ -8860,6 +13746,10 @@ export type TokenFilters = { sniperCount?: InputMaybe; /** Filter by percentage of tokens held by snipers */ sniperHeldPercentage?: InputMaybe; + /** Filter by number of suspicious wallets (deduplicated union of snipers, bundlers, and insiders) */ + suspiciousCount?: InputMaybe; + /** Filter by percentage of tokens held by suspicious wallets */ + suspiciousHeldPercentage?: InputMaybe; /** The percentage of wallets that are less than 1d old that have traded in the last 24h. */ swapPct1dOldWallet?: InputMaybe; /** The percentage of wallets that are less than 7d old that have traded in the last 24h. */ @@ -8868,6 +13758,16 @@ export type TokenFilters = { tokenCreatedAt?: InputMaybe; /** Filter by top 10 holders percentage. */ top10HoldersPercent?: InputMaybe; + /** Filter by total fees in the past hour. */ + totalFees1?: InputMaybe; + /** Filter by total fees in the past 4 hours. */ + totalFees4?: InputMaybe; + /** Filter by total fees in the past 5 minutes. */ + totalFees5m?: InputMaybe; + /** Filter by total fees in the past 12 hours. */ + totalFees12?: InputMaybe; + /** Filter by total fees in the past 24 hours. */ + totalFees24?: InputMaybe; /** Whether to ignore pairs/tokens not relevant to trending. This is done checking against a few factors and ignoring uninteresting tokens like stables / network tokens. If you want all tokens regardless of these checks, then don't include this field. (default) If you want only tokens that fail the trending ignore checks, then set it to `true`. (i.e. stablecoins, rugs, network base tokens) If you want only tokens that pass the trending ignore checks, then set it to `false`. */ trendingIgnored?: InputMaybe; /** The number of transactions in the past hour. */ @@ -8941,12 +13841,16 @@ export type TokenInfo = { __typename?: 'TokenInfo'; /** The contract address of the token. */ address: Scalars['String']['output']; + /** The Grid bluechip rating for this token (e.g. `A+`, `B-`). */ + bluechipRating?: Maybe; /** The circulating supply of the token. */ circulatingSupply?: Maybe; /** The token ID on CoinMarketCap. */ cmcId?: Maybe; /** A description of the token. */ description?: Maybe; + /** The Grid asset ID, if this token is linked to a Grid asset. */ + gridAssetId?: Maybe; /** Uniquely identifies the token. */ id: Scalars['String']['output']; /** The token banner URL. */ @@ -9030,9 +13934,9 @@ export enum TokenLifecycleEventType { /** Input type of `tokenLifecycleEvents` query. */ export type TokenLifecycleEventsQueryInput = { - /** The token contract address to filter by. */ + /** The token contract address to filter events by. In conjunction with `networkId`, this will filter events for a specific token on a specific network. */ address: Scalars['String']['input']; - /** The networkId to filter by. */ + /** The networkId to filter events by. */ networkId: Scalars['Int']['input']; }; @@ -9154,6 +14058,18 @@ export type TokenRanking = { export enum TokenRankingAttribute { /** @deprecated Use createdAt instead */ Age = 'age', + BaseFees1 = 'baseFees1', + BaseFees4 = 'baseFees4', + BaseFees5m = 'baseFees5m', + BaseFees12 = 'baseFees12', + BaseFees24 = 'baseFees24', + BuilderTips1 = 'builderTips1', + BuilderTips4 = 'builderTips4', + BuilderTips5m = 'builderTips5m', + BuilderTips12 = 'builderTips12', + BuilderTips24 = 'builderTips24', + BundlerCount = 'bundlerCount', + BundlerHeldPercentage = 'bundlerHeldPercentage', BuyCount1 = 'buyCount1', BuyCount4 = 'buyCount4', BuyCount5m = 'buyCount5m', @@ -9170,7 +14086,17 @@ export enum TokenRankingAttribute { Change12 = 'change12', Change24 = 'change24', CirculatingMarketCap = 'circulatingMarketCap', + CoinCommunityLastPostAt = 'coinCommunityLastPostAt', + CoinCommunityLikeCount = 'coinCommunityLikeCount', + CoinCommunityMemberCount = 'coinCommunityMemberCount', + CoinCommunityPostCount = 'coinCommunityPostCount', CreatedAt = 'createdAt', + DevHeldPercentage = 'devHeldPercentage', + FeeToVolumeRatio1 = 'feeToVolumeRatio1', + FeeToVolumeRatio4 = 'feeToVolumeRatio4', + FeeToVolumeRatio5m = 'feeToVolumeRatio5m', + FeeToVolumeRatio12 = 'feeToVolumeRatio12', + FeeToVolumeRatio24 = 'feeToVolumeRatio24', GraduationPercent = 'graduationPercent', High1 = 'high1', High4 = 'high4', @@ -9178,6 +14104,13 @@ export enum TokenRankingAttribute { High12 = 'high12', High24 = 'high24', Holders = 'holders', + InsiderCount = 'insiderCount', + InsiderHeldPercentage = 'insiderHeldPercentage', + L1DataFees1 = 'l1DataFees1', + L1DataFees4 = 'l1DataFees4', + L1DataFees5m = 'l1DataFees5m', + L1DataFees12 = 'l1DataFees12', + L1DataFees24 = 'l1DataFees24', LastTransaction = 'lastTransaction', LaunchpadCompletedAt = 'launchpadCompletedAt', LaunchpadMigratedAt = 'launchpadMigratedAt', @@ -9189,7 +14122,17 @@ export enum TokenRankingAttribute { Low24 = 'low24', MarketCap = 'marketCap', NotableHolderCount = 'notableHolderCount', + PoolFees1 = 'poolFees1', + PoolFees4 = 'poolFees4', + PoolFees5m = 'poolFees5m', + PoolFees12 = 'poolFees12', + PoolFees24 = 'poolFees24', PriceUsd = 'priceUSD', + PriorityFees1 = 'priorityFees1', + PriorityFees4 = 'priorityFees4', + PriorityFees5m = 'priorityFees5m', + PriorityFees12 = 'priorityFees12', + PriorityFees24 = 'priorityFees24', SellCount1 = 'sellCount1', SellCount4 = 'sellCount4', SellCount5m = 'sellCount5m', @@ -9200,10 +14143,19 @@ export enum TokenRankingAttribute { SellVolume5m = 'sellVolume5m', SellVolume12 = 'sellVolume12', SellVolume24 = 'sellVolume24', + SniperCount = 'sniperCount', + SniperHeldPercentage = 'sniperHeldPercentage', + SuspiciousCount = 'suspiciousCount', + SuspiciousHeldPercentage = 'suspiciousHeldPercentage', SwapPct1dOldWallet = 'swapPct1dOldWallet', SwapPct7dOldWallet = 'swapPct7dOldWallet', TokenCreatedAt = 'tokenCreatedAt', Top10HoldersPercent = 'top10HoldersPercent', + TotalFees1 = 'totalFees1', + TotalFees4 = 'totalFees4', + TotalFees5m = 'totalFees5m', + TotalFees12 = 'totalFees12', + TotalFees24 = 'totalFees24', TrendingScore = 'trendingScore', TrendingScore1 = 'trendingScore1', TrendingScore4 = 'trendingScore4', @@ -9387,6 +14339,10 @@ export type TokenWalletActivity = { sniperCount: Scalars['Int']['output']; /** The percentage of token supply held by sniper wallets. */ sniperHeldPercentage: Scalars['Float']['output']; + /** The number of suspicious wallets — the deduplicated union of snipers, bundlers, and insiders — that hold this token. */ + suspiciousCount: Scalars['Int']['output']; + /** The percentage of token supply held by suspicious wallets (deduplicated union of snipers, bundlers, and insiders). */ + suspiciousHeldPercentage: Scalars['Float']['output']; }; /** A connection of wallets matching a filter on a specific token. */ @@ -9429,6 +14385,14 @@ export type TokenWalletFilterResult = { amountSoldUsdAll1y: Scalars['String']['output']; /** Amount sold USD all in the past 30 days */ amountSoldUsdAll30d: Scalars['String']['output']; + /** Average hold period, in seconds, for positions sold during the past day. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1d?: Maybe; + /** Average hold period, in seconds, for positions sold during the past week. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1w?: Maybe; + /** Average hold period, in seconds, for positions sold during the past year. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1y?: Maybe; + /** Average hold period, in seconds, for positions sold during the past 30 days. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec30d?: Maybe; /** The backfill state of the wallet. */ backfillState?: Maybe; /** The bot score for the wallet. */ @@ -9550,7 +14514,7 @@ export type TokenWithMetadata = { lastTransaction?: Maybe; /** The total liquidity of the token's top pair in USD. */ liquidity: Scalars['String']['output']; - /** The market cap of circulating supply. */ + /** The fully diluted market cap. */ marketCap?: Maybe; /** The name of the token. */ name: Scalars['String']['output']; @@ -9743,8 +14707,55 @@ export type UniswapV4Data = { export type Wallet = { __typename?: 'Wallet'; address: Scalars['String']['output']; + /** Resolved profile avatar URL (best available source) */ + avatarUrl?: Maybe; + category?: Maybe; + /** A community-contributed description of the wallet */ + description?: Maybe; + /** Discord numeric ID */ + discordId?: Maybe; + /** Discord username */ + discordUsername?: Maybe; + /** A human-readable display name for the wallet */ + displayName?: Maybe; + /** Ethos credibility tier (1-10) */ + ethosLevel?: Maybe; + /** Ethos credibility score (0-2800, higher = more trustworthy) */ + ethosScore?: Maybe; + /** Ethos Network verification status */ + ethosVerified?: Maybe; + /** Farcaster numeric ID */ + farcasterId?: Maybe; + /** Farcaster username */ + farcasterUsername?: Maybe; firstFunding?: Maybe; firstSeenTimestamp?: Maybe; + /** GitHub numeric ID */ + githubId?: Maybe; + /** GitHub username */ + githubUsername?: Maybe; + /** Identity labels describing what this wallet is (e.g. CEX, DEX, bridge, team) */ + identityLabels?: Maybe>; + /** Source of identity data (e.g. ethos, manual, polymarket-backfill) */ + identitySource?: Maybe; + /** When identity data was last updated (unix timestamp) */ + identityUpdatedAt?: Maybe; + /** Raw Polymarket profile data when this wallet is a Polymarket proxy. Polymarket takes priority over contributed/ethos for resolved displayName, twitterUsername, and avatarUrl. */ + polymarket?: Maybe; + /** Telegram numeric ID */ + telegramId?: Maybe; + /** Telegram username */ + telegramUsername?: Maybe; + /** Total number of tokens created by this wallet across all networks (where the creator is known). */ + tokensCreatedCount?: Maybe; + /** Total number of launchpad tokens migrated (graduated) by this wallet across all networks. */ + tokensMigratedCount?: Maybe; + /** Twitter/X numeric ID */ + twitterId?: Maybe; + /** Twitter/X username */ + twitterUsername?: Maybe; + /** Website URL */ + website?: Maybe; }; /** Input arguments for the `backfillWalletAggregates` mutation. */ @@ -9780,6 +14791,19 @@ export type WalletAggregateBackfillStateResponse = { walletAddress: Scalars['String']['output']; }; +/** Wallet behavior classification. */ +export enum WalletCategory { + DefiExchange = 'DEFI_EXCHANGE', + Exchange = 'EXCHANGE', + Normie = 'NORMIE', + Notorious = 'NOTORIOUS', + Pair = 'PAIR', + PairTokenHolder = 'PAIR_TOKEN_HOLDER', + PoolAuthority = 'POOL_AUTHORITY', + StakingVault = 'STAKING_VAULT', + TokenCreator = 'TOKEN_CREATOR' +} + /** The data for a chart of a wallet's activity. */ export type WalletChartData = { __typename?: 'WalletChartData'; @@ -9865,12 +14889,22 @@ export type WalletFilterResult = { averageSwapAmountUsd1y: Scalars['String']['output']; /** Average swap amount in USD in the past 30 days */ averageSwapAmountUsd30d: Scalars['String']['output']; + /** Average hold period, in seconds, for positions sold during the past day. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1d?: Maybe; + /** Average hold period, in seconds, for positions sold during the past week. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1w?: Maybe; + /** Average hold period, in seconds, for positions sold during the past year. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1y?: Maybe; + /** Average hold period, in seconds, for positions sold during the past 30 days. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec30d?: Maybe; /** The backfill state of the wallet. */ backfillState?: Maybe; /** The bot score for the wallet. */ botScore?: Maybe; /** The unix timestamp for the first transaction from this wallet */ firstTransactionAt?: Maybe; + /** Manual or proposal-derived identity vocabulary (e.g. WHALE, KOL). Distinct from behavioral `labels`. */ + identityLabels?: Maybe>; /** The labels associated with the wallet */ labels: Array; /** The unix timestamp for the last transaction from this wallet */ @@ -9917,7 +14951,10 @@ export type WalletFilterResult = { uniqueTokens1d: Scalars['Int']['output']; /** Number of unique tokens traded in the past week */ uniqueTokens1w: Scalars['Int']['output']; - /** Number of unique tokens traded in the past year */ + /** + * Number of unique tokens traded in the past year + * @deprecated uniqueTokens1y is no longer supported and will be removed on 2026-07-10. + */ uniqueTokens1y: Scalars['Int']['output']; /** Number of unique tokens traded in the past 30 days */ uniqueTokens30d: Scalars['Int']['output']; @@ -9937,6 +14974,8 @@ export type WalletFilterResult = { volumeUsdAll1y: Scalars['String']['output']; /** Total volume in USD in the past 30 days including all tokens */ volumeUsdAll30d: Scalars['String']['output']; + /** The wallet identity and profile data */ + wallet?: Maybe; /** Win rate in the past day */ winRate1d: Scalars['Float']['output']; /** Win rate in the past week */ @@ -9965,10 +15004,34 @@ export type WalletFilters = { averageSwapAmountUsd1y?: InputMaybe; /** Average swap amount in USD in the past 30 days */ averageSwapAmountUsd30d?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past day. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1d?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past week. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1w?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past year. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1y?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past 30 days. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec30d?: InputMaybe; /** The bot score for the wallet. */ botScore?: InputMaybe; + /** Ethos credibility score (0-2800) */ + ethosScore?: InputMaybe; /** The unix timestamp for the first transaction from this wallet. */ firstTransactionAt?: InputMaybe; + /** Filter by whether the wallet has a Discord account */ + hasDiscord?: InputMaybe; + /** Filter by whether the wallet has a display name set */ + hasDisplayName?: InputMaybe; + /** Filter by whether the wallet has a Farcaster account */ + hasFarcaster?: InputMaybe; + /** Filter by whether the wallet has a GitHub account */ + hasGithub?: InputMaybe; + /** Filter by whether the wallet has any linked social account */ + hasSocials?: InputMaybe; + /** Filter by whether the wallet has a Telegram account */ + hasTelegram?: InputMaybe; + /** Filter by whether the wallet has a Twitter/X account */ + hasTwitter?: InputMaybe; /** The unix timestamp for the last transaction from this wallet. */ lastTransactionAt?: InputMaybe; /** The native token balance of the wallet. Can only be used in conjunction with `networkId` filter. */ @@ -10009,11 +15072,18 @@ export type WalletFilters = { swapsAll1y?: InputMaybe; /** Total number of swaps in the past 30 days including all tokens */ swapsAll30d?: InputMaybe; + /** Number of tokens created by this wallet across all networks. */ + tokensCreatedCount?: InputMaybe; + /** Number of launchpad tokens migrated (graduated) by this wallet across all networks. */ + tokensMigratedCount?: InputMaybe; /** Number of unique tokens traded in the past day */ uniqueTokens1d?: InputMaybe; /** Number of unique tokens traded in the past week */ uniqueTokens1w?: InputMaybe; - /** Number of unique tokens traded in the past year */ + /** + * Number of unique tokens traded in the past year + * @deprecated uniqueTokens1y is no longer supported and will be removed on 2026-07-10. + */ uniqueTokens1y?: InputMaybe; /** Number of unique tokens traded in the past 30 days */ uniqueTokens30d?: InputMaybe; @@ -10072,6 +15142,17 @@ export enum WalletLabel { Wealthy = 'WEALTHY' } +/** Metadata for a wallet label from the WALLET_LABEL_TYPES vocabulary */ +export type WalletLabelType = { + __typename?: 'WalletLabelType'; + /** Description of what this label means */ + description: Scalars['String']['output']; + /** Human-readable display name */ + displayName: Scalars['String']['output']; + /** Label name (e.g. WHALE, CEX, KOL) */ + name: Scalars['String']['output']; +}; + /** Filters for a wallet on a specific network. */ export type WalletNetworkFilters = { /** Average profit in USD per trade in the past day */ @@ -10090,10 +15171,34 @@ export type WalletNetworkFilters = { averageSwapAmountUsd1y?: InputMaybe; /** Average swap amount in USD in the past 30 days */ averageSwapAmountUsd30d?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past day. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1d?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past week. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1w?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past year. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1y?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past 30 days. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec30d?: InputMaybe; /** The bot score for the wallet. Indicates the likelihood of the wallet being a bot. Zero being not a bot and 100 being a definite bot. */ botScore?: InputMaybe; + /** Ethos credibility score (0-2800) */ + ethosScore?: InputMaybe; /** The unix timestamp for the first transaction from this wallet. */ firstTransactionAt?: InputMaybe; + /** Filter by whether the wallet has a Discord account */ + hasDiscord?: InputMaybe; + /** Filter by whether the wallet has a display name set */ + hasDisplayName?: InputMaybe; + /** Filter by whether the wallet has a Farcaster account */ + hasFarcaster?: InputMaybe; + /** Filter by whether the wallet has a GitHub account */ + hasGithub?: InputMaybe; + /** Filter by whether the wallet has any linked social account */ + hasSocials?: InputMaybe; + /** Filter by whether the wallet has a Telegram account */ + hasTelegram?: InputMaybe; + /** Filter by whether the wallet has a Twitter/X account */ + hasTwitter?: InputMaybe; /** The unix timestamp for the last transaction from this wallet. */ lastTransactionAt?: InputMaybe; /** The native token balance of the wallet. */ @@ -10136,7 +15241,10 @@ export type WalletNetworkFilters = { uniqueTokens1d?: InputMaybe; /** Number of unique tokens traded in the past week */ uniqueTokens1w?: InputMaybe; - /** Number of unique tokens traded in the past year */ + /** + * Number of unique tokens traded in the past year + * @deprecated uniqueTokens1y is no longer supported and will be removed on 2026-07-10. + */ uniqueTokens1y?: InputMaybe; /** Number of unique tokens traded in the past 30 days */ uniqueTokens30d?: InputMaybe; @@ -10184,7 +15292,16 @@ export enum WalletNetworkRankingAttribute { AverageSwapAmountUsd1w = 'averageSwapAmountUsd1w', AverageSwapAmountUsd1y = 'averageSwapAmountUsd1y', AverageSwapAmountUsd30d = 'averageSwapAmountUsd30d', + /** Average hold period, in seconds, for positions sold during the past day. */ + AvgHoldPeriodSec1d = 'avgHoldPeriodSec1d', + /** Average hold period, in seconds, for positions sold during the past week. */ + AvgHoldPeriodSec1w = 'avgHoldPeriodSec1w', + /** Average hold period, in seconds, for positions sold during the past year. */ + AvgHoldPeriodSec1y = 'avgHoldPeriodSec1y', + /** Average hold period, in seconds, for positions sold during the past 30 days. */ + AvgHoldPeriodSec30d = 'avgHoldPeriodSec30d', BotScore = 'botScore', + EthosScore = 'ethosScore', FirstTransactionAt = 'firstTransactionAt', LastTransactionAt = 'lastTransactionAt', NativeTokenBalance = 'nativeTokenBalance', @@ -10207,6 +15324,7 @@ export enum WalletNetworkRankingAttribute { SwapsAll30d = 'swapsAll30d', UniqueTokens1d = 'uniqueTokens1d', UniqueTokens1w = 'uniqueTokens1w', + /** @deprecated uniqueTokens1y is no longer supported and will be removed on 2026-07-10. */ UniqueTokens1y = 'uniqueTokens1y', UniqueTokens30d = 'uniqueTokens30d', VolumeUsd1d = 'volumeUsd1d', @@ -10277,6 +15395,27 @@ export type WalletNftCollectionsResponse = { items: Array; }; +/** Polymarket public profile. proxyWallet is a Polymarket-managed proxy, not the user's signing wallet. */ +export type WalletPolymarketProfile = { + __typename?: 'WalletPolymarketProfile'; + /** Display name set by the user on Polymarket. */ + displayName?: Maybe; + /** Whether the user has opted to display their username publicly. */ + displayUsernamePublic?: Maybe; + /** Unix timestamp of when this Polymarket profile was last fetched. */ + fetchedAt: Scalars['Int']['output']; + /** Profile image URL set by the user on Polymarket. */ + profileImageUrl?: Maybe; + /** On-chain proxy wallet address used by Polymarket to represent the user. */ + proxyWallet: Scalars['String']['output']; + /** Auto-generated pseudonym assigned by Polymarket (e.g. Incompatible-Standoff). */ + pseudonym?: Maybe; + /** Whether the user has a verified badge on Polymarket. */ + verifiedBadge?: Maybe; + /** Self-claimed X (Twitter) username on Polymarket, if set by the user. */ + xUsername?: Maybe; +}; + /** A wallet ranking. */ export type WalletRanking = { /** The attribute to rank wallets by. */ @@ -10295,7 +15434,12 @@ export enum WalletRankingAttribute { AverageSwapAmountUsd1w = 'averageSwapAmountUsd1w', AverageSwapAmountUsd1y = 'averageSwapAmountUsd1y', AverageSwapAmountUsd30d = 'averageSwapAmountUsd30d', + AvgHoldPeriodSec1d = 'avgHoldPeriodSec1d', + AvgHoldPeriodSec1w = 'avgHoldPeriodSec1w', + AvgHoldPeriodSec1y = 'avgHoldPeriodSec1y', + AvgHoldPeriodSec30d = 'avgHoldPeriodSec30d', BotScore = 'botScore', + EthosScore = 'ethosScore', FirstTransactionAt = 'firstTransactionAt', LastTransactionAt = 'lastTransactionAt', NativeTokenBalance = 'nativeTokenBalance', @@ -10318,6 +15462,7 @@ export enum WalletRankingAttribute { SwapsAll30d = 'swapsAll30d', UniqueTokens1d = 'uniqueTokens1d', UniqueTokens1w = 'uniqueTokens1w', + /** @deprecated uniqueTokens1y is no longer supported and will be removed on 2026-07-10. */ UniqueTokens1y = 'uniqueTokens1y', UniqueTokens30d = 'uniqueTokens30d', VolumeUsd1d = 'volumeUsd1d', @@ -10368,6 +15513,14 @@ export type WalletTokenFilters = { amountSoldUsd1y?: InputMaybe; /** Filter by amount sold in USD in the past 30 days */ amountSoldUsd30d?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past day. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1d?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past week. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1w?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past year. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1y?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past 30 days. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec30d?: InputMaybe; /** Filter by bot score */ botScore?: InputMaybe; /** Filter by number of buys in the past day */ @@ -10450,6 +15603,14 @@ export type WalletTokenFiltersV2 = { amountSoldUsd1y?: InputMaybe; /** Filter by amount sold in USD in the past 30 days */ amountSoldUsd30d?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past day. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1d?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past week. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1w?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past year. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec1y?: InputMaybe; + /** Average hold period, in seconds, for positions sold during the past 30 days. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells. */ + avgHoldPeriodSec30d?: InputMaybe; /** Filter by bot score */ botScore?: InputMaybe; /** Filter by number of buys in the past day */ @@ -10540,6 +15701,14 @@ export enum WalletTokenRankingAttribute { AmountSoldUsd1y = 'amountSoldUsd1y', /** Amount sold in USD in the past 30 days */ AmountSoldUsd30d = 'amountSoldUsd30d', + /** Average hold period, in seconds, for positions sold during the past day. */ + AvgHoldPeriodSec1d = 'avgHoldPeriodSec1d', + /** Average hold period, in seconds, for positions sold during the past week. */ + AvgHoldPeriodSec1w = 'avgHoldPeriodSec1w', + /** Average hold period, in seconds, for positions sold during the past year. */ + AvgHoldPeriodSec1y = 'avgHoldPeriodSec1y', + /** Average hold period, in seconds, for positions sold during the past 30 days. */ + AvgHoldPeriodSec30d = 'avgHoldPeriodSec30d', /** The bot score for the wallet. */ BotScore = 'botScore', /** Number of buys in the past day */ @@ -10641,43 +15810,18 @@ export type Webhook = { retrySettings?: Maybe; /** The status of the webhook. Can be `ACTIVE` or `INACTIVE`. */ status: Scalars['String']['output']; - /** The type of webhook. Can be `PRICE_EVENT`, `NFT_EVENT`, or `TOKEN_PAIR_EVENT`. */ + /** The type of webhook. Can be `PRICE_EVENT`, `TOKEN_PAIR_EVENT`, or `RAW_TRANSACTION`. */ webhookType: WebhookType; }; /** Webhook conditions that must be met for each webhook type. */ -export type WebhookCondition = MarketCapEventWebhookCondition | NftEventWebhookCondition | PriceEventWebhookCondition | RawTransactionWebhookCondition | TokenPairEventWebhookCondition | TokenPriceEventWebhookCondition | TokenTransferEventWebhookCondition; - -/** NFT marketplace names. */ -export enum WebhookNftEventFillSource { - Blur = 'BLUR', - Coinbase = 'COINBASE', - Echelon = 'ECHELON', - Element = 'ELEMENT', - Ensvision = 'ENSVISION', - Flipxyz = 'FLIPXYZ', - Gem = 'GEM', - Genie = 'GENIE', - Kodex = 'KODEX', - Magiceden = 'MAGICEDEN', - Nftnerds = 'NFTNERDS', - Opensea = 'OPENSEA', - Rarible = 'RARIBLE', - Reservoirtools = 'RESERVOIRTOOLS', - Soundxyz = 'SOUNDXYZ' -} - -/** NFT event types. */ -export enum WebhookNftEventType { - Mint = 'MINT', - Sale = 'SALE', - Transfer = 'TRANSFER' -} +export type WebhookCondition = MarketCapEventWebhookCondition | PredictionMarketMetricsEventWebhookCondition | PredictionTradeWebhookCondition | PriceEventWebhookCondition | RawTransactionWebhookCondition | TokenPairEventWebhookCondition | TokenPriceEventWebhookCondition | TokenTransferEventWebhookCondition; /** The type of webhook. */ export enum WebhookType { MarketCapEvent = 'MARKET_CAP_EVENT', - NftEvent = 'NFT_EVENT', + PredictionMarketMetricsEvent = 'PREDICTION_MARKET_METRICS_EVENT', + PredictionTrade = 'PREDICTION_TRADE', PriceEvent = 'PRICE_EVENT', RawTransaction = 'RAW_TRANSACTION', TokenPairEvent = 'TOKEN_PAIR_EVENT', @@ -10804,6 +15948,8 @@ export type WindowedDetailedNonCurrencyPairStats = { /** The non-currency stats for a wallet over a time window. */ export type WindowedDetailedNonCurrencyWalletStats = { __typename?: 'WindowedDetailedNonCurrencyWalletStats'; + /** Average hold period, in seconds, for positions sold during the window. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells in the window. */ + avgHoldPeriodSec?: Maybe; /** The number of losses */ losses: Scalars['Int']['output']; /** The number of swaps */ @@ -10814,6 +15960,19 @@ export type WindowedDetailedNonCurrencyWalletStats = { wins: Scalars['Int']['output']; }; +/** The non-currency stats for a wallet over the 1-year window. Mirrors `WindowedDetailedNonCurrencyWalletStats`, but scopes the deprecation of `uniqueTokens` to the 1-year window only. */ +export type WindowedDetailedNonCurrencyWalletStatsYear = { + __typename?: 'WindowedDetailedNonCurrencyWalletStatsYear'; + /** Average hold period, in seconds, for positions sold during the window. Calculated from cost-basis turnover using sold cost basis. Returns null when there are no sells in the window. */ + avgHoldPeriodSec?: Maybe; + /** The number of losses */ + losses: Scalars['Int']['output']; + /** The number of swaps */ + swaps: Scalars['Int']['output']; + /** The number of wins */ + wins: Scalars['Int']['output']; +}; + /** Detailed pair stats over a time frame. */ export type WindowedDetailedPairStats = { __typename?: 'WindowedDetailedPairStats'; @@ -10879,6 +16038,328 @@ export type WindowedDetailedTokenStats = { timestamps: Array>; }; +/** All-time stats containing volume data. */ +export type WindowedPredictionAllTimeStats = { + __typename?: 'WindowedPredictionAllTimeStats'; + /** Venue-specific volume (optional). */ + venueVolume?: Maybe; + /** Total volume. */ + volume: CurrencyValuePair; +}; + +/** Buy/sell volume breakdown for an event. */ +export type WindowedPredictionEventBuySellStats = { + __typename?: 'WindowedPredictionEventBuySellStats'; + /** Buy volume. */ + buyVolume: CurrencyValuePair; + /** Sell volume. */ + sellVolume: CurrencyValuePair; +}; + +/** Change percentages for a prediction event over a time window. */ +export type WindowedPredictionEventChangeStats = { + __typename?: 'WindowedPredictionEventChangeStats'; + /** Buy volume change percentage (optional). */ + buyVolumeChange?: Maybe; + /** Liquidity change percentage (optional). */ + liquidityChange?: Maybe; + /** Open interest change percentage (optional). */ + openInterestChange?: Maybe; + /** Sell volume change percentage (optional). */ + sellVolumeChange?: Maybe; + /** Trades change percentage. */ + tradesChange: Scalars['Float']['output']; + /** Unique traders change percentage (optional). */ + uniqueTradersChange?: Maybe; + /** Volume change percentage. */ + volumeChange: Scalars['Float']['output']; +}; + +/** Core event stats that are always available. */ +export type WindowedPredictionEventCoreStats = { + __typename?: 'WindowedPredictionEventCoreStats'; + /** Number of trades during this window. */ + trades: Scalars['Int']['output']; + /** Volume during this window. */ + volume: CurrencyValuePair; +}; + +/** Event-level liquidity OHLC data. */ +export type WindowedPredictionEventLiquidityStats = { + __typename?: 'WindowedPredictionEventLiquidityStats'; + /** Liquidity OHLC values. */ + liquidity: CurrencyOhlc; +}; + +/** Event-level open interest OHLC data. */ +export type WindowedPredictionEventOpenInterestStats = { + __typename?: 'WindowedPredictionEventOpenInterestStats'; + /** Open interest OHLC values. */ + openInterest: CurrencyOhlc; +}; + +/** Unique trader count during the period. */ +export type WindowedPredictionEventUniqueTraderStats = { + __typename?: 'WindowedPredictionEventUniqueTraderStats'; + /** Number of unique traders. */ + uniqueTraders: Scalars['Int']['output']; +}; + +/** Change percentages for a prediction market over a time window. */ +export type WindowedPredictionMarketChangeStats = { + __typename?: 'WindowedPredictionMarketChangeStats'; + /** Liquidity change percentage (optional). */ + liquidityChange?: Maybe; + /** Open interest change percentage (optional). */ + openInterestChange?: Maybe; + /** Trades change percentage. */ + tradesChange: Scalars['Float']['output']; + /** Unique traders change percentage (optional). */ + uniqueTradersChange?: Maybe; + /** Volume change percentage. */ + volumeChange: Scalars['Float']['output']; +}; + +/** Core market stats that are always available. */ +export type WindowedPredictionMarketCoreStats = { + __typename?: 'WindowedPredictionMarketCoreStats'; + /** Number of trades during this window. */ + trades: Scalars['Int']['output']; + /** Volume during this window. */ + volume: CurrencyValuePair; +}; + +/** Market-level liquidity OHLC data. */ +export type WindowedPredictionMarketLiquidityStats = { + __typename?: 'WindowedPredictionMarketLiquidityStats'; + /** Liquidity OHLC values. */ + liquidity: CurrencyOhlc; +}; + +/** Per-window market-level stat conditions for a prediction market metrics event webhook. */ +export type WindowedPredictionMarketMetricsEventMarketCondition = { + __typename?: 'WindowedPredictionMarketMetricsEventMarketCondition'; + /** The number of trades condition. */ + trades?: Maybe; + /** The trades change condition. */ + tradesChange?: Maybe; + /** The volume change condition. */ + volumeChange?: Maybe; + /** The volume in USD condition. */ + volumeUsd?: Maybe; +}; + +/** Per-window market-level stat thresholds. All present fields ANDed. */ +export type WindowedPredictionMarketMetricsEventMarketConditionInput = { + trades?: InputMaybe; + tradesChange?: InputMaybe; + volumeChange?: InputMaybe; + volumeUsd?: InputMaybe; +}; + +/** Per-window outcome stat conditions for a prediction market metrics event webhook. */ +export type WindowedPredictionMarketMetricsEventOutcomeCondition = { + __typename?: 'WindowedPredictionMarketMetricsEventOutcomeCondition'; + /** The price condition. */ + price?: Maybe; + /** The price change condition. */ + priceChange?: Maybe; + /** The number of trades condition. */ + trades?: Maybe; + /** The trades change condition. */ + tradesChange?: Maybe; + /** The volume change condition. */ + volumeChange?: Maybe; + /** The volume in USD condition. */ + volumeUsd?: Maybe; +}; + +/** Per-window stat thresholds for a PredictionMarketMetricsEvent webhook outcome. All present fields are ANDed. */ +export type WindowedPredictionMarketMetricsEventOutcomeConditionInput = { + price?: InputMaybe; + priceChange?: InputMaybe; + trades?: InputMaybe; + tradesChange?: InputMaybe; + volumeChange?: InputMaybe; + volumeUsd?: InputMaybe; +}; + +/** Market-level open interest OHLC data. */ +export type WindowedPredictionMarketOpenInterestStats = { + __typename?: 'WindowedPredictionMarketOpenInterestStats'; + /** Open interest OHLC values. */ + openInterest: CurrencyOhlc; +}; + +/** Unique trader count during the period. */ +export type WindowedPredictionMarketUniqueTraderStats = { + __typename?: 'WindowedPredictionMarketUniqueTraderStats'; + /** Number of unique traders. */ + uniqueTraders: Scalars['Int']['output']; +}; + +/** Buy/sell trade breakdown for an outcome. */ +export type WindowedPredictionOutcomeBuySellStats = { + __typename?: 'WindowedPredictionOutcomeBuySellStats'; + /** Buy volume breakdown. */ + buyVolume: OutcomeBuySellVolumeStats; + /** Number of buys. */ + buys: Scalars['Int']['output']; + /** Sell volume breakdown. */ + sellVolume: OutcomeBuySellVolumeStats; + /** Number of sells. */ + sells: Scalars['Int']['output']; +}; + +/** Change percentages for a prediction outcome over a time window. */ +export type WindowedPredictionOutcomeChangeStats = { + __typename?: 'WindowedPredictionOutcomeChangeStats'; + /** Buys change percentage (optional). */ + buysChange?: Maybe; + /** Liquidity change percentage (optional). */ + liquidityChange?: Maybe; + /** Price change percentage. */ + priceChange: Scalars['Float']['output']; + /** Price range over the window (volatility proxy). */ + priceRange: Scalars['Float']['output']; + /** Sells change percentage (optional). */ + sellsChange?: Maybe; + /** Trades change percentage. */ + tradesChange: Scalars['Float']['output']; + /** Volume change percentage. */ + volumeChange: Scalars['Float']['output']; + /** Volume shares change percentage. */ + volumeSharesChange: Scalars['Float']['output']; +}; + +/** Core outcome stats that are always available. */ +export type WindowedPredictionOutcomeCoreStats = { + __typename?: 'WindowedPredictionOutcomeCoreStats'; + /** Price OHLC data. */ + price: PriceOhlc; + /** Number of trades. */ + trades: Scalars['Int']['output']; + /** The venue-specific outcome ID. */ + venueOutcomeId: Scalars['String']['output']; + /** Volume stats including shares. */ + volume: OutcomeVolumeStats; +}; + +/** Two percent depth OHLC data for bid and ask. */ +export type WindowedPredictionOutcomeDepthStats = { + __typename?: 'WindowedPredictionOutcomeDepthStats'; + /** Ask depth OHLC. */ + askDepth: CurrencyOhlc; + /** Bid depth OHLC. */ + bidDepth: CurrencyOhlc; +}; + +/** Outcome-level liquidity OHLC data. */ +export type WindowedPredictionOutcomeLiquidityStats = { + __typename?: 'WindowedPredictionOutcomeLiquidityStats'; + /** Liquidity OHLC values. */ + liquidity: CurrencyOhlc; +}; + +/** Orderbook bid/ask OHLC data. */ +export type WindowedPredictionOutcomeOrderbookStats = { + __typename?: 'WindowedPredictionOutcomeOrderbookStats'; + /** Ask price OHLC. */ + ask: PriceOhlc; + /** Bid price OHLC. */ + bid: PriceOhlc; +}; + +/** All-time stats for a prediction trader in a windowed context. */ +export type WindowedPredictionTraderAllTimeStats = { + __typename?: 'WindowedPredictionTraderAllTimeStats'; + /** The total profit ct. */ + totalProfitCT: Scalars['String']['output']; + /** The total profit usd. */ + totalProfitUsd: Scalars['String']['output']; + /** The total volume ct. */ + totalVolumeCT: Scalars['String']['output']; + /** The total volume usd. */ + totalVolumeUsd: Scalars['String']['output']; +}; + +/** Change percentages for a prediction trader over a time window. */ +export type WindowedPredictionTraderChangeStats = { + __typename?: 'WindowedPredictionTraderChangeStats'; + /** Buy volume. */ + buyVolumeChange: Scalars['Float']['output']; + /** The percentage change. */ + lossesChange: Scalars['Float']['output']; + /** The percentage change. */ + realizedPnlChange: Scalars['Float']['output']; + /** Sell volume. */ + sellVolumeChange: Scalars['Float']['output']; + /** Trades change percentage. */ + tradesChange: Scalars['Float']['output']; + /** The percentage change. */ + uniqueMarketsChange: Scalars['Float']['output']; + /** Volume change percentage. */ + volumeChange: Scalars['Float']['output']; + /** The percentage change. */ + winsChange: Scalars['Float']['output']; +}; + +/** Currency stats for a prediction trader over a time window. */ +export type WindowedPredictionTraderCurrencyStats = { + __typename?: 'WindowedPredictionTraderCurrencyStats'; + /** The average profit ctper trade. */ + averageProfitCTPerTrade: Scalars['String']['output']; + /** The average profit usd per trade. */ + averageProfitUsdPerTrade: Scalars['String']['output']; + /** The average swap amount ct. */ + averageSwapAmountCT: Scalars['String']['output']; + /** The average swap amount usd. */ + averageSwapAmountUsd: Scalars['String']['output']; + /** Buy volume in collateral token units. */ + buyVolumeCT: Scalars['String']['output']; + /** Buy volume in USD. */ + buyVolumeUsd: Scalars['String']['output']; + /** The held token acquisition cost ct. */ + heldTokenAcquisitionCostCT: Scalars['String']['output']; + /** The held token acquisition cost usd. */ + heldTokenAcquisitionCostUsd: Scalars['String']['output']; + /** The realized pnl ct. */ + realizedPnlCT: Scalars['String']['output']; + /** The realized pnl usd. */ + realizedPnlUsd: Scalars['String']['output']; + /** The realized profit percentage. */ + realizedProfitPercentage: Scalars['Float']['output']; + /** Sell volume in collateral token units. */ + sellVolumeCT: Scalars['String']['output']; + /** Sell volume in USD. */ + sellVolumeUsd: Scalars['String']['output']; + /** The sold token acquisition cost ct. */ + soldTokenAcquisitionCostCT: Scalars['String']['output']; + /** The sold token acquisition cost usd. */ + soldTokenAcquisitionCostUsd: Scalars['String']['output']; + /** Volume in collateral token units. */ + volumeCT: Scalars['String']['output']; + /** Volume in USD. */ + volumeUsd: Scalars['String']['output']; +}; + +/** Non-currency stats for a prediction trader over a time window. */ +export type WindowedPredictionTraderNonCurrencyStats = { + __typename?: 'WindowedPredictionTraderNonCurrencyStats'; + /** The number of buys. */ + buys: Scalars['Int']['output']; + /** The losses. */ + losses: Scalars['Int']['output']; + /** The number of sells. */ + sells: Scalars['Int']['output']; + /** The number of trades. */ + trades: Scalars['Int']['output']; + /** The number of unique markets. */ + uniqueMarkets: Scalars['Int']['output']; + /** The wins. */ + wins: Scalars['Int']['output']; +}; + /** The stats for a wallet over a time window. */ export type WindowedWalletStats = { __typename?: 'WindowedWalletStats'; @@ -10898,6 +16379,25 @@ export type WindowedWalletStats = { walletAddress: Scalars['String']['output']; }; +/** The stats for a wallet over the 1-year window. Mirrors `WindowedWalletStats`, but exposes 1-year-scoped non-currency stats so `uniqueTokens` can be deprecated for the 1-year window only. */ +export type WindowedWalletStatsYear = { + __typename?: 'WindowedWalletStatsYear'; + /** The end timestamp */ + end: Scalars['Int']['output']; + /** The last transaction timestamp */ + lastTransactionAt: Scalars['Int']['output']; + /** The network ID */ + networkId?: Maybe; + /** The start timestamp */ + start: Scalars['Int']['output']; + /** The stats related to non-currency */ + statsNonCurrency: WindowedDetailedNonCurrencyWalletStatsYear; + /** The stats related to currency */ + statsUsd: WindowedDetailedCurrencyWalletStats; + /** The wallet address */ + walletAddress: Scalars['String']['output']; +}; + /** Currency stats. */ export type StatsCurrency = { /** The average sale price in the time frame. */ diff --git a/examples/codegen/src/index.ts b/examples/codegen/src/index.ts index 0d92a0d..abd6941 100644 --- a/examples/codegen/src/index.ts +++ b/examples/codegen/src/index.ts @@ -1,7 +1,8 @@ import { Codex } from "@codex-data/sdk"; -import { graphql } from "./gql/gql"; -import { NetworksQuery, NetworksQueryVariables } from "./gql/graphql"; +import { graphql } from "./gql"; +// The result type is inferred from exactly the fields selected here — +// and you're only billed for the fields you request. const doc = graphql(` query Networks { getNetworks { @@ -13,6 +14,6 @@ const doc = graphql(` const sdk = new Codex(process.env.CODEX_API_KEY || ""); -sdk.query(doc).then((res) => { - console.log("Fetched res", res); +sdk.query(doc).then((res) => { + console.log("Fetched res", res.getNetworks); }); diff --git a/package.json b/package.json index 2320965..6a6fe06 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "types": "./dist/index.d.ts", "import": "./dist/index.mjs", "require": "./dist/index.js" - } + }, + "./schema.graphql": "./schema.graphql" }, "sideEffects": false, "scripts": { @@ -23,7 +24,7 @@ "build:cjs": "tsc", "build:esm": "tsc -p tsconfig.esm.json", "build:rename-esm": "find dist-esm -name '*.js' -exec sh -c 'mv \"$1\" \"${1%.js}.mjs\"' _ {} \\; && cp -r dist-esm/* dist/ && rm -rf dist-esm", - "fetch:schema": "curl -s https://graph.codex.io/schema/latest.graphql --output src/resources/schema.graphql", + "fetch:schema": "curl -s https://graph.codex.io/schema/latest.graphql --output src/resources/schema.graphql && cp src/resources/schema.graphql schema.graphql", "generate:configs": "tsx src/scripts/generateNetworkConfigs.ts", "generate:graphql": "tsx src/scripts/generateGraphql.ts", "build:sdk": "tsx src/scripts/buildSdk.ts", @@ -40,6 +41,7 @@ "dist/index.mjs", "dist/index.d.ts", "dist/sdk/", + "schema.graphql", "README.md" ], "keywords": [ diff --git a/src/index.ts b/src/index.ts index 2ebf9fe..abb5672 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,3 +4,22 @@ export type { ApiConfig, CleanupFunction } from "./sdk"; // Export GraphQL types for use in applications export * from "./sdk/generated/graphql"; + +/** + * Recursively marks every field of a type as optional. + * + * Useful with `sdk.send()` when your query selects a subset of a type's + * fields: the exported query types (e.g. `FilterTokensQuery`) describe the + * full selection, so wrapping them in `DeepPartial` keeps the compiler honest + * about fields your query didn't ask for. + * + * @example + * const result = await sdk.send>( + * `query { filterTokens(limit: 10) { results { priceUSD } } }`, + * ); + */ +export type DeepPartial = T extends (infer U)[] + ? DeepPartial[] + : T extends object + ? { [K in keyof T]?: DeepPartial } + : T; From 8c291d8ddcd77b079d5fa8558f905e086a266d7e Mon Sep 17 00:00:00 2001 From: isEvrythngTkn Date: Wed, 8 Jul 2026 13:05:56 -0700 Subject: [PATCH 2/3] readme update --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bdd13cf..9226a1f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ const networks = await sdk.queries.getNetworks({}); console.log(networks.getNetworks); // [{ id: 1, name: "ethereum" }, { id: 1399811149, name: "solana" }, ...] ``` -> **Tip:** The built-in `sdk.queries.*` methods request **every** available field, and Codex pricing is based on the fields your query requests. They're great for exploring the API, but for production we recommend [writing a custom query](#custom-queries-request-only-the-fields-you-need) that selects only the fields you need. +> **Tip:** The built-in `sdk.queries.*` methods request **every** available field. They're great for exploring the API, but for production we recommend [writing a custom query](#custom-queries-request-only-the-fields-you-need) that selects only the fields you need. ## Get Token Prices @@ -307,7 +307,7 @@ const unsubscribe = sdk.subscriptions.onEventsCreated( ## Custom Queries: Request Only the Fields You Need -Codex pricing is based on the fields your query requests, and some nested fields (like the full `token` object) carry their own cost. The built-in `sdk.queries.*` methods select every available field, so the recipes above are the most expensive way to call each endpoint. Writing your own query means you pay only for what you use — and get smaller, faster responses. +The built-in `sdk.queries.*` methods select every available field, so the recipes above are the most expensive way to call each endpoint. Writing your own query means you get smaller, faster responses. There are two ways to do it: From 1296ec6a90be3cf5f0d6641b00c5f4fdf203afd4 Mon Sep 17 00:00:00 2001 From: isEvrythngTkn Date: Wed, 8 Jul 2026 13:34:29 -0700 Subject: [PATCH 3/3] remove weird line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9226a1f..9ff0c37 100644 --- a/README.md +++ b/README.md @@ -332,7 +332,7 @@ const result = await sdk.send<{ console.log("Networks:", result.getNetworks); ``` -Instead of writing types by hand, you can reuse the SDK's exported query types with `DeepPartial`, which makes every field optional — keeping the compiler honest about fields your query didn't select: +Instead of writing types by hand, you can reuse the SDK's exported query types with `DeepPartial`, which makes every field optional: ```typescript import { Codex, DeepPartial, FilterTokensQuery } from "@codex-data/sdk";