maybeyonasmim_dex_vol
Updated 2022-02-08
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 pools as (
select distinct user_address from ethereum.erc20_balances
where symbol = 'MIM'
and year(balance_date) = 2022
and (
label_type = 'dex' or
user_address in (
lower('0x5a6A4D54456819380173272A5E8E9B9904BdF41B'), --mim-crv
lower('0x55A8a39bc9694714E2874c1ce77aa1E599461E18') --mim-usd
)
)
),
sell as (
select
date(block_timestamp) as date,
count(distinct tx_id) as txs,
sum(amount) as volume
from ethereum.udm_events
where symbol = 'MIM'
-- and block_timestamp > current_date - interval '180 days'
and year(block_timestamp) = 2022
and to_address in (select user_address from pools)
group by 1
),
buy as (
select
date(block_timestamp) as date,
count(distinct tx_id) as txs,
sum(amount) as volume
from ethereum.udm_events
where symbol = 'MIM'
-- and block_timestamp > current_date - interval '180 days'
and year(block_timestamp) = 2022
and from_address in (select user_address from pools)
group by 1
)
Run a query to Download Data