HosseinUntitled Query
Updated 2022-12-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
›
⌄
select block_timestamp::date "Date",
'Serum' "Platform",
count(distinct tx_id) "Swaps Count",
count(distinct tx_from) "Swappers Count",
sum(amount) "Volume (USD)",
sum( amount) "Average Volume (USD)",
sum(amount) "Median Amount (USD)",
sum("Swaps Count") over (order by "Date" asc) as "Comulative Swaps Count",
sum("Swappers Count") over (order by "Date" asc) as "Comulative Swappers Count",
sum("Volume (USD)") over (order by "Date" asc) as "Comulative Volume (USD)"
from solana.core.fact_events a
join solana.core.fact_transfers b using(tx_id)
where 1 = 1
and succeeded = 1
and program_id in (
'SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt',
'srmuapvndxxokk5gt7xd5cuugxmbcoaz2lheuaokwrt',
'EUqojwWA2rd19FZrzeBncJsm38Jm1hEhE3zsmX3bRc2o',
'DeJBGdMFa1uynnnKiwrVioatTuHmNLpyFKnmB5kaFdzQ',
'4ckmDgGdxQoPDLUkDT3vHgSAkzA3QRdNq5ywwY4sUSJn',
'22Y43yTVxuUkoRKdm9thyRhQ3SdgQS7c7kB6UNCiaczD',
'9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin',
'BJ3jrUzddfuSrZHXSCxMUUQsjKEyLmuuyZebkcaFp2fg'
)
and mint = 'So11111111111111111111111111111111111111112'
and "Date" >= current_date - interval '2 weeks'
group by 1, 2
union
select block_timestamp::date "Date",
'Uniswap' "Platform",
count (distinct (tx_hash)) "Swaps Count",
count (distinct (recipient)) "Swappers Count",
sum(iff(amount0_usd > 0, amount0_usd , -1 * amount0_usd)) "Volume (USD)",
avg(iff(amount0_usd > 0, amount0_usd , -1 * amount0_usd)) "Average Volume (USD)",
Run a query to Download Data