Somnia Markets / TypeScript SDK

Documentation map

This page is the map of the @somnia-chain/markets-sdk documentation. The pages are grouped by what you need right now: to learn, to finish a task, to look something up, or to understand a design. Every TypeScript example has a compile-checked counterpart that uses the public package entrypoints and real dependency types. The tutorials were run on the testnet.

Start here

Two lessons take a newcomer from an empty directory to a cancelled order on the Somnia testnet. Follow them in order. Each one takes about 15 minutes.

  1. Stream a live order book. No wallet needed. Install the SDK, load the markets, read a book, and watch it change.
  2. Place and cancel your first order. Fund a testnet key, rest a limit order, see it in your open orders, and cancel it.

Do a task

Goal-shaped guides for a developer who already knows what they want.

Look something up

Neutral descriptions of the machinery. Facts, defaults, and constraints, without instruction.

  • Configuration: every field of SomniaMarketsConfig, with defaults
  • Networks and endpoints: chain ids, RPC and indexer URLs, address constants
  • Symbols: the symbol grammar and how raw references resolve
  • Units and scales: raw versus human values, decimals, basis points, ray, timestamps
  • Read tiers: which methods read the live store, the chain, or the indexer
  • Errors: the SDK error classes and the contract error names they decode
  • The API reference, generated from the source, lists every method, hook, and type. On the docs site it sits in the sidebar under "TypeScript SDK".

Understand the design

Discussion for reading away from the keyboard.

Area guides

One guide per market family or module. Each one covers reading, trading, and background for its area.

Edit this page