# Aggregator

DerpDEX uses [XY Finance](https://xy.finance/) for price aggregation which provides cost efficient swaps and checks from multiple liquidity sources. This allows DerpDEX to find the best trade for the swap and determine what would be the slippage based on the current liquidity.

{% hint style="info" %}
We replaced 1inch aggregator with XY Finance because they offer additional liquidity sources for various token assets and support more blockchains. We decided to integrate XY Finance as our aggregator partner because they aggregated multiple DEX aggregators, including 1inch. This helps our users to gain more exposure to different liquidity sources.
{% endhint %}

Key features of DerpDEX aggregator:

* Best Rate Calculation: The XY Finance aggregator computes the rates offered by different liquidity sources and selects the most competitive one, ensuring users get the best possible rates for their swaps.
* Optimal Route Finding: By evaluating liquidity pools and order books across multiple DEXs, the aggregator identifies the most efficient route for token swaps, minimizing slippage and maximizing the amount of tokens received.
* Gas Cost Optimization: The XY Finance aggregator considers gas fees on different networks and smartly routes trades to minimize transaction costs, saving users money on each swap.
* Trade Execution: Once the best route is determined, the aggregator executes the trade swiftly, providing a seamless user experience and reducing the time required for token swaps.


---

# 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://derpdex.gitbook.io/home/protocol/aggregator.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.
