This schema contains comprehensive datasets for tracking Aave fundamental data across multiple metrics categories, including lending activity, deposits, loans, revenue streams, treasury, liquidations, and market data.

Available Tables

Aave data is available in several tables:

  • ez_metrics: Main aggregated metrics for the entire Aave protocol
  • ez_metrics_by_chain: Metrics broken down by blockchain (Ethereum, Arbitrum, Optimism, etc.)
  • ez_metrics_by_token: Metrics broken down by token (USDC, ETH, AAVE, etc.)

Table Schema

Lending Activity Metrics

Table NameColumn NameDescription
ez_metricslending_depositsThe total amount of tokens deposited (in USD) on Aave
ez_metricslending_loansThe total outstanding loans (in USD) on Aave
ez_metricsnet_depositsLegacy naming for lending_deposits
ez_metricsoutstanding_supplyLegacy naming for lending_loans
ez_metricstvlThe total value locked in Aave (deposits - loans)

Fee and Revenue Metrics

Table NameColumn NameDescription
ez_metricsecosystem_revenueThe total USD value generated from all user-paid fees
ez_metricsinterest_rate_feesInterest fees paid by borrowers on loans
ez_metricsflashloan_feesFees generated from flash loans
ez_metricsgho_feesFees generated from GHO stablecoin operations
ez_metricsfeesLegacy naming for total fees (interest + flashloan + gho)

Revenue Distribution Metrics

Table NameColumn NameDescription
ez_metricsservice_cash_flowRevenue accrued to liquidity providers (deposit revenue + flashloan)
ez_metricsliquidator_cash_flowRevenue allocated to liquidators
ez_metricstreasury_cash_flowRevenue allocated to Aave treasury (reserve factor + dao + gho)
ez_metricsreserve_factor_treasury_cash_flowPortion of interest fees sent to treasury via reserve factor
ez_metricsdao_treasury_cash_flowRevenue from DAO trading activities
ez_metricsgho_treasury_cash_flowRevenue from GHO operations sent to treasury

Incentives and Expenses

Table NameColumn NameDescription
ez_metricsecosystem_incentivesIncentives distributed to ecosystem participants
ez_metricssafety_incentivesIncentives distributed for the safety module
ez_metricstoken_incentivesTotal token incentives (ecosystem + safety)
ez_metricstotal_expensesTotal protocol expenses (currently just token incentives)
ez_metricsprotocol_earningsProtocol revenue minus total expenses

Treasury Metrics

Table NameColumn NameDescription
ez_metricstreasuryThe total USD value in Aave’s treasury
ez_metricstreasury_nativeThe USD value of AAVE tokens in the treasury
ez_metricsnet_treasuryThe USD value in treasury excluding protocol’s own tokens
ez_metricstreasury_valueLegacy naming for treasury
ez_metricstreasury_value_nativeLegacy naming for treasury_native
ez_metricsnet_treasury_valueLegacy naming for net_treasury

Market and Token Metrics

Table NameColumn NameDescription
ez_metricspriceThe price of AAVE token in USD
ez_metricsmarket_capThe market cap of AAVE token in USD
ez_metricsfdmcThe fully diluted market cap of AAVE token in USD
ez_metricstoken_volumeThe trading volume of AAVE token in USD
ez_metricstoken_turnover_circulatingThe turnover of AAVE based on circulating supply
ez_metricstoken_turnover_fdvThe turnover of AAVE based on fully diluted valuation
ez_metricstoken_holder_countThe number of unique AAVE token holders
ez_metricsh24_volumeThe 24-hour trading volume of AAVE (legacy naming)

Chain-specific Metrics (ez_metrics_by_chain)

The ez_metrics_by_chain table provides the same metrics as the main table but broken down by blockchain network:

Column NameDescription
dateThe date of the recorded metrics
chainThe blockchain (Ethereum, Arbitrum, Optimism, etc.)
lending_depositsTotal deposits on this chain
lending_loansOutstanding loans on this chain
tvlTotal value locked on this chain
ecosystem_revenueTotal protocol revenue on this chain
service_cash_flowRevenue to liquidity providers on this chain
liquidator_cash_flowRevenue to liquidators on this chain
treasury_cash_flowRevenue to treasury on this chain
treasuryTreasury value associated with this chain
treasury_nativeAAVE token value in treasury for this chain

