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

# Stablecoin Volume Metrics

> Pre-built metrics for stablecoin transfer activity (e.g. volume & transaction counts), aggregated by day, chain and token address. Includes adjusted activity metrics.

The `crosschain.metrics.stablecoin_volume` table aggregates stablecoin activity from `crosschain.stablecoin.transfers` by day, chain and token address.

It includes adjusted activity metrics using the following methodologies:

* **Single Direction Max Transfer -** only the largest stablecoin amount transferred within a single transaction is counted

* **Single Direction Net Transfer -** the largest net stablecoin amount transferred per token, to a single address, for each transaction, is counted

* **Entity Adjusted, Single Direction Max Transfer -** in addition, to applying the Single Direction Max Transfer logic, this methodology also uses labels & heuristics to remove bot related activity (e.g. if an address does more than 1,000 transactions and \$10m in transfer volume in a rolling 30-day window), or intra-exchange volume (i.e. when transfers are made between two CEX/DEX addresses)

### Sample Query

**Get the monthly stablecoin transfer metrics for all USD currencies in the last 24 months, excluding anomalies and using the Entity Adjusted, Single Direction Max Transfer methodology**

<Frame caption="https://app.allium.so/s/bIrQUiFP">
  <img src="https://mintcdn.com/allium-e770e2b7/NiXvsYw69ZoZ_xpx/images/stablecoin-volume-sample-query.png?fit=max&auto=format&n=NiXvsYw69ZoZ_xpx&q=85&s=dc92cf777635a340a7546b8e40ae324f" width="2556" height="1660" data-path="images/stablecoin-volume-sample-query.png" />
</Frame>

```sql theme={null}
select 
    date_trunc('month', activity_date) as month,
    sum(entity_adjusted_single_direction_max_transfer_tx_count) as num_transactions,
    sum(entity_adjusted_single_direction_max_transfer_volume_usd/pow(10,9)) as usd_volume_billions
from crosschain.metrics.stablecoin_volume
where 1=1
    and currency = 'usd' -- limit to USD currencies
    and transfer_volume_is_anomaly = false -- exclude high volume days, where total raw volume is >1e18
    and activity_date >= current_date - interval '24 months'
    and activity_date < date_trunc('month', current_date) -- exclude incomplete months
group by all
order by 1 desc
```

### Table Columns

**Unique Key**: `chain`, `activity_date`, `token_address`

<Tabs>
  <Tab title="Raw Metrics">
    | Column Name                   | Description                                                                                                  |
    | ----------------------------- | ------------------------------------------------------------------------------------------------------------ |
    | chain                         | The name of the blockchain                                                                                   |
    | token\_address                | The address of the stablecoin                                                                                |
    | token\_symbol                 | The token symbol of the stablecoin                                                                           |
    | currency                      | The ISO currency code (e.g. usd, eur, jpy, xau (gold)) of the stablecoin in lowercasing                      |
    | base\_asset                   | The base assets in symbol in lowercasing. (i.e. usdt, usdc, tusd, dai, etc)                                  |
    | activity\_date                | The date for which metrics are being calculated. Only includes completed days.                               |
    | transfer\_tx\_count           | The total number of transactions with stablecoin transfers.                                                  |
    | transfer\_count               | The total number of stablecoin transfers.                                                                    |
    | avg\_transfer\_count          | The average number of stablecoin transfers                                                                   |
    | transfer\_volume              | The total volume of stablecoin transfers (normalized)                                                        |
    | transfer\_volume\_usd         | The total volume of stablecoin transfers in USD terms                                                        |
    | avg\_transfer\_volume         | The average volume of stablecoin transfers (normalized)                                                      |
    | avg\_transfer\_volume\_usd    | The average volume of stablecoin transfers in USD terms                                                      |
    | transfer\_volume\_is\_anomaly | A boolean flag that's set to true where the transfer\_volume is excessively high for a given day, i.e. >1e18 |
  </Tab>

  <Tab title="Adjusted Metrics">
    | Methodology                                    | Column Name                                                     | Description                                                                                      |
    | ---------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
    | Single Direction Max Transfer                  | single\_direction\_max\_transfer\_volume                        | The adjusted total volume of stablecoin transfers (normalized), using the given methodology      |
    | Single Direction Max Transfer                  | single\_direction\_max\_transfer\_volume\_usd                   | The adjusted total volume of stablecoin transfers in USD terms, using the given methodology      |
    | Single Direction Net Transfer                  | single\_direction\_net\_transfer\_volume                        | The adjusted total volume of stablecoin transfers (normalized), using the given methodology      |
    | Single Direction Net Transfer                  | single\_direction\_net\_transfer\_volume\_usd                   | The adjusted total volume of stablecoin transfers in USD terms, using the given methodology      |
    | Entity Adjusted, Single Direction Max Transfer | entity\_adjusted\_single\_direction\_max\_transfer\_tx\_count   | The adjusted total amount of transactions with stablecoin transfers, using the given methodology |
    | Entity Adjusted, Single Direction Max Transfer | entity\_adjusted\_single\_direction\_max\_transfer\_volume      | The adjusted total volume of stablecoin transfers (normalized), using the given methodology      |
    | Entity Adjusted, Single Direction Max Transfer | entity\_adjusted\_single\_direction\_max\_transfer\_volume\_usd | The adjusted total volume of stablecoin transfers in USD terms, using the given methodology      |
  </Tab>
</Tabs>
