Sbhn_NPendless-sapphire
Updated 2025-03-16
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
with price as (
select hour::date as datee,
avg(price) as usdprice
from ink.price.ez_prices_hourly
where symbol = 'WETH'
group by 1
)
select origin_from_address as "Traders",
count(distinct tx_hash) as "Trades",
sum(ethereum.public.udf_hex_to_int(regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}')[6]) / pow(10,18)) as "Volume $ETH",
sum((ethereum.public.udf_hex_to_int(regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}')[6]) / pow(10,18))*usdprice) as "Volume USD"
from ink.core.fact_event_logs
join price on block_timestamp::date=datee
where topic_0 in ('0x4b5824a0f21039d7160b2a57d8c140cae3ba13e4f15bcd879cc63e4964681a9e','0x0d29d7b2727600087ca17290038d4c09dc340440df666c931e739ad49594669e')
and origin_to_address = '0x1d74317d760f2c72a94386f50e8d10f2c902b899'
and concat('0x', right(regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}')[4],40)) != '0x1d74317d760f2c72a94386f50e8d10f2c902b899'
group by 1
order by 4 desc
QueryRunArchived: QueryRun has been archived