HTTP API

The DEX HTTP API provides a programmatic REST interface that allows integrators to list the currently-available markets and currencies, prepare orders for transmission, and receive real-time updates about all orders placed on Somnia.

See also the WebSocket API for truly real-time communication with the DEX.

Note that, unlike some DEX services, the HTTP API is not sufficient to place an order - the client is expected to be able to connect to the Somnia network and transmit their order themselves. See the POST /v0/markets/{symbol}/orders method for more information.

Base URLs

Every REST endpoint is served under the /v0 path prefix. Pick the row for your target environment and prepend the base URL to the operation paths shown throughout these docs (e.g. GET /v0/markets becomes https://api.dreamdex.io/v0/markets).

EnvironmentChain IDREST base URLWebSocket public feed
Mainnet (Somnia)5031https://api.dreamdex.io/v0wss://api.dreamdex.io/v0/ws/public
Testnet (Somnia Shannon)50312https://stg.api.dreamdex.io/v0wss://stg.api.dreamdex.io/v0/ws/public

The /v0 segment is required on both environments. Omitting it (e.g. https://stg.api.dreamdex.io/markets) returns a 404.

The examples in these docs use the mainnet base URL. To target testnet, substitute the staging base URL above (and the testnet contract addresses). The Quick Start parameterises this as a $BASE_URL shell variable so a single set of commands works against either environment.

For the live markets and currency codes accepted by {symbol} path parameters, see Markets and currency codes.