Introducing PoolTogether - Brendan Asselstine - [Toronto Ethereum Developers Meetup]

ETH Toronto Talks · 29 Apr 2021 · 19:15

PoolTogether CTO Brendan Asselstine introduces the open source, decentralized protocol behind loss-less prize games on Ethereum. He walks through the architecture of the system and describes PoolTogether's transition into a protocol governed through the POOL token. The talk was given at the Toronto Ethereum Developers Meetup.

Speakers

Topics

From ETH Toronto Talks, hosted by ETH Toronto.

Transcript

so brendan um introduction hi everybody i'm brendan from pool together um i've got three things to talk about today one is i want to introduce pool together because i don't know if everybody has necessarily um seen it or knows what it is i want to quickly run through the architecture sort of high level how does everything fit together what big pieces do we have in play and then finally talk a bit about the protocol and how we transition to it so i'm just going to share my screen and bear with me these slides are slightly slapped together like a frankenstein from different events so they may be a little rough not nearly as beautiful as yours tim's um so let me just go full screen here so let's start at the beginning

so pull together um what is it pool together is uh a prize linked savings account and so prize savings are a fun way to make savings more interesting much more interesting than a typical savings account so every dollar you put into the prize or rather into the account is a chance to win the prize and so the prizes are the interest that's accrued on all deposits and this is this is kind of neat because it means that these prizes are generated in perpetuity and um are no loss so that means you don't lose your your principle on it so it's a really

interesting mechanism so versus getting like 0.35 percent ap wines and sings account um you can actually have a potential to win everyone else's interest and it's actually a pretty old idea all of these countries run state versions of prize link savings accounts of course they're all run by the government because it's highly controlled and yada yada yada and we're all familiar with that the biggest one is in the uk they have a 100 billion dollar fund that has 20 million different accounts and each year they give away 1.3 billion in prizes what's interesting to note though is they actually generate about 9 billion

in interest but i guess 7.7 billion actually goes into the public funds and so it funds roads and infrastructure of course being government-run that's where the money goes and this this kind of um i guess public service is somewhere we'd like to go eventually it's um a really interesting way to give back to the community in a fun way um and so here here's some fun old posters uh these these are just ancient like from the 50s and 60s but this has been around for a long time so we're really not you know reinventing the wheel here but what's amazing is how blockchain really enables this like we built this in the first version we built in a week and so um

it just makes it very easy to put this kind of thing together and so price savings live in a very interesting um risk reward area so typical savings accounts bonds stocks startups there's a risk return profile that increases the higher the returns are pricing savings are this weird tool that has very low risk but at the potential for a very high return this actually happened a couple weeks ago we had a winner that had 73 or 73 died deposited and they won 44 000 and so that's quite the return for them uh really lucky winner and granted we do have a lot of whales winning because

they have higher chance of winning hence the you know um the one dollar one chance but it is still possible um and so we were really happy to see that that prize um and so you don't have to pick between safety reward you can have a couple bucks in you know like the beastie boys say you got to be in it to win and so just make sure you have a little bit of pool together and you'll have a chance to win potentially uh big money which is pretty exciting and the um we're now giving away just under a quarter million in prizes every week and so um and two of the main prize pools each are awarding about 80 000 u.s so every week you get a chance to win and the cool thing is you deposit once and then you have a chance in perpetuity

um it just lives there forever so don't have to worry about withdrawing it's just a couple of bucks um so that's pretty quick pretty quick intro but i feel like that does set the stage in general it is a fairly simple product um at least from the consumer point of view um in terms of the architecture so we've tried to keep it as simple as possible um using serverless tech using just trying to use the rpc as much as possible we kind of pushed that to its limits and inferior got mad at us but anyway um there's essentially four layers to this we've got the static front end uh right now it's hosted on netlify but i'm looking into fleeq fleek is interesting um there's caching and indexing and so this is the layer like the graph which actually provides us

with tooling to be able to um create different views of the blockchain and in a very efficient way and then we have um infuria of course to which we still have to make requests sometimes and then finally we have uh cloudflare and cloudflare bundles that all all up and caches it so that we don't incur huge monthly costs then we have our smart contracts that live under that this is where the application lives this is the core this is where um the the winners are selected where the money lives um and then that itself lives on the blockchain uh so ethereum is our main blockchain but we are looking to expand and i'll

