Afonso_Diaz2023-11-11 10:03 PM
Updated 2023-11-11
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
t0 as (
select
hour::date as date,
symbol,
avg(price) as price_usd
from ethereum.price.ez_hourly_token_prices
where symbol in ('WETH', 'WAVAX', 'MATIC')
group by 1, 2
),
t as (
select
tx_hash,
block_timestamp,
'Ethereum' as chain,
amount_in_usd,
amount_out_usd,
origin_from_address as swapper,
symbol_in,
symbol_out,
token_in,
token_out,
tx_fee * price_usd as tx_fee_usd
from ethereum.defi.ez_dex_swaps
join ethereum.core.fact_transactions
using(tx_hash)
join t0 on block_timestamp::date = date and t0.symbol = 'WETH'
where platform = 'curve'
union all
select
tx_hash,
block_timestamp,
'Polygon' as chain,
Run a query to Download Data