nasdfajsklj2024-06-14 10:01 PM
    Updated 2025-02-05
    with addresses as (
    select lower(address) as address from (
    values
    ('0xc8c0e780960f954c3426a32b6ab453248d632b59') --old fee address
    ,('0x77777d91c0b8ec9984a05302e4ef041dccf77fee') --new fee address
    -- ,('0x0000000000002bdbf1bf3279983603ec279cc6df') --relay?

    ) as t(address)
    )
    ,data as (
    select
    block_timestamp::date as date,
    date_trunc('minute', block_timestamp) as date_minute,
    date_trunc('month', block_timestamp)::date as month,
    chain,
    amount_usd,
    origin_to_address
    from (
    select block_timestamp, amount_usd, origin_to_address, 'ETH' as chain
    from ethereum.core.ez_token_transfers
    where to_address in (select address from addresses)
    and origin_from_address not in (select address from addresses)
    and block_timestamp::date > '2024-04-01'
    and symbol not in ('Shiba 2.0', 'INNBC')
    union all
    select block_timestamp, amount_usd, origin_to_address, 'BASE' as chain
    from base.core.ez_token_transfers
    where to_address in (select address from addresses)
    and origin_from_address not in (select address from addresses)
    and block_timestamp::date > '2024-04-01'

    ) as combined
    ),
    all_minutes AS (
    Auto-refreshes every 12 hours
    QueryRunArchived: QueryRun has been archived