Skip to content

fix opinion child markets hardcoding volume24h to 0#108

Closed
mooncitydev wants to merge 2 commits into
pmxt-dev:mainfrom
mooncitydev:fix/opinion-child-market-volume24h
Closed

fix opinion child markets hardcoding volume24h to 0#108
mooncitydev wants to merge 2 commits into
pmxt-dev:mainfrom
mooncitydev:fix/opinion-child-market-volume24h

Conversation

@mooncitydev

Copy link
Copy Markdown
Contributor

what's the problem

child markets (outcomes within categorical/multi-outcome events) always had volume24h set to 0 in the Opinion normalizer, even when the parent market was actively traded. this caused downstream consumers that filter on volume24h > 0 (like matching pipelines) to skip these markets entirely — which is why Opinion had near-zero embedding coverage (~0.4%).

what changed

instead of hardcoding volume24h: 0 for child markets, we now read the parent's volume24h and distribute it evenly across all children. this is a pragmatic approximation since the Opinion API only provides volume at the parent level.

normalizeMarketsFromEvent computes parentVolume24h / childCount and passes that into each normalizeChildMarket call. the private method now accepts a volume24h parameter (defaults to 0 to stay safe for any direct callers).

why even distribution?

the Opinion API doesn't expose per-child volume, so we can't be more precise here. splitting evenly is honest and avoids artificially inflating or hiding any specific outcome. it also unblocks the matching pipeline immediately without needing a more complex weighting scheme.

fixes #106

made by mooncitydev

@realfishsam

Copy link
Copy Markdown
Contributor

Merged to main in e547864 — changed the distribution strategy from even split to proportional by child volume. Thanks for the contribution!

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.

Opinion: child markets hardcode volume24h to 0

2 participants