{# One page for every venue's linked markets. mode: "pm" (Polymarket), "kalshi", or "schema" (a venue defined as a schema, with taker-fee edges). venue: name, code, url. Only the legend, the edge columns and a few labels differ by mode. #} {% extends "base.html" %}{% from "_macros.html" import csrf, new_badge, flash, page_head, edge_cell, source_note %} {% set pm = mode == "pm" %}{% set schema = mode not in ("pm", "kalshi") %}{# a schema venue is the default #} {% block title %}{{ venue.name }}{% endblock %} {% block content %}

Markets › {{ venue.name }}

{% if schema %}{% set sub = "Every " ~ sports|join(" and ") ~ " market listed on " ~ venue.name ~ ", including outcomes we don't price, with the model's fair price beside the quote net of the taker fee" ~ (" (racinglines markets --exchange " ~ venue.code ~ " fair)" if user.role == 'admin' else "") ~ ". Read-only: nothing is traded on " ~ venue.name ~ "." %} {% else %}{% set sub = "Every F1 event listed on " ~ venue.name ~ ", including outcomes we don't price. Mirror an event into your book, or open a race from Markets for the full view." ~ ("" if pm else " Read-only: nothing is traded on Kalshi.") %}{% endif %} {% call page_head(venue.name ~ " markets" ~ (" · " ~ sport_name if sport else ""), sub) %}
{{ csrf() }}
{% endcall %} {{ flash(msg) }}
{% if sport %}{% endif %} Last sync {{ synced|fmt }}{% if not pm %} · Polymarket markets{% endif %}{% if sport %} · every sport{% endif %}
{% if not pm %}{% include "_recorders.html" %}{% endif %} {{ source_note(sport or note_sports, [venue.code], model=true) }} {% if schema %}

Edge YES = our fair − ask − fee (buy YES at the ask); edge NO = bid − our fair − fee (buy NO at 1 − bid); the fee is {{ venue.name }}'s taker fee, {{ fee|money }} per contract (unverified against its fee schedule). Call = the side with a positive edge after the fee. A one-sided quote gets an edge on its quoted side only: a book nobody will trade against is not an edge. ⚠ marks gaps over 10 pts: usually a model blind spot rather than an edge; check before quoting.

{% else %}

Edge = our fair − {{ venue.name }} mid (positive = we think YES is cheap). ⚠ marks gaps over 10 pts: usually a model blind spot rather than an edge; check before quoting.{% if not pm %} Kalshi lists one YES contract per outcome; volume is in contracts ($1 each at settlement).{% endif %}

{% endif %} {% if not events %}

{% if pm %}No linked markets yet. Refresh from Polymarket.{% elif schema %}No {{ venue.name }} markets linked. Refresh from {{ venue.name }}, or include closed markets.{% else %}No open Kalshi markets linked. Refresh from Kalshi, or include closed markets to see past races.{% endif %}

{% endif %} {% for ev in events %}

{{ ev.title }}{% if ev.new %} {{ new_badge(ev.new if ev.new < ev.rows|length else 0) }}{% endif %}

{{ ev.rows|length }} outcomes · {{ ev.modeled }} priced · {% if pm %}{{ ev.volume|money(false, false) }}{% else %}{{ "{:,.0f}".format(ev.volume) }} contracts{% endif %} · ends {{ ev.end_date|fmt }}

{% if pm %}open on Polymarket ↗{% elif schema %}open {{ venue.name }} ↗ · {{ ev.slug }}{% else %}open on Kalshi ↗ · {{ ev.slug }}{% endif %}

{{ csrf() }} creates / reprices a YES/NO market in my book for every priced outcome
{% if schema %}{% else %}{% endif %} {% for r in ev.rows %} {% if schema %}{{ edge_cell(r.edge_yes, good=(r.edge_yes is not none and r.edge_yes > 0), mark=false, warn=false) }}{{ edge_cell(r.edge_no, good=(r.edge_no is not none and r.edge_no > 0), mark=false, warn=false) }}{{ edge_cell(r.edge, label=r.call or "", good=(true if r.call else false)) }}{% else %}{{ edge_cell(r.edge) }}{% endif %} {% endfor %}
OutcomeKind{{ "PM bid" if pm else "Bid" }}{{ "PM ask" if pm else "Ask" }}{{ "PM mid" if pm else "Last" }}Our fairEdge YESEdge NOCallEdgeQuote bidQuote askMine
{{ r.subject }}{% if r.new %} {{ new_badge() }}{% endif %}{% if r.prediction == 'race_h2h' and not schema %} {% if pm %}vs {{ r.question.split(': ')[-1] }}{% else %}{{ r.question }}{% endif %}{% endif %} {{ r.prediction }} {{ r.last_bid|fmt }}{{ r.last_ask|fmt }}{{ "%.3f"|format(r.last_price) if r.last_price is not none else "" }} {{ r.fair|fmt("model_prob") if r.fair is not none else "–" }}{{ "%.3f"|format(r.q_bid) if r.q_bid is not none and r.q_bid > 0 else "" }}{{ "%.3f"|format(r.q_ask) if r.q_ask is not none and r.q_ask < 1 else "" }} {{ "✓" if r.mirrored else "" }}
{% endfor %} {% endblock %}