Appearance
Architecture
Four contracts hold the money and the positions. One server prices, signs nothing on your behalf, and relays. The split is drawn so that anything that can be checked on chain is.
The pieces
| Piece | Where | What it does |
|---|---|---|
| Vault | Contract | Holds the USDC and the ledger: balances, stakes held for open positions, the pool, the queue |
| FuseMarket | Contract | Fuses: open, close, settle, each one transaction at one price; points |
| PerpMarket | Contract | Perps: open, close, liquidate; the win charge both products use |
| Params | Contract | Every setting, versioned; a loosening change waits before it applies |
| Recorder | Server | Keeps the Hyperliquid streams open and stores one mid a second |
| Vol engine | Server | Works out the volatility fuses are priced on, once a minute |
| Pricer | Library | The pricing maths, shared by the server, the app, the tests and these docs |
| Operator | Server | Quotes, relays signed orders with the price it read, liquidates perps, settles expiries, pays the queue |
| App | Browser | The ticket, the chart, the positions list |
One trade, end to end
- Quote. The app asks the server for a quote: for a fuse, how long it will last at this leverage and volatility. A quote is valid for 10 seconds.
- Sign. You sign the quote. Nothing has happened on chain yet.
- Price. The server waits for the first Hyperliquid mid at least one second after your click and pairs it with the oracle price.
- Open. The server sends
open(quote, price, signature). The contract checks the signature, the parameter version, the price, the size and the caps. If every check passes, the stake moves from your balance to the held account and the position is open. If any fails, the transaction reverts and nothing is taken. - End. A close (your signed intent), an expiry (the server settles at the first price at or after it) or a liquidation (perps) ends the position in one transaction that also pays it.
There is no pending state. A position is either open at a known price or it does not exist.
The contracts sit behind proxies
All four contracts are behind OpenZeppelin transparent proxies. A change ships as an upgrade: the addresses, positions, balances and parameter history stay. A storage layout guard runs before every upgrade and refuses a new version that moves, retypes or removes a stored variable.
Each proxy's admin is owned by the operator wallet, which is the only key that can upgrade. That is a trust assumption, listed in Risk.
The read model
The server keeps a SQLite copy of what the chain says (positions, balances, the queue) so pages load without reading the chain for every figure. It is rebuilt from chain events and is never the source of truth for money.
Units on chain
| Quantity | Unit |
|---|---|
| Dollar amounts | Integer micro-USDC (1,000,000 = $1) |
| Prices | Fixed point, 8 decimals |
| Fractions and rates | Parts per million |
| Times | Unix seconds |
| Points | Micro-points |
Every payout is worked out in integers and rounded down to the micro-dollar.