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

# Technical Architecture

How Everstrike combines off-chain trading with on-chain custody and withdrawals.

Everstrike uses a hybrid exchange architecture. It combines off-chain order matching with on-chain custody and settlement.

This design keeps order processing responsive. It also keeps user funds in Everstrike smart contracts.

### Architecture at a glance

Everstrike has three connected components:

* **On-chain custody and settlement** holds user funds in smart contracts. Funds are categorized by their available use.
* **Off-chain matching and risk** validates orders, applies margin checks, and matches orders through an internal order book.
* **Off-chain state channels** track balances and positions between you and the operator. They support recovery without operator cooperation.

### Order flow

1. Submit an order through the Everstrike API.
2. The risk engine validates the order and margin requirements.
3. The matching engine applies price-time priority.
4. A match updates the relevant balances and positions.
5. You receive an updated state receipt after the change.

Orders that do not match immediately remain in the order book until matched or cancelled.

### Custody and recovery

Your funds remain on-chain while you trade. Open orders and positions use locked funds as margin.

The state channel maintains a rolling record of your balances and positions. Either party can revoke it. Your latest signed state receipt enables a **Trustless Withdrawal** if the operator does not cooperate.

{% hint style="info" %}
Trustless Withdrawal is an emergency path. It has a 24-hour challenge period and fees.
{% endhint %}

### Explore the components

* [On-Chain Settlement/Custody](/technical-architecture/on-chain-settlement-custody.md) explains fund categories and gas fees.
* [Off-Chain Matching](/technical-architecture/off-chain-matching.md) explains risk checks and matching priority.
* [Off-Chain State Channel](/technical-architecture/off-chain-state-channel.md) explains the balance and position record.
* [Trustless Withdrawal](/technical-architecture/trustless-withdrawal.md) explains the emergency withdrawal process.
