# Swap API

The Everlong Swap API provides optimal routing and transaction generation for token swaps across supported liquidity sources.

Most integrations interact with the Everlong Router contract using calldata generated by the API.

The API handles:

* Route discovery
* Liquidity aggregation
* Transaction construction

This allows developers to integrate swaps without implementing complex routing logic.

***

### Zero Fees <a href="#zero-fees" id="zero-fees"></a>

The Everlong Router charges no additional protocol fees on swaps.

Users receive the full output of the optimised route without any hidden aggregator fees.

This ensures integrations always deliver maximum value to users.

### Positive Price Impact <a href="#positive-price-impact" id="positive-price-impact"></a>

Everlong’s routing engine is designed to maximise execution efficiency.

By intelligently aggregating liquidity across multiple pools, routes may sometimes produce positive price impact, meaning users can receive more output tokens than the expected market price.

This can occur when the routing engine:

* Identifies price imbalances across liquidity pools
* Splits trades across multiple venues
* Executes routes that capture arbitrage opportunities

### Core Contracts <a href="#core-contracts" id="core-contracts"></a>

#### Everlong Router <a href="#everlong-router" id="everlong-router"></a>

The Everlong Router is the primary contract used to execute swaps.

Most applications interact with this contract using the transaction payload returned by the Swap API.

The router coordinates swap execution across multiple liquidity sources.

***

#### Route Definition <a href="#route-definition" id="route-definition"></a>

The API generates the full swap route definition used during execution.

This route data is included in the transaction calldata returned by the /swap endpoint.

The route definition must never be modified.

Changing the route parameters can result in:

* failed transactions
* incorrect swap execution
* potential loss of funds

Always execute the transaction payload exactly as returned by the API.

***

### Execution Contracts <a href="#execution-contracts" id="execution-contracts"></a>

The underlying execution contracts used to perform swaps may change as new liquidity sources are added or routing logic evolves.

For this reason:

* Execution contracts should never be hardcoded
* Always rely on the transaction payload returned by the API
* Direct interaction with execution contracts is not recommended

***

### Rate Limits <a href="#rate-limits" id="rate-limits"></a>

Standard API keys have the following rate limits:

| Burst capacity | Refill rate            |
| -------------- | ---------------------- |
| 100 requests   | 10 requests per second |

If the rate limit is exceeded, the API returns:

```
429 Rate limit exceeded
```

[<br>](https://open-2v.gitbook.com/url/preview/site_IgQ4w/~/revisions/J17CB98xTQ3Qnt6uLSrZ/everlong-swap-api/guide)


---

# 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://router.foreverlong.io/swap-api.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.
