permaryRatio of Succeeded and Failed Transactions
    Updated 2024-10-16
    with aptos_transactions as(
    select
    'Aptos' as blockchain,
    count(*) AS total_transactions,
    count(case when success = true then 1 end) as successful_transactions,
    count(case when success = false then 1 end) as failed_transactions
    from aptos.core.fact_transactions
    where block_timestamp between '2024-10-01' and '2024-10-31'
    ),

    solana_transactions as (
    select
    'Solana' as blockchain,
    count(*) as total_transactions,
    count(case when succeeded = true then 1 end) as successful_transactions,
    count(case when succeeded = false then 1 end) as failed_transactions
    from solana.core.fact_transactions
    where block_timestamp between '2024-10-01' and '2024-10-31'
    ),

    polygon_transactions as (
    select
    'Polygon' as blockchain,
    count(*) as total_transactions,
    count(case when gas_used < gas_limit then 1 end) as successful_transactions,
    count(case when gas_used = gas_limit then 1 end) as failed_transactions
    from polygon.core.fact_transactions
    where block_timestamp between '2024-10-01' and '2024-10-31'
    ),

    avalanche_transactions as (
    select
    'Avalanche' as blockchain,
    count(*) as total_transactions,
    count(case when gas_used < gas_limit then 1 end) as successful_transactions,
    count(case when gas_used = gas_limit then 1 end) as failed_transactions
    QueryRunArchived: QueryRun has been archived