Created
September 30, 2020 05:52
-
-
Save Vergan-star/3065c6d41ee55502aa91924c02f0d440 to your computer and use it in GitHub Desktop.
Total ETH Staked
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH deposits as | |
( | |
SELECT | |
evt_block_time as block_time, | |
amount | |
FROM keep_v110."KeepBonding_evt_UnbondedValueDeposited" | |
), | |
withdrawals as | |
( | |
SELECT | |
evt_block_time as block_time, | |
-amount | |
FROM keep_v110."KeepBonding_evt_UnbondedValueWithdrawn" | |
), | |
unbonded_events as | |
( | |
SELECT * FROM deposits | |
UNION | |
SELECT * FROM withdrawals | |
) | |
SELECT | |
sum(amount / 1e18) | |
FROM unbonded_events |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment