# sahniaditya007/crypto-pilot-ai-models architecture

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

- Interactive diagram: https://gitdiagram.com/sahniaditya007/crypto-pilot-ai-models
- Repository: https://github.com/sahniaditya007/crypto-pilot-ai-models

## Overview

Crypto Bot exposes three analysis workflows: sentiment-driven recommendations, iceberg-order detection, and cross-exchange arbitrage scanning. Users can initiate them through the CLI or web demo; the README also documents direct module entry points. The sentiment workflow collects news, social, and market inputs for analysis and recommendation generation, while iceberg detection evaluates order-book patterns and arbitrage compares live exchange prices before optional orders. Sampled source confirms the sentiment collector and recommender are constructed by its pipeline and the interface dispatches to modules; some intermediate sentiment-stage wiring is documented but unsampled.

Main entry points: [`cli.py`](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/cli.py) (CLI commands), [`src/arbitrage/arbitrage_checker.py`](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/arbitrage/arbitrage_checker.py) (Arbitrage scanner), [`src/sentiment/main.py`](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/main.py) (Sentiment pipeline), [`src/iceberg/iceberg_detector.py`](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/iceberg/iceberg_detector.py) (Order-book detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_web["Web demo API<br/>[main.py]"]
end

subgraph group_sentiment["Sentiment analysis"]
  node_pipeline["Sentiment pipeline<br/>[main.py]"]
  node_collector["Data collection<br/>[data_collection.py]"]
  node_sentiment_engine["Sentiment scoring"]
  node_market["Market trends<br/>[market_analysis.py]"]
  node_prediction["Price prediction"]
  node_model_training["Model training<br/>[model_training.py]"]
  node_evaluation["Model evaluation"]
  node_recommender["Recommendations"]
end

subgraph group_iceberg["Iceberg detection"]
  node_iceberg_entry["Iceberg runner<br/>[run_prediction.py]"]
  node_iceberg_detector["Order-book detector"]
end

subgraph group_arbitrage["Arbitrage scanning"]
  node_arb_checker["Arbitrage scanner"]
  node_binance_connect["Binance connection<br/>[binance_connect.py]"]
  node_book_fetcher["Order-book fetcher"]
end

node_user(("User"))
node_news_social{{"News and social APIs"}}
node_market_data{{"Market data APIs"}}
node_exchange_data{{"Exchange order books"}}
node_binance{{"Binance"}}
node_kraken{{"Kraken"}}

node_user -->|"runs command"| node_cli
node_user -->|"uses demo"| node_web
node_cli -->|"runs recommendations"| node_pipeline
node_cli -->|"runs detection"| node_iceberg_detector
node_cli -->|"starts scanner"| node_arb_checker
node_web -->|"requests recommendations"| node_pipeline
node_web -->|"requests demo"| node_iceberg_detector
node_pipeline -->|"collects data"| node_collector
node_pipeline -->|"gets recommendations"| node_recommender
node_collector -->|"fetches content"| node_news_social
node_collector -->|"fetches metrics"| node_market_data
node_sentiment_engine -->|"scores content"| node_news_social
node_market -->|"analyzes metrics"| node_market_data
node_prediction -->|"uses market data"| node_market_data
node_recommender -->|"loads listings"| node_market_data
node_iceberg_entry -->|"runs prediction"| node_iceberg_detector
node_iceberg_detector -->|"fetches order book"| node_exchange_data
node_arb_checker -->|"fetches prices; places orders"| node_binance
node_arb_checker -->|"fetches prices; places orders"| node_kraken
node_arb_checker -->|"reads order books"| node_exchange_data
node_binance_connect -->|"fetches ticker"| node_binance
node_book_fetcher -->|"fetches order book"| node_binance

click node_cli "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/cli.py"
click node_web "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/main.py"
click node_pipeline "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/main.py"
click node_collector "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/data_collection.py"
click node_sentiment_engine "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/sentiment_analysis.py"
click node_market "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/market_analysis.py"
click node_prediction "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/prediction_generation.py"
click node_model_training "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/model_training.py"
click node_evaluation "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/evaluation_metrics.py"
click node_recommender "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/recommendation_system.py"
click node_iceberg_entry "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/iceberg/run_prediction.py"
click node_iceberg_detector "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/iceberg/iceberg_detector.py"
click node_arb_checker "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/arbitrage/arbitrage_checker.py"
click node_binance_connect "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/arbitrage/binance_connect.py"
click node_book_fetcher "https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/arbitrage/fetch_order_book.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_cli,node_web,node_user toneBlue
class node_pipeline,node_collector,node_sentiment_engine,node_market,node_prediction,node_model_training,node_evaluation,node_recommender toneAmber
class node_iceberg_entry,node_iceberg_detector,node_news_social,node_market_data toneMint
class node_arb_checker,node_binance_connect,node_book_fetcher toneRose
class node_exchange_data,node_binance,node_kraken toneIndigo
```

## Components

### User interfaces

- [CLI commands](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/cli.py): `cli.py`
- [Web demo API](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/main.py): `main.py`

### Sentiment analysis

- [Sentiment pipeline](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/main.py): `src/sentiment/main.py`
- [Data collection](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/data_collection.py): `src/sentiment/data_collection.py`
- [Sentiment scoring](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/sentiment_analysis.py): `src/sentiment/sentiment_analysis.py`
- [Market trends](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/market_analysis.py): `src/sentiment/market_analysis.py`
- [Price prediction](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/prediction_generation.py): `src/sentiment/prediction_generation.py`
- [Model training](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/model_training.py): `src/sentiment/model_training.py`
- [Model evaluation](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/evaluation_metrics.py): `src/sentiment/evaluation_metrics.py`
- [Recommendations](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/sentiment/recommendation_system.py): `src/sentiment/recommendation_system.py`

### Iceberg detection

- [Iceberg runner](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/iceberg/run_prediction.py): `src/iceberg/run_prediction.py`
- [Order-book detector](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/iceberg/iceberg_detector.py): `src/iceberg/iceberg_detector.py`

### Arbitrage scanning

- [Arbitrage scanner](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/arbitrage/arbitrage_checker.py): `src/arbitrage/arbitrage_checker.py`
- [Binance connection](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/arbitrage/binance_connect.py): `src/arbitrage/binance_connect.py`
- [Order-book fetcher](https://github.com/sahniaditya007/crypto-pilot-ai-models/blob/main/src/arbitrage/fetch_order_book.py): `src/arbitrage/fetch_order_book.py`

### Other components

- **User**
- **News and social APIs**
- **Market data APIs**
- **Exchange order books**
- **Binance**
- **Kraken**

## Connections

- User → CLI commands: runs command
- User → Web demo API: uses demo
- CLI commands → Sentiment pipeline: runs recommendations
- CLI commands → Order-book detector: runs detection
- CLI commands → Arbitrage scanner: starts scanner
- Web demo API → Sentiment pipeline: requests recommendations
- Web demo API → Order-book detector: requests demo
- Sentiment pipeline → Data collection: collects data
- Sentiment pipeline → Recommendations: gets recommendations
- Data collection → News and social APIs: fetches content
- Data collection → Market data APIs: fetches metrics
- Sentiment scoring → News and social APIs: scores content
- Market trends → Market data APIs: analyzes metrics
- Price prediction → Market data APIs: uses market data
- Recommendations → Market data APIs: loads listings
- Iceberg runner → Order-book detector: runs prediction
- Order-book detector → Exchange order books: fetches order book
- Arbitrage scanner → Binance: fetches prices; places orders
- Arbitrage scanner → Kraken: fetches prices; places orders
- Arbitrage scanner → Exchange order books: reads order books
- Binance connection → Binance: fetches ticker
- Order-book fetcher → Binance: fetches order book
