LordkingTVL copy
    Updated 2024-09-28
    -- forked from TVL @ https://flipsidecrypto.xyz/studio/queries/5fc81b84-0582-4745-9303-a9fb57d572bb

    select
    DATE as "Date",
    case when month(date) <= 3 then 'Q1'
    when month(date) between 3 and 6 then 'Q2'
    when month(date) between 6 and 9 then 'Q3'
    when month(date) between 9 and 12 then 'Q4'
    end as "Quarter",
    case when year(date) = 2022 then '2022'
    when year(date) = 2023 then '2023'
    when year(date) = 2024 then '2024'
    when year(date) = 2025 then '2025'
    end as "Year",
    TVL_USD as TVL,
    CHAIN
    from external.defillama.fact_chain_tvl
    where CHAIN ilike '%aptos%'
    or CHAIN ilike '%avalanche%'
    or CHAIN ilike '%near%'
    or CHAIN ilike '%base%'
    or CHAIN ilike '%thorchain%'
    or CHAIN ilike '%base%'
    or CHAIN ilike '%arbitrum%'
    or CHAIN ilike '%axelar%'
    or CHAIN ilike '%blast%'
    or CHAIN ilike '%optimism%'
    or CHAIN ilike '%polygon%'
    or CHAIN ilike '%sei%'

    QueryRunArchived: QueryRun has been archived