On-chain order books for anything.
Spot pairs, perpetuals, and event contracts — matched by a real central limit order book and settled on Somnia. Browse the markets, or build on the SDK.
From order to on-chain fill.
Every trade follows the same four moves — the same lifecycle the book above is playing out.
quote
Post a limit order at your price, or lift the best resting quote. Every order rests in an on-chain central limit order book — no AMM curve, no hidden spread.
match
Price-time priority matches makers and takers deterministically. The best price fills first; ties break by whoever rested earliest.
settle
Fills settle atomically against your balances in the same block. Positions, collateral, and PnL update on-chain instantly — no settlement delay.
resolve
Event contracts lock at expiry and resolve from the Prophecy oracle. Winning shares redeem 1:1 against the backing; the rest expire worthless.
Spot, perps, and event contracts. One book — plus lending.
Three order-book markets on one matching engine — every one a real book, not a pooled AMM — and a money market that puts idle collateral to work.
spot
Trade tokenized assets against USDC on a live book — real depth, real price-time priority, settled on-chain.
perps
Leveraged perpetuals with on-chain funding and a mark-price EMA. Go long or short, cross-margined from one collateral pool.
event contracts
Yes / no contracts on real-world outcomes, settled from the Prophecy oracle. Prices are live probabilities — trade the implied odds right up to expiry.
lend
Put idle collateral to work on SomniaLend, an Aave v3 money market on Somnia. Earn yield between trades or borrow working capital against your assets.
limit order book
Maker / taker matching with price-time priority — the same model as a real exchange, enforced by the contract itself.
on-chain settlement
Every fill, balance, and position lives on Somnia. No custodian, no off-chain matching engine to trust.
unified indexer
Spot, perps, and event contracts stream from one indexer — live over WebSocket, or read straight from chain state.
Trading on Somnia right now.
Straight from the indexer — the same counts the explorer pages read.
// indexer offline · @somnia-chain/markets-sdk: indexer CountFallback failed: connection error
The latest markets to open.
Fresh event contracts, newest first — trade the implied odds before they move.
no live markets yet
As soon as markets open for trading, the newest land here.
One SDK. Every market.
Read spot, perps, and event contracts — live or historical — from a single typed client.
one client, every market
The same SDK reads spot pairs, perps, and event contracts from a single unified indexer — no per-product plumbing.
live or historical
Stream fills and order-book deltas over WebSocket, or read depth, trades, and portfolios straight from on-chain state.
typed end to end
Fully typed market, order, and fill models. No hand-rolled ABIs, no bespoke GraphQL to maintain.
import { SomniaMarkets, SOMNIA_MAINNET_LEND } from "@somnia-chain/markets-sdk"; const { client } = new SomniaMarkets({ indexerUrl, chain, addresses: { lend: SOMNIA_MAINNET_LEND },}); // Every market — spot, perp, event — from one indexer.const markets = await client.listMarkets({ marketType: "SPOT" }); // Live depth for the top pair, straight off the book.const book = await client.getSpotOrderBook(markets[0].poolAddress); // Lending markets (SomniaLend) ride the same client.const reserves = await client.lend.listReserves();Questions about the book.
Open the book.
Browse live markets, or plug the SDK into your app.