Updated 2022-11-12
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
›
⌄
select 'Ethereum' as label , (sum(t.gas_used/pow(10,9)) * avg(p.price)) as results
from ethereum.core.fact_transactions as t inner join ethereum.core.fact_hourly_token_prices as p
on to_date(p.hour) = to_date(t.block_timestamp) and hour(p.hour) = hour(t.block_timestamp) and to_date(t.block_timestamp) > current_date - 31 and p.token_address is null and status='SUCCESS'
UNION
select 'Optimism' as label , (sum(t.gas_used/pow(10,9)) * avg(p.price)) as results
from optimism.core.fact_transactions as t inner join optimism.core.fact_hourly_token_prices as p
on to_date(p.hour) = to_date(t.block_timestamp) and hour(p.hour) = hour(t.block_timestamp) and to_date(t.block_timestamp) > current_date - 31 and p.symbol='OP' and status='SUCCESS'
UNION
select 'Algorand' as label , (sum(t.fee) * avg(p.price_usd)) as results
from algorand.core.fact_transaction as t inner join algorand.core.ez_price_pool_balances as p
on to_date(p.block_hour) = to_date(t.block_timestamp) and hour(p.block_hour) = hour(t.block_timestamp) and to_date(t.block_timestamp) > current_date - 31 and p.asset_id=0
UNION
select 'Solana' as label , (sum(t.fee/pow(10,9)) * avg(p.close)) as results
from solana.core.fact_transactions as t inner join solana.core.fact_token_prices_hourly as p
on to_date(p.recorded_hour) = to_date(t.block_timestamp) and hour(p.recorded_hour) = hour(t.block_timestamp) and to_date(t.block_timestamp) > current_date - 31 and p.id='solana' and succeeded='TRUE'
UNION
select 'Osmosis' as label , (sum(t.gas_used/pow(10,9)) * avg(p.price)) as results
from osmosis.core.fact_transactions as t inner join osmosis.core.dim_prices as p
on to_date(p.recorded_at) = to_date(t.block_timestamp) and hour(p.recorded_at) = hour(t.block_timestamp) and to_date(t.block_timestamp) > current_date - 31 and p.symbol='OSMO' and tx_status='SUCCEEDED'
UNION
select 'Flow' as label , (sum(t.gas_limit/pow(10,9)) * avg(p.price_usd)) as results
from flow.core.fact_transactions as t inner join flow.core.fact_prices as p
on to_date(p.timestamp) = to_date(t.block_timestamp) and hour(p.timestamp) = hour(t.block_timestamp) and to_date(t.block_timestamp) > current_date - 31 and p.token='Flow' and tx_succeeded='TRUE'
Run a query to Download Data