> For the complete documentation index, see [llms.txt](https://www.aevo.xyz/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.aevo.xyz/docs/api-reference/websocket-api/private-operations/publish-create-order.md).

# PUBLISH Create Order

## Request

| Field                   | Type    | Required | Description                                                                                                                                                                                                                             |
| ----------------------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `op`                    | string  | Yes      | Operation code: `create_order`                                                                                                                                                                                                          |
| `data.instrument`       | string  | Yes      | Instrument ID number. Example: `12`                                                                                                                                                                                                     |
| `data.maker`            | string  | Yes      | Account's Ethereum address.. Example: `0xYourAccountAddress`                                                                                                                                                                            |
| `data.is_buy`           | boolean | Yes      | True for long order, false for short order. Example: `12`                                                                                                                                                                               |
| `data.amount`           | string  | Yes      | Number of contracts. In 6 decimals fixed number. Example: `1000000`                                                                                                                                                                     |
| `data.limit_price`      | string  | Yes      | Order limit price. In 6 decimals fixed number. Example: `1000000`                                                                                                                                                                       |
| `data.salt`             | string  | Yes      | A randomly generated number to guarantee transaction uniqueness. Example: `12345678`                                                                                                                                                    |
| `data.timestamp`        | string  | No       | Timestamp used in order signing in UNIX timestamp in seconds.. Example: `1680249600`                                                                                                                                                    |
| `data.signature`        | string  | Yes      | Hash of order payload signature signed by the account.                                                                                                                                                                                  |
| `data.post_only`        | boolean | No       | Flag to indicate that the order is a maker order, or is immediately rejected if it is a taker order.                                                                                                                                    |
| `data.time_in_force`    | string  | No       | Can be set to GTC or IOC (GTC is set by default)                                                                                                                                                                                        |
| `data.mmp`              | boolean | No       | Flag to include the order into MMP (false by default)                                                                                                                                                                                   |
| `data.builder_id`       | string  | No       | Builder to attribute this order to. Requires `builder_fee_rate`, and the account must have approved the builder. See [Builder Codes](/docs/api-reference/builder-codes.md). Example: `builder_0123456789abcdef`                         |
| `data.builder_fee_rate` | string  | No       | Builder fee rate as a decimal fraction, at most 6 decimals (`0.0003` = 3 bps). Must be at or below the user's approved maximum and the protocol cap. Include `builderId` and `builderFeeRate` in the order signature. Example: `0.0003` |
| `id`                    | integer | No       | Request ID, an arbitrary integer to link requests with responses. Example: `1`                                                                                                                                                          |

**Example**

```json
{
  "op": "create_order",
  "id": 1,
  "data": {
    "instrument": "11235",
    "maker": "0xYourAccountAddress",
    "is_buy": true,
    "amount": "10000000",
    "limit_price": "10000000",
    "salt": "1",
    "signature": "0x8aecd6e002780a08dc623233c4bf26f217d13483bf5d75dba49eb4eda865630631505f3dda0294c4f0b8d6b2357f2c2dc5d3c2106aed6e77e88785a6daf602701b"
  }
}
```

## Response

| Field                    | Type    | Required | Description                                                                                                              |
| ------------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------ |
| `data.order_id`          | string  | Yes      | Order ID is the hash of the order payload. Example: `0x4c43e0ab72a4edb72dfe4b129148899815d816837b9a7e22d964b884834639f8` |
| `data.account`           | string  | Yes      | Account's Ethereum address. Example: `0xYourAccountAddress`                                                              |
| `data.instrument_id`     | string  | Yes      | Instrument ID number. Example: `12`                                                                                      |
| `data.instrument_name`   | string  | Yes      | Instrument name. Example: `ETH-24DEC22-1250-C`                                                                           |
| `data.instrument_type`   | string  | Yes      | Type of instrument. Allowed values: `OPTION` `PERPETUAL`                                                                 |
| `data.expiry`            | string  | No       | Option expiry in UNIX timestamp in nanoseconds. Example: `1680249600000000000`                                           |
| `data.strike`            | string  | No       | Option strike price. Example: `2500`                                                                                     |
| `data.option_type`       | string  | No       | Type of option contract. Allowed values: `call` `put`                                                                    |
| `data.order_type`        | string  | Yes      | Order type. Allowed values: `limit` `market`                                                                             |
| `data.order_status`      | string  | Yes      | Order status. Allowed values: `opened` `cancelled` `partial` `filled`                                                    |
| `data.side`              | string  | Yes      | Trade side. Allowed values: `buy` `sell`                                                                                 |
| `data.amount`            | string  | Yes      | Amount of contracts. Example: `12.23`                                                                                    |
| `data.price`             | string  | Yes      | Price in USD. Example: `12.23`                                                                                           |
| `data.filled`            | string  | Yes      | Amount filled. Example: `10.4`                                                                                           |
| `data.initial_margin`    | string  | Yes      | Margin required to keep an open order. Example: `12.23`                                                                  |
| `data.avg_price`         | string  | No       | Average execution price in USD. Example: `12.23`                                                                         |
| `data.created_timestamp` | string  | Yes      | Created timestamp in UNIX timestamp in nanoseconds. Example: `1680249600000000000`                                       |
| `data.timestamp`         | string  | Yes      | Response timestamp in UNIX timestamp in nanoseconds. Example: `1680249600000000000`                                      |
| `data.system_type`       | string  | Yes      | System type where the order is created. Orders created via websocket will default to `API`.                              |
| `id`                     | integer | No       | Response ID, an arbitrary integer to link requests with responses. Example: `1`                                          |

**Example**

```json
{
  "id": 1,
  "data": {
    "order_id": "0x4c43e0ab72a4edb72dfe4b129148899815d816837b9a7e22d964b884834639f8",
    "account": "0xYourAccountAddress",
    "instrument_id": "12",
    "instrument_name": "ETH-30JUN23-1600-C",
    "instrument_type": "OPTION",
    "option_type": "put",
    "expiry": "1680249600000000000",
    "strike": "2500",
    "order_type": "limit",
    "order_status": "filled",
    "side": "buy",
    "amount": "12.23",
    "price": "12.34",
    "filled": "12.23",
    "initial_margin": "12.23",
    "avg_price":"12.23",
    "created_timestamp": "1680249600000000000",
    "timestamp": "1680249600000000000",
    "system_type": "API"
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.aevo.xyz/docs/api-reference/websocket-api/private-operations/publish-create-order.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
