Skip to content

fix: keep Polymarket per-market image in UnifiedMarket mapping#63

Merged
realfishsam merged 1 commit intopmxt-dev:mainfrom
saschabuehrle:fix/issue-62-polymarket-market-images
Mar 20, 2026
Merged

fix: keep Polymarket per-market image in UnifiedMarket mapping#63
realfishsam merged 1 commit intopmxt-dev:mainfrom
saschabuehrle:fix/issue-62-polymarket-market-images

Conversation

@saschabuehrle
Copy link
Copy Markdown
Contributor

Bug

Fixes #62 — multi-market Polymarket events were assigning the same event-level image to every UnifiedMarket, even when the underlying market had its own image.

Fix

  • Updated Polymarket market normalization image precedence to prefer market-level image first.
  • New precedence order:
    1. market.image
    2. event.image
    3. fallback OG image URL
  • Added a focused unit test that verifies market image wins when both event and market images are present.

Files changed

  • core/src/exchanges/polymarket/utils.ts
  • core/test/unit/normalizers/polymarket.test.ts

Testing

  • Added unit test coverage for the image precedence behavior in the Polymarket normalizer test suite.

Happy to adjust if you want stricter fallback behavior for empty-string image values as well.

Greetings, saschabuehrle

@realfishsam realfishsam merged commit 407d3f2 into pmxt-dev:main Mar 20, 2026
@realfishsam
Copy link
Copy Markdown
Contributor

Good stuff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Polymarket: per-market images lost in multi-market events (all markets get event image)

2 participants