theericstonedefillama protocol tvl
    Updated 9 days ago
    WITH daily_tvl AS (
    SELECT
    date,
    protocol_id,
    protocol,
    SPLIT_PART(chain, '-', 1) as clean_chain, -- This will take first part before any '-'
    category,
    SUM(chain_tvl) as total_tvl
    FROM external.defillama.fact_protocol_tvl
    WHERE date BETWEEN CURRENT_DATE() - 90 AND CURRENT_DATE()
    GROUP BY date, protocol_id, protocol, SPLIT_PART(chain, '-', 1), category
    ),

    tvl_metrics AS (
    SELECT
    protocol,
    category,
    clean_chain as chain,
    -- Current TVL (most recent date)
    FIRST_VALUE(total_tvl) OVER (PARTITION BY protocol, clean_chain ORDER BY date DESC) as current_tvl,
    -- TVL changes over different periods
    FIRST_VALUE(total_tvl) OVER (PARTITION BY protocol, clean_chain ORDER BY date DESC) -
    NTH_VALUE(total_tvl, 2) OVER (PARTITION BY protocol, clean_chain ORDER BY date DESC) as day_1_change,
    FIRST_VALUE(total_tvl) OVER (PARTITION BY protocol, clean_chain ORDER BY date DESC) -
    NTH_VALUE(total_tvl, 8) OVER (PARTITION BY protocol, clean_chain ORDER BY date DESC) as day_7_change,
    FIRST_VALUE(total_tvl) OVER (PARTITION BY protocol, clean_chain ORDER BY date DESC) -
    NTH_VALUE(total_tvl, 31) OVER (PARTITION BY protocol, clean_chain ORDER BY date DESC) as day_30_change,
    FIRST_VALUE(total_tvl) OVER (PARTITION BY protocol, clean_chain ORDER BY date DESC) -
    NTH_VALUE(total_tvl, 91) OVER (PARTITION BY protocol, clean_chain ORDER BY date DESC) as day_90_change,
    -- Volatility (Standard Deviation of daily changes over the period)
    STDDEV(total_tvl) OVER (PARTITION BY protocol, clean_chain) as tvl_volatility,
    Last run: 9 days ago
    PROTOCOL
    CATEGORY
    CHAIN
    CURRENT_TVL
    PCT_CHANGE_1D
    PCT_CHANGE_7D
    PCT_CHANGE_30D
    PCT_CHANGE_90D
    VOLATILITY_SCORE
    MAX_DRAWDOWN_PCT
    1
    LidoLiquid StakingEthereum69926251248-1.2-14.52-29.78-54.7431.15-55.53
    2
    AAVE V3LendingEthereum23306537830-0.61-8.78-14.62-269.24-29.13
    3
    WBTCBridgeBitcoin105353479851.72-6.21-16.05-23.088.34-29.12
    4
    EigenLayerRestakingEthereum8707449286-1.2-13.98-29.55-56.9833.13-57.74
    5
    PendleYieldEthereum85639047360.511.36-10.46-5.246.72-20.73
    6
    ether.fi StakeLiquid RestakingEthereum8449792066-1.57-13.96-28.16-50.6426.66-51.82
    7
    Infrared FinanceLiquid StakingBerachain74693299321.062.8717.14-52.17
    8
    Binance staked ETHLiquid StakingEthereum6820695080-1.11-14.08-29.19-44.9421.95-46.27
    9
    EthenaBasis TradingEthereum58995769201.121.67-4.36
    10
    Binance BitcoinBridgeBitcoin55636201161.64-6.2-16.03-18.837.42-25.46
    11
    Ethena USDeBasis TradingEthereum5449544165-0.050.29-9.853.39-11.86
    12
    Royco ProtocolLaunchpadEthereum48758956941.23-7.28-16.65920823.8356.43-99.99
    13
    Royco ProtocolYieldEthereum48758956941.23-7.28-16.65920823.8356.43-99.99
    14
    BabylonRestakingBitcoin43556612991.71-7.18-20.9324.1911.92-42.47
    15
    JitoLiquid StakingSolana40541534260.03-9.07-35.18-39.6823.66-48.59
    16
    Morpho BlueLendingEthereum40047231441.53-3.9-1614.3311.34-32.9
    17
    SparkLendingEthereum35802258370.32-13.99-19.26-44.9627.46-56.09
    18
    JustLendLendingTron3462773320-1.99-7.43-28.53-50.1328.66-50.78
    19
    Kelp rsETHLiquid RestakingEthereum33954158301.79-7.367.135.82-20.04
    20
    LombardRestaked BTCBitcoin31618941663.04-4.87-8.7816.1118.04-100
    ...
    4582
    362KB
    3s