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

# Maple

> Maple Schema Description and Methodology

This schema contains comprehensive on-chain datasets for tracking Maple fundamental data across multiple metrics categories, including lending activity, fee distribution, treasury management, token economics, and market data.

## Available Tables

Maple data is available in several tables:

* **ez\_metrics**: Aggregated metrics for the entire Maple protocol with detailed token supply and treasury data
* **ez\_metrics\_by\_chain**: Contains key metrics broken down by blockchain
* **ez\_metrics\_by\_pool**: Metrics organized by individual Maple lending pools
* **ez\_metrics\_by\_token**: Treasury and revenue metrics broken down by token

## Table Schema

### Lending and Activity Metrics

| Table Name  | Column Name          | Description                                            |
| ----------- | -------------------- | ------------------------------------------------------ |
| ez\_metrics | lending\_deposits    | The total amount of tokens deposited (in USD) on Maple |
| ez\_metrics | lending\_loans       | The total outstanding loans (in USD) on Maple          |
| ez\_metrics | tvl                  | The total value locked in the Maple protocol           |
| ez\_metrics | tvl\_net\_change     | The net change in the total value locked in Maple      |
| ez\_metrics | outstanding\_supply  | The total amount of outstanding supply (legacy naming) |
| ez\_metrics | net\_deposits        | Total deposits in the protocol (legacy naming)         |
| ez\_metrics | token\_holder\_count | Number of SYRUP token holders                          |

### Fee and Revenue Metrics

| Table Name  | Column Name        | Description                                                    |
| ----------- | ------------------ | -------------------------------------------------------------- |
| ez\_metrics | interest\_fees     | Fees generated from interest payments on loans                 |
| ez\_metrics | platform\_fees     | Fees collected by the Maple platform                           |
| ez\_metrics | delegate\_fees     | Fees collected by pool delegates                               |
| ez\_metrics | fees               | The total USD value generated by Maple from all user-paid fees |
| ez\_metrics | fees               | Total fees collected (legacy naming)                           |
| ez\_metrics | revenue            | Total revenue (legacy naming)                                  |
| ez\_metrics | token\_incentives  | Incentives distributed in SYRUP tokens                         |
| ez\_metrics | total\_expenses    | Total expenses including token incentives                      |
| ez\_metrics | protocol\_earnings | Revenue minus expenses                                         |

### Cash Flow Distribution Metrics

| Table Name  | Column Name                          | Description                                                                        |
| ----------- | ------------------------------------ | ---------------------------------------------------------------------------------- |
| ez\_metrics | fee\_sharing\_token\_fee\_allocation | Revenue distributed to users who commit tokens to receive a share of protocol fees |
| ez\_metrics | treasury\_fee\_allocation            | Revenue allocated to the protocol's treasury                                       |
| ez\_metrics | service\_fee\_allocation             | The share of protocol revenue accrued to service providers (33% of delegate fees)  |
| ez\_metrics | token\_fee\_allocation               | The share of protocol revenue accrued to token holders (66% of delegate fees)      |
| ez\_metrics | primary\_supply\_side\_revenue       | Revenue accrued to supply-side participants (legacy naming)                        |
| ez\_metrics | total\_supply\_side\_revenue         | Total revenue accrued to supply-side participants (legacy naming)                  |
| ez\_metrics | buybacks                             | The amount of tokens actually bought back by the protocol in USD                   |
| ez\_metrics | buybacks\_native                     | The amount of tokens actually bought back by the protocol in native token units    |

### Treasury Metrics

| Table Name  | Column Name                  | Description                                                                   |
| ----------- | ---------------------------- | ----------------------------------------------------------------------------- |
| ez\_metrics | treasury                     | The USD value in the protocol treasury                                        |
| ez\_metrics | treasury\_native             | The native value of tokens in the protocol treasury                           |
| ez\_metrics | net\_treasury                | The USD value in the treasury excluding the protocol's own tokens             |
| ez\_metrics | net\_treasury\_native        | The native value in the treasury excluding the protocol's own tokens          |
| ez\_metrics | own\_token\_treasury         | The USD value of the protocol's own tokens in the protocol treasury           |
| ez\_metrics | own\_token\_treasury\_native | The native value of the protocol's own tokens in the protocol treasury        |
| ez\_metrics | treasury\_value              | The USD value in the protocol treasury (legacy naming)                        |
| ez\_metrics | treasury\_value\_native      | The native value of tokens in the protocol treasury (legacy naming)           |
| ez\_metrics | net\_treasury\_value         | The value in the treasury excluding the protocol's own tokens (legacy naming) |

### Market and Token Metrics

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

### Token Supply Metrics

| Table Name  | Column Name                 | Description                                             |
| ----------- | --------------------------- | ------------------------------------------------------- |
| ez\_metrics | circulating\_supply\_native | The circulating supply of SYRUP in native tokens        |
| ez\_metrics | gross\_emissions\_native    | The amount of native SYRUP tokens emitted               |
| ez\_metrics | gross\_emissions            | The USD value of SYRUP tokens emitted                   |
| ez\_metrics | premine\_unlocks\_native    | The amount of native tokens unlocked from premine       |
| ez\_metrics | locked\_syrup\_native       | The amount of locked SYRUP tokens in native token units |

## Sample Queries

### Lending Activity Analysis

```sql theme={null}
-- Analyze Maple lending activity
SELECT
    date,
    lending_deposits,
    lending_loans,
    tvl,
    tvl_net_change
FROM
    art_share.maple.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC
```

### Revenue Stream Breakdown

```sql theme={null}
-- Analyze Maple revenue streams
SELECT
    date,
    fees,
    interest_fees,
    platform_fees,
    delegate_fees,
    protocol_earnings
FROM
    art_share.maple.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC
```

### Cash Flow Distribution

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

### Treasury Analysis

```sql theme={null}
-- Analyze Maple's treasury composition
SELECT
    date,
    treasury,
    net_treasury,
    own_token_treasury,
    own_token_treasury_native
FROM
    art_share.maple.ez_metrics
WHERE
    date >= DATEADD(month, -6, CURRENT_DATE())
ORDER BY
    date ASC
```

### Token Economics Analysis

```sql theme={null}
-- Track SYRUP token metrics
SELECT
    date,
    price,
    market_cap,
    fdmc,
    circulating_supply_native,
    gross_emissions_native,
    premine_unlocks_native,
    locked_syrup_native,
    buybacks_native
FROM
    art_share.maple.ez_metrics
WHERE
    date >= '2022-01-01'
ORDER BY
    date ASC
```

### Pool Performance Comparison

```sql theme={null}
-- Compare performance across different Maple pools
SELECT
    date,
    pool_name,
    fees,
    platform_fees,
    delegate_fees,
    tvl,
    outstanding_supply
FROM
    art_share.maple.ez_metrics_by_pool
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    pool_name, date ASC
```

### Token Treasury Breakdown

```sql theme={null}
-- Analyze Maple's treasury by token
SELECT
    date,
    token,
    treasury_value_native,
    revenue_native,
    protocol_earnings_native
FROM
    art_share.maple.ez_metrics_by_token
WHERE
    date >= DATEADD(month, -2, CURRENT_DATE())
ORDER BY
    token, date ASC
```
