# rayees1728/imc-prosperity-4.0-alphas architecture

> Architecture diagram of the GitHub repository rayees1728/imc-prosperity-4.0-alphas, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rayees1728/imc-prosperity-4.0-alphas
- Repository: https://github.com/rayees1728/imc-prosperity-4.0-alphas

## Overview

This repository is a collection of standalone IMC Prosperity trading-bot iterations, with `prosperity_trader_v9.py` documented as the unified engine. Its user-to-result workflow is one trading tick: receive market state, calculate fair values and signals, select arbitrage and execution orders, apply risk controls, then return orders and serialized state. The README describes these stages and their capabilities; sampled code confirms state tracking, order generation and risk clipping. Most versioned files are independent alternatives, not a shared runtime pipeline, so their connections are not inferred.

Main entry points: [`prosperity_trader_v9.py`](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py) (Unified trader), [`trader_v7.py`](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_v7.py) (Round 1 bot), [`trader_round1_v8.py`](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_round1_v8.py) (Round 1 v8 bot)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Unified runtime"]
  node_v9["Unified trader"]
  node_state["Serialized state"]
end

subgraph group_strategy["Pricing and signals"]
  node_alpha["Fair-value models"]
  node_signals["Market signals"]
end

subgraph group_trading["Trading and risk"]
  node_arbitrage["Arbitrage strategies"]
  node_execution["Order execution"]
  node_risk["Risk controls"]
end

subgraph group_iterations["Strategy iterations"]
  node_round1["Round 1 bot<br/>[trader_v7.py]"]
  node_round1v8["Round 1 v8 bot"]
  node_trader5["Trader iteration<br/>[trader &#40;5&#41;.py]"]
  node_trader6["Trader iteration<br/>[trader &#40;6&#41;.py]"]
  node_trader7["Trader iteration<br/>[trader &#40;7&#41;.py]"]
  node_trader16["Trader iteration<br/>[trader &#40;16&#41;.py]"]
  node_round1v5["Round 1 iteration"]
  node_round1v6["Round 1 iteration"]
  node_round1v8core["Round 1 iteration"]
  node_v2["Trader v2<br/>[trader_v2.py]"]
  node_v2k["Trader v2k<br/>[trader_v2k.py]"]
  node_v7["Trader v7"]
  node_v8["Trader v8"]
  node_v5["Prosperity v5"]
  node_v9full["Full production bot"]
  node_v4log["Round 4 bot<br/>[534669.py]"]
end

node_platform(("Trading platform"))

node_platform -->|"supplies tick"| node_v9
node_v9 -->|"loads and saves"| node_state
node_v9 -->|"calculates fair values"| node_alpha
node_v9 -->|"evaluates regimes"| node_signals
node_v9 -->|"seeks mispricings"| node_arbitrage
node_v9 -->|"creates orders"| node_execution
node_v9 -->|"checks exposure"| node_risk
node_v9 -->|"returns orders"| node_platform
node_round1 -.->|"later iteration"| node_round1v8

click node_v9 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py"
click node_state "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py"
click node_alpha "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py"
click node_signals "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py"
click node_arbitrage "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py"
click node_execution "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py"
click node_risk "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py"
click node_round1 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_v7.py"
click node_round1v8 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_round1_v8.py"
click node_trader5 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader%20(5).py"
click node_trader6 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader%20(6).py"
click node_trader7 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader%20(7).py"
click node_trader16 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader%20(16).py"
click node_round1v5 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_round1_v5.py"
click node_round1v6 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_round1_v6%20(1).py"
click node_round1v8core "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_round1_v8.py"
click node_v2 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_v2.py"
click node_v2k "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_v2k.py"
click node_v7 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v7.py"
click node_v8 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v8.py"
click node_v5 "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity4_trader_v5.py"
click node_v9full "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/v9_full_production.py"
click node_v4log "https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/impo%20loggy/534669.py"

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_v9,node_state toneBlue
class node_alpha,node_signals toneAmber
class node_arbitrage,node_execution,node_risk toneMint
class node_round1,node_round1v8,node_trader5,node_trader6,node_trader7,node_trader16,node_round1v5,node_round1v6,node_round1v8core,node_v2,node_v2k,node_v7,node_v8,node_v5,node_v9full,node_v4log toneRose
class node_platform toneIndigo
```

## Components

### Unified runtime

- [Unified trader](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py): `prosperity_trader_v9.py`
- [Serialized state](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py): `prosperity_trader_v9.py`

### Pricing and signals

- [Fair-value models](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py): `prosperity_trader_v9.py`
- [Market signals](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py): `prosperity_trader_v9.py`

### Trading and risk

- [Arbitrage strategies](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py): `prosperity_trader_v9.py`
- [Order execution](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py): `prosperity_trader_v9.py`
- [Risk controls](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v9.py): `prosperity_trader_v9.py`

### Strategy iterations

- [Round 1 bot](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_v7.py): `trader_v7.py`
- [Round 1 v8 bot](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_round1_v8.py): `trader_round1_v8.py`
- [Trader iteration](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader%20(5).py): `trader (5).py`
- [Trader iteration](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader%20(6).py): `trader (6).py`
- [Trader iteration](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader%20(7).py): `trader (7).py`
- [Trader iteration](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader%20(16).py): `trader (16).py`
- [Round 1 iteration](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_round1_v5.py): `trader_round1_v5.py`
- [Round 1 iteration](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_round1_v6%20(1).py): `trader_round1_v6 (1).py`
- [Round 1 iteration](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_round1_v8.py): `trader_round1_v8.py`
- [Trader v2](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_v2.py): `trader_v2.py`
- [Trader v2k](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/trader_v2k.py): `trader_v2k.py`
- [Trader v7](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v7.py): `prosperity_trader_v7.py`
- [Trader v8](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity_trader_v8.py): `prosperity_trader_v8.py`
- [Prosperity v5](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/prosperity4_trader_v5.py): `prosperity4_trader_v5.py`
- [Full production bot](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/v9_full_production.py): `v9_full_production.py`
- [Round 4 bot](https://github.com/rayees1728/imc-prosperity-4.0-alphas/blob/main/impo%20loggy/534669.py): `impo loggy/534669.py`

### Other components

- **Trading platform**

## Connections

- Trading platform → Unified trader: supplies tick
- Unified trader → Serialized state: loads and saves (evidence: `prosperity_trader_v9.py`)
- Unified trader → Fair-value models: calculates fair values (evidence: `prosperity_trader_v9.py`)
- Unified trader → Market signals: evaluates regimes (evidence: `prosperity_trader_v9.py`)
- Unified trader → Arbitrage strategies: seeks mispricings (evidence: `prosperity_trader_v9.py`)
- Unified trader → Order execution: creates orders (evidence: `prosperity_trader_v9.py`)
- Unified trader → Risk controls: checks exposure (evidence: `prosperity_trader_v9.py`)
- Unified trader → Trading platform: returns orders
- Round 1 bot → Round 1 v8 bot: later iteration
