BlockTrackeradd gas_used to existing query (day name...)
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
-- forked from add gas_used to existing query @ https://flipsidecrypto.xyz/edit/queries/5942d116-fdcf-452e-907f-b307d6cda3c2
SELECT
platform,
DAYname(block_timestamp) as DAY,
hour(block_timestamp) as time,
avg(gas_used) as avg_gas_used,
avg(tx_fee) as avg_tx_fee,
avg(gas_price) as avg_gas_price,
--avg(amount_in/amount_out) as "Average of Exch. Rate",
--median(amount_in/amount_out) as "Median of Exch. Rate",
count(DISTINCT a.tx_hash) as n_swaps,
count (DISTINCT a.origin_from_address) as "Number of Swappers"
FROM {{chain}}.core.ez_dex_swaps a
LEFT JOIN {{chain}}.core.fact_transactions b using(tx_hash)
WHERE a.block_timestamp > dateadd('month', -1*{{last_n_months}}, current_date)
AND a.block_timestamp < current_date
--AND amount_out >0
GROUP BY 1 , 2 , 3
ORDER BY avg_gas_used
Run a query to Download Data