Networks and endpoints
This page lists the Somnia networks and the endpoint and address values that go into a configuration. The SDK accepts a viem Chain. The address constants come from the SDK root entry.
Chains
Use viem's somnia or somniaTestnet definition where the table names that export. Set wsRpcUrl explicitly because these viem definitions do not include a WebSocket URL. Define Elwood, Hideki, or the local chain as a custom viem Chain when you need those networks.
| viem export | Chain id | Name | Native currency | Block time | HTTP RPC | WebSocket RPC |
|---|---|---|---|---|---|---|
somnia | 5031 | Somnia | SOMI (18) | 100 ms | https://api.infra.mainnet.somnia.network | wss://api.infra.mainnet.somnia.network/ws |
somniaTestnet | 50312 | Somnia Testnet | STT (18) | 100 ms | https://api.infra.testnet.somnia.network | wss://api.infra.testnet.somnia.network/ws |
| custom | 50313 | Somnia Elwood Testnet | STT (18) | 100 ms | https://api.elwood.infra.testnet.somnia.network | wss://api.elwood.infra.testnet.somnia.network/ws |
| custom | 50383 | Hideki Testnet | STT (18) | 10 ms | https://api.hideki.infra.testnet.somnia.network | wss://api.hideki.infra.testnet.somnia.network/ws |
| custom | 31337 | Somnia Local | STT (18) | none | http://127.0.0.1:8545 | ws://127.0.0.1:8545 |
Shannon also serves https://dream-rpc.somnia.network and wss://dream-rpc.somnia.network/ws as secondary RPC URLs for the same network.
Block explorers: https://explorer.somnia.network (mainnet) and https://shannon-explorer.somnia.network (Shannon). Elwood, Hideki, and local carry no explorer.
Multicall3: mainnet 0x5e44F178E8cF9B2F5409B6f18ce936aB817C5a11, Shannon 0x841b8199E6d3Db3C6f264f6C2bd8848b3cA64223, Hideki 0x540B091b608f54E603c5dC19F6b2d955e1d2D131. Elwood and local carry none.
Somnia Markets deployments
| Network | Indexer GraphQL | Address constant |
|---|---|---|
| Mainnet (5031) | https://prd.smk.somnia.host/v1/graphql | SOMNIA_MAINNET_ADDRESSES |
| Shannon testnet (50312) | https://dev.smk.somnia.host/v1/graphql | SOMNIA_TESTNET_ADDRESSES |
| Local anvil (31337) | http://localhost:8085/v1/graphql when started with demo-clob.sh up | Resolved from the local manifest through @somnia-chain/deployments/local |
The two address constants share the protocol contracts (binaryModule, binaryPoolBeacon, binaryPoolImpl, marketsCore, oracleHub, binarySettlement, clobFactory, collateralRouter, marketCreatorFactory) and differ in collateral, marketCreator, and lend.
| Field | Mainnet | Shannon |
|---|---|---|
collateral / testUsdc | 0x00000022dA000002656c64D9eA6011ea952D008A | 0x70a86D8842FB63C4Ad2b7cdddF530eBf1BB25d8E (tUSDC, 6 decimals, has faucet) |
marketCreator | 0xfe81C4e8EfFb7df27Eb21881f80AF2BF8DCF0c39 | 0x138CfA6b80475b8c03d7E468b2442278E51e645a |
lend | SOMNIA_MAINNET_LEND | SOMNIA_TESTNET_LEND |
Addresses change with deployments. The constants in the installed SDK version are the source of truth; the values above are the ones current at the time of writing.
Testnet tokens
| Token | Address on Shannon | Decimals | Role | How to obtain |
|---|---|---|---|---|
| STT | native | 18 | Gas, and the base of SOMI/USDso | Faucets listed in Get testnet funds |
| USDso | 0x9c32f3827a1a99f0cf9b213de8b53ec3d57bb171 | 18 | Quote of the spot pairs and settlement of the perps | Public mint(address,uint256) |
| tUSDC | 0x70a86D8842FB63C4Ad2b7cdddF530eBf1BB25d8E | 6 | Collateral of the binary markets | exchange.trader.faucet() |
Price feed
| Network | Endpoint | Constant |
|---|---|---|
| Somnia mainnet | https://price-feed.prd.oracle.somnia.host/v1/graphql, quote USDC | SOMNIA_MAINNET_PRICE_FEED |
| Shannon testnet | https://price-feed.dev.oracle.somnia.host/v1/graphql, quote USDC | SOMNIA_TESTNET_PRICE_FEED |
These are two separate deployments. Each one indexes the PriceFeedScheduler
on its own chain. Use the feed that matches the chain the client runs on. A
mainnet client that uses the testnet feed reads prices from chain 50312.
The mainnet feed carries fewer symbols than the testnet feed. Code written for the testnet asset list can therefore fail on mainnet. Read the feed catalog to learn which bases exist. A base the feed does not carry returns no rows. It does not raise an error.
Peer dependencies
| Package | Range | Required |
|---|---|---|
viem | ^2 | yes |
react | >=18 | only for @somnia-chain/markets-sdk/react |
@somnia-chain/reactivity | ^0.2.1 | only for @somnia-chain/markets-sdk/reactivity |
The package is published on the public npm registry from version 0.20.0. Node.js 22 or newer provides the global WebSocket the chain transport uses.