Skip to content

Markets Compilation

Market templates consist of a combination of static text and placeholders, encompassing both market and outcome names.
The compilation process for market templates entails replacing designated placeholders with specific values, all while retaining the static text.
This procedure results in the creation of a finalized market name and a comprehensive list of outcomes.

template_syntax_diagram
Fig.1 Template syntax

An example of sport event snapshot with market templates
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{
  "id": "238dcc48-daa5-46af-81e9-3365901f4fd7",
  "meta": {},
  "markets": {
    "1": {
      "id": "1",
      "odds": {
        "1": {
          "id": "1",
          "value": "1.880000000000",
          "status": 5,
          "template": "{$competitor1}",
          "is_active": true
        },
        "2": {
          "id": "2",
          "value": "1.840000000000",
          "status": 5,
          "template": "{$competitor2}",
          "is_active": true
        }
      },
      "status": 0,
      "type_id": 1,
      "template": "Winner",
      "specifiers": {}
    },
    "20": {
      "id": "20",
      "odds": {
        "1": {
          "id": "1",
          "value": "1.900000000000",
          "status": 0,
          "template": "{$competitor1}",
          "is_active": true
        },
        "2": {
          "id": "2",
          "value": "1.860000000000",
          "status": 0,
          "template": "draw",
          "is_active": true
        },
        "3": {
          "id": "3",
          "value": "1.860000000000",
          "status": 0,
          "template": "{$competitor2}",
          "is_active": true
        }
      },
      "status": 0,
      "type_id": 20,
      "template": "1x2",
      "specifiers": {}
    },
    "14h2_5t2_5": {
      "id": "14h2_5t2_5",
      "odds": {
        "1": {
          "id": "1",
          "value": "1.920000000000",
          "status": 0,
          "template": "over {total}",
          "is_active": true
        },
        "2": {
          "id": "2",
          "value": "1.840000000000",
          "status": 0,
          "template": "under {total}",
          "is_active": true
        }
      },
      "status": 0,
      "type_id": 14,
      "template": "Total maps",
      "specifiers": {
        "hcp": "2.5",
        "total": "2.5"
      }
    }
  },
  "fixture": {
    "id": "238dcc48-daa5-46af-81e9-3365901f4fd7",
    "meta": {},
    "type": 0,
    "status": 3,
    "streams": {},
    "sport_id": "esports_counter_strike",
    "template": "{$competitor1} vs {$competitor2}",
    "start_time": "2019-04-01T15:29:31Z",
    "tournament": {
      "id": "betting:0: AOC CyberGamer Premier League  Spring. Best of 1",
      "name": " AOC CyberGamer Premier League  Spring. Best of 1",
      "master_id": "betting:0: AOC CyberGamer Premier League  Spring. Best of 1"
    },
    "updated_at": "2019-04-02T12:53:46Z",
    "competitors": {
      "betting:0:1003": {
        "id": "betting:0:1003",
        "meta": {},
        "name": "AKARA",
        "type": 2,
        "scores": {
          "total": {
            "id": "total",
            "type": "total",
            "number": 0,
            "points": "4"
          }
        },
        "home_away": 1,
        "master_id": "betting:0:1003",
        "template_position": 1
      },
      "betting:0:1015-esports_counter_strike": {
        "id": "betting:0:1015-esports_counter_strike",
        "meta": {},
        "name": "VG.J Thunder",
        "type": 2,
        "scores": {
          "total": {
            "id": "total",
            "type": "total",
            "number": 0,
            "points": "0"
          }
        },
        "home_away": 2,
        "master_id": "betting:0:1015-esports_counter_strike",
        "template_position": 2
      }
    },
    "live_coverage": false
  },
  "updated_at": "2019-04-02T12:53:46.476241Z"
}

Static text

Static text remains unchanged during compilation and serves as static content that is fundamental to the structure and purpose of the template.
Please refrain from modifying or replacing permanent text.

Example of template with static text:
Winner – no need to change.

Example of market template with static text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
...
  "markets": {
    "1": {
      "id": "1",
      "template": "Winner",
      "odds": {
        "1": {
          "id": "1",
          "value": "1.880000000000",
          "status": 5,
          "template": "{$competitor1}",
          "is_active": true
        },
        "2": {
          "id": "2",
          "value": "1.840000000000",
          "status": 5,
          "template": "{$competitor2}",
          "is_active": true
        }
      },
      "status": 0,
      "type_id": 1,
      "specifiers": {}
    }
  }
  ...

Placeholders

The template includes designated placeholders placed throughout the market and outcome names. These placeholders act as variables, which should be replaced with actual values to match templates with concrete sport events.

Steps for correct placeholder replacement:

  • identify placeholders enclosed in curly brackets.
  • replace placeholders with the actual information they represent.

Example of placeholder:
{$competior1} – need replace the actual name of the first competitor.

Example of market template with placeholder
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
...
  "markets": {
    "1": {
      "id": "1",
      "template": "{$market1}",
      "odds": {
        "1": {
          "id": "1",
          "value": "1.880000000000",
          "status": 5,
          "template": "{$competitor1}",
          "is_active": true
        },
        "2": {
          "id": "2",
          "value": "1.840000000000",
          "status": 5,
          "template": "{$competitor2}",
          "is_active": true
        }
      },
      "status": 0,
      "type_id": 1,
      "specifiers": {}
    }
  }
  ...

Special symbols

To ensure accurate template compilation, it is imperative to explicitly establish the significance of special symbols.
Properly defining the interpretation of these symbols is essential for the seamless generation and processing of templates within the intended context.

