07 / API
Read it without the site.
Every endpoint is public, read-only and rate limited. Nothing here holds a key or signs for anyone. Base URL https://oddva.xyz.
| Method | Path | Returns |
|---|---|---|
| GET | /api/markets | Every market on OddvaPoolHouse: creator, fee, state, outcome, void reason, times, strike, cap, pools, fee, readings, stakers and history from the contract's events, plus heldVsOwed and the scanned block range. ?id=<n> for one market. |
| GET | /api/price | Chain id, head block and time, gas price, the HYPE/USDC v4 pool (price in USDC with 6 decimals, tick, fee, liquidity, sqrtPriceX96) and quoter results for 1, 10, 100 and 1,000 HYPE both ways. Cached 10 s. |
| GET | /api/quote?yes=&no=&fee=&side=&amount=&addYes=&addNo= | Payout preview in wei from the site's math and from OddvaPoolHouse.quote() by eth_call (against the deployed house, or its compiled bytecode before deployment), with agree: true/false. |
| GET | /api/proof | Chain id answered by the RPC, latest block, the house's address and whether its bytecode matches this build, event counts, heldVsOwed, the price source, the token status and the build commit. |
| GET | /api/health | ok + chain id + commit. |
| GET | /api/chain | Block, gas and pool price for the header (a short form of /api/price). |
| POST | /api/rpc | Read-only JSON-RPC relay for this site's pages (eth_call to the house, pool manager, quoter and USDC; receipts; balances; gas estimates). It never sends a transaction. Budgeted per network. |
A keeper script, outside the browser
examples/keeper.mjs in the repository watches the house, records a reading in every open slot that has none, and calls settle() when a market is ready, signing with a key you give it on your own machine. Without --yes it only prints what it would send, with the calldata.
RPC_URL=https://rpc.elysium.kinetiq.xyz HOUSE=0x… KEEPER_KEY=0x… node examples/keeper.mjs # dry run
RPC_URL=https://rpc.elysium.kinetiq.xyz HOUSE=0x… KEEPER_KEY=0x… node examples/keeper.mjs --yes # sends