Query editor
WITH deposits AS (SELECT"from" AS user,SUM("value") / POWER(10, 18) AS total_depositFROM ethereum.transactionsWHERE "to" = 0xA62F9C5af106FeEE069F38dE51098D9d81B90572GROUP BY "from"),withdrawals AS (SELECTaccount AS user,SUM(actualAmount / 1e18) AS total_withdrawnFROM stakestone_v1_ethereum.stonevault_evt_withdrawnfromstrategyGROUP BY account),active_stake_per_wallet AS (SELECTd.user,(d.total_deposit - COALESCE(w.total_withdrawn, 0)) AS active_stakedFROM deposits dLEFT JOIN withdrawals w ON d.user = w.user)SELECTSUM(active_staked) AS "Total Active ETH Staked"FROM active_stake_per_walletWHERE active_staked > 0;