afonsoAverage Depositor numbers of Each Pool Before and After $BONK
Updated 2023-01-13Copy 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
pricet as (
select
recorded_hour::date as day,
token_address,
avg(close) as price_usd
from solana.core.ez_token_prices_hourly
group by 1, 2
),
t2 as (
select
pricet.day,
address_name as pool,
iff(block_timestamp >= '2022-12-24', 'After BONK', 'Before BONK') as timespan,
count(distinct tx_from) as users_count,
sum(amount * price_usd) as volume_deposited_usd,
avg(amount * price_usd) as avg_amount_deposited_usd,
median(amount * price_usd) as median_amount_deposited_usd,
count(distinct tx_id) as deposits_count
from solana.core.fact_transfers a
join solana.core.dim_labels c
join pricet
on a.tx_to = c.address
and a.mint = pricet.token_address
and pricet.day = date_trunc('day', block_timestamp)
where label_type = 'dex'
and label_subtype = 'pool'
and label ='orca'
and address_name not like '%aquafarm%'
and exists (
select * from solana.core.fact_events b
where b.tx_id = a.tx_id
and program_id = 'whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc'
)
and block_timestamp::date between date('2022-12-24') - 21 and date('2022-12-24') + 21
Run a query to Download Data