From 57d3dc6db8acc108a9a76d437e21a1ca58b8b8b3 Mon Sep 17 00:00:00 2001 From: "Samuel EF. Tinnerholm" Date: Sun, 24 May 2026 17:52:12 +0300 Subject: [PATCH] fix: correct category field mapping in baozi normalizer Fixes #540 --- core/src/exchanges/baozi/utils.ts | 8 ++++---- core/test/normalizers/exchange-normalizers-3.test.ts | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/src/exchanges/baozi/utils.ts b/core/src/exchanges/baozi/utils.ts index 30a78ede..977fbb84 100644 --- a/core/src/exchanges/baozi/utils.ts +++ b/core/src/exchanges/baozi/utils.ts @@ -408,8 +408,8 @@ export function mapBooleanToUnified(market: BaoziMarket, pubkey: string): Unifie volume: totalPoolSol, liquidity: totalPoolSol, url: `https://baozi.bet/market/${pubkey}`, - category: layerName(market.layer), - tags: [layerName(market.layer), 'solana', 'pari-mutuel'], + category: undefined, + tags: [`tier:${layerName(market.layer)}`, 'solana', 'pari-mutuel'], }; addBinaryOutcomes(um); @@ -449,8 +449,8 @@ export function mapRaceToUnified(market: BaoziRaceMarket, pubkey: string): Unifi volume: totalPoolSol, liquidity: totalPoolSol, url: `https://baozi.bet/market/${pubkey}`, - category: layerName(market.layer), - tags: [layerName(market.layer), 'solana', 'pari-mutuel', 'race'], + category: undefined, + tags: [`tier:${layerName(market.layer)}`, 'solana', 'pari-mutuel', 'race'], }; // For 2-outcome races, add binary convenience getters diff --git a/core/test/normalizers/exchange-normalizers-3.test.ts b/core/test/normalizers/exchange-normalizers-3.test.ts index 8e15d337..db37edc1 100644 --- a/core/test/normalizers/exchange-normalizers-3.test.ts +++ b/core/test/normalizers/exchange-normalizers-3.test.ts @@ -1023,14 +1023,14 @@ describe('BaoziNormalizer', () => { expect(market.volume24h).toBe(0); }); - test('category is official for layer 0', () => { + test('category is undefined (tier is not a topic category)', () => { const market = normalizer.normalizeMarket(rawBooleanMarket)!; - expect(market.category).toBe('official'); + expect(market.category).toBeUndefined(); }); - test('tags include official, solana, and pari-mutuel', () => { + test('tags include tier:official, solana, and pari-mutuel', () => { const market = normalizer.normalizeMarket(rawBooleanMarket)!; - expect(market.tags).toContain('official'); + expect(market.tags).toContain('tier:official'); expect(market.tags).toContain('solana'); expect(market.tags).toContain('pari-mutuel'); }); @@ -1183,9 +1183,9 @@ describe('BaoziNormalizer', () => { expect(market.volume).toBeCloseTo(10, 5); }); - test('category is lab for layer 1', () => { + test('category is undefined for race markets (tier is not a topic category)', () => { const market = normalizer.normalizeMarket(rawRaceMarket)!; - expect(market.category).toBe('lab'); + expect(market.category).toBeUndefined(); }); test('tags include race', () => {