mucryptoMost dominant protocol's TVL market share 2024-07-25 07:37 PM
    Updated 2024-07-25
    with resps as
    (select defillama.get('/protocols', {}) as resp),

    list as (
    select
    value:category as category,
    value:parentProtocol as protocol,
    value:name as name,
    value:tvl as tvl
    from resps,
    lateral flatten (input => resp:data)
    where category = 'Options Vault'
    and tvl != 0),

    m_protocols as (
    select
    substr(protocol, 8) as protocol,
    sum(tvl) as tvl
    from list
    group by 1),

    protocols as (
    select
    name,
    sum(tvl) as tvl
    from list
    where protocol is null
    group by 1),

    tvl_combined as (
    select
    sum(tvl) as total_combined_tvl
    from list),

    final_list as (
    select
    QueryRunArchived: QueryRun has been archived