### getMarkets Request Example Source: https://docs.dreamdex.io/developers/websocket-api/operations.md Example WebSocket request to fetch all markets using the getMarkets operation. ```json { "id": 1, "operation": "getMarkets" } ``` -------------------------------- ### Install @somnia-chain/markets-sdk and viem Source: https://docs.dreamdex.io/developers/event-contracts.md Install the SDK and viem via npm. Requires version 0.29.0 or newer; older versions have known issues with indexer columns, tick grid, and market count caps. ```bash npm install @somnia-chain/markets-sdk viem ``` -------------------------------- ### successResponse Example Source: https://docs.dreamdex.io/developers/websocket-api/operations.md Example successful WebSocket response with status 200 and a payload containing market data. ```json { "id": 1, "status": 200, "payload": { "markets": [ { "symbol": "SOMI:USDso", "contract": "0x1234567890abcdef1234567890abcdef12345678", "base": "0xC732f848Ca9146840903cf5CC20481C4c56e0A11", "quote": "0x1e128F195b081Aa75CE1898227993D0994bf51e1", "baseDecimals": 18, "quoteDecimals": 6, "tickSize": "0.00001", "lotSize": "0.000001", "minQuantity": "0.001" } ] } } ``` -------------------------------- ### prepareOrder Request Example Source: https://docs.dreamdex.io/developers/websocket-api/operations.md Example WebSocket request to prepare a limit order transaction using the prepareOrder operation, with symbol, bearer token, and payload containing order details. ```json { "id": 3, "operation": "prepareOrder", "params": { "symbol": "SOMI:USDso" }, "bearerToken": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...", "payload": { "type": "limit", "side": "buy", "price": "1.50", "amount": "100", "walletAddress": "0xaAaAaAaAaAbBbBbBbBbBcCcCcCcCcCdDdDdDdDdD" } } ``` -------------------------------- ### orderbook:snapshot example Source: https://docs.dreamdex.io/developers/websocket-api/real-time-feed.md Example of the orderbook:snapshot message for SOMI:USDso with 2 bid and 2 ask levels. Use to initialize local order book state before applying incremental updates. ```json { "channel": "orderbook", "type": "snapshot", "symbol": "SOMI:USDso", "bids": [ { "price": "1.24", "quantity": "1500" }, { "price": "1.23", "quantity": "3200" } ], "asks": [ { "price": "1.26", "quantity": "800" }, { "price": "1.27", "quantity": "2100" } ], "timestamp": 1765534169841 } ``` -------------------------------- ### Install CCXT dreamDEX from GitHub branch Source: https://docs.dreamdex.io/developers/libraries/ccxt.md Install the dreamDEX CCXT integration directly from the 'add-dreamdex-exchange' branch of Somnia's CCXT fork. This is required because the integration is in alpha and not yet published to npm. ```bash npm install github:somnia-chain/ccxt#add-dreamdex-exchange ``` -------------------------------- ### Example market data response Source: https://docs.dreamdex.io/developers/quick-start.md Example JSON response from the markets endpoint showing a single market (WETH:USDso). Note the contract, base, quote addresses, decimals, and constraints like tickSize, lotSize, and minQuantity. These values are illustrative and must be fetched per-market at runtime. ```json { "markets": [ { "symbol": "WETH:USDso", "contract": "0xa936da11B57b50A344e1293AAaE5232885ea2bDE", "base": "0x936Ab8C674bcb567CD5dEB85D8A216494704E9D8", "quote": "0x00000022dA000002656c64D9eA6011ea952D008A", "baseDecimals": 18, "quoteDecimals": 18, "tickSize": "0.01", "lotSize": "0.0001", "minQuantity": "0.001" } ] } ``` -------------------------------- ### errorResponse Example Source: https://docs.dreamdex.io/developers/websocket-api/operations.md Example WebSocket error response with status 404 and error details for an order not found. ```json { "id": 2, "status": 404, "errorName": "order_not_found", "payload": { "status": 404, "name": "order_not_found", "description": "The requested order was not found" } } ``` -------------------------------- ### shutdown message example Source: https://docs.dreamdex.io/developers/websocket-api/real-time-feed.md Example shutdown message broadcast to all clients before the server terminates connections. Clients should close their connections and reconnect to a different server or retry after a delay. ```json { "type": "shutdown", "message": "server shutting down" } ``` -------------------------------- ### order:update message examples (partial and filled) Source: https://docs.dreamdex.io/developers/websocket-api/real-time-feed.md Two example messages for the order:update event: one for a partially filled order (status "partial") and one for a fully filled order (status "filled"). Both include the complete current order state with id, market, side, price, quantity, filled, and timestamps. ```json { "channel": "order", "type": "update", "order": { "id": "0x1234567890abcdef", "market": "SOMI:USDso", "side": "buy", "price": "1.25", "quantity": "1000", "filled": "500", "status": "partial", "createdAt": 1765534160000, "updatedAt": 1765534175000 } } ``` ```json { "channel": "order", "type": "update", "order": { "id": "0x1234567890abcdef", "market": "SOMI:USDso", "side": "buy", "price": "1.25", "quantity": "1000", "filled": "1000", "status": "filled", "createdAt": 1765534160000, "updatedAt": 1765534180000 } } ``` -------------------------------- ### orderbook:update example Source: https://docs.dreamdex.io/developers/websocket-api/real-time-feed.md Example of the orderbook:update message showing a new bid and a removed ask (quantity 0). Apply updates by replacing the quantity at each price level, or removing the level if the quantity is zero. ```json { "channel": "orderbook", "type": "update", "symbol": "SOMI:USDso", "bids": [ { "price": "1.25", "quantity": "500" } ], "asks": [ { "price": "1.26", "quantity": "0" } ], "timestamp": 1765534170000 } ``` -------------------------------- ### Query DreamDEX docs with GET request Source: https://docs.dreamdex.io/trading/common.md Performs an HTTP GET request to the current page URL with the `ask` query parameter and optional `goal` parameter to retrieve relevant documentation excerpts and answers. Use when the answer is not present on the page or for related context. ```http GET https://docs.dreamdex.io/trading/common.md?ask=&goal= ``` -------------------------------- ### List markets with dreamdex CLI Source: https://docs.dreamdex.io/developers/quick-start.md Use the dreamdex CLI to fetch market metadata automatically without manual setup. This command lists available markets. ```sh dreamdex markets ``` -------------------------------- ### GET /v0/trades/{address} Source: https://docs.dreamdex.io/developers/http-api/trading.md Returns executed fills for any wallet. Restricted to bearer tokens carrying the `trades:read_any` scope. Trades are returned newest-first. ```APIDOC ## GET /v0/trades/{address} ### Description Returns executed fills for any wallet. Restricted to bearer tokens carrying the `trades:read_any` scope. Trades are returned newest-first (reverse chronological order). ### Method GET ### Endpoint /v0/trades/{address} ### Parameters #### Path Parameters - **address** (string) - Required - Wallet address of the account whose trades to retrieve. #### Query Parameters - **since** (integer) - Optional - Return trades after this unix millisecond timestamp. - **limit** (integer) - Optional - Maximum number of trades to return (default 100, max 1000). - **cursor** (string) - Optional - Opaque pagination token from a prior response's `nextCursor`. Omit on the first request; pass the previous response's value unchanged to retrieve the next page. The decoder rejects malformed cursors with `400 invalid_param`. ### Response #### Success Response (200) - **trades** (array of Trade) - List of executed trades, newest-first. - **nextCursor** (string) - Opaque pagination token for the next page. Absent when there are no further pages. #### Trade Object - **id** (string) - Unique trade identifier. - **symbol** (string) - Market symbol. - **side** (string) - Trade side (e.g., buy/sell). - **price** (number) - Execution price. - **amount** (number) - Quantity traded. - **cost** (number) - Total cost of the trade. - **timestamp** (integer) - Unix millisecond timestamp of the trade. - **maker** (string) - Wallet address of the resting (maker) order owner. Only present when the request carries a bearer token with the `trades:read_any` scope; omitted otherwise. - **taker** (string) - Wallet address of the aggressing (taker) order owner. Only present when the request carries a bearer token with the `trades:read_any` scope; omitted otherwise. - **txHash** (string) - On-chain transaction hash of the fill. ``` -------------------------------- ### GET /v0/orders Source: https://docs.dreamdex.io/developers/http-api/trading.md Lists orders for the authenticated account across one or more markets, with optional filtering by status and pagination via cursor. ```APIDOC ## GET /v0/orders ### Description Returns orders for the authenticated account across one or more markets, newest-first. If no symbols are specified, returns orders for all available markets. Unknown symbols are silently skipped. Optionally filter by order status. The response includes a `nextCursor` token when more pages are available — pass it back as `cursor` to continue. ### Method GET ### Endpoint /v0/orders ### Parameters #### Query Parameters - **symbols** (array of Symbol) - Optional - Market symbols to filter. When omitted, returns orders for all markets. - **status** (OrderStatus) - Optional - Order status to filter by. Allowed values: `open`, `closed`, `canceled`, `expired`, `rejected`. - **limit** (integer) - Optional - Maximum number of orders to return (default 100, max 1000). - **cursor** (string) - Optional - Opaque pagination token from a prior response's `nextCursor`. Omit on the first request; pass the previous response's value unchanged to retrieve the next page. The decoder rejects malformed cursors with `400 invalid_param`. ### Response #### Success Response (200) - **orders** (array) - List of orders. Each order includes its current state, fill progress, and associated transaction hash. - **nextCursor** (string) - Opaque pagination token. Pass this back as the `cursor` query parameter on the next request to retrieve the page after this one. The string is intentionally opaque — clients must not parse or modify it. ### Notes - Requires bearer authentication (account scope). - Servers: Mainnet `https://api.dreamdex.io`, Testnet `https://stg.api.dreamdex.io`. - Market symbols are in `BASE:QUOTE` form using the exchange's currency codes (e.g., `SOMI:USDso`). The authoritative list is served by `GET /v0/markets` and `GET /v0/currencies`; do not assume codes are stable across environments. ``` -------------------------------- ### GET /v0/markets/{symbol}/trades/{address} Source: https://docs.dreamdex.io/developers/http-api/trading.md Returns executed trades for the given wallet address within a market over a half-open time range [since, until). Requires a bearer token with the trades:read_any scope. Trades are returned newest-first, and the response is an empty array when no trades match. ```APIDOC ## GET /v0/markets/{symbol}/trades/{address} ### Description Returns executed trades for the given wallet address within a market over a half-open time range `[since, until)`. Includes trades where the wallet was either the taker or the maker. Trades are returned newest-first (reverse chronological order); the response is an empty array when no trades match. Access is restricted to bearer tokens carrying the `trades:read_any` scope. Tokens without the scope receive 403. Because the scope is required, each trade always includes the `maker` and `taker` wallet addresses. `until` defaults to the current time if omitted; `since` defaults to `until - 7 days`. The range must not exceed 40 days — longer ranges return 400. Use `as=maker` or `as=taker` to restrict the result to one side; both sides are returned by default. ### Method GET ### Endpoint /v0/markets/{symbol}/trades/{address} ### Parameters #### Path Parameters - **symbol** (Symbol) - Required - Market symbol in `BASE:QUOTE` form using the exchange's currency codes (e.g. `SOMI:USDso`). The authoritative, per-environment list of live symbols and currency codes is served by `GET /v0/markets` and `GET /v0/currencies`; do not assume codes are stable across mainnet and testnet. As of writing, mainnet lists `SOMI:USDso`, `WETH:USDso`, `WBTC:USDso`, and `USDC.e:USDso`. - **address** (Address) - Required - Wallet address whose trades to return. EVM-compatible address (0x-prefixed, checksummed). #### Query Parameters - **since** (integer, int64) - Optional - Return trades after this unix millisecond timestamp. - **until** (integer, int64) - Optional - Return trades strictly before this unix millisecond timestamp (exclusive). Defaults to the current time when omitted. - **as** (string) - Optional - Restrict results to trades where the wallet was on this side. Omit to return trades where the wallet was either maker or taker. Enum: `maker`, `taker`. ### Response #### Success Response (200) - **trades** (array of Trade) - A list of executed trades. Each trade has the following properties: - **id** (string) - Unique trade identifier. - **symbol** (Symbol) - Market symbol. - **side** (TradeSide) - Side of the trade. - **price** (Price) - Trade price. - **amount** (Quantity) - Trade amount. - **cost** (Quantity) - Trade cost. - **maker** (Address) - Wallet address of the resting (maker) order owner. Only present when the request carries a bearer token with the `trades:read_any` scope; omitted otherwise. - **taker** (Address) - Wallet address of the aggressing (taker) order owner. Only present when the request carries a bearer token with the `trades:read_any` scope; omitted otherwise. - **timestamp** (Timestamp) - Trade timestamp. - **txHash** (string) - On-chain transaction hash of the fill. #### Response Example ```json { "trades": [ { "id": "string", "symbol": "SOMI:USDso", "side": "buy", "price": "100.00", "amount": "1.5", "cost": "150.00", "maker": "0x...", "taker": "0x...", "timestamp": 1234567890, "txHash": "0x..." } ] } ``` ### Error Handling - **403** - Returned when the bearer token does not carry the `trades:read_any` scope. - **400** - Returned when the time range exceeds 40 days. ``` -------------------------------- ### OpenAPI specification for GET /v0/markets/{symbol}/orders Source: https://docs.dreamdex.io/developers/http-api/trading.md Defines the endpoint for listing orders, including parameters (symbol, status, limit, cursor), response schemas (Order, NextCursor, etc.), and security scheme (bearerAuth). The server URLs point to mainnet and testnet environments. ```json {"openapi":"3.0.0","info":{"title":"dreamDEX","version":"0.1.0"},"tags":[{"name":"Trading"},{"name":"Orders"},{"description":"Endpoint is scoped to the authenticated account.","name":"Private"}],"servers":[{"description":"Mainnet (production)","url":"https://api.dreamdex.io"},{"description":"Testnet (staging)","url":"https://stg.api.dreamdex.io"}],"security":[{"bearerAuth":["account"]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Bearer auth","scheme":"bearer","type":"http"}},"parameters":{"PathSymbol":{"description":"Market symbol","in":"path","name":"symbol","required":true,"schema":{"$ref":"#/components/schemas/Symbol"}},"OrderStatus":{"description":"Order status to filter by","in":"query","name":"status","schema":{"$ref":"#/components/schemas/OrderStatus"}},"OrderLimit":{"description":"Maximum number of orders to return (default 100, max 1000)","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},"OrderCursor":{"description":"Opaque pagination token from a prior response's `nextCursor`.\nOmit on the first request; pass the previous response's value\nunchanged to retrieve the next page. The decoder rejects\nmalformed cursors with `400 invalid_param`.\n","in":"query","name":"cursor","schema":{"type":"string"}}},"schemas":{"Symbol":{"description":"Market symbol in `BASE:QUOTE` form using the exchange's currency codes\n(e.g. `SOMI:USDso`). The authoritative, per-environment list of live\nsymbols and currency codes is served by `GET /v0/markets` and\n`GET /v0/currencies`; do not assume codes are stable across mainnet and\ntestnet. As of writing, mainnet lists `SOMI:USDso`, `WETH:USDso`,\n`WBTC:USDso`, and `USDC.e:USDso`.\n","type":"string"},"OrderStatus":{"description":"Current status of the order","enum":["open","closed","canceled","expired","rejected"],"type":"string"},"NextCursor":{"description":"Opaque pagination token. Pass this back as the `cursor` query\nparameter on the next request to retrieve the page after this\none. The string is intentionally opaque — clients must not parse\nor modify it. Absent (empty string omitted from the response)\nwhen there are no further pages.\n","type":"string"},"Order":{"description":"A trading order","properties":{"amount":{"$ref":"#/components/schemas/Quantity"},"createdAt":{"$ref":"#/components/schemas/Timestamp"},"executionPrice":{"$ref":"#/components/schemas/Price"},"expiresAt":{"$ref":"#/components/schemas/Timestamp"},"filled":{"$ref":"#/components/schemas/Quantity"},"id":{"$ref":"#/components/schemas/OrderId"},"price":{"$ref":"#/components/schemas/Price"},"remaining":{"$ref":"#/components/schemas/Quantity"},"side":{"$ref":"#/components/schemas/TradeSide"},"status":{"$ref":"#/components/schemas/OrderStatus"},"symbol":{"$ref":"#/components/schemas/Symbol"},"txHash":{"description":"On-chain transaction hash that placed the order","type":"string"},"walletAddress":{"$ref":"#/components/schemas/Address"}},"required":["id","status","createdAt","symbol","side","price","amount","filled","remaining"],"type":"object"},"Quantity":{"description":"Quantity as decimal string for precision (e.g., \"100.5\")","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"Timestamp":{"description":"Unix Timestamp (ms)","format":"int64","type":"integer"},"Price":{"description":"Price as decimal string for precision (e.g., \"1.23456789\")","pattern":"^[0-9]+(\\.[0-9]+)?$","type":"string"},"OrderId":{"description":"Unique uint128 order identifier, encoded as a decimal string","pattern":"^[0-9]+$","type":"string"},"TradeSide":{"description":"Order side (bid/ask)","enum":["buy","sell"],"type":"string"},"Address":{"description":"EVM-compatible address (0x-prefixed, checksummed)","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"responses":{"Orders":{"content":{"application/json":{"schema":{"properties":{"nextCursor":{"$ref":"#/components/schemas/NextCursor"},"orders":{"items":{"$ref":"#/components/schemas/Order"},"type":"array"},"total":{"description":"Total number of orders matching the query filters (e.g.\n`status`), ignoring `limit` and `cursor`. Omitted when the\ncount is unknown. A genuinely empty result set with a known\ncount returns `total: 0`.\n","minimum":0,"type":"integer"}},"required":["orders"],"type":"object"}}},"description":"List of orders"}}},"paths":{"/v0/markets/{symbol}/orders":{"get":{"description":"Returns orders for the authenticated account in a specific market,\nnewest-first. ``` -------------------------------- ### GET /v0/markets/{symbol}/trades/{address} Source: https://docs.dreamdex.io/developers/http-api/trading.md Privileged endpoint to list trades for a specific wallet address within a market. Requires bearer token with `trades:read_any` scope. ```APIDOC ## GET /v0/markets/{symbol}/trades/{address} ### Description Returns executed trades for the given wallet address within a market over a half-open time range `[since, until)`. Includes trades where the wallet was either the taker or the maker. Trades are returned newest-first (reverse chronological order); the response is an empty array when no trades match. Access is restricted to bearer tokens carrying the `trades:read_any` scope. Tokens without the scope receive 403. Because the scope is required, each trade always includes the `maker` and `taker` wallet addresses. `until` defaults to the current time if omitted; `since` defaults to `until - 7 days`. The range must not exceed 40 days — longer ranges return 400. Use `as=maker` or `as=taker` to restrict the result to one side; both sides are returned by default. ### Method GET ### Endpoint /v0/markets/{symbol}/trades/{address} ### Parameters #### Path Parameters - **symbol** (string) - Required - Market symbol (e.g., BTC-USD) - **address** (string) - Required - Wallet address to query trades for #### Query Parameters - **since** (integer) - Optional - Start of the time range (Unix timestamp in ms). Defaults to `until - 7 days`. - **until** (integer) - Optional - End of the time range (Unix timestamp in ms). Defaults to current time. - **as** (string) - Optional - Restrict to trades where the wallet was the maker or taker. Values: `maker`, `taker`. Default: both sides. ### Response #### Success Response (200) - **symbol** (string) - Market symbol - **trades** (array of Trade) - List of executed trades - **total** (integer) - Total number of trades matching the query filters (ignoring `limit` and `cursor`). Present only on authenticated per-user trade endpoints. Omitted when count is unknown. - **nextCursor** (string) - Cursor for pagination (if applicable) #### Response Example ```json { "symbol": "BTC-USD", "trades": [ { "id": "string", "timestamp": 0, "symbol": "string", "side": "buy", "price": "1.23456789", "amount": "100.5", "cost": "string" } ], "total": 0, "nextCursor": "string" } ``` #### Error Response (400, 403, 404, 500) - **status** (integer) - HTTP Status Code - **name** (string) - Machine-readable error name (e.g., `invalid_param`, `unauthorized`) - **description** (string) - Human-readable error description - **context** (object) - Additional contextual error information #### Error Example ```json { "status": 403, "name": "unauthorized", "description": "Missing required scope: trades:read_any" } ``` ``` -------------------------------- ### GET /v0/orders/{symbol}/{id} Source: https://docs.dreamdex.io/developers/http-api/trading.md Retrieves detailed information about a specific order by its unique identifier, including status, parameters, fill progress, and transaction hash. ```APIDOC ## GET /v0/orders/{symbol}/{id} ### Description Returns detailed information about a specific order by its unique identifier. The response includes the order's current status, original parameters, fill progress (filled vs remaining amounts), and the on-chain transaction hash if available. Use this endpoint to poll for order status updates or display order details. ### Method GET ### Endpoint /v0/orders/{symbol}/{id} ### Parameters #### Path Parameters - **symbol** (string) - Required - Market symbol in `BASE:QUOTE` form using the exchange's currency codes (e.g. `SOMI:USDso`). The authoritative, per-environment list of live symbols and currency codes is served by `GET /v0/markets` and `GET /v0/currencies`; do not assume codes are stable across mainnet and testnet. - **id** (string) - Required - The ID of the order. ### Response #### Success Response (200) - **status** (string) - The current status of the order. - **original parameters** (object) - The original parameters of the order. - **filled** (number) - The filled amount. - **remaining** (number) - The remaining amount. - **transaction hash** (string) - The on-chain transaction hash if available. #### Response Example ```json { "status": "filled", "originalParameters": {}, "filled": 100, "remaining": 0, "transactionHash": "0x..." } ``` ``` -------------------------------- ### GET /v0/orders Source: https://docs.dreamdex.io/developers/http-api/trading.md Returns orders for the authenticated account across one or more markets, newest-first. If no symbols are specified, returns orders for all available markets. Unknown symbols are silently skipped. Optionally filter by order status. The response includes a nextCursor token when more pages are available — pass it back as cursor to continue. ```APIDOC ## GET /v0/orders ### Description Returns orders for the authenticated account across one or more markets, newest-first. If no symbols are specified, returns orders for all available markets. Unknown symbols are silently skipped. Optionally filter by order status. The response includes a `nextCursor` token when more pages are available — pass it back as `cursor` to continue. ### Method GET ### Endpoint /v0/orders ### Parameters #### Query Parameters - **symbols** (array of strings) - Optional - List of market symbols to filter orders by. If omitted, returns orders for all available markets. Unknown symbols are silently skipped. - **status** (string) - Optional - Filter by order status. - **limit** (integer) - Optional - Maximum number of orders to return. - **cursor** (string) - Optional - Pagination cursor token from a previous response's `nextCursor`. ### Response #### Success Response (200) - **orders** (array of Order) - Required - List of orders. - **nextCursor** (string) - Optional - Cursor token for the next page. Absent (empty string omitted from the response) when there are no further pages. - **total** (integer) - Optional - Total number of orders matching the query filters (e.g. `status`), ignoring `limit` and `cursor`. Omitted when the count is unknown. A genuinely empty result set with a known count returns `total: 0`. #### Response Example { "orders": [ { "id": "123456789", "status": "open", "createdAt": 1620000000000, "symbol": "ETH-USD", "side": "buy", "price": "1.23456789", "amount": "100.5", "filled": "0", "remaining": "100.5", "executionPrice": "1.23456789", "expiresAt": 1620003600000, "txHash": "0xabc...", "walletAddress": "0x123..." } ], "nextCursor": "abc123", "total": 1 } #### Error Response (500) - **status** (integer) - HTTP Status Code - **name** (string) - Machine-readable error name - **description** (string) - Human-readable error description - **context** (object) - Additional contextual error information #### Error Response Example { "status": 500, "name": "internal_error", "description": "Internal server error", "context": {} } ``` -------------------------------- ### OpenAPI specification for GET /v0/markets/{symbol}/candles Source: https://docs.dreamdex.io/developers/http-api/trading.md JSON OpenAPI 3.0.0 definition for the candles endpoint. Includes server URLs for mainnet and testnet, parameters (symbol, interval, limit, endTime), and response references. Use this to generate clients or understand the API contract. ```json {"openapi":"3.0.0","info":{"title":"dreamDEX","version":"0.1.0"},"tags":[{"name":"Market"},{"description":"Endpoint is unscoped to the account.","name":"Public"}],"servers":[{"description":"Mainnet (production)","url":"https://api.dreamdex.io"},{"description":"Testnet (staging)","url":"https://stg.api.dreamdex.io"}],"security":[],"paths":{"/v0/markets/{symbol}/candles":{"get":{"description":"Returns historical OHLCV (Open, High, Low, Close, Volume) candlestick data\nfor charting purposes. Each candle represents price action over a specific\ntime interval. This endpoint supports various timeframes and is essential\nfor rendering price charts and performing technical analysis.\n\nTo page backwards through history, supply `endTime` as a unix millisecond\ntimestamp. Only candles whose bucket timestamp is strictly less than\n`endTime` are returned. Combined with `limit`, this lets a client load\nsuccessive older windows by passing the oldest returned timestamp as the\nnext request's `endTime`.\n","operationId":"GetMarketSymbolCandles","parameters":[{"$ref":"#/components/parameters/PathSymbol"},{"$ref":"#/components/parameters/CandleInterval"},{"$ref":"#/components/parameters/CandleLimit"},{"$ref":"#/components/parameters/CandleEndTime"}],"responses":{"200":{"$ref":"#/components/responses/Candles"},"404":{"$ref":"#/components/responses/Error"},"500":{"$ref":"#/components/responses/Error"}},"summary":"Get OHLCV candles","tags":["Market","Public"]}}},"components":{"parameters":{"PathSymbol":{"description":"Market symbol","in":"path","name":"symbol","required":true,"schema":{"$ref":"#/components/schemas/Symbol"}},"CandleInterval":{"description":"Candle time interval","in":"query","name":"interval","required":true,"schema":{"enum":["1m","5m","15m","1h","4h","1d"],"type":"string"}},"CandleLimit":{"description":"Maximum number of candles to return (default 100, max 1000)","in":"query","name":"limit","schema":{"default":100,"maximum":1000,"minimum":1,"type":"integer"}},"CandleEndTime":{"description":"Return only candles whose bucket timestamp is strictly less than this\nunix millisecond timestamp. Used to page backwards through history.\n","in":"query","name":"endTime","schema":{"format":"int64","type":"integer"}}},"schemas":{"Symbol":{"description":"Market symbol in `BASE:QUOTE` form using the exchange's currency codes\n(e.g. `SOMI:USDso`). The authoritative, per-environment list of live\nsymbols and currency codes is served by `GET /v0/markets` and\n`GET /v0/currencies`; do not assume codes are stable across mainnet and\ntestnet."}}}} ``` -------------------------------- ### GET /candles Source: https://docs.dreamdex.io/developers/http-api/trading.md Retrieves OHLCV candlestick data for a market. The response includes an array of candles with timestamp, open, high, low, close, and volume fields. ```APIDOC ## GET /candles ### Description Retrieves OHLCV candlestick data for a market. ### Method GET ### Endpoint /candles ### Parameters #### Query Parameters - **symbol** (string) - Required - Market symbol (e.g., "SOMI:USDso") - **interval** (string) - Required - Candle time interval ### Response #### Success Response (200) - **symbol** (string) - Market symbol - **interval** (string) - Candle time interval - **candles** (array of Candle) - List of OHLCV candles #### Candle Object - **timestamp** (integer) - Unix Timestamp (ms) - **open** (string) - Price as decimal string - **high** (string) - Price as decimal string - **low** (string) - Price as decimal string - **close** (string) - Price as decimal string - **volume** (string) - Quantity as decimal string #### Response Example { "symbol": "SOMI:USDso", "interval": "1h", "candles": [ { "timestamp": 1700000000000, "open": "1.23456789", "high": "1.23456789", "low": "1.23456789", "close": "1.23456789", "volume": "100.5" } ] } #### Error Response - **status** (integer) - HTTP Status Code - **name** (string) - Machine-readable error name - **description** (string) - Human-readable error description - **context** (object) - Additional contextual error information ``` -------------------------------- ### GET /v0/trades Source: https://docs.dreamdex.io/developers/http-api/trading.md Returns the authenticated user's executed trades across several markets in one call, tagging each trade with its symbol. Trades are returned newest-first. ```APIDOC ## GET /v0/trades ### Description Returns the authenticated user's executed trades across several markets in one call. Each trade is tagged with its symbol. Trades are returned newest-first (reverse chronological order). ### Method GET ### Endpoint /v0/trades ### Parameters #### Query Parameters - **since** (integer) - Optional - Return trades after this unix millisecond timestamp. - **limit** (integer) - Optional - Maximum number of trades to return (default 100, max 1000). - **cursor** (string) - Optional - Opaque pagination token from a prior response's `nextCursor`. Omit on the first request; pass the previous response's value unchanged to retrieve the next page. The decoder rejects malformed cursors with `400 invalid_param`. ### Response #### Success Response (200) - **trades** (array of Trade) - List of executed trades, newest-first. - **nextCursor** (string) - Opaque pagination token for the next page. Absent when there are no further pages. #### Trade Object - **id** (string) - Unique trade identifier. - **symbol** (string) - Market symbol. - **side** (string) - Trade side (e.g., buy/sell). - **price** (number) - Execution price. - **amount** (number) - Quantity traded. - **cost** (number) - Total cost of the trade. - **timestamp** (integer) - Unix millisecond timestamp of the trade. - **maker** (string) - Wallet address of the resting (maker) order owner. Only present when the request carries a bearer token with the `trades:read_any` scope; omitted otherwise. - **taker** (string) - Wallet address of the aggressing (taker) order owner. Only present when the request carries a bearer token with the `trades:read_any` scope; omitted otherwise. - **txHash** (string) - On-chain transaction hash of the fill. ``` -------------------------------- ### GET /v0/markets/{symbol}/tickers Source: https://docs.dreamdex.io/developers/http-api/trading.md Returns 24-hour OHLCV market statistics for a specific trading pair. Includes open, high, low, close prices and total trade volume. All fields are "0" if no trades occurred in the period. ```APIDOC ## GET /v0/markets/{symbol}/tickers ### Description Returns 24-hour OHLCV market statistics for a specific trading pair. Includes open, high, low, close prices and total trade volume. All fields are "0" if no trades occurred in the period. ### Method GET ### Endpoint /v0/markets/{symbol}/tickers ### Parameters #### Path Parameters - **symbol** (string) - Required - Market symbol in `BASE:QUOTE` form using the exchange's currency codes (e.g. `SOMI:USDso`). The authoritative, per-environment list of live symbols and currency codes is served by `GET /v0/markets` and `GET /v0/currencies`; do not assume codes are stable across mainnet and testnet. As of writing, mainnet lists `SOMI:USDso`, `WETH:USDso`, `WBTC:USDso`, and `USDC.e:USDso`. ### Response #### Success Response (200) - **symbols** (array of TickerInfo) - List of tickers for the requested symbols. Each TickerInfo object contains: - **symbol** (Symbol) - Market symbol in `BASE:QUOTE` form - **timestamp** (integer) - Time the ticker was computed (server "as of" time), not a trade time. Unix Timestamp (ms). - **lastTradeAt** (integer, nullable) - Time of the most recent trade on this market, regardless of the 24h window. Null if the market has never traded. Use this to distinguish "no trades recently" (stale OHLCV, but the market exists and may have depth) from "never traded". - **open** (string) - 24-hour opening price (first trade), "0" if no trades in the period. Price as decimal string. - **high** (string) - 24-hour high price, "0" if no trades in the period. Price as decimal string. - **low** (string) - 24-hour low price, "0" if no trades in the period. Price as decimal string. - **close** (string) - 24-hour closing price (last trade), "0" if no trades in the period. Price as decimal string. - **volume** (string) - 24-hour total trade volume, "0" if no trades in the period. Quantity as decimal string. #### Response Example { "symbols": [ { "symbol": "SOMI:USDso", "timestamp": 1700000000000, "lastTradeAt": 1700000000000, "open": "1.23456789", "high": "1.23456789", "low": "1.23456789", "close": "1.23456789", "volume": "100.5" } ] } ### Error Response (400) When any requested symbol is not a known market, the whole request is rejected with 400 `invalid_param`. The all-markets path (no `symbols` filter) always returns 200. ### Servers - Mainnet (production): https://api.dreamdex.io - Testnet (staging): https://stg.api.dreamdex.io ``` -------------------------------- ### GET /v0/trades/mine Source: https://docs.dreamdex.io/developers/http-api/trading.md Returns the authenticated user's executed trades for a specific market, including trades where the user was either the taker or the maker. Trades are returned newest-first. ```APIDOC ## GET /v0/trades/mine ### Description Returns the authenticated user's executed trades for a specific market. Includes trades where the user was either the taker or the maker. Each trade includes the price, quantity, side, and timestamp. Trades are returned newest-first (reverse chronological order). ### Method GET ### Endpoint /v0/trades/mine ### Parameters #### Path Parameters - **symbol** (string) - Required - Market symbol in `BASE:QUOTE` form (e.g. `SOMI:USDso`). #### Query Parameters - **since** (integer) - Optional - Return trades after this unix millisecond timestamp. - **limit** (integer) - Optional - Maximum number of trades to return (default 100, max 1000). - **cursor** (string) - Optional - Opaque pagination token from a prior response's `nextCursor`. Omit on the first request; pass the previous response's value unchanged to retrieve the next page. The decoder rejects malformed cursors with `400 invalid_param`. ### Response #### Success Response (200) - **trades** (array of Trade) - List of executed trades, newest-first. - **nextCursor** (string) - Opaque pagination token for the next page. Absent when there are no further pages. #### Trade Object - **id** (string) - Unique trade identifier. - **symbol** (string) - Market symbol. - **side** (string) - Trade side (e.g., buy/sell). - **price** (number) - Execution price. - **amount** (number) - Quantity traded. - **cost** (number) - Total cost of the trade. - **timestamp** (integer) - Unix millisecond timestamp of the trade. - **maker** (string) - Wallet address of the resting (maker) order owner. Only present when the request carries a bearer token with the `trades:read_any` scope; omitted otherwise. - **taker** (string) - Wallet address of the aggressing (taker) order owner. Only present when the request carries a bearer token with the `trades:read_any` scope; omitted otherwise. - **txHash** (string) - On-chain transaction hash of the fill. ```