Afonso_Diaztotal copy
Updated 2024-11-01
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with
pricet as (
select
hour::date as date,
avg(price) as price_usd
from ethereum.price.ez_prices_hourly
where symbol = 'WETH'
group by 1
),
main as (
select
tx_hash,
block_timestamp,
from_address as user,
tx_fee,
tx_fee * price_usd as tx_fee_usd
from blast.core.fact_transactions
left join pricet on block_timestamp::date = date
where block_timestamp >= '{{ start_date }}'
and block_timestamp <= '{{ end_date }}'
and status = 'SUCCESS'
)
select
count(distinct tx_hash) as transactions,
(transactions / (select count(distinct tx_hash) from bsc.core.fact_transactions where block_timestamp <= '{{ end_date }}' and status = 'SUCCESS')) * 100 as success_rate,
count(distinct user) as users,
sum(tx_fee_usd) as total_fee_usd,
avg(tx_fee_usd) as average_fee_usd,
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