Updated 2024-08-30
    with tab1 as (select
    livequery.live.udf_api(
    'GET',
    'https://api.llama.fi/protocol/kaiaswap',
    {'content-type': 'application/json;charset=utf-8'},
    {}
    ) as response)
    ,
    kai_tvl as ( SELECT *
    FROM (
    SELECT
    TO_TIMESTAMP(v.value:date::INT) AS date,
    'Kaia-swap' as project,
    'DEX' as Category,
    v.value:totalLiquidityUSD::FLOAT AS TVL
    FROM
    tab1,
    LATERAL FLATTEN(input => response['data']['chainTvls']['Klaytn']['tvl']) AS v

    ))
    ,

    tab2 as (
    select
    livequery.live.udf_api('GET',
    'https://api.llama.fi/protocol/dragonswap',{'content-type': 'application/json;charset=utf-8'},{}) as response
    ),

    ds_tvl as ( SELECT *
    FROM (
    SELECT
    TO_TIMESTAMP(v.value:date::INT) AS date,
    'Dragon-swap' as project,
    'DEX' as Category,
    v.value:totalLiquidityUSD::FLOAT AS TVL
    FROM