Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live spread and total #1

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
eebacf5
spread & total types for live trading - WIP
dmikic Jul 30, 2024
5c500bd
Merge branch 'main' into live-spread-and-total
dmikic Jul 31, 2024
62ffe0b
Merge branch 'main' into live-spread-and-total
dmikic Aug 5, 2024
93fab1f
added logging
dmikic Aug 7, 2024
2d4a8e1
bug fix
dmikic Aug 7, 2024
ab94a1a
some todos added
dmikic Aug 28, 2024
161aa68
added logs
Gorshtak Sep 5, 2024
258e417
added some if and logs
Gorshtak Sep 5, 2024
536e42e
removed hardcoded moneyline
Gorshtak Sep 6, 2024
d95b3f2
fixed odds for moneylines
Gorshtak Sep 7, 2024
5953efe
fix odds
Gorshtak Sep 9, 2024
1a886a6
added more info to the child markets
Gorshtak Sep 12, 2024
529fdfd
exported creating spread child markets
Gorshtak Sep 16, 2024
1229040
package-lock updated
Gorshtak Sep 16, 2024
220334b
fix types
Gorshtak Sep 16, 2024
0927246
fixed types
Gorshtak Sep 17, 2024
df98371
pack child markets with all the fields needed
Gorshtak Sep 18, 2024
b03ab0a
removed console logs
Gorshtak Sep 18, 2024
2d76d26
fix zero odds error
Gorshtak Sep 18, 2024
fc54ee1
added type in response for childmarkets
Gorshtak Sep 18, 2024
28a8ee9
Removed unused import
Gorshtak Sep 22, 2024
c91bb5f
Merge branch 'main' into live-spread-and-total
Gorshtak Sep 25, 2024
bae66ad
new version
Gorshtak Sep 25, 2024
c2f2587
added names for spread and totals
Gorshtak Sep 26, 2024
7683883
published changes
Gorshtak Sep 26, 2024
0638d9c
added error messages to markets
Gorshtak Sep 26, 2024
fa12cc4
fixed imports
Gorshtak Sep 26, 2024
2785631
fix for draw odds on twopositionalsport
Gorshtak Sep 27, 2024
bfceb6f
added spread name for nfl
Gorshtak Sep 30, 2024
423005a
added conosle logs for odds
Gorshtak Sep 30, 2024
ac6bf0c
added turkish league
Gorshtak Sep 30, 2024
86af08f
added code for cutting high and low odds for child markets
Gorshtak Sep 30, 2024
5fc3eab
added todo and removed unused method
Gorshtak Oct 2, 2024
087b7d0
Merge branch 'main' into live-spread-and-total
Gorshtak Oct 2, 2024
af06b45
added enums from api to utils
Gorshtak Oct 3, 2024
20ce9bc
removed unused opticOdds constants
Gorshtak Oct 3, 2024
ea9a7ed
refactored getLeagueSpreadType and getLeagueTotalType
Gorshtak Oct 3, 2024
0634232
added contraints to export
Gorshtak Oct 3, 2024
19e23b2
fixed code for comparision bet types
Gorshtak Oct 3, 2024
cc1eaaf
refactored getting spread childs markets
Gorshtak Oct 3, 2024
e8de253
new version, renamed methods
Gorshtak Oct 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
//utils
export * from './src/utils/bookmakers';
export * from './src/utils/gameMatching';
export * from './src/utils/markets';
export * from './src/utils/odds';
export * from './src/utils/sports';
export * from './src/utils/spread';

// constants
export * from './src/constants/common';
export * from './src/constants/constantsOpticodds';
export * from './src/constants/sports';

export * from './src/enums/sports';
export * from './src/enums/statuses';
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "overtime-live-trading-utils",
"version": "0.1.12",
"version": "0.0.112",
"description": "",
"main": "main.js",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions src/constants/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const ZERO = 0;
export const DRAW = 'Draw';
export const LIVE_TYPE_ID_BASE = 100000;
export const MIN_ODDS_FOR_DIFF_CHECKING = 0.2;
export const TAG_CHILD_SPREAD = 10001;
export const TAG_CHILD_TOTALS = 10002;
export const MULTIPLIER_100 = 100;
155 changes: 155 additions & 0 deletions src/constants/constantsOpticodds.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
export const FIRST_HALF_ASIAN_HANDICAP = '1st Half Asian Handicap';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Group as enum.

