> ## Documentation Index
> Fetch the complete documentation index at: https://docs.berachain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Swaps

> Single-hop and multi-hop swaps, routing, and slippage settings.

BEX lets you exchange one token for another when liquidity exists for the pair. Use the BEX interface on Bera Hub (navbar) for swaps.

<Frame>
  <img src="https://mintcdn.com/berachain-422fce37/6LKWuTvY60eeSRVD/images/bex/bex-swaps-modal-route.png?fit=max&auto=format&n=6LKWuTvY60eeSRVD&q=85&s=2dad294548b578ab4ce983ee62281219" alt="BEX swap modal showing the selected token pair and swap route" width="1050" height="1226" data-path="images/bex/bex-swaps-modal-route.png" />
</Frame>

## Single-hop and multi-hop swaps

If adequate liquidity exists in a given pair, BEX most likely executes the swap as a *single hop*. Single-hop swaps incur less exchange and gas fees, making them the preferred method.

However, when a trade between the input and output token does not provide the best overall price (or the trading pair does not exist as a single pool), BEX can perform a *multi-hop swap*. Multi-hop swaps involve chaining swaps across multiple pools to find the best overall price. The process of finding a cost-efficient multi-hop path is called *routing*.

### Intermediate tokens

In a multi-hop swap, *intermediate tokens* are the tokens held temporarily when swapping through a sequence of pairs. Intermediate tokens in BEX are never transferred because settlement occurs based on the net debit against the entire BEX protocol.

<Frame>
  <img src="https://mintcdn.com/berachain-422fce37/6LKWuTvY60eeSRVD/images/bex/bex-swaps-multi-hop-route.png?fit=max&auto=format&n=6LKWuTvY60eeSRVD&q=85&s=3a7b19300a871e980f1bb5004a883c52" alt="BEX swap modal showing a multi-hop route with intermediate tokens" width="1092" height="1416" data-path="images/bex/bex-swaps-multi-hop-route.png" />
</Frame>

## Swap parameters

When initiating a swap, you can define the following parameters:

* **Quantity**: The amount of tokens to swap, which can be specified as either a fixed input quantity or a fixed output quantity.
* **Slippage**: The maximum acceptable difference between the expected and actual price of the trade. Slippage is expressed as a percentage and represents the worst-case price impact you are willing to accept. If the actual price impact exceeds this threshold, the swap transaction will revert.

<Frame>
  <img src="https://mintcdn.com/berachain-422fce37/6LKWuTvY60eeSRVD/images/bex/bex-swaps-slippage-settings.png?fit=max&auto=format&n=6LKWuTvY60eeSRVD&q=85&s=3fe67822b7f53dd26731b11d2ad7ab8c" alt="BEX swap slippage settings panel for configuring maximum slippage tolerance" width="1078" height="1448" data-path="images/bex/bex-swaps-slippage-settings.png" />
</Frame>
