sepehrmhz82023-05-13 12:37 PM
    Updated 2023-05-14
    select
    'FLOW' as Network,
    date_trunc(week, block_timestamp) as date,
    count(distinct tx_id) as Txs,
    count(distinct proposer) as Users,
    count (case when tx_succeeded != 'TRUE' then 1 end) as Failed_Txs,
    count (case when tx_succeeded = 'TRUE' then 1 end) as Success_Txs,
    (Success_Txs / (Success_Txs+ Failed_Txs)) * 100 as Success_Rate
    from
    flow.core.fact_transactions
    where
    block_timestamp >= '2023-01-01'
    group by
    1,
    2
    union ALL
    select
    'BSC' as Network,
    date_trunc(week, block_timestamp) as date,
    count(distinct tx_hash) as Txs,
    count(distinct from_address) as Users,
    count (case when status != 'SUCCESS' then 1 end) as Failed_Txs,
    count (case when status = 'SUCCESS' then 1 end) as Success_Txs,
    (Success_Txs / (Success_Txs+ Failed_Txs)) * 100 as Success_Rate
    from
    bsc.core.fact_transactions
    where
    block_timestamp >= '2023-01-01'
    group by
    1,
    2
    union ALL
    select
    'Near' as Network,
    date_trunc(week, block_timestamp) as date,
    count(distinct tx_hash) as Txs,
    Run a query to Download Data