0xHaM-dNew Users Per project type
Updated 2024-06-27
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 all_claims as (
SELECT
tx.TX_HASH,
tx.block_timestamp as block_timestamp,
tr.to_Address as claimer,
RAW_AMOUNT/pow(10,18) as amount
FROM
blast.core.fact_transactions tx
INNER join blast.core.fact_token_transfers tr on tx.tx_hash = tr.tx_hash
and tr.contract_address = lower('0xb1a5700fA2358173Fe465e6eA4Ff52E36e88E2ad')
and tx.to_Address = '0xf7be503166828fe8565c520d66645ac6a06bbdd7'
and tx.ORIGIN_FUNCTION_SIGNATURE != '0xca1d209d'
WHERE
tx.status = 'SUCCESS'
)
,
get_volume_per_user as (
select
claimer,
sum (amount) as total_volume
from all_claims
group by 1
)
-- forked from 0xDataWolf / Retention Pareto Demo @ https://flipsidecrypto.xyz/0xDataWolf/q/6IUCfIcpSTMC/retention-pareto-demo
, get_cumulative_count as (
select
* , sum(total_volume) over(order by total_volume desc) as cumulative_count
from get_volume_per_user
)
, get_pct_of_cumulative_count as(
select
*
, cumulative_count / max(cumulative_count) over() as pct_of_cumu_count
, total_volume / max(cumulative_count) over() as pct_of_cumu_amt
from get_cumulative_count
QueryRunArchived: QueryRun has been archived