Eman-RazMaximum Swap Count
Updated 2023-05-16
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
›
⌄
----------------------------------------PEPE,SHIB,CHAD------------------------------------------------------
WITH DATA1 AS (with final_tab as
(WITH SELL AS (select date_trunc('day',block_timestamp) as day, symbol_in,
count(distinct origin_from_address) as SELLER_COUNT,
sum(amount_in_usd) as SELL_VOLUME_USD, count(distinct tx_hash) as selling_count
from ethereum.core.ez_dex_swaps
where (TOKEN_IN=lower('0x6982508145454Ce325dDbE47a25d4ec3d2311933') OR -- PEPE
TOKEN_IN=lower('0x6B89B97169a797d94F057F4a0B01E2cA303155e4') OR --CHAD
TOKEN_IN=lower('0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce')) -- SHIB
group by 1,2
order by 1),
BUY AS (select date_trunc('day',block_timestamp) as day, symbol_out,
count(distinct origin_from_address) as BUYER_COUNT, sum(amount_OUT_usd) as BUY_VOLUME_USD, count(distinct tx_hash) as BUYING_count
from ethereum.core.ez_dex_swaps
where (TOKEN_out=lower('0x6982508145454Ce325dDbE47a25d4ec3d2311933') OR -- PEPE
TOKEN_out=lower('0x6B89B97169a797d94F057F4a0B01E2cA303155e4') OR --CHAD
TOKEN_out=lower('0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce')) -- SHIB
group by 1,2
order by 1)
SELECT SELL.DAY AS "Date", SELL_VOLUME_USD+BUY_VOLUME_USD as "Swap Volume", selling_count+BUYING_count as "Swap Count",
symbol_in as "Symbol"
from sell left join buy on sell.day=buy.day and sell.symbol_in=buy.symbol_out
order by 1)
select "Symbol", max("Swap Count") as "Maximum", round(AVG("Swap Count")) as "Average",
round(median("Swap Count")) as "Median", min("Swap Count") as "Minimum"
from final_tab
group by 1),
--------------------------------------------DOGE----------------------------------------------------------
Run a query to Download Data