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

# Rates & Settlement

> How exchange rates are applied and how funds are delivered

## Overview

Rates and settlement define **how value moves** through the Daya API:

* **Rates** determine *how much* stablecoin a deposit converts into
* **Settlement** determines *where* the converted funds are delivered

These rules are deterministic and depend on the funding account type and settlement destination.

***

## Rates

A **rate** is a firm FX quote used to convert between NGN and stablecoins.

Each rate includes:

* A fixed exchange rate
* A **side** (`BUY` or `SELL`)
* A defined validity window (TTL)
* A unique `rate_id` for funding account settlement requests that need a firm quote

### Buy vs Sell Rates

| Side   | Use Case                                                                     |
| ------ | ---------------------------------------------------------------------------- |
| `BUY`  | Merchant is buying crypto (receiving NGN deposits, converting to stablecoin) |
| `SELL` | Merchant is selling crypto (converting stablecoin to NGN settlement)         |

<Note>
  New rates are generated approximately every **10 minutes** and expire about **30 minutes** after creation.
</Note>

***

## Rate Properties (Conceptual)

Each rate defines the following attributes:

| Property      | Meaning                                                      |
| ------------- | ------------------------------------------------------------ |
| `rate_id`     | Identifier used to bind a funding account settlement request |
| `from` / `to` | Source and destination currencies                            |
| `side`        | `BUY` or `SELL`                                              |
| `rate`        | Conversion rate                                              |
| `expires_at`  | When the rate becomes invalid                                |

Rates are **immutable** once published.

***

## Rate Semantics by Funding Account Type

How a rate is applied depends on the funding account.

### Temporary Funding Accounts (Firm Rates)

Temporary funding accounts that use a quoted conversion are **bound to a specific `rate_id` at creation**.

* Deposits received **within the validity window** execute at the bound rate
* Deposits received **after expiry** do not settle automatically
* No slippage occurs within the validity window

This includes:

* Temporary `NGN_VIRTUAL_ACCOUNT` funding accounts that settle to `INTERNAL_BALANCE`
* Temporary `NGN_VIRTUAL_ACCOUNT` funding accounts that settle through `ONCHAIN`
* Temporary `CRYPTO_ADDRESS` funding accounts that settle through `NGN_PAYOUT`

<Info>
  This provides price certainty for time-sensitive or one-time transactions.
</Info>

***

### Permanent NGN Funding Accounts (Floating Rates)

Permanent NGN funding accounts are **not bound** to a specific rate.

* Each deposit uses the **current rate** at the time of execution
* Rates may differ between deposits on the same funding account
* Subject to market movement and spread

<Info>
  This is best suited for recurring or long-lived deposit flows.
</Info>

***

## Rate Expiry Behavior

If a deposit arrives after a bound rate expires:

* The deposit is **FLAGGED**
* No FX or settlement occurs automatically
* Manual review is required

Rates **cannot** be extended, reused, or retroactively applied.

***

## Settlement

Settlement defines **where converted stablecoins are sent** after FX conversion.

Settlement behavior is configured on the funding account.

***

## Settlement Modes

### On-chain (`ONCHAIN`)

Converted stablecoins are **sent to a blockchain address**.

* Settlement occurs after FX conversion
* Subject to risk checks
* Finalized once the on-chain transaction confirms

Used for direct wallet settlement and real-time delivery.

***

### Internal balance (`INTERNAL_BALANCE`)

Converted funds are **credited to the merchant’s Daya balance**.

* No immediate on-chain transaction
* Funds can be withdrawn later
* Useful for aggregation and batch withdrawals

***

### NGN Payout (`NGN_PAYOUT`)

For crypto funding account deposits — converted funds are **paid out as NGN to a Nigerian bank account**.

* Temporary crypto funding accounts require a `rate_id` (SELL rate) and `destination_bank`
* Settlement occurs after crypto deposit is confirmed and FX conversion is executed

***

## Guarantees & Invariants

Daya enforces the following guarantees:

* FX conversion and settlement are **atomic**
* Partial execution is **not possible**
* Rates are **firm** for temporary rate-locked funding accounts
* Settlement behavior is **immutable** per temporary funding account (permanent funding accounts can update settlement)

***

## What Rates and Settlement Do *Not* Guarantee

* Rates do not guarantee settlement if deposits arrive late
* Settlement does not occur if deposits are flagged or failed
* Permanent funding accounts do not guarantee a fixed price

***

## Next Steps

<CardGroup cols={3}>
  <Card title="Funding Accounts" icon="landmark" href="/concepts/funding-accounts">
    See how receive-money settlement is configured
  </Card>

  <Card title="Deposits" icon="money-bill-transfer" href="/concepts/deposits">
    Understand the deposit lifecycle
  </Card>

  <Card title="Rates API" icon="code" href="/api-reference/rates/get-rates">
    View the API reference
  </Card>
</CardGroup>
