elsinaAvg daily activity
    Updated 4 days 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'
    ),
    daily as (
    SELECT
    date_trunc('day', block_timestamp) as date,
    count(DISTINCT origin_from_address) as user_count,
    count(DISTINCT tx_hash) as tx_count,
    sum(amount_usd) as total_volume,
    sum(tx_fee) as total_fees
    from base
    group by 1
    Last run: 4 days ago
    AVG_TX_COUNT
    AVG_USER_COUNT
    AVG_TOTAL_VOLUME
    AVG_TOTAL_FEES
    1
    337.142857335.3968251541.9384617360.01924869701
    1
    54B
    6s