WITH TERRA_HOLDERS AS(
SELECT
address,
balance_usd,
currency
FROM
terra.daily_balances
WHERE
date = CURRENT_DATE - 1
AND balance > 0
--AND db.balance_type = 'staked'
AND currency = 'LUNA'
),
ANCHOR_HOLDERS AS(
SELECT
address,
balance_usd,
currency
FROM
terra.daily_balances
WHERE
date = CURRENT_DATE - 1
AND balance > 0
--AND db.balance_type = 'staked'
AND currency = 'ANC'
),
MIRROR_HOLDERS AS(
SELECT
address,
balance_usd,
currency
FROM
terra.daily_balances
WHERE