> ## 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.

# Aptos

> Aptos Schema Description and Methodology

This schema contains comprehensive on-chain datasets for tracking Aptos fundamental data across multiple metrics categories, including network activity, fees, trading volumes, developer activity, and market data.

## Available Tables

Aptos data is available in one main table:

* **ez\_metrics**: Main aggregated metrics for the Aptos blockchain

## Table Schema

### Network and Usage Metrics

| Table Name  | Column Name | Description                                |
| ----------- | ----------- | ------------------------------------------ |
| ez\_metrics | chain\_txns | Daily transactions on the Aptos blockchain |
| ez\_metrics | chain\_dau  | Daily unique users on Aptos                |
| ez\_metrics | chain\_wau  | Weekly unique users on Aptos               |
| ez\_metrics | chain\_mau  | Monthly unique users on Aptos              |
| ez\_metrics | txns        | Legacy naming for chain\_txns              |
| ez\_metrics | dau         | Legacy naming for chain\_dau               |
| ez\_metrics | wau         | Legacy naming for chain\_wau               |
| ez\_metrics | mau         | Legacy naming for chain\_mau               |

### Fee and Revenue Metrics

| Table Name  | Column Name          | Description                                                    |
| ----------- | -------------------- | -------------------------------------------------------------- |
| ez\_metrics | chain\_fees          | The total transaction fees paid on Aptos in USD                |
| ez\_metrics | chain\_avg\_txn\_fee | The average transaction fee on Aptos in USD                    |
| ez\_metrics | fees                 | The total USD value generated from all user-paid fees on Aptos |
| ez\_metrics | fees\_native         | The total native APT value from all user-paid fees             |
| ez\_metrics | fees                 | Legacy naming for chain\_fees                                  |
| ez\_metrics | fees\_native         | Transaction fees in native APT tokens                          |
| ez\_metrics | avg\_txn\_fee        | Legacy naming for chain\_avg\_txn\_fee                         |

### Cash Flow Distribution Metrics

| Table Name  | Column Name                     | Description                                          |
| ----------- | ------------------------------- | ---------------------------------------------------- |
| ez\_metrics | burned\_fee\_allocation         | USD value of APT burned through transaction fees     |
| ez\_metrics | burned\_fee\_allocation\_native | Amount of native APT burned through transaction fees |
| ez\_metrics | revenue                         | Legacy naming for burned\_fee\_allocation            |
| ez\_metrics | revenue\_native                 | Legacy naming for burned\_fee\_allocation\_native    |

### Volume and DeFi Metrics

| Table Name  | Column Name         | Description                                    |
| ----------- | ------------------- | ---------------------------------------------- |
| ez\_metrics | chain\_spot\_volume | Total spot DEX volume on Aptos                 |
| ez\_metrics | tvl                 | The total value locked in Aptos DeFi protocols |
| ez\_metrics | dex\_volumes        | Legacy naming for chain\_spot\_volume          |

### Market and Token Metrics

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

### Developer Activity Metrics

| Table Name  | Column Name                         | Description                                                                |
| ----------- | ----------------------------------- | -------------------------------------------------------------------------- |
| ez\_metrics | weekly\_commits\_core\_ecosystem    | The number of commits to the Aptos core ecosystem                          |
| ez\_metrics | weekly\_commits\_sub\_ecosystem     | The number of commits to the Aptos sub-ecosystem                           |
| ez\_metrics | weekly\_developers\_core\_ecosystem | The number of developers who have made commits to the Aptos core ecosystem |
| ez\_metrics | weekly\_developers\_sub\_ecosystem  | The number of developers who have made commits to the Aptos sub-ecosystem  |

## Sample Queries

### Basic Network Activity Query

```sql theme={null}
-- Pull fundamental network activity data for Aptos
SELECT
    date,
    chain_txns,
    chain_dau,
    chain_fees,
    chain_avg_txn_fee,
    price
FROM
    art_share.aptos.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC
```

### User Growth Analysis

