ydcny555Daily $MNGO Buying-Selling Volume since Oct 1st 2022
Updated 2022-10-15
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
›
⌄
WITH s_ as ( -- swaps
SELECT
date_trunc('day', block_timestamp) as date,
count(tx_id) as swap_count,
sum(case when swap_to_mint = 'MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac'
then swap_to_amount end) as MNGO_buying_volume,
-1*sum(case when swap_from_mint = 'MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac'
then swap_from_amount end) as MNGO_selling_volume,
sum(case when swap_to_mint = 'MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac'
then swap_to_amount end) as MNGO_buying_pressure,
sum(case when swap_from_mint = 'MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac'
then swap_from_amount end) as MNGO_selling_pressure
FROM solana.core.fact_swaps
WHERE date < CURRENT_DATE
and succeeded = 'TRUE'
and (swap_to_mint = 'MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac'
or swap_from_mint = 'MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac')
GROUP BY date
)
SELECT
*, MNGO_buying_volume + MNGO_selling_volume as diff,
sum(diff) over (order by date) as cumu_diff
FROM s_
where date >= '2022-10-01'
ORDER BY date
Run a query to Download Data