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

# What Are Swaps and How to Calculate Your Gains

A swap exchanges one token for another through a smart contract. How swaps work, how to work out a gain or loss, and swapping in Leather.

A crypto swap exchanges one token for another directly from your wallet, through a smart contract. No exchange account holds your funds during the trade.

## How a swap works

* **The assets:** the token you pay with and the token you receive.
* **The contract:** a smart contract, usually a liquidity pool, that takes your token and sends the other one in the same transaction. If the terms are not met, the whole transaction reverts.

Kinds of swaps:

* **DEX swaps** trade against a liquidity pool on a decentralized exchange.
* **Aggregator swaps** compare several exchanges and route the trade to the best price.
* **Atomic swaps** trade directly between two parties, often across blockchains, with a hashed time-locked contract.

## Calculate a gain or loss

Gain or loss = value when you sell or swap out − value when you bought − fees paid.

Example: you buy bitcoin worth $50,000, later swap it when it is worth $55,000, and pay $200 in fees in total. $55,000 − $50,000 − $200 = $4,800 gain. A negative result is a loss.

Keep a record of each swap's date, amounts, prices and fees. Tax rules on swaps differ by country.

## Swap in Leather

1. On the Home screen of the extension, click "Swap".
2. Choose the asset you pay with and the asset you receive.
3. Enter the amount and click "Continue".
4. Check the review screen and click "Confirm".

BTC can only be swapped to sBTC, through the sBTC bridge. See [Stacks swaps](/stacking-and-sbtc-reference/stacks-swaps.md) and [Bridge BTC to sBTC](/sbtc/bridge-sbtc.md).

![Swap form with STX as the asset to swap](https://4209755586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaSQhveafXrLjROsW3JZ1%2Fuploads%2FYqHryCyI6LLTISrTrErP%2Fe-support-swaps-01-swap-form.png?alt=media\&token=c5d9fb33-d386-43b6-b766-5f81687dfe5b)
