Fully decentralized prediction markets on the NEAR Protocol — with Switchboard resolutions.
This document focuses on detailing the Rust smart-contracts and the frontend Typescript API that allows developers to create their own prediction markets dApps or extend the existing app.pulsemarkets.org dApp.
You may prefer to jump straight into the official Rust or Typescript codebases. Raise a pull request or an issue if you find bugs or improvements!
Pulse Markets was born as the 1st prediction markets platform built entirely on the NEAR Protocol (not for the Aurora EVM compatible platform, Solidity already has quite a lot of these).
BTC/USDT price markets frontend client
Pulse has a main objective: achieve full decentralization of prediction markets; meaning that there should be no middlemen between the bettors and the parties that provide the results of an event outcome.
Full decentralization was achieved by version 2.0 of app.pulsemarkets.org by implementing a well-tested suite of Market Rust smart-contracts and Switchboard Rust SDK for NEAR.
We are aware of the many types of prediction markets, PMs, but we decided to trial our main objective with the most straight forward type of PM: Parimutuel Markets.
Parimutuel markets work great with a binary outcome (💡 Pulse market contracts can manage more than 2 outcomes) at a specified date and time such as sporting events, elections and prices at a specific time in the future (💡 On version 2.0, Pulse focused on price markets).
Parimutuel markets allow anyone to deposit any amount of funds on either side of a market. The markets do not rely on liquidity so participants are free to deposit any size that they would like. The odds of these markets are only known upon the deposit period ending. If the side you deposit funds on is the correct side then, for example, if your position was 50% of the deposits on the correct side you would win 50% of the deposits from the incorrect side.
The drawbacks to Parimutuel markets are that you don't know the final odds until the market closes and therefore don't know your total percent of the side you deposit funds on until then either (💡 we balanced this drawback in our contract architecture). This can lead to individuals wanting to wait until the very last second to deposit funds to give them the most information as possible and best chance of gauging what the odds will likely be (💡 we implemented a feature to balance this drawback too). These markets are also illiquid meaning that your funds are locked up until a resolution is set (💡 yes, but this is the point of gambling, no?).
Prediction markets is a wide industry, normally attributed to betting and speculation on sport events, weather events or future price events; with Pulse Markets contracts and API though, several other use cases may be implemented:
Build A versus B online games where players bet on themselves. If they win, they get the money from the other players.
Use Pulse Markets contracts API to create a Telegram bot with commands such as /createmarket, /bet, /sell and /getmarket.
Onboard millions of Telegram users onto a decentralized betting frenzy.
Fixed Bet Markets
Implement new logic into Pulse Markets contracts, to allow only for specific bet amounts.
Browse through Switchboard Publisher catalog to see all the data sources that can power a Pulse Market at https://app.switchboard.xyz/