Contract Specifications

Deployed addresses for all environments are listed in Contract Addresses.

Overview

dreamDEX spot markets enable direct exchange of crypto assets with atomic on-chain settlement. Spot trades result in immediate ownership transfer of the underlying assets, with no margin, funding, or expiration mechanics.

All v1.0 spot markets are quoted in USDso (Somnia's USD stablecoin, backed 1:1 by FraxUSD via LayerZero), providing a consistent quote currency across pairs.

Contract Specifications

SpecificationDetails
Instrument TypeSpot
SettlementImmediate (atomic)
Quote CurrencyUSDso
CustodyNon-custodial (assets held in user wallet or pool vault)
Tick SizeVaries per pair (see Live Markets)
Lot SizeVaries per pair (see Live Markets)
Minimum OrderVaries per pair (see Live Markets)
ExpirationN/A
Fees0% maker / 0% taker (configurable per pool)
Trading Hours24/7/365

Live Markets

All dreamDEX spot markets quote against USDso.

Mainnet (chain ID 5031)

PairSpotPool
SOMI/USDso (native)0x035De7403eac6872787779CCA7CCF1b4CDb61379
USDC.e/USDso (Bridged USDC via Stargate)0x47fD2f18426f67106DBaC82F6d21D446c5F2120b
WBTC/USDso (Wrapped Bitcoin)0x25bfF6B7B5E2243424F38E75de7ab03C0522a5EA
WETH/USDso (Wrapped Ether)0xa936da11B57b50A344e1293AAaE5232885ea2bDE

Testnet (Somnia Shannon, chain ID 50312)

PairSpotPool
SOMI/USDso (native)0x259fD6559214dd5aD3752322426eA9F9fABEFff4
WBTC/USDso0x3605f28aA7C50e7441211e77Cb0762d49539326C
WETH/USDso0xD180195da5459C7a0DEA188ed61216ec43682b50

Per-pair parameters (mainnet)

Current mainnet values, in human-readable units. tickSize is the minimum price increment (quote); lotSize the minimum size increment and minQuantity the minimum order size (both base):

PairtickSizelotSizeminQuantity
SOMI:USDso0.00010.011
USDC.e:USDso0.00010.011
WBTC:USDso0.10.000010.0001
WETH:USDso0.010.00010.001

These are set at pool initialization and are admin-tunable, so treat the table as a snapshot. GET /v0/markets and on-chain getPoolParams() are the canonical, always-current source of truth - query them at runtime rather than hard-coding, and see Quantizing price and quantity for the integer arithmetic.

Raw values. On-chain parameters are stored in raw token units. For example, with USDso at 18 decimals, a tick size of 0.01 USDso is stored as 10000000000000000 on-chain. Use getPoolParams() to query the raw values for a specific market.

Stablecoin conversion. The USDC.e / USDso pair provides an on-ramp between bridged USDC and USDso, the quote currency used across dreamDEX.

Native SOMI pool. On the SOMI/USDso pair, SOMI is the chain's native token (no ERC-20 deposit). For manual vault funding use depositNative() with msg.value instead of deposit(token, amount); under the default auto-pull flow, placeOrder is payable and pulls input from msg.value instead of an ERC-20 allowance.

Gas limit on native-base BUYs: the payout path enforces a gas headroom guard, so set the tx gas limit to ≥ 5,000,000 (and use the same limit in eth_call simulation). Below that, the call reverts with InsufficientGasForPayout(uint256 gasLeft).

Stop Order Registries

Each spot market has an associated SpotStopOrderRegistry for conditional stop-loss and take-profit orders. Registries are triggered automatically by Somnia's on-chain reactivity when the SpotPool's EMA-smoothed mark price crosses a trigger threshold.

Mainnet

Pool pairStop Order Registry
SOMI/USDso (native)0x68c8f6fb1EA19A28F25358Ff00b8Ed8E1216df30
USDC.e/USDso0xD53E3F3b73513F2147377ef8f573f649cF60100c
WBTC/USDso0xed32F048D6a47923D38eCeD868d6f8b0eB4852bd
WETH/USDso0x9653a7355849B7691802A6AA49fDe18eF5ba633d

Testnet

Pool pairStop Order Registry
SOMI/USDso (native)0xEb97349Aa62A68507c0bE535eD88B0d028a47E1e
WBTC/USDso0x53d5B2b0791b3992a1F3b5e0b0277Ee2e08B7aaD
WETH/USDso0xf822D4Cb94902d667c9650e702aA5f096cc7598F

Default configuration

ParameterDefault
slippageToleranceBps500 (5%) — used to compute the limit price for MARKET-type stop orders at trigger time
somiPaymentPerOrder0.1 SOMI — exact payment required when creating a pending stop order
minStopDistanceBps0 (disabled) — minimum allowed gap between a stop's triggerPrice and the current EMA midpoint
gasBufferBps5000 (50%) — per-iteration gas headroom for the trigger loop

These are admin-tunable per registry. Read the live values via slippageToleranceBps(), somiPaymentPerOrder(), minStopDistanceBps(), and gasBufferBps() on the registry contract.