---
title: Derive the nfl_games close from the line quote series
type: task
status: draft
description: >-
  Move the stored close in nfl_games onto the per-book quote series and the as-of reader, so one
  cross-book consensus produces every game line; today the two disagree by half a point on 9 of 79
  played 2026 games.
base_uri: user:task/league/derive-nfl-game-close-from-line-quote-series.md
created_at: '2026-10-14T20:10:27.761Z'
entity_id: ab4e5fbf-436d-4d16-9d11-766d8d6dd138
observations:
  - ████████████████████████████████████████████████
owner_identity_uri: █████████████████████████
priority: Low
public_read: true
tags:
  - user:tag/league-xo-football.md
  - user:tag/nfl-betting.md
updated_at: '2026-10-25T21:21:58.409Z'
visibility_analyzed_at: '2026-11-05T23:49:08.386Z'
---

## Overview

The stored close in `nfl_games` and the as-of game line reader compute the cross-book consensus in two separate implementations. Move the close onto the per-book quote series and the as-of reader, so one consensus produces every game line the site shows.

## Background

- **Stored close.** `derive_closing_lines` in `libs-server/nfl-game-market-line.mjs`, run by `scripts/calculate-nfl-game-closing-lines.mjs` (also imported by `scripts/import-nfl-games-nflverse-nfldata.mjs`), reads market snapshots and writes the spread, total and moneylines on `nfl_games`. Line Timing `Close` reads these columns, and they reach back to 2000.
- **Quote series and reader.** `derive_line_quotes` (same file, run by `scripts/generate-nfl-game-line-quotes.mjs`, hourly cron at :45 on the main host) writes `nfl_game_line_quotes`, each book's main line at every change. `libs-server/nfl-game-line-as-of.mjs` takes the median across books at any instant in SQL, with the same half-point and probability-space moneyline rules. The series starts 2023-10-18.
- **Disagreement.** On the 2026-10-14 check, 9 of 79 played 2026 closes are off by half a point between the two. The cause is Fanatics alternate spreads filed as the main market with both sides at one number. `resolve_consistent_sides` rejects those in the series, and the stored close takes them.
- **Operator ruling, 2026-10-14:** do this later, not now.

## Notes

- Before 2023-10-18 there is no series, so the pre-series close has to stay as stored or come from a backfill of the series. Decide which in Design.
- The Fanatics importer defect itself is tracked on `███████████████████████████████████████████████████████`.
