Insights
Research and perspectives on onchain markets
Explainers, research, frequently asked questions and news from Somnia on market structure, oracles, agents and the infrastructure underneath them.
What is Somnia?
Somnia is the market infrastructure for onchain finance, an EVM-compatible Layer 1 network and a set of open protocols (Somnia Markets, the Somnia Oracle, Somnia Agents, Reactivity, USDso and Somnia Lend) for building financial markets that run entirely onchain, with services from the Somnia team to help clients design, launch and grow them.
Introduction in the docsWhat is Somnia Markets?
Somnia Markets is the shared market layer: an onchain central limit order book and matching engine, implemented as smart contracts, that supports spot, perpetual and event markets. Venues such as dreamDEX are built on it and share its books and liquidity.
Somnia Markets in the docsIs Somnia EVM-compatible?
Yes. Somnia runs standard EVM bytecode, so Solidity contracts, wallets and tools such as Foundry, Hardhat, viem and ethers work unchanged. Mainnet chain ID is 5031.
Network info in the docsHow fast is Somnia?
Somnia has demonstrated over 1 million transactions per second, produces a block every 100 ms and reaches finality in under 500 ms on mainnet.
Somnia Global L1 in the docsWho secures the network?
A proof-of-stake validator set that includes Google Cloud. Every validator also runs Cuthbert, an independent shadow implementation that halts the node on any divergence. The L1 and its consensus were audited by Hacken.
Network security in the docsCan institutions custody assets on Somnia?
Yes. BitGo, Fireblocks and Ledger support Somnia, including the SOMI token. Trading on Somnia Markets is self-custodial: assets stay in user-controlled accounts until settlement.
Is there a protocol fee on Somnia Markets?
No. Somnia Markets charges no protocol fee; participants pay gas only. Venues built on Somnia Markets set their own fees, and dreamDEX currently charges zero maker and taker fees.
Fees in the docsDo my users need to hold SOMI?
Today, yes. Native gas sponsorship, coming soon, lets a venue or wallet cover its users' gas, so they trade without first acquiring SOMI. Session keys remove the prompts in between.
Gas sponsorship in the docsWhy does the same call sometimes cost more gas?
Somnia prices state access by its real latency. Reading a value no transaction has touched recently costs 1,000,000 gas, while recently accessed state carries no extra charge. Busy contracts, like an active order book, are usually cached.
Gas differences to Ethereum in the docsCan the gas price rise?
Only under sustained congestion. Validators vote the base price up when execution falls behind and straight back to the 6 gwei floor when it catches up. It can never exceed 100,000 gwei.
Congestion pricing in the docsHow do I get a sustained-use discount?
There is nothing to enable or claim. Accounts that use enough gas over a rolling window of about 80 minutes are discounted automatically from the next epoch. The discount appears in each receipt's effective gas price.
Sustained-use discounts in the docsWhat do Somnia Agents and LLM Inference cost?
Each request carries a small deposit that pays the validators who run it, priced per validator by agent type. Unspent deposit is refunded. Gas for the transaction is charged as normal.
Agent pricing in the docsIs a venue a separate blockchain or exchange I have to run?
No. A venue is a branded front door onto Somnia's shared order books. Matching, settlement and oracles run as smart contracts, and traders keep their own assets. There is no engine, sequencer or database for you to operate.
Venues in the docsHow does my venue earn money?
You set a venue fee on the activity your users bring. Every Somnia protocol lets builders add their own fee, and the venue fee is paid to your address in the same transaction as the trade. Somnia charges no protocol fee and takes no share.
Fees in the docsDo I need to bring my own liquidity?
No. Venues share the same books, so a new venue opens onto existing liquidity. For new markets you can bring your own market makers or use Somnia's market-making service. Shared Liquidity Vaults are coming soon.
Venues in the docsCan Somnia build and launch the venue for me?
Yes. With Managed Venues, the Somnia team designs, builds and launches a venue for any asset class under your brand, and supports you after launch with whatever you need. Market making from the Somnia team is available on request.
Can I restrict who trades on my venue?
Yes. A venue can be open to everyone or limited to an allow-list, for example for a regulated or invitation-only venue. The rules are set onchain and are visible to anyone.
Venues in the docsWhat do I need to start?
A wallet and the Somnia Markets SDK. You register the venue, set its fee and choose who can trade with the SDK, testing on the Global testnet first. The Venue Kit, with a front-end template and a single CLI flow from testnet to mainnet, is coming soon.
Launching a venue in the docsDoes Somnia take a fee on trades?
No. Somnia Markets charges no protocol fee. Traders pay network gas, and venues set whatever fees they choose.
Fees in the docsWho holds customer funds?
Traders hold their own assets until a trade settles. Settlement happens onchain. Institutions that need qualified custody can use providers that support Somnia, including BitGo and Fireblocks.
Is matching really onchain?
Yes. The order book, the matching and the settlement are smart contracts on the Somnia L1. No offchain engine or central sequencer decides the order of trades.
Somnia Markets in the docsCan a venue restrict access by jurisdiction?
Yes. Access policy belongs to the venue. dreamDEX, for example, offers event contracts in permitted jurisdictions only.
How fast are orders?
Somnia produces 100 ms blocks and finalises in under a second on mainnet. dreamDEX reports that 95% of orders are placed within 24.4 ms.
Is there MEV?
Ordering is set by deterministic consensus rules, not by a sequencer or block proposer choosing transactions. Nobody in the middle can reorder a trade to profit from it.
Which APIs are available?
dreamDEX offers REST and WebSocket APIs, CCXT, a CLI and MCP-native endpoints. Somnia Markets contracts can also be called directly from any language.
APIs and SDKs in the docsDo we need to run matching infrastructure?
No. Matching and settlement run as smart contracts on Somnia. Your product places orders and shows state.
Somnia Markets in the docsHow do we get paid?
Orders carry builder-fee fields, so the interface that routed a trade is paid when it fills.
Fees in the docsCan our users avoid gas prompts?
Yes. Session-key accounts, built on EIP-7702, let users trade without a wallet prompt for each action, and native gas sponsorship, coming soon, removes gas from the first trade.
Somnia Accounts in the docsHow long does resolution take?
Minutes. At resolution time, Somnia Reactivity wakes the oracle, agent committees read the sources, and the answer is posted onchain. There is no dispute window.
Somnia Oracle in the docsWhat happens if a question can't be answered?
The question is voided. A voided market pays out on a defined basis; on dreamDEX event contracts, each side redeems at 0.50.
Asking questions in the docsCan we require KYC on our venue?
Yes. Venues can attach a policy that gates access by allowlist, token holding or KYC.
Venues in the docsWhat do new assets quote against?
Spot markets on Somnia Markets quote against USDso, Somnia's native stablecoin, issued and operated by Frax.
USDso in the docsCan an asset issued elsewhere trade on Somnia?
Yes. Assets can be bridged in through LayerZero-based routes, Relay and LI.FI, then paired on Somnia Markets.
Bridging in the docsDo we need to write smart contracts?
No. The Agents JSON API agent can read an existing endpoint without any change on the provider's side.
JSON API Request in the docsHow is agent-read data verified?
A subcommittee of validators runs each request independently. Results are agreed by majority or threshold consensus and come with signed execution receipts.
Receipts in the docsWhich oracle providers already operate on Somnia?
Stork and Protofire provide price data on Somnia. Protofire also operates Chainlink VRF v2.5.
Oracles in the docsIs this an AMM?
No. Somnia Markets is a central limit order book with price-time priority. Liquidity rests as limit orders, not in a pricing curve.
Spot markets in the docsHow are prices for margining set?
Somnia Price Feeds supplies index, mark and oracle prices with manipulation controls.
Somnia Price Feeds in the docsWhat does a trade cost?
Network gas only. There is no protocol fee, and venues set their own trading fees. dreamDEX charges none.
Fees in the docsWho decides the outcome?
The Somnia Oracle. Committees of AI agents read the named sources inside Somnia consensus, and the answer is aggregated onchain with per-source receipts.
Somnia Oracle in the docsWhere are event contracts available?
Availability is set by each venue. dreamDEX offers event contracts in early access, in permitted jurisdictions only.
Event contracts in the docsWhat is Somnia Lend?
Somnia Lend is Somnia's onchain credit engine. Users supply assets to earn yield and borrow against collateral.
Somnia Lend in the docsCan USDso be supplied?
Yes. USDso can be supplied on Somnia Lend.
Somnia Lend in the docsHow do liquidations stay timely?
Somnia Reactivity lets contracts subscribe to events, such as a price update, and react to them in the same block.
Reactivity in the docsHow can AI output be deterministic?
The LLM Inference agent runs with fixed seeds and zero temperature. A validator subcommittee runs each job, and the result is accepted by majority or threshold consensus.
LLM Inference in the docsWhat does an agent call cost?
Base agents are priced per call in SOMI: 0.03 for a JSON API request, 0.07 for LLM inference and 0.10 for parsing a website.
Agent pricing in the docsCan agents trade on Somnia Markets?
Yes. Agents use the same SDK, APIs and contracts as any other trader, and dreamDEX offers MCP-native endpoints.
The MCP server in the docsWhen will Somnia Bridge launch?
It is coming soon. Join the waitlist and we will tell you when it opens.
Which chains and assets will Somnia Bridge support?
The first list will be published before launch. Until then, both are TBC.
How is a Somnia Bridge transfer secured?
Somnia Agents observe the transfer, the Somnia Validator Network agrees it happened, and a signed receipt is recorded on Somnia.
How long does a Somnia Bridge transfer take?
Release on Somnia is final in under a second once attested. Time on the source chain varies; estimates TBC.
What will a Somnia Bridge transfer cost?
An agent fee for attestation plus Somnia gas. Amounts are TBC and shown before you sign.
Can my contract react to a Somnia Bridge deposit?
Yes. With Reactivity, a contract can act on an arriving transfer in the same block.
Reactivity in the docsWhen will Somnia Dedicated RPC be available?
Dedicated RPC is not yet available. Join the waitlist and the team will contact you when capacity opens in your region. Launch date TBC.
Dedicated RPC in the docsHow is Somnia Dedicated RPC different from the public RPC?
The public endpoint at api.infra.mainnet.somnia.network is shared by all network users. Dedicated nodes will serve only your traffic, in the region you choose, behind your own allow-list.
RPCs in the docsDo I need to change my code to use Somnia Dedicated RPC?
Only the RPC URL changes. Foundry, Hardhat, viem and ethers will work as they do today, and the chain ID remains 5031.
Which methods will Somnia Dedicated RPC support?
Standard Ethereum JSON-RPC, WebSocket subscriptions and Somnia’s realtime_sendRawTransaction will be supported. Archive and trace methods are TBC.
The JSON-RPC API in the docsHow will Somnia Dedicated RPC be priced?
Pricing is TBC. Gas applies to every transaction you send, as it does on any Somnia endpoint.