0xHaM-dComparison Swaps Fee Over Time
Updated 2025-01-22
999
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
)
, swapTB as (
SELECT
BLOCK_TIMESTAMP,
'INK' as chain,
TX_HASH,
FROM_ADDRESS,
TX_FEE_PRECISE as FEE_PRECISE,
TX_FEE_PRECISE*PRICE as FEE_USD,
FROM ink.core.fact_transactions
JOIN priceTb on trunc(BLOCK_TIMESTAMP, 'hour') = hour
WHERE TX_HASH in (SELECT DISTINCT TX_HASH FROM ink.core.ez_decoded_event_logs
WHERE EVENT_NAME ilike '%Swap%'
AND DECODED_LOG:liquidity is NULL
)
UNION ALL
SELECT
BLOCK_TIMESTAMP,
'Avalanche' as chain,
TX_HASH,
FROM_ADDRESS,
TX_FEE_PRECISE as FEE_PRECISE,
TX_FEE_PRECISE*PRICE as FEE_USD,
FROM avalanche.core.fact_transactions
JOIN priceTb on trunc(BLOCK_TIMESTAMP, 'hour') = hour
QueryRunArchived: QueryRun has been archived