permaryDaily TVL
    Updated 2024-10-21
    with klaytn_tvl as (
    with json as (
    select defillama.get('/v2/historicalChainTvl/Klaytn', {}) as resp
    )
    select
    to_timestamp(value:date::string) as date,
    value:tvl as tvl_usd
    from json, lateral flatten(input => resp:data)
    )

    select
    date,
    max(tvl_usd) as "daily tvl [usd]"
    from klaytn_tvl
    where date >= current_date - interval '30 days'
    group by date
    order by date;



    QueryRunArchived: QueryRun has been archived