chain-insights 0.76.0 → 0.78.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.
- package/dist/cli.cjs +5 -5
- package/dist/cli.mjs +5 -5
- package/dist/{dex-registry-CZQB2YhU.cjs → dex-registry-DdXOg5On.cjs} +4 -0
- package/dist/{dex-registry-D6Xxi_vr.mjs → dex-registry-sPTFuCrP.mjs} +5 -1
- package/dist/dex-registry-sPTFuCrP.mjs.map +1 -0
- package/dist/{dex-tool-DsM-pSku.cjs → dex-tool-CDmhhXfk.cjs} +3 -3
- package/dist/{dex-tool-BoAYqhZO.mjs → dex-tool-D61sIjpq.mjs} +4 -4
- package/dist/{dex-tool-BoAYqhZO.mjs.map → dex-tool-D61sIjpq.mjs.map} +1 -1
- package/dist/mcp-proxy.cjs +169 -5
- package/dist/mcp-proxy.d.cts.map +1 -1
- package/dist/mcp-proxy.d.mts.map +1 -1
- package/dist/mcp-proxy.mjs +169 -5
- package/dist/mcp-proxy.mjs.map +1 -1
- package/dist/{token-lookup-BJ00JO9A.cjs → token-lookup-DvgEyqcC.cjs} +1 -1
- package/dist/{token-lookup-XnyisLQW.mjs → token-lookup-sH2DesLS.mjs} +2 -2
- package/dist/{token-lookup-XnyisLQW.mjs.map → token-lookup-sH2DesLS.mjs.map} +1 -1
- package/docs/graph-query-compatibility.md +19 -0
- package/docs/graph-tools.md +51 -0
- package/package.json +2 -2
- package/registry/README.md +12 -6
- package/registry/robinhood.json +187 -2
- package/registry/robinhood.md +86 -2
- package/skills/chain-insights-cypher/SKILL.md +64 -3
- package/skills/chain-insights-dex/SKILL.md +7 -1
- package/skills/chain-insights-virtuals/SKILL.md +3 -1
- package/dist/dex-registry-D6Xxi_vr.mjs.map +0 -1
package/registry/robinhood.md
CHANGED
|
@@ -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:
|
|
9
|
+
Registry version: 6.
|
|
10
10
|
|
|
11
|
-
Recorded on: 2026-11-
|
|
11
|
+
Recorded on: 2026-11-05.
|
|
12
12
|
|
|
13
13
|
## Rows
|
|
14
14
|
|
|
@@ -18,6 +18,14 @@ Recorded on: 2026-11-02.
|
|
|
18
18
|
| aero | Aero (Aerodrome and Velodrome, merged) | | gauge | cl-gauge-v1 | router | `0x72e46c9edf828002fdbfdd0952419790576c0f18` | 94021838 | - | - | [census 2026-10-23](https://github.com/chainswarm/AP1000/blob/main/docs/evidence/2026-10-23-dex-protocol-skills.md) | served |
|
|
19
19
|
| aero | Aero (Aerodrome and Velodrome, merged) | | gauge | cl-gauge-v1 | router | `0x0fef9e88a7b76bcdbf451780c6774fe32965ee98` | 0 | - | - | [Dromos metarouter ledger](https://github.com/dromos-labs/metadex-slipstream-public/blob/main/deployment-addresses/cl-robinhood.json) | served |
|
|
20
20
|
| aero | Aero (Aerodrome and Velodrome, merged) | | gauge | cl-gauge-v1 | router | `0x9ee35bf1bd69a03c6f0393582030fce8bb93d418` | 0 | - | - | [Dromos CL ledger](https://github.com/dromos-labs/metadex-slipstream-public/blob/main/deployment-addresses/cl-robinhood.json) | served |
|
|
21
|
+
| aero | Aero (Aerodrome and Velodrome, merged) | | gauge | cl-gauge-v1 | helper | `0x4857db576ee0e45f10525ec59527bfd10beec60b` | 93974253 | - | - | [position NFT named by the verified gauge](https://sourcify.dev/server/v2/contract/4663/0x89e91a960154b1ed6c093039a8f0725ab67d14e0) | served |
|
|
22
|
+
| aero | Aero (Aerodrome and Velodrome, merged) | | gauge | cl-gauge-v1 | helper | `0xf437f62053acb121665b8fdbfea8f214fb8e589d` | 93974455 | - | - | [gauge factory of the verified gauge](https://sourcify.dev/server/v2/contract/4663/0x89e91a960154b1ed6c093039a8f0725ab67d14e0) | served |
|
|
23
|
+
| aero | Aero (Aerodrome and Velodrome, merged) | | gauge | cl-gauge-v1 | helper | `0x220d17d3260f130a4f91a1ba2d21f8f75f624942` | 94581179 | - | - | [clone of the verified ArbCLGauge](https://sourcify.dev/server/v2/contract/4663/0x89e91a960154b1ed6c093039a8f0725ab67d14e0) | served |
|
|
24
|
+
| aero | Aero (Aerodrome and Velodrome, merged) | | gauge | cl-gauge-v1 | helper | `0xe033f4bd3d7ccf537a2f954ecdc8eb1218e3b7a6` | 94581067 | - | - | [clone of the verified ArbCLGauge](https://sourcify.dev/server/v2/contract/4663/0x89e91a960154b1ed6c093039a8f0725ab67d14e0) | served |
|
|
25
|
+
| aero | Aero (Aerodrome and Velodrome, merged) | | gauge | cl-gauge-v1 | helper | `0x750a4e760873c863daf22890b8db55f4c71f1114` | 94581160 | - | - | [clone of the verified ArbCLGauge](https://sourcify.dev/server/v2/contract/4663/0x89e91a960154b1ed6c093039a8f0725ab67d14e0) | served |
|
|
26
|
+
| aero | Aero (Aerodrome and Velodrome, merged) | | gauge | cl-gauge-v1 | helper | `0x045ccb9d8a98cb748b39253005be2d6d5b955c14` | 94581169 | - | - | [clone of the verified ArbCLGauge](https://sourcify.dev/server/v2/contract/4663/0x89e91a960154b1ed6c093039a8f0725ab67d14e0) | served |
|
|
27
|
+
| aero | Aero (Aerodrome and Velodrome, merged) | | gauge | cl-gauge-v1 | helper | `0x5874f5b8728776993de4c90c61473d76eeab90db` | 94581072 | - | - | [clone of the verified ArbCLGauge](https://sourcify.dev/server/v2/contract/4663/0x89e91a960154b1ed6c093039a8f0725ab67d14e0) | served |
|
|
28
|
+
| aero | Aero (Aerodrome and Velodrome, merged) | | gauge | cl-gauge-v1 | helper | `0xe5b468c4e13b45ec10a1d22ace7e2c0fc0671da0` | 94581094 | - | - | [clone of the verified ArbCLGauge](https://sourcify.dev/server/v2/contract/4663/0x89e91a960154b1ed6c093039a8f0725ab67d14e0) | served |
|
|
21
29
|
| up | up. | up., up, UP, up33, UP33, up.finance | gauge | cl-gauge-v1 | factory | `0x1ac9db4a2608ba45d6127b1737949b51bb54b7f3` | 6184096 | 0x4e8649be40ae67ebbcff99c291b92ee03015917b | 800 | [DefiLlama up-v3](https://github.com/DefiLlama/dimension-adapters/blob/master/dexs/up-v3/index.ts) | served |
|
|
22
30
|
| up | up. | | gauge | solidly-v2 | factory | `0xfa5429aeba338bea2bfcc1b9a889862ee395bc28` | 6180950 | - | - | [DefiLlama up-v2](https://github.com/DefiLlama/dimension-adapters/blob/master/dexs/up-v2/index.ts) | served |
|
|
23
31
|
| up | up. | | gauge | cl-gauge-v1 | router | `0xc062b870e813fca720f1e002c234369ab3ab9415` | 0 | - | - | [lp-terminal contract map](https://github.com/lp-terminal/contracts/blob/main/robinhood.json) | served |
|
|
@@ -38,7 +46,11 @@ Recorded on: 2026-11-02.
|
|
|
38
46
|
| swaphood | SwapHood | | gauge | solidly-v2 | router | `0x8f8056fec03159ebcc4aee1b8ea5a61d8fe405fc` | 0 | - | - | [SwapHood contract addresses](https://swaphood-finance.gitbook.io/swaphood-finance-docs/contract-addresses.md) | served |
|
|
39
47
|
| uniswap-v2 | Uniswap v2 | Uniswap v2, Uni v2 | plain | uniswap-v2 | factory | `0x8bceaa40b9acdfaedf85adf4ff01f5ad6517937f` | 0 | 0x4a6a85252a6f6b383a5f747259ee157e65ff1307 | 10000 | [Uniswap v2 deployments](https://developers.uniswap.org/docs/protocols/v2/deployments) | served |
|
|
40
48
|
| uniswap-v3 | Uniswap v3 | Uniswap v3, Uni v3 | plain | uniswap-v3 | factory | `0x1f7d7550b1b028f7571e69a784071f0205fd2efa` | 0 | 0x10cc6bd38112cac182db90b6a71d8bb5939526ba | 200000 | [Uniswap v3 Robinhood deployment](https://developers.uniswap.org/docs/protocols/v3/deployments/v3-robinhood-chain-deployments) | served |
|
|
49
|
+
| eth-usdg-router | unnamed ETH/USDG swap router (routes into Uniswap v3 and v4) | ETH/USDG router, ETH/USDG swap router, USDG swap router | plain | uniswap-v3 | factory | `0x1f7d7550b1b028f7571e69a784071f0205fd2efa` | 105000018 | 0x52e65b17fb6e5ba00ed806f37afcd2daa50271ca | - | [scout-agent finding 164](https://github.com/chainswarm/scout-agent/issues/164) | served |
|
|
50
|
+
| eth-usdg-router | unnamed ETH/USDG swap router (routes into Uniswap v3 and v4) | | plain | uniswap-v3 | router | `0x7a39b98d31f84152bc724bc5ddb41dbcb338f2a5` | 105000018 | 0x52e65b17fb6e5ba00ed806f37afcd2daa50271ca | - | [scout-agent finding 164](https://github.com/chainswarm/scout-agent/issues/164) | served |
|
|
41
51
|
| uniswap-v4 | Uniswap v4 | Uniswap, UNI, Uniswap v4, Uni v4, PoolManager | vault | uniswap-v4 | manager | `0x8366a39cc670b4001a1121b8f6a443a643e40951` | 0 | - | - | [Uniswap v4 deployments](https://developers.uniswap.org/docs/protocols/v4/deployments) | served |
|
|
52
|
+
| uniswap-v4 | Uniswap v4 | | vault | uniswap-v4 | helper | `0x204faca1764b154221e35c0d20abb3c525710498` | 65727895 | - | - | [Uniswap v4 deployments](https://developers.uniswap.org/docs/protocols/v4/deployments) | served |
|
|
53
|
+
| uniswap-v4 | Uniswap v4 | | vault | uniswap-v4 | helper | `0x8876789976decbfcbbbe364623c63652db8c0904` | 18127 | - | - | [Uniswap v4 deployments](https://developers.uniswap.org/docs/protocols/v4/deployments) | served |
|
|
42
54
|
| pancakeswap | PancakeSwap Infinity | PancakeSwap, Pancake, CAKE, PancakeSwap Infinity | vault | pancake-infinity-cl | manager | `0xee04c68742e6bf434be8039580d2e89bbe55bc6f` | 0 | - | - | [PancakeSwap infinity config](https://github.com/pancakeswap/infinity-periphery/blob/main/script/config/robinhood-mainnet.json) | served |
|
|
43
55
|
| pancakeswap-v2 | PancakeSwap v2 | PancakeSwap v2, Pancake v2 | plain | uniswap-v2 | factory | `0x02a84c1b3bbd7401a5f7fa98a384ebc70bb5749e` | 0 | - | 40 | [PancakeSwap infinity config](https://github.com/pancakeswap/infinity-periphery/blob/main/script/config/robinhood-mainnet.json) | served |
|
|
44
56
|
| pancakeswap-v3 | PancakeSwap v3 | PancakeSwap v3, Pancake v3 | plain | uniswap-v3 | factory | `0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865` | 0 | - | - | [PancakeSwap config](https://github.com/pancakeswap/infinity-periphery/blob/main/script/config/robinhood-mainnet.json) | served |
|
|
@@ -69,6 +81,24 @@ Recorded on: 2026-11-02.
|
|
|
69
81
|
| single-router-launchpad | unnamed single-router bonding-curve launchpad | single-router bonding-curve launchpad, single-router launchpad | launchpad | mob-launch-curve | factory | `0x006fee8a9a5482dd7cdf7f21b4d78fa6e246ca4c` | 99903488 | - | - | [scout-agent finding 131](https://github.com/chainswarm/scout-agent/issues/131) | served |
|
|
70
82
|
| single-router-launchpad | unnamed single-router bonding-curve launchpad | | launchpad | mob-launch-curve | manager | `0x4ed0f046d97d508df86d6b7b058e763dbfb0027f` | 99903488 | - | - | [devops registry v29](https://github.com/chainswarm/devops/blob/e270ee1a3c8a2afc52e9d5549be5dbb8b98f0914/charts/chainswarm-indexer-evm-dex/registry/robinhood-v29.json) | served |
|
|
71
83
|
| virtuals | Virtuals Protocol | Virtuals, VIRTUAL, Virtuals Protocol | launchpad | uniswap-v2 | factory | `0xfc2e4da3edb2e18100473339c763705d263d20a9` | 0 | - | - | [change silent-factory-discovery-and-labels](https://github.com/chainswarm/AP1000/blob/main/openspec/changes/archive/2026-10-16-silent-factory-discovery-and-labels/design.md) | served |
|
|
84
|
+
| weth-unwrap-helper | unnamed WETH-unwrap helper of Uniswap sell routes | WETH-unwrap helper | plain | uniswap-v3 | factory | `0x1f7d7550b1b028f7571e69a784071f0205fd2efa` | 103295248 | - | - | [scout-agent finding 162](https://github.com/chainswarm/scout-agent/issues/162) | served |
|
|
85
|
+
| weth-unwrap-helper | unnamed WETH-unwrap helper of Uniswap sell routes | | plain | uniswap-v3 | router | `0x0849c295bc609da9fde347834f92a75c2c4eb178` | 103295248 | - | - | [scout-agent finding 162](https://github.com/chainswarm/scout-agent/issues/162) | served |
|
|
86
|
+
| realm-etf | Realm ETF launchpad | Realm, Realm ETF, RealmEtf | launchpad | uniswap-v4 | factory | `0x124ad86c732b16366ed26445e3943adef635f123` | 101031051 | - | - | [Sourcify RealmEtfHook](https://sourcify.dev/server/v2/contract/4663/0x74dd0a05540f7c1ae419c18f8d55ff220076e8c8) | served |
|
|
87
|
+
| realm-etf | Realm ETF launchpad | | launchpad | uniswap-v4 | router | `0x74dd0a05540f7c1ae419c18f8d55ff220076e8c8` | 101031057 | - | - | [Sourcify RealmEtfHook](https://sourcify.dev/server/v2/contract/4663/0x74dd0a05540f7c1ae419c18f8d55ff220076e8c8) | served |
|
|
88
|
+
| pangea | Pangea launch factory | Pangea, Pangea launch | launchpad | uniswap-v4 | factory | `0xadf9c12eaf14da2f7780c0587cc06034f1edf8d3` | 96290239 | - | - | [Sourcify UniswapLaunchFactoryV2](https://sourcify.dev/server/v2/contract/4663/0xadf9c12eaf14da2f7780c0587cc06034f1edf8d3) | served |
|
|
89
|
+
| pangea | Pangea launch factory | | launchpad | uniswap-v4 | helper | `0x6ea418b883571af6155145d5604187f92b2d7b92` | 96283385 | - | - | [Sourcify PartsDeployerV2](https://sourcify.dev/server/v2/contract/4663/0x6ea418b883571af6155145d5604187f92b2d7b92) | served |
|
|
90
|
+
| icecreamswap | IceCreamSwap aggregator | IceCreamSwap, IceCream, Ice Cream Swap | plain | uniswap-v3 | factory | `0x1f7d7550b1b028f7571e69a784071f0205fd2efa` | 3087983 | - | - | [Sourcify AggregatorGuard](https://sourcify.dev/server/v2/contract/4663/0x603206d6105217dd972e4ab30676a220ca393346) | served |
|
|
91
|
+
| icecreamswap | IceCreamSwap aggregator | | plain | uniswap-v3 | router | `0x603206d6105217dd972e4ab30676a220ca393346` | 3087983 | - | - | [Sourcify AggregatorGuard](https://sourcify.dev/server/v2/contract/4663/0x603206d6105217dd972e4ab30676a220ca393346) | served |
|
|
92
|
+
| icecreamswap | IceCreamSwap aggregator | | plain | uniswap-v3 | router | `0x2ca37ff95caf25366ef16fc2e655b78a165d125f` | 3094087 | - | - | [Sourcify AggregatorGuard](https://sourcify.dev/server/v2/contract/4663/0x603206d6105217dd972e4ab30676a220ca393346) | served |
|
|
93
|
+
| icecreamswap | IceCreamSwap aggregator | | plain | uniswap-v3 | router | `0xec9aa0a6c2372131a0502aba6188269ab52cacb5` | 72179539 | - | - | [Sourcify AggregatorGuard](https://sourcify.dev/server/v2/contract/4663/0x603206d6105217dd972e4ab30676a220ca393346) | served |
|
|
94
|
+
| icecreamswap | IceCreamSwap aggregator | | plain | uniswap-v3 | router | `0xe6eeda550918638529c6cf2ea14f9ea0572d6f88` | 92800751 | - | - | [Sourcify AggregatorGuard](https://sourcify.dev/server/v2/contract/4663/0x603206d6105217dd972e4ab30676a220ca393346) | served |
|
|
95
|
+
| per-launch-v4-router | unnamed per-launch Uniswap v4 swap routers | per-launch router, per-launch v4 router | vault | uniswap-v4 | manager | `0x8366a39cc670b4001a1121b8f6a443a643e40951` | 90471772 | - | - | [scout-agent finding 134](https://github.com/chainswarm/scout-agent/issues/134) | served |
|
|
96
|
+
| per-launch-v4-router | unnamed per-launch Uniswap v4 swap routers | | vault | uniswap-v4 | helper | `0xe672754903b2be414abbec68ee1a6d7884ba993b` | 100454866 | - | - | [scout-agent finding 134](https://github.com/chainswarm/scout-agent/issues/134) | served |
|
|
97
|
+
| per-launch-v4-router | unnamed per-launch Uniswap v4 swap routers | | vault | uniswap-v4 | helper | `0x0c388f9d803e17addc439a50a9c9b9e3937221f5` | 100437079 | - | - | [scout-agent finding 134](https://github.com/chainswarm/scout-agent/issues/134) | served |
|
|
98
|
+
| per-launch-v4-router | unnamed per-launch Uniswap v4 swap routers | | vault | uniswap-v4 | helper | `0x3201074c2a813d9827c563395c16a86560f57437` | 100215518 | - | - | [scout-agent finding 134](https://github.com/chainswarm/scout-agent/issues/134) | served |
|
|
99
|
+
| per-launch-v4-router | unnamed per-launch Uniswap v4 swap routers | | vault | uniswap-v4 | helper | `0x80d49714825e23d4801549a765cb88cf917f2f02` | 99533593 | - | - | [scout-agent finding 134](https://github.com/chainswarm/scout-agent/issues/134) | served |
|
|
100
|
+
| per-launch-v4-router | unnamed per-launch Uniswap v4 swap routers | | vault | uniswap-v4 | helper | `0xf5b7cba51da2cef7fb334aa34c83203efa1f083e` | 99416107 | - | - | [scout-agent finding 134](https://github.com/chainswarm/scout-agent/issues/134) | served |
|
|
101
|
+
| per-launch-v4-router | unnamed per-launch Uniswap v4 swap routers | | vault | uniswap-v4 | helper | `0xff4b110e9e3b70de24490bef682f18a2342b55a9` | 90471772 | - | - | [scout-agent finding 134](https://github.com/chainswarm/scout-agent/issues/134) | served |
|
|
72
102
|
|
|
73
103
|
## Verification
|
|
74
104
|
|
|
@@ -106,6 +136,7 @@ swaps it forwarded.
|
|
|
106
136
|
| `0x006fee8a9a5482dd7cdf7f21b4d78fa6e246ca4c` | factory | the token factory of the single-router launchpad: it created all 14 launched tokens on lane B, from Mob `0xe0165a1b3d8f9e276b0746adcb9c7094cbd05785` at block 99,903,488 to block 100,030,381. Created at block 99,884,248 by `0x9cd48fc444f80e6c79d90c4bcb9d045603747390`, the deployer of the router below. A launched token is not a pool: its curve is kept inside the router, so the row's factory serves the launches read, and the router holds the pools |
|
|
107
137
|
| `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 |
|
|
108
138
|
| `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 |
|
|
139
|
+
| `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 |
|
|
109
140
|
|
|
110
141
|
`0x0d1ebb179cdbca88d74c923c4255cb2b17474afd` created 254,650 `uniswap-v2`
|
|
111
142
|
pairs with 38 USD of volume in all: the Flap launchpad's pair factory per
|
|
@@ -136,3 +167,56 @@ one reserve holder (`swapped-custody`). The adapter ids keep the indexer's
|
|
|
136
167
|
words: the indexer named `hoodclub` and `mob` after token symbols, and
|
|
137
168
|
neither is a cited exchange name. Only the native-ETH launchpad carries a pool floor; its count is the
|
|
138
169
|
lowest proven, one pool.
|
|
170
|
+
|
|
171
|
+
Registry version 5 (2026-11-05) serves the swap router of scout-agent
|
|
172
|
+
finding 164: an unnamed ETH/USDG router, `eth-usdg-router`, that about 500
|
|
173
|
+
wallets call directly and that swaps in Uniswap v3 and Uniswap v4 pools. No
|
|
174
|
+
source names its operator, so it is served under a plain description. The
|
|
175
|
+
review rule refuses an exchange with router rows only, so the key also
|
|
176
|
+
carries a factory row for the Uniswap v3 factory
|
|
177
|
+
`0x1f7d7550b1b028f7571e69a784071f0205fd2efa`, valid from the router's
|
|
178
|
+
creation block. The example pool is the pool the router swaps in, the
|
|
179
|
+
Uniswap v3 WETH/USDG pool `0x52e65b17fb6e5ba00ed806f37afcd2daa50271ca`.
|
|
180
|
+
That factory stays Uniswap v3's: a lookup of its address still answers
|
|
181
|
+
Uniswap v3, the first exchange that names it.
|
|
182
|
+
|
|
183
|
+
Registry version 6 (2026-11-05) serves the rows of six scout-agent findings
|
|
184
|
+
and adds the role `helper`: a contract of an exchange that the trail does not
|
|
185
|
+
read. That is a position NFT, a gauge, a parts deployer, or a swap router of a
|
|
186
|
+
vault, where the manager stays the contract past the swap.
|
|
187
|
+
|
|
188
|
+
- Finding 162: the Uniswap Universal Routers
|
|
189
|
+
`0x204faca1764b154221e35c0d20abb3c525710498` and
|
|
190
|
+
`0x8876789976decbfcbbbe364623c63652db8c0904`, both on Uniswap's own
|
|
191
|
+
Robinhood Chain list, and the WETH-unwrap contract
|
|
192
|
+
`0x0849c295bc609da9fde347834f92a75c2c4eb178`. Its code holds WETH, and the
|
|
193
|
+
graph shows 7,431 transfers from it to the first router. It has no verified
|
|
194
|
+
source and no known operator, so it has a plain description and its own key.
|
|
195
|
+
- Finding 146: the Realm ETF launchpad. Sourcify verifies `RealmEtfHook`
|
|
196
|
+
`0x74dd0a05540f7c1ae419c18f8d55ff220076e8c8`, and its code holds its factory
|
|
197
|
+
`0x124ad86c732b16366ed26445e3943adef635f123` as an immutable.
|
|
198
|
+
- Finding 134: six single-launch v4 routers with one code shape, each holding
|
|
199
|
+
the PoolManager in its code. No source names them. Later launches of the
|
|
200
|
+
series need a row each.
|
|
201
|
+
- Finding 107: the Aero Slipstream staking contracts. Sourcify verifies the
|
|
202
|
+
implementation `ArbCLGauge` `0x89e91a960154b1ed6c093039a8f0725ab67d14e0`. Both
|
|
203
|
+
gauges read on 2026-11-05 answer `nft()` with the position NFT
|
|
204
|
+
`0x4857db576ee0e45f10525ec59527bfd10beec60b` ("Slipstream V3 Deposit",
|
|
205
|
+
AERO-CL) and `voter()` with `0x382409fad8503fbcdbb27a4211551fa03e884078`.
|
|
206
|
+
`0xe033f4bd3d7ccf537a2f954ecdc8eb1218e3b7a6` answers `pool()` with the Aero
|
|
207
|
+
pool `0x7615926023bb149f36095645c2a81dc367d39750`. Only the six gauges the
|
|
208
|
+
finding names are listed, out of more than 50.
|
|
209
|
+
- Finding 100: the Pangea launch factory. Sourcify verifies
|
|
210
|
+
`UniswapLaunchFactoryV2` `0xadf9c12eaf14da2f7780c0587cc06034f1edf8d3`, whose
|
|
211
|
+
title names Pangea. Its code holds `PartsDeployerV2`
|
|
212
|
+
`0x6ea418b883571af6155145d5604187f92b2d7b92`, and its `platform()` answers
|
|
213
|
+
the 20 percent fee wallet `0xe8e219cccff046b8e6666f9803414f442e333940`.
|
|
214
|
+
- Finding 50: the IceCreamSwap aggregator. Sourcify verifies `AggregatorGuard`
|
|
215
|
+
`0x603206d6105217dd972e4ab30676a220ca393346`, whose one entry function is
|
|
216
|
+
named `IceCreamSwap`. The name rests on that function alone. The three
|
|
217
|
+
executors are its routers.
|
|
218
|
+
|
|
219
|
+
Each new key that has no factory of its own names the factory or manager it
|
|
220
|
+
swaps through, valid from its own first block, as `eth-usdg-router` does. A
|
|
221
|
+
lookup of that factory or manager still answers Uniswap, the first exchange
|
|
222
|
+
that names it.
|
|
@@ -46,8 +46,12 @@ The one case without the tool is at the end, Shell without the tool.
|
|
|
46
46
|
3. A shortened address, a mixed-case address, or an ISO string against a
|
|
47
47
|
millisecond column gives zero rows with no error. Check these first. Zero
|
|
48
48
|
rows is not proof of safety.
|
|
49
|
-
4.
|
|
50
|
-
|
|
49
|
+
4. A risk question is answered from the graph: is this a scam, a fake
|
|
50
|
+
token, a poisoner, a drainer, a sweeper, a victim, on a laundering trail.
|
|
51
|
+
Read the judgement marks and the claims list beside each, see
|
|
52
|
+
[Judgement marks](#judgement-marks-scams-victims-and-trails). Do not
|
|
53
|
+
volunteer a risk screen when the user asked about flows, a balance or a
|
|
54
|
+
transaction. No overall risk score is served.
|
|
51
55
|
5. Never write files, reports or notes unless the user asks. Answer in the chat.
|
|
52
56
|
6. After a refusal, fix the query once from `fix` and `example`. A second
|
|
53
57
|
refusal ends it: tell the user plainly what cannot be asked and what can.
|
|
@@ -215,6 +219,7 @@ Marks say what an address is. They sit beside the kind and are never an anchor:
|
|
|
215
219
|
MATCH (a:Address {address: "0xc33acc93942105c57602e59e8e448c20ba718a85"})-[w:SWAPPED]->(a)
|
|
216
220
|
RETURN w.swap_count AS swap_count, w.sold_usd AS sold_usd, w.bought_usd AS bought_usd, w.pools AS pools LIMIT 1
|
|
217
221
|
```
|
|
222
|
+
- `:Scam` (`is_scam`), `:Poisoned`, `:Victim` (`is_victim`), `:Targeted` and `:OnMoneyTrail` are judgement marks from the labels layer. Why the mark is there sits in a sorted list on the node: `risk_claims` beside `:Scam`, `:Poisoned` and `:Sanctioned`, `protection_claims` beside `:Victim` and `:Targeted`, `traced_claims` beside `:OnMoneyTrail`. `suspect_labels` says the address itself used a mixer pool, and has no mark of its own. See [Judgement marks](#judgement-marks-scams-victims-and-trails).
|
|
218
223
|
- A basket is a Robinhood stock-basket token: one token that holds several stock tokens in near-equal USD weights. One factory, `0xe78b036bd6da158cd61a3dac3f67e18f62ecddfd`, creates every basket, and one router, `0xb672a5d825f82dea8574711d1da696fcc48d2ae0`, mints and redeems them. A basket is `:Protocol` and `:Token`, and its `labels` carry the word `Basket`. The factory is `:Protocol` and its `labels` carry `BasketFactory`. The router has no mark of its own beyond `:Contract`. See [Baskets](#baskets-is-this-a-basket-and-what-does-it-trade).
|
|
219
224
|
|
|
220
225
|
**Ask by mark.** A question that names a kind of thing (mixers, launchpad pools, NFT collections, tokens of one standard, arbitrage bots) is a label match on the mark, a probe the server answers from the label index: nine `:Mixer` rows come back in 13 ms, a count of 2.4 million `:Token` in 4 s.
|
|
@@ -223,6 +228,12 @@ Marks say what an address is. They sit beside the kind and are never an anchor:
|
|
|
223
228
|
USE topology MATCH (a:Mixer) RETURN a.address AS address, labels(a) AS node_labels, a.labels AS labels LIMIT 25
|
|
224
229
|
```
|
|
225
230
|
|
|
231
|
+
A `WHERE` on the marked node's own properties keeps the mark as the anchor. On production this read was admitted and gave 5 rows in 57 ms:
|
|
232
|
+
|
|
233
|
+
```cypher
|
|
234
|
+
USE topology MATCH (a:Mixer) WHERE "Mixer" IN a.labels RETURN a.address AS address, a.labels AS labels LIMIT 5
|
|
235
|
+
```
|
|
236
|
+
|
|
226
237
|
Never write `MATCH (a:Address) WHERE a.labels CONTAINS "mixer"` with no address: `labels` is a list on every address, the scan touches all of them and the query times out. Read `a.labels` only beside an anchor, or beside a mark. The marks a lane serves, and a golden set of 44 addresses with the marks each must carry, are pinned in `tests/fixtures/graph-marks-golden.json`.
|
|
227
238
|
|
|
228
239
|
A token name from an explorer gives `:Token`, not `:Protocol`. `:Token` is a mark, not a stop: the walk guard below does not name it. One contract can carry both marks: a Uniswap v2 pair is itself an ERC20 token of its liquidity providers, so it is `:Pool` and, when the asset scan lists it, `:Token` too. Ask which tokens or pools an address touched with the mark: `WHERE t:Token` or `WHERE p:Pool`.
|
|
@@ -266,13 +277,63 @@ How to answer:
|
|
|
266
277
|
- "Who created these tokens?" The factory. List its children with a `DEPLOYED_CONTRACT` read anchored on the factory, with a literal `LIMIT`. Never scan `a.labels` for `Basket` with no anchor; ask the factory's children, or the `:Protocol` mark beside an anchor.
|
|
267
278
|
- "Which baskets went through the router on a day?" A facts read needs both addresses, so never send one with the router alone: the server refuses it. List the factory's children first (above), then send one `graph_query_batch` of the facts day, one query per basket and direction (router to basket, basket to router), each with its own `id`.
|
|
268
279
|
|
|
280
|
+
### Judgement marks: scams, victims and trails
|
|
281
|
+
|
|
282
|
+
A mark says what the labels layer judged. The claims list beside it says why. The codes are for the query. The answer says what each one means, in plain words: "a fake-token scam", "it lost money to a scam". Never print the list name or the code to the user.
|
|
283
|
+
|
|
284
|
+
| Mark | List | Value: what it means |
|
|
285
|
+
| --- | --- | --- |
|
|
286
|
+
| `:Scam` | `risk_claims` | `FAKE_TOKEN`: a fake token, a spoof contract that imitates a real token. `FAKE_TOKEN_DEPLOYER`: its creator. `INBOUND_IMPERSONATION`: a look-alike address that paid the target to get into its history. `PHANTOM_TRANSFER`, `PHANTOM_TRANSFER_EMITTER`, `PHANTOM_ENTRYPOINT`: a contract that writes fake transfer events, claiming a transfer from a look-alike that never happened. `SWEEPER_DELEGATE`: an EIP-7702 delegate that empties the accounts that delegate to it. `SWEEP_BENEFICIARY`: where it sends the funds. `UNSAFE_DELEGATE`: a delegate any caller can use to empty the account. `APPROVAL_DRAINER`: a spender that moved the tokens of at least three owners with their approval or Permit2 within 72 hours of the grant, and paid nothing back. `APPROVAL_DRAIN_BENEFICIARY`: the receiver of those tokens. |
|
|
287
|
+
| `:Poisoned` | `risk_claims` | `ADDRESS_POISONING`: a poisoner, a look-alike address that sent worthless dust so the target copies it from its history. Never `:Scam`. |
|
|
288
|
+
| `:Sanctioned` | `risk_claims` | `SANCTIONED`: on a sanctions list. |
|
|
289
|
+
| `:Victim` | `protection_claims` | `VICTIM`: it lost money to a scam the evidence walk traced. It paid the accused, was swept, or was drained after the attempt. Receiving a fake token or dust never makes a victim. |
|
|
290
|
+
| `:Targeted` | `protection_claims` | `ADDRESS_POISONING_TARGET`, an older value a lane may still hold: a poisoning target the walk has not proven lost money. Never call it a victim. |
|
|
291
|
+
| `:OnMoneyTrail` | `traced_claims` | The trail the evidence walk followed from an accused address. `LAUNDERED`: it received the accused's money along the walk and moved it on. `RECEIVED`: it received that money and still holds it (it becomes `LAUNDERED` when it forwards it). `FUNDER`: it funded the accused address. `MIXED`: it received that money and paid it into a mixer pool, where the walk ends. |
|
|
292
|
+
| none | `suspect_labels` | `MIXER_DEPOSITOR`, `MIXER_WITHDRAWER`: it put money into, or took money out of, a mixer pool. A warning, not a theft. |
|
|
293
|
+
|
|
294
|
+
Ask by mark, or anchor on the full address. Never scan a claims list with no mark and no address: it reads every address and times out. A lane that has not written the lists yet returns null for them: name the mark, and say the graph gives no reason yet.
|
|
295
|
+
|
|
296
|
+
List fake-token scams: the `:Scam` mark is the anchor, and a `WHERE` on its own list picks the value. Approval drainers, sweepers and fake transfer events are the same read with `"APPROVAL_DRAINER"`, `"SWEEPER_DELEGATE"` or `"PHANTOM_TRANSFER"` in place of `"FAKE_TOKEN"`. For poisoners ask `:Poisoned` with `"ADDRESS_POISONING"`, for victims `:Victim` with `"VICTIM"`. When 25 rows come back, say there may be more.
|
|
297
|
+
|
|
298
|
+
```cypher
|
|
299
|
+
USE topology
|
|
300
|
+
MATCH (a:Scam) WHERE "FAKE_TOKEN" IN a.risk_claims
|
|
301
|
+
RETURN a.address AS address, a.risk_claims AS risk_claims, a.labels AS labels LIMIT 25
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Is this address a victim, and of what? Read its marks and lists first, anchored on the address:
|
|
305
|
+
|
|
306
|
+
```cypher
|
|
307
|
+
USE topology
|
|
308
|
+
MATCH (a:Address {address: "0x1111111111111111111111111111111111111111"})
|
|
309
|
+
RETURN a.address AS address, labels(a) AS node_labels, a.risk_claims AS risk_claims, a.protection_claims AS protection_claims, a.traced_claims AS traced_claims, a.suspect_labels AS suspect_labels LIMIT 1
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
The graph holds no link from an accused address to its victims, so answer per address. For "of what", read where the victim paid a `:Scam` address, and name each by its claims:
|
|
313
|
+
|
|
314
|
+
```cypher
|
|
315
|
+
USE topology
|
|
316
|
+
MATCH (v:Address {address: "0x1111111111111111111111111111111111111111"})-[f:FLOWED_TO]->(s:Scam) WHERE NOT v:Pool
|
|
317
|
+
RETURN v.address AS from_address, s.address AS to_address, f.amount_usd_sum AS amount_usd_sum, f.tx_count AS tx_count, f.first_seen_timestamp AS first_seen_timestamp, f.last_seen_timestamp AS last_seen_timestamp, v.labels AS from_labels, s.labels AS to_labels, v.is_exchange AS from_is_exchange, s.is_exchange AS to_is_exchange, s.risk_claims AS to_risk_claims ORDER BY f.last_seen_timestamp DESC LIMIT 25
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Who did this drainer empty? Anchor on the drainer. Its victims are the `:Victim` owners who approved it, with `VICTIM` in their `protection_claims`. Each row is one address the walk proved lost money, and its approval of the drainer: say both, never that the graph links the two as thief and victim. `APPROVED` holds no Permit2 grants, so a Permit2 drainer's victims are not on it: find them, and a sweeper's or a beneficiary's, as the `:Victim` senders on `FLOWED_TO` into the address, anchored on it the same way.
|
|
321
|
+
|
|
322
|
+
```cypher
|
|
323
|
+
USE topology
|
|
324
|
+
MATCH (v:Victim)-[p:APPROVED]->(d:Address {address: "0x1111111111111111111111111111111111111111"})
|
|
325
|
+
WHERE "VICTIM" IN v.protection_claims
|
|
326
|
+
RETURN v.address AS victim_address, p.granted_tokens AS granted_tokens, p.last_height AS last_height LIMIT 25
|
|
327
|
+
```
|
|
328
|
+
|
|
269
329
|
## Topology
|
|
270
330
|
|
|
271
331
|
`USE topology` is the address graph: `FLOWED_TO` money flow, swaps, liquidity,
|
|
272
332
|
bridges and the `LINKED` overlay. The server checks these before it runs:
|
|
273
333
|
|
|
274
334
|
- Anchor every pattern on a full address: `{address: "<address>"}` in the node, or `WHERE a.address = "<address>"`. A list of at most 25 addresses is an anchor. An address in `RETURN`, in an `OR` or in a `$parameter` is no anchor.
|
|
275
|
-
-
|
|
335
|
+
- A label match on a mark, such as `MATCH (a:Scam)` or `MATCH (a:Mixer)`, is an anchor: the server reads it from the label index. A `WHERE` on that node's own properties is allowed. What is refused is a `WHERE` with no label and no address, such as `MATCH (a:Address) WHERE "exchange" IN a.labels`.
|
|
336
|
+
- The one read with no anchor is a probe on `:Address`: one node or one hop, no `WHERE`, no `ORDER BY`, no aggregate, and a small `LIMIT`. Its rows are arbitrary: never call them recent, top or biggest.
|
|
276
337
|
- A sort, an aggregate, `DISTINCT`, `collect()` or a filter on a link property needs an anchor on every pattern.
|
|
277
338
|
- End every read with a literal `LIMIT`: at most 5,000 rows, 100 for a probe. A path has at most 5 hops and a query at most 8. The live numbers are in `topology_admission` (`cia network robinhood --json`).
|
|
278
339
|
- Paths use bounded quantifiers such as `-[:FLOWED_TO]-{1,5}`. A `*` range, the legacy path functions, `PROFILE`, writes and `CALL` are refused.
|
|
@@ -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
|
|
88
|
+
Memo of the exchange registry, version 6, robinhood, recorded 2026-11-05.
|
|
89
89
|
|
|
90
90
|
| Exchange | Key | Also written | Trail | Factories, or the manager | Router |
|
|
91
91
|
|---|---|---|---|---|---|
|
|
@@ -100,6 +100,7 @@ Memo of the exchange registry, version 4, robinhood, recorded 2026-11-02.
|
|
|
100
100
|
| SwapHood | `swaphood` | SwapHood, SwapHood Finance, SWT, swaphood.finance | gauge | `0xe7206ecac3a51afe7e6179182ad4130a26068dd1` | `0x8f8056fec03159ebcc4aee1b8ea5a61d8fe405fc` |
|
|
101
101
|
| Uniswap v2 | `uniswap-v2` | Uniswap v2, Uni v2 | plain | `0x8bceaa40b9acdfaedf85adf4ff01f5ad6517937f` | none |
|
|
102
102
|
| Uniswap v3 | `uniswap-v3` | Uniswap v3, Uni v3 | plain | `0x1f7d7550b1b028f7571e69a784071f0205fd2efa` | none |
|
|
103
|
+
| unnamed ETH/USDG swap router (routes into Uniswap v3 and v4) | `eth-usdg-router` | ETH/USDG router, ETH/USDG swap router, USDG swap router | plain | `0x1f7d7550b1b028f7571e69a784071f0205fd2efa` | `0x7a39b98d31f84152bc724bc5ddb41dbcb338f2a5` |
|
|
103
104
|
| Uniswap v4 | `uniswap-v4` | Uniswap, UNI, Uniswap v4, Uni v4, PoolManager | vault | manager `0x8366a39cc670b4001a1121b8f6a443a643e40951` | the manager |
|
|
104
105
|
| PancakeSwap Infinity | `pancakeswap` | PancakeSwap, Pancake, CAKE, PancakeSwap Infinity | vault | manager `0xee04c68742e6bf434be8039580d2e89bbe55bc6f` | the manager |
|
|
105
106
|
| PancakeSwap v2 | `pancakeswap-v2` | PancakeSwap v2, Pancake v2 | plain | `0x02a84c1b3bbd7401a5f7fa98a384ebc70bb5749e` | none |
|
|
@@ -123,6 +124,11 @@ Memo of the exchange registry, version 4, robinhood, recorded 2026-11-02.
|
|
|
123
124
|
| unnamed native-ETH bonding-curve launchpad | `eth-curve-launchpad` | native-ETH bonding-curve launchpad, ETH bonding-curve launchpad | launchpad | `0xc4210279fb1e1de24a87d6f5cc597c9422aef899` | none |
|
|
124
125
|
| unnamed single-router bonding-curve launchpad | `single-router-launchpad` | single-router bonding-curve launchpad, single-router launchpad | launchpad | `0x006fee8a9a5482dd7cdf7f21b4d78fa6e246ca4c`, `0x4ed0f046d97d508df86d6b7b058e763dbfb0027f` | `0x4ed0f046d97d508df86d6b7b058e763dbfb0027f` |
|
|
125
126
|
| Virtuals Protocol | `virtuals` | Virtuals, VIRTUAL, Virtuals Protocol | launchpad | `0xfc2e4da3edb2e18100473339c763705d263d20a9` | none |
|
|
127
|
+
| unnamed WETH-unwrap helper of Uniswap sell routes | `weth-unwrap-helper` | WETH-unwrap helper | plain | `0x1f7d7550b1b028f7571e69a784071f0205fd2efa` | `0x0849c295bc609da9fde347834f92a75c2c4eb178` |
|
|
128
|
+
| Realm ETF launchpad | `realm-etf` | Realm, Realm ETF, RealmEtf | launchpad | `0x124ad86c732b16366ed26445e3943adef635f123` | `0x74dd0a05540f7c1ae419c18f8d55ff220076e8c8` |
|
|
129
|
+
| Pangea launch factory | `pangea` | Pangea, Pangea launch | launchpad | `0xadf9c12eaf14da2f7780c0587cc06034f1edf8d3` | none |
|
|
130
|
+
| IceCreamSwap aggregator | `icecreamswap` | IceCreamSwap, IceCream, Ice Cream Swap | plain | `0x1f7d7550b1b028f7571e69a784071f0205fd2efa` | `0x603206d6105217dd972e4ab30676a220ca393346`, `0x2ca37ff95caf25366ef16fc2e655b78a165d125f`, `0xec9aa0a6c2372131a0502aba6188269ab52cacb5`, `0xe6eeda550918638529c6cf2ea14f9ea0572d6f88` |
|
|
131
|
+
| unnamed per-launch Uniswap v4 swap routers | `per-launch-v4-router` | per-launch router, per-launch v4 router | vault | manager `0x8366a39cc670b4001a1121b8f6a443a643e40951` | the manager |
|
|
126
132
|
<!-- dex-registry:end -->
|
|
127
133
|
|
|
128
134
|
## Find the pools of an exchange
|
|
@@ -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
|
|
72
|
+
The factories of the exchange registry, version 6, row `virtuals`:
|
|
73
73
|
|
|
74
74
|
| Factory | Address |
|
|
75
75
|
|---|---|
|
|
@@ -92,6 +92,8 @@ Targeted and Victim labels only because millions of transactions touch
|
|
|
92
92
|
it. When a pool's only receiver is the router, the router is not the
|
|
93
93
|
buyer: the buyer is the sender of the buy transaction (reference B4).
|
|
94
94
|
Read an address's transaction count before you trust any label on it.
|
|
95
|
+
A Victim mark means the evidence walk proved the address lost money to a
|
|
96
|
+
scam; a hub is never one, whatever label it carries.
|
|
95
97
|
|
|
96
98
|
## Who the creator is
|
|
97
99
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dex-registry-D6Xxi_vr.mjs","names":[],"sources":["../src/mcp/dex-registry.ts"],"sourcesContent":["/**\n * The exchange registry, as the proxy tool meta_dex_lookup reads it.\n *\n * The reviewed table lives in this repository, registry/<network>.md, and its\n * served copy registry/<network>.json is checked in CI\n * (scripts/pin-dex-registry.mjs). The proxy reads the copy three ways, in this\n * order:\n *\n * cached ~/.chain-insights/cache/dex-registry-<network>.json, younger than one hour\n * fetched the copy on main, https://raw.githubusercontent.com/chainswarm/chain-insights/main/registry/<network>.json,\n * within 3 s, at most once an hour per network and never two in flight\n * packaged registry/<network>.json of the installed package, when the fetch fails and no cache exists\n *\n * A fetched file is used only when it passes the same rules the pin script\n * applies. A malformed file never replaces a good cache: the stale cache keeps\n * answering and one line names the fault. So a proxy that never reaches GitHub\n * behaves like the skill memo of its own version, and a row merged on main\n * reaches every running proxy within the hour, with no release.\n *\n * matchDex turns a name into one exchange: normalise, exact on key, display and\n * aliases, then within two letters of an alias of four or more characters. One\n * winner is matched, a tie is listed, never guessed, and no hit names every\n * covered exchange.\n */\n\nimport { existsSync, readFileSync } from 'node:fs'\nimport { mkdir, readFile, rename, writeFile } from 'node:fs/promises'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { chainInsightsHome } from './cache-location.js'\n\nexport const DEX_REGISTRY_SCHEMA = 'chain-insights.dex-registry.v1' as const\n/** How long a cached registry stays fresh. CACHE_TTL_MS (24 h) stays the lifetime of the schema caches. */\nexport const DEX_REGISTRY_TTL_MS = 60 * 60 * 1000\n/** The most a fetch of the public file may take on the call path. */\nexport const DEX_REGISTRY_FETCH_BUDGET_MS = 3_000\nexport const DEX_REGISTRY_URL_ENV = 'CHAIN_INSIGHTS_DEX_REGISTRY_URL'\nexport const DEX_REGISTRY_PUBLIC_URL =\n 'https://raw.githubusercontent.com/chainswarm/chain-insights/main/registry/{network}.json'\n\nexport const TRAIL_TYPES = ['plain', 'vault', 'gauge', 'launchpad'] as const\nexport type TrailType = (typeof TRAIL_TYPES)[number]\nexport const ROLES = ['factory', 'manager', 'router'] as const\nexport type Role = (typeof ROLES)[number]\nexport type RegistrySource = 'fetched' | 'cached' | 'packaged'\n\n/** One exchange of the served copy. */\nexport interface DexEntry {\n dex: string\n display: string\n aliases: string[]\n trail_type: TrailType\n adapters: string[]\n roles: Record<string, Role>\n /** Its factory addresses, or the one manager of a vault. */\n factories: string[]\n /** Its routers, or the manager of a vault: a vault forwards its own swaps. */\n routers: string[]\n example_pool: string | null\n pool_floor: number | null\n since_block: number\n source: string\n}\n\nexport interface DexRegistryDocument {\n schema: typeof DEX_REGISTRY_SCHEMA\n network: string\n registry_version: number\n recorded_on: string\n rows: DexEntry[]\n}\n\nexport interface LoadedRegistry {\n document: DexRegistryDocument\n source: RegistrySource\n loaded_at_ms: number\n}\n\n/** A refusal with its own words for the caller: a network the registry does not cover. */\nexport class DexRegistryError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'DexRegistryError'\n }\n}\n\nconst ADDRESS_RE = /^0x[0-9a-f]{40}$/\n// An example pool is a pool address, or the pool id of a manager that keeps its pools by id.\nconst POOL_RE = /^0x(?:[0-9a-f]{40}|[0-9a-f]{64})$/\nconst DEX_RE = /^[a-z0-9][a-z0-9._-]{0,31}$/\nconst NETWORK_RE = /^[a-z0-9][a-z0-9_-]{0,63}$/\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value)\n}\n\nconst isStringList = (value: unknown): value is string[] =>\n Array.isArray(value) && value.every((entry) => typeof entry === 'string')\n\n/** The network as a lower-case identifier; it becomes part of a file name and a URL. */\nexport function normalizeDexNetwork(raw: unknown): string {\n const network = typeof raw === 'string' ? raw.trim().toLowerCase() : ''\n if (!network) {\n throw new DexRegistryError(\n 'invalid_network: network is required. Pass the identifier of a served network, for example robinhood.'\n )\n }\n if (!NETWORK_RE.test(network)) {\n throw new DexRegistryError(`invalid_network: \"${String(raw)}\" is not a network identifier`)\n }\n return network\n}\n\n/**\n * The fault of a registry document, or null when it is valid for the network:\n * the rules of registry/README.md, the same ones the pin script applies.\n */\nexport function registryFault(value: unknown, network: string): string | null {\n if (!isRecord(value)) return 'the file is not a JSON object'\n if (value.schema !== DEX_REGISTRY_SCHEMA) {\n return `schema is ${JSON.stringify(value.schema)}, not ${DEX_REGISTRY_SCHEMA}`\n }\n if (value.network !== network)\n return `network is ${JSON.stringify(value.network)}, not ${network}`\n if (!Number.isInteger(value.registry_version) || (value.registry_version as number) < 0) {\n return 'registry_version is not a whole number'\n }\n if (typeof value.recorded_on !== 'string' || !/^\\d{4}-\\d{2}-\\d{2}$/.test(value.recorded_on)) {\n return 'recorded_on is not a YYYY-MM-DD day'\n }\n if (!Array.isArray(value.rows) || value.rows.length === 0) return 'rows is empty'\n const keys = new Set<string>()\n for (const [index, row] of value.rows.entries()) {\n const at = `rows[${index}]`\n if (!isRecord(row)) return `${at} is not an object`\n if (typeof row.dex !== 'string' || !DEX_RE.test(row.dex))\n return `${at}.dex is not a key: ${String(row.dex)}`\n if (keys.has(row.dex)) return `${at}.dex ${row.dex} is listed twice`\n keys.add(row.dex)\n if (typeof row.display !== 'string' || row.display.trim() === '')\n return `${at} (${row.dex}) has no display`\n if (!isStringList(row.aliases)) return `${at} (${row.dex}) aliases is not a list of names`\n if (!TRAIL_TYPES.includes(row.trail_type as TrailType)) {\n return `${at} (${row.dex}) trail_type ${String(row.trail_type)} is not plain, vault, gauge or launchpad`\n }\n if (!isStringList(row.adapters)) return `${at} (${row.dex}) adapters is not a list`\n if (!isRecord(row.roles)) return `${at} (${row.dex}) roles is not a map`\n for (const [address, role] of Object.entries(row.roles)) {\n if (!ADDRESS_RE.test(address))\n return `${at} (${row.dex}) address ${address} is not lowercase 0x plus 40 hex characters`\n if (!ROLES.includes(role as Role))\n return `${at} (${row.dex}) role ${String(role)} is not factory, manager or router`\n }\n for (const field of ['factories', 'routers'] as const) {\n const list = row[field]\n if (!isStringList(list)) return `${at} (${row.dex}) ${field} is not a list`\n for (const address of list) {\n if (!ADDRESS_RE.test(address))\n return `${at} (${row.dex}) address ${address} is not lowercase 0x plus 40 hex characters`\n if (!(address in row.roles))\n return `${at} (${row.dex}) ${field} names ${address}, which roles lacks`\n }\n }\n if ((row.factories as string[]).length === 0)\n return `${at} (${row.dex}) has no factory or manager`\n if (\n row.example_pool !== null &&\n (typeof row.example_pool !== 'string' || !POOL_RE.test(row.example_pool))\n ) {\n return `${at} (${row.dex}) example_pool ${String(row.example_pool)} is not a pool`\n }\n if (\n row.pool_floor !== null &&\n (!Number.isInteger(row.pool_floor) || (row.pool_floor as number) < 0)\n ) {\n return `${at} (${row.dex}) pool_floor is not a whole number`\n }\n if (!Number.isInteger(row.since_block) || (row.since_block as number) < 0) {\n return `${at} (${row.dex}) since_block is not a block`\n }\n if (typeof row.source !== 'string' || !row.source.startsWith('https://')) {\n return `${at} (${row.dex}) source is not an https link`\n }\n }\n return null\n}\n\n/** The URL of the served copy: the public file on main, or the override with {network} filled in. */\nexport function dexRegistryUrl(network: string, env: NodeJS.ProcessEnv = process.env): string {\n const override = env[DEX_REGISTRY_URL_ENV]?.trim()\n const template = override || DEX_REGISTRY_PUBLIC_URL\n if (template.includes('{network}')) return template.replaceAll('{network}', network)\n return template.endsWith('/') ? `${template}${network}.json` : template\n}\n\nexport function dexRegistryCachePath(network: string): string {\n return path.join(chainInsightsHome(), 'cache', `dex-registry-${network}.json`)\n}\n\n/** The registry/ folder of the installed package: next to dist/, or the repository root when run from source. */\nexport function packagedRegistryDir(): string {\n const candidates = [\n fileURLToPath(new URL('../registry', import.meta.url)),\n fileURLToPath(new URL('../../registry', import.meta.url)),\n ]\n return (\n candidates.find((candidate) => existsSync(path.join(candidate, 'robinhood.json'))) ??\n candidates[0]!\n )\n}\n\n/** The packaged copy of a network, or null when the package carries none. A packaged copy that fails the rules is a defect: it throws. */\nexport function readPackagedRegistry(\n network: string,\n dir: string = packagedRegistryDir()\n): DexRegistryDocument | null {\n let parsed: unknown\n try {\n parsed = JSON.parse(readFileSync(path.join(dir, `${network}.json`), 'utf8'))\n } catch {\n return null\n }\n const fault = registryFault(parsed, network)\n if (fault)\n throw new Error(\n `the packaged exchange registry registry/${network}.json is malformed: ${fault}`\n )\n return parsed as DexRegistryDocument\n}\n\ninterface CacheFile {\n schema: typeof DEX_REGISTRY_SCHEMA\n network: string\n registry_version: number\n recorded_on: string\n rows: DexEntry[]\n /** When the copy was read: the fetch, or the first start with no fetch. */\n cached_at_ms: number\n /** When a fetch was last tried. The cache is fresh for an hour after it. */\n checked_at_ms: number\n source: 'fetched' | 'packaged'\n}\n\nconst documentOf = (file: CacheFile): DexRegistryDocument => ({\n schema: file.schema,\n network: file.network,\n registry_version: file.registry_version,\n recorded_on: file.recorded_on,\n rows: file.rows,\n})\n\nasync function readCache(network: string): Promise<CacheFile | null> {\n let parsed: unknown\n try {\n parsed = JSON.parse(await readFile(dexRegistryCachePath(network), 'utf8'))\n } catch {\n return null\n }\n if (!isRecord(parsed) || registryFault(parsed, network) !== null) return null\n if (typeof parsed.checked_at_ms !== 'number' || typeof parsed.cached_at_ms !== 'number')\n return null\n if (parsed.source !== 'fetched' && parsed.source !== 'packaged') return null\n return parsed as unknown as CacheFile\n}\n\nasync function writeCache(file: CacheFile): Promise<void> {\n const target = dexRegistryCachePath(file.network)\n await mkdir(path.dirname(target), { recursive: true })\n // Written beside the target and renamed, so a second proxy never reads half of it.\n const scratch = `${target}.${process.pid}.tmp`\n await writeFile(scratch, JSON.stringify(file, null, 2) + '\\n', { mode: 0o600 })\n await rename(scratch, target)\n}\n\nexport interface LoadRegistryOptions {\n fetch?: typeof fetch\n now?: () => number\n env?: NodeJS.ProcessEnv\n /** One line per fault: a failed fetch, a malformed file, a cache that cannot be written. */\n log?: (line: string) => void\n packagedDir?: string\n budgetMs?: number\n}\n\ntype FetchOutcome = { document: DexRegistryDocument } | { fault: string }\n\nasync function fetchRegistry(network: string, options: LoadRegistryOptions): Promise<FetchOutcome> {\n const url = dexRegistryUrl(network, options.env)\n const fetchImpl = options.fetch ?? fetch\n let response: Response\n try {\n response = await fetchImpl(url, {\n signal: AbortSignal.timeout(options.budgetMs ?? DEX_REGISTRY_FETCH_BUDGET_MS),\n })\n } catch (err) {\n return { fault: `${url} unreachable: ${err instanceof Error ? err.message : String(err)}` }\n }\n if (response.status !== 200) return { fault: `${url} answered HTTP ${response.status}` }\n let parsed: unknown\n try {\n parsed = JSON.parse(await response.text())\n } catch {\n return { fault: `${url} is not JSON` }\n }\n const fault = registryFault(parsed, network)\n if (fault) return { fault: `${url} is malformed: ${fault}` }\n return { document: parsed as DexRegistryDocument }\n}\n\n// Fetches in flight, by network: two calls at once share one fetch.\nconst inFlight = new Map<string, Promise<LoadedRegistry>>()\n\nconst defaultLog = (line: string): void => {\n process.stderr.write(`[chain-insights] dex-registry: ${line}\\n`)\n}\n\n/**\n * The registry of one network: the fresh cache, else the public file, else the\n * stale cache, else the packaged copy. A packaged copy with a higher registry\n * version than the cache or the public file wins, so an upgrade is never\n * answered from an older file. Never throws for a network the package covers.\n */\nexport async function loadRegistry(\n rawNetwork: unknown,\n options: LoadRegistryOptions = {}\n): Promise<LoadedRegistry> {\n const network = normalizeDexNetwork(rawNetwork)\n const now = options.now ?? Date.now\n const log = options.log ?? defaultLog\n const packaged = readPackagedRegistry(network, options.packagedDir)\n const newer = (document: DexRegistryDocument): boolean =>\n packaged !== null && packaged.registry_version > document.registry_version\n const fromPackaged = (): LoadedRegistry => ({\n document: packaged!,\n source: 'packaged',\n loaded_at_ms: now(),\n })\n\n const cache = await readCache(network)\n const age = cache ? now() - cache.checked_at_ms : Infinity\n if (cache && age >= 0 && age < DEX_REGISTRY_TTL_MS) {\n if (newer(cache)) return fromPackaged()\n return {\n document: documentOf(cache),\n source: cache.source === 'fetched' ? 'cached' : 'packaged',\n loaded_at_ms: now(),\n }\n }\n\n const running = inFlight.get(network)\n if (running) return running\n const load = (async (): Promise<LoadedRegistry> => {\n const outcome = await fetchRegistry(network, options)\n const checked = now()\n const save = async (file: CacheFile): Promise<void> => {\n try {\n await writeCache(file)\n } catch (err) {\n log(\n `the cache ${dexRegistryCachePath(network)} could not be written: ${err instanceof Error ? err.message : String(err)}`\n )\n }\n }\n if ('document' in outcome) {\n const { document } = outcome\n await save({ ...document, cached_at_ms: checked, checked_at_ms: checked, source: 'fetched' })\n if (newer(document)) return fromPackaged()\n return { document, source: 'fetched', loaded_at_ms: checked }\n }\n log(outcome.fault)\n if (cache) {\n // The stale cache keeps answering, and the next fetch waits an hour.\n await save({ ...cache, checked_at_ms: checked })\n if (newer(cache)) return fromPackaged()\n return {\n document: documentOf(cache),\n source: cache.source === 'fetched' ? 'cached' : 'packaged',\n loaded_at_ms: checked,\n }\n }\n if (!packaged) {\n throw new DexRegistryError(\n `network_not_covered: the exchange registry covers no network \"${network}\", and ${outcome.fault}`\n )\n }\n await save({ ...packaged, cached_at_ms: checked, checked_at_ms: checked, source: 'packaged' })\n return fromPackaged()\n })()\n inFlight.set(network, load)\n try {\n return await load\n } finally {\n inFlight.delete(network)\n }\n}\n\n// ─── The name match ───────────────────────────────────────────────────────────\n\n/** Lower case, with every space, \".\", \"-\" and \"_\" removed: \"Uni v4\" and \"uni-v4\" are \"univ4\". */\nexport function normaliseName(name: string): string {\n return name.toLowerCase().replace(/[\\s.\\-_]+/g, '')\n}\n\n/** The optimal string alignment distance: insertions, deletions, substitutions and swaps of two neighbours. */\nexport function damerauLevenshtein(a: string, b: string): number {\n const rows = a.length + 1\n const cols = b.length + 1\n const d: number[][] = Array.from({ length: rows }, (_, i) =>\n Array.from({ length: cols }, (_, j) => (i === 0 ? j : j === 0 ? i : 0))\n )\n for (let i = 1; i < rows; i += 1) {\n for (let j = 1; j < cols; j += 1) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1\n let best = Math.min(d[i - 1]![j]! + 1, d[i]![j - 1]! + 1, d[i - 1]![j - 1]! + cost)\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n best = Math.min(best, d[i - 2]![j - 2]! + 1)\n }\n d[i]![j] = best\n }\n }\n return d[a.length]![b.length]!\n}\n\n/** The most letters a near hit may differ by, and the shortest alias a near hit is taken from. */\nexport const NEAR_DISTANCE = 2\nexport const NEAR_MIN_ALIAS_LENGTH = 4\n\nexport interface DexCandidate {\n dex: string\n display: string\n distance: number\n}\n\nexport interface DexMatchResult {\n matched: DexEntry | null\n /** The name as typed, when the match is a near hit. */\n took_for?: string\n candidates: DexCandidate[]\n /** Every covered exchange, by display name. */\n covered: string[]\n}\n\n/**\n * One name against the registry rows:\n * one exact hit matched\n * several exact hits candidates at distance 0, matched null\n * no exact hit, one nearest exchange matched, took_for the name\n * no exact hit, a tie at the nearest candidates, matched null\n * nothing within two letters matched null, no candidates\n */\nexport function matchDex(name: string, rows: DexEntry[]): DexMatchResult {\n const covered = rows.map((row) => row.display)\n const wanted = normaliseName(name)\n if (!wanted) return { matched: null, candidates: [], covered }\n const exact = rows.filter((row) =>\n [row.dex, row.display, ...row.aliases].some((written) => normaliseName(written) === wanted)\n )\n if (exact.length === 1) return { matched: exact[0]!, candidates: [], covered }\n if (exact.length > 1) {\n return {\n matched: null,\n candidates: exact.map((row) => ({ dex: row.dex, display: row.display, distance: 0 })),\n covered,\n }\n }\n const near: Array<{ row: DexEntry; distance: number }> = []\n for (const row of rows) {\n const distances = row.aliases\n .map(normaliseName)\n .filter((alias) => alias.length >= NEAR_MIN_ALIAS_LENGTH)\n .map((alias) => damerauLevenshtein(wanted, alias))\n const distance = Math.min(...distances)\n if (distance <= NEAR_DISTANCE) near.push({ row, distance })\n }\n if (near.length === 0) return { matched: null, candidates: [], covered }\n const least = Math.min(...near.map((hit) => hit.distance))\n const nearest = near.filter((hit) => hit.distance === least)\n if (nearest.length === 1)\n return { matched: nearest[0]!.row, took_for: name.trim(), candidates: [], covered }\n return {\n matched: null,\n candidates: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