# leopardracer/fletch architecture

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

- Interactive diagram: https://gitdiagram.com/leopardracer/fletch
- Repository: https://github.com/leopardracer/fletch

## Overview

FLETCH is a read-only Robinhood Chain intelligence service: it discovers launches, analyzes token activity and risk, scores and explains findings, then serves feeds and token details in a dashboard. Its durable monitoring worker prioritizes checks and stores reports, snapshots, and signals for fast reads such as Radar. The README documents the main analysis stages and product capabilities; sampled excerpts confirm key orchestration and persistence links, but not every API route or internal call, so uncertain wiring is omitted.

Main entry points: [`src/api/server.ts`](https://github.com/leopardracer/fletch/blob/main/src/api/server.ts) (HTTP API), [`src/signals/signalService.ts`](https://github.com/leopardracer/fletch/blob/main/src/signals/signalService.ts) (Analysis and persistence), [`src/monitoring/monitoringService.ts`](https://github.com/leopardracer/fletch/blob/main/src/monitoring/monitoringService.ts) (Monitoring worker), [`src/intel/tokenIntel.ts`](https://github.com/leopardracer/fletch/blob/main/src/intel/tokenIntel.ts) (Token intelligence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Chain Collection"]
  node_chainclient["Chain client<br/>[client.ts]"]
  node_launchscan["Launch discovery<br/>[hunt.ts]"]
  node_providers["Chain data provider<br/>[rpcProvider.ts]"]
end

subgraph group_analysis["Token Analysis"]
  node_intel["Token intelligence<br/>[tokenIntel.ts]"]
  node_risk["Risk analysis<br/>[riskAnalysis.ts]"]
  node_signals["Signal analysis<br/>[signalEngine.ts]"]
  node_signalservice["Analysis and persistence<br/>[signalService.ts]"]
  node_score["FLETCH Score<br/>[fletchScore.ts]"]
  node_wallets["Wallet intelligence<br/>[smartMoney.ts]"]
  node_social["Social signals<br/>[social.ts]"]
end

subgraph group_monitoring["Monitoring and Persistence"]
  node_monitor["Monitoring worker"]
  node_poller["Background poller<br/>[poller.ts]"]
  node_store[("SQLite database<br/>[db.ts]")]
end

subgraph group_delivery["Product Delivery"]
  node_dashboard["Web dashboard<br/>[app.js]"]
  node_api["HTTP API<br/>[server.ts]"]
  node_radar["Meme Radar<br/>[radarService.ts]"]
end

subgraph group_ai["Optional AI"]
  node_ai["AI explanation<br/>[rephrase.ts]"]
end

node_user(("Dashboard user"))
node_chain{{"Robinhood Chain"}}
node_anthropic{{"Anthropic API"}}

node_user -->|"uses"| node_dashboard
node_dashboard -->|"requests data"| node_api
node_api -->|"returns feeds"| node_dashboard
node_api -->|"checks chain"| node_chainclient
node_chainclient -->|"reads RPC"| node_chain
node_api -->|"scans launches"| node_launchscan
node_launchscan -->|"reads events"| node_chain
node_monitor -->|"discovers launches"| node_launchscan
node_monitor -->|"gets metrics"| node_providers
node_providers -->|"reads chain data"| node_chain
node_poller -->|"runs checks"| node_monitor
node_monitor -->|"builds reports"| node_intel
node_intel -->|"analyzes token"| node_signalservice
node_signalservice -->|"computes risk"| node_risk
node_signalservice -->|"computes score"| node_score
node_signalservice -->|"detects signals"| node_signals
node_signalservice -->|"stores analysis"| node_store
node_monitor -->|"saves reports"| node_store
node_api -->|"gets rankings"| node_radar
node_radar -->|"reads history"| node_store
node_radar -->|"resolves token info"| node_chainclient
node_intel -->|"uses wallet data"| node_wallets
node_intel -->|"uses social data"| node_social
node_api -.->|"optionally rephrases"| node_ai
node_ai -.->|"requests text"| node_anthropic

click node_dashboard "https://github.com/leopardracer/fletch/blob/main/web/app.js"
click node_api "https://github.com/leopardracer/fletch/blob/main/src/api/server.ts"
click node_chainclient "https://github.com/leopardracer/fletch/blob/main/src/chain/client.ts"
click node_launchscan "https://github.com/leopardracer/fletch/blob/main/src/chain/hunt.ts"
click node_providers "https://github.com/leopardracer/fletch/blob/main/src/data/providers/rpcProvider.ts"
click node_monitor "https://github.com/leopardracer/fletch/blob/main/src/monitoring/monitoringService.ts"
click node_poller "https://github.com/leopardracer/fletch/blob/main/src/poller/poller.ts"
click node_intel "https://github.com/leopardracer/fletch/blob/main/src/intel/tokenIntel.ts"
click node_risk "https://github.com/leopardracer/fletch/blob/main/src/risk/riskAnalysis.ts"
click node_signals "https://github.com/leopardracer/fletch/blob/main/src/signals/signalEngine.ts"
click node_signalservice "https://github.com/leopardracer/fletch/blob/main/src/signals/signalService.ts"
click node_score "https://github.com/leopardracer/fletch/blob/main/src/scoring/fletchScore.ts"
click node_wallets "https://github.com/leopardracer/fletch/blob/main/src/wallets/smartMoney.ts"
click node_social "https://github.com/leopardracer/fletch/blob/main/src/social/social.ts"
click node_store "https://github.com/leopardracer/fletch/blob/main/src/persistence/db.ts"
click node_radar "https://github.com/leopardracer/fletch/blob/main/src/radar/radarService.ts"
click node_ai "https://github.com/leopardracer/fletch/blob/main/src/ai/rephrase.ts"

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_chainclient,node_launchscan,node_providers,node_user toneBlue
class node_intel,node_risk,node_signals,node_signalservice,node_score,node_wallets,node_social toneAmber
class node_monitor,node_poller,node_store,node_anthropic toneMint
class node_dashboard,node_api,node_radar toneRose
class node_ai,node_chain toneIndigo
```

## Components

### Chain Collection

- [Chain client](https://github.com/leopardracer/fletch/blob/main/src/chain/client.ts): `src/chain/client.ts`
- [Launch discovery](https://github.com/leopardracer/fletch/blob/main/src/chain/hunt.ts): `src/chain/hunt.ts`
- [Chain data provider](https://github.com/leopardracer/fletch/blob/main/src/data/providers/rpcProvider.ts): `src/data/providers/rpcProvider.ts`

### Token Analysis

- [Token intelligence](https://github.com/leopardracer/fletch/blob/main/src/intel/tokenIntel.ts): `src/intel/tokenIntel.ts`
- [Risk analysis](https://github.com/leopardracer/fletch/blob/main/src/risk/riskAnalysis.ts): `src/risk/riskAnalysis.ts`
- [Signal analysis](https://github.com/leopardracer/fletch/blob/main/src/signals/signalEngine.ts): `src/signals/signalEngine.ts`
- [Analysis and persistence](https://github.com/leopardracer/fletch/blob/main/src/signals/signalService.ts): `src/signals/signalService.ts`
- [FLETCH Score](https://github.com/leopardracer/fletch/blob/main/src/scoring/fletchScore.ts): `src/scoring/fletchScore.ts`
- [Wallet intelligence](https://github.com/leopardracer/fletch/blob/main/src/wallets/smartMoney.ts): `src/wallets/smartMoney.ts`
- [Social signals](https://github.com/leopardracer/fletch/blob/main/src/social/social.ts): `src/social/social.ts`

### Monitoring and Persistence

- [Monitoring worker](https://github.com/leopardracer/fletch/blob/main/src/monitoring/monitoringService.ts): `src/monitoring/monitoringService.ts`
- [Background poller](https://github.com/leopardracer/fletch/blob/main/src/poller/poller.ts): `src/poller/poller.ts`
- [SQLite database](https://github.com/leopardracer/fletch/blob/main/src/persistence/db.ts): `src/persistence/db.ts`

### Product Delivery

- [Web dashboard](https://github.com/leopardracer/fletch/blob/main/web/app.js): `web/app.js`
- [HTTP API](https://github.com/leopardracer/fletch/blob/main/src/api/server.ts): `src/api/server.ts`
- [Meme Radar](https://github.com/leopardracer/fletch/blob/main/src/radar/radarService.ts): `src/radar/radarService.ts`

### Optional AI

- [AI explanation](https://github.com/leopardracer/fletch/blob/main/src/ai/rephrase.ts): `src/ai/rephrase.ts`

### Other components

- **Dashboard user**
- **Robinhood Chain**
- **Anthropic API**

## Connections

- Dashboard user → Web dashboard: uses
- Web dashboard → HTTP API: requests data
- HTTP API → Web dashboard: returns feeds
- HTTP API → Chain client: checks chain
- Chain client → Robinhood Chain: reads RPC
- HTTP API → Launch discovery: scans launches
- Launch discovery → Robinhood Chain: reads events
- Monitoring worker → Launch discovery: discovers launches
- Monitoring worker → Chain data provider: gets metrics
- Chain data provider → Robinhood Chain: reads chain data
- Background poller → Monitoring worker: runs checks
- Monitoring worker → Token intelligence: builds reports
- Token intelligence → Analysis and persistence: analyzes token
- Analysis and persistence → Risk analysis: computes risk
- Analysis and persistence → FLETCH Score: computes score
- Analysis and persistence → Signal analysis: detects signals
- Analysis and persistence → SQLite database: stores analysis
- Monitoring worker → SQLite database: saves reports
- HTTP API → Meme Radar: gets rankings
- Meme Radar → SQLite database: reads history
- Meme Radar → Chain client: resolves token info
- Token intelligence → Wallet intelligence: uses wallet data
- Token intelligence → Social signals: uses social data
- HTTP API → AI explanation: optionally rephrases
- AI explanation → Anthropic API: requests text
