# Optimization Layer

The optimization layer is the brain behind the Grix protocol, where the route optimization decisions are made. As part of the protocol’s model, it “outsources” part of the heavy calculation to [solvers](/grix/grix-protocol/solvers-network.md) that specialize in finding the optimal route for the order flow. In order to facilitate and incentivize the solvers, there are many small processes happening before and after the route calculations - all done by **Socrates** component.

Socrates serves as the manager within the optimization layer, tasked with the key role of parsing incoming order flow, and managing the route optimization auction. Socrates oversees the competitive routing process, where solvers provide solutions for the optimal trade. It processes the solutions offered by solvers and organizes them into prioritized batches, ensuring that the most efficient and effective solutions are queued for execution. To make sure the winning solver is not acting in bad faith,  verification of routes and transaction simulations are applied.

The significant components and functions operated by the Optimization Layer is indicated in the following simplified overview:

<figure><img src="/files/cDXvvOAPhBqLTfP7oQiD" alt=""><figcaption><p>The Optimization Layer</p></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.grix.finance/grix/grix-protocol/optimization-layer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
