This is the announcement that I announced here:

I finally got the MVP done for a prediction market on lightning.

If you don't know what a prediction market is, watch this video.

But first and foremost: To prevent loss of funds, the market is running on mutinynet and not mainnet until I have enough confidence in the code for mainnet. This means the sats have no value and you need to use the mutiny faucet to pay invoices and the mutiny wallet (signet) to test withdrawals as mentioned in /about.

Thanks to @benthecarman @TonyGiorgio and Paul (I don't know his nym on here, lol) for mutinynet and the provided tools! Less stuff I had to worry about on my own.

Features

  1. create your own binary markets
On the main page, you can immediately see a button to create a new market. You'll need to login with lightning though. You can use any LNURL-auth capable wallet for that. LNURL-auth is independent from which network is used for transactions :)
For now, you can only create binary markets. This means that you can only bet on events which outcome is either YES or NO:
market creation form:
Be aware that you can currently not change the description or delete the market after creation. In the future, I might allow edits for a few minutes after creation.
  1. trading of YES and NO shares
Basically the heart of the market. As a market would be useless without trading, you can obviously create BUY and SELL orders for YES and NO shares. Every order must be matched with an order of a different market participant.
For example, if you want to buy 2 YES shares at a price of 70 sats per share or short: BUY 2 YES @ 70 sats, your order must match a BUY 2 NO @ 30 sats order.
buy order form:
The interface might still be overwhelming even though I iterated on it several times already.
The input labeled with how much? specifies how many sats you want to bet. With how sure? you specify the price per share since the share prices in a prediction market reflect what the market currently thinks how likely an outcome is (at least in theory).
  1. interactive order book
To match existing orders easily, you can simply click on PENDING and a context menu will show - assuming it's not your own order, else it will show a button to cancel your order:
matching existing orders using the interactive order book:
On click on match, you'll get redirected back to the order form but with prefilled values. If you submit this order, this will match the other order after payment. For example, if you click on match in the screenshot, you would get redirected to this order form with BUY 2 YES @ 20 sats prefilled:
  1. basic market stats
On the stats page, you can see the total sats locked in the market (volume) and how many are on which side. YES 75% means that 75% of all sats were put into YES share which means that the market thinks that the chance that YES will win is 75%. However, tbh, I am not entirely sure if the chart works, lol
stats page:
  1. withdrawal
You can withdraw any sats you received via payout or canceling an order (you'll get a refund for any invoice you paid for the order) in your wallet:
wallet page:
withdrawal via bolt11 payment request:
  1. list of all invoices
Not much to say here. Just a list of all your invoices with their status so you can pay them later or keep track of what you've done:
  1. list of all orders
Similar to the invoice list. You can also cancel your orders from this list (and not only from within a market order book) by clicking on PENDING to show the context menu.
  1. market settlement
If you created a market, you can decide the outcome of the market via a hidden settings page:
This is obviously not ideal and unlike what I initially mentioned: that the market creator (or me, as the site operator) would only be used as a fallback if the trading parties don't find consensus on the outcome. However, this idea didn't make it into the MVP.
If anyone even remembers, I also mentioned that I would be using HODL invoices to wait with settling the invoices until a counter party was found. If no counter party was found, their sats would get returned for free - no network fees. That also didn't make it into the MVP and I am no longer sure that's even something users would want since it trades UX for a potentially insignificant risk of having to pay the lightning network again for a withdrawal if you found no counter party.

Planned

  • actually show end date that was picked during market creation to user
  • PWA with push notifications
  • fix chart (?)
  • code cleanup / refactor (that's probably always a thing, lol)
  • tests, tests, tests
  • other stuff that I forgot now
  • ...
  • mainnet

That's it for now. I want to go to sleep and writing all of this took some time that I was worried about my account deletion deadline, lol
Now go, find all the bugs that I have hidden for you! Feel free to create new markets. I have created some orders for the existing markets so you can use them to immediately find some matches :)
Hopefully I'll wake up to some interesting prediction markets - or funny :)

Very cool.
Market settlement is going to be a very interesting problem to solve in future versions.
I wonder if you could nominate an npub (or have an m of n npub model) to agree on the outcome. Then anyone participating could:
  • Choose a market based on the npub they most trust
  • Vs. the market with most liquidity
Market settlement then only possible based on nominated npub signing a settlement message with their nsec.
Also, will be great to get stats working right. I love to randomly check Predictit, Manifold, and (this is the most shitcoiner thing I do) Polymarket.
reply
Ohh, I like the idea of nominating an npub or even a m of n npub model!
I mentioned in this comment that I think we could have a lot of options for oracle and hopefully the best one will emerge simply by what people choose. or maybe not, idk, haha. but experimentation seems like the way to go. just build something! lol
Also, will be great to get stats working right. I love to randomly check Predictit, Manifold, and (this is the most shitcoiner thing I do) Polymarket.
Yeah, the market stats might actually be the most important thing. Since it's where whole society gets value from prediction markets by exposing information and not only traders benefting from each other in a zero-sum game.
Need to work on my frontend skills.
reply
Sharing tips on testing
  1. Use any LN wallet to log in first - you can use any LNURL-auth capable wallet.
  2. Use https://faucet.mutinywallet.com/ "the Bolt11 Payment Request" to pay any invoices generated from delphi.market.
Feedback
  • site background color
Maybe it would be nice to have the option of choosing light or dark mode? I like the current color, but it hurts my eye to read it.
  • onboarding process
Now it's login first then able to create, how about having the option to fill everything first and then require to login? maybe some people want to see how it works before logging in.
that's for now 🫑
reply
site background color
oooh, yes, totally forgot about this. I just copied the theme from my personal site but also there I feel like it's too dark; bad contrast etc.
But I am very bad at styling things so I was happy that I found some colors which seem to make sense together haha
But yes, light and dark mode would be nice :)
  • onboarding process
Now it's login first then able to create, how about having the option to fill everything first and then require to login? maybe some people want to see how it works before logging in.
The problem with this approach is that it's annoying to fill some inputs only to then get prompted that you need to login and then your stuff is gone and you need to enter it again.
The solution would be to get redirected to the previous page after login and keep the stuff filled but that's state that isn't trivial to implement. So more effort. So I just decided to require login for the market form.
But it's a good point and always in the back of my mind :) When do people have to actually login without making it annoying?
reply
The terminology really confuses me. I matched someone's order but TBH, I'm not really sure what side I've taken or how to understand the "how sure are you" number and how it changes things. When I pick "no" and then say I'm "0.01 sure", it says I might get a lot of money, so like, yeah ofc I'll do that, I won't lose much to win that and I wasn't sure anyways. Also not sure why there's a bunch of "2 shares" stuff, are you substituting the word "to" for 2?
Perhaps remove the sure part to better that UX and just make it 50/50? Or let the markets average out the spread and enforce that and don't let users deviate from it by a certain amount? Not sure, but it's kind of hard to understand the sides of it. Also not sure what to do next, I guess wait until the end of the week. I didn't want to read any of the wall of text so sorry if that's answered lol.
I know it's early but those are my initial impressions. Cool to see though.
reply
1701 sats \ 1 reply \ @ek OP 4 Dec 2023
The terminology really confuses me. I matched someone's order but TBH, I'm not really sure what side I've taken or how to understand the "how sure are you" number and how it changes things. When I pick "no" and then say I'm "0.01 sure", it says I might get a lot of money, so like, yeah ofc I'll do that, I won't lose much to win that and I wasn't sure anyways.
Thanks for the feedback and testing it out!
I agree it's confusing and still needs improvement. I maybe need to explain prediction markets in general better. I only linked to this YT video in /about because I was too lazy to go in depth, haha. I think I'll sprinkle some help icons around and explain stuff which might not be easy to understand for someone with not much knowledge about prediction markets. And more stuff regarding this. I shouldn't forget how hard it was for me to grasp how prediction markets work.
I also used how sure are you? to make it more "intuitive" how the price is created. If you're very sure, you would pay a lot to gain a little. And the higher your price, the lower the amount the counter party has to bet against you so it's more likely you'll actually find someone to be your counter party. But as you framed it "if you're very unsure, you might win a lot" makes it clear that this isn't intuitive, lol
Perhaps remove the sure part to better that UX and just make it 50/50?
We don't do 50/50 here! It's a prediction market! haha
But yes, I could create a simplified UI and the "advanced stuff" might be hidden behind a checkbox. People are way more familiar with bets meaning that you pay the same amount as the other party.
Or let the markets average out the spread and enforce that and don't let users deviate from it by a certain amount?
I think that goes into the direction of creating a market maker and "market orders". I intend to do this and this was actually what was blocking me the whole time. The prospect of having to create an automated market maker for an MVP was very overwhelming, lol. But then I realized that first comes manual trading and a market maker only shows up when there's already some liquidity around. So an AMM is actually just "nice to have" even though most people might expect there to be one in a market :) We're really spoiled!
Also not sure what to do next, I guess wait until the end of the week
Do some deep research and see if you might want to change your prediction and buy more shares / sell some shares :) At least that's what serious traders would do now, haha
But yes, I am even currently missing to show the date that was entered during market creation, lol. The date doesn't enforce settlement currently anyway.
Also not sure why there's a bunch of "2 shares" stuff, are you substituting the word "to" for 2?
I didn't want to read any of the wall of text so sorry if that's answered lol.
I believe your questions will be mostly answered by the YT video :) I didn't explain prediction market stuff in the text
I know it's early but those are my initial impressions. Cool to see though.
Thanks, feedback is very important in this early stage :) So thanks again!
reply
Yeah I feel that. I only know the concepts, but some user friendly stuff could go a long way in usability before you have to build something that's "to a t" perfect prediction market. Just start out with 4 or 5 buttons and take it from there: no clue, doubtful, neutral, positive, absolute
Then some concepts such as "double down" or "reverse order" if the user changes their mind or is more confident.
reply
Excited to play with this! As with @siggy47, I noticed your absence recently. Am glad this a significant accomplishment is what's behind it :)
reply
deleted by author
reply
reply
Excellent, @ekzyis! Thanks for doing this. It really is an achievement, and you have just begun. I missed you around SN lately. Now I know why.
reply
Very cool. Looking forward to trying it this evening when I finish work.
reply
Groundbreaking. Congratulations πŸ‘πŸΎπŸŽ‰
reply
Can you add CORS to the LNURL auth call? Can't do LNURL auth from Mutiny wallet atm. Really intrigued by this so nice work.
reply
Oh, right, that doesn't work since mutiny is a browser wallet. Yes, can do!
reply
Just added it now simply via nginx. Tested it myself with https://app.mutinywallet.com/. Should work for you too now.
Adding it simply via add_header Access-Control-Allow-Origin * instead of inside the code feels like a hack but maybe that's actually not a hack but (should be) best practice? lol
reply
Worked! Thank you.
reply
This is huge! Congrats @ekzyis
reply
Awesome. Congrats.
reply
It would be great to integrate it to SN and/or nostr.
I think prediction markets can fight online disinformation much more effectively than the activist "fact checkers"
reply
Someone heard my prayers. πŸ˜… Nip88 by Ben Carman. πŸ”₯πŸ”₯πŸ”₯
reply
Fact checkers dosent check nothing. They are propaganda.
Bravo!!!! πŸ‘πŸ‘πŸ‘
reply
Nice. Will keep it in my radar.
What are your long-term plans for oracles?
reply
What are your long-term plans for oracles?
No real plans. Just trying out all kinds of stuff and seeing what sticks. Maybe you can even configure during market creation what kind of oracle you want to use? And then markets can compete using their oracle setting? lol
@gunson also had a nice idea here.
I consider this site to just be an experiment. I don't have any plans. I just want to build something that I and preferably also others want :)
But good question, I never looked into this whole DLC on lightning stuff much. Might be a good time now.
reply
I would assume the coolest thing would be a choose-your-oracle protocol where there's a market for Oracle services where good Oracles grow a reputation and collect fees out of keeping honest to them.
I've thought of similar schemes to decentralize arbitration in craiglist-like protocols. You have a market for arbiters, both sides choose one for each trade, arbiter grows a reputation by being professional and earns a fee for it.
reply
yeah, i think going from "oracles with built-in rug pull" over "reputation based oracles" to "oracles that provable cannot lie" (if this is ever possible since we want to map events in meat space to cyber space) is the way
reply
I prefer shaman's! ✌️
I was worried about my account deletion deadline
yay, @ekzyis is staying in SN.
Now go, find all the bugs that I have hidden for you!
will do after breakfast:))
reply
One more comment, may be a bit of a downer ...
How censorship resistant have you made the site?
Obviously using Bitcoin for funds is helpful, but there are other issues you could face as the website host if this is too successful. The USG hates prediction markets, and many are fighting lawsuits against the CFTC: https://archive.ph/VEeTJ
reply
The state hates it. What a great indication that this is what the world needs!
reply
How censorship resistant have you made the site?
Zero, it's as censorship resistant as any other site which is self hosted with a single person being in full control over the whole stack (ok, except DNS). It's just an MVP. Also, I'll censor any market that I think is putting me at risk (or for whatever other reason at my discretion). I hope this is obvious. So if you want to have censorship resistance, you probably need to fork, build something on your own or wait until I think censorship resistance becomes important enough :)
I only cared about whois info being private. But it won't stop the feds obviously.
I am not a hero, I won't be a martyr in any way, I don't expect any help from anyone if the feds come knocking, I'll just comply and shut the site down, it's very simple. I am just a pleb trying to build something which he thinks is worthwhile and hoping others will join his cause. And PMs aren't a hill I am going to die on / prison for.
But in some way, getting enough traction that the feds care would also be something I would be proud of, not going to lie.
But I'm open to ideas regarding censorship resistance. I guess running a onion/hidden service would help? Or I2P etc.?
reply
Permissionless innovators are heroes to me.
reply
What comes to my mind when I look up to people and want to tell them how much I admire them: I am always afraid I am going to alienate them. And they are probably getting so much admiration already, so they don't care about one more person. They might actually get annoyed at some point. Smile for the camera, shake hands, thank you, thank you ... (oof, that must be hell for a person which isn't very social)
So rather than telling them how much I admire them, I would ask them how much they annoy all this admiration. Try to empathize with them. Understand how it must be in their shoes. Ask very good questions and so on ...
So my hero might actually remember me lol
(between all these other random people, probably going for a hug because they can't control themselves and don't realize they are actually complete strangers to this person.)
So what do I want to say with this?
Just that I don't think I am a hero and people telling me I am just makes me feel alienated / strange to some degree :)
But don't worry, it's okay, just wanted to explain my view on this better :)
And it also does feel nice that people think I am doing a good job, that's definitely out of question. But that's just not the full picture.
reply
I'll lay off the personal praise, then, and make my point more abstract. Sorry, that's probably the best I can do.
The systems of control that are destroying vast amounts of prosperity rely on voluntary compliance. People are so afraid of running afoul of the regime that they don't take any chances. They self-censor and they stifle their own innovations. Incomprehensible amounts of foregone value are the cost of waiting for permission.
That's why I am a huge advocate for those who provide value to others without seeking regime permission to do so. To me people who behave this way are heroes of civilization, even if their contributions don't feel that significant to themselves.
reply
ohh, i see :) "then" i fully agree.
but as mentioned, i can understand why you're saying these things and i do appreciate it! but sometimes, it just feels like that's not what I need (for the reasons explained above). but definitely no need to be sorry!
my "master plan" is to just write the best code possible and document it so well that anyone can run it
and then i should be able to just say: i just wrote some code and released it to the public .... but i am not the one running it. i think about these t-shirts a lot, from the era where (strong) encryption was still classified as ammunition, until DJB showed the US gov how ridiculous that is:
but maybe that won't work because corruption or making an example out of me or something totally different, idk. then i'll go to prison anyway xD
but yes, at least I tried :) and tried to fight them with their own weapons (the legal system).
i believe the tornado cash guy also did run the code? need to look this up later ...

when @nemo is back, i would be very interested in his opinion on this topic :)
reply
Great answer
Btw shows that you've built something very cool that people like me are already imposing impossible standards onto it πŸ˜…
reply
Btw shows that you've built something very cool that people like me are already imposing impossible standards onto it πŸ˜…
Oh, good point, didn't see it this way yet :)
reply
I settled the market I created. How does it work now? Do users get a notification the market is settled and if they won or lost sats?
reply
I think I DM'ed you because I noticed during one of my "SN breaks" that I still didn't answer you. But I only think so here is my public answer:
No, no notifications yet. Sats will for now simply magically arrive in their wallet or not :)
reply
Yes I got a reply that came with a QR code. I had never gotten a message like that on SN but I don't know how to respond to it. The contract was announced Saturday but signed today so it didn't meet the criteria of YES for the event. Will be awesome when notifications are enabled.
I will create a new event this week.
reply
Yes I got a reply that came with a QR code. I had never gotten a message like that on SN but I don't know how to respond to it.
Ohh, this is the feature from @WeAreAllSatoshi announced in this release:
lnurl-pay comment support (via @weareallsatoshi)