elsina2025-02-25: Daily new users vs old users
    Updated 4 hours ago
    with price as (
    select
    date_trunc('day', hour) as date,
    avg(price) as price_usd
    from crosschain.price.ez_prices_hourly
    where
    blockchain = 'ethereum' and
    token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    group by 1
    ),
    base as (
    SELECT
    e.block_timestamp,
    e.origin_from_address,
    e.tx_hash,
    value as amount,
    amount * price_usd as amount_usd,
    tx_fee,
    utils.udf_hex_to_string(substring(data, 129)) AS domain_name
    from ink.core.fact_event_logs e left join ink.core.fact_transactions t on e.tx_hash = t.tx_hash left join price on e.block_timestamp::date = date
    where
    e.tx_succeeded = TRUE and
    topics[0] = '0x53946bf984072f5888fcb2d7d2b0587c8efeb9187d958f21809711cf00b4b4a5' and
    origin_to_address = '0xfb2cd41a8aec89efbb19575c6c48d872ce97a0a5'
    ),

    first_tx_of_each_users AS (
    SELECT
    origin_from_address,
    MIN(block_timestamp) AS min_date
    FROM
    base
    GROUP BY
    origin_from_address
    ),
    Last run: about 4 hours ago
    DAILY
    OLD_USERS
    ALL_USERS
    NEW_USERS
    PERCENT_NEW_USERS
    PERCENT_OLD_USERS
    1
    2024-12-18 00:00:00.000038381000
    2
    2024-12-19 00:00:00.00021019998.019801981.98019802
    3
    2024-12-20 00:00:00.000113012999.2307692310.7692307692
    4
    2024-12-21 00:00:00.000051511000
    5
    2024-12-22 00:00:00.0001979698.9690721651.030927835
    6
    2024-12-23 00:00:00.00004754751000
    7
    2024-12-24 00:00:00.00006276271000
    8
    2024-12-25 00:00:00.00004434431000
    9
    2024-12-26 00:00:00.00008278271000
    10
    2024-12-27 00:00:00.00004074071000
    11
    2024-12-28 00:00:00.0000100910091000
    12
    2024-12-29 00:00:00.000167667599.8520710060.1479289941
    13
    2024-12-30 00:00:00.00004544541000
    14
    2024-12-31 00:00:00.00003413411000
    15
    2025-01-01 00:00:00.00002212211000
    16
    2025-01-02 00:00:00.00003093091000
    17
    2025-01-03 00:00:00.00002232231000
    18
    2025-01-04 00:00:00.00002472471000
    19
    2025-01-05 00:00:00.00002722721000
    20
    2025-01-06 00:00:00.00002042041000
    ...
    126
    7KB
    7s