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

# Exchange Rates

> Understand floating and locked exchange rates for currency conversions

An exchange rate sets the conversion value between currencies when you run a transaction. Two conversion directions are supported:

* Fiat to stablecoin (e.g. USD to USDC).
* Stablecoin to fiat (e.g. USDT to BRL).

Rates move with market conditions, liquidity, and the pair you're converting.

## Exchange rate types

### Floating rate

A floating rate is a real-time reference rate without a price lock. Use it to show estimated conversion amounts in your UI.

The actual rate applied at execution time may vary slightly with market conditions. No fee.

Example: display an estimated conversion amount before a user confirms a transaction.

### Locked rate

A locked rate guarantees the exact conversion rate for a specific time window. When you request one, you get an `exchangeRateId` that locks in the quoted rate. Pass that ID on the transaction request to settle at the quoted rate.

Available durations: 30s, 1m, and 5m. The 30-second lock has no fee. Longer durations include a fee to cover volatility risk.

If the lock expires before the transaction is submitted, the `exchangeRateId` is no longer valid — request a new rate to continue.

Example: quote a guaranteed price to a customer so they have time to review and confirm before the rate expires.

Request a locked rate:

```bash POST /exchange-rates theme={null}
curl https://api-sandbox.lumx.io/exchange-rates \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "type": "LOCKED",
    "rail": "PIX",
    "sourceCurrency": "BRL",
    "targetCurrency": "USDC",
    "sourceAmount": "59255.50",
    "timelock": "1m"
  }'
```

```json Response theme={null}
{
  "id": "123e4567-e89b-12d3-a456-426614174001",
  "type": "LOCKED",
  "rail": "PIX",
  "sourceCurrency": "BRL",
  "sourceAmount": "59255.50",
  "targetCurrency": "USDC",
  "baseTargetAmount": "10000.000000",
  "baseExchangeRate": "5.9255",
  "finalTargetAmount": "9978.000000",
  "finalExchangeRate": "5.9386",
  "expiresAt": "2026-05-05T00:00:00Z"
}
```

Pass the returned `id` as `exchangeRateId` on the transaction request to settle at the quoted rate:

```json POST /transactions (excerpt) theme={null}
{
  "exchangeRateId": "123e4567-e89b-12d3-a456-426614174001"
}
```

## Rate comparison

| **Feature**     | **Floating rate**                 | **Locked rate**                  |
| :-------------- | :-------------------------------- | :------------------------------- |
| Rate guarantee  | No                                | Yes                              |
| Lock duration   | N/A                               | 30s, 1m, 5m                      |
| Amount inputs   | Source amount only                | Source or target amount          |
| Expiration      | No                                | Yes                              |
| Additional fees | No                                | No for 30s, Yes for 1m+          |
| Best for        | Immediate execution, low friction | Guaranteed pricing, exact quotes |

## Related resources

<CardGroup cols={2}>
  <Card title="Transactions" href="/concepts/transactions">
    Apply exchange rates when moving funds between currencies.
  </Card>

  <Card title="Coverage" href="/get-started/coverage">
    Supported currency pairs and conversion routes.
  </Card>
</CardGroup>
