bachisushi - liquidity Vs Volume - daily
    Updated 2022-01-16
    with daily_stats AS(
    select date(block_timestamp) as day, pool_name, AMOUNT_USD as liquidity_amt, tx_id
    from ethereum.dex_swaps where tx_id in (
    select tx_id from ethereum.udm_events
    where ORIGIN_FUNCTION_NAME = 'addLiquidity' and AMOUNT_USD is not null and AMOUNT_USD > 0
    and to_label = 'sushiswap' and block_timestamp >= dateadd(day, -30, getdate())
    )
    )

    select day, pool_name, sum(liquidity_amt) as total_liqudity, count(tx_id) as total_volume from daily_stats
    group by day, pool_name order by day desc
    /*select
    DATE(block_timestamp) as day,
    ORIGIN_ADDRESS as Wallet,
    --TO_ADDRESS_NAME ,
    --TO_LABEL,
    --EVENT_NAME,
    --EVENT_TYPE,
    --SYMBOL ,
    --AMOUNT ,
    sum(AMOUNT_USD) as tota_amount_usd,
    sum(AMOUNT_USD)* 0.30 as fees_usd
    from ethereum.udm_events
    where ORIGIN_FUNCTION_NAME = 'addLiquidity' and AMOUNT_USD is not null and AMOUNT_USD > 0
    and to_label = 'sushiswap' group by day, wallet order by tota_amount_usd desc
    ---------
    /*select
    DATE(block_timestamp) as date,
    count(Distinct(ORIGIN_ADDRESS)) as addresses
    from ethereum.udm_events
    where ORIGIN_FUNCTION_NAME = 'addLiquidity' and
    to_label = 'sushiswap'
    --and day > '2021-08-25'
    group by 1
    order by 1 asc*/

    Run a query to Download Data