chain-insights 0.46.3 → 0.46.5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: chain-insights-cypher
|
|
3
|
-
description: Load this before the first graph_query or graph_query_batch call: without it, most queries are refused. Use when answering any question about addresses, money flows, transfers, transactions or blocks with Chain Insights, when tracing where money went or came from, when writing or reviewing graph_query or graph_query_batch ISO GQL, when choosing between USE topology, USE facts and USE chain, or when a graph query is refused. Address, unit, layer, graph search and
|
|
3
|
+
description: Load this before the first graph_query or graph_query_batch call: without it, most queries are refused. Use when answering any question about addresses, money flows, transfers, transactions or blocks with Chain Insights, when tracing where money went or came from, when writing or reviewing graph_query or graph_query_batch ISO GQL, when choosing between USE topology, USE facts and USE chain, or when a graph query is refused. Address, unit, layer, graph search, refusal and answer rules (full addresses, no query text in replies, tokens are not dollars), with one query for each kind of search.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Chain Insights Cypher
|
|
@@ -18,11 +18,14 @@ Always pass `network` and your own `LIMIT`. These two commands, and
|
|
|
18
18
|
## Rules that stop most failures
|
|
19
19
|
|
|
20
20
|
1. Write every address in full, in lowercase: `0x` plus 40 hex characters, 42
|
|
21
|
-
in all. Never shorten one with `...` or `…`, in a query
|
|
22
|
-
Copy addresses from results exactly
|
|
21
|
+
in all. Never shorten one with `...` or `…`, in a query, a table, a sentence
|
|
22
|
+
or a summary. Copy addresses from results exactly, all 42 characters, every
|
|
23
|
+
time. The network is `robinhood`, the Robinhood Chain: use it without asking
|
|
24
|
+
the user which network.
|
|
23
25
|
2. Timestamps on every layer are integer milliseconds since the epoch, UTC,
|
|
24
26
|
and `USE chain` is no exception. Compute them from the current date: a day
|
|
25
|
-
is 86,400,000 ms.
|
|
27
|
+
is 86,400,000 ms. Write the number as a literal: the server has no `now()`,
|
|
28
|
+
`timestamp()` or `duration()`. Never compare one with an ISO string. `block_date` is the
|
|
26
29
|
string `"YYYY-MM-DD"`. Every `*_usd` field is US dollars. `*_raw` is the
|
|
27
30
|
token's smallest unit, not dollars.
|
|
28
31
|
3. A shortened address, a mixed-case address, or an ISO string against a
|
|
@@ -34,6 +37,16 @@ Always pass `network` and your own `LIMIT`. These two commands, and
|
|
|
34
37
|
6. After a refusal, fix the query once from `fix` and `example`. A second
|
|
35
38
|
refusal ends it: tell the user plainly what cannot be asked and what can.
|
|
36
39
|
Never send variations in a loop.
|
|
40
|
+
7. Answer in plain text. Do not print the query, its `USE` line, its `LIMIT`,
|
|
41
|
+
the epoch numbers you computed, or a `Ref:` line. The user does not need
|
|
42
|
+
them. Show them only when the user asks how a number was found.
|
|
43
|
+
8. Never draw the graph yourself, in ASCII art or in Mermaid. Claude Desktop
|
|
44
|
+
draws the picture from the column names (see Name the columns for a
|
|
45
|
+
picture). Write a short text answer beside it.
|
|
46
|
+
9. Tokens are not dollars. A transfer moves tokens, and its `amount_usd` is
|
|
47
|
+
their value at the day's average price. Say "tokens worth about 183 USD on
|
|
48
|
+
2026-10-06", never "sent 183 USD". For the assets behind a flow, use the
|
|
49
|
+
facts read in Value of one day's flow.
|
|
37
50
|
|
|
38
51
|
## Pick the layer first
|
|
39
52
|
|
|
@@ -65,7 +78,9 @@ Find the question in this table. Send its first query, once, with the addresses
|
|
|
65
78
|
| What fields does an Address have? | none | Call `meta_schema {network}`. Send no query. |
|
|
66
79
|
| Recent addresses, biggest senders, any top list of the chain | topology | A search bounded by `f.last_seen_timestamp`, then sort and LIMIT (below). |
|
|
67
80
|
|
|
68
|
-
For a question of the last row, compute the time bound first (epoch milliseconds
|
|
81
|
+
For a question of the last row, compute the time bound first as a literal number (epoch milliseconds of now minus 24 hours: take today's date, not a remembered year), then search. Never sort the whole graph without the time bound: it is stopped at 10 s.
|
|
82
|
+
|
|
83
|
+
A link's `amount_usd_sum` and `tx_count` are the pair's lifetime totals. The time bound only picks links active in the window; it does not cut their totals to the window. Say "lifetime total of pairs active in the last day", never "volume in the last day". For the money of one day, read the pair's transfers on `USE facts` for that day.
|
|
69
84
|
|
|
70
85
|
Recent activity, newest first:
|
|
71
86
|
|
|
@@ -276,6 +291,16 @@ MATCH (a:Address {address: "0x31a817802ee183eb8b13167ffe24bd28dcc6f30c"})-[t:TRA
|
|
|
276
291
|
RETURN t.tx_id AS tx_id, t.block_timestamp AS block_timestamp, t.asset_symbol AS asset_symbol, t.amount AS amount, t.amount_usd AS amount_usd, t.kind AS kind LIMIT 50
|
|
277
292
|
```
|
|
278
293
|
|
|
294
|
+
### Value of one day's flow
|
|
295
|
+
|
|
296
|
+
A topology link gives the pair's lifetime total, not the day's. To say what a
|
|
297
|
+
pair moved on one day, read its `TRANSFER` rows for that day, then:
|
|
298
|
+
|
|
299
|
+
1. List each row's `asset_symbol` and `amount`. Show the assets, not only a total.
|
|
300
|
+
2. Add the `amount_usd` values for the USD figure, after you convert the text to numbers. `amount_usd` is each row's value at the day's average price.
|
|
301
|
+
3. If a row's `price_missing` is true, show its amount and say no price exists for that asset. Never guess a USD value.
|
|
302
|
+
4. Say "tokens worth about X USD on DAY", because the row moved tokens.
|
|
303
|
+
|
|
279
304
|
## Chain: one key, one node
|
|
280
305
|
|
|
281
306
|
`USE chain` asks the chain node for one known thing: `Transaction` by `tx_id`, `Block` by `block_height` or `block_hash` (exactly one), `Address` by `address` (with an optional `at_block`), or `Head`. One node, literal keys in braces, a `RETURN` of `var.property` items, no `WHERE`, no range. Read its limits in `chain_admission` (`cia network robinhood --json`).
|
|
@@ -341,3 +366,5 @@ Claude Desktop draws a `graph_query` answer from its column names. Alias the
|
|
|
341
366
|
A graph also reads these optional columns: `amount_usd_sum`, `tx_count`, `first_seen_timestamp`, `last_seen_timestamp`, `link_kind`, `from_labels` and `to_labels`. In `graph_query_batch`, each query draws its own tab. Claude Code draws nothing and shows the rows as text.
|
|
342
367
|
|
|
343
368
|
A graph is the newest-links read of one address, receivers or senders, in Graph searches. A chart is the facts read of one pair over one day above, with `block_timestamp` and `amount_usd` in the `RETURN`.
|
|
369
|
+
|
|
370
|
+
A row that names its ends `src`, `dst` or `address` draws no graph. Alias them `from_address` and `to_address`.
|