> ## Documentation Index
> Fetch the complete documentation index at: https://dexbuilder.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Place Orders

> Create private Prediction Markets orders through the Prediction API.

After confirming that the Market currently accepts orders, you can submit a trade for a specific Outcome Token. Public market data does not require authentication; placing an order is a private operation and requires authentication.

Production Base URL:

```text theme={null}
https://api.dexbuilder.com
```

## 1. Read Market Trading Limits

First query the Market and select the Token to trade from `outcomes[].token_id`:

```bash cURL theme={null}
curl "https://api.dexbuilder.com/api/v4/prediction/markets/<market_id>"
```

Then read the public order book:

```bash cURL theme={null}
curl "https://api.dexbuilder.com/api/v4/prediction/tokens/<token_id>/order_book?depth=20"
```

Before submitting an order, validate quantity and price against `min_order_size` and `tick_size` from the response.

## 2. Submit an Order

```bash cURL theme={null}
curl -X POST "https://api.dexbuilder.com/api/v4/broker/prediction/orders" \
  -H "Content-Type: application/json" \
  -H "KEY: ${BROKER_API_KEY}" \
  -H "SIGN: ${SIGN}" \
  -H "Timestamp: ${TIMESTAMP}" \
  -H "X-User-Wallet-Address: ${USER_WALLET}" \
  --data '{
    "token_id": "<token_id>",
    "side": "BUY",
    "price": "0.52",
    "size": "10",
    "total_cost": "5.20",
    "order_type": "GTC",
    "order_mode": "LIMIT",
    "client_order_id": "client-order-001",
    "post_only": false,
    "sell_all": false,
    "expire_time": 0
  }'
```

> [!NOTE]
>
> Use a Broker API Key and pass a wallet address that belongs to your Broker in `X-User-Wallet-Address`. Calculate `SIGN` from the actual request method, path, query string, and body. See [Broker API key and signing](https://dexbuilder.mintlify.site/en/api-reference/common/broker-authentication.md) and [Access on behalf of a user](https://dexbuilder.mintlify.site/en/api-reference/common/sub-user-wallet.md).

## Request Fields

| Field | Description |
| - | - |
| `token_id` | Outcome Token to trade |
| `side` | Order side, for example `BUY` / `SELL` |
| `price` | Limit price, as a decimal string |
| `size` | Order size, as a decimal string |
| `total_cost` | Total order cost used by some order modes |
| `order_type` | Time-in-force: `GTC`, `GTD`, `FOK`, or `FAK` |
| `order_mode` | Execution mode: `LIMIT` or `MARKET` |
| `client_order_id` | Optional client idempotency / tracking ID |
| `post_only` | Whether the order should only provide liquidity as Maker |
| `sell_all` | Whether to use the full available position when selling |
| `expire_time` | Expiration time when applicable, Unix seconds |

## Accepted Response

```json theme={null}
{
  "order_id": "order-123",
  "client_order_id": "client-order-001",
  "status": "processing",
  "created_at": 1782753357
}
```

`processing` means the order request has been accepted for processing; it does not mean the order has been filled. Query the order to check its current REST status.

## Pre-Order Checks

* The Market must have `accepting_orders: true`.
* `token_id` should come from the Market's `outcomes` array.
* `size` must satisfy `min_order_size`.
* `price` must conform to `tick_size`.
* Prices, quantities, and amounts should always be represented as strings to avoid floating-point precision issues.
* Private requests must use the official authentication scheme.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.