zackmendelTAM - V3
Updated 2024-09-04
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
›
⌄
-- forked from TAM - V2 @ https://flipsidecrypto.xyz/studio/queries/bb6cea4f-d7df-461d-b08b-9d5935c7017f
WITH tvl AS (
SELECT
LOWER(chain) AS chain,
chain_tvl
FROM external.defillama.fact_protocol_tvl
WHERE protocol LIKE 'Uniswap V3'
AND chain IN ('Ethereum', 'Arbitrum', 'Base')
AND date = current_date
),
volume AS (
SELECT
chain,
SUM(volume) AS total_volume
FROM external.defillama.fact_dex_volume
WHERE protocol LIKE 'uniswap v3'
AND chain IN ('ethereum', 'arbitrum', 'base')
-- AND date >= current_date - 30
GROUP BY 1
),
users AS (
SELECT
'ethereum' AS chain,
COUNT(DISTINCT sender) AS users
FROM ethereum.defi.ez_dex_swaps
WHERE platform = 'uniswap-v3'
-- AND block_timestamp::date >= current_date - 30
UNION ALL
SELECT
'arbitrum' AS chain,
COUNT(DISTINCT sender) AS users
QueryRunArchived: QueryRun has been archived