Updated 2025-04-08
    with

    pricet as (
    select
    hour::date as date,
    token_address,
    avg(price) as token_price_usd
    from
    ink.price.ez_prices_hourly
    group by 1, 2
    ),

    txns as (
    select
    tx_hash,
    block_timestamp,
    origin_from_address as swapper,
    a.contract_address as token_out,
    b.contract_address as token_in,
    nvl(a.decoded_log:value, a.decoded_log:wad) as amount_out_unadj,
    nvl(b.decoded_log:value, b.decoded_log:wad) as amount_in_unadj
    from
    ink.core.ez_decoded_event_logs a
    join
    ink.core.ez_decoded_event_logs b using (tx_hash, block_timestamp, event_name)
    where
    a.event_name = 'Transfer'
    and nvl(a.decoded_log:from, a.decoded_log:src) = swapper
    and nvl(b.decoded_log:to, b.decoded_log:dst) = swapper
    and tx_succeeded
    and origin_to_address = '0x652e53c6a4fe39b6b30426d9c96376a105c89a95'
    and tx_hash in (select distinct tx_hash from ink.core.ez_decoded_event_logs where event_name = 'Swap')

    union all

    select
    Last run: about 2 months ago
    SWAPS
    SWAPPERS
    SWAPS_PER_SWAPPER
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    DAILY_AVERAGE_SWAPS
    DAILY_AVERAGE_SWAPPERS
    1
    38567212451.8153453423357.7194231989.00623263453.729412249.941176
    1
    75B
    10s