nitsBreakup by DEX
Updated 2022-03-01
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
›
⌄
-- SELECT * from
-- (SELECT *,
-- EVENT_INPUTS:value/pow(10,18) as total_tcr_tokens
-- from ethereum.events_emitted
-- where
-- tx_to_address ilike '0xA84918F3280d488EB3369Cb713Ec53cE386b6cBa')
-- -- where lower(tx_from_address) in lower(SELECT DISTINCT pool_address from ethereum.dex_swaps
-- -- where token_address ilike '0x9c4a4204b79dd291d6b6571c5be8bbcd0622f050')
-- -- where lower(tx_from_address) = lower('0x10b5c63a0a94ec3036238190bc88608a02e91e2c') or lower(tx_from_address) = lower('0xe55c3e83852429334a986b265d03b879a3d188ac')
-- LIMIT 100
SELECT date(block_timestamp) as day, pool_name, pool_address,platform, sum(amount_net) as net_inflows, count(DISTINCT to_address) as unique_participants, sum(amount_in)+sum(amount_out) as net_volume,
sum(net_volume) over (order by day) as cumulative_vol,
sum(net_inflows) over (order by day) as cumulative_inflow
from
(SELECT *, case when direction = 'IN' then amount_in else amount_out*(-1) end as amount_net
from ethereum.dex_swaps
where token_address ilike '0x9c4a4204b79dd291d6b6571c5be8bbcd0622f050')
GROUP by 1,2 ,3 ,4
-- limit 100
Run a query to Download Data