bachisushi - liquidity Vs Volume - daily
Updated 2022-01-16
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 daily_stats AS(
select date(block_timestamp) as day, pool_name, AMOUNT_USD as liquidity_amt, tx_id
from ethereum.dex_swaps where tx_id in (
select tx_id from ethereum.udm_events
where ORIGIN_FUNCTION_NAME = 'addLiquidity' and AMOUNT_USD is not null and AMOUNT_USD > 0
and to_label = 'sushiswap' and block_timestamp >= dateadd(day, -30, getdate())
)
)
select day, pool_name, sum(liquidity_amt) as total_liqudity, count(tx_id) as total_volume from daily_stats
group by day, pool_name order by day desc
/*select
DATE(block_timestamp) as day,
ORIGIN_ADDRESS as Wallet,
--TO_ADDRESS_NAME ,
--TO_LABEL,
--EVENT_NAME,
--EVENT_TYPE,
--SYMBOL ,
--AMOUNT ,
sum(AMOUNT_USD) as tota_amount_usd,
sum(AMOUNT_USD)* 0.30 as fees_usd
from ethereum.udm_events
where ORIGIN_FUNCTION_NAME = 'addLiquidity' and AMOUNT_USD is not null and AMOUNT_USD > 0
and to_label = 'sushiswap' group by day, wallet order by tota_amount_usd desc
---------
/*select
DATE(block_timestamp) as date,
count(Distinct(ORIGIN_ADDRESS)) as addresses
from ethereum.udm_events
where ORIGIN_FUNCTION_NAME = 'addLiquidity' and
to_label = 'sushiswap'
--and day > '2021-08-25'
group by 1
order by 1 asc*/
Run a query to Download Data