Skip to content

Commit c08d771

Browse files
committed
fix: prepend event title to Opinion child market titles
Opinion categorical markets produce generic titles like "$200M" or "June 30, 2026" that lack subject context. This caused the cross-venue matcher to incorrectly pair them with unrelated markets sharing the same threshold. Now applies the same ${event} - ${market} pattern Polymarket uses: "$200M" → "Probable FDV above ... one day after launch? - $200M"
1 parent e69f39d commit c08d771

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

core/src/exchanges/opinion/normalizer.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,16 @@ export class OpinionNormalizer implements IExchangeNormalizer<OpinionRawMarket,
353353
price: 0.5,
354354
};
355355

356+
const childTitle = child.marketTitle || '';
357+
const parentTitle = parent.marketTitle || '';
358+
const combinedTitle = parentTitle && childTitle
359+
? `${parentTitle} - ${childTitle}`
360+
: parentTitle || childTitle;
361+
356362
const market: UnifiedMarket = {
357363
marketId,
358364
eventId: String(parent.marketId),
359-
title: child.marketTitle || '',
365+
title: combinedTitle,
360366
description: child.rules || '',
361367
outcomes: [yesOutcome, noOutcome],
362368
resolutionDate: new Date(toMillis(child.cutoffAt)),

core/test/unit/normalizers/opinion.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,9 @@ describe('OpinionNormalizer.normalizeMarketsFromEvent', () => {
328328
const markets = normalizer.normalizeMarketsFromEvent(RAW_CATEGORICAL_MARKET);
329329
expect(markets).toHaveLength(2);
330330
expect(markets[0].marketId).toBe('201');
331-
expect(markets[0].title).toBe('Decrease rates');
331+
expect(markets[0].title).toBe('ECB Rates Decision June 2026 - Decrease rates');
332332
expect(markets[1].marketId).toBe('202');
333-
expect(markets[1].title).toBe('No change');
333+
expect(markets[1].title).toBe('ECB Rates Decision June 2026 - No change');
334334
});
335335

336336
test('should set eventId on child markets', () => {

0 commit comments

Comments
 (0)