Last active
November 15, 2023 20:17
-
-
Save robbestad/d6ac8cc87de2c2b84876e3199e6e5e22 to your computer and use it in GitHub Desktop.
Check PYTH allocation
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
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