flyingfish2 - ETH USDC-USDT Swap Amounts Profile
Updated 2023-11-01
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
›
⌄
⌄
/*
USDC: 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
USDT: 0xdac17f958d2ee523a2206206994597c13d831ec7
*/
with cte AS (
SELECT
block_timestamp
, tx_hash
, token_in
, amount_in AS swap_from_amount
, token_out
, amount_out
, pool_name
, platform
FROM ethereum.defi.ez_dex_swaps
WHERE block_timestamp > current_date - {{days_back}}
AND token_in IN ('0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
, '0xdac17f958d2ee523a2206206994597c13d831ec7')
AND token_out IN ('0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
, '0xdac17f958d2ee523a2206206994597c13d831ec7')
)
SELECT
date_trunc(week, block_timestamp) AS week
, CASE
when swap_from_amount < 10 THEN 1
when swap_from_amount < 100 THEN 2
when swap_from_amount < 1000 THEN 3
when swap_from_amount < 10000 THEN 4
when swap_from_amount < 100000 THEN 5
when swap_from_amount < 1000000 THEN 6
ELSE 7
END AS bucket
, CASE
when swap_from_amount < 10 THEN '<$10'
when swap_from_amount < 100 THEN '>=$10 - <$100'
when swap_from_amount < 1000 THEN '>=$100 - <$1k'
Run a query to Download Data