@oracle-agent/oracle 0.11.0 → 0.12.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.
Files changed (308) hide show
  1. package/LICENSE +115 -201
  2. package/README.md +66 -84
  3. package/SECURITY.md +37 -12
  4. package/SETUP.md +207 -272
  5. package/dist/action-receipts.mjs +1 -0
  6. package/dist/action-semantics.mjs +1 -0
  7. package/dist/address-book.mjs +2 -0
  8. package/dist/bin/desk-server.mjs +14 -0
  9. package/dist/bin/oracle-data-mcp.mjs +8 -0
  10. package/dist/bin/oracle-init.mjs +24 -0
  11. package/dist/bin/oracle-public-server.mjs +5 -0
  12. package/dist/bin/oracle-route.mjs +22 -0
  13. package/dist/bin/oracle-scan.mjs +18 -0
  14. package/dist/bin/oracle-upgrade.mjs +21 -0
  15. package/dist/bin/oracle.mjs +68 -0
  16. package/dist/chains.mjs +1 -0
  17. package/dist/cli/commands/auth.mjs +16 -0
  18. package/dist/cli/commands/bootstrap.mjs +18 -0
  19. package/dist/cli/commands/chain.mjs +21 -0
  20. package/dist/cli/commands/chat.mjs +35 -0
  21. package/dist/cli/commands/credential.mjs +1 -0
  22. package/dist/cli/commands/data-mcp.mjs +2 -0
  23. package/dist/cli/commands/data.mjs +12 -0
  24. package/dist/cli/commands/doctor.mjs +5 -0
  25. package/dist/cli/commands/gate.mjs +13 -0
  26. package/dist/cli/commands/help.mjs +1 -0
  27. package/dist/cli/commands/init.mjs +3 -0
  28. package/dist/cli/commands/mcp.mjs +33 -0
  29. package/dist/cli/commands/model.mjs +44 -0
  30. package/dist/cli/commands/prepare.mjs +2 -0
  31. package/dist/cli/commands/public.mjs +3 -0
  32. package/dist/cli/commands/route.mjs +2 -0
  33. package/dist/cli/commands/runner.mjs +1 -0
  34. package/dist/cli/commands/scan.mjs +2 -0
  35. package/dist/cli/commands/setup.mjs +34 -0
  36. package/dist/cli/commands/sign.mjs +4 -0
  37. package/dist/cli/commands/signer.mjs +1 -0
  38. package/dist/cli/commands/upgrade.mjs +2 -0
  39. package/dist/cli/commands/vault.mjs +1 -0
  40. package/dist/cli/commands/version.mjs +2 -0
  41. package/dist/data/desk-data.mjs +12 -0
  42. package/dist/index.mjs +17 -0
  43. package/dist/nft-gas-war-guard.mjs +1 -0
  44. package/dist/onboarding/harness-configs.mjs +4 -0
  45. package/dist/portfolio-risk.mjs +1 -0
  46. package/dist/prepare-envelope.mjs +1 -0
  47. package/dist/public-control/policy-schema.mjs +1 -0
  48. package/dist/router/index.mjs +2 -0
  49. package/dist/scanner/index.mjs +4 -0
  50. package/dist/signals/index.mjs +1 -0
  51. package/dist/watch-preferences.mjs +1 -0
  52. package/package.json +27 -65
  53. package/public/oracle-splash/index.html +11 -1
  54. package/CONTRIBUTING.md +0 -98
  55. package/bin/desk-server.mjs +0 -440
  56. package/bin/oracle-data-mcp.mjs +0 -1019
  57. package/bin/oracle-init.mjs +0 -496
  58. package/bin/oracle-public-server.mjs +0 -36
  59. package/bin/oracle-route.mjs +0 -254
  60. package/bin/oracle-scan.mjs +0 -192
  61. package/bin/oracle-upgrade.mjs +0 -42
  62. package/bin/oracle.mjs +0 -33
  63. package/docs/adding-a-chain.md +0 -229
  64. package/docs/architecture.md +0 -138
  65. package/docs/cli.md +0 -47
  66. package/docs/connectors.md +0 -13
  67. package/docs/oracle-pack-standard.md +0 -29
  68. package/docs/profiles.md +0 -151
  69. package/docs/public-surface.md +0 -133
  70. package/examples/add-a-chain.mjs +0 -65
  71. package/examples/oracle-pack-template.mjs +0 -38
  72. package/examples/research-a-token.mjs +0 -70
  73. package/plugins/oracle-owner-gate/__init__.py +0 -227
  74. package/plugins/oracle-owner-gate/plugin.yaml +0 -9
  75. package/profiles/_template/SOUL.md +0 -54
  76. package/profiles/_template/profile.json +0 -22
  77. package/profiles/bitcoin-agent/SOUL.md +0 -31
  78. package/profiles/bitcoin-agent/profile.json +0 -32
  79. package/profiles/hyperliquid-agent/SOUL.md +0 -34
  80. package/profiles/hyperliquid-agent/profile.json +0 -37
  81. package/profiles/oracle/SOUL.md +0 -107
  82. package/profiles/oracle/profile.json +0 -39
  83. package/profiles/polymarket-agent/SOUL.md +0 -35
  84. package/profiles/polymarket-agent/profile.json +0 -34
  85. package/profiles/profile.schema.json +0 -90
  86. package/profiles/protocol-builder/SOUL.md +0 -57
  87. package/profiles/protocol-builder/profile.json +0 -39
  88. package/profiles/robinhood-agent/SOUL.md +0 -53
  89. package/profiles/robinhood-agent/profile.json +0 -40
  90. package/profiles/solana-agent/SOUL.md +0 -37
  91. package/profiles/solana-agent/profile.json +0 -37
  92. package/profiles/stable-agent/SOUL.md +0 -43
  93. package/profiles/stable-agent/profile.json +0 -37
  94. package/protocols/templates/safe-erc20/SECURITY.md +0 -16
  95. package/protocols/templates/safe-erc20/foundry.toml +0 -12
  96. package/protocols/templates/safe-erc20/remappings.txt +0 -2
  97. package/protocols/templates/safe-erc20/src/SafeERC20.sol +0 -53
  98. package/protocols/templates/safe-erc20/test/SafeERC20.t.sol +0 -72
  99. package/scripts/adversarial-bench.mjs +0 -114
  100. package/scripts/build-inscription.py +0 -230
  101. package/scripts/check-doc-drift.mjs +0 -123
  102. package/scripts/check-test-count.mjs +0 -105
  103. package/scripts/e2e-hl-markets.mjs +0 -21
  104. package/scripts/e2e-hl-perps.mjs +0 -48
  105. package/scripts/e2e-hypercore-staking.mjs +0 -128
  106. package/scripts/e2e-solana-bitcoin.mjs +0 -183
  107. package/scripts/protocol-template-gate.mjs +0 -15
  108. package/scripts/public-api-scan.mjs +0 -23
  109. package/scripts/secret-scan.mjs +0 -181
  110. package/scripts/verify-v3-venues.mjs +0 -192
  111. package/skills/balance/SKILL.md +0 -176
  112. package/skills/oracle-action-semantics/SKILL.md +0 -40
  113. package/skills/oracle-best-execution/SKILL.md +0 -127
  114. package/skills/oracle-bitcoin/SKILL.md +0 -53
  115. package/skills/oracle-chain-graphs-telegram-cards/SKILL.md +0 -59
  116. package/skills/oracle-chat/SKILL.md +0 -61
  117. package/skills/oracle-chat/chain.SKILL.md +0 -31
  118. package/skills/oracle-chat/setup.SKILL.md +0 -37
  119. package/skills/oracle-circuit-breaker/SKILL.md +0 -51
  120. package/skills/oracle-contract-research/SKILL.md +0 -55
  121. package/skills/oracle-desk/SKILL.md +0 -58
  122. package/skills/oracle-dex-launch/SKILL.md +0 -38
  123. package/skills/oracle-grants/SKILL.md +0 -69
  124. package/skills/oracle-hypercore-staking/SKILL.md +0 -57
  125. package/skills/oracle-hyperliquid/SKILL.md +0 -56
  126. package/skills/oracle-meme-token-sniper/SKILL.md +0 -73
  127. package/skills/oracle-multichain-nft-launch/SKILL.md +0 -338
  128. package/skills/oracle-multichain-token-launch/SKILL.md +0 -300
  129. package/skills/oracle-nft-gacha-launch/SKILL.md +0 -48
  130. package/skills/oracle-nft-mint-gas-war/SKILL.md +0 -63
  131. package/skills/oracle-polymarket/SKILL.md +0 -60
  132. package/skills/oracle-protocol-builder/SKILL.md +0 -59
  133. package/skills/oracle-protocol-security/SKILL.md +0 -60
  134. package/skills/oracle-public-product/SKILL.md +0 -44
  135. package/skills/oracle-receipts/SKILL.md +0 -52
  136. package/skills/oracle-rfq-tokenized-assets/SKILL.md +0 -69
  137. package/skills/oracle-smart-wallet-scanner/SKILL.md +0 -49
  138. package/skills/oracle-solana/SKILL.md +0 -65
  139. package/skills/oracle-solana-nft/SKILL.md +0 -54
  140. package/skills/oracle-token-research/SKILL.md +0 -67
  141. package/skins/oracle.yaml +0 -56
  142. package/src/action-receipts.mjs +0 -265
  143. package/src/action-semantics.mjs +0 -62
  144. package/src/address-book.mjs +0 -208
  145. package/src/agent-auth.mjs +0 -206
  146. package/src/approval-guard.mjs +0 -282
  147. package/src/attestation-secret.mjs +0 -88
  148. package/src/audit-log.mjs +0 -196
  149. package/src/auth/oauth.mjs +0 -672
  150. package/src/auto-slippage.mjs +0 -378
  151. package/src/capability-posture.mjs +0 -125
  152. package/src/chains.mjs +0 -62
  153. package/src/cli/chain-catalog.mjs +0 -215
  154. package/src/cli/chain-state.mjs +0 -74
  155. package/src/cli/commands/auth.mjs +0 -193
  156. package/src/cli/commands/bootstrap.mjs +0 -87
  157. package/src/cli/commands/chain.mjs +0 -143
  158. package/src/cli/commands/chat.mjs +0 -434
  159. package/src/cli/commands/credential.mjs +0 -9
  160. package/src/cli/commands/data-mcp.mjs +0 -18
  161. package/src/cli/commands/data.mjs +0 -75
  162. package/src/cli/commands/doctor.mjs +0 -136
  163. package/src/cli/commands/help.mjs +0 -7
  164. package/src/cli/commands/init.mjs +0 -27
  165. package/src/cli/commands/mcp.mjs +0 -142
  166. package/src/cli/commands/model.mjs +0 -99
  167. package/src/cli/commands/prepare.mjs +0 -12
  168. package/src/cli/commands/public.mjs +0 -20
  169. package/src/cli/commands/route.mjs +0 -12
  170. package/src/cli/commands/runner.mjs +0 -9
  171. package/src/cli/commands/scan.mjs +0 -12
  172. package/src/cli/commands/setup.mjs +0 -275
  173. package/src/cli/commands/sign.mjs +0 -21
  174. package/src/cli/commands/signer.mjs +0 -9
  175. package/src/cli/commands/upgrade.mjs +0 -12
  176. package/src/cli/commands/vault.mjs +0 -9
  177. package/src/cli/commands/version.mjs +0 -22
  178. package/src/cli/first-run.mjs +0 -23
  179. package/src/cli/kernel.mjs +0 -239
  180. package/src/cli/mcp-targets/chatgpt.mjs +0 -51
  181. package/src/cli/mcp-targets/claude-code.mjs +0 -39
  182. package/src/cli/mcp-targets/claude-desktop.mjs +0 -24
  183. package/src/cli/mcp-targets/codex.mjs +0 -41
  184. package/src/cli/mcp-targets/shared.mjs +0 -61
  185. package/src/cli/messaging-platforms.mjs +0 -209
  186. package/src/cli/model-config.mjs +0 -70
  187. package/src/cli/operator-dispatch.mjs +0 -258
  188. package/src/cli/oracle-harness.py +0 -415
  189. package/src/cli/paths.mjs +0 -83
  190. package/src/cli/runtime.mjs +0 -351
  191. package/src/cli/setup-state.mjs +0 -168
  192. package/src/cli/spawn-child.mjs +0 -43
  193. package/src/data/catalog.mjs +0 -585
  194. package/src/data/desk-data.mjs +0 -695
  195. package/src/data/http.mjs +0 -253
  196. package/src/data/provider-endpoint.mjs +0 -94
  197. package/src/data/providers/aerodrome.mjs +0 -245
  198. package/src/data/providers/balancer.mjs +0 -209
  199. package/src/data/providers/bitcoin-esplora.mjs +0 -216
  200. package/src/data/providers/bitcoin-meta.mjs +0 -378
  201. package/src/data/providers/blockscout.mjs +0 -14
  202. package/src/data/providers/bridges.mjs +0 -242
  203. package/src/data/providers/cowswap.mjs +0 -415
  204. package/src/data/providers/curve.mjs +0 -201
  205. package/src/data/providers/defillama.mjs +0 -88
  206. package/src/data/providers/dexscreener.mjs +0 -43
  207. package/src/data/providers/evm-rpc.mjs +0 -225
  208. package/src/data/providers/geckoterminal.mjs +0 -34
  209. package/src/data/providers/gmx.mjs +0 -496
  210. package/src/data/providers/hl-assets.mjs +0 -165
  211. package/src/data/providers/hl-info.mjs +0 -108
  212. package/src/data/providers/hl-markets.mjs +0 -210
  213. package/src/data/providers/hl-outcome.mjs +0 -61
  214. package/src/data/providers/hl-perps.mjs +0 -387
  215. package/src/data/providers/hl-staking.mjs +0 -353
  216. package/src/data/providers/hl-ws.mjs +0 -119
  217. package/src/data/providers/hyperevm-dex.mjs +0 -49
  218. package/src/data/providers/jupiter-venues.mjs +0 -119
  219. package/src/data/providers/jupiter.mjs +0 -315
  220. package/src/data/providers/lifi.mjs +0 -151
  221. package/src/data/providers/magiceden-sol.mjs +0 -406
  222. package/src/data/providers/morpho.mjs +0 -177
  223. package/src/data/providers/nft-gallery.mjs +0 -163
  224. package/src/data/providers/nft-portfolio.mjs +0 -494
  225. package/src/data/providers/odos.mjs +0 -156
  226. package/src/data/providers/oneinch.mjs +0 -174
  227. package/src/data/providers/opensea-multichain.mjs +0 -136
  228. package/src/data/providers/opensea-nft.mjs +0 -371
  229. package/src/data/providers/paraswap.mjs +0 -118
  230. package/src/data/providers/pendle.mjs +0 -188
  231. package/src/data/providers/poly-clob.mjs +0 -283
  232. package/src/data/providers/poly-public.mjs +0 -96
  233. package/src/data/providers/poly-ws.mjs +0 -103
  234. package/src/data/providers/portfolio-history.mjs +0 -394
  235. package/src/data/providers/portfolio.mjs +0 -594
  236. package/src/data/providers/rfq.mjs +0 -15
  237. package/src/data/providers/rh-agent.mjs +0 -59
  238. package/src/data/providers/satflow.mjs +0 -341
  239. package/src/data/providers/signed-material-guard.mjs +0 -108
  240. package/src/data/providers/solana-rpc.mjs +0 -197
  241. package/src/data/providers/uniswap-v3.mjs +0 -349
  242. package/src/data/providers/uniswap-v4.mjs +0 -414
  243. package/src/data/providers/zerox.mjs +0 -167
  244. package/src/data/public-api-scan.mjs +0 -61
  245. package/src/data/quote-placeholder.mjs +0 -31
  246. package/src/exact-integer.mjs +0 -72
  247. package/src/exec-policy.mjs +0 -455
  248. package/src/flags.mjs +0 -15
  249. package/src/fresh-window.mjs +0 -76
  250. package/src/gmx-attestation.mjs +0 -176
  251. package/src/index.mjs +0 -100
  252. package/src/nft-gas-war-guard.mjs +0 -139
  253. package/src/onboarding/agent-keys.mjs +0 -161
  254. package/src/onboarding/harness-configs.mjs +0 -102
  255. package/src/onboarding/index.mjs +0 -18
  256. package/src/onboarding/tiers.mjs +0 -139
  257. package/src/oracle-env.mjs +0 -47
  258. package/src/portfolio-risk.mjs +0 -170
  259. package/src/prepare-envelope.mjs +0 -204
  260. package/src/profile-upgrade.mjs +0 -277
  261. package/src/protocol-execution.mjs +0 -84
  262. package/src/protocol-templates/gate.mjs +0 -179
  263. package/src/protocol-templates/prepare-deploy.mjs +0 -81
  264. package/src/public-api/buzz-integration.mjs +0 -256
  265. package/src/public-api/connect-agent.mjs +0 -416
  266. package/src/public-api/grants.mjs +0 -142
  267. package/src/public-api/http.mjs +0 -389
  268. package/src/public-control/aa-adapter.mjs +0 -402
  269. package/src/public-control/build-registry.mjs +0 -227
  270. package/src/public-control/bundler-client.mjs +0 -357
  271. package/src/public-control/grant-indexer.mjs +0 -296
  272. package/src/public-control/policy-render.mjs +0 -69
  273. package/src/public-control/policy-schema.mjs +0 -318
  274. package/src/public-control/runtime-config.mjs +0 -275
  275. package/src/public-control/session-key-model.mjs +0 -374
  276. package/src/public-control/session-orchestrator.mjs +0 -412
  277. package/src/rfq/intent.mjs +0 -180
  278. package/src/rfq/sources.mjs +0 -181
  279. package/src/route-attestation.mjs +0 -132
  280. package/src/router/best-execution.mjs +0 -326
  281. package/src/router/index.mjs +0 -226
  282. package/src/router/prepare-bridge.mjs +0 -289
  283. package/src/router/prepare-route.mjs +0 -398
  284. package/src/router/proposal.mjs +0 -311
  285. package/src/router/risk-classifier.mjs +0 -119
  286. package/src/router/route-sources.mjs +0 -364
  287. package/src/scanner/chains.config.mjs +0 -430
  288. package/src/scanner/contract.mjs +0 -270
  289. package/src/scanner/evm-scanner.mjs +0 -394
  290. package/src/scanner/index.mjs +0 -9
  291. package/src/scanner/v2-venue.mjs +0 -335
  292. package/src/scanner/v3-venue.mjs +0 -290
  293. package/src/scopes.mjs +0 -44
  294. package/src/sell-simulation.mjs +0 -167
  295. package/src/signals/engine.mjs +0 -146
  296. package/src/signals/index.mjs +0 -1
  297. package/src/token-transfer-guard.mjs +0 -188
  298. package/src/tui/app.mjs +0 -438
  299. package/src/tui/backend.mjs +0 -145
  300. package/src/tui/format.mjs +0 -272
  301. package/src/tui/gateway-client.mjs +0 -177
  302. package/src/tui/input.mjs +0 -501
  303. package/src/tui/renderer.mjs +0 -443
  304. package/src/tui/standalone-client.mjs +0 -666
  305. package/src/tui/theme.mjs +0 -81
  306. package/src/vault-attestation.mjs +0 -146
  307. package/src/venues.mjs +0 -206
  308. package/src/watch-preferences.mjs +0 -85
