# james-granderson/jim-rockies architecture

> Architecture diagram of the GitHub repository james-granderson/jim-rockies, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/james-granderson/jim-rockies
- Repository: https://github.com/james-granderson/jim-rockies

## Overview

Jim Rockies is a sports-market analysis project whose implemented core converts odds and evaluates arbitrage and hedge payoffs. The principal interactive workflow takes odds and a total stake, samples stake allocations, ranks outcomes, and prints a hedge analysis. A separate event analyzer reads structured event data and checks best moneyline prices; a small API script demonstrates data retrieval. The README describes snapshots, live-market comparisons, and probability modeling as broader or later capabilities, but their implementations are not shown. Arrows reflect excerpted calls or explicit README descriptions.

Main entry points: [`arb_math.py`](https://github.com/james-granderson/jim-rockies/blob/main/arb_math.py) (Odds and payoff math), [`rundown_api.py`](https://github.com/james-granderson/jim-rockies/blob/main/rundown_api.py) (API fetch), [`hedge_range.py`](https://github.com/james-granderson/jim-rockies/blob/main/hedge_range.py) (Hedge analysis), [`arb_reach.py`](https://github.com/james-granderson/jim-rockies/blob/main/arb_reach.py) (Hedge reach)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_math["Odds mathematics"]
  node_math_core["Odds and payoff math<br/>[arb_math.py]"]
end

subgraph group_positions["Position analysis"]
  node_hedge_cli["Hedge analysis<br/>[hedge_range.py]"]
  node_reach_cli["Hedge reach<br/>[arb_reach.py]"]
end

subgraph group_markets["Market analysis"]
  node_event_analysis["Event odds analysis<br/>[event_arb.py]"]
  node_market_display["Market display<br/>[display.py]"]
  node_api_fetch["API fetch<br/>[rundown_api.py]"]
  node_api_config["API configuration<br/>[config.py]"]
  node_snapshot_analysis["Snapshot comparison<br/>[README.md]"]
  node_market_collection["Market snapshots<br/>[README.md]"]
  node_probability_model["Outcome probability model<br/>[README.md]"]
end

node_analyst(("Analyst"))
node_sports_data(("Sports data source"))

node_analyst -->|"enters odds"| node_hedge_cli
node_hedge_cli -->|"calls calculations"| node_math_core
node_analyst -->|"enters target"| node_reach_cli
node_reach_cli -->|"calls calculations"| node_math_core
node_event_analysis -->|"converts odds"| node_math_core
node_market_display -->|"reads event data"| node_sports_data
node_api_fetch -->|"reads key"| node_api_config
node_api_fetch -->|"requests data"| node_sports_data
node_sports_data -.->|"provides prices"| node_market_collection
node_market_collection -.->|"compares states"| node_snapshot_analysis
node_snapshot_analysis -.->|"compares estimates"| node_probability_model

click node_hedge_cli "https://github.com/james-granderson/jim-rockies/blob/main/hedge_range.py"
click node_reach_cli "https://github.com/james-granderson/jim-rockies/blob/main/arb_reach.py"
click node_math_core "https://github.com/james-granderson/jim-rockies/blob/main/arb_math.py"
click node_event_analysis "https://github.com/james-granderson/jim-rockies/blob/main/event_arb.py"
click node_market_display "https://github.com/james-granderson/jim-rockies/blob/main/display.py"
click node_api_fetch "https://github.com/james-granderson/jim-rockies/blob/main/rundown_api.py"
click node_api_config "https://github.com/james-granderson/jim-rockies/blob/main/config.py"
click node_snapshot_analysis "https://github.com/james-granderson/jim-rockies/blob/main/README.md"
click node_market_collection "https://github.com/james-granderson/jim-rockies/blob/main/README.md"
click node_probability_model "https://github.com/james-granderson/jim-rockies/blob/main/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_math_core toneBlue
class node_hedge_cli,node_reach_cli toneAmber
class node_event_analysis,node_market_display,node_api_fetch,node_api_config,node_snapshot_analysis,node_market_collection,node_probability_model toneMint
class node_analyst,node_sports_data toneIndigo
```

## Components

### Odds mathematics

- [Odds and payoff math](https://github.com/james-granderson/jim-rockies/blob/main/arb_math.py): `arb_math.py`

### Position analysis

- [Hedge analysis](https://github.com/james-granderson/jim-rockies/blob/main/hedge_range.py): `hedge_range.py`
- [Hedge reach](https://github.com/james-granderson/jim-rockies/blob/main/arb_reach.py): `arb_reach.py`

### Market analysis

- [Event odds analysis](https://github.com/james-granderson/jim-rockies/blob/main/event_arb.py): `event_arb.py`
- [Market display](https://github.com/james-granderson/jim-rockies/blob/main/display.py): `display.py`
- [API fetch](https://github.com/james-granderson/jim-rockies/blob/main/rundown_api.py): `rundown_api.py`
- [API configuration](https://github.com/james-granderson/jim-rockies/blob/main/config.py): `config.py`
- [Snapshot comparison](https://github.com/james-granderson/jim-rockies/blob/main/README.md): `README.md`
- [Market snapshots](https://github.com/james-granderson/jim-rockies/blob/main/README.md): `README.md`
- [Outcome probability model](https://github.com/james-granderson/jim-rockies/blob/main/README.md): `README.md`

### Other components

- **Analyst**
- **Sports data source**

## Connections

- Analyst → Hedge analysis: enters odds (evidence: `hedge_range.py`)
- Hedge analysis → Odds and payoff math: calls calculations (evidence: `hedge_range.py`)
- Analyst → Hedge reach: enters target (evidence: `arb_reach.py`)
- Hedge reach → Odds and payoff math: calls calculations (evidence: `arb_reach.py`)
- Event odds analysis → Odds and payoff math: converts odds (evidence: `event_arb.py`)
- Market display → Sports data source: reads event data (evidence: `display.py`)
- API fetch → API configuration: reads key (evidence: `rundown_api.py`)
- API fetch → Sports data source: requests data (evidence: `rundown_api.py`)
- Sports data source → Market snapshots: provides prices (evidence: `README.md`)
- Market snapshots → Snapshot comparison: compares states (evidence: `README.md`)
- Snapshot comparison → Outcome probability model: compares estimates (evidence: `README.md`)
