mz0111esc 7
    Updated 2022-11-16
    with table_1 as
    (select
    distinct(tx_hash) as txs,
    date_trunc('day', block_timestamp) as date,
    sum(event_inputs:value/1e18) as usd_volume
    from polygon.core.fact_event_logs --GNS
    where tx_status= 'SUCCESS'
    and contract_address = '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063'
    and origin_to_address in ('0xd8d177efc926a18ee455da6f5f6a6cfcee5f8f58','0x65187fec6ecc4774c1f632c7503466d5b4353db1','0xf8a140db8b05bec52c7e86d0d40d72f8e54fe559')
    and origin_from_address = event_inputs:from
    and block_timestamp >= current_date - 30
    group by 1 , 2
    )

    select
    date,
    case when usd_volume < 10 then 'Less Than $10'
    when usd_volume >= 10 and usd_volume < 100 then '$10 - $100'
    when usd_volume >= 100 and usd_volume < 1000 then '$100 - $1000'
    when usd_volume >= 1000 and usd_volume < 10000 then '$1000 - $10000'
    else 'More Than $10000' end as type,
    count(txs) as tx_count
    from table_1
    group by 1 , 2
    Run a query to Download Data