jackguyvelodrom_test_321
Updated 2023-05-13
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
SELECT
*,
sum(swap_volume) over (ORDER BY day) as total_swap_volume,
sum(fee_usd) over (ORDER BY day) as total_swap_fee,
sum(swaps) over (ORDER BY DAY) as total_swaps
FROM (
SELECT
date_trunc('day', block_timestamp) as day,
sum(CASE WHEN NOT AMOUNT_IN_USD is NULL THEN AMOUNT_IN_USD
WHEN NOT AMOUNT_OUT_USD is NULL THEN AMOUNT_OUT_USD
ELSE 0 END) as swap_volume,
SUM(LP_FEE_USD) as fee_usd,
count(DISTINCT ORIGIN_FROM_ADDRESS) as users,
count(DISTINCT tx_hash) as swaps
FROM optimism.velodrome.ez_swaps
GROUP BY 1
-- limt 100
)
--LIMIT 100
Run a query to Download Data