FlippppppaStats copy
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
-- forked from Stats @ https://flipsidecrypto.xyz/edit/queries/4ef55c23-a6c9-42d1-a2cf-153c552d271c
select
SWAPPER AS User,
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='{{rename}}' group by 1
Run a query to Download Data