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

# BSC

> BSC (Binance Smart Chain) Schema Description and Methodology

This schema contains comprehensive datasets for tracking BSC fundamental data across multiple metrics categories, including network activity, fees, revenue distribution, stablecoin usage, developer engagement, and market data.

## Available Tables

BSC data is available in several tables:

* **ez\_metrics**: Main aggregated metrics for the BSC network
* **ez\_metrics\_by\_category\_v2**: Metrics broken down by transaction category
* **ez\_metrics\_by\_application\_v2**: Metrics broken down by application
* **ez\_metrics\_by\_subcategory**: Metrics broken down by subcategory
* **ez\_metrics\_by\_contract\_v2**: Metrics broken down by contract

## Table Schema

### Network and Usage Metrics

| Table Name  | Column Name             | Description                                  |
| ----------- | ----------------------- | -------------------------------------------- |
| ez\_metrics | chain\_txns             | Daily transactions on the BSC network        |
| ez\_metrics | chain\_dau              | Daily unique users on BSC                    |
| ez\_metrics | chain\_wau              | Weekly unique users on BSC                   |
| ez\_metrics | chain\_mau              | Monthly unique users on BSC                  |
| ez\_metrics | chain\_avg\_txn\_fee    | The average transaction fee on BSC           |
| ez\_metrics | chain\_median\_txn\_fee | The median transaction fee on BSC            |
| ez\_metrics | returning\_users        | The number of returning users on BSC         |
| ez\_metrics | new\_users              | The number of new users on BSC               |
| ez\_metrics | dau\_over\_100\_balance | The number of users with balances over \$100 |
| 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                 |
| ez\_metrics | avg\_txn\_fee           | Legacy naming for chain\_avg\_txn\_fee       |
| ez\_metrics | median\_txn\_fee        | Legacy naming for chain\_median\_txn\_fee    |
| ez\_metrics | dau\_over\_100          | Legacy naming for dau\_over\_100\_balance    |

### User Classification Metrics

| Table Name  | Column Name        | Description                                         |
| ----------- | ------------------ | --------------------------------------------------- |
| ez\_metrics | sybil\_users       | The number of sybil users (suspected bots) on BSC   |
| ez\_metrics | non\_sybil\_users  | The number of non-sybil users on BSC                |
| ez\_metrics | low\_sleep\_users  | Users with continuous activity (possible bots)      |
| ez\_metrics | high\_sleep\_users | Users with normal activity patterns (likely humans) |

### Fee and Revenue Metrics

| Table Name  | Column Name                     | Description                                         |
| ----------- | ------------------------------- | --------------------------------------------------- |
| ez\_metrics | chain\_fees                     | The total transaction fees paid on BSC (in USD)     |
| ez\_metrics | fees                            | Total revenue generated from transaction fees (USD) |
| ez\_metrics | fees\_native                    | Total revenue from transaction fees in BNB          |
| ez\_metrics | burned\_fee\_allocation         | USD value of BNB burned (10% of transaction fees)   |
| ez\_metrics | burned\_fee\_allocation\_native | Amount of native BNB burned (10% of fees)           |
| ez\_metrics | fees                            | Legacy naming for chain\_fees                       |
| ez\_metrics | fees\_native                    | Transaction fees in native BNB tokens               |
| ez\_metrics | revenue                         | Legacy naming for burned\_fee\_allocation           |
| ez\_metrics | revenue\_native                 | Legacy naming for burned\_fee\_allocation\_native   |

### Volume and Trading Metrics

| Table Name  | Column Name                 | Description                                   |
| ----------- | --------------------------- | --------------------------------------------- |
| ez\_metrics | chain\_spot\_volume         | Total spot DEX volume on BSC                  |
| ez\_metrics | chain\_nft\_trading\_volume | The total volume of NFT trading on BSC        |
| ez\_metrics | dex\_volumes                | Legacy naming for chain\_spot\_volume         |
| ez\_metrics | nft\_trading\_volume        | Legacy naming for chain\_nft\_trading\_volume |

### Stablecoin Metrics

