Abbas_ra21near reprot - txs copy copy
    Updated 2024-09-24
    -- forked from Mrfti / near reprot - txs copy @ https://flipsidecrypto.xyz/Mrfti/q/T7d6gVXBnmt-/near-reprot---txs-copy

    -- forked from MoDeFi / near reprot - txs @ https://flipsidecrypto.xyz/MoDeFi/q/Spnv_UwVq3NT/near-reprot---txs

    select date_trunc({{period_type}}, BLOCK_TIMESTAMP) as "Date",
    count(tx_hash) as "Transaction count",
    lag("Transaction count") over (order by "Date") as lag_txs,
    round(100*("Transaction count"-lag_txs)/lag_txs,2) as "Transaction count Change %",
    count(distinct from_address)as "Active users",
    lag("Active users") over (order by "Date") as lag_AUs,
    round(100*("Active users"-lag_AUs)/lag_AUs,2) as "Active users Change %",
    sum(TX_FEE_PRECISE) as "Total Fee ($BERA)",
    lag("Total Fee ($BERA)") over (order by "Date") as lag_fees,
    round(100*("Total Fee ($BERA)"-lag_fees)/lag_fees,2) as "Total Fee Change %"
    from berachain.testnet.fact_transactions
    where TX_SUCCEEDED=true
    and BLOCK_TIMESTAMP::date>='{{start_day}}' and date_trunc({{period_type}}, BLOCK_TIMESTAMP)<='{{target_day}}'
    group by 1
    order by 1 desc


    QueryRunArchived: QueryRun has been archived