LogoLogo
PAO DocsCommunity DocsDeveloper DocsPeerplays.com
  • Infrastructure Documentation
  • The Basics
    • Peerplays Node Types
    • Hardware Requirements
    • Obtaining private keys for cli_wallet
    • Using the CLI Wallet
      • CLI Wallet Fundamentals
      • CLI Commands for All Nodes
      • CLI Commands for Witnesses
      • CLI Commands for SONs
        • Updated CLI commands for SON voting
      • Deriving Keys using CLI Wallet
    • Auto-Starting a Node
    • Backup Servers
    • Obtaining Your First Tokens
    • Updating a Witness Node
    • How to create a Peerplays Account?
  • Advanced Topics
    • Private Testnets
      • Peerplays QA environment
      • Private Testnets - Manual Install
    • Reverse Proxy for Enabling SSL
    • Enabling Elasticsearch on a Node
    • Introduction to Faucet
  • Witnesses
    • What is a Witness node?
    • Installation Guides
      • Build and Install
      • Docker Install
      • GitLab Artifact Install
    • How to become a block producing witness?
    • Other Ways to configure a witness node
      • Peerplays API nodes & Installation Guide
      • Configuring Witness Node as Delayed Node
    • What's Next?
  • Sidechain Operator Nodes (SONs)
    • Installation Guides
      • Manual Install
      • Docker Install
      • SON Configuration - Version 1.5.19
      • SON configuration - Version 1.6.0
      • Bitcoin-SONs Sanity Checks
      • ETH-SONs Configuration & Installation
      • Existing SON node upgrade
  • Bookie Oracle Suite (BOS)
    • Introduction to BOS
    • BOS Installation
      • Installing MongoDB
      • Installing Redis
      • Configuration of bos-auto
      • Spinning Up bos-auto
    • BookieSports
      • Installing Bookiesports
      • Synchronizing BOS with BookieSports
      • BookieSports Module Contents
        • Sub Modules
      • Schema
      • Naming Scheme
    • Manual Intervention Tool (MINT)
      • Installing MINT
      • Introduction
  • DATA PROXIES
    • Introduction to Data Proxies
    • How Data Proxies Work
    • Data Proxy Set Up
  • COUCH POTATO
    • Installation
    • Functional Requirements
      • Flow Diagrams
      • Home Page
      • Create Account
      • Dashboard
        • Header
        • Sports Tabs
        • League Tabs
        • Calendar
        • Notifications
        • Replay
        • Account Menu
      • Game Selector
      • Change Password
    • Help
      • User Guide
        • Introduction
        • Home Page
        • Creating an Account
        • Dashboard
          • Replay
          • Account Menu
            • Change Password
        • Game Selector
    • Database
      • Schema
      • Objects
        • Tables
        • Views
    • API
      • Using the API
      • API Reference
        • Objects
        • Error Codes
      • BOS Schema
    • Proxy Payment Considerations
  • Other Documentation
    • Peerplays Home
    • Community Docs
    • Developer Docs
    • Site Reliability Engineering
Powered by GitBook
On this page
  • Overview of variables
  • Internal Processing

Was this helpful?

Export as PDF
  1. Bookie Oracle Suite (BOS)
  2. BookieSports

Naming Scheme

Some BookieSports files (in particular name and description fields) allow the use of variables. Those are dynamic and filled in by bookie-sync, automatically.

As an example, the file MLB_ML_1.yaml defines betting markets for a Moneyline market group. The betting markets carry the name of the event participants. We encode this in BookieSports using variables:

bettingmarkets:
     - description:
         en: '{teams.away}'
     - description:
         en: '{teams.home}'

Overview of variables

  • teams:

    • {teams.home}: Home team

    • {teams.away}: Away team

  • result:

    • {teams.home}: Points for home team

    • {teams.away}: Points for away team

    • {teams.hometeam}: Points for home team

    • {teams.awayteam}: Points for away team

    • {teams.total}: Total Points

  • handicaps:

    • {teams.home}: Comparative (symmetric) Handicaps (e.g., +-2) for home team

    • {teams.away}: Comparative (symmetric) Handicaps (e.g., +-2) for away team

    • {teams.home_score}: Absolute handicap for home team (e.g., 2)

    • {teams.away_score}: Absolute handicap for away team (e.g., 0)

  • overunder:

    • {teams.value}: The over-/under value

Internal Processing

The variable parsing is done in bos-sync (substitutions.py) and work through decode_variables and a few classes that deal with the variables. This allows us to have complex variable substitutions.

The variables all consist of a module identifier and the actual member variable:

{module.member}

All modules are listed in the substitutions variable in decode_variables::

substitutions = {
    "teams": Teams,
    "result": Result,
    "handicaps": Handicaps,
    "overunder": OverUnder,
}

The modules themselves (capitalized first letter) are defined in the same file and can be as easy as:

class Result:
    """ Defines a few variables to be used in conjuctions with {result.X}
    """
    def __init__(self, **kwargs):
        result = kwargs.get("result", [0, 0]) or [0, 0]
        self.hometeam = result[0]
        self.awayteam = result[1]
        self.total = sum([float(x) for x in result])
        # aliases
        self.home = self.hometeam
        self.away = self.awayteam

or as complex as:

class Teams:
    """ Defines a few variables to be used in conjuctions with {teams.X}
    """
    def __init__(self, **kwargs):
        teams = kwargs.get("teams", ["", ""]) or ["", ""]
        self.home = " ".join([
            x.capitalize() for x in teams[0].split(" ")])
        self.away = " ".join([
            x.capitalize() for x in teams[1].split(" ")])
PreviousSchemaNextManual Intervention Tool (MINT)

Last updated 2 years ago

Was this helpful?