rezarwztotal volume of all uTokens over time
Updated 2023-12-29
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 price as (
SELECT
avg(PRICE) as pr,
date_trunc('day', HOUR) as day
FROM
crosschain.price.ez_hourly_token_prices
WHERE
SYMBOL = 'WETH'
and date_trunc('day', hour) >= '2023-10-13'
GROUP by
2
),
flooring as (
SELECT
block_timestamp :: date as date,
tx_hash,
CASE
when symbol_out = 'WETH' then AMOUNT_OUT
when SYMBOL_IN = 'WETH' then AMOUNT_IN
end as eth_amount,
CASE
when symbol_out = 'WETH' then SYMBOL_IN
when SYMBOL_IN = 'WETH' then symbol_out
end as NFT_token,
CASE
when symbol_out = 'WETH'
and AMOUNT_OUT_usd is not null then AMOUNT_OUT_usd
when SYMBOL_IN = 'WETH'
and AMOUNT_IN_usd is not null then AMOUNT_IN_usd
when symbol_out = 'WETH'
and AMOUNT_OUT_usd is null then AMOUNT_OUT * pr
when SYMBOL_IN = 'WETH'
and AMOUNT_in_usd is null then AMOUNT_in * pr
end as USD_amount
FROM
ethereum.defi.ez_dex_swaps s
QueryRunArchived: QueryRun has been archived