standdpoints
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 tb AS (
select
SWAPPER AS SHRL5r8BBeJFVcg8Y5u2VRv4Q4paZtxFTz1VUnXWPyRwKstua4vvrPSFefrS4uYkhwsEaYYweSnYtNLjb1N48qw,
count(*) AS TX,
sum(case when SWAP_TO_AMOUNT*B.Close is not null then SWAP_TO_AMOUNT*B.Close
else SWAP_From_AMOUNT*C.Close end ) AS Volume,
count(DISTINCT date_trunc('Month',BLOCK_TIMESTAMP)) AS Months,
count(DISTINCT date_trunc('Week',BLOCK_TIMESTAMP)) AS Weeks,
sum(case when Swap_program like 'jupiter aggregator v2' then 1 else 0 end) AS "Before V3 upgrade TX"
from
solana.defi.fact_swaps
left join solana.price.ez_token_prices_hourly B on date_trunc('Hour',BLOCK_TIMESTAMP)=B.RECORDED_HOUR
and SWAP_TO_MINT=B.TOKEN_ADDRESS
left join solana.price.ez_token_prices_hourly C on date_trunc('Hour',BLOCK_TIMESTAMP)=C.RECORDED_HOUR
and SWAP_FROM_MINT=C.TOKEN_ADDRESS
where
Swap_program like 'jupiter%'
and swapper='CqeGtsnNgbCLptcapT8ca7FeiizpSxC3j3DqkLLVmoyn' group by 1)
select
User,
sum(case
when TX>=100 then 4
when TX>=25 then 3
when TX>=10 then 2
when TX>=5 then 1
else 0
end
) AS "transactions points",
sum(case when Volume>=25000 then 5
when Volume>=10000 then 4
when Volume>=5000 then 3
when Volume>=2500 then 2
when Volume>=1000 then 1
else 0
end
) AS "Volume points",