Sniperok-tomato
Updated 2024-10-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 tbl as ( select block_timestamp,
-- tx_signer as user,
-- tx_hash
-- from near.core.fact_transactions
-- where TX_SUCCEEDED = 'true'
-- and block_timestamp::date::Date >= '2023-01-01'
-- UNION
-- select block_timestamp,
-- tx_receiver as user,
-- tx_hash
-- from near.core.fact_transactions
-- where TX_SUCCEEDED = 'true'
-- and block_timestamp::date::Date >= '2023-01-01'
-- )
-- ,
with new_wallet as (
select
date_trunc('quarter', first_tx) as date,
count(DISTINCT tx_signer) as n_new_user
from (
select
tx_signer,
min(block_timestamp) as first_tx
from near.core.fact_transactions
group by 1
)
group by 1
)
-- ,
-- affiliate_volume as (
-- select
-- date_trunc('quarter', block_timestamp) as date,
-- sum(coalesce(from_amount_usd, to_amount_usd)) as affiliate_volume
-- from thorchain.defi.fact_swaps
-- where affiliate_address is not null
-- group by 1
QueryRunArchived: QueryRun has been archived