Updated 2024-10-02
    with main as (
    select
    tx_hash,
    block_timestamp,
    from_address as user,
    tx_fee,
    block_number
    from kaia.core.fact_transactions
    where tx_succeeded = 1
    and block_timestamp::date between '{{ start_date }}' and '{{ end_date }}'
    )

    select
    count(distinct tx_hash) as transactions,
    (transactions / (select count(distinct tx_hash) from kaia.core.fact_transactions where block_timestamp::date between '{{ start_date }}' and '{{ end_date }}')) * 100 as success_rate,
    count(distinct user) as users,
    count(distinct block_number) as blocks,
    sum(tx_fee) as fees_volume,
    avg(tx_fee) as average_fees_amount,
    transactions / count(distinct block_timestamp::date) as daily_average_transactions,
    users / count(distinct block_timestamp::date) as daily_average_users
    from main



    QueryRunArchived: QueryRun has been archived