List of special symbols and their meaning:

  • $, % - define placeholder of strategy level.
  • ! - define need of use grammatical correctness in relation to gender declension of linguistic elements.
  • + - outlines the requirement for designating the "+" symbol as a prefix before a numerical value to indicate its positivity.
  • - - outlines the requirement for designating the "-" symbol as a prefix before a numerical value to indicate its negativity.
  • no symbol - establish of the standard value substitution that does not involve supplementary text processing.

Strategies

In order to compile market templates correctly, it is imperative to substitute the placeholder information enclosed within curly brackets with precise values corresponding to one of the strategies.

Available strategy types:

  • market;
  • competitor;
  • tournament;
  • team member nickname;
  • specifier;

Market strategy

To fill placeholders using a market strategy, it is necessary to possess knowledge of market ids.

List of available placeholders and resolve process:

  • {$marketN} – replace the placeholder with the actual name of the market with id N.
Example of resolving templates of market strategy

Template, which requires resolve: {$market1}.

Solution:
For this is required to replace placeholder with appropriate name of market with id 1:
{$market1} → Winner

Competitor strategy

List of available placeholders and resolve process:

  • {$competiorN} - replace the placeholder with the actual name of the competitor in position N within the sports event.
  • {$playerN} - replace the placeholder with the actual name of the player in position N within the sports event.
Example of resolving templates of competitor strategy

Suppose in a match play two competitors: NAVI and EHOME.
The template, which requires resolve: {$competitor1} will win in round.

Solution:
For this it is required to find a competitor on position 1 in sport event and change the appropriate placeholder {$competior1} to NAVI (in this scenario).
Thus next statements represent right placeholder replacement:
{$competitor1} will win in round → NAVI will win in round
{$competitor2} will win in round → EHOME will win in round

Tournament strategy

List of available placeholders and resolve process:

  • {$tournament} – replace the placeholder with the appropriate tournament name.
Example of resolving templates of tournament strategy

Suppose there is a tournament: The International.
The template, which requires resolve: In {$tournament} will win team.

Solution:
For this is required to replace placeholder with tournament name:
In {$tournament} will win team. → In The International will win team.

Team member nickname strategy

List of available placeholders and resolve process:

  • {$teamMemberNickname} – replace the placeholder corresponding nickname of team member within the sports event.
Example of resolving templates of team member nickname strategy

Suppose there is a team member with the nickname : Ame.
The template, which requires resolve: {$teamMemberNickname} will get rampage.

Solution:
For this is required to replace placeholder with nickname of team member:
{$teamMemberNickname} will get rampage. → Ame will get rampage.

Specifier strategy

To fill placeholders using a specified strategy, it is necessary to possess knowledge of market's specifiers, so based on this information, appropriate values can be selected.

List of available placeholder specifiers and resolve process:

  • {minute} – replace the placeholder with the respective minute interval utilizing the specifier "minute" .
  • {halfnr} – replace the placeholder with the respective half number for the sport event utilizing the specifier "halfnr".
  • {mapnr} – replace the placeholder with the respective map number for the sport event utilizing the specifier "mapnr".
  • {setnr} – replace the placeholder with the respective set number for the sport event utilizing the specifier "setnr".
  • {gamenr} – replace the placeholder with the respective game number for the sport event utilizing the specifier "gamenr".
  • {periodnr} – replace the placeholder with the respective period number for the sport event event utilizing the specifier "periodnr".
  • {quarternr} – replace the placeholder with the respective quarter number for the sport event utilizing the specifier "quarternr".
  • {goalnr} – replace the placeholder with the respective number of goal for the sport event utilizing the specifier "goalnr".
  • {inningnr} – replace the placeholder with the respective inning number for the sport event utilizing the specifier "inningnr".
  • {overtimenr} - replace the placeholder with the respective overtime number for the sport event utilizing the specifier ”overtimenr".
  • {killnr} - replace the placeholder with the respective kills number for the sport event utilizing the specifier "killnr".
  • {pointnr} - replace the placeholder with the respective points number for the sport event utilizing the specifier "pointnr".
  • {hcp} - replace the placeholder with the respective handicap for the sport event utilizing the specifier "hcp".
  • {top} - replace the placeholder with the respective "top" value for the concrete sport event utilizing the specifier "top".
  • {xth} - replace the placeholder with the respective xth value for the sport event utilizing the specifier "xth".
  • {score} - replace the placeholder with the respective current score value for the sport event utilizing the specifier "score".
Example of resolving templates of team member nickname strategy

Suppose in match play two competitors: NAVI and EHOME in BO5 format (so there can be 5 maps in their game).
The template, which requires resolve for 2nd map of game: {!mapnr} map winner

Solution:
For this is required to replace placeholder with map number 2 which is determined in market's specifier value "mapnr".
And also as there`s special symbol "!" in placeholder, it's required to use grammatical correctness.
In this case, it is necessary to interpret the numeric value "2" as an ordinal numeral "second, so the outcome should be presented in the form of "2nd" to accurately convey its ordinal representation.
{!mapnr} map winner → 2nd map winner

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
...
  "markets": {
     "351m2t56_5": {
      "id": "351m2t56_5",
      "template": "{!mapnr} map winner",
      "specifiers": {
        "mapnr": "2",
        "total": "2.5"
      }
      "odds": {
        "1": {
          "id": "1",
          "value": "1.920000000000",
          "status": 0,
          "template": "{$competitor1}",
          "is_active": true
        },
        "2": {
          "id": "2",
          "value": "1.840000000000",
          "status": 0,
          "template": "{$competitor2}",
          "is_active": true
        }
      },
      "status": 0,
      "type_id": 14,
    }
  }
  ...