> For the complete documentation index, see [llms.txt](https://exliquid.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://exliquid.gitbook.io/docs/architecture/trading-lifecycle.md).

# Trading lifecycle

A trading action moves through several externally meaningful stages before the resulting order, fill or position change should be treated as final.

![Exliquid trading lifecycle](https://1310468402-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuAWTUuLpxZ37CPZEwFWV%2Fuploads%2Fgit-blob-3eb12e8d6a234f68b13170f7d0f4c253bf03a7c5%2Ftrading-lifecycle.svg?alt=media)

## 1. Build an action

The client creates an explicit trading action such as placing or cancelling an order. The action includes the network, account, nonce and validity information required by the current protocol.

## 2. Sign

The user or authorized agent signs the typed transaction representation.

Applications should show the intended action clearly before requesting a signature. See [Transactions and signing](/docs/developers/transactions-and-signing.md).

## 3. Submit

The signed transaction is submitted through the REST API or a supported SDK.

A successful submission response means the request has entered the network submission flow. It does **not** by itself mean that the trading action has been committed successfully.

## 4. Network ordering

The network determines the transaction order used for execution. For order-book trading, this ordered history is important because it contributes to deterministic order priority and state changes.

## 5. Native trading execution

The trading engine applies the action against the current market and account state. Depending on the action, execution can update:

* orders and fills;
* balances and fees;
* positions and PnL;
* funding and margin;
* risk and liquidation state.

A transaction can be valid at the protocol level but still be rejected for a trading reason, such as insufficient margin or an invalid order condition.

## 6. Confirmation

Clients should wait for committed transaction status before treating the result as final for account or trading decisions.

Use the transaction confirmation endpoint and then reconcile the affected order, balance or position state.

## 7. Real-time updates

WebSocket streams can notify the client about market and account changes after subscription. Because connections can drop or miss data, clients must support snapshot/resume or resynchronization behavior rather than treating one socket connection as permanent history.

## Recommended client rule

```
submission accepted ≠ trading result committed
```

Retain the transaction ID and idempotency key until confirmation is known, and use committed REST/account state to reconcile important trading outcomes.


---

# 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://exliquid.gitbook.io/docs/architecture/trading-lifecycle.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.