i'll get into that list next oh yes we just went into this um so in terms of the actual software architecture we've we've kind of changed it over the years but fundamentally everything is built around a prize pool and the prize pool is a non-upgradable contract we wanted this to be as non-custodial as possible and so what what it does is users deposit into the prize pool which then deposits into a yield source and the yield source can be you know a lending protocol like compound or ave uh we're also uh integrating sushi and so uh sushi swap has a a sushi bar which allows you to earn the fees on your deposited sushi and so

it's a no loss yield and so we're actually going to integrate it as well um and then so the interest the price pool then exposes to a price strategy and the cool thing about this is the very low coupling between the price strategy and the prize pool so the the kind of the game itself could be anything you know um price savings are just one aspect of this you know some some hackathons we've seen participants build things like like a um a horse race essentially but sort of between tokens it's like at the end of the week the token that went up the most will be the one that wins and whoever bet on that token gets the interest from everyone so you can make up all sorts of weird games if you want on top of the interest

it's pretty cool but so our flagship strategy is the multiple winner strategy and so this is the prize savings strategy and it uses a random number generator to select the winner from the pool of token holders and then of course that those token holders get the interest in the form of more tickets so as they win their chances get go uh uh increase and so and so on um so in terms of the blockchains that we're on right now i think this is pretty interesting to talk about because just uh two days ago we deployed to polygon and we're really excited about that move it feels like ethereum was two years ago and that we have like very cheap

transactions and um not a lot of congestion and so we're our users are really happy with it the pool that we launched uh two days ago now uh has 2.7 million in i think so it's gone up pretty fast which is great and um and what's good about it as well polygon in particular is that the bridge is as secure as the side chain itself and so we're pretty comfortable with moving back and forth and having these pools um be governed eventually be governed by our l1 on ethereum but in the short term in the future we're looking at optimism as well big fan of mark on the optimism team i really like what they're doing as well as zk sync their zk sync 2.0 with the edm compatibility is going to

be really interesting although i have not yet played with it so looking to get into that um and finally let's talk about the protocol so this is this is really interesting for us because we started as a small product team we were just three people uh maybe two just under two years ago and we ran with the product as long as we could so that we could find product market fit before launching a token and doing that whole business because that definitely complicates things um so we wanted to make sure that we had a product market fit for launching a token but um but we did feel ready and in february of this year we did launch the pool token and um what that means is that our

product uh became a protocol in the sense that um protocols are apps that are controlled by the users through that lens if we're looking at it through that lens that's essentially what it is and so we launched the pool token we retroactively dropped it told past users as as is common these days and uh also began a liquidity mining program for existing token holders or ticket holders rather um and then begins the votes and so we've had eight different um successful proposals so far that have changed the system the majority of which have come from third parties one even one which was to enable the reserve on pools which is actually capturing a portion of

the interest uh and retaining it in the pool as sponsorship but under the ownership of the protocol that was done by some random person and it actually took us by surprise when it did get executed but it was cool to see users actually take control of this thing so it's been a very interesting transition in terms of going from a product over which we control every aspect to instead inverting this and facing outward to our community to kind of corral all of these different stakeholders and so it's been a really interesting experience to try to manage that um but also um just get buoyed by the energy of all the

people it's amazing launching a token and just seeing people rush in and be like how can i help we've had so many uh contributors come in over the last few months and it's pretty exciting to see when people have skin in the game how much that can align incentives so that's been been a lot of fun to see so that concludes the presentation um happy to answer any questions that anybody might have thanks for that uh brendan um yeah if anyone has any questions feel free to uh raise your hands or um you know drop it in the chat um i have a question for you brenden um

uh how are uh like winners selected and and pulled together um that's a good question that's a good question um we use a sortition sum tree which is basically like a tree data structure um that is able to be updated in logarithmic time so it's pretty fast but it does mean that gas usually usage there's like a hundred thousand hundred fifty thousand premium on deposits and withdrawals uh but it does mean that we can basically index the entire supply of tokens and um select all right let's give me token 3 million and 42 and we can find the address that

that holds that even if it's kind of um it's not the it doesn't correspond of course they're purely fungible tokens but um it allows us to actually at least uniquely pick a person so cool and then on a related note somebody asked how did you randomly generate the numbers that's a really good question so we've got a couple different options um the first of course which is the weakest and um one that we we only use for um sort of test pools is the block hatch um and the the second one that we use for most of our pools is the chain link brf and so vrf is it's it's pretty good to the extent that it means that it's a that's a deterministic way

