# Architecture

Following diagram depicts the architecture of LogX Aggregator.

<figure><img src="/files/EtcyZckUC80w70xxeQVt" alt=""><figcaption></figcaption></figure>

User's trade request is sent to LogX Aggregator ProxyFactory via the Transferable Upgradeable proxy Contract.

For each unique User Address, Collateral Token, Underlying Token, isLong (true if position is long and false if position is short), a User Position Contract is created which will interact with the Exchange Contracts. The ProxyFactory contract makes sure each trade request is routed to the right User Position Contract.

The User Position Contract handles opening and closing trades, placing, modifying and cancelling orders and getting information related to the user's position.


---

# 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://logx-1.gitbook.io/logx-docs/logx-aggregator/technical-guide/architecture.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.
