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 exportChain idNameNative currencyBlock timeHTTP RPCWebSocket RPC
somnia5031SomniaSOMI (18)100 mshttps://api.infra.mainnet.somnia.networkwss://api.infra.mainnet.somnia.network/ws
somniaTestnet50312Somnia TestnetSTT (18)100 mshttps://api.infra.testnet.somnia.networkwss://api.infra.testnet.somnia.network/ws
custom50313Somnia Elwood TestnetSTT (18)100 mshttps://api.elwood.infra.testnet.somnia.networkwss://api.elwood.infra.testnet.somnia.network/ws
custom50383Hideki TestnetSTT (18)10 mshttps://api.hideki.infra.testnet.somnia.networkwss://api.hideki.infra.testnet.somnia.network/ws
custom31337Somnia 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 0x540B091b608f54E603c5dC19F6b2d955e1d2D131. 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
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 two address constants share the protocol contracts (binaryModule, binaryPoolBeacon, binaryPoolImpl, marketsCore, oracleHub, binarySettlement, clobFactory, collateralRouter, marketCreatorFactory) and differ in collateral, marketCreator, and lend.

FieldMainnetShannon
collateral / testUsdc0x00000022dA000002656c64D9eA6011ea952D008A0x70a86D8842FB63C4Ad2b7cdddF530eBf1BB25d8E (tUSDC, 6 decimals, has faucet)
marketCreator0xfe81C4e8EfFb7df27Eb21881f80AF2BF8DCF0c390x138CfA6b80475b8c03d7E468b2442278E51e645a
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^2yes
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. Node.js 22 or newer provides the global WebSocket the chain transport uses.