@@ -1,69 +0,0 @@
1
- ---
2
- name: oracle-rfq-tokenized-assets
3
- description: RFQ/intent routing across supported chains and guarded buys for tokenized Robinhood assets when user keys/routes are configured.
4
- ---
5
-
6
- # Oracle RFQ + tokenized asset routing
7
-
8
- Use when a user asks for RFQ, solver/intent quotes, request-for-quote execution,
9
- or buying tokenized Robinhood-style assets/stocks on supported chains.
10
-
11
- ## RFQ scope
12
-
13
- Oracle should treat RFQ as another best-execution source, not a bypass:
14
-
15
- - Query RFQ/intent venues where the chain and token pair are supported and the
16
- user has configured any required API keys.
17
- - Compare RFQ quotes against AMM/aggregator routes on net received after gas,
18
- fees, solver spread, and settlement assumptions.
19
- - Return `artifactKind` precisely: signed typed-data order vs unsigned tx vs
20
- wallet-provider action.
21
- - Re-quote immediately before prepare/signing. RFQ expiry/nonce is short-lived.
22
- - Do not fabricate RFQ support for a chain without a configured venue.
23
-
24
- ## Every-chain rule
25
-
26
- "Across all chains" means every configured chain is attempted and capability-labeled:
27
-
28
- - `RFQ_READY`: venue configured, quote live, prepare path verified.
29
- - `QUOTE_ONLY`: quote available, but no reviewed prepare path.
30
- - `UNCONFIGURED`: needs user API key or venue credentials.
31
- - `UNAVAILABLE`: no RFQ venue for that chain/token pair.
32
- - `BLOCKED`: policy, unsupported asset, compliance, or route guard rejected.
33
-
34
- Unsupported is an honest result, not a failure to hide.
35
-
36
- ## Tokenized Robinhood assets
37
-
38
- Treat tokenized Robinhood assets as normal on-chain assets plus extra identity/risk
39
- checks:
40
-
41
- 1. Resolve the exact chain and contract/mint from the official issuer/venue or a
42
- user-provided contract. Never infer from ticker alone.
43
- 2. Check asset metadata, decimals, supply, issuer/proxy/admin controls, transfer
44
- restrictions, and redeemability/custody disclosures when public.
45
- 3. Verify the venue/router can quote and prepare the asset on that chain.
46
- 4. For buys, run the same route and slippage guard as any ERC-20/SPL swap.
47
- 5. For sells, run sellability/reverse route first; tokenized assets may trade like
48
- wrappers and can have restricted-transfer or allowlist rules.
49
- 6. User signs; Oracle does not custody or guarantee redemption.
50
-
51
- ## Output contract
52
-
53
- Return a table per chain/venue:
54
-
55
- - chain / venue / asset id
56
- - RFQ status and expiry
57
- - gross quote, estimated gas/fees, net output
58
- - artifact kind and signing path
59
- - policy blockers
60
- - confidence and data timestamp
61
-
62
- ## Pitfalls
63
-
64
- - Calling a solver/RFQ quote "gasless" when the cost is hidden in spread.
65
- - Using an RFQ quote after expiry.
66
- - Treating a tokenized stock ticker as identity without contract provenance.
67
- - Ignoring transfer restrictions that make buys possible but exits blocked.
68
- - Routing tokenized Robinhood assets through DEMI/RH private executor by default;
69
- public users must use their own wallet/key/API setup.
@@ -1,49 +0,0 @@
1
- ---
2
- name: oracle-smart-wallet-scanner
3
- description: Use when finding, scoring, or monitoring smart wallets from on-chain behavior across tokens, NFTs, and venues.
4
- ---
5
-
6
- # Smart-wallet scanner
7
-
8
- Use this for on-chain wallet intelligence: early buyers, profitable exits, repeat
9
- edge, copy-radar, cabal detection candidates, and wallet boards.
10
-
11
- ## Smart wallet definition
12
-
13
- A wallet is not smart because it bought one winner. Require repeatable evidence:
14
-
15
- - early across multiple unrelated assets
16
- - profitable realized exits, not just mark-to-market bags
17
- - enough trade count and not only one ticker
18
- - entry before broad social consensus
19
- - exits before liquidity drain or sell imbalance
20
- - behavior survives fees, gas, and failed trades
21
-
22
- ## Scan pattern
23
-
24
- 1. Start from live events: pair creates, swaps, mint transfers, order fills,
25
- marketplace sales, bridge inflows.
26
- 2. Normalize wallet, chain, token/NFT, time, size, and realized PnL.
27
- 3. Cluster funding and common recipients separately; do not call it a bundle
28
- without launch-block clustering and common-funder evidence.
29
- 4. Score wallets by multi-asset repeatability and drawdown, not raw largest win.
30
- 5. Track holds vs exits. A smart buyer becoming a smart seller changes the signal.
31
- 6. Emit confidence and evidence window with every wallet label.
32
-
33
- ## Output standard
34
-
35
- For each wallet surface:
36
-
37
- - address and chain
38
- - sample wins/losses
39
- - realized PnL basis and limitations
40
- - first-seen timing vs launch/volume
41
- - current holdings/exit state if known
42
- - confidence: high / moderate / low / unknown
43
-
44
- ## Hard rules
45
-
46
- - Never expose a private operator wallet as a public smart-wallet seed.
47
- - Never use one-token PnL as a primary smart label.
48
- - Cabal candidates are seeds for deeper analysis, not proof of manipulation.
49
- - If sell data is unavailable, label PnL `UNKNOWN`, not profitable.
@@ -1,65 +0,0 @@
1
- ---
2
- name: oracle-solana
3
- description: Use for Solana research and swap preparation — Jupiter routes, SPL accounts, simulation, blockhash expiry.
4
- ---
5
-
6
- # Solana
7
-
8
- Read and prepare through Oracle's data plane (`solana-rpc`, `jupiter`). No key
9
- required. Signing happens in the user's wallet; Oracle returns unsigned
10
- transactions.
11
-
12
- ## Ops
13
-
14
- | Need | Op |
15
- |---|---|
16
- | SOL balance | `getBalance` |
17
- | SPL accounts | `tokenAccounts` |
18
- | fresh blockhash | `latestBlockhash` |
19
- | dry run | `simulate` |
20
- | route price | `jupiter.quote` |
21
- | unsigned swap tx | `jupiter.prepare` |
22
-
23
- ## Blockhash expiry is the trap
24
-
25
- A Solana transaction carries a recent blockhash and dies in roughly 60–90 seconds.
26
-
27
- Consequences that catch people:
28
-
29
- - a transaction prepared two minutes ago is **dead** — re-prepare, don't retry
30
- - do not prepare, go do other tool work, then hand it over
31
- - if the user takes a while to approve, prepare again
32
-
33
- An expired transaction fails with a confusing error that looks like a routing bug.
34
- It isn't.
35
-
36
- ## Simulate every time
37
-
38
- `simulateTransaction` is cheap and tells you the actual failure before the user
39
- signs. There is no reason to skip it. Check:
40
-
41
- - does it succeed at all
42
- - compute units consumed (near the limit → it will fail under load)
43
- - logs for the real revert reason
44
-
45
- ## Account creation costs rent
46
-
47
- Swapping into a token the wallet has never held requires creating an associated
48
- token account, which costs SOL rent. Budget it, and say so — a wallet with exactly
49
- enough SOL for the swap will fail on the account creation.
50
-
51
- ## Decimals are not standard
52
-
53
- Nine is common, six is common, others exist. Read the mint. Assuming decimals is how
54
- an amount ends up 1000x off.
55
-
56
- ## Hard rules
57
-
58
- 1. **Simulate before returning any transaction for signature.**
59
- 2. **Never relay a caller-supplied RPC** — a hostile endpoint can lie about
60
- simulation.
61
- 3. **Return unsigned only.** Never a fully-signed transaction.
62
- 4. **Solana authority is separate from EVM authority.** No EVM key satisfies a
63
- Solana grant.
64
- 5. Name the **mint address**, not just the ticker.
65
- 6. Receipts or it didn't happen — confirmed signature or it failed.
@@ -1,54 +0,0 @@
1
- ---
2
- name: oracle-solana-nft
3
- description: Research Solana NFT collections and prepare unsigned Magic Eden buy, list, and mint transactions.
4
- ---
5
-
6
- # Solana NFT lane (Magic Eden)
7
-
8
- Use when someone asks Oracle to check a Solana NFT collection's floor, find
9
- listings, buy an NFT, list one they hold, or mint from a launchpad drop.
10
-
11
- ## Tiers
12
-
13
- | Op | Key needed | What it returns |
14
- |---|---|---|
15
- | `stats` | none | floor in SOL, listed count, 24h volume |
16
- | `listings` | none | mint, seller, auctionHouse, tokenATA, price |
17
- | `tokenListings` | none | listings for one specific mint |
18
- | `prepareBuy` | `MAGICEDEN_API_KEY` | unsigned base64 transaction |
19
- | `prepareList` | `MAGICEDEN_API_KEY` | unsigned base64 transaction |
20
- | `prepareMint` | `MAGICEDEN_API_KEY` | unsigned base64 transaction |
21
-
22
- Reads are keyless. Instruction builders need the user's own Magic Eden key. If
23
- the key is missing, say so plainly and stop; do not fake a ticket.
24
-
25
- ## Flow for a buy
26
-
27
- 1. `desk.solana.nftStats({ symbol })` - confirm the collection is real and get
28
- the floor.
29
- 2. `desk.solana.nftListings({ symbol, limit })` - pull live listings. The
30
- cheapest listing is the first one when sorted by price.
31
- 3. Set `maxPriceSol` from the user's stated ceiling, not from the floor. The cap
32
- is checked before any network call, so a listing that moved above the ceiling
33
- is rejected without touching the API.
34
- 4. `desk.solana.nftPrepareBuy({ buyer, seller, auctionHouse, tokenMint, tokenATA, priceSol, maxPriceSol })`.
35
- 5. Simulate the returned base64 through `desk.solana.simulate` before handing it
36
- over. A prepared transaction that fails simulation is a prepared loss.
37
- 6. Hand the user the unsigned transaction. Their wallet signs and sends.
38
-
39
- ## Rules
40
-
41
- - Floor price is not a bid. Buying fills at the listing price, which can move
42
- between the read and the signature.
43
- - Always pass `maxPriceSol`. Without it there is no ceiling on a mint or buy.
44
- - Collection symbols are validated as slugs. `../` and empty strings are
45
- rejected, not encoded into a URL.
46
- - Every prepare returns `signingReady: false` and `broadcastReady: false`. Oracle
47
- never signs a Solana transaction and never sends one.
48
- - Solana lamports are integers. `priceSol` is decimal SOL; the module converts.
49
-
50
- ## Verification
51
-
52
- `npm run e2e:solana-bitcoin` hits live Magic Eden reads, a live Jupiter quote,
53
- a live prepared swap, and a live simulation, then asserts the prepare posture
54
- held.
@@ -1,67 +0,0 @@
1
- ---
2
- name: oracle-token-research
3
- description: Use when researching any token, especially low-cap or newly launched. The sell-side-first checklist that catches honeypots.
4
- ---
5
-
6
- # Token research
7
-
8
- The default assumption for a new token is **hostile**. Research exists to disprove
9
- that, not to confirm a story.
10
-
11
- ## Sell side first
12
-
13
- Most losses here are not bad entries. They are tokens that **buy cleanly and cannot
14
- be sold**. So the first question is never "will it go up" — it is "can I get out."
15
-
16
- Run a **round-trip simulation** in one state-free call: wrap native → buy token →
17
- sell token back → require a minimum return. Treat any of these as FAIL:
18
-
19
- - quote failure in either direction
20
- - transfer failure
21
- - router revert
22
- - round-trip return below the no-tax reverse quote by more than a small tolerance
23
-
24
- A successful **buy** quote proves nothing about the sell.
25
-
26
- ## Price against the real pool
27
-
28
- A launchpad or bonding-curve token often exposes its **own** `getReserves()`
29
- returning zero or virtual values. The tradeable market is a *different* pair.
30
-
31
- - `blockTimestampLast == 0` → not a live pool. Do not size against it.
32
- - Find the real pair via `factory.getPair(a, b)` or a live swap's decoded target
33
- - A pair with `kLast`, `price0CumulativeLast`, `MINIMUM_LIQUIDITY` is standard V2
34
- even when the router in front of it is a custom fork
35
-
36
- Sizing against stale reserves is how a "0.4% impact" trade becomes 3%.
37
-
38
- ## Identity before action
39
-
40
- Tickers collide and get squatted. A fuzzy name match is a **candidate**, never
41
- confirmation.
42
-
43
- Always surface the **contract address** and require explicit confirmation before
44
- anything that moves value. `FEFUR` vs `FEFER` is a real class of loss.
45
-
46
- ## The rest of the checklist
47
-
48
- | Check | Red flag |
49
- |---|---|
50
- | holder concentration | top 5 hold most of supply |
51
- | liquidity depth | thin relative to your size |
52
- | LP status | unlocked or removable |
53
- | age | hours old with heavy volume |
54
- | router | non-canonical clone with a familiar name |
55
- | mint authority | still open |
56
- | transfer logic | fees or blocks that change post-launch |
57
-
58
- ## Label your evidence
59
-
60
- Mark every finding `LIVE`, `STALE`, `UNKNOWN`, or `UNAVAILABLE` with a timestamp.
61
- Do not call holder-concentration analysis "bundle detection" — bundles require
62
- launch-block clustering and common-funder evidence, which is a different query.
63
-
64
- ## Honest output
65
-
66
- `unknown` is a correct and frequent answer about a two-hour-old token. Say it.
67
- Never let narrative quality substitute for a passing sell simulation.
package/skins/oracle.yaml DELETED
@@ -1,56 +0,0 @@
1
- name: oracle
2
- description: filled lowercase oracle in the classic boxed layout
3
- colors:
4
- banner_border: "#455867"
5
- banner_title: "#B8F0FF"
6
- banner_accent: "#91C2D7"
7
- banner_dim: "#60717F"
8
- banner_text: "#EAF2F8"
9
- ui_accent: "#B8F0FF"
10
- ui_label: "#A5D9EB"
11
- ui_ok: "#7EE7B5"
12
- ui_error: "#FF7B7B"
13
- ui_warn: "#F0C674"
14
- prompt: "#B8F0FF"
15
- input_rule: "#455867"
16
- response_border: "#91C2D7"
17
- status_bar_bg: "#11161B"
18
- status_bar_text: "#91A2B1"
19
- status_bar_strong: "#EAF2F8"
20
- status_bar_dim: "#60717F"
21
- status_bar_good: "#7EE7B5"
22
- status_bar_warn: "#F0C674"
23
- status_bar_bad: "#FF9B71"
24
- status_bar_critical: "#FF7B7B"
25
- session_label: "#B8F0FF"
26
- session_border: "#455867"
27
- voice_status_bg: "#11161B"
28
- selection_bg: "#23313B"
29
- completion_menu_bg: "#11161B"
30
- completion_menu_current_bg: "#23313B"
31
- completion_menu_meta_bg: "#11161B"
32
- completion_menu_meta_current_bg: "#23313B"
33
- spinner:
34
- waiting_faces: ["·", "··", "···"]
35
- thinking_faces: ["◇", "◈", "◆", "◈"]
36
- thinking_verbs: ["thinking", "reading", "checking", "routing"]
37
- wings: [["", ""]]
38
- branding:
39
- agent_name: "oracle"
40
- welcome: ""
41
- goodbye: "exit"
42
- response_label: " oracle "
43
- prompt_symbol: "›"
44
- help_header: "oracle"
45
- tool_prefix: "│"
46
- banner_logo: |
47
- [bold #B8F0FF] ████[/]
48
- [bold #B8F0FF] ░░███[/]
49
- [bold #ACDEEF] ██████ ████████ ██████ ██████ ░███ ██████[/]
50
- [bold #A5D9EB] ███░░███░░███░░███ ░░░░░███ ███░░███ ░███ ███░░███[/]
51
- [bold #9FCBDD]░███ ░███ ░███ ░░░ ███████ ░███ ░░░ ░███ ░███████[/]
52
- [bold #9FCBDD]░███ ░███ ░███ ███░░███ ░███ ███ ░███ ░███░░░[/]
53
- [bold #ACDEEF]░░██████ █████ ░░████████░░██████ █████░░██████[/]
54
- [bold #B8F0FF] ░░░░░░ ░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░ ░░░░░░[/]
55
- banner_hero: |
56
- [bold #EAF2F8]THE FUTURE IS AGENTIC[/]
@@ -1,265 +0,0 @@
1
- // Deterministic, public-only receipts for prepared and executed actions.
2
- //
3
- // This module deliberately has no authority and no I/O: it does not authorize,
4
- // sign, broadcast, or fetch. It only records facts supplied by its caller.
5
-
6
- import { createHash } from "node:crypto";
7
- import { wordlists } from "ethers";
8
-
9
- export const ACTION_RECEIPT_VERSION = 1;
10
-
11
- // Key-name matching was exact-ish and only covered five words, so every wallet
12
- // export alias (secretKey, seedPhrase, wif, keyMaterial, privKey, xprv, seed,
13
- // keystore) sailed through. There was also NO value-shape rule, so a raw key or
14
- // a BIP-39 phrase pasted into a benign field like `memo` was recorded verbatim.
15
- //
16
- // Both concerns were already solved in src/address-book.mjs; this module simply
17
- // did not use the hardened list. Found by the opus lane of the 2026-08-03
18
- // four-model review, and verified to PERSIST: unknown top-level props are
19
- // dropped by the schema whitelist, but a secret nested inside a RETAINED field
20
- // (intent, route, decodedAction) survives into the frozen receipt.
21
- const SECRET_KEYS = new Set([
22
- "privatekey",
23
- "privkey",
24
- "secretkey",
25
- "seedphrase",
26
- "seed",
27
- "mnemonic",
28
- "passphrase",
29
- "password",
30
- "keystore",
31
- "keymaterial",
32
- "wif",
33
- "xprv",
34
- "xpriv",
35
- "bearer",
36
- "authorization",
37
- "signature",
38
- "apikey",
39
- "credential",
40
- ]);
41
-
42
- // Unambiguous key shapes: WIF, extended private key, BIP-39 word run. These are
43
- // refused wherever they appear.
44
- //
45
- // A bare 64-hex string is deliberately NOT in this list. A raw EVM private key
46
- // and a bytes32 tx hash are byte-identical, and receipts legitimately carry
47
- // txHash / orderHash / salt / merkleRoot / nonce. Blanket-refusing 64-hex would
48
- // break real receipts — an over-tight filter is its own bug. It is instead
49
- // gated on the field name below.
50
- const KEY_SHAPED_VALUE = [
51
- /\b[5KL][1-9A-HJ-NP-Za-km-z]{50,51}\b/,
52
- /\bxprv[0-9A-Za-z]{50,}\b/,
53
- ];
54
-
55
- const BIP39_WORD_COUNTS = new Set([12, 15, 18, 21, 24]);
56
-
57
- function isBip39EnglishPhrase(value) {
58
- const words = String(value).trim().toLowerCase().split(/\s+/).filter(Boolean);
59
- return BIP39_WORD_COUNTS.has(words.length) && words.every((word) => wordlists.en.getWordIndex(word) >= 0);
60
- }
61
-
62
- const BARE_32_BYTE_HEX = /^\s*(?:0x)?[0-9a-fA-F]{64}\s*$/;
63
-
64
- // Field names whose whole value is EXPECTED to be a 32-byte digest.
65
- //
66
- // The trailing `(?:e?s)?` matters: `publicValue` scans array leaves using the
67
- // PARENT key, so a batched route's `orderHashes` / `proofs` / `commitments`
68
- // arrives here in its plural form (English pluralizes `hash` as `hashes`).
69
- // Without it a digest LIST is refused while the exact same digest in singular
70
- // form is accepted — an over-tight filter that breaks real receipts and blocks
71
- // no secret (key-SHAPED values are refused by KEY_SHAPED_VALUE / BIP-39
72
- // regardless of field name).
73
- const DIGEST_FIELD = /(hash|digest|root|salt|nonce|proof|commitment|sig|id)(?:e?s)?$/i;
74
- const PROTOCOL_HEX_FIELDS = new Set([
75
- "calldata",
76
- "data",
77
- "publickey",
78
- "pubkey",
79
- "message",
80
- "payload",
81
- "input",
82
- "extradata",
83
- ]);
84
-
85
- function allows32ByteHex(key) {
86
- const normalized = normalizedKey(key);
87
- return PROTOCOL_HEX_FIELDS.has(normalized) || DIGEST_FIELD.test(normalized);
88
- }
89
-
90
- export class ActionReceiptSecretError extends Error {
91
- constructor(path) {
92
- super(`action receipt refused: secret-bearing field at ${path}`);
93
- this.name = "ActionReceiptSecretError";
94
- this.code = "ACTION_RECEIPT_SECRET";
95
- }
96
- }
97
-
98
- function normalizedKey(key) {
99
- return String(key).replace(/[^a-z0-9]/gi, "").toLowerCase();
100
- }
101
-
102
- function isSecretKey(key) {
103
- const normalized = normalizedKey(key);
104
- return [...SECRET_KEYS].some((secret) => normalized.includes(secret));
105
- }
106
-
107
- /**
108
- * Refuse a key-material-shaped VALUE, so a secret pasted into a benign field
109
- * name (memo, note, label) cannot be recorded verbatim.
110
- *
111
- * Bare 64-hex is only refused when the field name is NOT digest-shaped: a raw
112
- * EVM private key and a bytes32 hash are byte-identical, and receipts carry
113
- * txHash / orderHash / salt / nonce legitimately.
114
- */
115
- function assertNoSecretValue(key, value, path) {
116
- if (typeof value !== "string") return;
117
- if (KEY_SHAPED_VALUE.some((re) => re.test(value)) || isBip39EnglishPhrase(value)) {
118
- throw new ActionReceiptSecretError(path);
119
- }
120
- if (BARE_32_BYTE_HEX.test(value) && !allows32ByteHex(key)) {
121
- throw new ActionReceiptSecretError(path);
122
- }
123
- }
124
-
125
- function publicValue(value, path = "$", key = "") {
126
- if (value == null || typeof value === "boolean") return value;
127
- if (typeof value === "string") {
128
- assertNoSecretValue(key, value, path);
129
- return value;
130
- }
131
- if (typeof value === "number") {
132
- if (!Number.isFinite(value)) throw new TypeError(`action receipt: non-finite number at ${path}`);
133
- return value;
134
- }
135
- if (typeof value === "bigint") return value.toString();
136
- if (Array.isArray(value)) return value.map((item, index) => publicValue(item, `${path}[${index}]`, key));
137
- if (typeof value !== "object" || Object.getPrototypeOf(value) !== Object.prototype) {
138
- throw new TypeError(`action receipt: JSON-like value required at ${path}`);
139
- }
140
-
141
- const out = {};
142
- for (const childKey of Object.keys(value).sort()) {
143
- const childPath = `${path}.${childKey}`;
144
- if (isSecretKey(childKey)) throw new ActionReceiptSecretError(childPath);
145
- if (value[childKey] !== undefined) out[childKey] = publicValue(value[childKey], childPath, childKey);
146
- }
147
- return out;
148
- }
149
-
150
- /** Recursively reject secret-bearing fields and return a detached public copy. */
151
- export function assertNoReceiptSecrets(value) {
152
- return publicValue(value);
153
- }
154
-
155
- function canonicalPublicJson(value) {
156
- if (value === null || typeof value !== "object") return JSON.stringify(value);
157
- if (Array.isArray(value)) return `[${value.map(canonicalPublicJson).join(",")}]`;
158
- return `{${Object.keys(value).map((key) => `${JSON.stringify(key)}:${canonicalPublicJson(value[key])}`).join(",")}}`;
159
- }
160
-
161
- /** Canonical JSON with recursively sorted object keys. */
162
- export function canonicalReceiptJson(value) {
163
- return canonicalPublicJson(publicValue(value));
164
- }
165
-
166
- /** Hash exactly the public receipt fields, excluding the self-referential id. */
167
- export function computeReceiptId(receipt) {
168
- if (!receipt || typeof receipt !== "object" || Array.isArray(receipt)) {
169
- throw new TypeError("action receipt: object required");
170
- }
171
- const { receiptId: _ignored, summary: _derived, ...publicFields } = receipt;
172
- return createHash("sha256").update(canonicalReceiptJson(publicFields)).digest("hex");
173
- }
174
-
175
- function supplied(input, ...keys) {
176
- for (const key of keys) if (input[key] !== undefined) return input[key];
177
- return undefined;
178
- }
179
-
180
- function required(input, keys, label) {
181
- const value = supplied(input, ...keys);
182
- if (value === undefined || value === null) throw new TypeError(`action receipt: ${label} required`);
183
- return value;
184
- }
185
-
186
- function balanceFields(input) {
187
- const balances = supplied(input, "balances", "balanceChanges");
188
- const before = supplied(input, "beforeBalances", "balancesBefore", "before");
189
- const after = supplied(input, "afterBalances", "balancesAfter", "after");
190
- if (balances !== undefined) return { balances };
191
- if (before === undefined && after === undefined) return {};
192
- return { balances: { ...(before === undefined ? {} : { before }), ...(after === undefined ? {} : { after }) } };
193
- }
194
-
195
- /**
196
- * Normalize caller-supplied prepare/execute facts into the versioned schema.
197
- * Unknown input fields are intentionally omitted from the receipt.
198
- */
199
- export function normalizeActionReceipt(input = {}) {
200
- if (!input || typeof input !== "object" || Array.isArray(input)) {
201
- throw new TypeError("action receipt: input object required");
202
- }
203
- // Scan the complete input before selecting fields so a secret cannot be
204
- // hidden in an otherwise unknown property and accidentally appear later.
205
- publicValue(input);
206
-
207
- const txHash = supplied(input, "txHash", "transactionHash");
208
- const phase = supplied(input, "phase", "stage", "resultType") ?? (txHash == null ? "prepare" : "execute");
209
- if (phase !== "prepare" && phase !== "execute") {
210
- throw new TypeError('action receipt: phase must be "prepare" or "execute"');
211
- }
212
-
213
- const fields = {
214
- receiptVersion: ACTION_RECEIPT_VERSION,
215
- phase,
216
- intent: required(input, ["intent"], "intent"),
217
- route: required(input, ["route"], "route"),
218
- decodedAction: required(input, ["decodedAction", "action"], "decodedAction"),
219
- policyChecks: required(input, ["policyChecks", "checks"], "policyChecks"),
220
- allowlistHits: required(input, ["allowlistHits", "allowlistMatches"], "allowlistHits"),
221
- prepareHash: required(input, ["prepareHash"], "prepareHash"),
222
- ...(txHash == null ? {} : { txHash }),
223
- ...balanceFields(input),
224
- };
225
- const receipt = publicValue(fields);
226
- return Object.freeze({ ...receipt, receiptId: computeReceiptId(receipt) });
227
- }
228
-
229
- export const createActionReceipt = normalizeActionReceipt;
230
-
231
- function label(value, preferred = []) {
232
- if (typeof value === "string" || typeof value === "number") return String(value);
233
- for (const key of preferred) if (value?.[key] != null) return String(value[key]);
234
- return "recorded";
235
- }
236
-
237
- function checkResult(check) {
238
- if (typeof check === "boolean") return check;
239
- if (check && typeof check === "object") {
240
- if (typeof check.ok === "boolean") return check.ok;
241
- if (typeof check.allowed === "boolean") return check.allowed;
242
- if (typeof check.passed === "boolean") return check.passed;
243
- }
244
- return null;
245
- }
246
-
247
- /** Produce a compact human-readable statement without changing the receipt. */
248
- export function summarizeActionReceipt(receipt) {
249
- if (!receipt || typeof receipt !== "object") throw new TypeError("action receipt: object required");
250
- const action = label(receipt.decodedAction, ["type", "action", "method", "name"]);
251
- const route = label(receipt.route, ["name", "provider", "venue", "id"]);
252
- const checks = Array.isArray(receipt.policyChecks)
253
- ? receipt.policyChecks
254
- : Object.values(receipt.policyChecks || {});
255
- const passed = checks.filter((check) => checkResult(check) === true).length;
256
- const failed = checks.filter((check) => checkResult(check) === false).length;
257
- const hits = Array.isArray(receipt.allowlistHits)
258
- ? receipt.allowlistHits.length
259
- : Object.keys(receipt.allowlistHits || {}).length;
260
- const tx = receipt.txHash == null ? "no transaction hash" : `tx ${receipt.txHash}`;
261
- const balances = receipt.balances == null ? "balances not provided" : "before/after balances recorded";
262
- return `${receipt.phase} ${action} via ${route}; policy ${passed} passed, ${failed} failed; ${hits} allowlist hit${hits === 1 ? "" : "s"}; ${tx}; ${balances}; receipt ${receipt.receiptId}`;
263
- }
264
-
265
- export const formatActionReceipt = summarizeActionReceipt;