Copy of OpenBook Whitepaper
  • Introduction
    • Welcome to OpenBook
  • Market Description
    • Market Participants
    • Market Size
  • Background
    • Introduction
    • Centralized Models
    • Decentralized Models
  • Description of the Problem
    • Existing Problems
  • Our Solution
    • Introduction
    • Problems and Solutions
    • Our New Model
    • Advantages for Bettors
    • Advantages for Bookies
  • Project Architecture
    • Introuduction
    • Protocol Structure
  • Betting Side
    • Introduction
    • Making a Bet
    • Types of Bets
  • Bookie Side
    • Introduction
    • Becoming a Bookie
    • Benefits of Being a Bookie
  • Backend Implementaion
    • Liquidity
    • Market
    • Bet Contract
  • Frontend Implementation
    • Introduction
    • Navigation Layouts
    • Betting Page
    • Account Page
    • Bookie Page
  • Business Model
    • Businese Model
  • Legal Consideration
    • Legal Considerations
  • Roadmap
    • Introduction
    • Three Phase Rollout
  • OpenBook DAO
    • OpenBook DAO
  • Allocation of funds
    • Allocation of funds
  • Team and Project History
    • Team and Project History
Powered by GitBook
On this page
  1. Backend Implementaion

Market

PreviousLiquidityNextBet Contract

Last updated 3 years ago

New Matches are created and settled from the Market contract. Only the provider address can call must of functions in the market contract. A market is started when provider calls startMarket function with appropriate details like start time, match name, match details, series of bets available for the match, and the starting odds. This data is sent in an array, and multiple matches can be sent at the same time. The data is stored inside a map with an index that increases with every new call serving as the match id and the key in the map.

Before the match settles, providers can call the updateOdds function to update the odds for the game.

The match is settled when the provider calls settleMarkets method with the index of the winning team. When a match is settled, this contract unlocks the liquidity the bet contract locked for this match.

Market contract also has many read-only functions that frontend calls to get details of a match. It returns all matches, match details by given id, and so on.