# Decentralized Exchange

{% hint style="info" %}
**Increment Swap** is a *dual-mode* decentralized exchange (DEX) on Flow blockchain supporting both **volatile pairs** (adopting Uniswap-V2 CPAMM curve, suitable for uncorrelated assets like `Flow/USDC`) and **pegged pairs** (adopting Solidly-Stableswap curve, suitable for correlated assets like `USDC/FUSD`, `Flow/stFlow`, et al.).

It allows users to create arbitrary trading pairs between fungible tokens in a permissionless way, including basic functionalities like `CreatePair`, `AddLiquidity`, `RemoveLiquidity`, `Swap`, `TWAP-Oracle`, `Flashloan`, etc.

* It adopts the factory pattern that each unique trading pair is deployed using the `SwapPair` template file, with a factory contract storing all deployed pairs.
* On-chain time-weighted average price oracle of each of the trading pair is supported by snapshoting cumulative data on the first call of any block. Developers can choose different window size to support different TWAP data.
* The trading fee is set to `0.3%` for volatile pairs and `0.04%` for pegged pairs by default. All of the trading fees goes to liquidity providers (LP) initially. However, there's a switch that factory admin can opt to turn on to earn `1/6` of the trading fees.&#x20;
* There're several fee parameters configurable by the factory admin:
  * Trading fee of volatile pairs (default to 0.3%)
  * Trading fee of pegged pairs (default to 0.04%)
  * Rate of flashloan repayment (default to 0.05%)
  * feeTo switch (default off, i.e. no protocol cut from the trading fees)
  * protocol fee cut (default to 0% as feeTo is off, once feeTo is on it's default to 1/6)<br>
    {% endhint %}


---

# 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.increment.fi/protocols/decentralized-exchange.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.