| Table Name  | Column Name                           | Description                                    |
| ----------- | ------------------------------------- | ---------------------------------------------- |
| ez\_metrics | stablecoin\_total\_supply             | The total supply of stablecoins on BSC         |
| ez\_metrics | stablecoin\_txns                      | The number of stablecoin transactions          |
| ez\_metrics | stablecoin\_dau                       | Daily active users of stablecoins              |
| ez\_metrics | stablecoin\_mau                       | Monthly active users of stablecoins            |
| ez\_metrics | stablecoin\_transfer\_volume          | The total volume of stablecoin transfers       |
| ez\_metrics | stablecoin\_tokenholder\_count        | The number of unique stablecoin tokenholders   |
| ez\_metrics | artemis\_stablecoin\_txns             | Stablecoin txns excluding MEV transactions     |
| ez\_metrics | artemis\_stablecoin\_dau              | Daily users excluding MEV addresses            |
| ez\_metrics | artemis\_stablecoin\_mau              | Monthly users excluding MEV addresses          |
| ez\_metrics | artemis\_stablecoin\_transfer\_volume | Stablecoin volume excluding MEV transactions   |
| ez\_metrics | p2p\_stablecoin\_txns                 | P2P stablecoin transactions (wallet-to-wallet) |
| ez\_metrics | p2p\_stablecoin\_dau                  | Daily users of P2P stablecoin transfers        |
| ez\_metrics | p2p\_stablecoin\_mau                  | Monthly users of P2P stablecoin transfers      |
| ez\_metrics | p2p\_stablecoin\_transfer\_volume     | Volume of P2P stablecoin transfers             |
| ez\_metrics | p2p\_stablecoin\_tokenholder\_count   | Unique holders conducting P2P transfers        |

### Developer Activity Metrics

| Table Name  | Column Name                         | Description                                           |
| ----------- | ----------------------------------- | ----------------------------------------------------- |
| ez\_metrics | weekly\_contracts\_deployed         | The number of new contracts deployed on BSC           |
| ez\_metrics | weekly\_contract\_deployers         | The number of addresses deploying contracts           |
| ez\_metrics | weekly\_commits\_core\_ecosystem    | Commits to the BSC core ecosystem repositories        |
| ez\_metrics | weekly\_commits\_sub\_ecosystem     | Commits to BSC sub-ecosystem repositories             |
| ez\_metrics | weekly\_developers\_core\_ecosystem | Developers contributing to core repositories          |
| ez\_metrics | weekly\_developers\_sub\_ecosystem  | Developers contributing to sub-ecosystem repositories |

### Market and Token Metrics

| Table Name  | Column Name | Description                                      |
| ----------- | ----------- | ------------------------------------------------ |
| ez\_metrics | price       | The price of BNB token in USD                    |
| ez\_metrics | market\_cap | The market cap of BNB token in USD               |
| ez\_metrics | fdmc        | The fully diluted market cap of BNB token in USD |
| ez\_metrics | tvl         | The total value locked in BSC protocols          |

## Sample Queries

### Basic Network Activity Query

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

### Fee and Revenue Analysis

```sql theme={null}
-- Analyze BSC fee and revenue metrics
SELECT
    date,
    chain_fees,
    fees,
    burned_fee_allocation,
    burned_fee_allocation / fees * 100 as burn_percentage,
    chain_txns,
    chain_fees / chain_txns as fee_per_transaction,
    burned_fee_allocation / chain_txns as burn_per_transaction
FROM
    art_share.bsc.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 BSC
SELECT
    date,
    chain_dau,
    new_users,
    returning_users,
    new_users / NULLIF(chain_dau, 0) * 100 as new_user_percentage,
    returning_users / NULLIF(chain_dau, 0) * 100 as returning_user_percentage,
    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.bsc.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC
```

### User Classification Analysis

```sql theme={null}
-- Analyze different user types on BSC
SELECT
    date,
    chain_dau,
    sybil_users,
    non_sybil_users,
    low_sleep_users,
    high_sleep_users,
    dau_over_100_balance,
    non_sybil_users / NULLIF(chain_dau, 0) * 100 as non_sybil_percentage,
    high_sleep_users / NULLIF(chain_dau, 0) * 100 as high_sleep_percentage,
    dau_over_100_balance / NULLIF(chain_dau, 0) * 100 as wealthy_user_percentage
FROM
    art_share.bsc.ez_metrics
WHERE
    date >= DATEADD(month, -2, CURRENT_DATE())
ORDER BY
    date ASC
```

### Trading Volume Analysis

