0xHaM-dOver Time
Updated 2025-01-22
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 priceTb as (
select
hour,
PRICE
from crosschain.price.ez_prices_hourly
where symbol ='ETH'
and BLOCKCHAIN = 'ethereum'
and date_trunc(day,hour)::date >= '2024-12-01'
and TOKEN_ADDRESS is NULL
)
,
domainTb as (
SELECT
t1.BLOCK_TIMESTAMP,
t1.TX_HASH,
t1.ORIGIN_FROM_ADDRESS as owner,
ethereum.public.udf_hex_to_int(TOPIC_1)::string as token_Id,
ethereum.public.udf_hex_to_int(TOPIC_3) as expiry,
AMOUNT,
AMOUNT*PRICE as amt_usd,
AMOUNT_USD
FROM ink.core.fact_event_logs t1
JOIN ink.core.ez_native_transfers t2
LEFT JOIN priceTb p on trunc(BLOCK_TIMESTAMP, 'hour') = trunc(hour, 'hour')
on t1.TX_HASH = t2.TX_HASH AND t1.ORIGIN_FROM_ADDRESS = t2.FROM_ADDRESS AND t1.contract_address = t2.TO_ADDRESS
WHERE contract_address = '0xfb2cd41a8aec89efbb19575c6c48d872ce97a0a5'
AND topics[0] = '0x2d764d30e21994e86d9ea9925aa0095caac83736bb99f47ae5eeb3f2256239a7'
-- AND t1.TX_HASH in (
-- '0xf70decdfb11e9002b00d94268982c2e2f9472f50a247ec669a6a445607f798af'
-- ,'0xea1df33d3d69407e878780190f0308b9f2dd009f9ea71f929eae80ee58fd39eb'
-- )
AND tx_succeeded = 'TRUE'
)
SELECT
trunc(BLOCK_TIMESTAMP, 'd') as date,
count(DISTINCT TX_HASH) as n_txs,
QueryRunArchived: QueryRun has been archived