@agg-build/ui 4.22.2 → 4.22.5

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-JGLBF5WY.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-Q3XA3WIH.mjs").then((module) => ({ default: module.EventMarketPage }))
270
270
  );
271
271
  var MIN_SEARCH_LENGTH = 3;
272
272
  var SEARCH_DEBOUNCE_MS = 300;
@@ -1897,7 +1897,9 @@ var aggregateSportsLineStops = (markets, isSpread = false) => {
1897
1897
  value: displayOf(representative),
1898
1898
  representative,
1899
1899
  venues: Array.from(venues),
1900
- volume: resolveTotalGroupVolume(lineMarkets),
1900
+ // Cluster volume: a line anchored on a zero-volume venue can carry its
1901
+ // real volume on the matched twins (prophetx $0 → kalshi $23K).
1902
+ volume: resolveSportsExpandedMarketsVolume(lineMarkets),
1901
1903
  lineValue: axis
1902
1904
  };
1903
1905
  }).sort(
@@ -1918,6 +1920,7 @@ var resolveDistanceFromEvenMoney = (market, prices) => {
1918
1920
  const price = market.venueMarketOutcomes.map((outcome) => prices == null ? void 0 : prices.get(outcome.id)).find((value) => value != null);
1919
1921
  return price == null ? Number.POSITIVE_INFINITY : Math.abs(price - 0.5);
1920
1922
  };
1923
+ var MAIN_LINE_PRICE_BAND = 0.2;
1921
1924
  var buildSportsSlideFromGroup = (group, prices) => {
1922
1925
  const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets, group.sportsMarketType === "spread") : [];
1923
1926
  const hasLadder = lineStops.length > 1;
@@ -1929,13 +1932,21 @@ var buildSportsSlideFromGroup = (group, prices) => {
1929
1932
  const evenMoneyDistances = lineStops.map(
1930
1933
  (lineStop) => resolveDistanceFromEvenMoney(lineStop.representative, prices)
1931
1934
  );
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;
1935
+ const isBetter = (index, bestIndex) => {
1936
+ const distance = evenMoneyDistances[index];
1937
+ const bestDistance = evenMoneyDistances[bestIndex];
1938
+ const inBand = distance <= MAIN_LINE_PRICE_BAND;
1939
+ const bestInBand = bestDistance <= MAIN_LINE_PRICE_BAND;
1940
+ if (inBand !== bestInBand) return inBand;
1941
+ const volume = lineStops[index].volume;
1942
+ const bestVolume = lineStops[bestIndex].volume;
1943
+ if (inBand) return volume !== bestVolume ? volume > bestVolume : distance < bestDistance;
1944
+ return distance !== bestDistance ? distance < bestDistance : volume > bestVolume;
1945
+ };
1946
+ const defaultStopIndex = hasLadder ? lineStops.reduce(
1947
+ (bestIndex, _lineStop, index) => isBetter(index, bestIndex) ? index : bestIndex,
1948
+ 0
1949
+ ) : 0;
1939
1950
  return {
1940
1951
  id: group.id,
1941
1952
  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-JGLBF5WY.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";
@@ -32894,7 +32894,9 @@ var init_sports_event_market_utils = __esm({
32894
32894
  value: displayOf(representative),
32895
32895
  representative,
32896
32896
  venues: Array.from(venues),
32897
- volume: resolveTotalGroupVolume(lineMarkets),
32897
+ // Cluster volume: a line anchored on a zero-volume venue can carry its
32898
+ // real volume on the matched twins (prophetx $0 → kalshi $23K).
32899
+ volume: resolveSportsExpandedMarketsVolume(lineMarkets),
32898
32900
  lineValue: axis
32899
32901
  };
32900
32902
  }).sort(
@@ -32915,6 +32917,7 @@ var init_sports_event_market_utils = __esm({
32915
32917
  const price = market.venueMarketOutcomes.map((outcome) => prices == null ? void 0 : prices.get(outcome.id)).find((value) => value != null);
32916
32918
  return price == null ? Number.POSITIVE_INFINITY : Math.abs(price - 0.5);
32917
32919
  };
32920
+ MAIN_LINE_PRICE_BAND = 0.2;
32918
32921
  buildSportsSlideFromGroup = (group, prices) => {
32919
32922
  const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets, group.sportsMarketType === "spread") : [];
32920
32923
  const hasLadder = lineStops.length > 1;
@@ -32926,13 +32929,21 @@ var init_sports_event_market_utils = __esm({
32926
32929
  const evenMoneyDistances = lineStops.map(
32927
32930
  (lineStop) => resolveDistanceFromEvenMoney(lineStop.representative, prices)
32928
32931
  );
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;
32932
+ const isBetter = (index, bestIndex) => {
32933
+ const distance = evenMoneyDistances[index];
32934
+ const bestDistance = evenMoneyDistances[bestIndex];
32935
+ const inBand = distance <= MAIN_LINE_PRICE_BAND;
32936
+ const bestInBand = bestDistance <= MAIN_LINE_PRICE_BAND;
32937
+ if (inBand !== bestInBand) return inBand;
32938
+ const volume = lineStops[index].volume;
32939
+ const bestVolume = lineStops[bestIndex].volume;
32940
+ if (inBand) return volume !== bestVolume ? volume > bestVolume : distance < bestDistance;
32941
+ return distance !== bestDistance ? distance < bestDistance : volume > bestVolume;
32942
+ };
32943
+ const defaultStopIndex = hasLadder ? lineStops.reduce(
32944
+ (bestIndex, _lineStop, index) => isBetter(index, bestIndex) ? index : bestIndex,
32945
+ 0
32946
+ ) : 0;
32936
32947
  return {
32937
32948
  id: group.id,
32938
32949
  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-EPP5DTCF.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-JGLBF5WY.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";
@@ -32169,7 +32169,9 @@ var init_sports_event_market_utils = __esm({
32169
32169
  value: displayOf(representative),
32170
32170
  representative,
32171
32171
  venues: Array.from(venues),
32172
- volume: resolveTotalGroupVolume(lineMarkets),
32172
+ // Cluster volume: a line anchored on a zero-volume venue can carry its
32173
+ // real volume on the matched twins (prophetx $0 → kalshi $23K).
32174
+ volume: resolveSportsExpandedMarketsVolume(lineMarkets),
32173
32175
  lineValue: axis
32174
32176
  };
32175
32177
  }).sort(
@@ -32190,6 +32192,7 @@ var init_sports_event_market_utils = __esm({
32190
32192
  const price = market.venueMarketOutcomes.map((outcome) => prices == null ? void 0 : prices.get(outcome.id)).find((value) => value != null);
32191
32193
  return price == null ? Number.POSITIVE_INFINITY : Math.abs(price - 0.5);
32192
32194
  };
32195
+ MAIN_LINE_PRICE_BAND = 0.2;
32193
32196
  buildSportsSlideFromGroup = (group, prices) => {
32194
32197
  const lineStops = group.hasLineVariants ? aggregateSportsLineStops(group.markets, group.sportsMarketType === "spread") : [];
32195
32198
  const hasLadder = lineStops.length > 1;
@@ -32201,13 +32204,21 @@ var init_sports_event_market_utils = __esm({
32201
32204
  const evenMoneyDistances = lineStops.map(
32202
32205
  (lineStop) => resolveDistanceFromEvenMoney(lineStop.representative, prices)
32203
32206
  );
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;
32207
+ const isBetter = (index, bestIndex) => {
32208
+ const distance = evenMoneyDistances[index];
32209
+ const bestDistance = evenMoneyDistances[bestIndex];
32210
+ const inBand = distance <= MAIN_LINE_PRICE_BAND;
32211
+ const bestInBand = bestDistance <= MAIN_LINE_PRICE_BAND;
32212
+ if (inBand !== bestInBand) return inBand;
32213
+ const volume = lineStops[index].volume;
32214
+ const bestVolume = lineStops[bestIndex].volume;
32215
+ if (inBand) return volume !== bestVolume ? volume > bestVolume : distance < bestDistance;
32216
+ return distance !== bestDistance ? distance < bestDistance : volume > bestVolume;
32217
+ };
32218
+ const defaultStopIndex = hasLadder ? lineStops.reduce(
32219
+ (bestIndex, _lineStop, index) => isBetter(index, bestIndex) ? index : bestIndex,
32220
+ 0
32221
+ ) : 0;
32211
32222
  return {
32212
32223
  id: group.id,
32213
32224
  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-EPP5DTCF.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-JGLBF5WY.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.5",
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",