mucryptoTop gainers/losers by 7 day change in TVL (%) 2024-08-14 11:19 PM
    Updated 2024-08-14
    with resps as
    (select defillama.get('/protocols', {}) as resp),

    positive as (
    select
    value:category as category,
    value:name as name,
    cast(value:change_7d as decimal(38,2)) as "SEVEN DAY CHANGE",
    value:description::string as description
    from resps,
    lateral flatten (input => resp:data)
    where category = 'Uncollateralized Lending'
    and "SEVEN DAY CHANGE" > 0
    order by 3 desc
    limit 10),

    negative as (
    select
    value:category as category,
    value:name as name,
    cast(value:change_7d as decimal(38,2)) as "SEVEN DAY CHANGE",
    value:description as description
    from resps,
    lateral flatten (input => resp:data)
    where category = 'Uncollateralized Lending'
    and "SEVEN DAY CHANGE" < 0
    order by 3
    limit 10)

    select
    name,
    "SEVEN DAY CHANGE",
    description,
    'Positive' as category
    from positive

    QueryRunArchived: QueryRun has been archived