A Twitter Bot to track winners and user deposits on PoolTogether, in 2 minutes 🤖

Manlio Poltronieri
HAL.xyz
Published in
3 min readMay 25, 2020
A no-loss, audited savings game powered by blockchain technology

Here at HAL we are big fans of PoolTogether, a no-loss, audited savings game powered by blockchain technology. The way it works is simple but brilliant:

  1. You join the pool buying tickets. For every DAI you deposit you get 1 ticket
  2. Interest builds. All the DAI in the pool earn interest.
  3. You maybe win: at the end of the week one lucky person wins all of the interest 💰
  4. You never lose! Whether you win or not, you can withdraw your savings and winnings at any time 😎

In this post I’m going to show you how we created a Twitter Bot to easily track the weekly PoolTogether winner, as well as everyone else who joins the pool. As always, this is just to show you what kind of stuff is possible to hack together with HAL — feel free to tweak and twist this example any way you want!

Tracking winners and user deposits

Head over to HAL.xyz and create a new “Watch an Event” trigger:

Insert the PoolTogether contract address, 0xa125841831b4645f22c1c4ccb6e1df0842e60040, in the “Contract Address” field, and a list of events will be automatically fetched for you to choose from. Every time a lucky winner gets the prize, a “Rewarded” event is emitted. That’s what we’re going to track.

If you’d rather track user deposits, you would simply pick the “Deposited” event instead. If you’d rather track… you got the gist of it already. Once you’ve selected the event you want to track, you’ll be able to add extra filters on the various fields of the event, as well as referencing all these variables later on.

For now, we’ll leave all of those variables blank, and move on to the fun part :)

Time to Tweet

For this example I created a new Twitter bot, and I gave HAL permissions to post tweets on behalf of my bot. You simply need to click on the “Connect” button next to the Twitter logo.

Now it’s finally time to create a nice twitter message. You can reference all the variables in the event that we’ve seen above, such as winner (the address of the lucky one), winnings (the amount of DAI they won). We’re also going to create a nice link to the Etherscan transaction, and of course we’re going to finish up the message with a few emojis. This is what my template looks like:

When you’re happy with your message all is left to do is to save your new trigger and if you joined any pool…cross your fingers… 🤞

This is what our bot looks like. It’s already alive and kicking, and you can follow it here.

Where to go from here

There’s a lot more you might want to explore:

--

--