@buzzr/dfs-engine
    Preparing search index...

    Type Alias DfsBetLeg

    @buzzr/dfs-engine — pure-functional DFS prop grading, payouts, and stat normalization for PrizePicks/Underdog-style contests.

    All exports are pure functions or types — no I/O, no React, no native deps. Feed it data, get grading decisions and payout math back.

    type DfsBetLeg = {
        actualValue: number | null;
        boostType: DfsBoostType;
        direction: "over" | "under";
        gameContext: DfsLegGameContext;
        gradingSnapshot: LegGradingSnapshot | null;
        league: string;
        legId: string;
        legStatus: DfsLegStatus;
        line: number;
        linkage: LegLinkage | null;
        liveSnapshot: LegLiveSnapshot | null;
        playerAthleteId: string | null;
        playerName: string;
        playerNumber: string | null;
        playerPosition: string | null;
        playerTeam: string | null;
        propType: string;
        settlementPendingReason?: DfsSettlementPendingReason | null;
    }
    Index

    Properties

    actualValue: number | null

    Final stat after the game. Populated by the settlement watcher (or read directly from a settled-state screenshot when the user uploads post-game). NULL while pending.

    boostType: DfsBoostType

    PrizePicks-only - Underdog parsers always emit 'standard'.

    direction: "over" | "under"

    DFS slips show ↑ = over for nearly all lines; we still capture it for under-DFS markets.

    gameContext: DfsLegGameContext
    gradingSnapshot: LegGradingSnapshot | null

    Audit snapshot captured the moment the settlement watcher graded this leg. Used by the dispute path (Phase G) and by reconciliation crons that re-check stat-correction windows. NULL while pending.

    league: string
    legId: string

    Stable id within a bet - used for DNP edits.

    legStatus: DfsLegStatus
    line: number
    linkage: LegLinkage | null

    Resolution metadata for the player. Populated by dfs-linkage-service after parse / manual entry. The settlement watcher only auto-grades legs whose linkage.status === 'resolved'; ambiguous and unmatched legs surface a verification prompt to the user before grading.

    Lives alongside playerAthleteId for backwards compatibility — when status === 'resolved', playerAthleteId is also set to the chosen athlete's id.

    liveSnapshot: LegLiveSnapshot | null

    In-progress fingerprint refreshed every tick by the live watcher (Phase D). Mirrors leg.actualValue at the moment of the last polled stat update; lastLiveStatAt advances only when actualValue actually changes (diff-based writes). Cleared (null) when the settlement watcher grades the leg — gradingSnapshot becomes the authoritative record from then on.

    playerAthleteId: string | null

    Internal players.id when matched. Plain-string fallback otherwise.

    playerName: string
    playerNumber: string | null
    playerPosition: string | null
    playerTeam: string | null
    propType: string

    "Points", "Rebounds", "Rec Yards", "Pts + Rebs + Asts" — verbatim from slip.

    settlementPendingReason?: DfsSettlementPendingReason | null