for someone to sign a message to produce a unique result um and the vrf is is tweaked such that um you can only so each each signature has a unique number or unique result that it corresponds to and so with chain link they essentially they have an oracle to which we make a request and then they sign the message and we just send them the block hash which they then sign and they are committed to that because they publicize the signing public key on chain um and then we consume that as the random number but the one that we'd like to move to one that i'm starfar has rolled out is the bdf which hopefully i can explain in two sentences um

but the vdf is essentially like a puzzle that takes time to compute and the cool thing about it is that you can come up with this seed just fairly randomly like let's say it's the block hash and then you can select the number of iterations required to compute and you can you can you can kind of tune it so it requires let's say 10 minutes with the best computer that you can find and it's very difficult to parallelize this algorithm and so you can sort of delay the results you can delay it as long as possible but then when it comes time to finally use that random number they submit that and it's very quick to verify it on the chain um and startware has some extra fancy

moon map that allows you to do it very efficiently on the chain um so that's eventually what we'd like to move to um for now the vrf is pretty powerful and this sort of the flip side of that data structure i was mentioning earlier is that it's kind of challenging to manipulate um in the set in the extent that um uh the addresses you know to to really move addresses around and change the numbers it's pretty challenging um as well as we actually lock the pool before the award starts so we try to mitigate as much as possible any kind of front running of the reveal another person asks what is the purpose utility of the pull token uh so the pools themselves because of their heritage from us being a product team are mostly autonomous you don't really have to do a lot of

management to them beyond the sort of fairness parameters um but that being said that they do control the fairness parameters um so the fairness is um is maintained by so okay so let me just let's just back up a bit how does it work really um if people were able to buy a ticket just seconds before we select the winner that wouldn't really be fair to everyone else right because they'd basically be able to dump a bunch of money into pool together and then pull it out immediately after they could potentially even just sandwich attack the reveal um so the first step for us was of course to do a two-phase start award complete awards so you could lock the funds the second part of that is okay let's say let's say they they didn't

sandwich it like that but instead they just only spend a few minutes in the pool how do we punish them well there's a there's an exit fee that decays with time and so the xfp is one percent but in a week that decays to zero and so it sort of ensures that everyone at least contributes some interest to the pool to some extent um it's not perfect by any means but rather than being an a experience for some and an f for others it's kind of a b plus for most people um but uh we found that people in general haven't noticed it because the uh time decay is less than the average pool participation time but so the pool token actually controls those fairness parameters as well as the the reserve rate so how

much of the interest is captured as well as the ability to swap out the price strategy like i said before the price pool itself is um non-upgradable and so we can't actually change it but we can't change the price strategy so let's say people are like hey well why don't we do prizes this way well governance can swap out that price strategy for something else and and do prizes a different way or perhaps swap out the rng for the next uh next greatest thing so um yeah in that way the pool token is meant for uh controlling the protocol oh so another question was if the national government has a monopoly on pool sweepstakes in these countries how will they view a new competitor

maybe litigation i'm not sure um and it's good good call in calling sweepstakes because that's the closest legal definition that we are too so um you know we actually haven't no one's really reached out to us right now um i feel like we're still pretty small fish but we do have a legal um perspective in place that we um you know spend a great deal of time working on to at least be ready if something did happen um and it is largely built around sweepstakes laws um but uh but so far so good and also now that we're decentralized and it's controlled by the cool token holders it's kind of out of our hands um so fortunately we're in a pretty good position at the moment

nice yeah those are uh those are a lot of good questions and thank you for answering them um it's uh that's certainly a core protocol and one that i look forward to um trying out myself so thank you for for that presentation brendan appreciate it yeah polygon cool it costs like 100 of the penny to enter it's great right oh it looks like we do have one more question here you mentioned that pool together is deployed on polygon now the fees be reduced to claim pool so yeah that's a good question um the pool liquidity mining is still on ethereum and so the pool claiming is still going to be on the ethereum blockchain what we have right now in polygon is uh

matic liquidity mining and so when you deposit into our polygon tether pool it will begin to accrumatic which you can then claim very cheaply because it's automatic network um but uh likely in the future we will bridge pool but i want to do that very cautiously um because it fragments voting power and you know i'm that's just a concern for me is that we start to sort of lose voting power and perhaps don't reach quorum so i think ideally we'll have a bridge that you can delegate the votes to and then at least have some kind of signaling mechanism to control it but um yeah that's what we're approaching cautiously so no pool on polygon yet great thank you for that brendan

appreciate it um