Price oracles answer one kind of question: what is this asset worth right now? Most of what markets need to settle is not a price. Who won the match? Did the proposal pass? Was the shipment delivered? Did the index close above a level? The Somnia Oracle exists to answer questions like these onchain, with evidence, in minutes.
It is a standalone protocol on Somnia. Prediction markets are its first consumer, but any contract can submit a question and read the answer, including parametric insurance, conditional escrow and governance triggers.
1. Ask
A question has three parts: the question in natural language, a list of sources, and the expected shape of the answer. Sources can be web pages, JSON APIs or onchain contracts. The answer shape is either a set of discrete labels (up to 64) or numeric intervals, so one answer can bucket a number cleanly. The question is submitted through the OracleEntryPoint contract with a scheduled resolution time.
2. Moderate
Before anyone relies on the question, an LLM committee reviews it and records an advisory accept or reject verdict in the QuestionModerationRegistry. A separate naming agent writes a display name. The point is to catch ambiguous or unresolvable questions early, before any market depends on them.
3. Dispatch
No keeper bot is needed when resolution time comes. The oracle schedules itself using Somnia Reactivity: at the resolution time, the chain wakes the OracleCore contract as part of normal block execution. OracleCore then dispatches Somnia Agents subcommittees to read the listed sources.
Agents read web pages and JSON endpoints. Onchain sources are read directly in the same block, so a contract value and an external value are captured together.
4. Answer
Each agent returns a response and a signed execution receipt showing what it read and how it reached its answer. OracleCore aggregates the responses onchain: a median for numeric questions, a majority vote for discrete ones. It then posts one immutable answer, with per-source receipts and a caliber rating that scores the quality of the question and its sources.
There is no dispute window. Answers are final when posted. The safety valve is void: if a question cannot be answered reliably, the oracle can return a void outcome rather than force a wrong one. On dreamDEX event contracts, a void pays 0.50 per outcome token on each side, while a winning token redeems for 1 USDso (dreamDEX documentation).
How contracts consume an answer
- Pull: call getAnswer(questionId) on the oracle whenever the answer is needed.
- Push: subscribe to the AnswerPosted event with Somnia Reactivity, and a handler contract runs as soon as the answer lands, with no polling.
Markets bind to questions through an allowlisted adapter, so one answer can settle up to 64 independent markets.
How it compares
The Somnia Oracle documentation compares its design with existing oracles:
- Price-feed networks such as Chainlink, Pyth and API3 deliver continuous numeric data. They are not built to resolve arbitrary questions like "who won the game?".
- Optimistic oracles such as UMA accept arbitrary questions, but rely on a bonded dispute period that can take hours or days and fall back to human arbitration.
- The Somnia Oracle handles discrete and numeric questions and resolves in minutes. Aggregation runs in full onchain and sources are user-defined.
These designs complement each other. A derivatives venue on Somnia can use a price feed for marks and the Somnia Oracle for event settlement.
In production
The Somnia Oracle settles dreamDEX event contracts, which are up/down markets on BTC and ETH over 15-minute and 1-hour windows, from a multi-source median. It also resolves every market on Prophecy Social, where markets have been created and resolved without manual intervention since launch (Somnia blog, 4 May 2026). Every question, answer and receipt is public on the Somnia Oracle explorer.