# Eagle Protocol Micro Services

**The Aggregator Service** provides an API endpoint that returns a quotation for a token swap. It calculates the best route to exchange tokens using graph search, based on the data collected by the pool explorer service, which is prioritized based on available liquidity in USD. It performs price impact calculations off-chain based on the collected data in order to find the best deal for the user

**The Pool Explorer Service** makes sure that our system has all the necessary information from the integrated AMMs on each chain. Accomplishing this in two ways: it subscribes to listen to the pool contract of all the pairs of the AMMs that have been integrated and it updates token reserves of that pool in case of any swap event that it fetches and it gets the pool data from the subgraph of AMMs, and queries the subgraph to get all pairs and their reserve of all the supported AMMs.&#x20;

**The Token Provider Service** keeps the token list up to date, whenever there is any pool creation event detected by the pool explorer service then token service checks whether there is any new token that needs to be added to the token list and adds new token if it is not present in the token list already. It also collects and stores USD price data for all tokens that are emitted by the aggregator service.&#x20;

**The User Service** keeps track of user balances and transactions, provides an api that is used by frontend user interface to get user swap transaction status&#x20;

**The Relayer Service** listens to swappedIn event on all supported chains, it queries wormhole guardian network to get VAA for any swapIn transaction and then it calls swapOut on the target chain&#x20;

Finally, the Message Broker handles the communication between the services.


---

# 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://eagle-protocol.gitbook.io/eagle-protocol-litepaper/eagle-protocol-micro-services.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.
