> 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 transaction
    S->>E: Reference + signed backrun
    E->>B: bundle/transaction
    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 forwards the bundle and transaction.
6. Tracking and refunds endpoints reflect the status of transaction, bundle and refund.

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

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

```
GET https://docs.ethgas.com/orderflow/how-it-works.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.
