> For the complete documentation index, see [llms.txt](https://docs.anchored.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anchored.finance/trading-api/reference/enums.md).

# Enums & Constraints

## Header enums

| Field            | Allowed values                                   |
| ---------------- | ------------------------------------------------ |
| `x-api-chain-id` | `8453`, `1`, `143`, `11155111`, `10143`, `84532` |
| `x-api-p`        | `Anchored`                                       |

## Permission enums

| Field    | Values      | Description        |
| -------- | ----------- | ------------------ |
| `access` | `READ_ONLY` | GET only.          |
| `access` | `WRITABLE`  | GET, POST, DELETE. |

## Order enums

| Field           | Values                         | Description                                                                                                                                                                    |
| --------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `side`          | `Buy`, `Sell`                  | Direction.                                                                                                                                                                     |
| `type`          | `Market`, `Limit`              | Order type.                                                                                                                                                                    |
| `timeInForce`   | `DAY`                          | Limit TIF. The contract enum includes `GTC`, `OPG`, `IOC`, `FOK`, `GTX`, `GTD`, and `CLS` for forward compatibility, but current production contracts reject non-`DAY` values. |
| `operationType` | `trade`, `deposit`, `withdraw` | Mapping type.                                                                                                                                                                  |

> Production limit orders currently only accept `DAY`; other `timeInForce` values will make the order transaction revert.

### Order status (mapped)

| Value            | Description             |
| ---------------- | ----------------------- |
| `Init`           | Initial.                |
| `Pending`        | Recorded or processing. |
| `New`            | New order identified.   |
| `Partial filled` | Partial fill.           |
| `Filled`         | Filled.                 |
| `Canceled`       | Canceled.               |
| `Expired`        | Expired.                |
| `Rejected`       | Rejected.               |
| `Failed`         | Failed.                 |

### On-chain status

| Value       | Description       |
| ----------- | ----------------- |
| `placing`   | Processing.       |
| `canceling` | Cancel in flight. |

### Broker raw status

```
init, pending, failed, new, partially_filled, filled, done_for_day,
canceled, expired, replaced, pending_cancel, pending_replace, accepted,
pending_new, accepted_for_bidding, stopped, rejected, suspended, calculated
```

## Cash status

### operationStatus

| Value        | Description |
| ------------ | ----------- |
| `requested`  | Requested.  |
| `processing` | Processing. |
| `settled`    | Settled.    |
| `closed`     | Closed.     |

### mappingStatus

Same as order mapping status enum above.

## Market data enums

### K-line interval

| Value | Description |
| ----- | ----------- |
| `1m`  | 1 minute    |
| `3m`  | 3 minutes   |
| `5m`  | 5 minutes   |
| `15m` | 15 minutes  |
| `1h`  | 1 hour      |
| `1d`  | 1 day       |
| `1w`  | 1 week      |

### Adjustment type

| Value      | Description    |
| ---------- | -------------- |
| `raw`      | No adjustment. |
| `split`    | Split.         |
| `dividend` | Dividend.      |
| `spin-off` | Spin-off.      |
| `all`      | All (default). |

### Corporate action types

| Value             | Description     |
| ----------------- | --------------- |
| `reverse_splits`  | Reverse split.  |
| `forward_splits`  | Forward split.  |
| `unit_splits`     | Unit split.     |
| `stock_dividends` | Stock dividend. |
| `cash_dividends`  | Cash dividend.  |

## Value constraints

| Field          | Constraint                                                                                                                       |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `stockAddress` | Valid EVM address. Lowercased by server.                                                                                         |
| `userAddress`  | Valid EVM address.                                                                                                               |
| `tokenAddress` | Valid EVM address.                                                                                                               |
| `quantity`     | > 0 in API input. Stock order quantities must encode to an 18-decimal WAD multiple of `1e9` (broker-facing 9-decimal precision). |
| `notional`     | > 0. Market-buy USD amount must use the production USD step: `0.01` when amount is `>= 1`, or `0.0001` when amount is `< 1`.     |
| `price`        | > 0. Limit price must use the production USD step: `0.01` when price is `>= 1`, or `0.0001` when price is `< 1`.                 |
| `tokenAmount`  | > 0, decimals ≤ token decimals, raw ≤ uint96.                                                                                    |
| `creditAmount` | > 0, up to 18 decimals, raw ≤ uint96.                                                                                            |
| `deadline`     | Unix seconds, > 0, ≤ `4294967295`.                                                                                               |
| `orderId`      | bytes32 hex (64 chars) for cancel.                                                                                               |
| `signature`    | 65-byte hex for One Click enable.                                                                                                |
| `gasLimit`     | Optional; server estimates if empty or ≤ 0.                                                                                      |


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.anchored.finance/trading-api/reference/enums.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
