rmasFlow - Wallet Providers - Daily Active Swappers
Updated 2022-07-11Copy Reference Fork
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
dim_account AS (
SELECT
event_data['address']::varchar AS account_address
, tx.payer AS account_creation_fee_payer
, tx.tx_id AS account_creation_tx_id
, tx.block_timestamp AS account_creation_timestamp
FROM flow.core.fact_events AS ac
INNER JOIN flow.core.fact_transactions AS tx
ON tx.tx_id = ac.tx_id
WHERE ac.event_type = 'AccountCreated'
QUALIFY row_number() OVER (partition by account_address order by account_creation_timestamp) = 1
),
daily_swappers AS (
SELECT
s.block_timestamp::date AS utc_date
, da.account_creation_fee_payer
, count(*) AS swaps
FROM flow.core.fact_swaps AS s
LEFT JOIN dim_account AS da
ON da.account_address = s.trader
GROUP BY 1,2
),
daily_nft_buyers AS (
SELECT
s.block_timestamp::date AS utc_date
, da.account_creation_fee_payer
Run a query to Download Data