Afonso_DiazSwaps Distribution by Hour
    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
    HOUR
    SWAP_COUNT
    TOTAL_VOLUME
    1
    0982140267.649588907
    2
    1898111045.251279766
    3
    21061128885.742826954
    4
    31255109754.229905471
    5
    4110574071.459408022
    6
    5122875209.414482195
    7
    6151879208.115418467
    8
    7150777511.856256132
    9
    81838105322.002431286
    10
    91882126628.906891908
    11
    10190792579.296686784
    12
    11184681693.124751419
    13
    121975123394.693501731
    14
    131936104672.419659139
    15
    142057289131.215711359
    16
    152021244634.398885472
    17
    162236255178.781477483
    18
    172173272954.163140842
    19
    181940171574.483206518
    20
    191875169033.898931461
    24
    631B
    14s