MasiDaily Numbers
    Updated 2025-03-08
    with tb0 as ( select trunc(hour,'day') as day,
    avg(price) as price
    from crosschain.price.ez_prices_hourly
    where token_address = lower('0xc383a3833a87009fd9597f8184979af5edfad019')
    and day = current_date - 1
    group by 1)
    ,
    tb1 as (select trunc(block_timestamp,'day') as day,
    count(distinct tx_hash) as wrap_tx,
    count(distinct origin_from_address) as wrapper,
    sum(amount) as wrap_amount,
    sum(amount*price) as wrap_usd,
    avg(amount*price) as avg_usd,
    median(amount*price) as median_usd,
    max(amount*price) as max_usd
    from ink.core.ez_token_transfers , tb0
    where from_address = '0x0000000000000000000000000000000000000000'
    and contract_address = '0x11476323d8dfcbafac942588e2f38823d2dd308e'
    group by 1)
    ,
    tb2 as (select trunc(block_timestamp,'day') as day,
    count(distinct tx_hash) as unwrap_tx,
    count(distinct origin_from_address) as unwrapper,
    sum(amount) as unwrap_amount,
    sum(amount*price) as unwrap_usd,
    avg(amount*price) as avg_usd,
    median(amount*price) as median_usd,
    max(amount*price) as max_usd
    from ink.core.ez_token_transfers , tb0
    where to_address = '0x0000000000000000000000000000000000000000'
    and contract_address = '0x11476323d8dfcbafac942588e2f38823d2dd308e'
    group by 1)

    select coalesce(a.day,b.day) as daily,
    coalesce(wrap_tx,0) as "Wrap Txn",
    coalesce(unwrap_tx,0) as "Unwrap Txn",
    QueryRunArchived: QueryRun has been archived