MrftiBuy/Sell
Updated 2024-04-02
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
›
⌄
with tbl AS (
select
date_trunc (hour, Block_timestamp) as "Date",
'Buy' as "Buy/Sell",
TX_HASH as "Transaction hash",
trader as "Trader address",
PLATFORM as "Platform",
AMOUNT_Out_USD as "Trade volume (USD)"
from
crosschain.defi.ez_dex_swaps
where
token_in = lower('0x57e114b691db790c35207b2e685d4a43181e6061')
and blockchain = 'ethereum'
UNION ALL
select
date_trunc (hour, Block_timestamp) as "Date",
'Sell' as "Buy/Sell",
TX_HASH as "Transaction hash",
trader as "Trader address",
PLATFORM as "Platform",
AMOUNT_In_USD as "Trade volume (USD)"
from
crosschain.defi.ez_dex_swaps
where
token_out = lower('0x57e114b691db790c35207b2e685d4a43181e6061')
and blockchain = 'ethereum'
)
select "Date", "Buy/Sell", count (DISTINCT "Transaction hash") as "Total tx", sum ("Trade volume (USD)") as "Total volume(USD)"
from tbl
GROUP by 1,2
QueryRunArchived: QueryRun has been archived