elsina2024-07-24 06:39 PM
    Updated 2025-02-16
    with hourly_prices as (
    select
    date_trunc('hour', hour) as h,
    price
    from crosschain.price.ez_prices_hourly
    where symbol = 'OLAS'
    and blockchain = 'ethereum'
    ),
    transactions_with_prices as (
    select
    date_trunc('year', block_timestamp) as year,
    t.event_name,
    count(distinct t.tx_hash) as transaction_count,
    count(distinct t.origin_from_address) as unique_user,
    sum(t.olas_amount * p.price) as volume_in_usd
    from crosschain.olas.ez_olas_locking t
    join hourly_prices p on date_trunc('hour', t.block_timestamp) = p.h
    group by date_trunc('year', t.block_timestamp), t.event_name
    )
    select
    year,
    case
    when year = '2022-01-01 00:00:00.000' then '2022'
    when year = '2023-01-01 00:00:00.000' then '2023'
    when year = '2024-01-01 00:00:00.000' then '2024'
    when year = '2025-01-01 00:00:00.000' then '2025'
    end as year_label,
    event_name,
    transaction_count,
    unique_user,
    volume_in_usd
    from transactions_with_prices
    order by year;
    Last run: about 2 months ago
    YEAR
    YEAR_LABEL
    EVENT_NAME
    TRANSACTION_COUNT
    UNIQUE_USER
    VOLUME_IN_USD
    1
    2023-01-01 00:00:00.0002023Deposit402831756169.8006224
    2
    2023-01-01 00:00:00.0002023Withdraw201521673644.4989718
    3
    2024-01-01 00:00:00.0002024Withdraw10891111895888.588027
    4
    2024-01-01 00:00:00.0002024Deposit160114343427406.490399
    5
    2025-01-01 00:00:00.0002025Withdraw222235381084.166971
    6
    2025-01-01 00:00:00.0002025Deposit1311110395.149136225
    6
    414B
    1s