Soheil_MKUSD Volume of swaps in ETH mainnent by their size
Updated 2022-10-22
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 OP_uniswap as (
SELECT
(transfer.raw_amount * price.price) / pow(10, price.decimals) as USD_amounts,
'OP' as network
FROM optimism.core.fact_event_logs logs
JOIN optimism.core.fact_token_transfers transfer
ON logs.tx_hash = transfer.tx_hash
JOIN optimism.core.fact_hourly_token_prices price
ON transfer.contract_address = price.token_address
AND date_trunc('hour', transfer.block_timestamp) = price.hour
WHERE logs.origin_to_address IN ('0xe592427a0aece92de3edee1f18e0157c05861564','0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45')
and logs.tx_status ='SUCCESS'
and logs.event_name = 'Swap'
and logs.BLOCK_TIMESTAMP >='2022-06-01'
),
ETH_uniswap as (
select
abs(AMOUNT1_USD) as USD_amounts,
'ETH' as network
from ethereum.uniswapv3.ez_swaps
where BLOCK_TIMESTAMP >='2022-06-01'
)
SELECT
case
when USD_AMOUNTS < 1 then 'below 1$ swaps'
when USD_AMOUNTS >=1 and USD_AMOUNTS <10 then 'between 1$ and 10$ swaps'
when USD_AMOUNTS >=10 and USD_AMOUNTS <100 then 'between 10$ and 100$ swaps'
when USD_AMOUNTS >=100 and USD_AMOUNTS <1000 then 'between 100$ and 1K$ swaps'
when USD_AMOUNTS >=1000 and USD_AMOUNTS <10000 then 'between 1K$ and 10K$ swaps'
when USD_AMOUNTS >=10000 and USD_AMOUNTS <100000 then 'between 10K$ and 100K$ swaps'
when USD_AMOUNTS >=100000 and USD_AMOUNTS <1000000 then 'between 100K$ and 1M$ swaps'
when USD_AMOUNTS >=1000000 then 'more than 1M $ swaps'
Run a query to Download Data