Introduction to Prediction Markets: The Speedrun Ethereum Challenge - BuidlGuidl's Builder Bootcamp
BuidlGuidl's Builder Bootcamp at Devconnect Argentina 2025 · 18 Nov 2025 · 46:37
Eda Akturk introduces prediction markets and the building blocks needed to create a decentralized market: the oracle, the automated market maker and conditional markets. The talk looks at how liquidity providers set initial price probabilities and why low liquidity and manipulation create risk, and ties the ideas to the Speedrun Ethereum challenge. It includes a live demo of setting up a market and an audience Q&A at BuidlGuidl's Builder Bootcamp during Devconnect Argentina 2025.
Speakers
Topics
From BuidlGuidl's Builder Bootcamp at Devconnect Argentina 2025, hosted by BuidlGuidl.
Transcript
Perfect. Um, hi everyone. Good morning. Buas, only Spanish I know. Um, so today I'm going to talk about prediction markets. It's going to be an introduction to prediction markets and introduce like the building blocks on how you can build your own prediction markets. Um, so as part of speedrun Ethereum, we have one of the challenges. uh I think it's quite like a new challenge we introduced in the last like two three months where you can like follow the challenge to build your own prediction markets and this presentation is going to be like a small introduction and overview of what you can do. I won't be building the whole prediction market but instead like introducing the building blocks so that you can go ahead and build and it's all available online for free. So
once you go to speedrun ethereum.com um you will see like the prediction market challenge there and yeah that's just like a quick overview of what we're going to be doing today. And my name is Eda. Uh I think this is my third dev connect/devcon. Um so I yeah it feels very nice to be back and my first time in Argentina and um yeah I guess we can directly get started. I know we're like a bit over like started a bit late too and I think this presentation will be a total of like 45 minutes maybe 40 minutes. We'll try and leave some time for questions for questions. I have helpers over here as well but we can get to start. So just an overview prediction markets um I assume like almost everyone here has heard about prediction markets and I'll still like give like
a small introduction but it seems like people love to bet on everything. So my friend sent me was at this event I did not go but apparently there was like a small guinea pig in the middle and you were betting on like which uh box the guinea pig would like go to. when he explained, I thought it was like a bit more complex setup, but then I saw the picture, it seemed like, well, super fun, but I was like expecting something more like high complex. And yeah, basically you could like bet on which box the guinea pig would choose. Um, so like there's food inside all of them and the guinea pig goes to one and then you win if you made the correct bets. And I think that was like from an event on Monday. I don't know if anyone went to it. No, not from here. But yeah,
I guess we all missed it. But people love to bet on everything. And I guess like most popular is like sports betting. Um you can bet on like who will win a reality TV show. And then especially with prediction markets coming into play, I guess like they become mostly popular during the US elections. Um and yeah, you probably heard about Poly Market and Khi, which are like the two biggest prediction markets out here to like live today for crypto. And especially like poly market became very popular with the 2024 uh presidential elections. And one thing which was interesting is like how accurately it was able to predict like most results of the elections and it is definitely like one of the biggest use cases of onchain applications today. Uh both like poly market and
kshi. I know there are like a few others but does anyone here like follow or like bets on prediction markets? Okay. I think there are like a few more maybe, but yeah, it's definitely very popular and super easy to vet. And why we're going to even be talking about this today is well, basically, if you look at it from a forecasting engine, they do have like a higher accuracy rate on the on um compared to other forecasting engines such as surveys. Um I don't necessarily know if my brother who's an economist agrees with my that thesis but that is like a strong uh thesis which economists make that it is like a bigger forecasting engine and you can predict the results accurately since
people have more skin in the game when you put up money and you're like hey like the swin will win. Um well obviously like you have more incentives to actually like be honest there. And then what I'm most excited about today is that when we go through building a prediction market, you actually like learn a lot about the crypto primitives. Like you learn about how to create tokens. You learn about how uh liquidity providers work, how you can like like choose the price based on like uh the interest into like a certain token or certain bets for example. And then yeah that is like the most part which I'm excited about. We we will also talk about oracles like how you can like determine the result of a prediction market like how it ends when it ends like where the market owner comes to place. Uh and well of all it is very popular so we obviously like don't want to miss out on the
popular stuff and it's also much more fun and concrete. So I recall like just very recently when there was the New York mayor elections everywhere around New York they had like these billboards like on all like the bus stations. Uh there was like the Kali billboards. So you would see them everywhere in the in the subway, in the billboards, just like all around the city. And yeah, so we should stay up with the trend, I guess. And well, we talked about like just to make it a bit more concrete is like betting has been around like sports betting as well. The way kind of prediction markets what we will be talking about today is taking prediction markets on chain.
So building like the major primitives like the tokens and the market maker, the price discovery, etc. All of this onchain. Um, and that's kind of like the goal of today as well. Um, but yeah, just to re reiterate, prediction market is a betting market where users can bet on an outcome of a future event. Um a few things that are important to call out here is that yeah like once you bet and then after the like the future event has finished then that kind of closes the betting market. So you should have like a concrete time where that prediction market finishes and a concrete outcome. Like it can't be like oh maybe it's actually this result but it has to actually be like okay this is the person that won the you know mayor elections or like this is the price that bitcoin is at today and yeah we will like explore it all through like onchain benefits
etc. And we will talk about this as it goes through. So I don't want to spend too much time. And I just was on like Kali yesterday and I saw like these two examples. You will see them probably every day. There's like a bet on like what the price of a certain asset will be like on an every single day. But like just to give an example like how low will Bitcoin get this year. This is just like an example. So there's like even ones which are like how low will Bitk get today and then you vote yes no. like the higher probability means that you will earn less because like more people are like voting for that. Um and then the lower probability means like okay like you're like in a smaller group so that's like a less probable outcome so you will earn more if
you actually win. Um and yeah these are like just two examples which I pulled up from yesterday. And what we do in the speedrun Ethereum challenge is a bit more simple than that, but it's a lot more concrete. Um, basically the challenge will walk you through an example where you will see like an interface which displays like this animation and there's like a green car and a red car and the prompt is like will the green car win and then you will basically build out the prediction market for this. So like there will be tokens where you can vote yes or no and then there's going to be like an oracle which determines like who is the winner and that is kind of the how the challenge will play out. And in the speedrun Ethereum challenge
we will look into a binary prediction market. So it's going to be like a lot easier to walk through as well but basically like zero like there will be just like two outcomes which is a yes and no. And it's just going to be easier to like first build out uh like build out the build it out on chain. And yeah, we have another example over here. This example is actually I think Shiv added this example. Uh will Taylor Swift be pregnant in 2025? So what is important here is um there is like a certain fixed date. it will end at December 31st, 2025 and she will either be pregnant or not. Like she can't like be half pregnant. Um, so yeah, that's kind of like a good example of a prediction market and I didn't want to race this one because
I thought it was pretty funny. Um, there was also like prediction market on like will she be engaged in 2024 2025. So I guess some people won money if they voted yes she is engaged now. Um, okay. But how can I build a prediction market? And even before building, I want to just go over here to show you what you will build at the end of the challenge. Um, and let me show the challenge before. So, I mentioned speedrun Ethereum. You can go to speedrunthereum.com and it walks you through like a bunch of challenges from like tokenization, staking up, dice game, building a dex. Um, we also have like the on boarding batches here. Um, has anyone actually like followed the batches from BuildG Guild? Oh, okay. That's cool. That's great. Um, so then we have like a few
more challenges and then when you scroll down, you see prediction markets over here. You can directly like follow the quests. Um, and it's it's it's a really good challenge because it also explains you how everything works very clearly. So, exactly what we're going to be doing today, but it walks you through like how our prediction market works. there like some useful links where you can read more if you're interested as well. Uh it walks you through like why uh like onchain prediction market is different than like a regular betting markets uh where the liquidity comes from etc. So all the details are here in the challenge and this is kind of like the basis of my presentation uh especially continuing this side and yeah so I will I have this up and running as I said I'm not going to go through like the full code today because I think that's something better done individually
and live coding is always stressful also I think it's like a long challenge which is yeah so I thought like I'd just explain the main building blocks instead but I have it up and running and it's pretty easy to set up. You just download the repo. You start like your on your terminal. You deploy the contracts. And if you have ever built with scaffold, you basically like should have three terminals open. One to like run your local chain. I'm well, you can also deploy it, but I'm just like on a local node. I'm running hard hats. Um, and then you start your chain, you deploy your contracts, and then you can start your front end. So, scaffolded comes with both like the contract piece and the front end piece. So you don't have to build out from ground up because especially like if you're only interested in like understanding how a prediction
market smart contract looks like, you probably don't want to build out the animation that like follows your car. So that's like well I don't want to build that out personally but um yeah so it gives you all the building blocks especially if you're just interested in a part of that uh setup and yeah so I have this up and running. Um all I did was download it and I actually completed the challenge. So this is a completed one. Um but basically you can come over here to the user it like this is all coming by default. Uh what I the changes I did are to the smart contract. So mostly like some of these will be commented out but like once you follow the challenge you will actually see like all this if you complete the challenge. Uh and then uh what this gives me is
like an interface with like yes tokens, no tokens and like you can see the different users over here or roles I should say since like there's a user tab. So there are like different roles people play in order to make this prediction market work. And we are coming here as a user. Then there's a liquidity provider. Someone has to be like, hey, like I'm adding money to this. Um yeah, someone adds money to this. And then the music is not part of the presentation. I hope it doesn't reflect to the audio, but um and then there's the oracle which kind of ends the like ends the market. So then you can be like, "Hey, okay, like this person won." Maybe I I actually don't think it will help if we close the doors either. Um, okay. But I just wanted to show here that you can
basically like buy the tokens, you can sell the tokens, you have the liquidity provider interface, and then you also have yeah a debug contracts tab which comes with all the scaffold well which comes with the base scaffold. Um, and this is kind of allows you to see like all the contracts you have deployed in your project. So you can basically interact with like you can call the read functions or the write like you can add liquidity etc if you want to just see like what your contract is about. But scaffold also comes with like the liquidity provider interface over there. So you can actually like go in as a liquidity provider and like add as much as you want and okay this is good. So yeah, this is like basically the challenge which you can follow on speed on Ethereum. And today I'm going
to talk about like the contract building blocks of this challenge. Um again like there are some design choices we made. So like it's not like all prediction markets are the same. Um and I am going to talk about it a bit more high level. So it's not going to be like a follow along like a hands-on followalong over here. However, I do hope it will help you. And yeah, I did spend quite a bit of time to carve out the presentation. So I hope like it will cover everything, but if you do have any questions, I'm more than happy to answer. I'll leave like some time at the end. Okay. So how can I build a prediction market? So everyone knows prediction markets. We talked about them. Uh speed on Ethereum. You can go to the link. I said we have a QR code over
here. I will skip because I said it multiple times. But I did mention about the roles on prediction markets. Now there are two sides which I think are the most important. One is the market roles and the second is the building blocks of like yeah the market components. Sorry I wasn't sure which name we had there. So first of all we have like three main roles which when we looked at the scaffold interface we saw like three tabs as well which was like the user the liquidity provider and I think there was one more and and the oracle. Okay, the liquid the market owner, liquidity provider, the oracle and the user. So these are basically like the three roles that will make our application work. I will start with the user while the user can like buy tokens like these are like yes or no tokens. So just like you and I we go to poly market you're like hey like uh
Taylor Swift will get pregnant so I will buy like yes shares or if you're like you know maybe Pablo doesn't think he will she will get pregnant so he buys like no shares and then if he puts like a lot of money then it can like change the probability so that will change the price of the shares you buy and so that's the user component the oracle is in our application we will just basically use like a trusted address which says like hey okay like this bet has end and the winner is like the red car or the green car but you can use like you well oracles I guess like you might know from DeFi as well which basically like gets you some result from um basically the setup is like smart contracts don't know what happened in the real world so you need some kind of entity which
tells them like hey this event happened in the real world like you can say like hey today the weather in Bonosirus is 30° C so you will have like a weather oracle which tells you that or like you have a price oracle which tells you like you know the exchange rates of um you know ethereum or any crypto or any kind of currency you want but that's kind of the role of the oracle basically will get us some information from offchain to our smart contracts and mostly used in defi when you want to get the price of an asset like you know if you want to get the the price of I don't know euros to uh ethereum you need to know like how much euro is traded at and And then lastly, the market owner and the liquidity provider. So this the liquidity provider is who adds the
initial money into the contract because if you just have like two ERC like if you just deploy a contract without any liquidity, what are people going to buy? You need to have like some money inside there. And then the market owner is who says okay like now the market is closed. So once the race actually ends, the oracle will report the winner. The oracle will say, hey, like the red car won. And then the market owner will call that function and say like make sure the market is closed so no one can buy any more shares. So yeah I guess like in real life probably like poly market and calls you have like their market owner setup when it's the end of the year they either like run something and then no one can like bet on Taylor Swift being pregnant that year cuz the year has ended and the onchain prediction market components. Yeah,
I think these two slides are very similar honestly. But I do want to mention this because these are the parts which I'm going to like go over mention the code a bit more. Um we mentioned the we mentioned the oracle. So you can have like different types of oracle in our setup. We will just use a trusted address. We will say like hey whatever this address tells me is correct. Um obviously there can be more secure methods of that if you don't trust that address but like for I think the purpose of this demo that's fine. Um and then we will talk about the trading and liquidity mechanism. So we will have a dynamic price. Um basically the price will change based on how many people buy a certain amount of shares. Um and that we will walk through as well. No need to be a math expert for like at least like our setup. But you can of course like
get more complex. But that's kind of like how the trading and liquidity comes in. And then we will have liquidity providers that put money in and be like hey like I am putting like 10 ETH into this like betting market and people can buy shares at it. And then lastly we will have tokens a bit different from the side before but the tokens are what the users will buy and the tokens will be ERC20 tokens and they will be like yes tokens and no tokens. So basically imagine like a pool of 100 tokens like 50 yes 50 no tokens and then people can buy yes tokens or no tokens and it change like the price changes dynamically because again we're using like a binary market it's like a lot easier. Uh if you had like multiple options if you had like you know um red car, orange car,
you know 10 more colors then probably you would need like a different setup. But for our setup, like having the shares as tokens makes a lot of sense. Okay, I need some water. But okay, so these are the components we have. Oh, I directly go to the code. So before that, maybe I can go over here just to reiterate like what I explained um for a while is we have like the different tabs for the people to interact. So this is the users. So I said that people can buy shares. So like as a user I can go over here and like the total available tokens is 90. Of course like you can change the the you know the integers we have here. You just have to like go to the code. I actually have it over here as well. But um maybe I can show this a bit is there
are two contracts you have which is the the main prediction market contract and then you have a prediction market token contract. This is a simple ERC20 token. So these are your yes and no tokens. So when you define the prediction market, it will actually like deploy two of these like prediction market token contracts and I should have them here. I will go through that as well. Uh but just to give you an overview, uh yeah, this is like the main scaffold 2 setup. Uh I'm just under here at the hard hats but you can also like if you want to edit your front end you can go over here and like you have all your components and um yeah you can like many make any edits to the front end as well. Uh basically what happens is when you deploy the contracts it will automatically add
like the deployed contracts over here. So once you make a change to the contract you don't need to go and change your front end. You can just edit your front end uh edit your smart contract and then run like um yarn yarn deploy yarn. Yeah, I think like you just run a yarn deploy from your terminal and then it will automatically like generate the you know b bindings and add them to the front end. So you don't need to like go and change that. Um I'm actually not even going to look at the front end at all today. Uh anyone interested can go and look at it. I know we have like a few more scaffold two presentations as well like all week. So maybe you can also like find a presentation for that if you're interested. But I'm basically like all I'm going to do is going to look at like my main
contract and then my token contract. So yeah, this is the scaffold 2 setup of the prediction market challenge. The different challenges of course have like the different contracts, but since we're on the prediction market, that's what I'm at right now. And yeah, I'm running it over here. um I need to run my front end and I'm also like running a chain over here and then basically like to deploy I just do like a yarn deploy and I can do a reset but I don't want to reset right now. So I just deploy my contracts it automatically like updates to my front end. Don't need to do anything. I have my chain running. If you try to deploy without your chain running on hard hat you will not be able to because you don't have like an active chain running. But you can also like deploy to base or or any network you want. You just do like a yarn deploy.
I think network network dash or like base- network like you can look at the the docs for the exact command but you don't like you can change where you deploy to and you can deploy to any network you would like if that network is not available in scaffolded you can just add it there too so okay this is how my front end looks like basically I can like buy tokens I can buy yes tokens like there's like 90 token supply so if I buy one token supply then the probability will like be changed because now one person actually has like a buy like a yes token. So I'm betting that the green car will actually win. But if I buy like 20 then the probability is higher. So then like that means that there's more people that who think like green car will win. And that's kind of how the pricing
dynamics works in this setup. So it depends on how many tokens are sold. Same for the no token. Like if like everyone thinks like you know the red car is I don't know a good car like a Ferrari or something um then you're like I I think that the red car will win so I will buy like 80 shares of that then the probability becomes so high of that but if anyone buys like a yes token then they have like um will have if they win they will more because the probability is like now lower for the green car. But yeah this is kind of the pricing nax. I'll get to it a bit more in the slides. I think it's better to explain over there but yeah so the onchain prediction market components to explain them a bit more um the first part is the tokens as I mentioned the
tokens are defined in the main contract uh this is like a like basically you define it on your main prediction markets soul contract you define like hey I will have like two ERC20 tokens deployed for this prediction market and this will be like the token name the token symbol uh the owner of the token and then the initial token amount how much you want to deploy As you saw on our front end, we have like 90 tokens supply for each, but you can be like, "Hey, I want like a thousand." And then the prediction market token is just like a standard ERC20 token. Nothing different. Probably don't want to add something different over there, but it's just like a standard ERC20. Um, so that is the first part. Then the second part is um is the where do we get the liquidity from? We
have a liquidity provider in our prediction market contract. So that will set the supply initially. Uh there's also like some modifiers, some checkers we add inside the contract to be like hey like if there is no like initial supply then don't start the market because it will just not make sense. So um don't have all the code here but basically the like the goal of the liquidage provider is to supply some initial like tokens to the contract so people can actually buy the shares right like you can put like 10 E for example and then those will like be allocated to the different tokens um and if you don't have any supply well then doesn't really make sense to have a market so it will just automatically revert and then the second one the I guess like the trickier part is how to
predict the price. Uh this does look use like an automatic automated market maker. So basically like the price is determined dynamically. I don't have the con like the maybe I can actually show them in the code as well but you basically have like a get price in ETH and a sell price in ETH functions in your prediction market which will determine the price. And then this is based on basically the outcome, the trading amounts and I'm not sure I think the true false is maybe like if it like if the market ended or not. I'm not sure but we can look at the code as well. But yeah, so these prices are like determined dynamically. We don't have like a fixed price for these. Um instead like based on the outcome, the trading amounts and like has the market ended the prices
are determined. Um and then I was just thinking of one other thing but I think I forgot it. Um so if I remember I will say again but basically like it's determined dynamically. Um no need to do anything like because we don't use like an order book system doesn't mean that someone has to want to sell at the same price you want to buy. So there's no like you can buy or like you can trade tokens at any time because they are calculated dynamically in the system. um no real like math like it's a very simple uh system which says like if oh oh okay I already have it here if there's like more demands for yes that means there's a higher yes price and there's a higher probability that yes will happen and I actually like show these on the app itself so I'm not going
to go through them again but yeah uh you have like all the functions to build out the get price and eat and the sell price uh one other thing I want to mention is like most these functions are not uh they don't come as built when you download the scaffold ETH app. So the goal actually of the challenge is to build out all these functions. I'm not showing the full of them. I can I already have like the GitHub if you guys want to like have a sneak peek. Uh it's mostly like explain the challenge too. But yeah, like most of these like the goal of the challenge is to actually like feel these challens and modifiers, constructors, etc. So then you can build it out yourself. Um but yeah the a very important component is the trading and liquidity mechanism how this works. So that
was like another thing. Um I did not mention the market owner and I actually don't think I have the slide but I will mention it after the oracle. And then last of all is the oracle. So as I mentioned like smart contracts can't know what happens in the real world. You have to have a way to tell them hey like this action happened or in this case you know like the race has ended and the green car is the winner. Um so that is where the oracle comes to play. We have a very simple oracle setup over here which just uses a trusted address that says like hey yes like the red car won and the game has ended. Um so once that happens you basically like set the winning outcome. You say like hey like who is winning. Um and yeah that's like is reported true or false that basically like
ends the market. So once the oracle says like hey this event has ended the market owner calls um I think like a I'm not exactly sure the function name but oh report okay uh the market owner calls the report function gets the result and ends the market. So from that point on, you cannot change the price. You cannot trade. All you can do is like if you are a winner, you can withdraw the money that you want. If you're a loser, well, you don't have any money to withdraw anyway. So that's kind of the role of the market owner in relating to the oracle. And yeah, this is like the mark the oracle is defined in the prediction market contract. Everything is actually defined in the prediction market. Contract besides of course the ERC20 which you will also have to deploy.
So to close the loop um liquidity provider funds the market, users trades um once users like lock in all their trades. Um and the the time endings, the oracle reports who won, the outcome of the prediction market, the winners can redeem their tokens and the LP can withdraw what's left. You can you probably want to add some incentives for the LP as well, right? Like no one just wants to like put money in and like not get anything in return. So you can add like some fees for the LP to win over there. Uh really up to you on how you design the mechanics. I think in like this setup, I'm not sure. I guess like there's a fee that goes to the LPS as well, but completely up to you on how you want to build out your markets. And these are basically like small things to change.
So yeah, I think like when you go through them, you can definitely like look into like see how they're working. Just going to see 35 minutes. So these are the links, the QR codes that might be useful. Scaffold 2. Uh you can download the base app. The base app doesn't come with like all the tabs which are specifically for prediction markets which we walk through. Uh the speedrun Ethereum that's the prediction markets challenge and then I wrote a blog post on it yesterday instead of going to dinner. So you can like check out the blog post uh if you'd like to like have a run through of everything we talked about today. Um I hope that it will be helpful. Um it's the blog post is basically like an outline of everything we talked about and I can kind of walk through that
as well. But yeah, so it walks you through like all the bedding. Um, it explains the contracts a bit more in detail because today I like I talked a bit more high uh high level but it like explains the same contracts has a bit more detail. Um, it gives you yeah like explains like a bit more of the constructor details etc. It's still not a walkthrough. So I think the best place to go is follow this prediction market challenge kind of go ahead and build it out yourself and then all I did for the setup as well is you basically like just do like an MPX crate you like run your prediction market challenge you go in you do like a yarn chain to start the chain scaffold has this all built out so you don't need to do that at all yourself and then once you do that you do like a
yarn deploy to deploy the smart contracts because once you get them like you need to deploy them on your own like local node or if you want to like go to mainet or something you can do that and then you start your front end just with like a it's an XJS app as I shown um I didn't edit that but you totally can if you want like the cars to be different colors or any kind of change you can do that and then you do a yarn start uh the debug contracts tab I can show that one more time uh the debug contracts tab is basically it shows you all the contracts you have deploy deployed in the application. So we have the main prediction market contract and you can see like all the functions there. You can directly interact on this tab here but it shows you like you know get price and ETH
sell price and ETH which we talked about and then you have the two other smart contracts which are the ERC20 like standard ERC20 the prediction market no and the prediction market yes. So you will see like all the details here like the token supply etc. So when you run scaffoldeth it will automatically come with a debug contracts tab whether you run this challenge or not that will have all the functions of your contract reflected on this page. So then if you are not a front-end builder but you want to like interact with your smart contracts it makes your life easier. Um the difference of this challenge is it comes with like all these three extra tabs as well compared to the base scaffold. And then yeah so you can basically like also add liquidity from here. Um or you can
just like add it. I'm not sure if you can add it here but I think when we did like when you do the challenge you automatically define like hey add liquidity. So once you deploy the contracts it will automatically add the liquidity there. Um again this is all like hard hats. So, like you can like there's a built-in faucet so you don't need to like think about like supplying any tokens. So, I can just press here and I can get money. I think I got like one ETH. Yeah, one ETH but it's all hard hat. So, I can like constantly get like some money from the faucets. Um, I can log in from an incognito window and I can come in as a different user. So, if I want to buy like no shares I thought it was because I logged in front as a different user. So I can buy like some shares as
this user as well. We can try. So yeah. So like this user like the incognito user user bought like 10 shares. Now the probability has increased because more people think yes we'll win. If we go back here now this user you see now this person sees a different probability because like some person came in and bought shares and well this person thinks no. So I will buy like 30 shares. Now the probability has changed again. So like oops. So like now the probability is much less because like people are participating in our market and buying shares. So you guys can well you can't come in and like if I had it like on a different uh if it didn't have it on my local host maybe you could have like bought the car
which which would have been a good idea as well but that's for the next presentation I guess and then basically what happens is we can like start the race uh and then once the race wins then the oracle will say like hey okay like this person won and then I think like I will have to stop it from the other account that I deployed uh and the markets and be like okay like these persons like you guys like end the markets so then the yes token owners can withdraw or the no token or openers are withdraw depending on like who won the race but yeah this is kind of the setup of the prediction market contract this race well green car won so it is a yes um I think I should go from here okay I don't know the address of there. So, but the or like then I can go and I can run a
revert what is it re sorry report function which basically ends the prediction market as the owner uh the market owner. So get the result from the oracle and the prediction market close the betting and people can withdraw if they made the correct bets and people will lose their money if they made the wrong bets. So yeah, this again this blog post walks through walks you through all this defining the oracle a bit more detailed than maybe what I have on the slides but I probably talked more so I don't know if it has more details than what I talked today but yeah that is my presentation happy to answer any questions you guys might have uh we do have the main builders of scaffold and like a lot of the the main contributors
to build guild here so if you have like super technical contract questions, you can also ask them and I'm happy to try my best if not relay to the necessary people. That's all. Thank you. What are the differences between market? Everyone asks the same question. Everyone thinks they're the same. Uh I mean there's like a whole debate on the difference between prediction market and betting platforms. Uh I I can only say like what I read yesterday from ChachiPT as well is I like
basically it's like prediction markets are more like surveys on future events where you can like get the outcome not necessarily like the goal is not to win or lose but to kind of guess the outcome is one of the statements they make. Um, and then secondly, I think like there's no like winner which can take it all, but instead like there's no house that wins. Um, but honestly, I'm not very sure on the differences cuz like it is like a very large debate. Uh, but these are like my understandings and I think what's most interesting is like they are very accurate in predicting future events. So it's not necessarily the goal is not necessarily to like win something but more so to like know what will happen in the future. I see Austin as a microphone
maybe as a better answer. Yeah. I think the the added information market that happens on top of it. So the uh example with a hamster running to the box like that's purely gambling, right? Like you might know which box the hamster likes. No one has like inside information for where that hamster is going. Or or maybe they do. Maybe they like have maybe it's their hamster and their hamster always goes to like this direction. So that person has inside information so they'll bet. But the difference between a betting market and a prediction market is usually uh the prediction market tends to uh be around some kind of information asymmetry game. Where a betting market is usually around a game that is built to be fair.
And a prediction market is around a a realworld event that isn't so uh synthesized like a a sports game. They're they're constantly changing the rules of the sports game to keep the game very even to keep the teams competing and make the games look fun. But a prediction market is usually around something more more advanced and more real world where there's a lot more information at play and a lot more information asymmetry. So they work a lot better in those uh games of information asymmetry where uh you know it's a real world event. There's thousands of different things interacting with this particular thing. The price of of oil and the price of sesame seeds somehow coming together to make something happen in the market. That that kind of stuff is what where prediction markets are quite interesting because they uh tend to
bubble up this uh information that would have normally uh been you know silent or private. Y my question is how so how would you determine uh the initial liquidity for a market like how will be that process where you know how much is enough to provide like yeah enough liquidity for the people to trade and to avoid like huge spike changes on the probability. Yeah. So in this example setup, we provide like an initial liquidity, but you also have the functions to add and remove liquidity as well. I'm not sure how like big prediction markets manage the liquidity
there, but you like we do have the opportunity to like add more liquidity or remove more liquidity in the case that you see like a spike of people wanted to contribute or not contribute etc. Uh so we do have those functions in the contract. So yeah, it's really up to Yeah, I don't really know how actual prediction markets do the liquidity management. Um I was wondering um maybe a different possible implementation would be instead of using yes and no tokens to use ETH maybe and keep track of how much ETH is bet on the yes or no. So is there any um advantage of using a the yes or and no tokens? Yeah. So we do price them based on
ETH. So like you you have the like price sell tokens based on ETH. Uh if I go here uh yeah function sell tokens for ETH. So we do actually like do the conversion of ETH and the Oh. Whoops. Um can we connect it? Oh, it is connected now. Okay. Um so we do have the conversion of ETH. Um I guess the main advantage here is that so because ETH is like much larger number right now if like if you have like 4k or 3.5k dollars where you want to buy like you know a cent of to contribute like $1, it might be like a bit too confusing to do the conversion in
your head. So that's why we have like we price them based on ETH but we have like yes and no tokens so that they don't like um they're not like 0.00001 ETH and instead you have like 10 sell tokens. So the conversion is actually like you do add like ETH to the market and you have the functions that converged over here. Uh same for the buy tokens. It's all like based on ETH but we abstract it from the users who contribute. Yeah, I had a question. Um, I'm thinking about this from a security perspective. What would prevent the liquidity provider from rugg pulling this and just running off with the money? Uh, if can can you please repeat the question if the So, I'm thinking about this from a security
perspective. So, what would prevent the liquidity provider from rug pulling this contract and just running off with the money before the event has actually transpired? Good question. So I do think we have like some I'm not sure if we like well the functions are like only like the market owner can run certain functions and I don't know in this setup because the market owner is also the liquidity provider. Well that's not great setup. Uh but you probably want to have those like two different like addresses and then there's like a liquidity provider and the market owner which like stops you know allows person to like deposit at a certain time. Um, but the market owner, you can like I think at least like in my setup, I didn't like change it so that they're the same so they can rug. But you can totally like make them have different addresses so then you don't have
like the same address like withdrawing. Um, that would be my answer. I'm not a security expert so I do think like there are Oh, there is a security expert here. [Music] Oh, Philip knows. Can we have a microphone for Philip? Hi everyone. I'm Philip from the build guild as well. Um, and I worked a little bit with the prediction markets and how it's set up. The liquidity par in the first init to in initialize the market is putting one Eve itself in there. For instance, it could also be 10 Eve. So, he only can rock himself because you're going to only run away with the Eve. And during then the prediction markets, people buying in. But there is not but they're getting then the token
and you can only redeem the tokens for the ETH inside. So in the in the end the predict in in this case how it's set up it's also kind of an issue because the liquidity provider goes in with some financial risk. If you imagine you're putting one ETH in and each of these token only costs half um depends on the token. If we just say we have two tokens to make it easy the one yes token cost half a E and the other no token costs no Eve. So it is a huge financial risk because if there's one person going in just buying the the the yes token for half a E and now the um the the prediction finalizes it's over and yes win then the then the prediction market owner loses half a E because the other half of he has to pay to him. So it's more a financial risk
on the on the liquidity provider or who creates the market. That's why you really have to think of when you create a mark, get the initial kind of probabilities right and just make really sure that you don't lose a ton of money. That's why you can see it also in a case that um you can as a liquidity you're the person who seek for advice to a future question. So you're willing to put money in to lose but you will get the information of it. Yeah. I can add one thing on that that I'm working with myriad markets which is another uh prediction markets and the way we set up uh markets is usually trying to find things that are like 50/50 because if you have one share that is like above the pro the the middle probability
uh you could end up losing your your liquidity and yeah that's not good that's not good. Perfect. I think we are already just on time as well. So, yes, feel free to head over to I can find my QR codes. Feel free to head over to speedrun Ethereum to do the challenge. We will see the prediction market liquidity provider set up there as well. But yeah, if you have any questions, we're all here around this whole week. So, hope to see you. If you're at the hackathon, too, will be here. But yeah, thank you. [Applause]
[Music]