with balances as (
select
USER_ADDRESS as wallet,
CURRENT_BAL as balance,
COALESCE(ctr.name, lbl.address_name, USER_ADDRESS) as name
from ethereum.core.ez_current_balances bal
LEFT JOIN ethereum.core.dim_contracts ctr ON bal.user_address = ctr.address
LEFT JOIN ethereum.core.dim_labels lbl ON lbl.address = bal.user_address
WHERE contract_address = lower('0x5c147e74D63B1D31AA3Fd78Eb229B65161983B2b')
qualify row_number() over(order by current_bal desc) <= 20
)
SELECT * FROM balances
WHERE wallet is not null or wallet !='null'
ORDER BY balance desc