tomingbase tvl daily copy
    -- forked from Abbas_ra21 / base tvl daily @ https://flipsidecrypto.xyz/Abbas_ra21/q/gQPpwqGX3oI7/base-tvl-daily

    with
    tb AS (
    SELECT defillama.get('/historicalChainTvl', {
    'chain':'Base'
    }) as resp
    )
    select
    TO_TIMESTAMP(VALUE:date)::DATE AS Day,
    VALUE:tvl AS TVL
    from
    tb,
    TABLE (
    FLATTEN(
    input => parse_json(resp:data)
    )
    ) f
    order by 1


    Run a query to Download Data