theericstoneEthereum Activity
    Updated 2023-03-09
    with amount_sent as (
    select
    date_trunc('week',block_timestamp) as week,
    sum(amount_usd) as amount_sent_usd
    from
    ethereum.udm_events
    where amount > 0
    and block_timestamp > getdate() - interval '180 days'
    and (
    contract_address IS NULL
    or contract_address = LOWER('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2')
    )
    group by 1
    ),

    fees as (
    select
    date_trunc('week',block_timestamp) as week,
    sum(fee_usd) as fees_usd
    from ethereum.transactions
    where block_timestamp > getdate() - interval '180 days'
    group by 1
    )

    select a.week, a.amount_sent_usd, f.fees_usd
    from amount_sent a join fees f on a.week = f.week
    order by 1 desc;
    Run a query to Download Data