winnie-fsSol CUs - Transactions & Fees (Standard, Priority)
Updated 2023-12-13
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
activity as (
select
block_timestamp
, fee / pow(10,9) as fee_sol
, fee / pow(10,9) * close as fee_usd
, 'Solana' as blockchain
-- credit @ltirrell_ for the priority fee filter
, case
when regexp_count(
array_to_string(instructions, ',')
, 'ComputeBudget111111111111111111111111111111'
) = 2 then 'Priority Fees'
else 'Standard Fees'
end as fee_type
from solana.core.fact_transactions
left join solana.price.ez_token_prices_hourly
on date_trunc('hour', fact_transactions.block_timestamp) = ez_token_prices_hourly.recorded_hour
and ez_token_prices_hourly.symbol = 'sol'
where date_trunc('minute', fact_transactions.block_timestamp) > current_timestamp() - interval '{{hours}} hours'
)
select
date_trunc('{{date_trunc}}', block_timestamp) as date
, fee_type
, count(1) as transactions
, case
when '{{date_trunc}}' = 'minute' then count(1) / 60
when '{{date_trunc}}' = 'hour' then count(1) / 3600
when '{{date_trunc}}' = 'hour' then count(1) / 86400
QueryRunArchived: QueryRun has been archived