overtime-live-trading-utils 0.0.77 → 0.0.79
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/package.json +1 -1
- package/src/utils/odds.ts +5 -5
package/package.json
CHANGED
package/src/utils/odds.ts
CHANGED
|
@@ -394,7 +394,7 @@ export const formatSpreadOdds = (
|
|
|
394
394
|
*/
|
|
395
395
|
export const groupAndFormatSpreadOdds = (oddsArray, commonData) => {
|
|
396
396
|
// Group odds by their selection points and selection
|
|
397
|
-
const groupedOdds = oddsArray.reduce((acc, odd) => {
|
|
397
|
+
const groupedOdds = oddsArray.reduce((acc: any, odd: any) => {
|
|
398
398
|
const { selection_points, price, selection } = odd;
|
|
399
399
|
const isHomeTeam = selection === commonData.homeTeam;
|
|
400
400
|
|
|
@@ -411,13 +411,13 @@ export const groupAndFormatSpreadOdds = (oddsArray, commonData) => {
|
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
return acc;
|
|
414
|
-
}, {});
|
|
414
|
+
}, {}) as any;
|
|
415
415
|
// Format the grouped odds into the desired output
|
|
416
|
-
const formattedOdds = Object.entries(groupedOdds).reduce((acc, [key, value]) => {
|
|
416
|
+
const formattedOdds = Object.entries(groupedOdds as any).reduce((acc, [key, value]) => {
|
|
417
417
|
const line = parseFloat(key);
|
|
418
418
|
if ((value as any).home !== null && (value as any).away !== null) {
|
|
419
419
|
acc.push({
|
|
420
|
-
line,
|
|
420
|
+
line: line as any,
|
|
421
421
|
odds: [(value as any).home, (value as any).away],
|
|
422
422
|
});
|
|
423
423
|
}
|
|
@@ -453,7 +453,7 @@ export const cutOddsCloseToValue = (oddsArray, threshold = 0.952) => {
|
|
|
453
453
|
* @returns {Array} The processed total odds market objects.
|
|
454
454
|
*/
|
|
455
455
|
export const processTotalOdds = (totalOdds, leagueId, spreadDataForSport, typeId, defaultSpreadForLiveMarkets) => {
|
|
456
|
-
const childMarkets = [];
|
|
456
|
+
const childMarkets = [] as any;
|
|
457
457
|
const validTotalOdds = totalOdds.filter((odd) => odd && Math.abs(odd.selection_points % 1) === 0.5);
|
|
458
458
|
const groupedOdds = groupOddsBySelectionAndPoints(validTotalOdds);
|
|
459
459
|
const iterableGroupedOdds = Object.entries(groupedOdds) as any;
|