Skip to content
This repository was archived by the owner on May 16, 2026. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HIP-4 Onboarding Starter

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 l2Book snapshots for outcome coins
  • renders a public market browser
  • does not trade, custody funds, or create markets

Why this exists

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.

Quick start

npm install
npm run check
npm run test:api
npm run dev

Open the local Worker URL from Wrangler.

Deploy

npm run deploy

API

GET /api/hip4/markets

Returns 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 }
      ]
    }
  ]
}

GET /api/hip4/book?coin=#50

Returns normalized l2Book levels for an outcome coin.

HIP-4 encoding

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

What this does not do

  • 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.

License

MIT

About

Tiny starter frontend and API proxy for Hyperliquid HIP-4 outcome-market onboarding

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages