cybergenlab[DeFi Overview] DeFi TVL Historical
    Updated 2025-05-16
    with defi as (
    select
    date_trunc('month', date) as date,
    'Defi' as sector,
    protocol,
    category,
    avg(chain_tvl) as tvl
    from external.defillama.fact_protocol_tvl
    where chain = 'Base'
    and category in ('Farm', 'Liquid Restaking', 'Options Vault', 'Staking Pool', 'Yield', 'Yield Aggregator', 'Leveraged Farming', 'RWA Lending',
    'Options', 'CDP', 'Synthetics', 'Lending', 'Liquid Staking', 'Basis Trading', 'Derivatives', 'Uncollateralized Lending', 'Restaking')
    and date >= dateadd(year, -1, date_trunc('month',current_date()))
    and date < date_trunc('month',current_date())
    and chain_tvl >0
    group by 1, 2, 3, 4
    order by 1 desc
    )

    , defi_tvl as (
    select
    date,
    sector,
    category,
    rank() over (partition by date order by sum(tvl) desc) as tvl_rank,
    sum(tvl) as tvl
    from defi
    group by 1,2,3
    )

    select * from defi_tvl
    order by date, tvl desc
    Last run: 3 months ago
    DATE
    SECTOR
    CATEGORY
    TVL_RANK
    TVL
    1
    2024-05-01 00:00:00.000DefiLending1251173105
    2
    2024-05-01 00:00:00.000DefiLeveraged Farming2119346359.5
    3
    2024-05-01 00:00:00.000DefiYield Aggregator392425806
    4
    2024-05-01 00:00:00.000DefiCDP471942856
    5
    2024-05-01 00:00:00.000DefiDerivatives548920758.5
    6
    2024-05-01 00:00:00.000DefiYield615230957.5
    7
    2024-05-01 00:00:00.000DefiLiquid Restaking75157945.5
    8
    2024-05-01 00:00:00.000DefiOptions8833437
    9
    2024-05-01 00:00:00.000DefiFarm95016
    10
    2024-05-01 00:00:00.000DefiOptions Vault10365.5
    11
    2024-06-01 00:00:00.000DefiLending1253837476.19855
    12
    2024-06-01 00:00:00.000DefiLeveraged Farming2114901772.666667
    13
    2024-06-01 00:00:00.000DefiYield Aggregator393756206.319298
    14
    2024-06-01 00:00:00.000DefiCDP472091500.1
    15
    2024-06-01 00:00:00.000DefiDerivatives553634559.016667
    16
    2024-06-01 00:00:00.000DefiYield615367835.7
    17
    2024-06-01 00:00:00.000DefiLiquid Restaking75139678.333333
    18
    2024-06-01 00:00:00.000DefiOptions82599368.433333
    19
    2024-06-01 00:00:00.000DefiFarm94984.366667
    20
    2024-06-01 00:00:00.000DefiOptions Vault10365.133333
    ...
    127
    8KB
    2s