export const FIRST_HALF_ASIAN_HANDICAP_CORNERS = '1st Half Asian Handicap Corners';
export const FIRST_HALF_BOTH_TEAMS_TO_SCORE = '1st Half Both Teams To Score';
export const FIRST_HALF_CORRECT_SCORE = '1st Half Correct Score';
export const FIRST_HALF_MONEYLINE = '1st Half Moneyline';
export const FIRST_HALF_TEAM_TOTAL = '1st Half Team Total';
export const FIRST_HALF_TEAM_TOTAL_EXACT = '1st Half Team Total Exact';
export const FIRST_HALF_TOTAL_CORNERS = '1st Half Total Corners';
export const FIRST_HALF_TOTAL_GOALS = '1st Half Total Goals';
export const FIRST_HALF_TOTAL_GOALS_ODD_EVEN = '1st Half Total Goals Odd/Even';
export const SECOND_HALF_ASIAN_HANDICAP_CORNERS = '2nd Half Asian Handicap Corners';
export const SECOND_HALF_BOTH_TEAMS_TO_SCORE = '2nd Half Both Teams To Score';
export const SECOND_HALF_MONEYLINE = '2nd Half Moneyline';
export const SECOND_HALF_TOTAL_CORNERS = '2nd Half Total Corners';
export const SECOND_HALF_TOTAL_GOALS = '2nd Half Total Goals';
export const SECOND_HALF_TOTAL_GOALS_ODD_EVEN = '2nd Half Total Goals Odd/Even';
export const ANYTIME_GOAL_SCORER = 'Anytime Goal Scorer';
export const ASIAN_HANDICAP = 'Asian Handicap';
export const ASIAN_HANDICAP_CARDS = 'Asian Handicap Cards';
export const ASIAN_HANDICAP_CORNERS = 'Asian Handicap Corners';
export const BOTH_TEAMS_TO_SCORE = 'Both Teams To Score';
export const CORRECT_SCORE = 'Correct Score';
export const DRAW_NO_BET = 'Draw No Bet';
export const FIRST_GOAL_SCORER = 'First Goal Scorer';
export const FIRST_TEAM_TO_SCORE_3_WAY = 'First Team To Score 3-Way';
export const LAST_GOAL_SCORER = 'Last Goal Scorer';
export const LAST_TEAM_TO_SCORE_3_WAY = 'Last Team To Score 3-Way';
export const MONEYLINE = 'Moneyline';
export const PLAYER_GOALS = 'Player Goals';
export const TEAM_CLEAN_SHEET = 'Team Clean Sheet';
export const TEAM_TOTAL = 'Team Total';
export const TEAM_TOTAL_CARD_POINTS = 'Team Total Card Points';
export const TEAM_TOTAL_CORNERS = 'Team Total Corners';
export const TEAM_TOTAL_ODD_EVEN = 'Team Total Odd/Even';
export const TOTAL_CARDS = 'Total Cards';
export const TOTAL_CORNERS = 'Total Corners';
export const TOTAL_CORNERS_ODD_EVEN = 'Total Corners Odd/Even';
export const TOTAL_GOALS = 'Total Goals';
export const TOTAL_GOALS_ODD_EVEN = 'Total Goals Odd/Even';
export const TO_QUALIFY = 'To Qualify';
export const HALFTIME_FULLTIME = 'Halftime / Fulltime';

