cindieAnchor Dominance -3
Updated 2022-02-14Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
›
⌄
WITH active_wallets AS
( select distinct event_from as wallets from terra.transfers
where date_trunc('day',block_timestamp)>getdate()- interval '30 days'
),
wallet_balance AS
(select sum(balance_usd) as value_usd from terra.daily_balances
where date=CURRENT_DATE and balance_usd>0 AND
address in (select wallets from active_wallets)),
anchor_value_balance AS (
select sum(balance_usd) as value_usd from terra.daily_balances
where currency = 'ANC' and date=CURRENT_DATE and balance_usd>0 AND
address in (select wallets from active_wallets)
)
select (anchor_value_balance.value_usd/wallet_balance.value_usd)*100 as "Anchor Dominance",
anchor_value_balance.value_usd as "Value of assets in ANC",
wallet_balance.value_usd as "Total value of assets"
from wallet_balance,anchor_value_balance
Run a query to Download Data