```sql theme={null}
-- Analyze trading volumes on BSC
SELECT
    date,
    chain_spot_volume,
    chain_nft_trading_volume,
    chain_spot_volume / NULLIF(chain_nft_trading_volume, 0) as dex_to_nft_ratio,
    LAG(chain_spot_volume, 7) OVER (ORDER BY date) as dex_volume_week_ago,
    chain_spot_volume / NULLIF(dex_volume_week_ago, 0) - 1 as weekly_dex_volume_growth,
    tvl,
    chain_spot_volume / NULLIF(tvl, 0) as capital_efficiency_ratio
FROM
    art_share.bsc.ez_metrics
WHERE
    date >= DATEADD(month, -1, CURRENT_DATE())
ORDER BY
    date ASC
```

### Stablecoin Analysis

```sql theme={null}
-- Track stablecoin usage on BSC
SELECT
    date,
    stablecoin_total_supply,
    stablecoin_dau,
    artemis_stablecoin_dau,
    p2p_stablecoin_dau,
    stablecoin_transfer_volume,
    p2p_stablecoin_transfer_volume,
    p2p_stablecoin_transfer_volume / NULLIF(stablecoin_transfer_volume, 0) * 100 as p2p_percentage,
    stablecoin_transfer_volume / NULLIF(chain_spot_volume, 0) * 100 as stablecoin_to_dex_ratio
FROM
    art_share.bsc.ez_metrics
WHERE
    date >= DATEADD(month, -2, CURRENT_DATE())
ORDER BY
    date ASC
```

### Developer Activity Monitoring

```sql theme={null}
-- Track developer activity on BSC
SELECT
    date,
    weekly_contracts_deployed,
    weekly_contract_deployers,
    weekly_commits_core_ecosystem,
    weekly_commits_sub_ecosystem,
    weekly_developers_core_ecosystem,
    weekly_developers_sub_ecosystem,
    weekly_contracts_deployed / NULLIF(weekly_contract_deployers, 0) as avg_contracts_per_deployer,
    weekly_commits_core_ecosystem / NULLIF(weekly_developers_core_ecosystem, 0) as avg_commits_per_core_dev
FROM
    art_share.bsc.ez_metrics
WHERE
    date >= DATEADD(month, -6, CURRENT_DATE())
ORDER BY
    date ASC
```

### BSC vs Token Price Analysis

```sql theme={null}
-- Analyze relationship between BSC usage and BNB price
SELECT
    date,
    chain_dau,
    chain_txns,
    price,
    market_cap,
    tvl,
    market_cap / NULLIF(tvl, 0) as mcap_to_tvl_ratio,
    price / NULLIF(LAG(price, 30) OVER (ORDER BY date), 0) - 1 as monthly_price_change,
    chain_dau / NULLIF(LAG(chain_dau, 30) OVER (ORDER BY date), 0) - 1 as monthly_dau_change
FROM
    art_share.bsc.ez_metrics
WHERE
    date >= DATEADD(month, -6, CURRENT_DATE())
ORDER BY
    date ASC
```

### Fee Efficiency Analysis

```sql theme={null}
-- Analyze fee efficiency on BSC
SELECT
    date,
    chain_txns,
    chain_fees,
    chain_dau,
    tvl,
    chain_fees / NULLIF(chain_txns, 0) as fees_per_transaction,
    chain_fees / NULLIF(chain_dau, 0) as fees_per_user,
    chain_fees / NULLIF(tvl, 0) * 365 * 100 as annualized_fee_yield,
    burned_fee_allocation / NULLIF(market_cap, 0) * 365 * 100 as annualized_burn_rate
FROM
    art_share.bsc.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC
```

### Application-specific Analysis

```sql theme={null}
-- Analyze metrics for specific applications on BSC
SELECT
    date,
    app,
    friendly_name,
    category,
    txns,
    dau,
    returning_users,
    new_users
FROM
    art_share.bsc.ez_metrics_by_application_v2
WHERE
    date >= DATEADD(month, -2, CURRENT_DATE())
    AND app IN ('pancakeswap', 'venus', 'biswap')
ORDER BY
    app, date ASC
```

### Monthly Performance Dashboard

```sql theme={null}
-- Create a monthly performance dashboard for BSC
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,
    SUM(burned_fee_allocation) as total_burned,
    AVG(chain_avg_txn_fee) as avg_transaction_fee,
    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(stablecoin_total_supply) OVER (PARTITION BY DATE_TRUNC('month', date) ORDER BY date) as end_of_month_stablecoin_supply
FROM
    art_share.bsc.ez_metrics
WHERE
    date >= DATEADD(year, -1, CURRENT_DATE())
GROUP BY
    DATE_TRUNC('month', date)
ORDER BY
    month ASC
```
