@oracle-agent/oracle 0.1.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 (169) hide show
  1. package/CONTRIBUTING.md +98 -0
  2. package/LICENSE +202 -0
  3. package/README.md +384 -0
  4. package/SECURITY.md +89 -0
  5. package/SETUP.md +235 -0
  6. package/artifacts/inscription/oracle-was-here-preview.png +0 -0
  7. package/artifacts/inscription/oracle-was-here.svg +1 -0
  8. package/artifacts/specialist-packs/oracle-full-crypto.json +273 -0
  9. package/bin/desk-server.mjs +438 -0
  10. package/bin/oracle-data-mcp.mjs +603 -0
  11. package/bin/oracle-init.mjs +423 -0
  12. package/bin/oracle-public-server.mjs +36 -0
  13. package/bin/oracle-route.mjs +254 -0
  14. package/bin/oracle-scan.mjs +192 -0
  15. package/docs/adding-a-chain.md +229 -0
  16. package/docs/architecture.md +135 -0
  17. package/docs/profiles.md +132 -0
  18. package/examples/add-a-chain.mjs +65 -0
  19. package/examples/research-a-token.mjs +70 -0
  20. package/package.json +90 -0
  21. package/profiles/_template/SOUL.md +47 -0
  22. package/profiles/_template/profile.json +22 -0
  23. package/profiles/bitcoin-agent/SOUL.md +31 -0
  24. package/profiles/bitcoin-agent/profile.json +32 -0
  25. package/profiles/hyperliquid-agent/SOUL.md +34 -0
  26. package/profiles/hyperliquid-agent/profile.json +37 -0
  27. package/profiles/oracle/SOUL.md +65 -0
  28. package/profiles/oracle/profile.json +35 -0
  29. package/profiles/polymarket-agent/SOUL.md +35 -0
  30. package/profiles/polymarket-agent/profile.json +34 -0
  31. package/profiles/profile.schema.json +90 -0
  32. package/profiles/protocol-builder/SOUL.md +50 -0
  33. package/profiles/protocol-builder/profile.json +37 -0
  34. package/profiles/robinhood-agent/SOUL.md +45 -0
  35. package/profiles/robinhood-agent/profile.json +39 -0
  36. package/profiles/solana-agent/SOUL.md +37 -0
  37. package/profiles/solana-agent/profile.json +37 -0
  38. package/profiles/stable-agent/SOUL.md +43 -0
  39. package/profiles/stable-agent/profile.json +37 -0
  40. package/public/oracle-console/app.js +272 -0
  41. package/public/oracle-console/bitcoin-wallets.js +206 -0
  42. package/public/oracle-console/index.html +91 -0
  43. package/public/oracle-console/styles.css +239 -0
  44. package/public/oracle-splash/index.html +931 -0
  45. package/scripts/build-inscription.py +230 -0
  46. package/scripts/check-test-count.mjs +105 -0
  47. package/scripts/e2e-hl-markets.mjs +21 -0
  48. package/scripts/e2e-hl-perps.mjs +48 -0
  49. package/scripts/e2e-hypercore-staking.mjs +128 -0
  50. package/scripts/e2e-solana-bitcoin.mjs +183 -0
  51. package/scripts/public-api-scan.mjs +23 -0
  52. package/scripts/secret-scan.mjs +181 -0
  53. package/scripts/verify-v3-venues.mjs +192 -0
  54. package/skills/oracle-best-execution/SKILL.md +127 -0
  55. package/skills/oracle-bitcoin/SKILL.md +53 -0
  56. package/skills/oracle-chain-graphs-telegram-cards/SKILL.md +59 -0
  57. package/skills/oracle-circuit-breaker/SKILL.md +51 -0
  58. package/skills/oracle-contract-research/SKILL.md +55 -0
  59. package/skills/oracle-desk/SKILL.md +58 -0
  60. package/skills/oracle-dex-launch/SKILL.md +38 -0
  61. package/skills/oracle-grants/SKILL.md +69 -0
  62. package/skills/oracle-hypercore-staking/SKILL.md +57 -0
  63. package/skills/oracle-hyperliquid/SKILL.md +56 -0
  64. package/skills/oracle-meme-token-sniper/SKILL.md +73 -0
  65. package/skills/oracle-nft-gacha-launch/SKILL.md +48 -0
  66. package/skills/oracle-nft-mint-gas-war/SKILL.md +63 -0
  67. package/skills/oracle-polymarket/SKILL.md +60 -0
  68. package/skills/oracle-protocol-builder/SKILL.md +38 -0
  69. package/skills/oracle-protocol-security/SKILL.md +60 -0
  70. package/skills/oracle-public-product/SKILL.md +44 -0
  71. package/skills/oracle-receipts/SKILL.md +52 -0
  72. package/skills/oracle-rfq-tokenized-assets/SKILL.md +69 -0
  73. package/skills/oracle-smart-wallet-scanner/SKILL.md +49 -0
  74. package/skills/oracle-solana/SKILL.md +65 -0
  75. package/skills/oracle-solana-nft/SKILL.md +54 -0
  76. package/skills/oracle-token-research/SKILL.md +67 -0
  77. package/src/agent-auth.mjs +191 -0
  78. package/src/approval-guard.mjs +282 -0
  79. package/src/attestation-secret.mjs +88 -0
  80. package/src/audit-log.mjs +196 -0
  81. package/src/auto-slippage.mjs +378 -0
  82. package/src/capability-posture.mjs +125 -0
  83. package/src/chains.mjs +62 -0
  84. package/src/data/catalog.mjs +495 -0
  85. package/src/data/desk-data.mjs +623 -0
  86. package/src/data/http.mjs +200 -0
  87. package/src/data/provider-endpoint.mjs +94 -0
  88. package/src/data/providers/aerodrome.mjs +244 -0
  89. package/src/data/providers/balancer.mjs +208 -0
  90. package/src/data/providers/bitcoin-esplora.mjs +230 -0
  91. package/src/data/providers/bitcoin-meta.mjs +378 -0
  92. package/src/data/providers/blockscout.mjs +14 -0
  93. package/src/data/providers/bridges.mjs +241 -0
  94. package/src/data/providers/cowswap.mjs +501 -0
  95. package/src/data/providers/curve.mjs +200 -0
  96. package/src/data/providers/defillama.mjs +88 -0
  97. package/src/data/providers/dexscreener.mjs +43 -0
  98. package/src/data/providers/evm-rpc.mjs +203 -0
  99. package/src/data/providers/geckoterminal.mjs +34 -0
  100. package/src/data/providers/gmx.mjs +495 -0
  101. package/src/data/providers/hl-info.mjs +102 -0
  102. package/src/data/providers/hl-markets.mjs +210 -0
  103. package/src/data/providers/hl-perps.mjs +382 -0
  104. package/src/data/providers/hl-staking.mjs +352 -0
  105. package/src/data/providers/hl-ws.mjs +119 -0
  106. package/src/data/providers/hyperevm-dex.mjs +49 -0
  107. package/src/data/providers/jupiter.mjs +182 -0
  108. package/src/data/providers/lifi.mjs +150 -0
  109. package/src/data/providers/magiceden-sol.mjs +355 -0
  110. package/src/data/providers/morpho.mjs +173 -0
  111. package/src/data/providers/odos.mjs +155 -0
  112. package/src/data/providers/oneinch.mjs +173 -0
  113. package/src/data/providers/opensea-multichain.mjs +136 -0
  114. package/src/data/providers/opensea-nft.mjs +99 -0
  115. package/src/data/providers/paraswap.mjs +117 -0
  116. package/src/data/providers/pendle.mjs +187 -0
  117. package/src/data/providers/poly-public.mjs +96 -0
  118. package/src/data/providers/poly-ws.mjs +103 -0
  119. package/src/data/providers/rh-agent.mjs +59 -0
  120. package/src/data/providers/satflow.mjs +336 -0
  121. package/src/data/providers/solana-rpc.mjs +186 -0
  122. package/src/data/providers/uniswap-v3.mjs +303 -0
  123. package/src/data/providers/zerox.mjs +166 -0
  124. package/src/data/public-api-scan.mjs +61 -0
  125. package/src/data/quote-placeholder.mjs +31 -0
  126. package/src/exact-integer.mjs +72 -0
  127. package/src/exec-policy.mjs +444 -0
  128. package/src/flags.mjs +15 -0
  129. package/src/fresh-window.mjs +76 -0
  130. package/src/gmx-attestation.mjs +175 -0
  131. package/src/index.mjs +50 -0
  132. package/src/nft-gas-war-guard.mjs +139 -0
  133. package/src/onboarding/agent-keys.mjs +157 -0
  134. package/src/onboarding/index.mjs +18 -0
  135. package/src/onboarding/tiers.mjs +139 -0
  136. package/src/oracle-env.mjs +38 -0
  137. package/src/protocol-execution.mjs +84 -0
  138. package/src/public-api/buzz-integration.mjs +256 -0
  139. package/src/public-api/connect-agent.mjs +397 -0
  140. package/src/public-api/grants.mjs +142 -0
  141. package/src/public-api/http.mjs +374 -0
  142. package/src/public-control/aa-adapter.mjs +402 -0
  143. package/src/public-control/build-registry.mjs +227 -0
  144. package/src/public-control/bundler-client.mjs +372 -0
  145. package/src/public-control/grant-indexer.mjs +296 -0
  146. package/src/public-control/policy-render.mjs +69 -0
  147. package/src/public-control/policy-schema.mjs +318 -0
  148. package/src/public-control/runtime-config.mjs +265 -0
  149. package/src/public-control/session-key-model.mjs +374 -0
  150. package/src/public-control/session-orchestrator.mjs +412 -0
  151. package/src/route-attestation.mjs +132 -0
  152. package/src/router/best-execution.mjs +221 -0
  153. package/src/router/index.mjs +185 -0
  154. package/src/router/prepare-bridge.mjs +288 -0
  155. package/src/router/prepare-route.mjs +341 -0
  156. package/src/router/proposal.mjs +311 -0
  157. package/src/router/risk-classifier.mjs +119 -0
  158. package/src/router/route-sources.mjs +292 -0
  159. package/src/scanner/chains.config.mjs +381 -0
  160. package/src/scanner/contract.mjs +270 -0
  161. package/src/scanner/evm-scanner.mjs +394 -0
  162. package/src/scanner/index.mjs +9 -0
  163. package/src/scanner/v2-venue.mjs +335 -0
  164. package/src/scanner/v3-venue.mjs +290 -0
  165. package/src/scopes.mjs +44 -0
  166. package/src/sell-simulation.mjs +167 -0
  167. package/src/token-transfer-guard.mjs +188 -0
  168. package/src/vault-attestation.mjs +145 -0
  169. package/src/venues.mjs +206 -0
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: oracle-meme-token-sniper
3
+ description: Scan and prepare guarded meme-token launch/sniping trades across configured chains; fail-closed, user-signed, sell-sim first.
4
+ ---
5
+
6
+ # Oracle meme-token sniper
7
+
8
+ Use when a user asks Oracle to find, monitor, or prepare buys for meme tokens,
9
+ new launches, liquidity adds, bonding curves, or "snipe" opportunities on any
10
+ supported chain.
11
+
12
+ ## Scope
13
+
14
+ Oracle may scan every configured venue/chain for meme-token launch signals:
15
+
16
+ - EVM factory/pair/pool creation logs across configured chains.
17
+ - Liquidity additions, first swaps, tax/owner-risk changes, holder distribution.
18
+ - Solana SPL/token-launch feeds and Jupiter-route availability when configured.
19
+ - Chain-specific launchpads/bonding curves only after the venue is verified.
20
+ - Smart-wallet early-entry overlap and repeat deployer history.
21
+
22
+ Unsupported chain/venue means `UNAVAILABLE`, not fake coverage. A chain with no
23
+ verified executable route can still be analyzed, but cannot be prepared for buy.
24
+
25
+ ## Required gate before any prepared buy
26
+
27
+ 1. Resolve exact chain, token mint/contract, pool, quote asset, router/venue.
28
+ 2. Verify token identity from live chain data, not only a ticker/social link.
29
+ 3. Check deployer/owner controls, mint/freeze/blacklist/tax/proxy risks where
30
+ the chain exposes them.
31
+ 4. Confirm liquidity exists and is not only a fake/self pool.
32
+ 5. Run sellability / reverse-route simulation when the chain/venue supports it.
33
+ 6. Quote fresh, net of gas, and bind slippage/deadline to the prepared artifact.
34
+ 7. Enforce user caps: per-trade spend, chain, venue, token, max fee, and TTL.
35
+ 8. Return unsigned/user-signable transaction only. No model-authored calldata
36
+ bypass, no raw user calldata, no backend custody by default.
37
+
38
+ ## Autonomous mode
39
+
40
+ Autonomous meme sniping is allowed only as a capped local-user signer loop:
41
+
42
+ - separate burner/session key, never main wallet
43
+ - explicit user opt-in and scope
44
+ - max spend per token and per day
45
+ - denylist/allowlist support
46
+ - retry ceiling and kill switch
47
+ - first-run paper/shadow mode
48
+ - receipt/balance reconciliation after every fill
49
+
50
+ Default public posture is advisory/prepare-only. "Snipe" in UI copy means fast
51
+ scan + prepared ticket; it does not mean blind broadcast.
52
+
53
+ ## Output contract
54
+
55
+ For every candidate, return:
56
+
57
+ - `chain`, `token`, `pool`, `venue`
58
+ - `signal`: launch/liquidity/smart-wallet/social/etc.
59
+ - `risk`: PASS/WARN/BLOCK/UNKNOWN with evidence
60
+ - `sellability`: PASS/FAIL/UNKNOWN/UNAVAILABLE
61
+ - `route`: quote source and freshness
62
+ - `prepared`: true only if a guarded unsigned artifact exists
63
+ - `whyBlocked` when not prepared
64
+
65
+ ## Pitfalls
66
+
67
+ - Treating ticker match as identity.
68
+ - Buying before sell-sim/reverse-route proof.
69
+ - Using scanner membership as an execution allowlist.
70
+ - Calling a launchpool real when reserves are virtual/stale.
71
+ - Ignoring gas: on small meme trades, gas can dominate edge.
72
+ - Letting "every chain" become "every venue is executable". Coverage must be
73
+ capability-labeled per chain.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: oracle-nft-gacha-launch
3
+ description: Use when designing or preparing NFT collections, mint pages, reveal mechanics, and gacha-style pack/loot drops.
4
+ ---
5
+
6
+ # NFT and gacha launch builder
7
+
8
+ Use this when a user wants to launch an NFT collection, pack opening, loot box,
9
+ claim pass, or randomized reveal product.
10
+
11
+ ## Product shape first
12
+
13
+ State the launch mechanics before code:
14
+
15
+ - asset standard: ERC-721, ERC-1155, Ordinals collection, SPL/NFT, or hybrid
16
+ - supply, per-wallet caps, allowlist/public phases, price, treasury, royalties
17
+ - reveal style: instant, delayed, commit-reveal, VRF-backed, or fully deterministic
18
+ - pack/gacha odds and whether duplicates are possible
19
+ - admin powers: owner, pauser, metadata updater, withdrawer, upgrader
20
+
21
+ ## Safety rails
22
+
23
+ - User signs every deploy/mint/admin transaction; Oracle prepares and simulates.
24
+ - Randomness must be honest. Do not use miner/block timestamp as gacha randomness.
25
+ - Publish odds for gacha/loot mechanics and keep them deterministic/auditable.
26
+ - No hidden mint, owner reroll, metadata rug, or unbounded treasury withdrawal.
27
+ - Per-wallet caps and phase windows are enforced on-chain when material.
28
+ - Marketplaces are secondary: floor price is not a guaranteed bid.
29
+ - Public mint bots enforce gas-war limits across chains: total gas cap, optional
30
+ per-unit fee cap, and optional priority-fee cap before returning unsigned
31
+ mint calldata. Missing caps fail closed.
32
+
33
+ ## Build checklist
34
+
35
+ 1. Choose the boring audited base contract unless novelty is required.
36
+ 2. Write the authority model in plain language.
37
+ 3. Add tests for mint limits, payment/refund, reveal, withdraw, and admin changes.
38
+ 4. Simulate deploy and first mint before returning unsigned transactions.
39
+ 5. Produce metadata schema, asset pipeline, and provenance hash/manifest.
40
+ 6. Prepare marketplace setup only after contract addresses and metadata are stable.
41
+
42
+ ## Gacha-specific checks
43
+
44
+ - Show odds table and expected value in user terms.
45
+ - Cap max spend per wallet/session.
46
+ - Separate entertainment mechanics from investment claims.
47
+ - If jurisdictional gambling risk is plausible, flag it and keep the launch
48
+ non-custodial/transparent rather than pretending it is just an NFT mint.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: oracle-nft-mint-gas-war
3
+ description: Guard public NFT mint bots with chain-wide gas-war caps before any wallet-signed mint transaction is returned.
4
+ ---
5
+
6
+ # Oracle NFT mint gas-war guard
7
+
8
+ Use when a public Oracle lane prepares NFT mint transactions or runs a mint bot
9
+ across configured chains.
10
+
11
+ ## Rule
12
+
13
+ A mint bot may move fast, but it must not bid uncapped gas.
14
+
15
+ Every prepared mint transaction must carry a gas envelope that fits the user's
16
+ explicit grant or bot policy:
17
+
18
+ - `maxTotalGasWei` / grant `maxGasWei`: total gas spend cap (`gasLimit * maxFeePerGas` or `gasLimit * gasPrice`)
19
+ - optional `maxFeePerGasWei`: per-unit fee cap
20
+ - optional `maxPriorityFeePerGasWei`: tip cap for gas wars
21
+ - chain id: required and bound to the prepared transaction
22
+
23
+ Missing caps fail closed. A mint returning calldata without gas caps is not
24
+ public-safe.
25
+
26
+ ## Implementation hook
27
+
28
+ Use `validateNftMintGasWar()` or `assertNftMintGasWar()` from the public package
29
+ before returning a wallet-signable NFT mint transaction.
30
+
31
+ ```js
32
+ import { assertNftMintGasWar } from "oracle-agent";
33
+
34
+ assertNftMintGasWar({
35
+ chainId,
36
+ tx: { gasLimit, maxFeePerGas, maxPriorityFeePerGas },
37
+ policy: {
38
+ grant, // may provide maxGasWei
39
+ maxFeePerGasWei,
40
+ maxPriorityFeePerGasWei,
41
+ },
42
+ });
43
+ ```
44
+
45
+ ## Public behavior
46
+
47
+ - PASS: return the unsigned mint transaction with the gas verdict fields.
48
+ - BLOCK: show the cap breached and ask the user to raise the cap or skip.
49
+ - Never silently widen gas during a gas war.
50
+ - Never treat mint price cap as gas cap; mint value and gas spend are separate.
51
+ - Never backend-sign public mints. User wallet or explicit self-hosted session
52
+ grant signs.
53
+
54
+ ## Verification
55
+
56
+ Run:
57
+
58
+ ```bash
59
+ node --test test/nft-gas-war-guard.test.mjs test/package-surface.test.mjs
60
+ ```
61
+
62
+ Full public release gate still requires `npm test`, package dry-run, and secret
63
+ scan before publishing.
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: oracle-polymarket
3
+ description: Use for Polymarket prediction markets — event pricing, books, and resolution risk via the public CLOB and Gamma APIs.
4
+ ---
5
+
6
+ # Polymarket
7
+
8
+ Read through Oracle's data plane (`poly-public` provider: CLOB + Gamma REST, no
9
+ key). Settles on Polygon (137).
10
+
11
+ ## Ops
12
+
13
+ | Need | Op |
14
+ |---|---|
15
+ | market list | `markets` |
16
+ | events | `events` |
17
+ | order book | `book` |
18
+ | midpoint | `midpoint` |
19
+ | spread | `spread` |
20
+ | last price | `price` |
21
+
22
+ ## A price is not a probability
23
+
24
+ 0.62 means the last trader transacted there — net of fees, liquidity constraints,
25
+ and whoever is hedging an off-platform position. Before treating it as a forecast:
26
+
27
+ - **depth** — 0.62 on $40 of size carries no information
28
+ - **spread** — wide means nobody defends an opinion
29
+ - **time to resolution** — a 3-day market and a 3-month market at the same price
30
+ are not saying the same thing
31
+ - **fee drag** — round-trip costs eat thin edges
32
+
33
+ ## Resolution text is the real risk
34
+
35
+ The most expensive mistake here is not mispricing probability. It is being *right*
36
+ about the world and *wrong* about the resolution criteria.
37
+
38
+ Read the rules before discussing edge. Flag:
39
+
40
+ - ambiguous wording that could settle against the consensus reading
41
+ - who resolves it and on what source
42
+ - what happens on an edge case, a delay, or a cancelled event
43
+ - whether the market can resolve early
44
+
45
+ If the rules could plausibly settle the "obviously right" side as a loss, that is
46
+ the headline, not a footnote.
47
+
48
+ ## Correlated markets
49
+
50
+ Related markets often disagree. A set of outcome prices summing well past 1.00 is
51
+ either a fee/liquidity artifact or a genuine inconsistency. Check the sum before
52
+ calling something mispriced.
53
+
54
+ ## Hard rules
55
+
56
+ 1. Read the resolution criteria before discussing edge.
57
+ 2. Never present a market price as your own forecast without saying which you mean.
58
+ 3. Quote depth alongside price.
59
+ 4. You prepare; the user's wallet signs.
60
+ 5. Receipts or it didn't happen.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: oracle-protocol-builder
3
+ description: Use when the user wants Oracle to act as a builder: scaffold contracts/apps, prepare unsigned deploys, and create launch runbooks.
4
+ ---
5
+
6
+ # Protocol builder
7
+
8
+ Oracle can be a builder, not only a trader/analyzer. The boundary stays the same:
9
+ it writes and prepares; the user signs and deploys.
10
+
11
+ ## Builder modes
12
+
13
+ - scaffold contracts and tests
14
+ - scaffold mint/gacha/claim pages
15
+ - build DEX/pool/router integrations
16
+ - write deploy and verify scripts
17
+ - produce unsigned deploy or admin transactions
18
+ - create launch runbooks and monitoring dashboards
19
+ - audit authority, upgradeability, fees, and emergency controls
20
+
21
+ ## Required order
22
+
23
+ 1. Authority model: owner, admin, upgrader, pauser, treasury, withdrawer.
24
+ 2. Threat model: what can go wrong and who can rug or halt.
25
+ 3. Tests: caps, payments, roles, upgrades, withdrawals, randomness, routing.
26
+ 4. Simulation: deploy, initialize, and first user action.
27
+ 5. Prepare: unsigned artifact only, bound to chain and destination.
28
+ 6. Receipt: deployed address, source verification, event logs, and state readback.
29
+
30
+ ## Refusal line
31
+
32
+ Refuse hidden drains, honeypots, wash-trading systems, undisclosed tax switches,
33
+ fake TVL, or any contract whose main purpose is deceiving buyers.
34
+
35
+ ## Output standard
36
+
37
+ Lead with the authority model and irreversible choices. Then the file plan or
38
+ artifact. End with the exact tests/simulations run and what remains unverified.
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: oracle-protocol-security
3
+ description: Use before preparing any contract deploy or reviewing protocol code. Authority model first, then the vulnerability checklist.
4
+ ---
5
+
6
+ # Protocol security
7
+
8
+ Deploys are permanent. This skill runs **before** code is written, not after.
9
+
10
+ ## Authority model comes first
11
+
12
+ Before reviewing a single line of logic, answer these in plain language:
13
+
14
+ 1. **Who owns it** after deployment — owner, admin, upgrader, pauser, treasury
15
+ 2. **What is upgradeable**, and who can upgrade
16
+ 3. **What is immutable** once live
17
+ 4. **What breaks if the deployer key is lost** — or is stolen
18
+ 5. **What an attacker gains** from each privileged function
19
+
20
+ If a contract mints privileged roles to an address, **name that address** and make
21
+ the user confirm it is the intended one. A deploy that hands ownership to the wrong
22
+ key is unrecoverable.
23
+
24
+ ## Review checklist
25
+
26
+ | Area | What to actually check |
27
+ |---|---|
28
+ | access control | every privileged fn gated; no missing modifier |
29
+ | initialization | can `initialize` be front-run or called twice? |
30
+ | reentrancy | state written *before* external calls |
31
+ | external calls | return values checked; no blind `call` |
32
+ | integer handling | unchecked blocks justified individually |
33
+ | approvals | exact amount, never unlimited by default |
34
+ | upgrade path | storage layout compatible; gap reserved |
35
+ | emergency stop | exists, and someone can actually reach it |
36
+ | oracle use | manipulation cost vs the value it secures |
37
+ | withdrawal | can funds ever be stranded? |
38
+
39
+ ## Prefer boring
40
+
41
+ A fork of an audited contract with a small, reviewed diff beats elegant clean-room
42
+ code. If you propose something novel, justify why the boring option fails.
43
+
44
+ ## Verify, never assume
45
+
46
+ - Explorer contract **names are not verification**. Clones share names.
47
+ - Confirm bytecode exists: `eth_getCode` returning `0x` means nothing is deployed
48
+ there. Codesize 2 is an empty stub.
49
+ - Confirm constructor-bound addresses (factory, WETH, router) match what you
50
+ expect — read them back from the deployed contract.
51
+ - Verify a router or venue from the protocol's **own API or docs**, per chain, and
52
+ record how and when you verified it.
53
+
54
+ ## Deploy discipline
55
+
56
+ Review → simulate → prepare **unsigned** → user signs. Never house-sign. The
57
+ destination allowlist applies to deploy targets like any other destination.
58
+
59
+ Decode constructor arguments and read them back to the user in plain language
60
+ before they sign. "Trust the calldata" is not consent.
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: oracle-public-product
3
+ description: Use for Oracle public product UX/copy: non-custodial, prepare-first, graph/evidence-led, no operator framing.
4
+ ---
5
+
6
+ # Oracle public product
7
+
8
+ Use this when writing Oracle public docs, console copy, landing pages, launch notes,
9
+ or capability-pack language.
10
+
11
+ ## Positioning
12
+
13
+ Oracle is a public multichain crypto agent interface:
14
+
15
+ - trader: quote, route, simulate, prepare, and verify receipts
16
+ - builder: scaffold contracts/apps and prepare unsigned deploy/admin txs
17
+ - analyzer: token, contract, venue, wallet, and market research
18
+ - scanner: chain scanners and smart-wallet boards
19
+ - non-EVM lanes: Solana and Bitcoin/Ordinals where supported
20
+
21
+ The product voice is user-facing. Do not describe internal operator plumbing,
22
+ private wallets, VPS paths, hot-wallet ops, or house execution.
23
+
24
+ ## Custody copy
25
+
26
+ Always state the invariant clearly:
27
+
28
+ - Oracle prepares; the user's wallet signs.
29
+ - Broadcast needs explicit user/grant authority.
30
+ - Prepare is not sign. Sign is not broadcast.
31
+ - Server API keys are scoped agent keys, not wallet keys.
32
+
33
+ ## Forbidden public framing
34
+
35
+ - no autonomous custody promises
36
+ - no hidden operator signer references
37
+ - no guaranteed-profit or floor-guarantee claims
38
+ - no "we execute for you" without the grant/user-wallet boundary
39
+ - no references to private infrastructure, hostnames, paths, or internal agents
40
+
41
+ ## Output standard
42
+
43
+ Lead with what the user can do. Then name the guardrail. Keep it concrete and
44
+ short: capability, boundary, evidence.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: oracle-receipts
3
+ description: Use whenever reporting the outcome of any on-chain action. Enforces that a claim of success carries a hash, a receipt, and a balance delta.
4
+ ---
5
+
6
+ # Receipts or it didn't happen
7
+
8
+ The failure mode this prevents: an agent says "done, swapped 0.5 ETH for USDC" when
9
+ the transaction reverted, was never broadcast, or landed with a different output
10
+ than promised. The user then acts on a false balance.
11
+
12
+ ## The rule
13
+
14
+ A money-moving action is **complete** only when you can show:
15
+
16
+ 1. **transaction hash** — the real one, from the broadcast response
17
+ 2. **receipt status** — `1`. A receipt with status `0` is a *failed* transaction
18
+ that still consumed gas; that is not success
19
+ 3. **balance delta** — the output token balance actually changed, read back after
20
+ the receipt
21
+ 4. **the log** proving the intended event fired (`Swap`, `Transfer` to the right
22
+ recipient, `OrderFilled`)
23
+
24
+ Missing any of the four → report what you have and call it incomplete.
25
+
26
+ ## Language discipline
27
+
28
+ | Don't say | Say |
29
+ |---|---|
30
+ | "swapped" (before receipt) | "prepared" / "broadcast, awaiting receipt" |
31
+ | "done" | "receipt 1, balance +NNN USDC, hash 0x..." |
32
+ | "it should have gone through" | "unknown — no receipt yet" |
33
+ | "approved and swapped" | name each transaction separately |
34
+
35
+ **Preparing is not signing. Signing is not broadcasting. Broadcasting is not
36
+ confirmation.** Four distinct states; never collapse them in a report.
37
+
38
+ ## Multi-step actions
39
+
40
+ An ERC-20 swap is at minimum two transactions: `approve` then the swap. Report each
41
+ separately with its own hash. If the approve landed and the swap reverted, the
42
+ honest report is "allowance set, swap failed" — not "swap failed" (the user now has
43
+ a live allowance they should know about).
44
+
45
+ For a raw-pair or multi-leg route: funding a pool is **not** a buy. Until the swap
46
+ call itself has a receipt, the tokens are sitting somewhere they can be taken.
47
+
48
+ ## When it fails
49
+
50
+ Say what failed, the revert reason if you have it, and what you tried. Never
51
+ substitute a plausible-looking result for one you could not obtain. A reported
52
+ blocker is useful; an invented success is a loss.
@@ -0,0 +1,69 @@
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.
@@ -0,0 +1,49 @@
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.
@@ -0,0 +1,65 @@
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.
@@ -0,0 +1,54 @@
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.