WEEKLY | SWAP_PROGRAM | TRANSACTIONS | TOTAL_USERS | VOLUME_USD | VOLUME_USD_AVG | FEE_USD | FEE_USD_AVG | VOLUME_CUM | |
---|---|---|---|---|---|---|---|---|---|
1 | 2023-07-24 00:00:00.000 | balancer | 1 | 1 | 0.1 | 0.1 | 0.4119389945 | 0.4119389945 | 0.1 |
2 | 2023-07-31 00:00:00.000 | balancer | 481 | 146 | 0.25 | 0.08333333333 | 566.699674618 | 0.7200758254 | 0.35 |
3 | 2023-08-07 00:00:00.000 | balancer | 4876 | 1318 | 1035568.31 | 4707.128681818 | 12847.656559032 | 2.310314073 | 1035568.66 |
4 | 2023-08-14 00:00:00.000 | balancer | 3654 | 1330 | 1273860.79 | 6337.615870647 | 4858.33085851 | 1.062162409 | 2309429.45 |
5 | 2023-08-21 00:00:00.000 | balancer | 3952 | 1810 | 439263.39 | 2185.39 | 2314.620364862 | 0.4289511425 | 2748692.84 |
6 | 2023-08-28 00:00:00.000 | balancer | 4808 | 2229 | 307403.7 | 998.063961039 | 2384.667426366 | 0.3965193592 | 3056096.54 |
7 | 2023-09-04 00:00:00.000 | balancer | 6144 | 2659 | 2773695.65 | 1818.816819672 | 2205.36574928 | 0.2909069713 | 5829792.19 |
8 | 2023-09-11 00:00:00.000 | balancer | 5144 | 2479 | 2618850.72 | 1643.974086629 | 2060.797461984 | 0.3161217153 | 8448642.91 |
9 | 2023-09-18 00:00:00.000 | balancer | 3789 | 1932 | 3259521.79 | 2700.515153273 | 2210.390663137 | 0.4563151658 | 11708164.7 |
10 | 2023-09-25 00:00:00.000 | balancer | 4258 | 2084 | 1243092.76 | 783.29726528 | 1923.67607262 | 0.2441523128 | 12951257.46 |
11 | 2023-10-02 00:00:00.000 | balancer | 4721 | 2262 | 2082439.13 | 1044.352622869 | 1760.008690587 | 0.2148448109 | 15033696.59 |
12 | 2023-10-09 00:00:00.000 | balancer | 6172 | 3060 | 2297585.48 | 534.197972565 | 2020.797352749 | 0.1700721556 | 17331282.07 |
13 | 2023-10-16 00:00:00.000 | balancer | 8140 | 3519 | 879105.61 | 150.120493511 | 2013.404777184 | 0.1161066131 | 18210387.68 |
14 | 2023-10-23 00:00:00.000 | balancer | 7502 | 3218 | 1636366.74 | 244.343249216 | 3985.777048153 | 0.2002299331 | 19846754.42 |
15 | 2023-10-30 00:00:00.000 | balancer | 5978 | 2996 | 2781919.75 | 530.6981591 | 3241.347183926 | 0.2084869868 | 22628674.17 |
16 | 2023-11-06 00:00:00.000 | balancer | 7196 | 3167 | 1493536.81 | 490.810650674 | 5157.339825105 | 0.4203896173 | 24122210.98 |
17 | 2023-11-13 00:00:00.000 | balancer | 6592 | 3798 | 963215.2 | 252.613480199 | 5591.494662735 | 0.4395138078 | 25085426.18 |
18 | 2023-11-20 00:00:00.000 | balancer | 6539 | 3703 | 822446.66 | 215.978639706 | 5109.890503942 | 0.4072274868 | 25907872.84 |
19 | 2023-11-27 00:00:00.000 | balancer | 5844 | 3465 | 1084807.23 | 222.98195889 | 5400.02383361 | 0.4620143595 | 26992680.07 |
20 | 2023-12-04 00:00:00.000 | balancer | 5700 | 3344 | 2923700.86 | 457.543170579 | 8313.830334329 | 0.6942076097 | 29916380.93 |
bergOverTime copy
Updated 2024-01-31Copy Reference Fork
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
TRUNC(hour, 'DAY') as DATE_TIME,
symbol,
AVG(PRICE) AS PRICE
FROM crosschain.price.ez_hourly_token_prices
WHERE symbol like Any('WETH', 'MATIC', 'BNB')
GROUP BY 1, 2
)
SELECT
TRUNC(t1.block_timestamp, 'WEEK') as WEEKLY,
CASE
when platform ilike '%uniswap%' then 'uniswap'
when platform ilike '%sushiswap%' then 'sushiswap'
when platform ilike '%curve%' then 'curve'
when platform ilike '%balancer%' then 'balancer'
when platform ilike '%hashflow%' then 'hashflow'
when platform ilike '%dodo%' then 'dodo'
END AS SWAP_PROGRAM,
COUNT(DISTINCT t1.tx_hash) as TRANSACTIONS,
COUNT(DISTINCT origin_from_address) as TOTAL_USERS,
SUM(amount_in_usd) as VOLUME_USD,
AVG(amount_in_usd) as VOLUME_USD_AVG,
SUM(tx_fee * PRICES.PRICE) as FEE_USD,
AVG(tx_fee * PRICES.PRICE) as FEE_USD_AVG,
SUM(VOLUME_USD) OVER (PARTITION BY SWAP_PROGRAM ORDER BY WEEKLY) AS VOLUME_CUM
FROM base.defi.ez_dex_swaps t1
JOIN base.core.fact_transactions t2
ON t1.tx_hash = t2.tx_hash
JOIN PRICES ON TRUNC(t1.block_timestamp, 'DAY') = DATE_TIME AND symbol = 'WETH'
WHERE platform ilike Any ('%uniswap%', '%sushiswap%', '%curve%', '%balancer%', '%hashflow%', '%dodo%')
AND status ilike 'success'
AND t1.block_timestamp >= '2023-01-01'
GROUP BY SWAP_PROGRAM, WEEKLY
ORDER BY SWAP_PROGRAM, WEEKLY
Last run: over 1 year ago
105
11KB
26s