princefarzamSwap to Blur
Updated 2023-12-21
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 Swaps AS (
SELECT
date_trunc('day', BLOCK_TIMESTAMP) :: date as day,
Count(DISTINCT ORIGIN_FROM_ADDRESS) AS Number_of_Swappers,
Count(DISTINCT TX_HASH) AS Number_of_Swaps,
Sum(AMOUNT_OUT) AS Swap_Volume_to_BLUR,
Sum(AMOUNT_OUT_USD) AS Swap_Volume_to_BLUR_in_USD,
Avg(Swap_Volume_to_BLUR_in_USD) over (
Order by
day
) as avg_Swap_Volume_to_BLUR_in_USD
FROM
ethereum.defi.ez_dex_swaps
WHERE
SYMBOL_OUT = 'BLUR'
AND day >= '2023-06-01'
GROUP BY
day
ORDER BY
day ASC
),
BLUR_Price AS (
SELECT
date_trunc('day', HOUR) :: date as day,
AVG(PRICE) AS BLUR_Price
FROM
ethereum.price.ez_hourly_token_prices
WHERE
SYMBOL = 'BLUR'
GROUP BY
day
ORDER BY
day ASC
)
SELECT
S.day AS date,
QueryRunArchived: QueryRun has been archived