kiacryptosushiswap tvl farms on Ethereum and Polygon
Updated 2022-04-07
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
›
⌄
with
eth as (
select
pool_address,
pool_name,
sum(iff(amount_usd is null, 0, amount_usd)) as tvl
from ethereum.erc20_balances, ethereum.dex_liquidity_pools
where user_address = pool_address and platform = 'sushiswap'
and balance_date >= current_date -1
group by 1, 2
),
poly as (
select
address,
address_name,
sum(case when from_address = address then iff(amount_usd is null, 0, -amount_usd) else iff(amount_usd is null, 0, amount_usd) end) as net_change
from polygon.udm_events, polygon.labels
where (to_address = address or from_address = address) and label = 'sushiswap' and label_subtype = 'pool'
group by 1, 2
)
select *,'ethereum' as network from eth
union all
select *,'polygon' as network from poly
Run a query to Download Data