Inspired by the Goat CBB stories about how they used code to gain an edge in the markets, one of our own stories came to mind while I was reading https://t.co/3mp0B3n81P
Thought it was worth sharing - enjoy.
Back in 2022, my brother and I cleared 1m profit over a period of 5 months with less than 100 lines of code. Cost? 20k.
I had stumbled upon a new protocol called
empDOTmoney on BSC — one of the few legit Tomb forks that’s still alive today.
Context: They had developed these custom gamified ROI contracts which allowed users to deposit EMP/ETH LP into the contract and paid out LP on a daily basis depending on how much ownership you had of the total pool. The contract allowed users to either compound your positions to increase your ownership or claim your daily drip at the cost of possibly lowering your ownership position.
Bullet points for those that like it more.
→ Deposit LP
→ Get paid daily on your ownership amount and lp size
→ Claim or compound
To incentivize users to deposit fresh funds they would pay out 1% of the total pot to the largest depositor of the day at the cutoff time, 12 UTC.
Interested, I watched it play out on day 1 with a total of around 1m in total pool size, low and behold the top depositor got paid 10k on a deposit of around 20k. There were probably around 10 other depositors ranging between 3k and 20k. The winner got this 10k got added to his 20k deposit and he now had a balance of 30k on a roughly 1m pool size and now being paid daily on his position.
IE:
Total pool = $1M
Top depositor = $20K
→ Reward = $10K instantly added to their balance
→ And they’d earn daily yield on that new 30K position.
Seeing this was an instant no brainer for me. I’m absolutely sniping this shit.
Goal was simple, minimize exposure with smallest deposits to maximize ROI. Called my brother to give me a hand to work quicker since we’re both devs. Script was finished pretty much within a few hours.
4 step Flow:
1) Monitor contract pool for incoming deposits
2) Estimate closing block with time (3 seconds per block)
3) Create transaction outbidding existing largest depositor
4) Take win
The only real parameters I had setup were LP cap. Initially since it was so early on the protocol I thought a 2x on my deposit would be good IE: 10k snipe + 10k deposit half the ROI period and increase ownership. So 10k was loaded up ready to snipe.
We ran some tests and simulations, seemed good, tek was working.
I watched for the upcoming days and probably around the 4th day our buying conditions were met. There were no bidders > 10k so the code should work. Watched as the timer was getting closer, time hits, bot creates the transaction and actually submits.
Man was I nervous, I’m mashing refresh on the UI like a mongoloid to see if we had won. Seconds later the UI had updated, to my disbelief we had lost.
Last bid was 9.5k, we bid 10k what happened?
Post-mortem: After digging onchain the main culprit was the assumption that we’d time the closing block perfectly without anyone entering after us.
Last bid 9k, prepare 10k and while 10k was in the mempool a new bidder enters with 10k. Their contract would award the last depositor with the largest amount.
Fix was simple: If new transaction enters mempool during the submission window, reconstruct, increase bid and submit
while submissionState:
if existingBid > lastBid:
submit;
else reconstruct
Code adjusted and down 10k. Can’t give up now.
A few days later our opportunity presented itself again.
Last bid 8k, timer starts, we submit 8.5k, we wait for confirmation… We WON. Euphoric. Instant 19k deposit on the UI. Let the milking begin.
Over the course of the next month we had a 90% win rate when sniping conditions were met, managed to completely ROI money we had put in. Deposits + Rewards within the protocol was close to 350k printing roughly 2.5-3k/day. At this point we decided to automate the sniping process, setup a server and deployed the bot, and were only checking the logs post run to make sure everything worked as intended.
We did see a few other competitors, other botting attempts by some other users. Most of the time we were easily able to outbid them and let them win when conditions were not favourable.
This went on for another 2 months, we accumulated 1m in rewards printing around 5k/day. Since the pool size got larger over time the peak deposit amounts were hovering around 60k per win (I think). We were heavily taking profits during this time.
At some point the team realized we were winning by botting it and they released a new version of the contracts only allowing the reward to be equal to the largest amount deposited - measure to prevent us from cleaning house. The upgrade announcement ended up taking like a month or so and we decided to snipe more aggressively to take as many 50-60k+ wins as we could.
Their v2 change also included allowing users to do cumulative deposits throughout the day and the largest by end of day would win. We were able to easily track deposits and submit a delta during our sniping window. This was profitable for only a short time.
After that we were just claiming and jeeting daily. These funds ended up helping us set out on our next journey traversing the memecoin trenches.
At the peak, across all of our wallets we were making close to 8-10k per day in EMP/ETH lp. Liquidated the EMP daily and ETH too (was trading around 2k at the time RIP). Total cost between initials and how many times we had to put in house money was around 20k, total extracted give or take 1m.
Blessing how long this printer ended up running. This was amongst one of the many winners over the past years - like and comment if interested to hear others
S