Skip to content

Response drift: gemini-titan — contracts[].prices now includes buy/sell directional split #796

@realfishsam

Description

@realfishsam

Exchange

gemini-titan

Severity

MEDIUM

What Our Normalizer Expects

core/src/exchanges/gemini-titan/normalizer.ts:214-216 reads only bestBid and bestAsk from contract.prices:

// normalizer.ts ~lines 214-216
yesPrice: parseFloat(contract.prices.bestBid || '0.5'),
noPrice:  parseFloat(contract.prices.bestAsk  || '0.5'),
lastTradePrice: parseFloat(contract.prices.lastTradePrice ?? ...),

What The Live API Returns

contract.prices now contains a richer structure with directional buy/sell prices in addition to bestBid/bestAsk:

contracts[].prices.buy.yes: str
contracts[].prices.buy.no: str
contracts[].prices.sell.yes: str
contracts[].prices.sell.no: str
contracts[].prices.bestBid: str     ← still present
contracts[].prices.bestAsk: str     ← still present
contracts[].prices.lastTradePrice: str

Endpoint tested: GET https://api.gemini.com/v1/prediction-markets/events?limit=2&status=active

Impact

MEDIUM: bestBid/bestAsk are still present so existing normalizer logic works, but the richer directional pricing (buy.yes, sell.yes, etc.) is ignored. These fields expose the actual executable buy/sell prices for each outcome side, which are more accurate than bestBid/bestAsk midpoints for order sizing and spread display.

Suggested Fix

Extend the price extraction to surface directional prices, either as additional fields on UnifiedMarket.outcomes[] or as part of a separate executionPrices metadata block:

buyYesPrice:  parseFloat(contract.prices.buy?.yes  || contract.prices.bestAsk  || '0.5'),
sellYesPrice: parseFloat(contract.prices.sell?.yes || contract.prices.bestBid || '0.5'),

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions