Afonso_DiazTop Users
    Updated 2025-05-05
    with

    pricet as (
    select
    hour::date as date,
    avg(price) as token_price_usd
    from
    crosschain.price.ez_prices_hourly
    where
    symbol = 'XLM'
    and token_address is null
    and blockchain = 'stellar'
    group by 1
    ),

    main as (
    select
    transaction_hash as tx_hash,
    block_timestamp,
    account as user,
    successful as tx_succeeded,
    fee_charged / 1e7 as tx_fee,
    tx_fee * token_price_usd as tx_fee_usd
    from
    stellar.core.fact_transactions
    left join
    pricet on block_timestamp::date = date
    )

    select
    user,
    count(distinct tx_hash) as transactions,
    sum(tx_fee) as volume_fee,
    avg(tx_fee) as average_tx_fee,
    sum(tx_fee_usd) as volume_fee_usd,
    avg(tx_fee_usd) as average_tx_fee_usd
    QueryRunArchived: QueryRun has been archived