Sandeshtotal_staked
    Updated 2022-09-21
    with stake as
    (
    select sum(raw_amount)/1e18 as deposit from ethereum.core.fact_token_transfers
    where contract_address='0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'
    and to_address='0x5e3ef299fddf15eaa0432e6e66473ace8c13d908'
    ),
    unstake as
    (
    select
    sum(raw_amount)/1e18 as unstake from ethereum.core.fact_token_transfers
    where contract_address='0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'
    and from_address=lower('0x5e3ef299fddf15eaa0432e6e66473ace8c13d908')

    )

    select (s.deposit)-(u.unstake) as amt from stake s, unstake u
    Run a query to Download Data