BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/mrdoge-ui/mrdoge-odds-selector-adapter

Odds Selector Adapter (Mr. Doge SDK)

mrdoge-ui/mrdoge-odds-selector-adapter
FreeUtility

Pairs Over/Under markets into OddsLine[] and picks a representative line, for Odds Selector's lines prop.

Install it

npx shadcn@latest add https://mrdoge.co/r/mrdoge-odds-selector-adapter.json

Source

lib/mrdoge-adapters/odds-lines.tsmrdoge.co/r/mrdoge-odds-selector-adapter.json
1import type { Market } from "@mrdoge/protocol"
2import type { OddsLine } from "@/registry/mrdoge-ui/odds-selector/odds-selector"
3
4// Over/Under outcomes only carry a generic "O"/"U" code, no threshold in
5// it. The threshold lives in the caption instead ("Over 1.5", "Under
6// 1.5"), so that's what has to be parsed to sort lines and label them.
7function parseThreshold(caption: string | null | undefined): number {
8 const match = caption?.match(/[\d.]+/)
9 return match ? parseFloat(match[0]) : NaN
10}
11
12/**
13 * Some bet types post one market per line instead of one market total.
14 * SOCCER_UNDER_OVER posts a separate market for each Over/Under threshold
15 * (0.5, 1.5, 2.5, ...). Pairs each market's two outcomes into one OddsLine
16 * row and sorts by threshold, for OddsSelector's `lines` prop.
17 */
18export function toOddsLines(markets: Market[]): OddsLine[] {
19 const lines: (OddsLine & { threshold: number })[] = []
20 for (const market of markets) {
21 const over = market.lines.find((line) => line.code.startsWith("O"))
22 const under = market.lines.find((line) => line.code.startsWith("U"))
23 if (!over || !under) continue
24 const threshold = parseThreshold(over.caption ?? under.caption)
25 // Can't sort or label a line without a real threshold. Drop it
26 // rather than showing a broken "NaN" row.
27 if (Number.isNaN(threshold)) continue
28 lines.push({
29 id: market.id,
30 threshold,
31 label: String(threshold),
32 over: {
33 id: over.id,
34 label: over.caption ?? over.code,
35 price: over.price.toFixed(2),
36 suspended: !over.isAvailable,
37 },
38 under: {
39 id: under.id,
40 label: under.caption ?? under.code,
41 price: under.price.toFixed(2),
42 suspended: !under.isAvailable,
43 },
44 })
45 }
46 return lines.sort((a, b) => a.threshold - b.threshold)
47}
48
49/**
50 * Picks the line closest to an even split: the Over/Under prices closest
51 * to each other, e.g. Over 1.90 / Under 2.00 rather than a lopsided Over
52 * 1.18 / Under 4.50. A reasonable single-market pick when there's only
53 * room to show one Total Goals line, e.g. alongside other markets on a
54 * board. The first market in the snapshot is otherwise arbitrary.
55 */
56export function pickMostBalancedMarket(markets: Market[]): Market | undefined {
57 let best: Market | undefined
58 let bestSpread = Infinity
59 for (const market of markets) {
60 const over = market.lines.find((line) => line.code.startsWith("O"))
61// … truncated

What it pulls in

npm packages

  • @mrdoge/protocol

Other registry items

  • odds-selector

Files it writes

  • lib/mrdoge-adapters/odds-lines.ts

Facts

Registry
mrdoge-ui
Type
registry:lib
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

mrdoge.co mrdogeco/docs on GitHub Raw registry item This item as JSON

More from mrdoge-ui

All 26 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Bet Slip Adapter (Mr. Doge SDK)mrdoge-bet-slip-adaptermrdoge-uiUtilitiesFree1 dep
Mr. Doge Clientmrdoge-clientmrdoge-uiUtilitiesFree1 dep
Conflict Adapter (Mr. Doge SDK)mrdoge-conflict-adaptermrdoge-uiUtilitiesFree1 dep
Match Card Adapter (Mr. Doge SDK)mrdoge-match-card-adaptermrdoge-uiUtilitiesFree1 dep
Match Highlight Adapter (Mr. Doge SDK)mrdoge-match-highlight-adaptermrdoge-uiUtilitiesFree1 dep
Match Timeline Adapter (Mr. Doge SDK)mrdoge-match-timeline-adaptermrdoge-uiUtilitiesFree1 dep
Stats List Adapter (Mr. Doge SDK)mrdoge-stats-list-adaptermrdoge-uiUtilitiesFree1 dep
Rate Limitrate-limitmrdoge-uiUtilitiesFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex