A tiny Cloudflare Worker + static frontend for onboarding users into Hyperliquid HIP-4 outcome markets.
It is intentionally simple:
- discovers live HIP-4 markets via
outcomeMeta - computes outcome side encodings (
#50,#51, asset IDs, etc.) - fetches live
l2Booksnapshots for outcome coins - renders a public market browser
- does not trade, custody funds, or create markets
HIP-4 is real and usable for existing Hyperliquid outcome markets. This starter helps teams get users oriented immediately while keeping trading/accounting separate until it is proven.
npm install
npm run check
npm run test:api
npm run devOpen the local Worker URL from Wrangler.
npm run deployReturns normalized outcomeMeta:
{
"ok": true,
"outcomes": [
{
"outcome": 5,
"description": "class:priceBinary|underlying:BTC|expiry:20260508-0600|targetPrice:81041|period:1d",
"sides": [
{ "side": 0, "spotCoin": "#50", "assetId": 100000050 },
{ "side": 1, "spotCoin": "#51", "assetId": 100000051 }
]
}
]
}Returns normalized l2Book levels for an outcome coin.
For outcome outcome and side side:
encoding = 10 * outcome + side
spot coin = #<encoding>
token name = +<encoding>
asset ID = 100000000 + encoding
Example:
outcome 5, side 0 → #50 / +50 / asset ID 100000050
outcome 5, side 1 → #51 / +51 / asset ID 100000051
- no private keys
- no exchange signing
- no order placement
- no arbitrary HIP-4 market creation
- no token collateral integration
Use it as an onboarding/intelligence surface first. Add trading only after wallet, risk limits, and accounting are explicit.
MIT