Afonso_Diazmigrated users
Updated 2024-07-09
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 tab1 AS (
SELECT
from_address AS user
,amount_in_usd AS amount_usd
,a.tx_hash
,a.block_timestamp::date as dt
,tx_fee
,platform
FROM ethereum.defi.ez_dex_swaps a
JOIN ethereum.core.fact_transactions b
ON a.tx_hash=b.tx_hash
WHERE dt>='2023-10-17'
AND amount_usd>0
AND amount_usd IS NOT NULL
AND amount_usd<10000000
), tab2 AS (
SELECT
DISTINCT from_address AS user
FROM ethereum.uniswapv3.ez_swaps a
JOIN ethereum.core.fact_transactions b
ON a.tx_hash=b.tx_hash
WHERE a.block_timestamp::Date<'2023-10-17'
AND NOT EXISTS (
SELECT *
FROM ethereum.uniswapv3.ez_swaps c
JOIN ethereum.core.fact_transactions d
ON c.tx_hash=d.tx_hash
WHERE b.from_address=d.from_address
AND c.block_timestamp::Date>='2023-10-17'
)
)
SELECT
COUNT(DISTINCT(tx_hash)) AS "swaps"
,COUNT(DISTINCT user) AS "users"
,SUM(amount_usd) AS "volume($)"
QueryRunArchived: QueryRun has been archived