> For the complete documentation index, see [llms.txt](https://tektias.gitbook.io/tektias/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tektias.gitbook.io/tektias/getting-started/design-components/high-performance-exchange.md).

# High-Performance Exchange

**An off-chain system that manages all aspects of trading**

The exchange component of TEKTIAS mirrors the performance of top centralized exchanges. This design allows TEKTIAS to match centralized exchanges in terms of latency and throughput — offering a level of performance that is rarely available from other decentralized exchanges (DEXs).

#### Trading Engine

TEKTIAS leverages an off-chain trading engine for order execution, bringing:

* **Extreme performance:** Capable of processing tens of thousands of orders per second with millisecond latency.
* **Guaranteed sequencing:** Orders are executed in the exact order they are received by the server, ensuring fairness and transparency.

This is in stark contrast to most DEXs, which execute trades directly on-chain, leading to:

* **Low throughput and high latency:** Blockchain transactions can create slow and inefficient trading experiences.
* **Non-deterministic ordering:** Miners and validators decide which transactions are included and in what order, opening the door to potential manipulation.

The TEKTIAS trading engine delivers a responsive and smooth user experience, shielding users from issues like failed trades, front-running, and sandwich attacks that often plague on-chain DEXs.

#### Order Book

Paired with the high-performance trading engine is an off-chain order book. This combination minimizes gas costs and maximizes the benefits of the trading engine.

Orders on TEKTIAS are represented by signed transactions that include the price, amount, and other parameters. These orders pass through the trading engine, where they are processed and either:

* Matched and executed immediately when overlapping with existing liquidity.
* Placed on the order book as a new limit order when no immediate match is found.

When orders match, a trade is executed. Both traders' balances update in real time, allowing them to continue trading immediately with their new balances. At the same time, the completed trade is sent to the network for settlement.

On-chain transactions only occur during the settlement of matched trades. Users can place and cancel orders as frequently as they like without incurring additional network costs. Real-time order placement and cancellation enable more advanced market-making and trading strategies.

#### Advanced Orders

The high-performance trading engine also supports advanced order types typically found only on centralized exchanges. These include:

* **Stop-Loss:** Automatically triggers an order when the market reaches a specified price.
* **Post-Only:** Ensures the order adds liquidity to the order book and avoids taker fees.
* **Fill-Or-Kill (FOK):** Executes the entire order immediately or cancels it entirely.

These advanced order types empower traders to execute sophisticated strategies, providing the flexibility and efficiency typically unavailable on traditional DEXs.

For a comprehensive list of order types, see the *Order Types* section, and for detailed explanations, refer to the TEKTIAS API documentation.


---

# 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://tektias.gitbook.io/tektias/getting-started/design-components/high-performance-exchange.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.
