permaryTotal Users and Daily transactions on Kaia
    Updated 2024-10-01
    with weekly_activity as (
    select
    date_trunc('week', block_timestamp) as week_start,
    count(distinct to_address) + count(distinct from_address) as total_unique_users,
    count(tx_hash) as total_tx,
    sum(
    case
    when tx_succeeded = 'true' then 1
    else 0
    end
    ) as successful_tx,
    sum(
    case
    when tx_succeeded = 'false' then 1
    else 0
    end
    ) as failed_tx
    from
    kaia.core.fact_transactions
    where
    block_timestamp >= '2024-08-28'
    and block_timestamp < '2024-10-01'
    group by
    week_start
    )
    select
    week_start,
    total_unique_users,
    total_tx,
    successful_tx,
    failed_tx,
    round((successful_tx :: float / total_tx) * 100, 2) as success_rate,
    round((failed_tx :: float / total_tx) * 100, 2) as failure_rate
    from
    weekly_activity
    order by
    QueryRunArchived: QueryRun has been archived