overtime-live-trading-utils 4.0.0-rc.8 → 4.0.0-rc.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overtime-live-trading-utils",
3
- "version": "4.0.0-rc.8",
3
+ "version": "4.0.0-rc.9",
4
4
  "description": "",
5
5
  "main": "main.js",
6
6
  "scripts": {
package/src/utils/odds.ts CHANGED
@@ -291,12 +291,10 @@ export const createChildMarkets: (
291
291
  const maxOdds = leagueInfoByTypeId?.maxOdds; // maximum odds configured for child market (e.g. 0.05 implied probability)
292
292
 
293
293
  if (minOdds && maxOdds) {
294
- let conditionToAddChildMarket = true;
295
- data.odds.forEach((odd: number) => {
296
- if (odd >= minOdds || odd <= maxOdds) {
297
- conditionToAddChildMarket = false;
298
- }
299
- });
294
+ const conditionToAddChildMarket =
295
+ data.type === 'Total'
296
+ ? data.odds.some((odd: number) => odd < minOdds && odd > maxOdds)
297
+ : data.odds.every((odd: number) => odd < minOdds && odd > maxOdds);
300
298
  if (conditionToAddChildMarket) {
301
299
  childMarkets.push(childMarket);
302
300
  }