mamad-5XN3k32023-06-28 09:41 PM
Updated 2023-06-28
999
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
›
⌄
-- forked from User Statistics (Inflow) @ https://flipsidecrypto.xyz/edit/queries/0008d2f6-cb88-4230-96be-c19f20c32017
with inflowt as (
---polygon
(
select
--date_trunc(week,block_timestamp) as week,
distinct from_address as user,
count(distinct tx_hash) as txs,
--count(distinct from_address) as user,
sum(AMOUNT_USD) as usd_amount
-- txs/user as tx_per_user,
--usd_amount/user as usd_per_user
from polygon.core.ez_token_transfers
where to_address in (
select address from polygon.core.dim_labels where ADDRESS_NAME ilike '%layerzero%')
and block_timestamp >= '2023-01-01'
group by 1
union
select
distinct MATIC_FROM_ADDRESS as user,
--date_trunc(week,block_timestamp) as week,
count(distinct tx_hash) as txs,
--count(distinct MATIC_FROM_ADDRESS) as user,
sum(AMOUNT_USD) as usd_amount
-- txs/user as tx_per_user,
--usd_amount/user as usd_per_user
from polygon.core.ez_matic_transfers
where MATIC_TO_ADDRESS
in (
select address from polygon.core.dim_labels where ADDRESS_NAME ilike '%layerzero%')
and block_timestamp >= '2023-01-01'
group by 1)
Run a query to Download Data