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

# Stablecoin FX

> Onchain foreign-exchange activity between stablecoins for a currency pair: swap volume in USD, number of swaps, and the chains and DEXes the pair traded on. Cross-currency pairs capture stablecoin FX; same-currency pairs capture swaps between stablecoins of one currency. Each series is one pair, keyed by base and quote currency codes.

One row per currency pair traded onchain between stablecoins, keyed by base and quote currency codes: display name, pair type (cross-currency or same-currency) and both currencies. The id is the series key of the stablecoin-fx timeseries model.

|                  |                                                                                                      |
| ---------------- | ---------------------------------------------------------------------------------------------------- |
| Access           | Stablecoins\_unified                                                                                 |
| Tabular model    | `stablecoin-fx-pairs`: primary key `id`                                                              |
| Timeseries model | `stablecoin-fx`: intervals `1d`, series key `id` (Currency Pair), every series available in one call |

## Endpoints

<CardGroup cols={2}>
  <Card title="List Stablecoin FX Pairs" icon="arrow-right" href="/api-reference/data-api/stablecoins/tabular-stablecoin-fx-pairs">
    One page of rows with per-column filters, sorting and pagination.
  </Card>

  <Card title="Batch Get Currency Pair timeseries" icon="arrow-right" href="/api-reference/data-api/stablecoins/timeseries-stablecoin-fx">
    Every series in one request, or the named ones.
  </Card>

  <Card title="Get Currency Pair timeseries" icon="arrow-right" href="/api-reference/data-api/stablecoins/timeseries-stablecoin-fx-by-id">
    One series over a time window, keyed by its Currency Pair.
  </Card>
</CardGroup>

## Metrics

4 metrics. Use the `Field` value in `selections`; every point starts with the timestamp and continues in this order.

| Field           | Name           | Type    | Unit | Description                                                 |
| --------------- | -------------- | ------- | ---- | ----------------------------------------------------------- |
| `volumeUSD`     | Volume (USD)   | float64 |      | DEX swap volume for the currency pair in USD.               |
| `tradeCount`    | Trade Count    | float64 |      | Number of swaps for the currency pair.                      |
| `chainCount`    | Chain Count    | float64 |      | Number of blockchains the currency pair traded on that day. |
| `exchangeCount` | Exchange Count | float64 |      | Number of DEXes the currency pair traded on that day.       |

## Columns

Use the `Field` value in `selections`, `sortBy`, and as the base of a filter parameter (`Field` plus one of its `Filters` suffixes).

| Field           | Type   | Filters                     | Sort    | Description                                                                                                                                     |
| --------------- | ------ | --------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`            | string | `Eq`, `IsOneOf`             |         | The series key of the stablecoin-fx timeseries model, the lowercase base and quote currency codes joined with a hyphen (eur-usd). (primary key) |
| `name`          | string | `Eq`, `IsOneOf`, `Contains` | default | The display name of the currency pair (for example EUR/USD).                                                                                    |
| `pairType`      | string | `Eq`, `IsOneOf`             | yes     | fx for cross-currency trades, same-currency for stablecoin-to-stablecoin trades within one currency.                                            |
| `baseCurrency`  | string | `Eq`, `IsOneOf`             | yes     | The base currency of the pair.                                                                                                                  |
| `quoteCurrency` | string | `Eq`, `IsOneOf`             | yes     | The quote currency of the pair.                                                                                                                 |

## Example

```bash curl theme={null}
curl "https://api.blockworks.com/query/timeseries/stablecoin-fx/1d/ars-usd?timeframe=7d&selections=volumeUSD,tradeCount" \
  -H "X-Blockworks-API-Key: $BLOCKWORKS_API_KEY"
```

See [Get Currency Pair timeseries](/api-reference/data-api/stablecoins/timeseries-stablecoin-fx-by-id) for the response and the errors.
