> For the complete documentation index, see [llms.txt](https://infi-1.gitbook.io/infi-litepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infi-1.gitbook.io/infi-litepaper/architechture/readme.md).

# Adapter Pattern

Adapters are specialized, individual smart contracts that act as translators or intermediaries between the generic [InfiRouter](/infi-litepaper/architechture/readme-1.md) and the unique interfaces and functionalities of specific underlying DEX protocols.<br>

* **Protocol-Specific Logic**: Each Adapter contains the necessary logic to interact directly with its target DEX’s smart contracts<br>
* **Standardized Interface** (IAdapter.sol): To ensure interoperability and allow the InfiRouter to treat all DEX integrations uniformly, every Adapter contract *must* implement the IAdapter interface.
* **Benefits of Modularity**:<br>

  – Extensibility: Integrating a new DEX protocol becomes a matter of developing a new Adapter contract conforming to the IAdapter interface and registering its address with the InfiRouter via the administrative functions. The core router logic remains unchanged.<br>

  – Maintainability: Updates or fixes specific to a single DEX integration can be handled by upgrading only the relevant Adapter contract, minimizing disruption to the overall system.<br>

  – Isolation: Potential issues or complexities within one DEX integration are largely contained within its specific Adapter contract.


---

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

```
GET https://infi-1.gitbook.io/infi-litepaper/architechture/readme.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.
