Skip to content

Instantly share code, notes, and snippets.

@robbestad
Last active November 15, 2023 20:17
Show Gist options
  • Save robbestad/d6ac8cc87de2c2b84876e3199e6e5e22 to your computer and use it in GitHub Desktop.
Save robbestad/d6ac8cc87de2c2b84876e3199e6e5e22 to your computer and use it in GitHub Desktop.
Check PYTH allocation
import requests
def check(pubkey):
url = f"https://airdrop.pyth.network/api/grant/v1/amount_and_proof?ecosystem=solana&identity={pubkey}"
response = requests.get(url)
if response.status_code == 200:
jsondata = response.json()
amount = jsondata.get('amount')
if amount:
print(pubkey, amount)
return int(amount)
else:
return None
else:
return None
def main():
pubkeys=[
]
total = 0
for pubkey in pubkeys:
amount = check(pubkey)
if amount is not None:
total += amount
print(f"------\ntotal: {total}")
if __name__ =="__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment