DiamondProd EM Daily Unique + First Time Traders Overall
Updated 2023-06-05
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
a as (
select
BLOCK_TIMESTAMP,
to_date(BLOCK_TIMESTAMP) as SessDate,
LEFT_SWAP_USER.value:value:value as LEFT_SWAP_USER,
RIGHT_SWAP_USER.value:value:value as RIGHT_SWAP_USER,
f.*
from
FLOW.CORE.FACT_EVENTS,
table (flatten(event_data)) f,
LATERAL flatten(ARRAY_SLICE(parse_json(f.Value), 3, 4)) AS LEFT_SWAP_USER,
LATERAL flatten(ARRAY_SLICE(parse_json(f.Value), 5, 6)) AS RIGHT_SWAP_USER
where
event_contract IN ('A.9066631feda9e518.Swap')
and event_type = 'ProposalExecuted'
and TX_SUCCEEDED = TRUE
),
user_swaps AS (
SELECT
SessDate,
SWAP_USER AS SWAP_USER
FROM
(
select
SessDate,
LEFT_SWAP_USER as SWAP_USER
from
a
UNION
select
SessDate,
RIGHT_SWAP_USER as SWAP_USER
from
a
)
Run a query to Download Data