cybergenlab[Ecosystem Overview] TVL Distribution
    Updated 2024-11-17

    with defi as (
    select
    date_trunc('month', date) as date,
    'Defi' as sector,
    protocol,
    avg(chain_tvl) as tvl
    from external.defillama.fact_protocol_tvl
    where chain = 'Avalanche'
    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(month, -1, date_trunc('month',current_date()))
    and date < date_trunc('month',current_date())
    group by 1, 2, 3
    order by 1 desc
    )


    , dex as (
    select
    date_trunc('month', date) as date,
    'DEX' as sector,
    protocol,
    avg(chain_tvl) as tvl
    from external.defillama.fact_protocol_tvl
    where chain = 'Avalanche'
    and category in ('Dexes', 'DEX Aggregator')
    and date >= dateadd(month, -1, date_trunc('month',current_date()))
    and date < date_trunc('month',current_date())
    group by 1,2,3
    order by 1 desc
    )

    , nft as (
    select
    date_trunc('month', date) as date,
    QueryRunArchived: QueryRun has been archived