drone-mostafasell tether total
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
›
⌄
SELECT
DATE_TRUNC ('DAY',BLOCK_TIMESTAMP) AS DATE,
CASE
when BLOCK_TIMESTAMP >= CURRENT_DATE -7 then 'Last Week'
when BLOCK_TIMESTAMP >= CURRENT_DATE -14 then '2 weeks ago'
when BLOCK_TIMESTAMP >= CURRENT_DATE -30 then 'Last Month'
end as type,
count (DISTINCT TX_HASH) as txn,
count (DISTINCT TRADER) as users,
sum (AMOUNT_OUT) as Volume,
SUM (txn) OVER (PARTITION BY type ORDER BY DATE) AS CUM_TXN,
SUM (users) OVER (PARTITION BY type ORDER BY DATE) AS CUM_users,
SUM (Volume) OVER (PARTITION BY type ORDER BY DATE) AS CUM_Volume
FROM near.core.ez_dex_swaps
WHERE TOKEN_OUT ilike '%usdt%'
AND TOKEN_IN NOT IN (SELECT TOKEN_IN FROM near.core.ez_dex_swaps WHERE TOKEN_IN ilike '%usdt%')
AND BLOCK_TIMESTAMP >= CURRENT_DATE -30
GROUP BY 1,2
Run a query to Download Data