dcfpascalstarknet tx
    Updated 2023-12-21
    with pricet as (
    SELECT
    HOUR::date as pdate,
    avg(price) as usd
    from crosschain.price.ez_hourly_token_prices
    where SYMBOL = 'WETH'
    group by 1
    )

    SELECT
    date_trunc('day', TIMESTAMP) as days,
    count(distinct tx_hash) as txs,
    count(distinct CONTRACT) as users,
    sum(ACTUAL_FEE/pow(10,18)) as "Paid Fee (ETH)",
    sum((ACTUAL_FEE * usd)/pow(10,18)) as "Paid Fee (USD)",
    sum(ACTUAL_FEE/pow(10,18))/count(distinct tx_hash) as "Paid Fee per tx"
    from external.tokenflow_starknet.decoded_transactions
    left join pricet on pdate = TIMESTAMP::date
    where CHAIN_ID = 'mainnet'
    and TIMESTAMP < current_date
    and TIMESTAMP > '2023-12-10 00:00:00.000'
    group by 1
    order by 1 asc


    QueryRunArchived: QueryRun has been archived