scottincryptoSushiswap LP Users UNI Proportion
Updated 2022-07-02
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 uni_users as (
select
e.tx_from_address as from_address,
case
when d.platform in ('uniswap-v2', 'uniswap-v3') then 'uniswap'
when d.platform in ('sushiswap') then 'sushiswap'
else 'other dex'
end as dex
from ethereum.events_emitted e inner join ethereum.dex_liquidity_pools d on (e.contract_address = d.pool_address)
where block_timestamp > '2021-01-01'
and contract_address in (select pool_address from ethereum.dex_liquidity_pools)
and e.event_name = 'Mint'
group by 1,2
),
date_list as (
SELECT DATEADD(week, (number - 1), '2021-01-01') AS date
FROM (
SELECT ROW_NUMBER() OVER (
ORDER BY n.block_id
)
FROM ethereum.events_emitted n
) S(number)
WHERE number <= (DATEDIFF(week, '2021-01-01', '2021-07-07') + 1)
),
usd_bal_split as(
select
balance_date,
case
when symbol = 'UNI' then 'UNI'
else 'Other Token'
end as token_type,
-- symbol,
-- contract_label,
sum(amount_usd) as usd_balance
Run a query to Download Data