# rezafaghani/vantrel architecture

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

- Interactive diagram: https://gitdiagram.com/rezafaghani/vantrel
- Repository: https://github.com/rezafaghani/vantrel

## Overview

Vantrel is an early-stage market-data platform; the implemented product slice is a local synthetic-market pipeline, a Series Catalog API, and the MRX raw-archive library and CLI. In the local workflow, a user runs a batch through the pipeline, which generates records, captures raw bytes, parses and validates canonical events, and publishes supported observations to QuestDB for dashboard queries. The catalog is a separate API-backed domain. This map reflects the sampled implementation; README capabilities such as trading, surveillance, AI/ML, and Kafka/Flink are platform direction, not implemented services in the shown tree.

Main entry points: [`libs/go/ingestion/ingestion.go`](https://github.com/rezafaghani/vantrel/blob/main/libs/go/ingestion/ingestion.go) (Ingestion runtime), [`services/local-pipeline/main.go`](https://github.com/rezafaghani/vantrel/blob/main/services/local-pipeline/main.go) (Pipeline dashboard), [`libs/go/catalog/catalog.go`](https://github.com/rezafaghani/vantrel/blob/main/libs/go/catalog/catalog.go) (Catalog core), [`libs/go/marketstore/ingestion.go`](https://github.com/rezafaghani/vantrel/blob/main/libs/go/marketstore/ingestion.go) (Observation publisher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Market pipeline"]
  node_dashboard["Pipeline dashboard<br/>[main.go]"]
  node_pipeline_runner["Batch orchestrator<br/>[main.go]"]
  node_synthetic_source["Synthetic source<br/>[source.go]"]
  node_ingestion_runtime["Ingestion runtime<br/>[ingestion.go]"]
  node_validator["Event validation<br/>[validation.go]"]
  node_observation_publisher["Observation publisher<br/>[ingestion.go]"]
  node_market_store["Market store<br/>[marketstore.go]"]
end

subgraph group_catalog["Series catalog"]
  node_catalog_api["Catalog API<br/>[api.go]"]
  node_catalog_core["Catalog core<br/>[catalog.go]"]
  node_catalog_memory["Memory catalog store<br/>[memory_store.go]"]
  node_synthetic_catalog["Synthetic catalog setup<br/>[catalog.go]"]
end

subgraph group_archive["Raw archive"]
  node_raw_sink["Raw capture sink<br/>[sink.go]"]
  node_mrx_format["MRX archive format<br/>[mrx.go]"]
  node_mrx_cli["MRX CLI<br/>[main.go]"]
end

subgraph group_contracts["Market contracts"]
  node_market_contracts["Canonical market contracts<br/>[market.proto]"]
end

node_user(("User"))
node_questdb[("QuestDB")]

node_user -->|"runs batch"| node_dashboard
node_dashboard -->|"invokes run"| node_pipeline_runner
node_dashboard -->|"queries and writes"| node_questdb
node_pipeline_runner -->|"uses source"| node_synthetic_source
node_pipeline_runner -->|"runs ingestion"| node_ingestion_runtime
node_ingestion_runtime -->|"captures records"| node_raw_sink
node_raw_sink -->|"writes frames"| node_mrx_format
node_ingestion_runtime -->|"validates events"| node_validator
node_ingestion_runtime -->|"publishes events"| node_observation_publisher
node_observation_publisher -->|"writes observations"| node_market_store
node_market_store -->|"stores observations"| node_questdb
node_user -->|"inspects archives"| node_mrx_cli
node_catalog_api -->|"calls catalog store"| node_catalog_core
node_synthetic_catalog -->|"registers series"| node_catalog_core
node_catalog_memory -->|"implements store"| node_catalog_core

click node_dashboard "https://github.com/rezafaghani/vantrel/blob/main/services/local-pipeline/main.go"
click node_pipeline_runner "https://github.com/rezafaghani/vantrel/blob/main/services/local-pipeline/main.go"
click node_synthetic_source "https://github.com/rezafaghani/vantrel/blob/main/libs/go/synthetic/source.go"
click node_ingestion_runtime "https://github.com/rezafaghani/vantrel/blob/main/libs/go/ingestion/ingestion.go"
click node_raw_sink "https://github.com/rezafaghani/vantrel/blob/main/libs/go/rawarchive/sink.go"
click node_mrx_format "https://github.com/rezafaghani/vantrel/blob/main/libs/go/mrx/mrx.go"
click node_mrx_cli "https://github.com/rezafaghani/vantrel/blob/main/libs/go/mrx/cmd/mrx/main.go"
click node_validator "https://github.com/rezafaghani/vantrel/blob/main/libs/go/validation/validation.go"
click node_observation_publisher "https://github.com/rezafaghani/vantrel/blob/main/libs/go/marketstore/ingestion.go"
click node_market_store "https://github.com/rezafaghani/vantrel/blob/main/libs/go/marketstore/marketstore.go"
click node_catalog_api "https://github.com/rezafaghani/vantrel/blob/main/services/catalog-api/api.go"
click node_catalog_core "https://github.com/rezafaghani/vantrel/blob/main/libs/go/catalog/catalog.go"
click node_catalog_memory "https://github.com/rezafaghani/vantrel/blob/main/libs/go/catalog/memory_store.go"
click node_synthetic_catalog "https://github.com/rezafaghani/vantrel/blob/main/libs/go/synthetic/catalog.go"
click node_market_contracts "https://github.com/rezafaghani/vantrel/blob/main/contracts/proto/vantrel/market/v1/market.proto"

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_dashboard,node_pipeline_runner,node_synthetic_source,node_ingestion_runtime,node_validator,node_observation_publisher,node_market_store,node_user toneBlue
class node_catalog_api,node_catalog_core,node_catalog_memory,node_synthetic_catalog,node_questdb toneAmber
class node_raw_sink,node_mrx_format,node_mrx_cli toneMint
class node_market_contracts toneRose
```

## Components

### Market pipeline

- [Pipeline dashboard](https://github.com/rezafaghani/vantrel/blob/main/services/local-pipeline/main.go): `services/local-pipeline/main.go`
- [Batch orchestrator](https://github.com/rezafaghani/vantrel/blob/main/services/local-pipeline/main.go): `services/local-pipeline/main.go`
- [Synthetic source](https://github.com/rezafaghani/vantrel/blob/main/libs/go/synthetic/source.go): `libs/go/synthetic/source.go`
- [Ingestion runtime](https://github.com/rezafaghani/vantrel/blob/main/libs/go/ingestion/ingestion.go): `libs/go/ingestion/ingestion.go`
- [Event validation](https://github.com/rezafaghani/vantrel/blob/main/libs/go/validation/validation.go): `libs/go/validation/validation.go`
- [Observation publisher](https://github.com/rezafaghani/vantrel/blob/main/libs/go/marketstore/ingestion.go): `libs/go/marketstore/ingestion.go`
- [Market store](https://github.com/rezafaghani/vantrel/blob/main/libs/go/marketstore/marketstore.go): `libs/go/marketstore/marketstore.go`

### Series catalog

- [Catalog API](https://github.com/rezafaghani/vantrel/blob/main/services/catalog-api/api.go): `services/catalog-api/api.go`
- [Catalog core](https://github.com/rezafaghani/vantrel/blob/main/libs/go/catalog/catalog.go): `libs/go/catalog/catalog.go`
- [Memory catalog store](https://github.com/rezafaghani/vantrel/blob/main/libs/go/catalog/memory_store.go): `libs/go/catalog/memory_store.go`
- [Synthetic catalog setup](https://github.com/rezafaghani/vantrel/blob/main/libs/go/synthetic/catalog.go): `libs/go/synthetic/catalog.go`

### Raw archive

- [Raw capture sink](https://github.com/rezafaghani/vantrel/blob/main/libs/go/rawarchive/sink.go): `libs/go/rawarchive/sink.go`
- [MRX archive format](https://github.com/rezafaghani/vantrel/blob/main/libs/go/mrx/mrx.go): `libs/go/mrx/mrx.go`
- [MRX CLI](https://github.com/rezafaghani/vantrel/blob/main/libs/go/mrx/cmd/mrx/main.go): `libs/go/mrx/cmd/mrx/main.go`

### Market contracts

- [Canonical market contracts](https://github.com/rezafaghani/vantrel/blob/main/contracts/proto/vantrel/market/v1/market.proto): `contracts/proto/vantrel/market/v1/market.proto`

### Other components

- **User**
- **QuestDB**

## Connections

- User → Pipeline dashboard: runs batch (evidence: `services/local-pipeline/main.go`)
- Pipeline dashboard → Batch orchestrator: invokes run (evidence: `services/local-pipeline/main.go`)
- Pipeline dashboard → QuestDB: queries and writes (evidence: `services/local-pipeline/main.go`)
- Batch orchestrator → Synthetic source: uses source (evidence: `services/local-pipeline/main.go`)
- Batch orchestrator → Ingestion runtime: runs ingestion (evidence: `services/local-pipeline/main.go`)
- Ingestion runtime → Raw capture sink: captures records (evidence: `libs/go/ingestion/ingestion.go`)
- Raw capture sink → MRX archive format: writes frames (evidence: `libs/go/rawarchive/sink.go`)
- Ingestion runtime → Event validation: validates events (evidence: `libs/go/ingestion/ingestion.go`)
- Ingestion runtime → Observation publisher: publishes events (evidence: `libs/go/ingestion/ingestion.go`)
- Observation publisher → Market store: writes observations (evidence: `libs/go/marketstore/ingestion.go`)
- Market store → QuestDB: stores observations
- User → MRX CLI: inspects archives (evidence: `libs/go/mrx/cmd/mrx/main.go`)
- Catalog API → Catalog core: calls catalog store (evidence: `services/catalog-api/api.go`)
- Synthetic catalog setup → Catalog core: registers series (evidence: `libs/go/synthetic/catalog.go`)
- Memory catalog store → Catalog core: implements store (evidence: `libs/go/catalog/memory_store.go`)
