Skip to content

Response drift: hunch — markets[].totalBets field not surfaced by normalizer #2011

Description

@realfishsam

Exchange

hunch

Severity

MEDIUM

What Our Normalizer Expects

utils.tsmapHunchMarketToUnified does not access totalBets. The field is absent from the HunchRawMarket type definition and from all normalizer mapping code.

What The Live API Returns

totalBets is present as an integer on every market object in the list and single-market endpoints:

markets[].totalBets: int   ← total number of individual bets placed on this market

Endpoint tested: GET https://www.playhunch.xyz/api/agent/v1/markets?limit=1

Impact

MEDIUM: totalBets is a direct measure of market activity distinct from volume24hUsd or volumeUsd — it counts bet events rather than dollar volume. Consumers cannot distinguish a market with one large bet (high volume, low bets) from one with many small bets (same volume, high engagement). This matters for:

  • Sorting/filtering by market engagement
  • Identifying thin markets where a single actor dominates
  • Displaying bet count in UI as a social proof signal

Suggested Fix

Add totalBets?: number to HunchRawMarket and map it in mapHunchMarketToUnified:

// utils.ts — in mapHunchMarketToUnified
totalBets: raw.totalBets ?? 0,

Include in UnifiedMarket or sourceMetadata as appropriate.


Found by automated response shape drift audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    response-driftLive API response shape differs from normalizer expectations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions