Updated 2023-05-03
    select
    date_trunc('Day', BLOCK_TIMESTAMP)::Date AS Day,
    TOKEN0_BALANCE_USD AS "USDC Balance (USD)",
    TOKEN1_BALANCE_USD AS "USDT Balance (USD)",
    "USDC Balance (USD)" + "USDT Balance (USD)" AS "Total Value Locked"
    from
    ethereum.uniswapv3.ez_pool_stats
    inner join (
    select
    BLOCK_TIMESTAMP::Date AS date,
    max(BLOCK_TIMESTAMP) AS Last_time
    from
    ethereum.uniswapv3.ez_pool_stats
    where
    POOL_ADDRESS = '0x3416cf6c708da44db2624d63ea0aaef7113527c6'
    group by 1
    ) on date=BLOCK_TIMESTAMP::Date and BLOCK_TIMESTAMP=Last_time
    where
    POOL_ADDRESS = '0x3416cf6c708da44db2624d63ea0aaef7113527c6'
    and BLOCK_TIMESTAMP >= dateadd('Day', - {{Last_N_days}}, current_date)
    order by 1 desc
    Run a query to Download Data