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 the chain definitions that @somnia-chain/markets-sdk/chains exports. Each one carries its WebSocket URL, so wsRpcUrl is optional with them. Do not define these networks by hand: a hand-written definition keeps old endpoints when a network moves, as Hideki did at its 2026-09-17 regenesis. viem's own somnia and somniaTestnet describe the mainnet and Shannon networks but carry no WebSocket URL. If you use them, set wsRpcUrl.

ts
import { hidekiTestnet, somniaMainnet, somniaShannon } from "@somnia-chain/markets-sdk/chains";
SDK exportChain idNameNative currencyBlock timeHTTP RPCWebSocket RPC
somniaMainnet5031SomniaSOMI (18)100 mshttps://api.infra.mainnet.somnia.networkwss://api.infra.mainnet.somnia.network/ws
somniaShannon50312Somnia TestnetSTT (18)100 mshttps://api.infra.testnet.somnia.networkwss://api.infra.testnet.somnia.network/ws
somniaElwood50313Somnia Elwood TestnetSTT (18)100 mshttps://api.elwood.infra.testnet.somnia.networkwss://api.elwood.infra.testnet.somnia.network/ws
hidekiTestnet50383Hideki TestnetSTT (18)10 mshttps://api.hideki2.infra.testnet.somnia.networkwss://api.hideki2.infra.testnet.somnia.network/ws
somniaLocal31337Somnia LocalSTT (18)nonehttp://127.0.0.1:8545ws://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 0xcA11bde05977b3631167028862bE2a173976CA11 (the canonical address; v2 predeploys it). Elwood and local carry none.

Somnia Markets deployments

NetworkIndexer GraphQLAddress constant
Mainnet (5031)https://prd.smk.somnia.host/v1/graphqlSOMNIA_MAINNET_ADDRESSES
Shannon testnet (50312)https://dev.smk.somnia.host/v1/graphqlSOMNIA_TESTNET_ADDRESSES
Hideki testnet (50383)https://hideki-dev.smk.somnia.host/v1/graphql (development-grade)SOMNIA_HIDEKI_TESTNET_ADDRESSES
Local anvil (31337)http://localhost:8085/v1/graphql when started with demo-clob.sh upResolved from the local manifest through @somnia-chain/deployments/local

The mainnet and Shannon testnet constants share the protocol contracts (binaryModule, binaryPoolBeacon, binaryPoolImpl, marketsCore, oracleHub, binarySettlement, clobFactory, collateralRouter, marketCreatorFactory) and differ in collateral, marketCreator, lend, and perpPoolFactory.

The Hideki preset omits collateralRouter and lend. Hideki has no wSTT, Permit2, or SomniaLend deployment, so the corresponding helpers report not-configured.

The Hideki indexer is development-grade. It runs in the development environment and has no alerting, so a stall can go unnoticed. It indexes the Hideki binary and perp markets. It does not index the Hideki spot pools yet. Omit indexerUrl for chain-only reads and writes; supply one for indexed discovery and history. Indexed reads without a configured URL fail with NotConfiguredError; requests to an unreachable indexer fail with IndexerError.

The Shannon and Hideki presets set perpPoolFactory. loadMarkets therefore lists their perps from the chain, also when the binding has no indexerUrl. The mainnet preset has no perpPoolFactory.

FieldMainnetShannon
collateral / testUsdc0x00000022dA000002656c64D9eA6011ea952D008A0x70a86D8842FB63C4Ad2b7cdddF530eBf1BB25d8E (tUSDC, 6 decimals, has faucet)
marketCreator0xfe81C4e8EfFb7df27Eb21881f80AF2BF8DCF0c390x94D963B6670AB96E78C8d0C46ca35D196d606EFE
lendSOMNIA_MAINNET_LENDSOMNIA_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

TokenAddress on ShannonDecimalsRoleHow to obtain
STTnative18Gas, and the base of SOMI/USDsoFaucets listed in Get testnet funds
USDso0x9c32f3827a1a99f0cf9b213de8b53ec3d57bb17118Quote of the spot pairs and settlement of the perpsPublic mint(address,uint256)
tUSDC0x70a86D8842FB63C4Ad2b7cdddF530eBf1BB25d8E6Collateral of the binary marketsexchange.trader.faucet()

Price feed

NetworkEndpointConstant
Somnia mainnethttps://price-feed.prd.oracle.somnia.host/v1/graphql, quote USDCSOMNIA_MAINNET_PRICE_FEED
Shannon testnethttps://price-feed.dev.oracle.somnia.host/v1/graphql, quote USDCSOMNIA_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

PackageRangeRequired
viem^2.18.5yes
react>=18only for @somnia-chain/markets-sdk/react
@somnia-chain/reactivity^0.2.1only for @somnia-chain/markets-sdk/reactivity

The package is published on the public npm registry from version 0.20.0. The chain transport uses the platform WebSocket where there is one, and the ws package on Node.js 20, which has none.