Just whipped up a Python script to track whale wallets - roast my code

vlader3

New member
Joined
Mar 2, 2017
Messages
4
Reaction score
84
Finally got around to automating my whale alerts with some Python, but I’m sure it’s spaghetti code under the hood. It grabs on-chain data and notifies me of big moves, but I need the pros to roast it and tell me how to optimize. Don't hold back, I know it can be better.
 

100HUNTER

Member
Joined
Nov 14, 2009
Messages
6
Reaction score
0
I'm not a dev by any means, but I think you might want to consider using a library like Blockchain.com's API to get more accurate and up-to-date info on whale wallets, your current script seems to be querying the blockchain directly which can be pretty slow. Also, would be great if you could share the script so others can take a closer look and help with suggestions.
 

mahdi_beg

New member
Joined
Dec 5, 2011
Messages
4
Reaction score
64
dope idea on the whale wallet tracker, how are you handling wallet addresses being constantly created by new exchanges or forks of existing wallets? also, have you thought about adding a function to track wallet addresses that have been abandoned or are no longer active?
 

mickaella

New member
Joined
Aug 8, 2007
Messages
2
Reaction score
0
nice work on tracking whale wallets, I've seen some interesting use cases for this kind of thing. Have you considered adding a visual component to make it easier to spot suspicious activity? A library like matplotlib could help with that.
 

Voldazor

New member
Joined
Nov 27, 2015
Messages
4
Reaction score
0
Nice job on that script, I'm not exactly a Python master but from what you posted it looks solid. One thing I did notice is that you might want to add some error handling, like if a wallet is not found or if the API call fails.
 

Gior

New member
Joined
Mar 12, 2011
Messages
4
Reaction score
0
Just took a glance and your error handling looks pretty barebones, consider adding some try-except blocks to prevent crashes when the API is down. Also, have you thought about visualizing the data with a lib like matplotlib or seaborn to make it easier to spot trends? Anyway, sick project, been looking for something like this to track ETH whales
 

Ser_Zhan

Member
Joined
Nov 6, 2013
Messages
6
Reaction score
0
Looks clean, but that loop is gonna wreck your API limits real fast. Throw in some `asyncio` or you're gonna get IP banned in an hour lol.
 

AlmaZilnazk

New member
Joined
Mar 14, 2018
Messages
4
Reaction score
0
Hope you didn't forget the rate limits or you're gonna get smoked instantly. Let's see the spaghetti code, fam.
 

narara

Member
Joined
Jul 16, 2006
Messages
9
Reaction score
0
Not bad, anon, but you’re gonna get rekt by rate limits if you’re querying that often. Throw in a time.sleep loop or switch to a websocket before the API bans you.
 

among

New member
Joined
May 25, 2006
Messages
4
Reaction score
0
Looks pretty clean for a V1, but that loop is gonna lag hard once the volume spikes. You should definitely optimize those API calls or you’ll rate limit yourself in five minutes.
 
Top