select address "User",
count (distinct(tx_id)) "Transaction Number",
sum (amount / pow (10, 9)) "Total Amount",
avg (amount / pow (10, 9)) "Amount (AVG)"
from solana.core.fact_stake_pool_actions
where 1 = 1
and succeeded = 'TRUE'
and block_timestamp::date >= current_date - interval '1 week'
and action ilike '%deposit%' and amount > 0
group by "User"
order by "Transaction Number" desc
limit 20