feyikemi2024-06-07 02:17 AM
Updated 2024-06-07
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 Prices AS (
SELECT
date_trunc('day', hour) AS Date,
avg(price) AS price
FROM
ethereum.price.ez_prices_hourly
WHERE
symbol ILIKE 'weth'
GROUP BY
Date
),
DexSwapsWithPrice AS (
SELECT
block_timestamp,
tx_hash,
origin_from_address,
amount_in_usd,
tx_fee * price AS tx_fee_usd,
'Uniswap on Ethereum' as Platform
FROM ethereum.defi.ez_dex_swaps
JOIN
ethereum.core.fact_transactions USING (tx_hash)
JOIN
Prices P ON date_trunc('day', block_timestamp) = P.Date
where platform ilike 'uniswap%'
union
SELECT
block_timestamp,
tx_hash,
origin_from_address,
amount_in_usd,
tx_fee * price AS tx_fee_usd,
'Uniswap on Arbitrum' AS Platform
QueryRunArchived: QueryRun has been archived