mucrypto2023-09-23 03:38 AM
    Updated 2023-10-02
    with resps as
    (select defillama.get('/protocols', {}) as resp),

    tvl as (
    select
    value:category as category,
    value:tvl as tvl
    from resps,
    lateral flatten (input => resp:data))

    select
    category,
    sum(tvl) as combined_tvl
    from tvl
    where category = 'Bridge'
    group by 1
    order by 2 desc
    Run a query to Download Data