overtime-live-trading-utils 4.0.2 → 4.0.3-rc.0
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/tests/mock/MockLeagueMap.ts +16 -0
- package/src/tests/mock/OpticOddsMock/MockNBAPlayerPropsAdjustment.ts +476 -0
- package/src/tests/mock/OpticOddsMock/MockRedisNbaPlayerPropsAdjustment.ts +22 -0
- package/src/tests/unit/bookmakers.test.ts +173 -10
- package/src/tests/unit/markets.test.ts +17 -24
- package/src/tests/unit/odds.test.ts +9 -12
- package/src/tests/unit/spread.test.ts +11 -13
- package/src/tests/utils/helper.ts +10 -3
- package/src/utils/bookmakers.ts +31 -1
- package/src/utils/markets.ts +4 -2
- package/src/utils/odds.ts +8 -5
- package/webpack.config.js +2 -0
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
|
|
355
|
-
if (playerId &&
|
|
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}`;
|
package/webpack.config.js
CHANGED