Afonso_DiazOvertime
    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
    DATE
    SWAPS
    SWAPPERS
    VOLUME_USD
    AVERAGE_AMOUNT_USD
    NEW_SWAPPERS
    RETURNING_SWAPPERS
    CUMULATIVE_SWAPS
    CUMULATIVE_VOLUME_USD
    1
    2025-01-14 00:00:00.0001163.7406563.7406510163.74065
    2
    2025-01-15 00:00:00.0002114941.01704586444.810335517131221004.757695864
    3
    2025-01-16 00:00:00.0001864175518.204494185406.01185211937420876522.962190049
    4
    2025-01-17 00:00:00.000492930114.426913222614.580141086218257106637.38910327
    5
    2025-01-18 00:00:00.000612537270.421052144610.9905090521312318143907.810155415
    6
    2025-01-19 00:00:00.00025892278757.1538684461080.4540847618012576422664.964023861
    7
    2025-01-20 00:00:00.0001715220138.129947347117.7668417973022747442803.093971208
    8
    2025-01-21 00:00:00.0001044611177.375613964107.4747655191927851453980.469585172
    9
    2025-01-22 00:00:00.000875317878.797117076205.5034151392726938471859.266702248
    10
    2025-01-23 00:00:00.0001928690209.61582551469.84174909160261130562068.882527758
    11
    2025-01-24 00:00:00.00022810628642.229869353125.62381521676301358590711.112397111
    12
    2025-01-25 00:00:00.0001276325038.438052701197.15305553335281485615749.550449812
    13
    2025-01-26 00:00:00.0001367124675.628901258181.43844780336351621640425.179351069
    14
    2025-01-27 00:00:00.0001868457829.33898769310.91042466537471807698254.51833876
    15
    2025-01-28 00:00:00.00053239132293.55861651660.81649457347442339730548.076955275
    16
    2025-01-29 00:00:00.0001371123354337.65053834839.6914905321190433710784885.727493623
    17
    2025-01-30 00:00:00.0001131101933145.46387066429.384276481965544841818031.191364287
    18
    2025-01-31 00:00:00.00094884442823.39304599345.315759837815295789860854.584410279
    19
    2025-02-01 00:00:00.00079663123377.32649857629.442476698593386585884231.910908856
    20
    2025-02-02 00:00:00.00060643615660.86408758125.928582926395417191899892.774996437
    85
    8KB
    21s