SeiDragonswap TVL cleanup
    Updated 2024-06-18
    WITH dragonswap AS (
    SELECT
    livequery.live.udf_api(
    'GET',
    'https://api.llama.fi/protocol/dragonswap',
    {'content-type': 'application/json;charset=utf-8'},
    {}
    ) AS response
    ),
    dragonswap_tvl AS (
    SELECT
    TO_TIMESTAMP(v.value:date::INT) AS date,
    'dragonswap-tvl' as project,
    v.value:totalLiquidityUSD::FLOAT AS TVL
    FROM
    dragonswap,
    LATERAL FLATTEN(input => response['data']['tvl']) AS v
    )
    SELECT
    *
    FROM
    dragonswap_tvl
    WHERE
    date LIKE '% 00:00:00.000'
    QueryRunArchived: QueryRun has been archived