Soheil_MKUntitled Query
Updated 2022-11-16Copy 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
›
⌄
--https://app.flipsidecrypto.com/dashboard/WQhDNw
with outflow as (
select date_trunc('day', block_timestamp) as date,
'Binance Outflow' as transaction_type,
-1*sum(amount/pow (10, decimal)) as osmo_vol,
-1*sum(osmo_vol) over (order by date) as cumu_osmo_vol,
-1*count(distinct(tx_id)) as tx_count,
-1*sum(tx_count) over (order by date) as cumu_tx_count,
-1*count(distinct(receiver)) as wallet_count
from osmosis.core.fact_transfers
where tx_status = 'SUCCEEDED'
and currency = 'uosmo'
and sender in ('osmo129uhlqcsvmehxgzcsdxksnsyz94dvea907e575','osmo1krmqr8zhvteevq4hnl7q0pxtff6xpnqz4ckxcu') --Binance
group by 1
),
Inflow as (
select date_trunc('day', block_timestamp) as date,
'Binance Inflow' as transaction_type,
sum(amount/pow (10, decimal)) as osmo_vol,
sum(osmo_vol) over (order by date) as cumu_osmo_vol,
count(distinct(tx_id)) as tx_count,
sum(tx_count) over (order by date) as cumu_tx_count,
count(distinct(sender)) as wallet_count
from osmosis.core.fact_transfers
where tx_status = 'SUCCEEDED'
and currency = 'uosmo'
and receiver in ('osmo129uhlqcsvmehxgzcsdxksnsyz94dvea907e575','osmo1krmqr8zhvteevq4hnl7q0pxtff6xpnqz4ckxcu') --Binance
group by 1)
select
a.date,
a.osmo_vol as inflow_osmo_vol,
b.osmo_vol as outflow_osmo_vol,
sum(inflow_osmo_vol+outflow_osmo_vol) over (order by a.date) as cum_osmo_vol
Run a query to Download Data