Query editor
with outgoing as (select sum(value) / 1e18 as value, "to" as accountfrom erc20_arbitrum.evt_Transferwhere "from" = 0x907E5d334F27a769EF779358089fE5fdAA6cf2Bband contract_address = 0xD5954c3084a1cCd70B4dA011E67760B8e78aeE84group by 2), incoming as (select sum(value) / 1e18 * 0.99 as value, "from" as accountfrom erc20_arbitrum.evt_Transferwhere "to" = 0x907E5d334F27a769EF779358089fE5fdAA6cf2Bband contract_address = 0xD5954c3084a1cCd70B4dA011E67760B8e78aeE84group by 2), total as (selectincoming.account,(incoming.value - coalesce(outgoing.value, 0)) as balancefromincomingleft joinoutgoing on (incoming.account = outgoing.account))-- Adding total staked amount as the first rowselect 0x0000000000000000000000000000000000000000 as account, sum(balance) as balance from totalwherebalance > 0 andaccount not in (0xd2bcFd6b84E778D2DE5Bb6A167EcBBef5D053A06)UNION ALL-- Individual balancesselect account, balance from totalwherebalance > 0 andaccount not in (0xd2bcFd6b84E778D2DE5Bb6A167EcBBef5D053A06)order by balance desc;