Andrew Fernandez Profile picture
May 12 25 tweets 6 min read
Here's a 🧵 on how I went about trying to debot and degame the @cpgclub raffles.
(I'm not part of the @cpgclub team or anything just helping out some friends using some badly written Python and JS)
1/
I'll be using the largest allowlist @cpgclub had to explain the process at a high level and I want to be clear that there's no way we caught everyone trying to game the system and we definitely excluded some folks who maybe weren't trying to be nefarious
...but when you are dealing with such a large dataset and a complex filter set things don't always go perfect.
So first the main public allowlist on @PREMINT_NFT was close to 100k wallets which is crazy as is.. So we had to figure out a way to cull that down right from the get go.
shoutout to @mulligan and the premint team as they were able to filter out for us close to 50k by deduping wallets that shared the same ip, don't worry we set some rules assuming there were some shared households trying to win.
We also filtered that initial list down by when the linked twitter account was created so brand new accounts created just to be in the raffle were excluded.
So after all that I now had a list of 54,000 wallets to run some deeper analysis on to see if there was anything interesting.
Okay so my thinking was we should be looking for wallets that are funding other wallets nefariously to game the system or wallets that are passing ETH around in order to get more entries.
With that in mind I had to figure out how to get every transaction from right before the raffle went live till now.
Get ready for some terrible javascript!
Using the 50k address I wrote a quick node.js script that uses getAssetTransfers from the alchemy api to get each ETH transfer where a wallet in the 50k list was either the recipient or the sender. This was fun because it was slow, would constantly timeout and crash.
Try Catch Retry until infinity to the rescue! After a bit more hacking and dealing with weird errors like below I was able to get a reliable script that streamed To,From,Eth Amount to a csv. Now I wait...
24 hours of that script running later I now had 704,000 transactions in a csv to sift through
Okay so full disclosure I'm not a data scientist or python coder..so a lot of the next parts were lots of googling and trying to piece together memories of how to use pandas and network graphs.
So now that I had 704,000 transactions to sift through I needed to think of some filters and rules to apply. First rule was let's only look at transfers worth 2.55ETH and up .This immediately reduced my dataset down by a ton.
Next I only wanted transfers to or from wallets that were in my 50k list. This would show me money moving between wallets registered and not external people. Lastly we decided that 1 wallet helping another wallet would be allowed but 1 wallet funding 3+ would be our cutoff.
If you are just that good a friend sending your 10 best buds 3ETH then I apologize and also need better friends.

So after writing some ugly python code using pandas, pyvis, and networkx I was able to get this bacteria looking graph
Let's break this down into a few interesting groupings
We got the spoke and hub ..1 wallet sending >=2.55 ETH to multiple other wallets
We got the loop.. 1 wallet starting a chain of sending >=2.55ETH around a ring of wallets and then back to itself
We got chains.. 1 wallet funding a chain of wallets but not sending it back to itself
There was this super long chain ..reminder this is all >=2.55ETH transfers only AFTER the allowlist was opened and each of these nodes is a wallet that was also entered
This one is just weird and a mix of all of the above
Okay so after all this I now had a bunch of grouping types to figure out what to do with.

A little more python and some excel remove duplicates and I had about 5k wallet addresses that represented the nodes in these groupings.
That represented about 10% of the 50k list.. and after those are pulled out... here's what the nodes look like
Now I'm sure some folks got caught and removed and were totally legit wallets and others were gaming the system and slipped but this whole experience tells me that there's still a lot of work to do to make fair raffle processes easier. Hopefully you find this interesting!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Andrew Fernandez

Andrew Fernandez Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(