maybeyonassushi_game_coins_swap_from
Updated 2022-01-31
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
›
⌄
with
pools as (
select * from (
select
pool_name,
pool_address
from ethereum.dex_swaps
where platform = 'sushiswap'
and direction = 'IN'
)
),
pool_bals as (
select
-- address_name,
-- user_address,
contract_address,
case when symbol is null and contract_address = '0x6b3595068778dd592e39a122f4f5a5cf09c90fe2' then 'SUSHI' else symbol end as symbol,
sum(amount_usd) as tvl,
sum(balance) as tokens_locked
from ethereum.erc20_balances
where user_address in (select pool_address from pools)
and balance_date in (select balance_date from ethereum.erc20_balances where amount_usd is not null order by balance_date desc limit 1)
and amount_usd is not null
and address_name is not null
group by 1,2
),
game_coins as (
select *
from pool_bals
where contract_address in (
lower('0x3845badAde8e6dFF049820680d1F14bD3903a5d0'), --SAND (SAND)
lower('0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c'), --EnjinCoin (ENJ)
lower('0x15D4c048F83bd7e37d49eA4C83a07267Ec4203dA'), --Gala (GALA)
lower('0x767fe9edc9e0df98e07454847909b5e959d7ca0e'), --Illuvium (ILV)
lower('0xcc8fa225d80b9c7d42f96e9570156c65d6caaa25'), --Smooth Love Potion (SLP)
lower('0xd13c7342e1ef687c5ad21b27c2b65d772cab5c8c'), --Ultra Token (UOS)
Run a query to Download Data