marquWorld Cup - [Polygon] txs and price
Updated 2023-04-06
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
gas as (
select
block_timestamp,
block_number,
tx_hash,
tx_fee * price as fee_usd,
'MATIC' as token,
price as price_usd,
'Polygon' as blockchain
from polygon.core.fact_transactions txs
left join ethereum.core.fact_hourly_token_prices prices
on date_trunc('hour',txs.block_timestamp) = prices.hour
and prices.token_address = '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0' -- MATIC
where block_timestamp ::date >= current_date() - interval '{{months}} months'
),
transactions as (
select
date_trunc('day',block_timestamp) as date,
count(distinct tx_hash) as txs,
sum(fee_usd) as fees_usd
from gas
group by 1
),
prices as (
Run a query to Download Data