> ## Documentation Index
> Fetch the complete documentation index at: https://berachain-422fce37-docs-staking-pool-install-cli.mintlify.site/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-docs-staking-pool-install-cli/GpovaHpJph8S_rDh/images/bex/bex-swaps-modal-route.png?fit=max&auto=format&n=GpovaHpJph8S_rDh&q=85&s=22e0526d4d064edef058cacf5576796c" 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-docs-staking-pool-install-cli/GpovaHpJph8S_rDh/images/bex/bex-swaps-multi-hop-route.png?fit=max&auto=format&n=GpovaHpJph8S_rDh&q=85&s=1438a7cfdc9fa9a1962f695525e199b8" 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-docs-staking-pool-install-cli/GpovaHpJph8S_rDh/images/bex/bex-swaps-slippage-settings.png?fit=max&auto=format&n=GpovaHpJph8S_rDh&q=85&s=6dcc3a8afe945c40f71fd979c95ddce4" 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>
