> For the complete documentation index, see [llms.txt](https://atlantisfi.gitbook.io/arbiswap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://atlantisfi.gitbook.io/arbiswap/protcol/trade.md).

# TRADE

**Token swaps** on ArbiSwap are a simple way to trade one ERC-20 token for another via automated liquidity pools.&#x20;

To make a swap transaction successful, the user has to pick an input and output token *(i.e. ETH vs ARBI)*, specify the exact amount of either:

* The {input.token} he wants to trade, the protocol calculates how much of the {output.token} he will receive, but `Arbi Swap Router` will also at the same time look for the best route to pass by:`require(SharkyLibrary.getAmountsOut(factory, amountIn, path)[lastIndex] > UniswapLibrary.getAmountsOut(factory, amountIn, path)[lastIndex]);`

If he finds a cheaper way, he will make the swap pass by another router and will pay for the user the asked fees.

The {output.token} he want to receive, the smart-contract calculates how much of the {input.token} he need to trade, and use the exact same call than above to find the best route to pass by.

When you make a token swap (trade) on the exchange you will pay a **0.25% trading fee**, which is broken down as follows:

**0.25%** - Returned to $ARBI stakers in the form of a revenue generated by exchange.&#x20;
