# X-Swap

### X-Swap

A fork of [kadenaswap](https://github.com/kadena-io/kadenaswap) (a Uniswap V2 port to pact), with support for global exchange fees (equivalent to Uniswap's `_mintFee`) and time-weighted average price oracle data, with support for tracking the TWAP of longer swap paths like `[tokenA coin tokenB]`.

The code is in the `kadenaswap/` directory and the following are the main files:

* `exchange.pact`: The core of the exchange, represents all the pairs and includes code for adding and removing liquidity, swapping, oracles, and more.
* `tokens.pact`: Simple module for keeping track of liquidity tokens across all pairs. Each token is identified by a key, and has a similar interface to `fungible-v2` modules.
* `gas-station/gas-station.pact`: Module for managing the gas station that is used with the exchange.
* `exchange.repl`, `oracle.repl` and `gas-station/gas-station.repl`: Test files.


---

# 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://docs.ecko.finance/eckodao/eckodex/how-to-swap/x-swap.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.
