SniperTotal daily transactions
    Updated 2022-10-04
    with sushi_pools as
    (select
    POOL_ADDRESS
    from
    ethereum.core.dim_dex_liquidity_pools
    where PLATFORM ilike 'sushiswap'),

    inflow as (
    SELECT
    'ETH' as chain,
    date_trunc('day', block_timestamp) as day,
    case when block_timestamp >='2022-09-15' then 'Post Merge' else 'Pre Merge'end as date_type,
    'inflow pool' as type,
    COUNT(DISTINCT ORIGIN_FROM_ADDRESS) as total_user,
    COUNT(DISTINCT tx_hash) as total_tx,
    sum(amount_usd) as amount_usd
    FROM ethereum.core.ez_token_transfers
    WHERE
    block_timestamp >='2022-09-01'
    AND tx_hash IN (
    select tx_hash
    FROM ethereum.core.fact_event_logs
    WHERE contract_address IN (SELECT pool_address FROM sushi_pools)
    AND event_name ='Mint'
    )
    GROUP BY 1,2,3
    ),

    outflow as (
    SELECT
    'ETH' as chain,
    date_trunc('day', block_timestamp) as day,
    case when block_timestamp >='2022-09-15' then 'Post Merge' else 'Pre Merge'end as date_type,
    'outflow pool' as type,
    COUNT(DISTINCT ORIGIN_FROM_ADDRESS) as total_user,
    Run a query to Download Data