export const FIRST_3_INNINGS_MONEYLINE = '1st 3 Innings Moneyline';
export const FIRST_3_INNINGS_RUN_LINE = '1st 3 Innings Run Line';
export const FIRST_3_INNINGS_TEAM_TOTAL = '1st 3 Innings Team Total';
export const FIRST_3_INNINGS_TOTAL_RUNS = '1st 3 Innings Total Runs';
export const FIRST_7_INNINGS_MONEYLINE = '1st 7 Innings Moneyline';
export const FIRST_7_INNINGS_RUN_LINE = '1st 7 Innings Run Line';
export const FIRST_7_INNINGS_TEAM_TOTAL = '1st 7 Innings Team Total';
export const FIRST_7_INNINGS_TOTAL_RUNS = '1st 7 Innings Total Runs';
export const FIRST_HALF_RUN_LINE = '1st Half Run Line';
export const FIRST_HALF_TOTAL_RUNS = '1st Half Total Runs';
export const FIRST_INNING_MONEYLINE_3_WAY = '1st Inning Moneyline 3-Way';
export const FIRST_INNING_RUN_LINE = '1st Inning Run Line';
export const FIRST_INNING_TOTAL_RUNS = '1st Inning Total Runs';
export const FIRST_INNING_TOTAL_RUNS_ODD_EVEN = '1st Inning Total Runs Odd/Even';
export const SECOND_INNING_MONEYLINE_3_WAY = '2nd Inning Moneyline 3-Way';
export const SECOND_INNING_RUN_LINE = '2nd Inning Run Line';
export const SECOND_INNING_TOTAL_RUNS = '2nd Inning Total Runs';
export const THIRD_INNING_MONEYLINE_3_WAY = '3rd Inning Moneyline 3-Way';
export const THIRD_INNING_RUN_LINE = '3rd Inning Run Line';
export const THIRD_INNING_TOTAL_RUNS = '3rd Inning Total Runs';
export const FOURTH_INNING_MONEYLINE_3_WAY = '4th Inning Moneyline 3-Way';
export const FOURTH_INNING_RUN_LINE = '4th Inning Run Line';
export const FOURTH_INNING_TOTAL_RUNS = '4th Inning Total Runs';
export const FIFTH_INNING_MONEYLINE_3_WAY = '5th Inning Moneyline 3-Way';
export const FIFTH_INNING_RUN_LINE = '5th Inning Run Line';
export const FIFTH_INNING_TOTAL_RUNS = '5th Inning Total Runs';
export const SIXTH_INNING_MONEYLINE_3_WAY = '6th Inning Moneyline 3-Way';
export const SIXTH_INNING_RUN_LINE = '6th Inning Run Line';
export const SIXTH_INNING_TOTAL_RUNS = '6th Inning Total Runs';
export const SEVENTH_INNING_MONEYLINE_3_WAY = '7th Inning Moneyline 3-Way';
export const SEVENTH_INNING_RUN_LINE = '7th Inning Run Line';
export const SEVENTH_INNING_TOTAL_RUNS = '7th Inning Total Runs';
export const EIGHTH_INNING_MONEYLINE_3_WAY = '8th Inning Moneyline 3-Way';
export const EIGHTH_INNING_RUN_LINE = '8th Inning Run Line';
export const EIGHTH_INNING_TOTAL_RUNS = '8th Inning Total Runs';
export const NINTH_INNING_MONEYLINE_3_WAY = '9th Inning Moneyline 3-Way';
export const NINTH_INNING_RUN_LINE = '9th Inning Run Line';
export const NINTH_INNING_TOTAL_RUNS = '9th Inning Total Runs';
export const FIRST_TEAM_TO_SCORE = 'First Team To Score';
export const NO_RUNS_FIRST_INNING = 'No Runs First Inning';
export const PLAYER_BASES = 'Player Bases';
export const PLAYER_BATTING_STRIKEOUTS = 'Player Batting Strikeouts';
export const PLAYER_BATTING_WALKS = 'Player Batting Walks';
export const PLAYER_DOUBLES = 'Player Doubles';
export const PLAYER_EARNED_RUNS = 'Player Earned Runs';
export const PLAYER_HITS = 'Player Hits';
export const PLAYER_HITS_RUNS_RBIS = 'Player Hits + Runs + RBIs';
export const PLAYER_HITS_ALLOWED = 'Player Hits Allowed';
export const PLAYER_HOME_RUNS = 'Player Home Runs';
export const PLAYER_HOME_RUNS_YES_NO = 'Player Home Runs Yes/No';
export const PLAYER_OUTS = 'Player Outs';
export const PLAYER_RBIS = 'Player RBIs';
export const PLAYER_RUNS = 'Player Runs';
export const PLAYER_SINGLES = 'Player Singles';
export const PLAYER_STOLEN_BASES = 'Player Stolen Bases';
export const PLAYER_STRIKEOUTS = 'Player Strikeouts';
export const PLAYER_TO_RECORD_WIN = 'Player To Record Win';
export const PLAYER_WALKS = 'Player Walks';
export const RUN_LINE = 'Run Line';
export const TOTAL_RUNS = 'Total Runs';
export const WILL_THERE_BE_OVERTIME = 'Will There Be Overtime';

