Pmisha-bmlMdxcumulative
    Updated 2022-04-12
    with t1 as(SELECT
    pool_name as pools,
    sum(asset_amount_usd) as tvl
    from thorchain.pool_block_balances
    where block_timestamp>='2022-03-01'
    group by 1 order by 2 desc
    limit 10)


    SELECT
    date_trunc('day',block_timestamp) as dt,
    pool_name as pool,
    SUM(asset_amount_usd) OVER (PARTITION BY pool ORDER BY dt ASC) as cummulative,
    sum(asset_amount_usd) as tvl
    from thorchain.pool_block_balances
    where block_timestamp>='2022-03-25'
    and pool in (select pools from t1)
    group by 1,2,asset_amount_usd
    Run a query to Download Data