Skip to content

Response drift: suibets — sport field renamed to sportName, raw.sport always undefined #2012

Description

@realfishsam

Exchange

suibets

Severity

MEDIUM

What Our Normalizer Expects

core/src/exchanges/suibets/normalizer.ts reads raw.sport to populate the market's sport category:

// normalizer.ts
sport: raw.sport,

SuibetsRawOffer (fetcher.ts) declares the field as sport: string.

What The Live API Returns

The live GET https://www.suibets.com/api/p2p/offers response uses sportName instead:

[].sportName: str | null   ← present (was: sport)
[].sport                   ← ABSENT

Endpoint tested: GET https://www.suibets.com/api/p2p/offers?status=all

Impact

MEDIUM: raw.sport is always undefined because the field has been renamed. All Suibets markets are assigned an undefined sport category in normalized output:

  • Sport-based filtering returns no Suibets markets regardless of the user's selection
  • Category grouping assigns all Suibets markets to an "unknown" bucket
  • The SuibetsRawOffer TypeScript interface is wrong, masking the rename from developers

Relationship to Existing Issues

Issues #1085 (creatorOdds→odds), #1954 (matchId→eventId, matchName→eventName), and #1752 (type guard) cover related renames from the same API version bump. This rename was not included in those issues.

Suggested Fix

Rename the field access and update the interface:

// fetcher.ts — SuibetsRawOffer
sportName?: string;   // was: sport?: string

// normalizer.ts
sport: raw.sportName ?? undefined,

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