> For the complete documentation index, see [llms.txt](https://docs.ethgas.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ethgas.com/orderflow/how-it-works.md).

# How it works

The engine keeps the submission path regional and Redis-backed. PostgreSQL receives durable projections asynchronously and is not required to answer an orderflow submission.

```mermaid
sequenceDiagram
    participant O as Originator
    participant E as ETHGas Engine
    participant S as Searcher
    participant B as Builders
    O->>E: Signed transaction or bundle
    E-->>O: Transaction or local bundle hash
    E->>S: Unsigned decoded transactions
    S->>E: Reference + signed backrun
    E->>B: Expanded bundle
    B-->>E: Builder result
    E-->>O: Tracking and refund record
```

## Flow overview

1. An originator submits a signed raw transaction or bundle.
2. The engine validates its envelope and chain ID, admits it atomically, and forwards it to every configured builder.
3. Authorized searchers receive the decoded transactions without raw bytes or signatures.
4. A searcher references the last transaction hash in the originator orderflow and appends its own signed transactions.
5. The engine expands the reference server-side, applies the originator refund policy, and forwards the bundle.
6. Tracking reflects builder responses. Finalized on-chain builder payments can become originator refund liabilities and payouts.

## Privacy boundary

Searchers see decoded transaction fields—including calldata—but not signed raw transaction bodies or signature fields. Configured builders receive the signed payloads needed for execution. Do not submit secrets in transaction calldata.

## Lifecycle

| Status      | Meaning                                                         |
| ----------- | --------------------------------------------------------------- |
| `PENDING`   | Accepted; no terminal builder result is available.              |
| `FORWARDED` | At least one builder accepted the submission.                   |
| `REJECTED`  | Processing failed or all applicable builder submissions failed. |
| `CANCELLED` | A searcher replacement group was cancelled.                     |
| `UNKNOWN`   | No matching hash is visible to the tracking service.            |

Only `PENDING` is non-terminal. `UNKNOWN` can be temporary immediately after submission because tracking projections are asynchronous.


---

# 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.ethgas.com/orderflow/how-it-works.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.
