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

# Raydium

> Raydium Schema Description and Methodology

This schema contains comprehensive on-chain datasets for tracking Raydium fundamental data across multiple metrics categories, including trading activity, fees, revenue streams, token economics, and market data.

## Available Tables

Raydium data is available in two main tables:

* **ez\_metrics**: Aggregated metrics for the entire Raydium protocol with detailed token supply data
* **ez\_metrics\_by\_chain**: Contains the same metrics as ez\_metrics (where applicable), but broken down by blockchain. Use this table when you need to analyze performance across different chains.

## Table Schema

### Trading and Activity Metrics

| Table Name | Column Name | Description |
| - | - | - |
| ez\_metrics | spot\_volume | The total volume on Raydium's CPMM, AMM v4, and CLMM |
| ez\_metrics | spot\_dau | The number of daily active traders on Raydium's CPMM, AMM v4, and CLMM |
| ez\_metrics | spot\_txns | The number of daily trades on Raydium's CPMM, AMM v4, and CLMM |
| ez\_metrics | tvl | The total value locked in Raydium's AMM, CPMM, and CLMM pools |
| ez\_metrics | trading\_volume | Total trading volume (legacy naming, same as spot\_volume) |
| ez\_metrics | unique\_traders | Number of unique traders (legacy naming, same as spot\_dau) |
| ez\_metrics | number\_of\_swaps | Total number of swap transactions (legacy naming, same as spot\_txns) |

### Fee and Revenue Metrics

| Table Name | Column Name | Description |
| - | - | - |
| ez\_metrics | spot\_fees | The trading fees generated from swaps on all Raydium platforms |
| ez\_metrics | pool\_creation\_fees | The fees collected from creating new pools on Raydium |
| ez\_metrics | fees | The total USD value generated from all user-paid fees on Raydium's CPMM, AMM, and CLMM, prior to the split with network participants |
| ez\_metrics | fees | Combined trading fees and pool creation fees (legacy naming) |
| ez\_metrics | revenue | Total revenue (legacy naming) |

### Cash Flow Distribution Metrics

| Table Name | Column Name | Description |
| - | - | - |
| ez\_metrics | buyback\_fee\_allocation | Portion of revenue allocated to buy back RAY tokens |
| ez\_metrics | treasury\_fee\_allocation | Revenue allocated to the protocol's treasury. For Raydium's CPMM and CLMM that is 4% of fees, and 0% for AMM v4 |
| ez\_metrics | service\_fee\_allocation | The share of protocol revenue accrued to Raydium LPs. On Raydium's AMM, that is 88% of fees, while on the CPMM and CLMM it is 84% of fees |
| ez\_metrics | buybacks | The USD value of RAY tokens actually bought back by the protocol |
| ez\_metrics | buyback\_native | The amount of RAY tokens bought back in native token units |
| ez\_metrics | treasury\_fees | Fees allocated to the treasury in USD (legacy naming) |
| ez\_metrics | treasury\_fees\_native | Fees allocated to the treasury in native token units (legacy naming) |

### Market and Token Metrics

| Table Name | Column Name | Description |
| - | - | - |
| ez\_metrics | price | The price of RAY in USD |
| ez\_metrics | market\_cap | The market cap of RAY token in USD |
| ez\_metrics | fdmc | The fully diluted market cap of RAY token in USD |
| ez\_metrics | token\_volume | The trading volume of RAY token in USD |
| ez\_metrics | token\_turnover\_circulating | The turnover of RAY based on circulating supply |
| ez\_metrics | token\_turnover\_fdv | The turnover of RAY based on fully diluted valuation |

### Token Supply Metrics

| Table Name | Column Name | Description |
| - | - | - |
| ez\_metrics | circulating\_supply\_native | The circulating supply of RAY in native tokens |
| ez\_metrics | net\_supply\_change\_native | The net change in the circulating supply of RAY in native tokens |
| ez\_metrics | gross\_emissions\_native | The amount of new RAY tokens emitted |
| ez\_metrics | premine\_unlocks\_native | The amount of native tokens unlocked from premine |

## Sample Queries

### Trading Activity Analysis

```sql theme={null}
-- Analyze Raydium trading activity
SELECT
    date,
    spot_volume,
    spot_dau,
    spot_txns,
    tvl
FROM
    art_share.raydium.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC
```

### Revenue Stream Breakdown

```sql theme={null}
-- Analyze Raydium revenue streams
SELECT
    date,
    fees,
    spot_fees,
    pool_creation_fees
FROM
    art_share.raydium.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC
```

### Cash Flow Distribution

```sql theme={null}
-- Track how Raydium revenue is distributed
SELECT
    date,
    fees,
    buyback_fee_allocation,
    treasury_fee_allocation,
    service_fee_allocation
FROM
    art_share.raydium.ez_metrics
WHERE
    date >= DATEADD(month, -1, CURRENT_DATE())
ORDER BY
    date ASC
```

### Token Economics Analysis

```sql theme={null}
-- Track RAY token supply changes
SELECT
    date,
    price,
    circulating_supply_native,
    gross_emissions_native,
    premine_unlocks_native,
    net_supply_change_native
FROM
    art_share.raydium.ez_metrics
WHERE
    date >= '2022-01-01'
ORDER BY
    date ASC
```

### TVL and Protocol Metrics Correlation

```sql theme={null}
-- Analyze correlation between TVL, trading volume and user activity
SELECT
    date,
    tvl,
    spot_volume,
    spot_dau,
    price
FROM
    art_share.raydium.ez_metrics
WHERE
    date >= DATEADD(month, -6, CURRENT_DATE())
ORDER BY
    date ASC
```

### Chain-specific Analysis

```sql theme={null}
-- Analyze Raydium metrics on Solana
SELECT
    date,
    chain,
    spot_volume,
    spot_dau,
    tvl,
    fees,
    buyback_fee_allocation
FROM
    art_share.raydium.ez_metrics_by_chain
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
    AND chain = 'solana'
ORDER BY
    date ASC
```


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