@agg-build/ui 4.22.2 → 4.22.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.
@@ -21,7 +21,7 @@ import {
21
21
  parseRawMicroValue,
22
22
  selectOpenLimitOrders,
23
23
  useOpenOrderCancellation
24
- } from "./chunk-NDD5IHAU.mjs";
24
+ } from "./chunk-WAGNSZQ6.mjs";
25
25
  import {
26
26
  DEPOSIT_MODAL_OPEN_EVENT,
27
27
  WITHDRAW_MODAL_OPEN_EVENT,
@@ -266,7 +266,7 @@ var useHomePageModals = () => {
266
266
  // src/pages/home/index.tsx
267
267
  import { jsx, jsxs } from "react/jsx-runtime";
268
268
  var DeferredEventMarketPage = lazy(
269
- () => import("./event-market-F2FPSTAB.mjs").then((module) => ({ default: module.EventMarketPage }))
269
+ () => import("./event-market-CEOSCKEG.mjs").then((module) => ({ default: module.EventMarketPage }))
270
270
  );
271
271
  var MIN_SEARCH_LENGTH = 3;
272
272
  var SEARCH_DEBOUNCE_MS = 300;
@@ -1918,6 +1918,7 @@ var resolveDistanceFromEvenMoney = (market, prices) => {
1918
1918
  const price = market.venueMarketOutcomes.map((outcome) => prices == null ? void 0 : prices.get(outcome.id)).find((value) => value != null);
1919
1919
  return price == null ? Number.POSITIVE_INFINITY : Math.abs(price - 0.5);
1920
1920
  };
1921
+ var MAIN_LINE_PRICE_BAND = 0.2;
1921
1922
  var buildSportsSlideFromGroup = (group, prices) => {
1922
1923
  const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets, group.sportsMarketType === "spread") : [];
1923
1924
  const hasLadder = lineStops.length > 1;
@@ -1929,13 +1930,21 @@ var buildSportsSlideFromGroup = (group, prices) => {
1929
1930
  const evenMoneyDistances = lineStops.map(
1930
1931
  (lineStop) => resolveDistanceFromEvenMoney(lineStop.representative, prices)
1931
1932
  );
1932
- const defaultStopIndex = hasLadder ? lineStops.reduce((bestIndex, lineStop, index) => {
1933
- const best = lineStops[bestIndex];
1934
- if (lineStop.volume !== best.volume) {
1935
- return lineStop.volume > best.volume ? index : bestIndex;
1936
- }
1937
- return evenMoneyDistances[index] < evenMoneyDistances[bestIndex] ? index : bestIndex;
1938
- }, 0) : 0;
1933
+ const isBetter = (index, bestIndex) => {
1934
+ const distance = evenMoneyDistances[index];
1935
+ const bestDistance = evenMoneyDistances[bestIndex];
1936
+ const inBand = distance <= MAIN_LINE_PRICE_BAND;
1937
+ const bestInBand = bestDistance <= MAIN_LINE_PRICE_BAND;
1938
+ if (inBand !== bestInBand) return inBand;
1939
+ const volume = lineStops[index].volume;
1940
+ const bestVolume = lineStops[bestIndex].volume;
1941
+ if (inBand) return volume !== bestVolume ? volume > bestVolume : distance < bestDistance;
1942
+ return distance !== bestDistance ? distance < bestDistance : volume > bestVolume;
1943
+ };
1944
+ const defaultStopIndex = hasLadder ? lineStops.reduce(
1945
+ (bestIndex, _lineStop, index) => isBetter(index, bestIndex) ? index : bestIndex,
1946
+ 0
1947
+ ) : 0;
1939
1948
  return {
1940
1949
  id: group.id,
1941
1950
  kind: resolveSlideKind(group),
@@ -6,7 +6,7 @@ import {
6
6
  EventOpenOrdersCard,
7
7
  formatRecurringCountdown,
8
8
  useEventOpenOrders
9
- } from "./chunk-NDD5IHAU.mjs";
9
+ } from "./chunk-WAGNSZQ6.mjs";
10
10
  import "./chunk-LTFRGJPL.mjs";
11
11
  import "./chunk-NV6WT3TN.mjs";
12
12
  import "./chunk-WOCZ4TVT.mjs";
package/dist/index.js CHANGED
@@ -31954,7 +31954,7 @@ var init_event_market_shared = __esm({
31954
31954
  });
31955
31955
 
31956
31956
  // src/pages/event-market/sports-event-market.utils.ts
31957
- var SPORTS_MARKET_TYPE_KEYS, SPORTS_PERIOD_KEYS, SPORTS_PERIOD_GRAMMAR_PATTERN, SPORTS_MARKET_CATEGORY_KEYS, SPORTS_MARKET_GROUP_KEYS, SPORTS_PERIOD_KEY_SET, SPORTS_MARKET_TYPE_KEY_SET, SPORTS_MARKET_CATEGORY_KEY_SET, SPORTS_MARKET_GROUP_KEY_SET, SPORTS_LEGACY_PROP_CATEGORY_KEY_SET, SPORTS_GAME_LINE_GROUPS, SPORTS_GENERIC_STAT, ESPORTS_CATEGORY_TOKENS, ESPORTS_TITLE_PATTERN, SERIES_SCOPE_PATTERN, SPORTS_PERIOD_ORDER, FIRST_N_INNINGS_PATTERN, SPORTS_MARKET_TYPE_ORDER, YES_NO_LABELS, LINE_MARKET_TYPES, PLAYER_PROP_COUNT_PATTERN, REG_TIME_TITLE_PATTERN, toTrimmedString, resolveSportsMarketAggKey, sanitizeFamilyValue, stripLineValueFromQuestion, SPORTS_PERIOD_FAMILY_ORDER, getSportsPeriodOrderIndex, getSportsMarketTypeOrderIndex, resolveSportsPeriodFamily, normalizeSportsPeriod, normalizeSportsMarketType, normalizeSportsMarketCategory, normalizeSportsMarketGroup, resolveFallbackSportsMarketCategory, resolveSportsStatToken, resolveMarketSectionTabKey, SPORTS_PERIOD_FAMILY_ALLOWED_SPORTS, PERIOD_N_FAMILY_PATTERN, isPeriodFamilyAllowedForSport, resolveEffectiveMarketSectionTabKey, resolveVisibleSportsSectionTabs, resolveSportsSectionFilters, hasTeamTitledOutcomes, isClusterRelation, isDecomposedLeg, singleEnumeratesLegs, dropDecomposedLegsMergedIntoSingle, resolveSportsSectionMarkets, resolveSportsMarketCardVariant, isBinarySportsMoneylineMarket, AGGKEY_LINE_TOKEN_PATTERN, resolveSportsLineFamilyKey, resolveSpreadFamilyKey, SPREAD_KEY_LEG_PATTERN, resolveSpreadKeyLeg, isSpreadUnderdogLeg, resolveSpreadAnchorToken, SPREAD_NON_TEAM_TITLE_PATTERN, isSpreadTeamTitle, resolveSpreadOutcomeTeamNames, resolveCombinedMoneylineLegLabel, normalizeSportsSubtypeToken, SPORTS_LEG_GROUPABLE_GROUPS, DRAW_OUTCOME_TITLE_PATTERN, isThreeWayMoneylineHub, resolveDisplayGroupFamilyKey, resolveMarketOwnCardKey, LEG_GROUP_KEY_MARKER, TOTAL_STAT_UNITS, resolveTotalStatUnit, SPORTS_LEG_TITLE_OVERRIDES, SPORTS_LEG_TITLE_SMALL_WORDS, formatSportsLegTitle, resolveDisplayGroupTitle, sortMarketsByLineValue, buildSportsMarketDisplayGroups, groupSportsMarketsByPeriod, resolveSelectedSportsLineValue, collectVenueNames, resolveTotalGroupVolume, resolveSportsExpandedMarkets, resolveSportsExpandedMarketsVolume, resolveHighestVolumeIndex, resolveSportsCombinedLegs, resolveSlideKind, aggregateSportsLineStops, escapeRegExp, resolveSportsLadderTitle, resolveDistanceFromEvenMoney, buildSportsSlideFromGroup, formatSportsPeriodGrammarLabel, resolveSportsCategoryTokens, isNonStandardSportsLikeEvent, mergeSportsSectionMarketsIntoEvent;
31957
+ var SPORTS_MARKET_TYPE_KEYS, SPORTS_PERIOD_KEYS, SPORTS_PERIOD_GRAMMAR_PATTERN, SPORTS_MARKET_CATEGORY_KEYS, SPORTS_MARKET_GROUP_KEYS, SPORTS_PERIOD_KEY_SET, SPORTS_MARKET_TYPE_KEY_SET, SPORTS_MARKET_CATEGORY_KEY_SET, SPORTS_MARKET_GROUP_KEY_SET, SPORTS_LEGACY_PROP_CATEGORY_KEY_SET, SPORTS_GAME_LINE_GROUPS, SPORTS_GENERIC_STAT, ESPORTS_CATEGORY_TOKENS, ESPORTS_TITLE_PATTERN, SERIES_SCOPE_PATTERN, SPORTS_PERIOD_ORDER, FIRST_N_INNINGS_PATTERN, SPORTS_MARKET_TYPE_ORDER, YES_NO_LABELS, LINE_MARKET_TYPES, PLAYER_PROP_COUNT_PATTERN, REG_TIME_TITLE_PATTERN, toTrimmedString, resolveSportsMarketAggKey, sanitizeFamilyValue, stripLineValueFromQuestion, SPORTS_PERIOD_FAMILY_ORDER, getSportsPeriodOrderIndex, getSportsMarketTypeOrderIndex, resolveSportsPeriodFamily, normalizeSportsPeriod, normalizeSportsMarketType, normalizeSportsMarketCategory, normalizeSportsMarketGroup, resolveFallbackSportsMarketCategory, resolveSportsStatToken, resolveMarketSectionTabKey, SPORTS_PERIOD_FAMILY_ALLOWED_SPORTS, PERIOD_N_FAMILY_PATTERN, isPeriodFamilyAllowedForSport, resolveEffectiveMarketSectionTabKey, resolveVisibleSportsSectionTabs, resolveSportsSectionFilters, hasTeamTitledOutcomes, isClusterRelation, isDecomposedLeg, singleEnumeratesLegs, dropDecomposedLegsMergedIntoSingle, resolveSportsSectionMarkets, resolveSportsMarketCardVariant, isBinarySportsMoneylineMarket, AGGKEY_LINE_TOKEN_PATTERN, resolveSportsLineFamilyKey, resolveSpreadFamilyKey, SPREAD_KEY_LEG_PATTERN, resolveSpreadKeyLeg, isSpreadUnderdogLeg, resolveSpreadAnchorToken, SPREAD_NON_TEAM_TITLE_PATTERN, isSpreadTeamTitle, resolveSpreadOutcomeTeamNames, resolveCombinedMoneylineLegLabel, normalizeSportsSubtypeToken, SPORTS_LEG_GROUPABLE_GROUPS, DRAW_OUTCOME_TITLE_PATTERN, isThreeWayMoneylineHub, resolveDisplayGroupFamilyKey, resolveMarketOwnCardKey, LEG_GROUP_KEY_MARKER, TOTAL_STAT_UNITS, resolveTotalStatUnit, SPORTS_LEG_TITLE_OVERRIDES, SPORTS_LEG_TITLE_SMALL_WORDS, formatSportsLegTitle, resolveDisplayGroupTitle, sortMarketsByLineValue, buildSportsMarketDisplayGroups, groupSportsMarketsByPeriod, resolveSelectedSportsLineValue, collectVenueNames, resolveTotalGroupVolume, resolveSportsExpandedMarkets, resolveSportsExpandedMarketsVolume, resolveHighestVolumeIndex, resolveSportsCombinedLegs, resolveSlideKind, aggregateSportsLineStops, escapeRegExp, resolveSportsLadderTitle, resolveDistanceFromEvenMoney, MAIN_LINE_PRICE_BAND, buildSportsSlideFromGroup, formatSportsPeriodGrammarLabel, resolveSportsCategoryTokens, isNonStandardSportsLikeEvent, mergeSportsSectionMarketsIntoEvent;
31958
31958
  var init_sports_event_market_utils = __esm({
31959
31959
  "src/pages/event-market/sports-event-market.utils.ts"() {
31960
31960
  "use strict";
@@ -32915,6 +32915,7 @@ var init_sports_event_market_utils = __esm({
32915
32915
  const price = market.venueMarketOutcomes.map((outcome) => prices == null ? void 0 : prices.get(outcome.id)).find((value) => value != null);
32916
32916
  return price == null ? Number.POSITIVE_INFINITY : Math.abs(price - 0.5);
32917
32917
  };
32918
+ MAIN_LINE_PRICE_BAND = 0.2;
32918
32919
  buildSportsSlideFromGroup = (group, prices) => {
32919
32920
  const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets, group.sportsMarketType === "spread") : [];
32920
32921
  const hasLadder = lineStops.length > 1;
@@ -32926,13 +32927,21 @@ var init_sports_event_market_utils = __esm({
32926
32927
  const evenMoneyDistances = lineStops.map(
32927
32928
  (lineStop) => resolveDistanceFromEvenMoney(lineStop.representative, prices)
32928
32929
  );
32929
- const defaultStopIndex = hasLadder ? lineStops.reduce((bestIndex, lineStop, index) => {
32930
- const best = lineStops[bestIndex];
32931
- if (lineStop.volume !== best.volume) {
32932
- return lineStop.volume > best.volume ? index : bestIndex;
32933
- }
32934
- return evenMoneyDistances[index] < evenMoneyDistances[bestIndex] ? index : bestIndex;
32935
- }, 0) : 0;
32930
+ const isBetter = (index, bestIndex) => {
32931
+ const distance = evenMoneyDistances[index];
32932
+ const bestDistance = evenMoneyDistances[bestIndex];
32933
+ const inBand = distance <= MAIN_LINE_PRICE_BAND;
32934
+ const bestInBand = bestDistance <= MAIN_LINE_PRICE_BAND;
32935
+ if (inBand !== bestInBand) return inBand;
32936
+ const volume = lineStops[index].volume;
32937
+ const bestVolume = lineStops[bestIndex].volume;
32938
+ if (inBand) return volume !== bestVolume ? volume > bestVolume : distance < bestDistance;
32939
+ return distance !== bestDistance ? distance < bestDistance : volume > bestVolume;
32940
+ };
32941
+ const defaultStopIndex = hasLadder ? lineStops.reduce(
32942
+ (bestIndex, _lineStop, index) => isBetter(index, bestIndex) ? index : bestIndex,
32943
+ 0
32944
+ ) : 0;
32936
32945
  return {
32937
32946
  id: group.id,
32938
32947
  kind: resolveSlideKind(group),
package/dist/index.mjs CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  buildAggTxExplorerHref,
17
17
  formatShareAmount,
18
18
  useHomePageModals
19
- } from "./chunk-4IO5CRSG.mjs";
19
+ } from "./chunk-3DQGXJ7P.mjs";
20
20
  import {
21
21
  EventList,
22
22
  EventListItem,
@@ -40,7 +40,7 @@ import {
40
40
  EventOpenOrdersCard,
41
41
  formatRecurringCountdown,
42
42
  useEventOpenOrders
43
- } from "./chunk-NDD5IHAU.mjs";
43
+ } from "./chunk-WAGNSZQ6.mjs";
44
44
  import {
45
45
  EventListItemDetails,
46
46
  MarketDetails,
package/dist/pages.js CHANGED
@@ -31229,7 +31229,7 @@ var init_event_market_shared = __esm({
31229
31229
  });
31230
31230
 
31231
31231
  // src/pages/event-market/sports-event-market.utils.ts
31232
- var SPORTS_MARKET_TYPE_KEYS, SPORTS_PERIOD_KEYS, SPORTS_PERIOD_GRAMMAR_PATTERN, SPORTS_MARKET_CATEGORY_KEYS, SPORTS_MARKET_GROUP_KEYS, SPORTS_PERIOD_KEY_SET, SPORTS_MARKET_TYPE_KEY_SET, SPORTS_MARKET_CATEGORY_KEY_SET, SPORTS_MARKET_GROUP_KEY_SET, SPORTS_LEGACY_PROP_CATEGORY_KEY_SET, SPORTS_GAME_LINE_GROUPS, SPORTS_GENERIC_STAT, ESPORTS_CATEGORY_TOKENS, ESPORTS_TITLE_PATTERN, SERIES_SCOPE_PATTERN, SPORTS_PERIOD_ORDER, FIRST_N_INNINGS_PATTERN, SPORTS_MARKET_TYPE_ORDER, YES_NO_LABELS, LINE_MARKET_TYPES, PLAYER_PROP_COUNT_PATTERN, REG_TIME_TITLE_PATTERN, toTrimmedString, resolveSportsMarketAggKey, sanitizeFamilyValue, stripLineValueFromQuestion, SPORTS_PERIOD_FAMILY_ORDER, getSportsPeriodOrderIndex, getSportsMarketTypeOrderIndex, resolveSportsPeriodFamily, normalizeSportsPeriod, normalizeSportsMarketType, normalizeSportsMarketCategory, normalizeSportsMarketGroup, resolveFallbackSportsMarketCategory, resolveSportsStatToken, resolveMarketSectionTabKey, SPORTS_PERIOD_FAMILY_ALLOWED_SPORTS, PERIOD_N_FAMILY_PATTERN, isPeriodFamilyAllowedForSport, resolveEffectiveMarketSectionTabKey, resolveVisibleSportsSectionTabs, resolveSportsSectionFilters, hasTeamTitledOutcomes, isClusterRelation, isDecomposedLeg, singleEnumeratesLegs, dropDecomposedLegsMergedIntoSingle, resolveSportsSectionMarkets, resolveSportsMarketCardVariant, isBinarySportsMoneylineMarket, AGGKEY_LINE_TOKEN_PATTERN, resolveSportsLineFamilyKey, resolveSpreadFamilyKey, SPREAD_KEY_LEG_PATTERN, resolveSpreadKeyLeg, isSpreadUnderdogLeg, resolveSpreadAnchorToken, SPREAD_NON_TEAM_TITLE_PATTERN, isSpreadTeamTitle, resolveSpreadOutcomeTeamNames, resolveCombinedMoneylineLegLabel, normalizeSportsSubtypeToken, SPORTS_LEG_GROUPABLE_GROUPS, DRAW_OUTCOME_TITLE_PATTERN, isThreeWayMoneylineHub, resolveDisplayGroupFamilyKey, resolveMarketOwnCardKey, LEG_GROUP_KEY_MARKER, TOTAL_STAT_UNITS, resolveTotalStatUnit, SPORTS_LEG_TITLE_OVERRIDES, SPORTS_LEG_TITLE_SMALL_WORDS, formatSportsLegTitle, resolveDisplayGroupTitle, sortMarketsByLineValue, buildSportsMarketDisplayGroups, groupSportsMarketsByPeriod, resolveSelectedSportsLineValue, collectVenueNames, resolveTotalGroupVolume, resolveSportsExpandedMarkets, resolveSportsExpandedMarketsVolume, resolveHighestVolumeIndex, resolveSportsCombinedLegs, resolveSlideKind, aggregateSportsLineStops, escapeRegExp, resolveSportsLadderTitle, resolveDistanceFromEvenMoney, buildSportsSlideFromGroup, formatSportsPeriodGrammarLabel, resolveSportsCategoryTokens, isNonStandardSportsLikeEvent, mergeSportsSectionMarketsIntoEvent;
31232
+ var SPORTS_MARKET_TYPE_KEYS, SPORTS_PERIOD_KEYS, SPORTS_PERIOD_GRAMMAR_PATTERN, SPORTS_MARKET_CATEGORY_KEYS, SPORTS_MARKET_GROUP_KEYS, SPORTS_PERIOD_KEY_SET, SPORTS_MARKET_TYPE_KEY_SET, SPORTS_MARKET_CATEGORY_KEY_SET, SPORTS_MARKET_GROUP_KEY_SET, SPORTS_LEGACY_PROP_CATEGORY_KEY_SET, SPORTS_GAME_LINE_GROUPS, SPORTS_GENERIC_STAT, ESPORTS_CATEGORY_TOKENS, ESPORTS_TITLE_PATTERN, SERIES_SCOPE_PATTERN, SPORTS_PERIOD_ORDER, FIRST_N_INNINGS_PATTERN, SPORTS_MARKET_TYPE_ORDER, YES_NO_LABELS, LINE_MARKET_TYPES, PLAYER_PROP_COUNT_PATTERN, REG_TIME_TITLE_PATTERN, toTrimmedString, resolveSportsMarketAggKey, sanitizeFamilyValue, stripLineValueFromQuestion, SPORTS_PERIOD_FAMILY_ORDER, getSportsPeriodOrderIndex, getSportsMarketTypeOrderIndex, resolveSportsPeriodFamily, normalizeSportsPeriod, normalizeSportsMarketType, normalizeSportsMarketCategory, normalizeSportsMarketGroup, resolveFallbackSportsMarketCategory, resolveSportsStatToken, resolveMarketSectionTabKey, SPORTS_PERIOD_FAMILY_ALLOWED_SPORTS, PERIOD_N_FAMILY_PATTERN, isPeriodFamilyAllowedForSport, resolveEffectiveMarketSectionTabKey, resolveVisibleSportsSectionTabs, resolveSportsSectionFilters, hasTeamTitledOutcomes, isClusterRelation, isDecomposedLeg, singleEnumeratesLegs, dropDecomposedLegsMergedIntoSingle, resolveSportsSectionMarkets, resolveSportsMarketCardVariant, isBinarySportsMoneylineMarket, AGGKEY_LINE_TOKEN_PATTERN, resolveSportsLineFamilyKey, resolveSpreadFamilyKey, SPREAD_KEY_LEG_PATTERN, resolveSpreadKeyLeg, isSpreadUnderdogLeg, resolveSpreadAnchorToken, SPREAD_NON_TEAM_TITLE_PATTERN, isSpreadTeamTitle, resolveSpreadOutcomeTeamNames, resolveCombinedMoneylineLegLabel, normalizeSportsSubtypeToken, SPORTS_LEG_GROUPABLE_GROUPS, DRAW_OUTCOME_TITLE_PATTERN, isThreeWayMoneylineHub, resolveDisplayGroupFamilyKey, resolveMarketOwnCardKey, LEG_GROUP_KEY_MARKER, TOTAL_STAT_UNITS, resolveTotalStatUnit, SPORTS_LEG_TITLE_OVERRIDES, SPORTS_LEG_TITLE_SMALL_WORDS, formatSportsLegTitle, resolveDisplayGroupTitle, sortMarketsByLineValue, buildSportsMarketDisplayGroups, groupSportsMarketsByPeriod, resolveSelectedSportsLineValue, collectVenueNames, resolveTotalGroupVolume, resolveSportsExpandedMarkets, resolveSportsExpandedMarketsVolume, resolveHighestVolumeIndex, resolveSportsCombinedLegs, resolveSlideKind, aggregateSportsLineStops, escapeRegExp, resolveSportsLadderTitle, resolveDistanceFromEvenMoney, MAIN_LINE_PRICE_BAND, buildSportsSlideFromGroup, formatSportsPeriodGrammarLabel, resolveSportsCategoryTokens, isNonStandardSportsLikeEvent, mergeSportsSectionMarketsIntoEvent;
31233
31233
  var init_sports_event_market_utils = __esm({
31234
31234
  "src/pages/event-market/sports-event-market.utils.ts"() {
31235
31235
  "use strict";
@@ -32190,6 +32190,7 @@ var init_sports_event_market_utils = __esm({
32190
32190
  const price = market.venueMarketOutcomes.map((outcome) => prices == null ? void 0 : prices.get(outcome.id)).find((value) => value != null);
32191
32191
  return price == null ? Number.POSITIVE_INFINITY : Math.abs(price - 0.5);
32192
32192
  };
32193
+ MAIN_LINE_PRICE_BAND = 0.2;
32193
32194
  buildSportsSlideFromGroup = (group, prices) => {
32194
32195
  const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets, group.sportsMarketType === "spread") : [];
32195
32196
  const hasLadder = lineStops.length > 1;
@@ -32201,13 +32202,21 @@ var init_sports_event_market_utils = __esm({
32201
32202
  const evenMoneyDistances = lineStops.map(
32202
32203
  (lineStop) => resolveDistanceFromEvenMoney(lineStop.representative, prices)
32203
32204
  );
32204
- const defaultStopIndex = hasLadder ? lineStops.reduce((bestIndex, lineStop, index) => {
32205
- const best = lineStops[bestIndex];
32206
- if (lineStop.volume !== best.volume) {
32207
- return lineStop.volume > best.volume ? index : bestIndex;
32208
- }
32209
- return evenMoneyDistances[index] < evenMoneyDistances[bestIndex] ? index : bestIndex;
32210
- }, 0) : 0;
32205
+ const isBetter = (index, bestIndex) => {
32206
+ const distance = evenMoneyDistances[index];
32207
+ const bestDistance = evenMoneyDistances[bestIndex];
32208
+ const inBand = distance <= MAIN_LINE_PRICE_BAND;
32209
+ const bestInBand = bestDistance <= MAIN_LINE_PRICE_BAND;
32210
+ if (inBand !== bestInBand) return inBand;
32211
+ const volume = lineStops[index].volume;
32212
+ const bestVolume = lineStops[bestIndex].volume;
32213
+ if (inBand) return volume !== bestVolume ? volume > bestVolume : distance < bestDistance;
32214
+ return distance !== bestDistance ? distance < bestDistance : volume > bestVolume;
32215
+ };
32216
+ const defaultStopIndex = hasLadder ? lineStops.reduce(
32217
+ (bestIndex, _lineStop, index) => isBetter(index, bestIndex) ? index : bestIndex,
32218
+ 0
32219
+ ) : 0;
32211
32220
  return {
32212
32221
  id: group.id,
32213
32222
  kind: resolveSlideKind(group),
package/dist/pages.mjs CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  buildAggTxExplorerHref,
14
14
  formatShareAmount,
15
15
  useHomePageModals
16
- } from "./chunk-4IO5CRSG.mjs";
16
+ } from "./chunk-3DQGXJ7P.mjs";
17
17
  import "./chunk-LIB6TLLV.mjs";
18
18
  import {
19
19
  EventMarketPage,
@@ -21,7 +21,7 @@ import {
21
21
  EventOpenOrdersCard,
22
22
  formatRecurringCountdown,
23
23
  useEventOpenOrders
24
- } from "./chunk-NDD5IHAU.mjs";
24
+ } from "./chunk-WAGNSZQ6.mjs";
25
25
  import "./chunk-LTFRGJPL.mjs";
26
26
  import {
27
27
  DEPOSIT_MODAL_OPEN_EVENT,
@@ -212,9 +212,11 @@ export declare const resolveSportsCombinedLegs: (group: Pick<SportsMarketDisplay
212
212
  */
213
213
  export declare const resolveSportsLadderTitle: (group: SportsMarketDisplayGroup, selectedLineDisplay: string) => string;
214
214
  /**
215
- * `prices` (outcomeId → midpoint) breaks volume ties toward the line priced
216
- * closest to 50/50 — the main line, where the books are deepest. Most line
217
- * markets carry zero volume, so without it the default was the lowest rung.
215
+ * The default line is the main line, picked by `prices` (outcomeId → midpoint):
216
+ * among lines priced within 30–70¢ the highest volume wins; with none in that
217
+ * band, the line closest to 50/50 wins. Volume alone is misleading — a stale
218
+ * lopsided line (kalshi's "Over 25.5" on an NFL game total, 95¢) can outtrade
219
+ * every real line, and most lines report zero volume at all.
218
220
  */
219
221
  export declare const buildSportsSlideFromGroup: (group: SportsMarketDisplayGroup, prices?: ReadonlyMap<string, number>) => SportsGameLineSlide;
220
222
  /**
@@ -212,9 +212,11 @@ export declare const resolveSportsCombinedLegs: (group: Pick<SportsMarketDisplay
212
212
  */
213
213
  export declare const resolveSportsLadderTitle: (group: SportsMarketDisplayGroup, selectedLineDisplay: string) => string;
214
214
  /**
215
- * `prices` (outcomeId → midpoint) breaks volume ties toward the line priced
216
- * closest to 50/50 — the main line, where the books are deepest. Most line
217
- * markets carry zero volume, so without it the default was the lowest rung.
215
+ * The default line is the main line, picked by `prices` (outcomeId → midpoint):
216
+ * among lines priced within 30–70¢ the highest volume wins; with none in that
217
+ * band, the line closest to 50/50 wins. Volume alone is misleading — a stale
218
+ * lopsided line (kalshi's "Over 25.5" on an NFL game total, 95¢) can outtrade
219
+ * every real line, and most lines report zero volume at all.
218
220
  */
219
221
  export declare const buildSportsSlideFromGroup: (group: SportsMarketDisplayGroup, prices?: ReadonlyMap<string, number>) => SportsGameLineSlide;
220
222
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agg-build/ui",
3
- "version": "4.22.2",
3
+ "version": "4.22.4",
4
4
  "description": "Pre-built React component library for the AGG prediction market aggregator. Tailwind-based, themeable, with primitives, event surfaces, trading flows, full pages, and modals.",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -101,7 +101,7 @@
101
101
  "react": "^18.0.0 || ^19.0.0",
102
102
  "react-dom": "^18.0.0 || ^19.0.0",
103
103
  "@agg-build/hooks": "^4.21.1",
104
- "@agg-build/sdk": "^4.22.1"
104
+ "@agg-build/sdk": "^4.22.3"
105
105
  },
106
106
  "dependencies": {
107
107
  "@number-flow/react": "^0.6.0",