@oracle-agent/oracle 0.12.0 → 0.13.1
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/README.md +31 -4
- package/SETUP.md +5 -2
- package/artifacts/specialist-packs/oracle-full-crypto.json +3 -0
- package/dist/address-book.mjs +2 -2
- package/dist/assets/profiles/_template/SOUL.md +54 -0
- package/dist/assets/profiles/_template/profile.json +22 -0
- package/dist/assets/profiles/bitcoin-agent/SOUL.md +31 -0
- package/dist/assets/profiles/bitcoin-agent/profile.json +32 -0
- package/dist/assets/profiles/hyperliquid-agent/SOUL.md +34 -0
- package/dist/assets/profiles/hyperliquid-agent/profile.json +38 -0
- package/dist/assets/profiles/oracle/SOUL.md +134 -0
- package/dist/assets/profiles/oracle/profile.json +40 -0
- package/dist/assets/profiles/polymarket-agent/SOUL.md +35 -0
- package/dist/assets/profiles/polymarket-agent/profile.json +34 -0
- package/dist/assets/profiles/profile.schema.json +90 -0
- package/dist/assets/profiles/protocol-builder/SOUL.md +57 -0
- package/dist/assets/profiles/protocol-builder/profile.json +39 -0
- package/dist/assets/profiles/robinhood-agent/SOUL.md +53 -0
- package/dist/assets/profiles/robinhood-agent/profile.json +41 -0
- package/dist/assets/profiles/solana-agent/SOUL.md +37 -0
- package/dist/assets/profiles/solana-agent/profile.json +38 -0
- package/dist/assets/profiles/stable-agent/SOUL.md +43 -0
- package/dist/assets/profiles/stable-agent/profile.json +38 -0
- package/dist/assets/skills/balance/SKILL.md +176 -0
- package/dist/assets/skills/bitcoin-l1.md +33 -0
- package/dist/assets/skills/chain-defi-ecosystem-profiling.md +27 -0
- package/dist/assets/skills/evm-contract-research.md +27 -0
- package/dist/assets/skills/hyperliquid.md +26 -0
- package/dist/assets/skills/multichain-exec-desk.md +33 -0
- package/dist/assets/skills/oracle-action-semantics/SKILL.md +40 -0
- package/dist/assets/skills/oracle-best-execution/SKILL.md +127 -0
- package/dist/assets/skills/oracle-best-execution.md +27 -0
- package/dist/assets/skills/oracle-bitcoin/SKILL.md +53 -0
- package/dist/assets/skills/oracle-chain-graphs-telegram-cards/SKILL.md +59 -0
- package/dist/assets/skills/oracle-chat/SKILL.md +61 -0
- package/dist/assets/skills/oracle-chat/chain.SKILL.md +31 -0
- package/dist/assets/skills/oracle-chat/setup.SKILL.md +37 -0
- package/dist/assets/skills/oracle-circuit-breaker/SKILL.md +51 -0
- package/dist/assets/skills/oracle-contract-research/SKILL.md +55 -0
- package/dist/assets/skills/oracle-desk/SKILL.md +58 -0
- package/dist/assets/skills/oracle-desk.md +27 -0
- package/dist/assets/skills/oracle-dex-launch/SKILL.md +38 -0
- package/dist/assets/skills/oracle-equities/SKILL.md +62 -0
- package/dist/assets/skills/oracle-grants/SKILL.md +69 -0
- package/dist/assets/skills/oracle-hypercore-staking/SKILL.md +57 -0
- package/dist/assets/skills/oracle-hyperliquid/SKILL.md +56 -0
- package/dist/assets/skills/oracle-meme-token-sniper/SKILL.md +73 -0
- package/dist/assets/skills/oracle-multichain-nft-launch/SKILL.md +338 -0
- package/dist/assets/skills/oracle-multichain-token-launch/SKILL.md +300 -0
- package/dist/assets/skills/oracle-nft-gacha-launch/SKILL.md +48 -0
- package/dist/assets/skills/oracle-nft-mint-gas-war/SKILL.md +63 -0
- package/dist/assets/skills/oracle-polymarket/SKILL.md +60 -0
- package/dist/assets/skills/oracle-protocol-builder/SKILL.md +59 -0
- package/dist/assets/skills/oracle-protocol-security/SKILL.md +60 -0
- package/dist/assets/skills/oracle-public-product/SKILL.md +44 -0
- package/dist/assets/skills/oracle-receipts/SKILL.md +52 -0
- package/dist/assets/skills/oracle-receipts.md +29 -0
- package/dist/assets/skills/oracle-rfq-tokenized-assets/SKILL.md +69 -0
- package/dist/assets/skills/oracle-smart-wallet-scanner/SKILL.md +49 -0
- package/dist/assets/skills/oracle-solana/SKILL.md +65 -0
- package/dist/assets/skills/oracle-solana-nft/SKILL.md +54 -0
- package/dist/assets/skills/oracle-token-research/SKILL.md +67 -0
- package/dist/assets/skills/solana.md +22 -0
- package/dist/bin/desk-server.mjs +56 -11
- package/dist/bin/oracle-data-mcp.mjs +6 -6
- package/dist/bin/oracle-equities.mjs +20 -0
- package/dist/bin/oracle-init.mjs +19 -19
- package/dist/bin/oracle-public-server.mjs +4 -4
- package/dist/bin/oracle-route.mjs +13 -13
- package/dist/bin/oracle-scan.mjs +10 -10
- package/dist/bin/oracle.mjs +35 -27
- package/dist/cli/commands/auth.mjs +11 -11
- package/dist/cli/commands/bootstrap.mjs +6 -6
- package/dist/cli/commands/chain.mjs +12 -12
- package/dist/cli/commands/chat.mjs +39 -29
- package/dist/cli/commands/data-mcp.mjs +2 -2
- package/dist/cli/commands/data.mjs +5 -5
- package/dist/cli/commands/doctor.mjs +3 -3
- package/dist/cli/commands/equities.mjs +15 -0
- package/dist/cli/commands/farm.mjs +59 -0
- package/dist/cli/commands/follow.mjs +28 -0
- package/dist/cli/commands/gate.mjs +4 -4
- package/dist/cli/commands/harness.mjs +15 -0
- package/dist/cli/commands/init.mjs +3 -3
- package/dist/cli/commands/mcp.mjs +50 -23
- package/dist/cli/commands/model.mjs +44 -34
- package/dist/cli/commands/plugins.mjs +38 -0
- package/dist/cli/commands/prepare.mjs +2 -2
- package/dist/cli/commands/public.mjs +3 -3
- package/dist/cli/commands/resolve.mjs +23 -0
- package/dist/cli/commands/route.mjs +2 -2
- package/dist/cli/commands/scan.mjs +2 -2
- package/dist/cli/commands/setup.mjs +12 -12
- package/dist/cli/commands/sign.mjs +19 -2
- package/dist/cli/commands/swap.mjs +36 -0
- package/dist/cli/commands/upgrade.mjs +2 -2
- package/dist/cli/commands/version.mjs +2 -2
- package/dist/data/desk-data.mjs +53 -10
- package/dist/data/names.mjs +2 -0
- package/dist/data/providers/farming.mjs +2 -0
- package/dist/equities/index.mjs +1 -0
- package/dist/index.mjs +58 -15
- package/dist/public-api/agent-grants.mjs +3 -0
- package/dist/router/index.mjs +2 -2
- package/dist/scanner/index.mjs +3 -3
- package/package.json +8 -3
- package/public/oracle-splash/_variants/ice.html +2073 -0
- package/public/oracle-splash/_variants/ivory.html +2075 -0
- package/public/oracle-splash/assets/agents/claude.png +0 -0
- package/public/oracle-splash/assets/agents/codex.png +0 -0
- package/public/oracle-splash/assets/desktop-app.jpg +0 -0
- package/public/oracle-splash/assets/hero/cli-session-poster.jpg +0 -0
- package/public/oracle-splash/assets/hero/cli-session.mp4 +0 -0
- package/public/oracle-splash/assets/hero/cli-session.webm +0 -0
- package/public/oracle-splash/assets/hero/orb-poster.jpg +0 -0
- package/public/oracle-splash/assets/hero/orb.webm +0 -0
- package/public/oracle-splash/assets/hero/risk-session-poster.jpg +0 -0
- package/public/oracle-splash/assets/hero/risk-session.mp4 +0 -0
- package/public/oracle-splash/assets/hero/risk-session.webm +0 -0
- package/public/oracle-splash/assets/hero/route-session-poster.jpg +0 -0
- package/public/oracle-splash/assets/hero/route-session.mp4 +0 -0
- package/public/oracle-splash/assets/hero/route-session.webm +0 -0
- package/public/oracle-splash/downloads/index.html +241 -0
- package/public/oracle-splash/index.html +1211 -242
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oracle-desk
|
|
3
|
+
description: Use when routing a crypto request to the right lane or comparing options across chains. The router's operating manual.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Routing the desk
|
|
7
|
+
|
|
8
|
+
## Decide the lane before doing the work
|
|
9
|
+
|
|
10
|
+
Every crypto request gets a routing decision first:
|
|
11
|
+
|
|
12
|
+
1. **Which chain?** If the request names a token but not a chain, resolve the
|
|
13
|
+
token's home chain (DexScreener search via the data plane). Do not guess.
|
|
14
|
+
2. **Which lane owns it?** Venue lanes own their venue. Cross-chain comparison is
|
|
15
|
+
yours.
|
|
16
|
+
3. **Is it multi-chain?** Then quote each option yourself and synthesize. Do not
|
|
17
|
+
ask one venue lane to opine on another's chain.
|
|
18
|
+
4. **Still ambiguous?** Ask. A wrong chain assumption produces confidently wrong
|
|
19
|
+
numbers.
|
|
20
|
+
|
|
21
|
+
## Comparing chains honestly
|
|
22
|
+
|
|
23
|
+
When asked "which is cheaper" or "where should this go," the comparison must be
|
|
24
|
+
like-for-like:
|
|
25
|
+
|
|
26
|
+
- quote the **same notional** on each chain, not the same token amount
|
|
27
|
+
- include **gas in the same unit** (USD), because 0.001 ETH means different things
|
|
28
|
+
on mainnet and an L2
|
|
29
|
+
- include **bridge cost and time** if the funds aren't already there
|
|
30
|
+
- include **price impact at that size**, not the headline mid
|
|
31
|
+
- note **liquidity depth** — the cheapest venue at $100 is often not cheapest at
|
|
32
|
+
$50k
|
|
33
|
+
|
|
34
|
+
A comparison that ignores bridging or impact is a wrong answer dressed as a table.
|
|
35
|
+
|
|
36
|
+
## Capability tiers are not interchangeable
|
|
37
|
+
|
|
38
|
+
The data catalog labels each provider honestly. Respect the label:
|
|
39
|
+
|
|
40
|
+
| Tier | Means |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `read-only` | data only, no execution claim whatsoever |
|
|
43
|
+
| `quote-only` | can price a route; no reviewed transaction builder |
|
|
44
|
+
| `prepare` | returns a policy-bound unsigned transaction |
|
|
45
|
+
| `intent` | returns a typed-data order to sign, not a transaction |
|
|
46
|
+
|
|
47
|
+
**API coverage ≠ execution support ≠ live trading support.** When asked "can we
|
|
48
|
+
trade X," answer with the tier, not yes/no.
|
|
49
|
+
|
|
50
|
+
## Don't invent chain facts
|
|
51
|
+
|
|
52
|
+
If a number did not come from a live read this turn, it is `unknown`. Not "roughly,"
|
|
53
|
+
not "typically." Stale liquidity and stale gas are how people get filled badly.
|
|
54
|
+
|
|
55
|
+
## Synthesis
|
|
56
|
+
|
|
57
|
+
Lead with the recommendation and the number. Then the two or three facts that drove
|
|
58
|
+
it. Then the risk that would change the answer. State confidence explicitly.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oracle-desk
|
|
3
|
+
description: Use when routing a crypto request to the right lane or comparing options across chains.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Oracle desk routing
|
|
7
|
+
|
|
8
|
+
1. **Which chain?** Resolve via DexScreener or user input. Never guess.
|
|
9
|
+
2. **Which lane?** RH 4663 = oracle owns it. Other EVM = mad_exec/mad_data. Solana = Jupiter.
|
|
10
|
+
3. **Multi-chain?** Quote each option, synthesize. Same notional, include gas in USD, include bridge cost.
|
|
11
|
+
4. **Ambiguous?** Ask.
|
|
12
|
+
|
|
13
|
+
## Comparison rules
|
|
14
|
+
- Same notional on each chain
|
|
15
|
+
- Gas in USD (not native units)
|
|
16
|
+
- Include bridge cost + time if cross-chain
|
|
17
|
+
- Include price impact at request size
|
|
18
|
+
- Note liquidity depth — cheapest at $100 may not be cheapest at $50k
|
|
19
|
+
|
|
20
|
+
## Capability tiers
|
|
21
|
+
- `read-only` — data only
|
|
22
|
+
- `quote-only` — can price a route
|
|
23
|
+
- `prepare` — returns unsigned tx
|
|
24
|
+
- `intent` — typed-data order to sign
|
|
25
|
+
|
|
26
|
+
## Confidence
|
|
27
|
+
State explicitly: high / moderate / low / unknown. Never invent chain facts.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oracle-dex-launch
|
|
3
|
+
description: Use when designing, reviewing, or preparing a DEX, AMM pool, router/factory fork, token launch, or liquidity bootstrap.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DEX / AMM launch builder
|
|
7
|
+
|
|
8
|
+
Use this for launching or auditing token markets, DEX forks, pools, routing surfaces,
|
|
9
|
+
liquidity bootstraps, and trading UIs.
|
|
10
|
+
|
|
11
|
+
## Decide the AMM shape
|
|
12
|
+
|
|
13
|
+
- V2 constant-product pair: factory, router, WETH/wrapped native, fee, LP token.
|
|
14
|
+
- V3 concentrated liquidity: factory, position manager, quoter, router, fee tiers.
|
|
15
|
+
- Stable-swap / Curve-like: pool invariant, amplification, coins, router.
|
|
16
|
+
- Aggregator frontend: quote source, destination allowlist, minOut/deadline guard.
|
|
17
|
+
|
|
18
|
+
Do not bend one adapter to fit another shape. V2, V3, stable-swap, and aggregator
|
|
19
|
+
routes need separate encoders and tests.
|
|
20
|
+
|
|
21
|
+
## Launch checklist
|
|
22
|
+
|
|
23
|
+
1. Verify canonical factory/router/quoter addresses from official sources and live
|
|
24
|
+
functional probes, not names or codesize alone.
|
|
25
|
+
2. Define initial liquidity, starting price, lock/burn policy, and treasury role.
|
|
26
|
+
3. Simulate buy and sell, including exact approval path and round-trip retention.
|
|
27
|
+
4. Enforce nonzero minOut, short deadlines, route attestation, and gas caps.
|
|
28
|
+
5. Record per-chain provenance next to any allowlisted venue address.
|
|
29
|
+
6. Publish honest risk labels: `LIVE`, `UNKNOWN`, `UNAVAILABLE`, or `FAIL`.
|
|
30
|
+
|
|
31
|
+
## Hard rules
|
|
32
|
+
|
|
33
|
+
- No fake TVL, wash-volume instructions, hidden tax switches, or owner-only sell
|
|
34
|
+
bypasses.
|
|
35
|
+
- A successful buy quote does not prove sellability. Test exits first.
|
|
36
|
+
- A router on one chain is not verified on another chain.
|
|
37
|
+
- Preparing a pool deploy is not live support; live support needs simulation,
|
|
38
|
+
allowlist, signer-bound policy, receipt verification, and docs.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oracle-equities
|
|
3
|
+
description: Use when comparing on-chain equity venues (HIP-3, Arcus, RH Uniswap, Solana xStocks, TON). Cross-chain best execution for tokenized equities, prepare-only.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Crossbook (on-chain equities best execution)
|
|
7
|
+
|
|
8
|
+
On-chain equities are not one venue. HIP-3 builder DEXes discover price, Arcus/RH list spot and perps on Robinhood Chain 4663, Solana xStocks and TON ston.fi list tokenized spots. Rank **net of known costs**, never the loudest mid.
|
|
9
|
+
|
|
10
|
+
## Get the comparison
|
|
11
|
+
|
|
12
|
+
MCP (data plane, in-process, no desk required):
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
equity_venues
|
|
16
|
+
equity_quote { ticker, sizeUsd?, horizonHours? }
|
|
17
|
+
equity_prepare { ticker, recipient, sizeUsd? }
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
CLI:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
oracle equities venues
|
|
24
|
+
oracle equities quote NVDA --size 1000
|
|
25
|
+
oracle equities quote SPY --size 500 --json
|
|
26
|
+
oracle equities prepare NVDA --recipient 0xYourWallet
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Library:
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import { bestEquityRoute, equityVenues, prepareEquityRoute } from "@oracle-agent/oracle/equities";
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Read the result properly
|
|
36
|
+
|
|
37
|
+
- **`rankedOn`** — `net-of-cost` only when fees/gas/impact are known. Usually `gross` today because HIP-3 fees/gas and DexScreener floats are unmeasured. Say so.
|
|
38
|
+
- **`costAccounted`** per route — `false` means that route is flattered by missing costs.
|
|
39
|
+
- **`improvementBps`** — `null` when no honest same-class costed pair exists. Do not invent one.
|
|
40
|
+
- **`bestPreparable`** is independent of `winner`. A quote-only HIP-3 or Solana mid can win discovery without being actionable here.
|
|
41
|
+
- **`excluded[]`** is not `failed[]`. Dormant HIP-3 dexs and crossed Arcus books land in excluded with reasons.
|
|
42
|
+
- **`darkWindow`** — outside NYSE core hours, marks are not real price discovery. Surface it.
|
|
43
|
+
|
|
44
|
+
## Tiers
|
|
45
|
+
|
|
46
|
+
| Venue | Tier | Can prepare? |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| hyperliquid_hip3 | quote-only | no |
|
|
49
|
+
| arcus_perp / arcus_spot | quote-only | no |
|
|
50
|
+
| solana_xstocks | quote-only | no |
|
|
51
|
+
| ton_stonfi | quote-only | no |
|
|
52
|
+
| rh_uniswap | prepare | yes, unsigned only |
|
|
53
|
+
|
|
54
|
+
v1 only prepares RH Uniswap on chain 4663. Everything else is discovery and carry comparison.
|
|
55
|
+
|
|
56
|
+
## Rules
|
|
57
|
+
|
|
58
|
+
- Never present a quote-only winner as something the user can sign here.
|
|
59
|
+
- Never treat unknown gas/fees as zero.
|
|
60
|
+
- Horizon mode compares spot vs perp with funding carry held constant and labeled as an estimate.
|
|
61
|
+
- Prepare requires the real wallet as `recipient`. Placeholders are rejected by the RH prepare path when applicable.
|
|
62
|
+
- A comparison is not an execution. Preparing is separate. Signing is the user's wallet.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oracle-grants
|
|
3
|
+
description: Use when arming, widening, or refusing an agent action against a bound grant. Defines what authorization means on this desk.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Bound grants
|
|
7
|
+
|
|
8
|
+
The model proposes. The owner authorizes. A grant is the authorization.
|
|
9
|
+
|
|
10
|
+
## What a grant is
|
|
11
|
+
|
|
12
|
+
An owner-signed permission with hard bounds:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
chain which chain id, exactly one
|
|
16
|
+
actions read:chain | simulate:tx | prepare:* — never "broadcast:*"
|
|
17
|
+
targets destination allowlist: the addresses value may reach
|
|
18
|
+
maxValueWei spend cap
|
|
19
|
+
maxGasWei gas cap — gas is separate money
|
|
20
|
+
expiresAt unix timestamp; after this the grant is dead
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Your reasoning is not authorization. A convincing argument that an action is safe
|
|
24
|
+
does not widen a grant.
|
|
25
|
+
|
|
26
|
+
## Refusing correctly
|
|
27
|
+
|
|
28
|
+
When an action falls outside the grant, refuse and **name the bound that broke**:
|
|
29
|
+
|
|
30
|
+
> Refused. Grant covers chain 8453; this route settles on 42161.
|
|
31
|
+
|
|
32
|
+
> Refused. Destination 0xabc… is not in the allowlist for chain 8453.
|
|
33
|
+
|
|
34
|
+
> Refused. Grant expired 14 minutes ago.
|
|
35
|
+
|
|
36
|
+
A vague "I can't do that" teaches the user nothing. A specific refusal tells them
|
|
37
|
+
exactly what to change if they still want it.
|
|
38
|
+
|
|
39
|
+
## Fail closed, always
|
|
40
|
+
|
|
41
|
+
An **empty** destination allowlist means *refuse everything*. It never means
|
|
42
|
+
"nothing specified, so allow anything." This inverts under pressure — a partially
|
|
43
|
+
configured chain looks like an unconfigured one. Fail closed.
|
|
44
|
+
|
|
45
|
+
## Gas is separate money
|
|
46
|
+
|
|
47
|
+
A grant that caps `value` but not gas is not capped. Unbounded gas limit or fee
|
|
48
|
+
drains the wallet outside the value ceiling. Both caps or neither is meaningful.
|
|
49
|
+
|
|
50
|
+
## The caps are not negotiable mid-task
|
|
51
|
+
|
|
52
|
+
If a route needs more slippage than the cap allows, the answer is block, requote,
|
|
53
|
+
or split — **not** widen. A cap that yields under pressure is decoration.
|
|
54
|
+
|
|
55
|
+
Likewise a hard ceiling stays hard: a caller-supplied tolerance is a *maximum*, not
|
|
56
|
+
the selected value.
|
|
57
|
+
|
|
58
|
+
## Authorization expires
|
|
59
|
+
|
|
60
|
+
Prefer short TTLs. A permanent broad grant is a hot wallet with extra steps. When a
|
|
61
|
+
grant lapses, the lane returns to reading — that is the system working, not a
|
|
62
|
+
regression to route around.
|
|
63
|
+
|
|
64
|
+
## Re-check at the boundary
|
|
65
|
+
|
|
66
|
+
Validate the grant at **sign time and broadcast time**, not only when the plan was
|
|
67
|
+
made. State can change between planning and execution: a stale check is not a
|
|
68
|
+
check. Reject a guard that is missing, stale, wrong-chain, wrong-venue, or
|
|
69
|
+
over-cap.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oracle-hypercore-staking
|
|
3
|
+
description: Stake, delegate, undelegate, and unstake HYPE on Hyperliquid HyperCore. Prepare-only, user wallet signs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# HyperCore HYPE staking
|
|
7
|
+
|
|
8
|
+
Use when someone asks Oracle to stake HYPE, delegate to a validator, undelegate,
|
|
9
|
+
or unstake back to spot on Hyperliquid.
|
|
10
|
+
|
|
11
|
+
## The four moves, in order
|
|
12
|
+
|
|
13
|
+
HyperCore keeps staking in two buckets. Know which one holds the HYPE before
|
|
14
|
+
preparing anything.
|
|
15
|
+
|
|
16
|
+
| Move | Action | From -> To | Timing |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| Stake | `cDeposit` | spot -> staking balance | instant |
|
|
19
|
+
| Delegate | `tokenDelegate` isUndelegate=false | staking balance -> validator | 1 day validator lockup |
|
|
20
|
+
| Undelegate | `tokenDelegate` isUndelegate=true | validator -> staking balance | instant after lockup |
|
|
21
|
+
| Unstake | `cWithdraw` | staking balance -> spot | 7 day queue |
|
|
22
|
+
|
|
23
|
+
Staking balance earns nothing until it is delegated. "Unstake" almost always
|
|
24
|
+
means two steps: undelegate first, then withdraw.
|
|
25
|
+
|
|
26
|
+
## Flow
|
|
27
|
+
|
|
28
|
+
1. `desk.hl.staking.preflight(user)` - read delegated, undelegated, and pending
|
|
29
|
+
withdrawal balances plus the queue and lockup constants.
|
|
30
|
+
2. `desk.hl.staking.validators()` - pick a validator. Reject jailed ones and
|
|
31
|
+
surface commission before recommending.
|
|
32
|
+
3. Prepare exactly one move:
|
|
33
|
+
- `desk.hl.staking.prepareStake({ amountHype, maxHype })`
|
|
34
|
+
- `desk.hl.staking.prepareDelegate({ validator, amountHype, isUndelegate })`
|
|
35
|
+
- `desk.hl.staking.prepareUnstake({ amountHype })`
|
|
36
|
+
4. Hand back the EIP-712 typed data. The user's wallet signs and submits.
|
|
37
|
+
|
|
38
|
+
## Rules
|
|
39
|
+
|
|
40
|
+
- Amounts are decimal HYPE strings at 8 decimals. `hypeToWei("1.5")` is
|
|
41
|
+
`150000000`. More than 8 decimals is rejected, not rounded.
|
|
42
|
+
- `maxHype` is a hard cap checked before anything is built. No cap, no size
|
|
43
|
+
discipline on an agent path.
|
|
44
|
+
- Never claim a stake happened. These functions return `broadcastReady: false`
|
|
45
|
+
and `requiresUserSignature: true`. There is no submit function in the module
|
|
46
|
+
on purpose.
|
|
47
|
+
- Warn about the 7 day unstaking queue every time you prepare a `cWithdraw`.
|
|
48
|
+
The HYPE is illiquid for the whole queue.
|
|
49
|
+
- Warn about the 1 day validator lockup before a delegate.
|
|
50
|
+
- Check `undelegated` balance before preparing a withdraw. Withdrawing more than
|
|
51
|
+
the undelegated bucket fails on chain, and the failure costs the user a round
|
|
52
|
+
trip.
|
|
53
|
+
|
|
54
|
+
## Verification
|
|
55
|
+
|
|
56
|
+
`npm run e2e:hypercore-staking` hits live validator/delegator reads and asserts
|
|
57
|
+
every prepare path stays unsigned with caps enforced.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oracle-hyperliquid
|
|
3
|
+
description: Use for Hyperliquid perps and spot — funding, books, positions, liquidation distance via the public info API.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hyperliquid
|
|
7
|
+
|
|
8
|
+
Read through Oracle's data plane (`hl-info` provider, public `/info` endpoint). No
|
|
9
|
+
key required for reads.
|
|
10
|
+
|
|
11
|
+
## Ops worth knowing
|
|
12
|
+
|
|
13
|
+
| Need | Op |
|
|
14
|
+
|---|---|
|
|
15
|
+
| all mids | `allMids` |
|
|
16
|
+
| order book | `l2Book` |
|
|
17
|
+
| perp metadata + live ctx | `metaAndAssetCtxs` |
|
|
18
|
+
| spot metadata | `spotMeta` |
|
|
19
|
+
| account state | `clearinghouse` / `userState` |
|
|
20
|
+
| fills | `userFills` |
|
|
21
|
+
| open orders | `openOrders` / `frontendOpenOrders` |
|
|
22
|
+
| candles | `candleSnapshot` |
|
|
23
|
+
|
|
24
|
+
`metaAndAssetCtxs` is the efficient one: it returns funding, open interest, mark and
|
|
25
|
+
oracle price for every asset in a single call. Prefer it over per-asset loops.
|
|
26
|
+
|
|
27
|
+
## The three numbers that matter
|
|
28
|
+
|
|
29
|
+
**Liquidation distance.** In percent. Always state it for a leveraged position. A
|
|
30
|
+
"20x position" is really "a 5% adverse move ends this."
|
|
31
|
+
|
|
32
|
+
**Funding.** Annualize it. A position paying 40% annualized is losing steadily even
|
|
33
|
+
when directionally right. Funding flips sign — check the current rate, not the
|
|
34
|
+
average.
|
|
35
|
+
|
|
36
|
+
**Depth at your size.** The mid is a fiction for anything but the smallest clip.
|
|
37
|
+
Walk the `l2Book` to your notional and quote the real average fill.
|
|
38
|
+
|
|
39
|
+
## Mark vs oracle price
|
|
40
|
+
|
|
41
|
+
Liquidations reference the **oracle** price; PnL references the **mark**. They
|
|
42
|
+
diverge during volatility, which is exactly when it matters. Say which one you used.
|
|
43
|
+
|
|
44
|
+
## Spot and perps are different assets
|
|
45
|
+
|
|
46
|
+
The same ticker exists in both with different liquidity and no automatic
|
|
47
|
+
relationship. Never quote a perp book for a spot question.
|
|
48
|
+
|
|
49
|
+
## Hard rules
|
|
50
|
+
|
|
51
|
+
1. State liquidation distance for every leveraged position — not optional.
|
|
52
|
+
2. Annualize funding, always.
|
|
53
|
+
3. Quote fills from book depth, not the mid.
|
|
54
|
+
4. Never size to "max leverage" without naming the wipeout move.
|
|
55
|
+
5. You prepare; the user's wallet signs.
|
|
56
|
+
6. Receipts or it didn't happen.
|
|
@@ -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.
|