zackmendelUniswap Basic Stats
Updated 2024-06-26
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 eth_price AS (
SELECT
hour::date AS timespan,
symbol,
avg (price) AS price
FROM ethereum.price.ez_prices_hourly
WHERE symbol IN ('WETH', 'WAVAX', 'WMATIC')
GROUP BY 1, 2
),
base_table AS (
SELECT
DISTINCT t.tx_hash,
'Ethereum' AS chain,
t.block_timestamp,
sender,
amount_in_usd,
tx_fee AS tx_fee_eth,
tx_fee * price AS tx_fee_usd
FROM ethereum.core.fact_transactions t JOIN ethereum.defi.ez_dex_swaps s
ON t.tx_hash = s.tx_hash AND t.block_timestamp::date = s.block_timestamp::date
JOIN eth_price p ON t.block_timestamp::date = p.timespan
WHERE platform LIKE 'uniswap%'
AND symbol = 'WETH'
AND status = 'SUCCESS'
UNION ALL
SELECT
DISTINCT t.tx_hash,
'Arbitrum' AS chain,
t.block_timestamp,
sender,
amount_in_usd,
tx_fee AS tx_fee_eth,
tx_fee * price AS tx_fee_usd
QueryRunArchived: QueryRun has been archived