# pkjoshi23/moomoo_hackathon architecture

> Architecture diagram of the GitHub repository pkjoshi23/moomoo_hackathon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pkjoshi23/moomoo_hackathon
- Repository: https://github.com/pkjoshi23/moomoo_hackathon

## Overview

This repository defines a paper-trading submission rather than an executable trading application. Its principal workflow is scheduled market observation by a read-only Scout, signal handoff to a rule-enforcing Guard, then order submission and verification through moomoo, with outcomes recorded in the journal. Strategy, constraints, and agent role cards are the operational specification; config/limits.yaml supplies Guard thresholds. The graph reflects README-documented relationships only: no source excerpts were provided, so internal implementation calls cannot be verified.

Main entry points: [`agents/guard.md`](https://github.com/pkjoshi23/moomoo_hackathon/blob/main/agents/guard.md) (Guard agent), [`agents/scout.md`](https://github.com/pkjoshi23/moomoo_hackathon/blob/main/agents/scout.md) (Scout agent), [`PLAYBOOK.md`](https://github.com/pkjoshi23/moomoo_hackathon/blob/main/PLAYBOOK.md) (Strategy playbook), [`RULES.md`](https://github.com/pkjoshi23/moomoo_hackathon/blob/main/RULES.md) (Trading rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agents["Trading agents"]
  node_scout["Scout agent<br/>[scout.md]"]
  node_guard["Guard agent<br/>[guard.md]"]
end

subgraph group_specification["Strategy and controls"]
  node_playbook["Strategy playbook<br/>[PLAYBOOK.md]"]
  node_rules["Trading rules<br/>[RULES.md]"]
  node_limits["Guard limits<br/>[limits.yaml]"]
end

subgraph group_operations["Operations and audit"]
  node_journal["Session journal<br/>[2026-11-24.md]"]
  node_evidence["Evidence archive<br/>[README.md]"]
end

node_schedule(("SGT schedule"))
node_market["Market data"]
node_moomoo["Moomoo MCP"]

node_schedule -->|"schedules"| node_scout
node_schedule -->|"triggers flatten"| node_guard
node_market -->|"provides data"| node_scout
node_scout -->|"sends signal"| node_guard
node_guard -->|"submits orders"| node_moomoo
node_moomoo -->|"returns order status"| node_guard
node_guard -->|"checks thresholds"| node_limits
node_guard -->|"enforces rules"| node_rules
node_playbook -->|"specifies strategy"| node_scout
node_guard -->|"records decisions"| node_journal
node_guard -->|"files rejection"| node_evidence

click node_scout "https://github.com/pkjoshi23/moomoo_hackathon/blob/main/agents/scout.md"
click node_guard "https://github.com/pkjoshi23/moomoo_hackathon/blob/main/agents/guard.md"
click node_playbook "https://github.com/pkjoshi23/moomoo_hackathon/blob/main/PLAYBOOK.md"
click node_rules "https://github.com/pkjoshi23/moomoo_hackathon/blob/main/RULES.md"
click node_limits "https://github.com/pkjoshi23/moomoo_hackathon/blob/main/config/limits.yaml"
click node_journal "https://github.com/pkjoshi23/moomoo_hackathon/blob/main/journal/2026-11-24.md"
click node_evidence "https://github.com/pkjoshi23/moomoo_hackathon/blob/main/evidence/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_scout,node_guard toneBlue
class node_playbook,node_rules,node_limits toneAmber
class node_journal,node_evidence toneMint
class node_schedule,node_market,node_moomoo toneIndigo
```

## Components

### Trading agents

- [Scout agent](https://github.com/pkjoshi23/moomoo_hackathon/blob/main/agents/scout.md): `agents/scout.md`
- [Guard agent](https://github.com/pkjoshi23/moomoo_hackathon/blob/main/agents/guard.md): `agents/guard.md`

### Strategy and controls

- [Strategy playbook](https://github.com/pkjoshi23/moomoo_hackathon/blob/main/PLAYBOOK.md): `PLAYBOOK.md`
- [Trading rules](https://github.com/pkjoshi23/moomoo_hackathon/blob/main/RULES.md): `RULES.md`
- [Guard limits](https://github.com/pkjoshi23/moomoo_hackathon/blob/main/config/limits.yaml): `config/limits.yaml`

### Operations and audit

- [Session journal](https://github.com/pkjoshi23/moomoo_hackathon/blob/main/journal/2026-11-24.md): `journal/2026-11-24.md`
- [Evidence archive](https://github.com/pkjoshi23/moomoo_hackathon/blob/main/evidence/README.md): `evidence/README.md`

### Other components

- **SGT schedule**
- **Market data**
- **Moomoo MCP**

## Connections

- SGT schedule → Scout agent: schedules (evidence: `README.md`)
- SGT schedule → Guard agent: triggers flatten (evidence: `README.md`)
- Market data → Scout agent: provides data (evidence: `README.md`)
- Scout agent → Guard agent: sends signal (evidence: `README.md`)
- Guard agent → Moomoo MCP: submits orders (evidence: `README.md`)
- Moomoo MCP → Guard agent: returns order status (evidence: `README.md`)
- Guard agent → Guard limits: checks thresholds (evidence: `README.md`)
- Guard agent → Trading rules: enforces rules (evidence: `README.md`)
- Strategy playbook → Scout agent: specifies strategy (evidence: `README.md`)
- Guard agent → Session journal: records decisions (evidence: `README.md`)
- Guard agent → Evidence archive: files rejection (evidence: `README.md`)
