chain-insights 0.84.0 → 0.85.0

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.
@@ -6,9 +6,9 @@ columns and the check are in the [README](README.md). The served copy is
6
6
  [robinhood.json](robinhood.json), written by
7
7
  `node scripts/pin-dex-registry.mjs registry/robinhood.md`.
8
8
 
9
- Registry version: 8.
9
+ Registry version: 9.
10
10
 
11
- Recorded on: 2026-11-06.
11
+ Recorded on: 2026-11-19.
12
12
 
13
13
  ## Rows
14
14
 
@@ -61,6 +61,11 @@ Recorded on: 2026-11-06.
61
61
  | balancer-v3 | unnamed Balancer v3 vault | Balancer, Balancer v3, Balancer v3 vault | vault | balancer-v3 | manager | `0x28082618ba2073e602230188e4f4c46e9b2169eb` | 0 | - | - | [Sourcify verified source](https://sourcify.dev/server/v2/contract/4663/0x28082618ba2073e602230188e4f4c46e9b2169eb) | served |
62
62
  | ekubo | Ekubo | Ekubo, Ekubo Protocol, ekubo.org | vault | ekubo-core | manager | `0x00000000000014aa86c5d3c41765bb24e11bd701` | 33534 | - | - | [Ekubo robinhood deployment](https://github.com/EkuboProtocol/evm-contracts/blob/933c813ca154475a3c7eab8234869f6db151c682/broadcast/DeployAll.s.sol/4663/run-latest.json) | served |
63
63
  | stock-token-market | unnamed stock-token market with one reserve holder | stock-token market, stock token market | vault | swapped-custody | manager | `0x2f4579ca81717d3d61bf8b6f06571877bbe54a07` | 461784 | - | - | [devops registry v29](https://github.com/chainswarm/devops/blob/e270ee1a3c8a2afc52e9d5549be5dbb8b98f0914/charts/chainswarm-indexer-evm-dex/registry/robinhood-v29.json) | served |
64
+ | tessera | Tessera | Tessera, Tessera market maker | vault | tessera-custody | manager | `0x907d1d174569b11624bdcefd20dcef27600237f8` | 0 | - | - | [Van Helsing robinhood chain constants](https://github.com/nexroute/van-helsing/blob/f228f9958f198fb55a67d6c3da50cf37c6a74fec/chains/robinhood/Chain.sol) | served |
65
+ | tessera | Tessera | | vault | tessera-custody | helper | `0x55555522005bcae1c2424d474bfd5ed477749e3e` | 0 | - | - | [DefiLlama tessera adapter](https://github.com/DefiLlama/dimension-adapters/blob/974276ba6e9fa4fa00962aed41bf30e702a85560/dexs/tessera/index.ts) | served |
66
+ | woofi | WOOFi | WOOFi, WooFi, WOOFi Swap, WooPP | vault | woo-custody | manager | `0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4` | 0 | - | - | [WOOFi integration guide](https://github.com/woonetwork/docs/blob/9bcc162d55d2f53e2e110cd552a2286ba03248a3/guides/integrate-woofi-as-liquidity-source.md) | served |
67
+ | woofi | WOOFi | | vault | woo-custody | helper | `0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7` | 0 | - | - | [WOOFi integration guide](https://github.com/woonetwork/docs/blob/9bcc162d55d2f53e2e110cd552a2286ba03248a3/guides/integrate-woofi-as-liquidity-source.md) | served |
68
+ | quoted-stock-market | unnamed quoted stock-token market | quoted stock-token market, quoted stock market | vault | quoted-custody | manager | `0x9d9806fe54de0dca35eb6839374d2222aca3c967` | 100062876 | - | - | [deployment transaction](https://robin.etherscan.io/tx/0xa4062dc9a318af215fa385f2ea523a320724b00618076c195b8f451387367830) | served |
64
69
  | ramses | Ramses | Ramses, Ramses Exchange, RAM, ramses.xyz, Ramses DLMM | plain | trader-joe-lb | factory | `0xdcd5f77697914e27f56fd263ef82923c8524abac` | 0 | 0x06ffaa507a9c3e7025294a642f1e1c75da3dfb4a | 150 | [Ramses contract addresses](https://www.ramses.xyz/docs/contract-addresses) | served |
65
70
  | ramses | Ramses | | plain | uniswap-v2 | factory | `0x43b2bf9f33036a02fc7a00935571c2a6b0108e66` | 0 | - | - | [Ramses contract addresses](https://www.ramses.xyz/docs/contract-addresses) | served |
66
71
  | ramses | Ramses | | plain | trader-joe-lb | router | `0xd0019e86edb35e1fedaab03aed5c3c60f115d28b` | 0 | - | - | [Ramses contract addresses](https://www.ramses.xyz/docs/contract-addresses) | served |
@@ -142,6 +147,11 @@ proven from those rows.
142
147
  | `0x4ed0f046d97d508df86d6b7b058e763dbfb0027f` | manager | one router holds every curve, each keyed by the launched token: 13 `mob-launch-curve` pools on lane B on 2026-11-02, from block 99,903,488 to 100,025,977, and 780 swap rows since 2026-10-28. The first, `0x331d64719b7a01f59ef03311e4f0c10f00b7271d1cef0dcdeb6321ae480efcd7` at block 99,903,517, is a buy the router refunded in part. Created at block 99,884,296 by `0x9cd48fc444f80e6c79d90c4bcb9d045603747390`; no source is verified and no project names it. The token Mob is a launch, never the launchpad's name |
143
148
  | `0x2f4579ca81717d3d61bf8b6f06571877bbe54a07` | manager | the one reserve holder of 105 market contracts that log `Swapped` and move no token themselves; the indexer names the first, `0x95e4a408590e5ace8aab498ab0f9f4236f5162e5` (the AMD market), and 104 more, all created by `0x8dbf0d37cad30b2510d5c74e0f87a210cb298086`. The holder takes the sold token and pays the bought one in every trade. Read on lane B's StarRocks on 2026-11-02: 52 `swapped-custody` pairs from block 461,784, each a pool of the holder keyed by its two tokens, and 225,885 swap rows from 2026-10-26 to 2026-11-02. On 2026-11-01 its trades were stock tokens (SNDK, SKHY, MU, MSTR, AMD, SPCX, USO, RDDT, DJT) against USDG, and some WETH and ETH; the first that day, `0x4e625db12c0affff1ab5634d587da84a0da4c474ab110d174b6c0cd6cd64887c` at block 102,958,054. Created at block 223,587 by `0xb97c121f7bf12bc21ed22b9739f3695bd2ab23a8`; no source is verified and no project names it. The market contracts have no row: each is one token's door, not a pool and not a router |
144
149
  | `0x7a39b98d31f84152bc724bc5ddb41dbcb338f2a5` | router | read on the production graph through the Chain Insights proxy on 2026-11-05 by scout-agent (finding 164): a contract with no label, created at block 105,000,018 (2026-11-03) by `0xf90e3e4f5b23b2ba5a53e7c72ccac139e0ff1c1b` in `0x3561086bf317b231da030bff5367f6213afdeb01724f990c1d4dc2bbed06d982`, below the DEX head 106,440,927. About 500 wallets call it directly with ETH and USDG `0x5fc5360d0400a0fd4f2af552add042d716f1d168`: 500 senders, 495 receivers, 19,962 transactions in and 21,858 out. It wraps and unwraps WETH `0x0bd7d308f8e1639fab988df18a8011f41eacad73` and swaps in the Uniswap v3 WETH/USDG pool `0x52e65b17fb6e5ba00ed806f37afcd2daa50271ca` (7,041 transactions) and, for some trades, the Uniswap v4 PoolManager `0x8366a39cc670b4001a1121b8f6a443a643e40951`. Its `SWAPPED` links reach its callers through the pool, so the caller stays the trader. Sample call `0x4e675f9318bfced710a7c2072662701beb4662a6b61fcf57a608ac84fdbeae18` (block 106,301,475) from `0x7b6830c4f01d976d9a344febdf3588d99a23dfd0`, ETH value, 12 logs. No source is verified and no project names it |
150
+ | `0x907d1d174569b11624bdcefd20dcef27600237f8` | manager | Tessera's vault. Read from the production node on 2026-11-06 for indexer-evm-dex (golden set `tessera-custody`): a sample of 2,000 of the 577,500 `TesseraTrade` logs below block 91,000,000, 2,000 of 2,000 take the sold token into this contract and pay the bought one out of it to the log's recipient. It logs nothing itself; the router below logs each trade. Van Helsing's robinhood constants name it `TESSERA_TREASURY`, the treasury Tessera pays out of. Sample buy `0x8a66a468afcad071da90fb8a25e60815fae87e6f20e28c23266b8f50c1d67e54` (block 106,015,302): wallet `0xaa0ea5019ecc8f1b1a4de7e15b0a36edec01ea18` pays it USDG and it pays the wallet SPCX. Indexer registry version 31 and later read it as adapter `tessera-custody` on lane A and lane B |
151
+ | `0x55555522005bcae1c2424d474bfd5ed477749e3e` | helper | Tessera's router: it logs one `TesseraTrade` per trade and moves no token; the vault above is the contract past the swap. DefiLlama's Tessera adapter reads the same address and event on Robinhood Chain from 2026-09-10, as on Base and BNB Chain |
152
+ | `0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4` | manager | `WooPPV2`, WOOFi's market, at the address WOOFi's integration guide gives for Robinhood. Read from the production node on 2026-11-07 for indexer-evm-dex (golden set `woo-custody`): all 3,608 `WooSwap` logs to block 108,109,678 take the sold token into this contract and pay the bought one from it, so it holds its own reserves. Indexer registry version 33 and later read it as adapter `woo-custody` on lane A and lane B |
153
+ | `0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7` | helper | `WooRouterV2`, WOOFi's router, at the address WOOFi's integration guide gives for Robinhood. In `0x65d9e6abfd598c197ec10755fc24f8be6ec106482c7437cee5d9582fd4546d0c` (block 49,013,651) wallet `0x5c5aa6b8db076757bad008c7aeccf87e5c66a7a3` pays it native ETH, it wraps the ETH and pays WooPP, and WooPP pays the wallet USDG: WooPP is the contract past the swap |
154
+ | `0x9d9806fe54de0dca35eb6839374d2222aca3c967` | manager | read from the production node on 2026-11-06: created at block 100,062,876 by `0x2808ec057018d458ad4b34cc005da85ca06a7b66`. It holds the stock tokens and the USDG `0x5fc5360d0400a0fd4f2af552add042d716f1d168` and moves both legs of every trade. A settlement contract of the same deployer, `0xe94579b5e4a5342b2e677d0a34f1211c54628d09`, checks a signed quote and logs one `Fill` per trade; for indexer-evm-dex (golden set `quoted-custody`) the legs of every `Fill` over blocks 100,000,000 to 107,377,805 were proven, 2,147 of 2,147, the first at block 104,202,505. Sample trade `0x9571c237fb7cc13d3fffe9fabefe606f188dbf86e849c048b01be902a97be68b`: the trader sends NVDA to it and takes USDG back in one transaction. No source is verified and no project names it, so it is served under a plain description. It is a different design from `stock-token-market`: another deployer, other events. Indexer registry version 30 and later read it as adapter `quoted-custody` on lane A and lane B |
145
155
 
146
156
  `0x0d1ebb179cdbca88d74c923c4255cb2b17474afd` created 254,650 `uniswap-v2`
147
157
  pairs with 38 USD of volume in all: the Flap launchpad's pair factory per
@@ -231,3 +241,24 @@ Each new key that has no factory of its own names the factory or manager it
231
241
  swaps through, valid from its own first block, as `eth-usdg-router` does. A
232
242
  lookup of that factory or manager still answers Uniswap, the first exchange
233
243
  that names it.
244
+
245
+ Registry version 9 (2026-11-19) serves three desks that trade from their own
246
+ reserves. The DEX indexer reads the quoted market from its registry version
247
+ 30, Tessera from version 31 and WOOFi from version 33; version 34 runs on
248
+ lane A and lane B:
249
+
250
+ - Tessera (`tessera-custody`): its vault
251
+ `0x907d1d174569b11624bdcefd20dcef27600237f8` is the manager, its router
252
+ `0x55555522005bcae1c2424d474bfd5ed477749e3e` a helper.
253
+ - WOOFi (`woo-custody`): `WooPPV2`
254
+ `0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4` is the manager, `WooRouterV2`
255
+ `0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7` a helper.
256
+ - the unnamed quoted stock-token market (`quoted-custody`): its market
257
+ contract `0x9d9806fe54de0dca35eb6839374d2222aca3c967` is the manager. No
258
+ source names its operator, so it is served under a plain description, as
259
+ `stock-token-market` is. Its settlement contract logs the trades and has
260
+ no row, as the market contracts of `stock-token-market` have none.
261
+
262
+ None logs a pool creation: each pair of tokens is a pool of the manager,
263
+ written at its first trade. So no row of the three carries an example pool or a pool
264
+ floor, like every vault row.
@@ -565,7 +565,7 @@ A `TRANSFERRED` search over the whole chain, with no address anchor, must name o
565
565
 
566
566
  An `asset` that names no token of the graph, or a symbol such as `USDC`, is refused with `anchor_missing` whose fix names the contract: the graph holds no token at that address. That refusal is not a family behind and not a missing anchor: do not ask for an address. Check the contract, all 42 characters in lowercase, and send the same query again with the right one.
567
567
 
568
- A token named by its ticker or its name, with no contract (TCITY, USDG): call `meta_token_lookup {network, symbol}` first, before any read. It returns every contract on the network that carries that symbol, verified first, then oldest first, each with its creator. Tickers collide: a clone copies a symbol on purpose, so never treat the first row as the token. When several come back, name each contract in full with its creator and first seen time, and ask which one the user means, or pick one by the evidence the user gave and say why. Zero candidates is an answer: say no contract on the network carries the symbol, and do not search the web. Then read the chosen contract as the `asset` of the reads above.
568
+ A token named by its ticker or its name, with no contract (TCITY, USDG): call `meta_token_lookup {network, symbol}` first, before any read. It returns the contracts on the network that carry that symbol, verified first, then oldest first, each with its creator, and `matches`, the count of all of them. When more match than the 25 listed, `newest` holds the newest ones, and `first_seen_after_verified` counts the contracts first seen after the one verified contract: each of those copied its symbol. A copied name alone is not proof of a scam. The lists are a part: give `matches` as the count, never the number of rows, and never say none exist beyond a list. Tickers collide: a clone copies a symbol on purpose, so never treat the first row as the token. When several come back, name each contract in full with its creator and first seen time, and ask which one the user means, or pick one by the evidence the user gave and say why. Zero candidates is an answer: say no contract on the network carries the symbol, and do not search the web. Then read the chosen contract as the `asset` of the reads above.
569
569
 
570
570
  How to answer from these rows:
571
571
 
@@ -85,7 +85,7 @@ hand. When the tool and the memo differ, follow the tool: it reads the
85
85
  newest file.
86
86
 
87
87
  <!-- dex-registry:start -->
88
- Memo of the exchange registry, version 8, robinhood, recorded 2026-11-06.
88
+ Memo of the exchange registry, version 9, robinhood, recorded 2026-11-19.
89
89
 
90
90
  | Exchange | Key | Also written | Trail | Factories, or the manager | Router |
91
91
  |---|---|---|---|---|---|
@@ -111,6 +111,9 @@ Memo of the exchange registry, version 8, robinhood, recorded 2026-11-06.
111
111
  | unnamed Balancer v3 vault | `balancer-v3` | Balancer, Balancer v3, Balancer v3 vault | vault | manager `0x28082618ba2073e602230188e4f4c46e9b2169eb` | the manager |
112
112
  | Ekubo | `ekubo` | Ekubo, Ekubo Protocol, ekubo.org | vault | manager `0x00000000000014aa86c5d3c41765bb24e11bd701` | the manager |
113
113
  | unnamed stock-token market with one reserve holder | `stock-token-market` | stock-token market, stock token market | vault | manager `0x2f4579ca81717d3d61bf8b6f06571877bbe54a07` | the manager |
114
+ | Tessera | `tessera` | Tessera, Tessera market maker | vault | manager `0x907d1d174569b11624bdcefd20dcef27600237f8` | the manager |
115
+ | WOOFi | `woofi` | WOOFi, WooFi, WOOFi Swap, WooPP | vault | manager `0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4` | the manager |
116
+ | unnamed quoted stock-token market | `quoted-stock-market` | quoted stock-token market, quoted stock market | vault | manager `0x9d9806fe54de0dca35eb6839374d2222aca3c967` | the manager |
114
117
  | Ramses | `ramses` | Ramses, Ramses Exchange, RAM, ramses.xyz, Ramses DLMM | plain | `0xdcd5f77697914e27f56fd263ef82923c8524abac`, `0x43b2bf9f33036a02fc7a00935571c2a6b0108e66` | `0xd0019e86edb35e1fedaab03aed5c3c60f115d28b` |
115
118
  | SectorOne | `sectorone` | SectorOne, SectorOne DLMM | plain | `0x3d8dc63ddc9b992cfde89f7aea6f18717e84687d` | none |
116
119
  | Hoodit | `hoodit` | Hoodit, hoodit.xyz | plain | `0x22602d966defd638ee94e97a92e2eb0934c3fe1b` | none |
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: chain-insights-dex-vault
3
3
  door: meta_dex_lookup
4
- description: Use for the dex-vault trail - exchanges where one pool manager contract holds every pool, such as Uniswap v4, Balancer v2, Balancer v3, PancakeSwap Infinity, Ekubo and the unnamed stock-token market with one reserve holder on robinhood - when a seller's swap names the pool manager or vault, when a question asks who bought past the manager, or which pools such an exchange has. Loaded by chain-insights-dex for a vault row of its memo.
4
+ description: Use for the dex-vault trail - exchanges where one pool manager contract holds every pool, such as Uniswap v4, Balancer v2, Balancer v3, PancakeSwap Infinity, Ekubo, the market makers Tessera and WOOFi, the unnamed stock-token market with one reserve holder and the unnamed quoted stock-token market on robinhood - when a seller's swap names the pool manager or vault, when a question asks who bought past the manager, or which pools such an exchange has. Loaded by chain-insights-dex for a vault row of its memo.
5
5
  ---
6
6
 
7
- # Chain Insights: the vault trail (Uniswap v4, Balancer, PancakeSwap Infinity, Ekubo)
7
+ # Chain Insights: the vault trail (Uniswap v4, Balancer, PancakeSwap Infinity, Ekubo, Tessera, WOOFi)
8
8
 
9
9
  Load `chain-insights-cypher` first, then `chain-insights-dex`: the
10
10
  exchange's manager comes from `meta_dex_lookup`, or from the memo there when
@@ -34,14 +34,30 @@ buyer.** Name it for what it is, in full: "the Uniswap v4 pool manager
34
34
  | PancakeSwap Infinity | `0xd01c774d4a66408326bc65728ac5ae5aaf004032` |
35
35
  | Ekubo | `0x00000000000014aa86c5d3c41765bb24e11bd701` |
36
36
  | unnamed stock-token market | `0x2f4579ca81717d3d61bf8b6f06571877bbe54a07`, the reserve holder |
37
+ | Tessera | `0x907d1d174569b11624bdcefd20dcef27600237f8`, the vault |
38
+ | WOOFi | `0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4`, WooPP |
39
+ | unnamed quoted stock-token market | `0x9d9806fe54de0dca35eb6839374d2222aca3c967`, the market contract |
37
40
 
38
- Call the last one "an unnamed stock-token market with one reserve holder".
41
+ Call the stock-token market "an unnamed stock-token market with one reserve holder".
39
42
  No source names it: never give it a name you have not read. Its trades are
40
43
  logged by 105 small market contracts, one per stock token, that move no
41
44
  token themselves. The holder takes the sold token and pays the bought one,
42
45
  so the holder is the manager of every swap, and each pair of tokens is one
43
46
  of its pools.
44
47
 
48
+ Tessera and WOOFi are market makers that trade from their own reserves, the
49
+ same shape. Tessera's router logs each trade and moves no token; its vault
50
+ takes the sold token and pays the bought one. WOOFi's WooPP logs and pays
51
+ itself; its router only passes the seller's tokens on. `meta_dex_lookup`
52
+ gives both routers as helpers. Neither router is ever the buyer, and each
53
+ pair of tokens is one pool of the manager.
54
+
55
+ Call the quoted market "an unnamed quoted stock-token market". No source
56
+ names it either. A settlement contract checks a signed quote and logs each
57
+ trade; the market contract holds the stock tokens and the USDG and pays both
58
+ legs, so it is the manager. It is not the stock-token market with one
59
+ reserve holder: another deployer, other events.
60
+
45
61
  ## On a lane with the levels
46
62
 
47
63
  Money is read on three levels: level 2 (`FLOWED_TO`, `ROUTED_TO`) traces money, one link per pair of addresses in USD, level 1 (`TRANSFERRED`, `SWAPPED`, `ADDED_LIQUIDITY`, `REMOVED_LIQUIDITY`) holds the assets and the pools, and a single transaction is a `USE facts` row.
@@ -69,7 +69,7 @@ agent is created on Uniswap's own v2 factory
69
69
  most of that factory's pairs are Virtuals agents.
70
70
 
71
71
  <!-- dex-registry:start -->
72
- The factories of the exchange registry, version 8, row `virtuals`:
72
+ The factories of the exchange registry, version 9, row `virtuals`:
73
73
 
74
74
  | Factory | Address |
75
75
  |---|---|
@@ -1 +0,0 @@
1
- {"version":3,"file":"token-lookup-QpIv77P2.mjs","names":[],"sources":["../src/mcp/token-lookup.ts"],"sourcesContent":["/**\n * meta_token_lookup: a ticker or a token name becomes its contracts.\n *\n * A local tool of the proxy. It sends one anchored facts read of the Asset\n * lookup by symbol, the same read by name when the symbol answers nothing, and\n * then the creator and the factory of each candidate from topology, one batch\n * member per candidate. Nothing is matched here: the graph server matches the\n * symbol or the name, case-insensitively and exactly, and orders the rows\n * verified first, then oldest first. The proxy keeps that order.\n *\n * Tickers collide on purpose: clones reuse a symbol to borrow its trust. The\n * tool never picks one. The description below is the contract with every\n * host, Claude Desktop chat included, which reads no skill.\n */\n\nimport { ANSWER_HINT } from './answer-hint.js'\nimport { DexRegistryError, normalizeDexNetwork } from './dex-registry.js'\nimport { isEpochMs, utcText } from './timestamp-text.js'\n\nexport const META_TOKEN_LOOKUP_TOOL = 'meta_token_lookup'\nexport const META_TOKEN_LOOKUP_SCHEMA = 'chain-insights.meta-token-lookup.v1' as const\nexport const META_TOKEN_LOOKUP_TITLE = 'Token by ticker or name'\nexport const META_TOKEN_LOOKUP_DESCRIPTION =\n 'Call this first when a question names a token by its ticker or name and gives no contract ' +\n '(TCITY, USDG, SPCX). It returns every contract on the network that carries that symbol, ' +\n 'verified first, then oldest first. Tickers collide: never treat the first row as the token. ' +\n 'When several match, name them and ask, or pick by the evidence the user gave. Zero candidates ' +\n 'means no contract carries the symbol: say so, and do not search the web.'\nexport const META_TOKEN_LOOKUP_ANNOTATIONS = {\n readOnlyHint: true,\n idempotentHint: true,\n openWorldHint: false,\n} as const\nexport const META_TOKEN_LOOKUP_ARGS = ['network', 'symbol'] as const\n\n/** The candidates returned. The read asks for one more, so a full page says there are more. */\nexport const CANDIDATES_MAX = 25\nexport const ROWS_READ = CANDIDATES_MAX + 1\n/** The graph server admits at most 20 members in one graph_query_batch. */\nexport const CREATOR_BATCH_MAX = 20\nexport const SYMBOL_MAX = 64\n\nexport const ADDRESS_INPUT_HINT = 'an address is already an anchor: read it on USE topology'\n\nexport interface TokenCandidate {\n contract: string\n symbol: string | null\n name: string | null\n token_standard: string | null\n decimals: number | null\n verified: boolean\n verification_source: string | null\n first_seen_timestamp: number | null\n first_seen_timestamp_utc: string | null\n creator: string | null\n factory: string | null\n}\n\nexport interface MetaTokenLookupResult {\n schema: typeof META_TOKEN_LOOKUP_SCHEMA\n network: string\n query: string\n matched_on: 'symbol' | 'name' | null\n candidates: TokenCandidate[]\n /** The rows the server sent, at most 26: 26 means there are more than the 25 returned. */\n total: number\n truncated: boolean\n hint: string\n}\n\n/** One graph_query or graph_query_batch reply as the remote client returns it. */\nexport type GraphAnswer = {\n content?: unknown[]\n structuredContent?: unknown\n isError?: boolean\n}\n\nexport interface TokenToolDependencies {\n /** One graph_query through the proxy's remote client, billed as any read. */\n graphQuery: (args: { network: string; query: string }) => Promise<GraphAnswer>\n /** One graph_query_batch through the proxy's remote client, billed as any read. */\n graphQueryBatch: (args: {\n network: string\n queries: Array<{ id: string; query: string }>\n }) => Promise<GraphAnswer>\n /** The reason no read can be sent now, or undefined when the graph is reachable. */\n unavailable?: () => Promise<string | undefined> | string | undefined\n /** The text of a call that threw: payment required, transport. */\n describeFailure: (err: unknown) => string\n}\n\nexport type MetaTokenLookupToolResult = {\n content: Array<{ type: 'text'; text: string }>\n structuredContent?: Record<string, unknown>\n isError: boolean\n}\n\nconst ADDRESS_FORM = /^0x[0-9a-fA-F]{40}$/\nconst CONTRACT_FORM = /^0x[0-9a-f]{40}$/\n// A string literal of the read holds no double quote, no backslash and no\n// control character: the symbol is refused rather than escaped, so the read the\n// server receives is always the read written here.\nfunction unsafeLiteral(text: string): boolean {\n for (const char of text) {\n const code = char.codePointAt(0)!\n if (char === '\"' || char === '\\\\' || code < 0x20 || code === 0x7f) return true\n }\n return false\n}\nconst CODE_PREFIX = /^([a-z][a-z0-9_]*):\\s*/\n// Codes of a read that was stopped, not refused: the same read may answer later.\nconst TRANSIENT_CODE =\n /(timeout|memory_limit|cpu_limit|busy|_failed$|rate_limited|unavailable|too_large|node_error)/\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value)\n}\n\nfunction errorResult(text: string): MetaTokenLookupToolResult {\n return { content: [{ type: 'text', text }], isError: true }\n}\n\nfunction textResult(structured: MetaTokenLookupResult): MetaTokenLookupToolResult {\n return {\n content: [{ type: 'text', text: JSON.stringify(structured, null, 2) }],\n structuredContent: structured as unknown as Record<string, unknown>,\n isError: false,\n }\n}\n\n/** The facts Asset read by symbol or by name, in the one shape the graph server admits. */\nexport function assetQuery(key: 'symbol' | 'name', value: string): string {\n return (\n `USE facts MATCH (t:Asset {${key}: \"${value}\"}) ` +\n 'RETURN t.asset_contract AS contract, t.asset_symbol AS symbol, t.name AS name, ' +\n 't.token_standard AS token_standard, t.decimals AS decimals, t.verified AS verified, ' +\n 't.verification_source AS verification_source, t.first_seen_timestamp AS first_seen_timestamp ' +\n `LIMIT ${ROWS_READ}`\n )\n}\n\n/** The topology read of who deployed one contract: the deploying address and the transaction's sender. */\nexport function creatorQuery(contract: string): string {\n return (\n `USE topology MATCH (f:Address)-[d:DEPLOYED_CONTRACT]->(t:Address {address: \"${contract}\"}) ` +\n 'RETURN f.address AS factory, d.tx_origin AS creator LIMIT 1'\n )\n}\n\nconst textOrNull = (value: unknown): string | null =>\n typeof value === 'string' && value.trim() !== '' ? value : null\n\nconst numberOrNull = (value: unknown): number | null => {\n if (typeof value === 'number' && Number.isFinite(value)) return value\n if (typeof value === 'string' && value.trim() !== '' && Number.isFinite(Number(value)))\n return Number(value)\n return null\n}\n\nconst addressOrNull = (value: unknown): string | null =>\n typeof value === 'string' && ADDRESS_FORM.test(value.trim()) ? value.trim().toLowerCase() : null\n\nfunction verifiedOf(value: unknown): boolean {\n if (typeof value === 'boolean') return value\n if (typeof value === 'number') return value === 1\n if (typeof value === 'string') return ['true', '1'].includes(value.trim().toLowerCase())\n return false\n}\n\nfunction answerText(answer: GraphAnswer): string {\n return (Array.isArray(answer.content) ? answer.content : [])\n .map((block) => (isRecord(block) && typeof block.text === 'string' ? block.text : ''))\n .filter(Boolean)\n .join('\\n')\n .trim()\n}\n\nexport type Refusal = { code: string; text: string; transient: boolean }\n\n/** A graph_query answer that did not answer: its code, its text, and whether the same read may answer later. */\nexport function refusalOf(answer: GraphAnswer): Refusal {\n const text = answerText(answer)\n const detail = isRecord(answer.structuredContent)\n ? answer.structuredContent.error_detail\n : undefined\n const detailCode = isRecord(detail) && typeof detail.code === 'string' ? detail.code : ''\n const detailClass = isRecord(detail) && typeof detail.class === 'string' ? detail.class : ''\n const named = detailCode || CODE_PREFIX.exec(text)?.[1] || ''\n // A refusal that names no class is a stop only when its code says so; a\n // refusal in plain words (\"unknown label Asset\") is a server that lacks the read.\n const transient = detailClass ? detailClass !== 'refused' : TRANSIENT_CODE.test(named)\n const code = named || 'not_served'\n return { code, text: text || `${code}: the graph endpoint refused the read`, transient }\n}\n\n/** The result rows of a graph_query answer, or null when it holds none. */\nfunction rowsOf(answer: GraphAnswer): Array<Record<string, unknown>> | null {\n const facts = isRecord(answer.structuredContent) ? answer.structuredContent.facts : undefined\n const query = isRecord(facts) ? facts.query : undefined\n const results = isRecord(query) ? query.results : undefined\n return Array.isArray(results) ? results.filter(isRecord) : null\n}\n\nexport type Member = { id?: unknown; ok?: unknown; results?: unknown; error?: unknown }\n\n/** The members of a graph_query_batch answer by id. */\nexport function membersOf(answer: GraphAnswer): Map<string, Member> {\n const facts = isRecord(answer.structuredContent) ? answer.structuredContent.facts : undefined\n const queries = isRecord(facts) ? facts.queries : undefined\n const members = new Map<string, Member>()\n if (Array.isArray(queries)) {\n for (const member of queries)\n if (isRecord(member) && typeof member.id === 'string') members.set(member.id, member)\n }\n return members\n}\n\nfunction candidateOf(row: Record<string, unknown>): TokenCandidate | null {\n const contract = textOrNull(row.contract)?.trim().toLowerCase()\n if (!contract) return null\n const firstSeen = numberOrNull(row.first_seen_timestamp)\n return {\n contract,\n symbol: textOrNull(row.symbol),\n name: textOrNull(row.name),\n token_standard: textOrNull(row.token_standard),\n decimals: numberOrNull(row.decimals),\n verified: verifiedOf(row.verified),\n verification_source: textOrNull(row.verification_source),\n first_seen_timestamp: firstSeen,\n first_seen_timestamp_utc: isEpochMs(firstSeen) ? utcText(firstSeen) : null,\n creator: null,\n factory: null,\n }\n}\n\ntype Read =\n | { kind: 'rows'; rows: Array<Record<string, unknown>> }\n | { kind: 'not_served'; refusal: Refusal }\n | { kind: 'failed'; text: string }\n\nasync function readAssets(\n deps: TokenToolDependencies,\n network: string,\n key: 'symbol' | 'name',\n value: string\n): Promise<Read> {\n let answer: GraphAnswer\n try {\n answer = await deps.graphQuery({ network, query: assetQuery(key, value) })\n } catch (err) {\n return { kind: 'failed', text: deps.describeFailure(err) }\n }\n const rows = rowsOf(answer)\n if (answer.isError !== true && rows !== null) return { kind: 'rows', rows }\n const refusal = refusalOf(answer)\n if (answer.isError === true && refusal.transient) return { kind: 'failed', text: refusal.text }\n return { kind: 'not_served', refusal }\n}\n\n/**\n * The creator and the factory of each candidate, written in place. Returns why\n * some creators were not read, or null when every read answered. A read that\n * answered with no row leaves the candidate's creator empty with no note: the\n * graph holds no deployment for it.\n */\nasync function readCreators(\n deps: TokenToolDependencies,\n network: string,\n candidates: TokenCandidate[]\n): Promise<string | null> {\n const contracts = [\n ...new Set(candidates.map((c) => c.contract).filter((c) => CONTRACT_FORM.test(c))),\n ]\n const found = new Map<string, { creator: string | null; factory: string | null }>()\n const reasons: string[] = []\n let unread = candidates.length - candidates.filter((c) => CONTRACT_FORM.test(c.contract)).length\n for (let at = 0; at < contracts.length; at += CREATOR_BATCH_MAX) {\n const chunk = contracts.slice(at, at + CREATOR_BATCH_MAX)\n const queries = chunk.map((contract) => ({\n id: `creator:${contract}`,\n query: creatorQuery(contract),\n }))\n let members = new Map<string, Member>()\n try {\n const answer = await deps.graphQueryBatch({ network, queries })\n members = membersOf(answer)\n if (members.size === 0) {\n reasons.push(\n answer.isError === true ? refusalOf(answer).text : 'the batch answer held no reads'\n )\n }\n } catch (err) {\n reasons.push(deps.describeFailure(err))\n }\n for (const contract of chunk) {\n const member = members.get(`creator:${contract}`)\n if (member?.ok === true && Array.isArray(member.results)) {\n const row = member.results.find(isRecord)\n found.set(contract, {\n creator: row ? addressOrNull(row.creator) : null,\n factory: row ? addressOrNull(row.factory) : null,\n })\n continue\n }\n unread += 1\n if (member && typeof member.error === 'string' && !reasons.includes(member.error))\n reasons.push(member.error)\n }\n }\n for (const candidate of candidates) {\n const read = found.get(candidate.contract)\n if (read) Object.assign(candidate, read)\n }\n if (unread === 0) return null\n return `${unread} of ${candidates.length}${reasons.length > 0 ? `: ${reasons.join('; ')}` : ''}`\n}\n\nconst NO_WEB =\n 'Do not search the web and do not guess a contract: a web page is not a contract on this network.'\n\nfunction hintFor(\n result: Omit<MetaTokenLookupResult, 'hint'>,\n creatorsNotRead: string | null\n): string {\n const { network, query, candidates, matched_on, truncated } = result\n const parts: string[] = [ANSWER_HINT]\n if (candidates.length === 0) {\n parts.push(\n `No contract on ${network} carries the symbol or the name \"${query}\". Say so in one line. ${NO_WEB} ` +\n 'Ask the user for the contract if they have one.'\n )\n return parts.join(' ')\n }\n if (matched_on === 'name') {\n parts.push(`No contract carries \"${query}\" as its symbol; these carry it as their name.`)\n }\n if (candidates.length === 1) {\n parts.push(\n `One contract on ${network} carries \"${query}\": ${candidates[0]!.contract}. ` +\n 'Say it is the only one on this network, then read it by this full contract on USE topology.'\n )\n } else {\n parts.push(\n `${candidates.length} contracts on ${network} carry \"${query}\"` +\n `${truncated ? `, and more exist than the ${CANDIDATES_MAX} listed` : ''}. ` +\n 'Tickers collide: never treat the first row as the token. Name them, each contract in full, ' +\n 'with its creator and first seen time, and ask which one the user means, or pick one by the evidence the user gave ' +\n '(a creator, a launch date, a price move) and say why.'\n )\n }\n if (creatorsNotRead) {\n parts.push(\n `The creators were not read for ${creatorsNotRead}. creator and factory are empty there because the read failed, ` +\n 'not because the chain holds none.'\n )\n }\n parts.push('Write every contract and creator in full, 0x plus 40 hex characters.')\n return parts.join(' ')\n}\n\n/** meta_token_lookup, {network, symbol}. Every argument is checked before a read is sent. */\nexport async function handleMetaTokenLookup(\n args: unknown,\n deps: TokenToolDependencies\n): Promise<MetaTokenLookupToolResult> {\n const record = isRecord(args) ? args : {}\n let network: string\n try {\n network = normalizeDexNetwork(record.network)\n } catch (err) {\n return errorResult(\n err instanceof DexRegistryError ? err.message : `invalid_network: ${(err as Error).message}`\n )\n }\n if (typeof record.symbol !== 'string' || record.symbol.trim() === '') {\n return errorResult(\n 'invalid_symbol: symbol is required: the ticker or the name as the user wrote it, for example TCITY'\n )\n }\n const symbol = record.symbol.trim()\n if (symbol.length > SYMBOL_MAX) {\n return errorResult(`invalid_symbol: symbol holds at most ${SYMBOL_MAX} characters`)\n }\n const base = {\n schema: META_TOKEN_LOOKUP_SCHEMA,\n network,\n query: symbol,\n }\n\n if (ADDRESS_FORM.test(symbol)) {\n const address = symbol.toLowerCase()\n return textResult({\n ...base,\n matched_on: null,\n candidates: [],\n total: 0,\n truncated: false,\n hint: `${ANSWER_HINT} ${address} is a contract address, not a ticker: ${ADDRESS_INPUT_HINT}. Send no token lookup for it.`,\n })\n }\n if (unsafeLiteral(symbol)) {\n return errorResult(\n 'invalid_symbol: a symbol holds no double quote, backslash or control character. Send the ticker or the name as plain text.'\n )\n }\n\n const unavailable = await deps.unavailable?.()\n if (unavailable) {\n return errorResult(\n `No token read was sent: ${unavailable} The lookup has no answer yet, which is not \"no contract\": try again later, or ask the user for the contract. ${NO_WEB}`\n )\n }\n\n let matchedOn: 'symbol' | 'name' = 'symbol'\n let read = await readAssets(deps, network, 'symbol', symbol)\n if (read.kind === 'rows' && read.rows.length === 0) {\n matchedOn = 'name'\n read = await readAssets(deps, network, 'name', symbol)\n }\n if (read.kind === 'failed') {\n return errorResult(\n `The token read failed: ${read.text} This is not \"no contract\": send the same lookup again once, or ask the user for the contract. ${NO_WEB}`\n )\n }\n if (read.kind === 'not_served') {\n return textResult({\n ...base,\n matched_on: null,\n candidates: [],\n total: 0,\n truncated: false,\n hint:\n `${ANSWER_HINT} This lookup gave no answer (${read.refusal.code}). ` +\n `That is not \"no contract carries ${symbol}\": ask the user for the token's contract, 0x plus 40 hex characters. ${NO_WEB}`,\n })\n }\n\n const total = read.rows.length\n const candidates = read.rows\n .slice(0, CANDIDATES_MAX)\n .map(candidateOf)\n .filter((candidate): candidate is TokenCandidate => candidate !== null)\n const creatorsNotRead =\n candidates.length > 0 ? await readCreators(deps, network, candidates) : null\n const result = {\n ...base,\n matched_on: candidates.length > 0 ? matchedOn : null,\n candidates,\n total,\n truncated: total > CANDIDATES_MAX,\n }\n return textResult({ ...result, hint: hintFor(result, creatorsNotRead) })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAa,yBAAyB;AACtC,MAAa,2BAA2B;AACxC,MAAa,0BAA0B;AACvC,MAAa,gCACX;AAKF,MAAa,gCAAgC;CAC3C,cAAc;CACd,gBAAgB;CAChB,eAAe;AACjB;;AAIA,MAAa,iBAAiB;AAC9B,MAAa,YAAY;;AAEzB,MAAa,oBAAoB;AACjC,MAAa,aAAa;AAE1B,MAAa,qBAAqB;AAuDlC,MAAM,eAAe;AACrB,MAAM,gBAAgB;AAItB,SAAS,cAAc,MAAuB;CAC5C,KAAK,MAAM,QAAQ,MAAM;EACvB,MAAM,OAAO,KAAK,YAAY,CAAC;EAC/B,IAAI,SAAS,QAAO,SAAS,QAAQ,OAAO,MAAQ,SAAS,KAAM,OAAO;CAC5E;CACA,OAAO;AACT;AACA,MAAM,cAAc;AAEpB,MAAM,iBACJ;AAEF,SAAS,SAAS,OAAkD;CAClE,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AACrE;AAEA,SAAS,YAAY,MAAyC;CAC5D,OAAO;EAAE,SAAS,CAAC;GAAE,MAAM;GAAQ;EAAK,CAAC;EAAG,SAAS;CAAK;AAC5D;AAEA,SAAS,WAAW,YAA8D;CAChF,OAAO;EACL,SAAS,CAAC;GAAE,MAAM;GAAQ,MAAM,KAAK,UAAU,YAAY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