elsinaAvg daily activity
    Updated 2025-05-17
    WITH katana_swaps_tx AS (
    SELECT tx_hash
    FROM
    ronin.core.ez_decoded_event_logs
    WHERE
    origin_to_address in ('0x5f0acdd3ec767514ff1bf7e79949640bf94576bd', '0x7d0556d55ca1a92708681e2e231733ebd922597d') and
    TX_SUCCEEDED = TRUE and
    (
    EVENT_NAME = 'Swap'
    OR ORIGIN_FUNCTION_SIGNATURE LIKE '%swap%'
    OR TOPIC_0 = '0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822'
    )
    ),

    katana_swaps as (
    select
    t.tx_hash,
    block_timestamp,
    origin_from_address as user,
    symbol,
    amount_usd,
    ROW_NUMBER() OVER (PARTITION BY t.TX_HASH ORDER BY CASE WHEN AMOUNT_USD = 0 OR AMOUNT_USD IS NULL THEN AMOUNT ELSE AMOUNT_USD END DESC) as row_num
    from katana_swaps_tx k left join ronin.core.ez_token_transfers t
    where k.tx_hash = t.tx_hash
    ),

    base as (
    SELECT *
    FROM katana_swaps
    WHERE row_num = 1;
    ),
    daily as (
    SELECT
    date_trunc('day', block_timestamp) as date,
    count(DISTINCT user) as user_count,
    Last run: 13 days ago
    AVG_TX_COUNT
    AVG_USER_COUNT
    AVG_TOTAL_VOL
    1
    15783.795625433.8248183652677.7780292
    1
    43B
    8s