> For the complete documentation index, see [llms.txt](https://doc.torch.finance/dex/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.torch.finance/dex/getting-started/architecture/meesage-flows/swap.md).

# Swap

![TorchSwapFlow](https://hackmd.io/_uploads/rkPeVeJIyl.png)

Torch’s Stable Swap mechanism effectively reduces slippage during swaps, providing a more cost-efficient trading experience. Below is a detailed breakdown of the swap process:

1. **Asset Transfer to Vault**
   * Users transfer the asset they wish to swap (swap in asset) to the corresponding Vault contract.
2. **Vault Notifies Pool**
   * Once the Vault receives the asset, it sends an `op::swap_internal` message to the Pool contract, initiating the swap calculation.
3. **Pool Calculates and Notifies Vault**
   * After the calculation, the Pool determines the amount of the swap out asset and sends an `op::payout` message to the Vault responsible for the swap out asset.
   * The Vault then transfers the swapped asset to the user’s designated address as instructed.
4. **Cross-Pool Swap Operations**
   * If the swap involves cross-pool operations, the Pool includes swap details and sends an `op::swap_between` or `op::withdraw_between` message to the next Pool to continue the swap process.
   * A detailed explanation of cross-pool operations will be provided in the [following sections](https://hackmd.io/WUJkKbNOSeujHtjYyB73uA?view#Cross-Pool-Operations).
