@codex-data/sdk 2.4.2 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/edge.mjs +157 -1
- package/dist/sdk/generated/graphql.d.ts +8 -8
- package/package.json +5 -3
- package/schema.graphql +8 -8
package/dist/edge.mjs
CHANGED
|
@@ -1 +1,157 @@
|
|
|
1
|
-
|
|
1
|
+
// src/sdk/edge.ts
|
|
2
|
+
import {
|
|
3
|
+
createClient
|
|
4
|
+
} from "graphql-ws";
|
|
5
|
+
|
|
6
|
+
// src/sdk/edgeSubscription.ts
|
|
7
|
+
import { getOperationAST, Kind, parse, valueFromASTUntyped } from "graphql";
|
|
8
|
+
var SOLANA_NETWORK_ID = 1399811149;
|
|
9
|
+
var SUPPORTED_OPERATIONS = /* @__PURE__ */ new Set([
|
|
10
|
+
"onEventsCreated",
|
|
11
|
+
"onTokenEventsCreated",
|
|
12
|
+
"onBarsUpdated",
|
|
13
|
+
"onTokenBarsUpdated"
|
|
14
|
+
]);
|
|
15
|
+
function assertEdgeSubscription(payload) {
|
|
16
|
+
function fail() {
|
|
17
|
+
throw new Error(
|
|
18
|
+
"useEdge requires a supported Solana subscription with commitmentLevel including Processed"
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
const document = parse(payload.query);
|
|
22
|
+
const operation = getOperationAST(document, payload.operationName);
|
|
23
|
+
if (!operation || operation.operation !== "subscription") fail();
|
|
24
|
+
const selections = operation.selectionSet.selections;
|
|
25
|
+
if (selections.length !== 1) fail();
|
|
26
|
+
const field = selections[0];
|
|
27
|
+
if (field.kind !== Kind.FIELD || !SUPPORTED_OPERATIONS.has(field.name.value))
|
|
28
|
+
fail();
|
|
29
|
+
if (field.directives?.length) fail();
|
|
30
|
+
const variables = { ...payload.variables };
|
|
31
|
+
for (const definition of operation.variableDefinitions ?? []) {
|
|
32
|
+
const name = definition.variable.name.value;
|
|
33
|
+
if (variables[name] === void 0 && definition.defaultValue !== void 0) {
|
|
34
|
+
variables[name] = valueFromASTUntyped(definition.defaultValue);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const args = Object.fromEntries(
|
|
38
|
+
(field.arguments ?? []).map((argument) => [
|
|
39
|
+
argument.name.value,
|
|
40
|
+
valueFromASTUntyped(argument.value, variables)
|
|
41
|
+
])
|
|
42
|
+
);
|
|
43
|
+
const levels = Array.isArray(args.commitmentLevel) ? args.commitmentLevel : [args.commitmentLevel];
|
|
44
|
+
if (!levels.includes("Processed") || [...levels].some(
|
|
45
|
+
(level) => level !== "Processed" && level !== "Confirmed" && level !== "Preprocessed"
|
|
46
|
+
))
|
|
47
|
+
fail();
|
|
48
|
+
const networks = [];
|
|
49
|
+
const collect = (value) => {
|
|
50
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
51
|
+
for (const [name, item] of Object.entries(value)) {
|
|
52
|
+
if (name === "networkId" && item != null) networks.push(item);
|
|
53
|
+
if (["id", "pairId", "tokenId"].includes(name) && item != null) {
|
|
54
|
+
if (typeof item !== "string" || !/^[^:]+:\d+$/.test(item)) fail();
|
|
55
|
+
networks.push(Number(item.slice(item.lastIndexOf(":") + 1)));
|
|
56
|
+
}
|
|
57
|
+
if (name === "input") collect(item);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
collect(args);
|
|
61
|
+
if (!networks.length || networks.some((network) => network !== SOLANA_NETWORK_ID))
|
|
62
|
+
fail();
|
|
63
|
+
if (field.name.value === "onBarsUpdated" && args.quoteToken == null) {
|
|
64
|
+
throw new Error("useEdge onBarsUpdated requires an explicit quoteToken");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/sdk/edge.ts
|
|
69
|
+
var DEFAULT_EDGE_URL = "wss://fra.edge.codex.io/graphql";
|
|
70
|
+
function createEdgeClient(options) {
|
|
71
|
+
return createClient({ ...options, url: options.url ?? DEFAULT_EDGE_URL });
|
|
72
|
+
}
|
|
73
|
+
function prepareEdgeSubscription(payload, replacer) {
|
|
74
|
+
const snapshot = JSON.parse(
|
|
75
|
+
JSON.stringify(payload, replacer)
|
|
76
|
+
);
|
|
77
|
+
assertEdgeSubscription(snapshot);
|
|
78
|
+
return snapshot;
|
|
79
|
+
}
|
|
80
|
+
function withEdge(main, options) {
|
|
81
|
+
const { edgeUrl = DEFAULT_EDGE_URL, ...wsOptions } = options;
|
|
82
|
+
const mainHandlers = /* @__PURE__ */ new Set();
|
|
83
|
+
const edgeHandlers = new Set(
|
|
84
|
+
wsOptions.on ? [wsOptions.on] : []
|
|
85
|
+
);
|
|
86
|
+
const handlersFor = (useEdge) => {
|
|
87
|
+
const handlers = () => Array.from(useEdge ? edgeHandlers : mainHandlers);
|
|
88
|
+
return {
|
|
89
|
+
connecting: (...args) => handlers().forEach((on) => on?.connecting?.(...args)),
|
|
90
|
+
opened: (...args) => handlers().forEach((on) => on?.opened?.(...args)),
|
|
91
|
+
connected: (...args) => handlers().forEach((on) => on?.connected?.(...args)),
|
|
92
|
+
ping: (...args) => handlers().forEach((on) => on?.ping?.(...args)),
|
|
93
|
+
pong: (...args) => handlers().forEach((on) => on?.pong?.(...args)),
|
|
94
|
+
message: (...args) => handlers().forEach((on) => on?.message?.(...args)),
|
|
95
|
+
closed: (...args) => handlers().forEach((on) => on?.closed?.(...args)),
|
|
96
|
+
error: (...args) => handlers().forEach((on) => on?.error?.(...args))
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
const mainEvents = handlersFor(false);
|
|
100
|
+
main.on("connecting", mainEvents.connecting);
|
|
101
|
+
main.on("opened", mainEvents.opened);
|
|
102
|
+
main.on("connected", mainEvents.connected);
|
|
103
|
+
main.on("ping", mainEvents.ping);
|
|
104
|
+
main.on("pong", mainEvents.pong);
|
|
105
|
+
main.on("message", mainEvents.message);
|
|
106
|
+
main.on("closed", mainEvents.closed);
|
|
107
|
+
main.on("error", mainEvents.error);
|
|
108
|
+
let edge;
|
|
109
|
+
let disposed = false;
|
|
110
|
+
return {
|
|
111
|
+
...main,
|
|
112
|
+
on: (event, listener, subscriptionOptions = {}) => {
|
|
113
|
+
const handlers = { [event]: listener };
|
|
114
|
+
if (subscriptionOptions.useEdge !== true) mainHandlers.add(handlers);
|
|
115
|
+
if (subscriptionOptions.useEdge !== false) edgeHandlers.add(handlers);
|
|
116
|
+
return () => {
|
|
117
|
+
mainHandlers.delete(handlers);
|
|
118
|
+
edgeHandlers.delete(handlers);
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
subscribe: (payload, sink, subscriptionOptions = {}) => {
|
|
122
|
+
if (disposed) throw new Error("Edge client has been disposed");
|
|
123
|
+
if (!subscriptionOptions.useEdge) return main.subscribe(payload, sink);
|
|
124
|
+
const snapshot = prepareEdgeSubscription(
|
|
125
|
+
payload,
|
|
126
|
+
wsOptions.jsonMessageReplacer
|
|
127
|
+
);
|
|
128
|
+
if (!edge) {
|
|
129
|
+
let subscriptionMessage = false;
|
|
130
|
+
edge = createEdgeClient({
|
|
131
|
+
...wsOptions,
|
|
132
|
+
url: edgeUrl,
|
|
133
|
+
on: handlersFor(true),
|
|
134
|
+
jsonMessageReplacer: function(key, value) {
|
|
135
|
+
if (key === "") subscriptionMessage = value?.type === "subscribe";
|
|
136
|
+
return subscriptionMessage ? value : wsOptions.jsonMessageReplacer ? wsOptions.jsonMessageReplacer.call(this, key, value) : value;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return edge.subscribe(snapshot, sink);
|
|
141
|
+
},
|
|
142
|
+
terminate: () => {
|
|
143
|
+
main.terminate();
|
|
144
|
+
edge?.terminate();
|
|
145
|
+
},
|
|
146
|
+
dispose: async () => {
|
|
147
|
+
disposed = true;
|
|
148
|
+
await Promise.all([main.dispose(), edge?.dispose()]);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export {
|
|
153
|
+
DEFAULT_EDGE_URL,
|
|
154
|
+
createClient,
|
|
155
|
+
createEdgeClient,
|
|
156
|
+
withEdge
|
|
157
|
+
};
|
|
@@ -3770,7 +3770,7 @@ export type LiquidityMetadataByToken = {
|
|
|
3770
3770
|
networkId: Scalars['Int']['output'];
|
|
3771
3771
|
/** The address of the token. */
|
|
3772
3772
|
tokenAddress: Scalars['String']['output'];
|
|
3773
|
-
/** The total liquidity in USD. */
|
|
3773
|
+
/** The token's total liquidity in USD. On networks where the real-money total is enabled, this is `totalLiquidityUsd` from `filterTokens` (the combined liquidity of its 15 deepest pools) once the token has one; elsewhere, or until then, it is the value of the token's own side across the pairs below at its current price. `lockedLiquidityPercentage` is always measured across the pairs below, not against this figure. */
|
|
3774
3774
|
totalLiquidityUsd: Scalars['String']['output'];
|
|
3775
3775
|
/** The total amount of tokens in pairs. */
|
|
3776
3776
|
totalTokenLiquidity: Scalars['String']['output'];
|
|
@@ -11467,7 +11467,7 @@ export type Price = {
|
|
|
11467
11467
|
* @deprecated Pricing no longer based on specific pools
|
|
11468
11468
|
*/
|
|
11469
11469
|
confidence?: Maybe<Scalars['Float']['output']>;
|
|
11470
|
-
/** The token's liquidity in USD. On networks where the real-money total is enabled, this is `totalLiquidityUsd` from `filterTokens`: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days, where each pool counts only the real money the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once. Elsewhere, or until that total is computed for the token, it is the token's route-backed liquidity, summed across its pairs with valid routing liquidity. Null when this stat has not been computed for the token yet.
|
|
11470
|
+
/** The token's liquidity in USD. On networks where the real-money total is enabled, this is `totalLiquidityUsd` from `filterTokens`: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days, where each pool counts only the real money the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once. Elsewhere, or until that total is computed for the token, it is the token's route-backed liquidity, summed across its pairs with valid routing liquidity. Null when this stat has not been computed for the token yet. On subscriptions it is the `totalLiquidityUsd` value only, refreshed at most every 30 seconds, and null on networks where the real-money total is not enabled. */
|
|
11471
11471
|
liquidityUsd?: Maybe<Scalars['String']['output']>;
|
|
11472
11472
|
/** The network ID the token is deployed on. */
|
|
11473
11473
|
networkId: Scalars['Int']['output'];
|
|
@@ -14367,11 +14367,11 @@ export type TokenFilterResult = {
|
|
|
14367
14367
|
lastTransaction?: Maybe<Scalars['Int']['output']>;
|
|
14368
14368
|
/** Metadata for the token's most liquid pair */
|
|
14369
14369
|
liquidPair?: Maybe<Pair>;
|
|
14370
|
-
/** The liquidity of the token's most liquid pair */
|
|
14370
|
+
/** The liquidity of the token's most liquid pair. On networks where the real-money total is enabled, this is the same value as `totalLiquidityUsd` (the combined liquidity of the token's 15 deepest pools) once the token has one. The value is recomputed when the token trades. */
|
|
14371
14371
|
liquidPairLiquidity?: Maybe<Scalars['String']['output']>;
|
|
14372
14372
|
/** The liquid pairs price in USD. */
|
|
14373
14373
|
liquidPairPriceUSD?: Maybe<Scalars['String']['output']>;
|
|
14374
|
-
/**
|
|
14374
|
+
/** The token's liquidity in USD. On networks where the real-money total is enabled, this is the same value as `totalLiquidityUsd` (the combined liquidity of its 15 deepest pools) once the token has one. On other networks it is the liquidity of the token's top pair, or with `useAggregatedStats` the token's aggregated liquidity. The value is recomputed when the token trades, so a token with no trade since this definition last changed keeps its previous value. */
|
|
14375
14375
|
liquidity?: Maybe<Scalars['String']['output']>;
|
|
14376
14376
|
/** The lowest price in USD in the past hour. */
|
|
14377
14377
|
low1?: Maybe<Scalars['String']['output']>;
|
|
@@ -14459,7 +14459,7 @@ export type TokenFilterResult = {
|
|
|
14459
14459
|
totalFees12?: Maybe<Scalars['String']['output']>;
|
|
14460
14460
|
/** The total trading fees (pool + gas + tips) in USD in the past 24 hours. */
|
|
14461
14461
|
totalFees24?: Maybe<Scalars['String']['output']>;
|
|
14462
|
-
/** The token's total liquidity in USD: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days. On networks where the real-money total is enabled, each pool counts only the real money behind it: what the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once.
|
|
14462
|
+
/** The token's total liquidity in USD: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days. On networks where the real-money total is enabled, each pool counts only the real money behind it: what the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once. On networks where the real-money total is enabled, `liquidity` is the same value; elsewhere `liquidity` covers the top pair only (or the aggregated liquidity with `useAggregatedStats`). The value is recomputed when the token trades, so a token with no trade since this definition last changed keeps its previous value. Null when this stat has not been computed for the token yet. */
|
|
14463
14463
|
totalLiquidityUsd?: Maybe<Scalars['String']['output']>;
|
|
14464
14464
|
/** A heuristic based on various factors used to rank tokens based on how trending they are. */
|
|
14465
14465
|
trendingScore?: Maybe<Scalars['Float']['output']>;
|
|
@@ -14654,7 +14654,7 @@ export type TokenFilters = {
|
|
|
14654
14654
|
launchpadName?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
14655
14655
|
/** A list of launchpad protocols. */
|
|
14656
14656
|
launchpadProtocol?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
14657
|
-
/** The
|
|
14657
|
+
/** The token's liquidity in USD. On networks where the real-money total is enabled, this filters on the same value as `totalLiquidityUsd` (the combined liquidity of its 15 deepest pools) once the token has one. On other networks it filters on the liquidity of the token's top pair, or with `useAggregatedStats` the token's aggregated liquidity. */
|
|
14658
14658
|
liquidity?: InputMaybe<NumberFilter>;
|
|
14659
14659
|
/** The lowest price in USD in the past hour. */
|
|
14660
14660
|
low1?: InputMaybe<NumberFilter>;
|
|
@@ -14740,7 +14740,7 @@ export type TokenFilters = {
|
|
|
14740
14740
|
totalFees12?: InputMaybe<NumberFilter>;
|
|
14741
14741
|
/** Filter by total fees in the past 24 hours. */
|
|
14742
14742
|
totalFees24?: InputMaybe<NumberFilter>;
|
|
14743
|
-
/** The token's total liquidity in USD: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days. On networks where the real-money total is enabled, each pool counts only the real money behind it: what the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once.
|
|
14743
|
+
/** The token's total liquidity in USD: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days. On networks where the real-money total is enabled, each pool counts only the real money behind it: what the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once. On networks where the real-money total is enabled, `liquidity` is the same value; elsewhere `liquidity` covers the top pair only (or the aggregated liquidity with `useAggregatedStats`). */
|
|
14744
14744
|
totalLiquidityUsd?: InputMaybe<NumberFilter>;
|
|
14745
14745
|
/** 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`. */
|
|
14746
14746
|
trendingIgnored?: InputMaybe<Scalars['Boolean']['input']>;
|
|
@@ -15633,7 +15633,7 @@ export type TokenWithMetadata = {
|
|
|
15633
15633
|
isScam?: Maybe<Scalars['Boolean']['output']>;
|
|
15634
15634
|
/** The unix timestamp for the token's last transaction. */
|
|
15635
15635
|
lastTransaction?: Maybe<Scalars['Int']['output']>;
|
|
15636
|
-
/** The total liquidity of the token's top pair
|
|
15636
|
+
/** The token's liquidity in USD. On networks where the real-money total is enabled, this is the same value as `totalLiquidityUsd` from `filterTokens` (the combined liquidity of the token's 15 deepest pools) once the token has one; elsewhere it is the total liquidity of the token's top pair. The value is recomputed when the token trades. */
|
|
15637
15637
|
liquidity: Scalars['String']['output'];
|
|
15638
15638
|
/** The fully diluted market cap. */
|
|
15639
15639
|
marketCap?: Maybe<Scalars['String']['output']>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codex-data/sdk",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.4",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=17.5.0"
|
|
6
6
|
},
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
"prebuild": "pnpm run clean && pnpm run generate:configs",
|
|
26
26
|
"clean": "rm -rf dist dist-esm",
|
|
27
27
|
"build": "pnpm run copy:schema && pnpm run generate:graphql && pnpm run build:sdk && pnpm run codegen && pnpm run lint ./src/sdk --fix && pnpm run build:types",
|
|
28
|
-
"build:types": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:rename-esm",
|
|
28
|
+
"build:types": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:rename-esm && pnpm run build:edge",
|
|
29
29
|
"build:cjs": "tsc",
|
|
30
30
|
"build:esm": "tsc -p tsconfig.esm.json",
|
|
31
31
|
"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",
|
|
32
|
+
"build:edge": "esbuild src/edge.ts --bundle --format=esm --platform=neutral --packages=external --target=es2020 --outfile=dist/edge.mjs",
|
|
32
33
|
"fetch:schema": "curl -s https://graph.codex.io/schema/latest.graphql --output src/resources/schema.graphql && cp src/resources/schema.graphql schema.graphql",
|
|
33
34
|
"copy:schema": "cp src/resources/schema.graphql schema.graphql",
|
|
34
35
|
"schema:diff": "tsx src/scripts/schemaDiff.ts",
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
"build:sdk": "tsx src/scripts/buildSdk.ts",
|
|
38
39
|
"codegen": "graphql-codegen --config codegen.ts",
|
|
39
40
|
"lint": "eslint --ext .ts src",
|
|
40
|
-
"test": "jest",
|
|
41
|
+
"test": "pnpm run build:types && jest",
|
|
41
42
|
"format": "prettier --write .",
|
|
42
43
|
"prepublishOnly": "pnpm run build",
|
|
43
44
|
"publish:beta": "pnpm publish --tag beta --access public",
|
|
@@ -92,6 +93,7 @@
|
|
|
92
93
|
"chalk": "^4.1.2",
|
|
93
94
|
"cli-spinners": "^2.9.2",
|
|
94
95
|
"dotenv": "^16.4.5",
|
|
96
|
+
"esbuild": "^0.25.12",
|
|
95
97
|
"eslint": "^8.50.0",
|
|
96
98
|
"eslint-config-prettier": "^9.0.0",
|
|
97
99
|
"eslint-plugin-import": "^2.28.1",
|
package/schema.graphql
CHANGED
|
@@ -9193,7 +9193,7 @@ type Price {
|
|
|
9193
9193
|
priceUsd: Float!
|
|
9194
9194
|
"""The pool that emitted the swap generating this price"""
|
|
9195
9195
|
blockNumber: Int
|
|
9196
|
-
"""The token's liquidity in USD. On networks where the real-money total is enabled, this is `totalLiquidityUsd` from `filterTokens`: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days, where each pool counts only the real money the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once. Elsewhere, or until that total is computed for the token, it is the token's route-backed liquidity, summed across its pairs with valid routing liquidity. Null when this stat has not been computed for the token yet.
|
|
9196
|
+
"""The token's liquidity in USD. On networks where the real-money total is enabled, this is `totalLiquidityUsd` from `filterTokens`: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days, where each pool counts only the real money the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once. Elsewhere, or until that total is computed for the token, it is the token's route-backed liquidity, summed across its pairs with valid routing liquidity. Null when this stat has not been computed for the token yet. On subscriptions it is the `totalLiquidityUsd` value only, refreshed at most every 30 seconds, and null on networks where the real-money total is not enabled."""
|
|
9197
9197
|
liquidityUsd: String
|
|
9198
9198
|
"""The percent price change in the past 24 hours. Decimal format. Not available via subscription."""
|
|
9199
9199
|
priceChange24: Float
|
|
@@ -9340,9 +9340,9 @@ type TokenFilterResult {
|
|
|
9340
9340
|
high24: String
|
|
9341
9341
|
"""The highest price in USD in the past 4 hours."""
|
|
9342
9342
|
high4: String
|
|
9343
|
-
"""
|
|
9343
|
+
"""The token's liquidity in USD. On networks where the real-money total is enabled, this is the same value as `totalLiquidityUsd` (the combined liquidity of its 15 deepest pools) once the token has one. On other networks it is the liquidity of the token's top pair, or with `useAggregatedStats` the token's aggregated liquidity. The value is recomputed when the token trades, so a token with no trade since this definition last changed keeps its previous value."""
|
|
9344
9344
|
liquidity: String
|
|
9345
|
-
"""The token's total liquidity in USD: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days. On networks where the real-money total is enabled, each pool counts only the real money behind it: what the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once.
|
|
9345
|
+
"""The token's total liquidity in USD: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days. On networks where the real-money total is enabled, each pool counts only the real money behind it: what the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once. On networks where the real-money total is enabled, `liquidity` is the same value; elsewhere `liquidity` covers the top pair only (or the aggregated liquidity with `useAggregatedStats`). The value is recomputed when the token trades, so a token with no trade since this definition last changed keeps its previous value. Null when this stat has not been computed for the token yet."""
|
|
9346
9346
|
totalLiquidityUsd: String
|
|
9347
9347
|
"""The token of interest. Can be `token0` or `token1`."""
|
|
9348
9348
|
quoteToken: String
|
|
@@ -9364,7 +9364,7 @@ type TokenFilterResult {
|
|
|
9364
9364
|
pair: Pair
|
|
9365
9365
|
"""Metadata for the token's most liquid pair"""
|
|
9366
9366
|
liquidPair: Pair
|
|
9367
|
-
"""The liquidity of the token's most liquid pair"""
|
|
9367
|
+
"""The liquidity of the token's most liquid pair. On networks where the real-money total is enabled, this is the same value as `totalLiquidityUsd` (the combined liquidity of the token's 15 deepest pools) once the token has one. The value is recomputed when the token trades."""
|
|
9368
9368
|
liquidPairLiquidity: String
|
|
9369
9369
|
"""The liquid pairs price in USD."""
|
|
9370
9370
|
liquidPairPriceUSD: String
|
|
@@ -13016,9 +13016,9 @@ input TokenFilters {
|
|
|
13016
13016
|
high24: NumberFilter
|
|
13017
13017
|
"""The highest price in USD in the past 4 hours."""
|
|
13018
13018
|
high4: NumberFilter
|
|
13019
|
-
"""The
|
|
13019
|
+
"""The token's liquidity in USD. On networks where the real-money total is enabled, this filters on the same value as `totalLiquidityUsd` (the combined liquidity of its 15 deepest pools) once the token has one. On other networks it filters on the liquidity of the token's top pair, or with `useAggregatedStats` the token's aggregated liquidity."""
|
|
13020
13020
|
liquidity: NumberFilter
|
|
13021
|
-
"""The token's total liquidity in USD: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days. On networks where the real-money total is enabled, each pool counts only the real money behind it: what the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once.
|
|
13021
|
+
"""The token's total liquidity in USD: the combined liquidity of its 15 deepest pools, leaving out pools with no trade in the last 7 days. On networks where the real-money total is enabled, each pool counts only the real money behind it: what the token can reach in one or two trades into the network's pricing reference tokens (such as its main stablecoins), with each route counted once. On networks where the real-money total is enabled, `liquidity` is the same value; elsewhere `liquidity` covers the top pair only (or the aggregated liquidity with `useAggregatedStats`)."""
|
|
13022
13022
|
totalLiquidityUsd: NumberFilter
|
|
13023
13023
|
"""The lowest price in USD in the past hour."""
|
|
13024
13024
|
low1: NumberFilter
|
|
@@ -13315,7 +13315,7 @@ type TokenWithMetadata {
|
|
|
13315
13315
|
exchanges: [Exchange!]!
|
|
13316
13316
|
"""The ID of the token (`address:networkId`). For example, `0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2:1`."""
|
|
13317
13317
|
id: String!
|
|
13318
|
-
"""The total liquidity of the token's top pair
|
|
13318
|
+
"""The token's liquidity in USD. On networks where the real-money total is enabled, this is the same value as `totalLiquidityUsd` from `filterTokens` (the combined liquidity of the token's 15 deepest pools) once the token has one; elsewhere it is the total liquidity of the token's top pair. The value is recomputed when the token trades."""
|
|
13319
13319
|
liquidity: String!
|
|
13320
13320
|
"""The name of the token."""
|
|
13321
13321
|
name: String!
|
|
@@ -15722,7 +15722,7 @@ type LiquidityMetadataByToken {
|
|
|
15722
15722
|
tokenAddress: String!
|
|
15723
15723
|
"""The network ID the token is deployed on."""
|
|
15724
15724
|
networkId: Int!
|
|
15725
|
-
"""The total liquidity in USD."""
|
|
15725
|
+
"""The token's total liquidity in USD. On networks where the real-money total is enabled, this is `totalLiquidityUsd` from `filterTokens` (the combined liquidity of its 15 deepest pools) once the token has one; elsewhere, or until then, it is the value of the token's own side across the pairs below at its current price. `lockedLiquidityPercentage` is always measured across the pairs below, not against this figure."""
|
|
15726
15726
|
totalLiquidityUsd: String!
|
|
15727
15727
|
"""The locked liquidity in USD."""
|
|
15728
15728
|
lockedLiquidityUsd: String!
|