overtime-live-trading-utils 4.0.3 → 4.0.4

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/src/utils/odds.ts CHANGED
@@ -198,7 +198,8 @@ export const createChildMarkets: (
198
198
  lastPolledData: LastPolledArray,
199
199
  maxAllowedProviderDataStaleDelay: number,
200
200
  anchors: Anchor[],
201
- playersMap: Map<string, number>
201
+ playersMap: Map<string, number>,
202
+ maxPercentageDiffForPPLines: number
202
203
  ) => ChildMarket[] = (
203
204
  apiResponseWithOdds,
204
205
  leagueId,
@@ -207,7 +208,8 @@ export const createChildMarkets: (
207
208
  lastPolledData,
208
209
  maxAllowedProviderDataStaleDelay,
209
210
  anchors,
210
- playersMap
211
+ playersMap,
212
+ maxPercentageDiffForPPLines
211
213
  ) => {
212
214
  const [spreadOdds, totalOdds, moneylineOdds, correctScoreOdds, doubleChanceOdds, ggOdds, childMarkets]: any[] = [
213
215
  [],
@@ -232,7 +234,8 @@ export const createChildMarkets: (
232
234
  liveOddsProviders,
233
235
  lastPolledData,
234
236
  maxAllowedProviderDataStaleDelay,
235
- anchors
237
+ anchors,
238
+ maxPercentageDiffForPPLines
236
239
  );
237
240
  checkedChildOdds.forEach((odd) => {
238
241
  if (odd.type === 'Total') {
@@ -351,8 +354,8 @@ export const filterOdds = (oddsArray: Odds, leagueInfos: LeagueConfigInfo[], pla
351
354
  .map((leagueInfo) => leagueInfo.marketName.toLowerCase());
352
355
  return oddsArray.reduce((acc: any, odd: any) => {
353
356
  if (allChildMarketsTypes.includes(odd.marketName.toLowerCase())) {
354
- const { points, marketName, selection, selectionLine, sportsBookName, playerId, isMain } = odd;
355
- if (playerId && (!playersMap.has(playerId) || !isMain)) {
357
+ const { points, marketName, selection, selectionLine, sportsBookName, playerId } = odd;
358
+ if (playerId && !playersMap.has(playerId)) {
356
359
  return acc;
357
360
  }
358
361
  const key = `${sportsBookName.toLowerCase()}_${marketName.toLowerCase()}_${points}_${selection}_${selectionLine}`;