Skip to content

Instantly share code, notes, and snippets.

@Benhawkins18
Created October 11, 2023 19:48
Show Gist options
  • Save Benhawkins18/5a917c76f84fcd3b067ac2503527a137 to your computer and use it in GitHub Desktop.
Save Benhawkins18/5a917c76f84fcd3b067ac2503527a137 to your computer and use it in GitHub Desktop.
## Must have solana CLI installed for this to work
import json
import subprocess
command_output = subprocess.check_output(["solana", "stakes", "--output", "json"])
stakes = json.loads(command_output)
total_sfdp_stake = 0
for stake in stakes:
if stake["withdrawer"] == "4ZJhPQAgUseCsWhKvJLTmmRRUV74fdoTpQLNfKoekbPY":
total_sfdp_stake += stake.get("delegatedStake",0) / 10**9 ### Lamports to SOL
print(total_sfdp_stake)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment