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

# Rates

> How Paj quotes fiat against USD, and how to use a rate correctly.

[`GET /pub/v2/rate`](/api-reference/get-rates) returns the two live rates for a
currency. Both are quoted as **units of the target currency per 1 USD**, so a
`rate` of `1610` for `NGN` means one dollar of stablecoin is worth ₦1,610.

## Two directions, priced separately

<CardGroup cols={2}>
  <Card title="offRampRate" icon="arrow-right-from-bracket">
    Crypto leaving for fiat — the rate applied when a deposit to a bank account
    address is paid out.
  </Card>

  <Card title="onRampRate" icon="arrow-right-to-bracket">
    Fiat coming in for crypto.
  </Card>
</CardGroup>

The offramp rate is not the inverse of the onramp rate. The spread between them
is where the pricing lives, so always read the field matching the direction the
money is actually moving rather than deriving one from the other.

## Your fee is already applied

Rates are resolved against the business behind your API key, with that
business's fee already baked into the number returned. The value you get is the
value your user should see.

<Warning>
  Do not add your own margin on top of these rates unless you deliberately
  intend to charge twice — the fee configured for your business has already
  been applied.
</Warning>

## Quoting an amount

To show a user what a deposit will be worth:

```ts theme={null}
const res = await fetch('https://api.paj.cash/pub/v2/rate?currency=NGN', {
  headers: { 'x-api-key': process.env.PAJ_API_KEY! },
});
const { offRampRate } = await res.json();

const usdcAmount = 50;
const payout = usdcAmount * offRampRate.rate; // ₦80,500 at 1610
```

## A rate is indicative, not a lock

Calling this endpoint does not reserve anything. The rate that settles a deposit
is the one active at the moment the deposit is observed on-chain, which may
differ from the one you displayed a minute earlier.

<Note>
  Present quotes as approximate ("you'll receive about ₦80,500") and re-fetch
  the rate rather than caching it for long stretches. The `createdAt` on each
  rate tells you how recently it was published.
</Note>

## Currencies

The `currency` parameter accepts `NGN`, `GHS`, `TZS`, `KES`, `ZAR` and `USD`.
Being listed in the enum is not the same as being live — a currency with no
active rate returns `404`, so treat that response as "not supported yet" rather
than as an error in your request.
