Hessishsevdrag - trades vol t
Updated 2024-06-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
›
⌄
-- forked from sevdrag - trades vol @ https://flipsidecrypto.xyz/edit/queries/f0ecda95-55db-43d6-a1d7-312c7c85a7ae
with trades as (SELECT DISTINCT tx_hash
from kaia.core.fact_event_logs
where
ORIGIN_TO_ADDRESS = '0x0000000000000068f116a894984e2db1123eb395'
and CONTRACT_ADDRESS = '0x4e3f3a3dba12cec714cba0508a1bab8ead85af31'
),
all_vol as (SELECT date_trunc('hour',block_timestamp) as time,
VALUE::string as price,
TO_ADDRESS as seller
FROM kaia.core.fact_traces
WHERE tx_hash in (SELECT DISTINCT tx_hash from trades) and
TO_ADDRESS != '0x0000000000000068f116a894984e2db1123eb395' --operator
and FROM_ADDRESS = '0x0000000000000068f116a894984e2db1123eb395'
)
SELECT
sum(price) as "Volume in $KLAY"--, "Volume in $KLAY"*avg(close) as "Volume in USD", avg(close)
from all_vol
--join crosschain.price.fact_prices_ohlc_hourly on HOUr::date=time::date
--where ASSET_ID = 'klaytn'
--and PROVIDER = 'coinmarketcap'
QueryRunArchived: QueryRun has been archived