Afonso_DiazNew / Active users + Retention Rate
    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: 17 days ago
    WEEK
    ACTIVE_SWAPPERS
    NEW_SWAPPERS
    RETURNING_SWAPPERS
    RETAINED_SWAPPERS
    RETENTION_RATE
    1
    2025-01-13 00:00:00.000165165000
    2
    2025-01-20 00:00:00.000335283525215.52
    3
    2025-01-27 00:00:00.000447343421311192.66
    4
    2025-02-03 00:00:00.000254724311161034.04
    5
    2025-02-10 00:00:00.000167815121661176.97
    6
    2025-02-17 00:00:00.00012731098175856.68
    7
    2025-02-24 00:00:00.0007100564014602573.62
    8
    2025-03-03 00:00:00.0002619200161829811.38
    9
    2025-03-10 00:00:00.000109272536716815.38
    10
    2025-03-17 00:00:00.0001221883338725.9
    11
    2025-03-24 00:00:00.00012619712901018.01
    12
    2025-03-31 00:00:00.000158711124751539.64
    13
    2025-04-07 00:00:00.00016882864727.98
    13
    645B
    8s