# sivanujan/deskmind architecture

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

- Interactive diagram: https://gitdiagram.com/sivanujan/deskmind
- Repository: https://github.com/sivanujan/deskmind

## Overview

Deskmind is a paper/testnet-only Binance USDT-M futures advisory and trading system, with a web dashboard for monitoring and charting. Market data is collected and stored, live candles feed agents, and strategy intents pass through risk and execution controls. The API exposes read-only chart and dashboard data. Edges reflect README statements or relationships visible in the supplied excerpts and SOURCE INDEX; unsampled subsystems are represented at their existing directory or module paths, without asserting unverified internal calls.

Main entry points: [`src/deskmind/api/app.py`](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/api/app.py) (Read-only API), [`src/deskmind/agents/trend/agent.py`](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/agents/trend/agent.py) (Trend agent), [`src/deskmind/execution/service.py`](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/execution/service.py) (Execution service), [`src/deskmind/data/pipeline.py`](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/data/pipeline.py) (Historical sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market_data["Market data"]
  node_historical["Historical sync<br/>[pipeline.py]"]
  node_datasets["Dataset definitions<br/>[datasets.py]"]
  node_live["Live market feed<br/>[service.py]"]
end

subgraph group_analysis["Analysis"]
  node_trend["Trend agent<br/>[agent.py]"]
  node_trend_engine["Trend engine<br/>[engine.py]"]
  node_overlays["Chart overlays<br/>[overlays.py]"]
  node_universe["Symbol universe<br/>[daily.py]"]
  node_backtest["Backtesting<br/>[engine.py]"]
end

subgraph group_trading["Trading"]
  node_strategy["Trading strategies<br/>[base.py]"]
  node_risk["Risk evaluation<br/>[evaluator.py]"]
  node_execution["Execution service<br/>[service.py]"]
  node_exchange["Binance testnet"]
end

subgraph group_services["API and dashboard"]
  node_web["Web dashboard<br/>[page.tsx]"]
  node_web_api["Web API client<br/>[api.ts]"]
  node_api["Read-only API<br/>[app.py]"]
  node_api_control["Control routes<br/>[control.py]"]
  node_api_dashboard["Dashboard routes<br/>[dashboard.py]"]
end

subgraph group_persistence["State and storage"]
  node_parquet[("Historical data store<br/>[storage.py]")]
  node_redis[("Live buffers<br/>[buffers.py]")]
  node_postgres[("PostgreSQL")]
end

node_user(("Operator"))

node_user -->|"uses"| node_web
node_web -.->|"requests data"| node_web_api
node_web_api -->|"calls"| node_api
node_api -->|"registers routes"| node_api_control
node_api -->|"registers routes"| node_api_dashboard
node_historical -->|"uses definitions"| node_datasets
node_historical -->|"reads and writes"| node_parquet
node_live -->|"updates buffers"| node_redis
node_trend -->|"processes candles"| node_trend_engine
node_trend -->|"reads candles"| node_redis
node_trend -->|"produces overlays"| node_overlays
node_api -->|"serves overlays"| node_overlays
node_api -->|"serves candle history"| node_parquet
node_backtest -->|"runs strategy"| node_strategy
node_execution -->|"builds intents"| node_strategy
node_execution -->|"evaluates intents"| node_risk
node_execution -.->|"submits orders"| node_exchange
node_api_control -.->|"uses state"| node_postgres
node_universe -.->|"persists universe"| node_postgres

click node_web "https://github.com/sivanujan/deskmind/blob/main/apps/web/src/app/(dashboard)/chart/page.tsx"
click node_web_api "https://github.com/sivanujan/deskmind/blob/main/apps/web/src/lib/api.ts"
click node_api "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/api/app.py"
click node_api_control "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/api/control.py"
click node_api_dashboard "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/api/dashboard.py"
click node_historical "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/data/pipeline.py"
click node_datasets "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/data/datasets.py"
click node_parquet "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/data/storage.py"
click node_live "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/data/live/service.py"
click node_redis "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/data/live/buffers.py"
click node_trend "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/agents/trend/agent.py"
click node_trend_engine "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/agents/trend/engine.py"
click node_overlays "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/agents/trend/overlays.py"
click node_universe "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/universe/daily.py"
click node_backtest "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/backtest/engine.py"
click node_strategy "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/strategies/base.py"
click node_risk "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/risk/evaluator.py"
click node_execution "https://github.com/sivanujan/deskmind/blob/main/src/deskmind/execution/service.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_historical,node_datasets,node_live toneBlue
class node_trend,node_trend_engine,node_overlays,node_universe,node_backtest toneAmber
class node_strategy,node_risk,node_execution,node_exchange toneMint
class node_web,node_web_api,node_api,node_api_control,node_api_dashboard toneRose
class node_parquet,node_redis,node_postgres,node_user toneIndigo
```

## Components

### Market data

- [Historical sync](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/data/pipeline.py): `src/deskmind/data/pipeline.py`
- [Dataset definitions](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/data/datasets.py): `src/deskmind/data/datasets.py`
- [Live market feed](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/data/live/service.py): `src/deskmind/data/live/service.py`

### Analysis

- [Trend agent](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/agents/trend/agent.py): `src/deskmind/agents/trend/agent.py`
- [Trend engine](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/agents/trend/engine.py): `src/deskmind/agents/trend/engine.py`
- [Chart overlays](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/agents/trend/overlays.py): `src/deskmind/agents/trend/overlays.py`
- [Symbol universe](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/universe/daily.py): `src/deskmind/universe/daily.py`
- [Backtesting](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/backtest/engine.py): `src/deskmind/backtest/engine.py`

### Trading

- [Trading strategies](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/strategies/base.py): `src/deskmind/strategies/base.py`
- [Risk evaluation](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/risk/evaluator.py): `src/deskmind/risk/evaluator.py`
- [Execution service](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/execution/service.py): `src/deskmind/execution/service.py`
- **Binance testnet**

### API and dashboard

- [Web dashboard](https://github.com/sivanujan/deskmind/blob/main/apps/web/src/app/(dashboard)/chart/page.tsx): `apps/web/src/app/(dashboard)/chart/page.tsx`
- [Web API client](https://github.com/sivanujan/deskmind/blob/main/apps/web/src/lib/api.ts): `apps/web/src/lib/api.ts`
- [Read-only API](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/api/app.py): `src/deskmind/api/app.py`
- [Control routes](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/api/control.py): `src/deskmind/api/control.py`
- [Dashboard routes](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/api/dashboard.py): `src/deskmind/api/dashboard.py`

### State and storage

- [Historical data store](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/data/storage.py): `src/deskmind/data/storage.py`
- [Live buffers](https://github.com/sivanujan/deskmind/blob/main/src/deskmind/data/live/buffers.py): `src/deskmind/data/live/buffers.py`
- **PostgreSQL**

### Other components

- **Operator**

## Connections

- Operator → Web dashboard: uses (evidence: `README.md`)
- Web dashboard → Web API client: requests data
- Web API client → Read-only API: calls (evidence: `README.md`)
- Read-only API → Control routes: registers routes (evidence: `src/deskmind/api/app.py`)
- Read-only API → Dashboard routes: registers routes (evidence: `src/deskmind/api/app.py`)
- Historical sync → Dataset definitions: uses definitions (evidence: `src/deskmind/data/pipeline.py`)
- Historical sync → Historical data store: reads and writes (evidence: `src/deskmind/data/pipeline.py`)
- Live market feed → Live buffers: updates buffers (evidence: `README.md`)
- Trend agent → Trend engine: processes candles (evidence: `src/deskmind/agents/trend/agent.py`)
- Trend agent → Live buffers: reads candles (evidence: `README.md`)
- Trend agent → Chart overlays: produces overlays (evidence: `README.md`)
- Read-only API → Chart overlays: serves overlays (evidence: `src/deskmind/api/app.py`)
- Read-only API → Historical data store: serves candle history
- Backtesting → Trading strategies: runs strategy (evidence: `src/deskmind/backtest/engine.py`)
- Execution service → Trading strategies: builds intents (evidence: `src/deskmind/execution/service.py`)
- Execution service → Risk evaluation: evaluates intents (evidence: `src/deskmind/execution/service.py`)
- Execution service → Binance testnet: submits orders
- Control routes → PostgreSQL: uses state
- Symbol universe → PostgreSQL: persists universe