```sql theme={null}
-- Analyze user growth and retention on Aptos
SELECT
    date,
    chain_dau,
    chain_wau,
    chain_mau,
    chain_dau / NULLIF(chain_wau, 0) * 100 as daily_to_weekly_ratio,
    chain_wau / NULLIF(chain_mau, 0) * 100 as weekly_to_monthly_ratio,
    LAG(chain_dau, 7) OVER (ORDER BY date) as dau_week_ago,
    chain_dau / NULLIF(dau_week_ago, 0) - 1 as weekly_dau_growth
FROM
    art_share.aptos.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC
```

### Fee and Revenue Analysis

```sql theme={null}
-- Analyze Aptos fees and revenue
SELECT
    date,
    chain_fees,
    chain_avg_txn_fee,
    fees,
    burned_fee_allocation,
    chain_txns,
    chain_dau,
    chain_fees / chain_txns as avg_fee_per_txn,
    chain_fees / chain_dau as avg_fee_per_user
FROM
    art_share.aptos.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC
```

### DeFi Activity Analysis

```sql theme={null}
-- Track DeFi activity on Aptos
SELECT
    date,
    chain_spot_volume,
    tvl,
    chain_spot_volume / NULLIF(tvl, 0) as dex_volume_to_tvl_ratio,
    LAG(chain_spot_volume, 7) OVER (ORDER BY date) as volume_week_ago,
    chain_spot_volume / NULLIF(volume_week_ago, 0) - 1 as weekly_volume_growth
FROM
    art_share.aptos.ez_metrics
WHERE
    date >= DATEADD(month, -2, CURRENT_DATE())
ORDER BY
    date ASC
```

### Token Performance Analysis

```sql theme={null}
-- Analyze APT token metrics
SELECT
    date,
    price,
    market_cap,
    fdmc,
    token_volume,
    token_turnover_circulating,
    token_volume / NULLIF(chain_fees, 0) as token_volume_to_fees_ratio
FROM
    art_share.aptos.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC
```

### Developer Activity Monitoring

```sql theme={null}
-- Track developer activity on Aptos
SELECT
    date,
    weekly_developers_core_ecosystem,
    weekly_developers_sub_ecosystem,
    weekly_commits_core_ecosystem,
    weekly_commits_sub_ecosystem,
    weekly_commits_core_ecosystem / NULLIF(weekly_developers_core_ecosystem, 0) as commits_per_core_dev,
    weekly_commits_sub_ecosystem / NULLIF(weekly_developers_sub_ecosystem, 0) as commits_per_sub_dev
FROM
    art_share.aptos.ez_metrics
WHERE
    date >= DATEADD(month, -6, CURRENT_DATE())
ORDER BY
    date ASC
```

### Network Economics Analysis

```sql theme={null}
-- Analyze Aptos network economics
SELECT
    date,
    chain_txns,
    chain_fees,
    burned_fee_allocation,
    price,
    market_cap,
    market_cap / NULLIF(chain_fees * 365, 0) as price_to_annual_fees_ratio,
    chain_fees / chain_txns as revenue_per_transaction
FROM
    art_share.aptos.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC
```

### Monthly Performance Dashboard

```sql theme={null}
-- Create a monthly performance dashboard for Aptos
SELECT
    DATE_TRUNC('month', date) as month,
    AVG(chain_dau) as avg_daily_users,
    SUM(chain_txns) as total_transactions,
    SUM(chain_fees) as total_fees,
    AVG(chain_avg_txn_fee) as avg_transaction_fee,
    SUM(chain_spot_volume) as total_dex_volume,
    AVG(tvl) as avg_tvl,
    AVG(price) as avg_token_price,
    LAST_VALUE(market_cap) OVER (PARTITION BY DATE_TRUNC('month', date) ORDER BY date) as end_of_month_market_cap,
    LAST_VALUE(weekly_developers_core_ecosystem + weekly_developers_sub_ecosystem) OVER (PARTITION BY DATE_TRUNC('month', date) ORDER BY date) as active_developers
FROM
    art_share.aptos.ez_metrics
WHERE
    date >= DATEADD(year, -1, CURRENT_DATE())
GROUP BY
    DATE_TRUNC('month', date)
ORDER BY
    month ASC
```
