Afonso_Diazgrouping users
Updated 2024-08-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
pricet as (
select
hour::date as date,
avg(price) as price_usd
from ethereum.price.ez_prices_hourly
where symbol = 'MATIC'
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 polygon.core.fact_transactions
left join pricet on block_timestamp::date = date
where block_timestamp >= '{{ start_date }}'
and block_timestamp <= '{{ end_date }}'
and status = 'SUCCESS'
),
users as (
select
user,
count(distinct tx_hash) as transactions
from main
group by 1
)
select
case
when transactions = 1 then 'a. 1 Transaction'
QueryRunArchived: QueryRun has been archived