overtime-live-trading-utils 4.0.0-rc.2 → 4.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.js +1 -1
- package/package.json +1 -1
- package/src/types/sports.ts +1 -0
- package/src/utils/odds.ts +4 -9
package/package.json
CHANGED
package/src/types/sports.ts
CHANGED
package/src/utils/odds.ts
CHANGED
|
@@ -474,12 +474,12 @@ export const groupAndFormatTotalOdds = (oddsArray: any[], commonData: HomeAwayTe
|
|
|
474
474
|
|
|
475
475
|
// if we have away team in total odds we know the market is team total and we need to increase typeId by one.
|
|
476
476
|
// if this is false typeId is already mapped correctly
|
|
477
|
-
const
|
|
477
|
+
const shouldIncreaseTypeId = selection === commonData.awayTeam && !(value as any).playerProps;
|
|
478
478
|
if ((value as any).over !== null && (value as any).under !== null) {
|
|
479
479
|
acc.push({
|
|
480
480
|
line: line as any,
|
|
481
481
|
odds: [(value as any).over, (value as any).under],
|
|
482
|
-
typeId: !
|
|
482
|
+
typeId: !shouldIncreaseTypeId ? (value as any).typeId : Number((value as any).typeId) + 1,
|
|
483
483
|
sportId: (value as any).sportId,
|
|
484
484
|
type: (value as any).type,
|
|
485
485
|
playerProps: (value as any).playerProps,
|
|
@@ -943,13 +943,8 @@ export const adjustSpreadOnChildOdds = (
|
|
|
943
943
|
) => {
|
|
944
944
|
const result: any[] = [];
|
|
945
945
|
iterableGroupedOdds.forEach((data) => {
|
|
946
|
-
const
|
|
947
|
-
const
|
|
948
|
-
const awayTeamOdds = convertOddsToImpl(data.odds[1]) || ZERO;
|
|
949
|
-
const drawOdds = convertOddsToImpl(data.odds[2]) || ZERO;
|
|
950
|
-
const odds = hasDrawOdds ? [homeTeamOdds, awayTeamOdds, drawOdds] : [homeTeamOdds, awayTeamOdds];
|
|
951
|
-
|
|
952
|
-
const isZeroOddsChild = homeTeamOdds === ZERO || awayTeamOdds === ZERO || (hasDrawOdds && drawOdds === ZERO);
|
|
946
|
+
const odds = data.odds.map((odd: number) => convertOddsToImpl(odd) || ZERO);
|
|
947
|
+
const isZeroOddsChild = odds.includes(ZERO);
|
|
953
948
|
if (!isZeroOddsChild) {
|
|
954
949
|
const spreadData = getSpreadData(
|
|
955
950
|
spreadDataForSport,
|