export const FIRST_HALF_DOUBLE_CHANCE = '1st Half Double Chance';
export const FIRST_HALF_MONEYLINE_3_WAY = '1st Half Moneyline 3-Way';
export const FIRST_HALF_POINT_SPREAD = '1st Half Point Spread';
export const FIRST_HALF_RACE_TO_20_POINTS = '1st Half Race To 20 Points';
export const FIRST_HALF_RACE_TO_25_POINTS = '1st Half Race To 25 Points';
export const FIRST_HALF_RACE_TO_30_POINTS = '1st Half Race To 30 Points';
export const FIRST_HALF_RACE_TO_35_POINTS = '1st Half Race To 35 Points';
export const FIRST_HALF_RACE_TO_40_POINTS = '1st Half Race To 40 Points';
export const FIRST_HALF_RACE_TO_45_POINTS = '1st Half Race To 45 Points';
export const FIRST_HALF_RACE_TO_50_POINTS = '1st Half Race To 50 Points';
export const FIRST_HALF_RACE_TO_55_POINTS = '1st Half Race To 55 Points';
export const FIRST_HALF_RACE_TO_60_POINTS = '1st Half Race To 60 Points';
export const FIRST_HALF_TOTAL_POINTS = '1st Half Total Points';
export const FIRST_HALF_TOTAL_POINTS_ODD_EVEN = '1st Half Total Points Odd/Even';
export const FIRST_QUARTER_DOUBLE_CHANCE = '1st Quarter Double Chance';
export const FIRST_QUARTER_MONEYLINE = '1st Quarter Moneyline';
export const FIRST_QUARTER_MONEYLINE_3_WAY = '1st Quarter Moneyline 3-Way';
export const FIRST_QUARTER_POINT_SPREAD = '1st Quarter Point Spread';
export const FIRST_QUARTER_RACE_TO_10_POINTS = '1st Quarter Race To 10 Points';
export const FIRST_QUARTER_RACE_TO_15_POINTS = '1st Quarter Race To 15 Points';
export const FIRST_QUARTER_RACE_TO_20_POINTS = '1st Quarter Race To 20 Points';
export const FIRST_QUARTER_TEAM_TOTAL = '1st Quarter Team Total';
export const FIRST_QUARTER_TOTAL_POINTS = '1st Quarter Total Points';
export const FIRST_QUARTER_TOTAL_POINTS_ODD_EVEN = '1st Quarter Total Points Odd/Even';
export const FIRST_BASKET_INCLUDING_FT = 'First Basket Including FT';
export const PLAYER_ASSISTS = 'Player Assists';
export const PLAYER_DOUBLE_DOUBLE = 'Player Double Double';
export const PLAYER_MADE_THREES = 'Player Made Threes';
export const PLAYER_POINTS = 'Player Points';
export const PLAYER_POINTS_REBOUNDS_ASSISTS = 'Player Points + Rebounds + Assists';
export const PLAYER_REBOUNDS = 'Player Rebounds';
export const POINT_SPREAD = 'Point Spread';
export const RACE_TO_20_POINTS = 'Race To 20 Points';
export const TEAM_TOTAL_POINTS_ODD_EVEN = 'Team Total Points Odd/Even';
export const TOTAL_POINTS = 'Total Points';
export const TOTAL_POINTS_ODD_EVEN = 'Total Points Odd/Even';

export const GO_THE_DISTANCE = 'Go The Distance';
export const METHOD_OF_VICTORY = 'Method of Victory';
export const PLAYER_SIGNIFICANT_STRIKES = 'Player Significant Strikes';
export const PLAYER_TAKEDOWNS = 'Player Takedowns';
export const ROUND_BETTING = 'Round Betting';
export const TOTAL_ROUNDS = 'Total Rounds';
export const METHOD_OF_ENDING = 'Method Of Ending';
export const MONEYLINE_TOTAL_ROUNDS = 'Moneyline + Total Rounds';
export const WILL_A_POINT_BE_DEDUCTED = 'Will A Point Be Deducted';
export const WILL_FIGHT_END_IN_FIRST_MINUTE = 'Will Fight End In First Minute';
export const WINNING_ROUND = 'Winning Round';

export const TOTAL_GAMES = 'Total Games';
export const GAME_SPREAD = 'Game Spread';
Loading