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

# How an order travels

## The path

```
Your wallet
  USDC collateral on Lighter, keys on your device
        |
        v
NockTrade terminal (your browser)
  reads venue data over WebSocket
  prices the order in the cost ledger
  signs the order locally in WASM
  attaches the integrator fee
        |
        v
Lighter
  matching, funding, liquidation, settlement
```

## Who does what

**Lighter** is the exchange: a zero-knowledge rollup order book that matches orders, computes funding, runs the liquidation engine and settles in USDC. All prices, candles, books, trades and account state in NockTrade are read live from Lighter.

**NockTrade** is the interface and integrator: market discovery, charting, the cost ledger, order construction with exact per-market precision, local signing, and routing. Our revenue is the disclosed integrator fee attached to orders — nothing else.

**Your browser** is where the sensitive work happens: key generation, key storage and order signing all run client-side. There is no NockTrade backend in the order path.

## Live data discipline

Market data arrives over persistent WebSocket streams — order book deltas with sequence integrity checks, trade prints, mark prices and account state. REST is used once per view for history and metadata, never polled for live prices. If a stream breaks, the terminal reconnects and resynchronizes from a fresh snapshot rather than showing stale data as current.

## What this architecture refuses to do

* No server-side key storage: nothing to breach.
* No off-venue price sources presented as the market: the market you see is the market your order meets.
* No synthetic data: empty books and thin histories are shown as what they are.


---

# 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.nocktrade.xyz/concepts/architecture.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.