Token-specific Metrics (ez_metrics_by_token)

The ez_metrics_by_token table breaks down metrics by individual tokens:

Column NameDescription
dateThe date of the recorded metrics
chainThe blockchain where the token is used
token_addressThe contract address of the token
lending_depositsDeposits of this specific token (USD)
lending_deposits_nativeDeposits of this token in native units
lending_loansLoans of this specific token (USD)
lending_loans_nativeLoans of this token in native units
tvlTVL for this token (USD)
tvl_nativeTVL for this token in native units
ecosystem_revenueRevenue generated by this token (USD)
ecosystem_revenue_nativeRevenue generated by this token in native units
service_cash_flowRevenue to liquidity providers from this token
service_cash_flow_nativeRevenue to LPs in native token units
liquidator_cash_flowRevenue to liquidators from this token
liquidator_cash_flow_nativeRevenue to liquidators in native token units
treasury_cash_flowRevenue to treasury from this token
treasury_cash_flow_nativeRevenue to treasury in native token units
treasuryTreasury holdings of this token (USD)
treasury_nativeTreasury holdings in native token units

Sample Queries

Basic Protocol Activity Query

-- Pull fundamental lending data for Aave
SELECT
    date,
    lending_deposits,
    lending_loans,
    tvl,
    price
FROM
    art_share.aave.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC

Revenue Analysis

-- Analyze Aave revenue streams
SELECT
    date,
    ecosystem_revenue,
    interest_rate_fees,
    flashloan_fees,
    gho_fees,
    service_cash_flow,
    liquidator_cash_flow,
    treasury_cash_flow
FROM
    art_share.aave.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC

Revenue Distribution Analysis

-- Analyze how Aave's revenue is distributed
SELECT
    date,
    ecosystem_revenue,
    service_cash_flow,
    liquidator_cash_flow,
    treasury_cash_flow,
    service_cash_flow / ecosystem_revenue * 100 as lp_percentage,
    liquidator_cash_flow / ecosystem_revenue * 100 as liquidator_percentage,
    treasury_cash_flow / ecosystem_revenue * 100 as treasury_percentage
FROM
    art_share.aave.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC

Treasury Analysis

-- Track Aave treasury composition
SELECT
    date,
    treasury,
    treasury_native,
    net_treasury,
    treasury_native / treasury * 100 as aave_token_percentage,
    token_incentives,
    protocol_earnings
FROM
    art_share.aave.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC

Cross-Chain Comparison

-- Compare Aave metrics across different blockchains
SELECT
    date,
    chain,
    lending_deposits,
    lending_loans,
    tvl,
    ecosystem_revenue
FROM
    art_share.aave.ez_metrics_by_chain
WHERE
    date >= DATEADD(month, -1, CURRENT_DATE())
ORDER BY
    chain, date ASC

Token Analysis

-- Analyze the performance of specific tokens on Aave
SELECT
    date,
    chain,
    token_address,
    lending_deposits,
    lending_loans,
    ecosystem_revenue,
    service_cash_flow
FROM
    art_share.aave.ez_metrics_by_token
WHERE
    date = DATEADD(day, -1, CURRENT_DATE())
    AND token_address IN (
        '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', -- USDC
        '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', -- WETH
        '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9'  -- AAVE
    )
ORDER BY
    ecosystem_revenue DESC

GHO Stablecoin Analysis

-- Track Aave's GHO stablecoin revenue
SELECT
    date,
    gho_fees,
    gho_treasury_cash_flow,
    gho_fees / ecosystem_revenue * 100 as gho_revenue_percentage
FROM
    art_share.aave.ez_metrics
WHERE
    date >= '2023-07-01'  -- Approximate GHO launch date
    AND date <= CURRENT_DATE()
ORDER BY
    date ASC

Protocol Economics Analysis

-- Analyze Aave protocol economics
SELECT
    date,
    lending_deposits,
    lending_loans,
    lending_loans / lending_deposits * 100 as utilization_rate,
    ecosystem_revenue,
    ecosystem_revenue / lending_loans * 365 * 100 as annualized_revenue_rate,
    token_incentives,
    protocol_earnings,
    price
FROM
    art_share.aave.ez_metrics
WHERE
    date >= DATEADD(month, -3, CURRENT_DATE())
ORDER BY
    date ASC