# Swaps

> Convert between fiat and stablecoins on your balance (on and off ramp).

Section: Payouts & Swaps
Source: https://coincircuit.io/docs/guides/swaps/
Interactive version: https://coincircuit.io/api-reference?tab=guides&guide=swaps

## API reference

- GET `/api/v1/swap/estimate`: [Estimate a swap](https://coincircuit.io/api-reference/#tag/swap/GET/api/v1/swap/estimate)
- POST `/api/v1/swap/quotation`: [Create a quotation](https://coincircuit.io/api-reference/#tag/swap/POST/api/v1/swap/quotation)
- POST `/api/v1/swap/execute/{quotationId}`: [Execute a swap](https://coincircuit.io/api-reference/#tag/swap/POST/api/v1/swap/execute/{quotationId})
- GET `/api/v1/swaps`: [List swaps](https://coincircuit.io/api-reference/#tag/swap/GET/api/v1/swaps)

A swap converts from one currency to another at a rate you lock first. Move between a stablecoin (USDC or USDT) and fiat (NGN) to turn crypto you have received into cash, or to top up stablecoins to pay out. You get a quote, lock it, and CoinCircuit settles the conversion on your balance.

![Swap between assets](https://coincircuit.io/images/features/swaps.png)

## How it works
1. Check the rate with `GET /api/v1/swap/estimate`.
2. Lock a quote with `POST /api/v1/swap/quotation` (returns a `quotationId` with a short expiry).
3. Re-check a quote with `GET /api/v1/swap/quotation/{quotationId}`.
4. Execute before it expires with `POST /api/v1/swap/execute/{quotationId}`.
5. List swaps with `GET /api/v1/swaps` and `GET /api/v1/swaps/{id}`.

## Use cases
- Converting to stablecoins after a sale
- Moving the same asset across chains
- Preparing an asset for a payout

> A quote expires after a short time. Execute it before then, or request a new one.
