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

# Overview

> Query RWA.xyz data directly in your Snowflake account with Secure Data Sharing.

RWA.xyz delivers its tokenized real-world asset data to Snowflake through [Secure Data Sharing](https://docs.snowflake.com/en/user-guide/data-sharing-intro). The shared data appears as a read-only database in your own Snowflake account, so you can query it with SQL and join it to your own tables without running an ETL pipeline or calling the [API](https://docs.rwa.xyz/api/overview.md).

The share draws on the same data pipeline as the RWA.xyz platform and covers a core set of its metrics. Metric definitions follow the [Methodology](https://docs.rwa.xyz/methodology/overview.md) section.

## What's included

Shares typically contain four views:

| View | Contents | One row per |
| - | - | - |
| [`ASSETS`](https://docs.rwa.xyz/snowflake/tables#assets) | Asset reference data: identifiers, issuer, manager, classification, fees, and regulatory details | Asset |
| [`TOKENS`](https://docs.rwa.xyz/snowflake/tables#tokens) | On-chain deployments of each asset: network, platform, contract address, and transferability | Token |
| [`ASSET_METRICS`](https://docs.rwa.xyz/snowflake/tables#asset_metrics) | Daily asset-level metrics: NAV, price, and yield | Asset per day |
| [`TOKEN_METRICS`](https://docs.rwa.xyz/snowflake/tables#token_metrics) | Daily token-level metrics: supply, value, holders, activity, and flows | Token per day |

See [Tables & Schema](https://docs.rwa.xyz/snowflake/tables.md) for every column and how the views join.

> [!NOTE]
>
> Shares are configured per customer. Yours may include a subset of these views or additional columns. Run `SHOW VIEWS IN DATABASE <database>;` to see what your share contains.

## Getting access

1. Email [team@rwa.xyz](mailto:team@rwa.xyz) with your Snowflake organization and account name (or account locator) and your account's cloud provider and region. Direct shares work only between accounts in the same region, so RWA.xyz will confirm how your account can receive the share.
2. Once RWA.xyz grants your account access, create a database from the share. Run this as `ACCOUNTADMIN`, or as a role with the `IMPORT SHARE` and `CREATE DATABASE` privileges, using the provider account and share name RWA.xyz sends you:

```sql theme={null}
CREATE DATABASE RWA FROM SHARE <provider_account>.<share_name>;
```

3. Grant other roles access to the new database:

```sql theme={null}
GRANT IMPORTED PRIVILEGES ON DATABASE RWA TO ROLE <role>;
```

The shared database is read-only. Queries run on your warehouse, so you pay for the compute they use; RWA.xyz pays for storage.

## Data freshness

RWA.xyz computes metrics in a daily pipeline. The tables behind the share refresh automatically, so new data appears in Snowflake within about 30 minutes of RWA.xyz publishing it. You do not need to refresh anything on your side.

Each metrics row has a `date`, the day the metrics describe, and an `_etl_date`, which is always `date` + 1. `_etl_date` is a partition key, not a load timestamp: when RWA.xyz restates or backfills history, the restated rows keep their original `_etl_date`. To keep a copy in sync, reload a trailing window of `date` values rather than filtering on `_etl_date`.

Different metrics for the same day can arrive at different times, so the most recent day may be partly filled until every metric has landed.

## Example queries

The examples assume you named the database `RWA`. Set your share's schema first:

```sql theme={null}
USE SCHEMA RWA.<schema>;
```

### Latest metrics for every token

```sql theme={null}
SELECT
  a.name AS asset_name,
  a.ticker,
  t.network_name,
  m.date,
  m.circulating_supply_token,
  m.circulating_asset_value_dollar,
  m.holding_addresses_count
FROM token_metrics m
JOIN tokens t ON t.id = m.token_id
JOIN assets a ON a.id = t.asset_id
WHERE m.circulating_asset_value_dollar IS NOT NULL
QUALIFY ROW_NUMBER() OVER (PARTITION BY m.token_id ORDER BY m.date DESC) = 1
ORDER BY m.circulating_asset_value_dollar DESC;
```

Keep the inner join to `ASSETS` in any query that rolls tokens up to assets.

### NAV and yield history for one asset

Find the asset's `ID` in `ASSETS` first, since tickers are not guaranteed to be unique.

```sql theme={null}
SELECT
  m.date,
  m.net_asset_value_dollar,
  m.apy_7_day,
  m.apy_30_day
FROM asset_metrics m
WHERE m.asset_id = <asset_id>
ORDER BY m.date;
```

### Daily net flows by asset

Subscriptions and redemptions are adjusted mints and burns: they exclude mints and burns in issuer treasury and premint wallets, and count transfers out of and into those wallets instead. See [Net flows](https://docs.rwa.xyz/methodology/corporate-actions.md#net-flows). Flow columns are `NULL`, not 0, on days without that activity, so the query treats missing values as 0.

```sql theme={null}
SELECT
  m.date,
  a.name AS asset_name,
  COALESCE(SUM(m.daily_subscription_volume_dollar), 0) AS subscriptions_dollar,
  COALESCE(SUM(m.daily_redemption_volume_dollar), 0) AS redemptions_dollar,
  subscriptions_dollar - redemptions_dollar AS net_flow_dollar
FROM token_metrics m
JOIN tokens t ON t.id = m.token_id
JOIN assets a ON a.id = t.asset_id
WHERE m.date >= DATEADD(day, -30, CURRENT_DATE)
GROUP BY m.date, a.id, a.name
ORDER BY m.date, net_flow_dollar DESC;
```

This values each day's flows at that day's price, falling back to NAV, so its totals can differ from the API's fund flows endpoints, which value a whole window at its ending NAV. See [Volumes](https://docs.rwa.xyz/methodology/corporate-actions.md#volumes).

## Next steps

> [card] [Tables & Schema](https://docs.rwa.xyz/snowflake/tables.md)
>
> Every view, column, and join key in the share.

> [card] [Methodology](https://docs.rwa.xyz/methodology/metrics.md)
>
> How each metric is defined and calculated.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.