Inspiration
It's not just you. Your search results are getting worse over time. It's inevitable given the way the incentives on the internet are aligned right now. A friend joked with me that prediction markets were way more accurate than polls during the 2020 elections. This is an attempt to realign the incentives of search, using the power of prediction markets on Solana.
What it does
The search market works like this:
- The user submits a query through a search frontend, paying a small fee to list
- Search engines respond with results for that query. Each result is a mint for binary option tokens.
- Information traders can escrow some SOL with the exchange and get Yes/No token pairs in return.
- Token holders trade through the exchange until the search market expires. These tokens have value derived from the escrowed SOL, and their price should converge on the probability that their associated result is the most relevant for you, similar to a prediction market.
- The user marks the best result.
- Token holders can redeem for the escrowed SOL. “YES” tokens redeem if the user selected that result. “NO” tokens redeem if the user selected a different result, or if the market expired without a result.
How we built it
There are three components to this project:
- A program on-chain written in Rust that encodes queries, results, and a basic exchange.
- A frontend written in Typescript with Next.js to allow users to submit their own queries for a small fee.
- A backend written in Typescript that echoes Bing Web API results back on-chain.
Challenges we ran into
- There's enough of a difference between the results for solana-program-test and actual devnet to be frustrating sometimes. Solana-program-test just hangs when there's a panic which makes debugging locally hard.
- The Borsh serializer in Javascript is a PIA to work with. Totally undocumented and super weird schema format. I'd pick a different wire format if I did this again.
- Ran out of time to add all the security/safety validations lol. Don't...put real money on this.
- Realized way too late that Serum costs a burned 4 SOL to list a new token so I had to implement a minimal marketplace on my own. There's no way that was going to work with 2 tokens per search result per query.
What's next for AskBid: A Decentralized Search Market
- Lots and lots of validation, testing, and security auditing
- Have the backend actually redeem its tokens so it doesn't airdrop as much
Built With
- bing-web-api
- heroku
- next.js
- rust
- solana
- tailwindcss
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.