# drakkar-software/octobot architecture

> Architecture diagram of the GitHub repository drakkar-software/octobot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/drakkar-software/octobot
- Repository: https://github.com/drakkar-software/octobot

## Overview

##### Project Type and Purpose
- OctoBot is an open-source, Python-based cryptocurrency trading robot.
- It is primarily a backend/CLI application (no bundled frontend UI in this repo) that:
- Automates live trading on multiple exchanges (via CCXT)
- Provides a built-in backtesting engine
- Supports strategy optimization
- Integrates “community” reporting (via Supabase, MQTT, WebSockets)
- Self-updates (binary and Python updaters)
- Runs in Docker or directly on a server/desktop

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Local Container"
        subgraph "CLI & Configuration"
            CLI["start.py / octobot/cli.py / octobot/commands.py"]:::core
            click CLI "https://github.com/drakkar-software/octobot/blob/master/start.py"
            click CLI "https://github.com/drakkar-software/octobot/blob/master/octobot/cli.py"
            click CLI "https://github.com/drakkar-software/octobot/blob/master/octobot/commands.py"
            CONFIG["configuration_manager.py"]:::core
            click CONFIG "https://github.com/drakkar-software/octobot/blob/master/octobot/configuration_manager.py"
            CONFIG_JSON["default_config.json / profile_schema.json"]:::core
            click CONFIG_JSON "https://github.com/drakkar-software/octobot/blob/master/octobot/config/default_config.json"
            click CONFIG_JSON "https://github.com/drakkar-software/octobot/blob/master/octobot/config/profile_schema.json"
        end
        subgraph "Core Engine"
            ENGINE["octobot/octobot.py"]:::core
            click ENGINE "https://github.com/drakkar-software/octobot/blob/master/octobot/octobot.py"
            TASK["octobot/task_manager.py"]:::core
            click TASK "https://github.com/drakkar-software/octobot/blob/master/octobot/task_manager.py"
        end
        subgraph "Producers" 
            EXCH_PROD["ExchangeProducer"]:::producer
            click EXCH_PROD "https://github.com/drakkar-software/octobot/blob/master/octobot/producers/exchange_producer.py"
            EVAL_PROD["EvaluatorProducer"]:::producer
            click EVAL_PROD "https://github.com/drakkar-software/octobot/blob/master/octobot/producers/evaluator_producer.py"
            INT_PROD["InterfaceProducer"]:::producer
            click INT_PROD "https://github.com/drakkar-software/octobot/blob/master/octobot/producers/interface_producer.py"
            SF_PROD["ServiceFeedProducer"]:::producer
            click SF_PROD "https://github.com/drakkar-software/octobot/blob/master/octobot/producers/service_feed_producer.py"
        end
        subgraph "Automation Pipeline"
            AUTO_CORE["automation.py"]:::automation
            click AUTO_CORE "https://github.com/drakkar-software/octobot/blob/master/octobot/automation/automation.py"
            TRIGGER["abstract_trigger_event"]:::automation
            click TRIGGER "https://github.com/drakkar-software/octobot/blob/master/octobot/automation/bases/abstract_trigger_event.py"
            STEP["automation_step"]:::automation
            click STEP "https://github.com/drakkar-software/octobot/blob/master/octobot/automation/bases/automation_step.py"
            CONDITION["abstract_condition"]:::automation
            click CONDITION "https://github.com/drakkar-software/octobot/blob/master/octobot/automation/bases/abstract_condition.py"
            ACTION["abstract_action"]:::automation
            click ACTION "https://github.com/drakkar-software/octobot/blob/master/octobot/automation/bases/abstract_action.py"
        end
        subgraph "Channels"
            CHANNEL["octobot_channel"]:::channels
            click CHANNEL "https://github.com/drakkar-software/octobot/blob/master/octobot/channels/octobot_channel.py"
        end
        subgraph "Storage Layer"
            META["trading_metadata"]:::storage
            click META "https://github.com/drakkar-software/octobot/blob/master/octobot/storage/trading_metadata.py"
            PRUNE["db_databases_pruning"]:::storage
            click PRUNE "https://github.com/drakkar-software/octobot/blob/master/octobot/storage/db_databases_pruning.py"
        end
        subgraph "Backtesting Module"
            BACKCORE["octobot_backtesting"]:::backtesting
            click BACKCORE "https://github.com/drakkar-software/octobot/blob/master/octobot/backtesting/octobot_backtesting.py"
            INDEP["independent_backtesting"]:::backtesting
            click INDEP "https://github.com/drakkar-software/octobot/blob/master/octobot/backtesting/independent_backtesting.py"
            ABT["abstract_backtesting_test"]:::backtesting
            click ABT "https://github.com/drakkar-software/octobot/blob/master/octobot/backtesting/abstract_backtesting_test.py"
        end
        subgraph "Strategy Optimizer"
            SO_CORE["strategy_optimizer"]:::optimizer
            click SO_CORE "https://github.com/drakkar-software/octobot/blob/master/octobot/strategy_optimizer/strategy_optimizer.py"
            DESIGN["strategy_design_optimizer"]:::optimizer
            click DESIGN "https://github.com/drakkar-software/octobot/blob/master/octobot/strategy_optimizer/strategy_design_optimizer.py"
            SUITE["strategy_test_suite"]:::optimizer
            click SUITE "https://github.com/drakkar-software/octobot/blob/master/octobot/strategy_optimizer/strategy_test_suite.py"
            SETTINGS["optimizer_settings"]:::optimizer
            click SETTINGS "https://github.com/drakkar-software/octobot/blob/master/octobot/strategy_optimizer/optimizer_settings.py"
            FILTER["optimizer_filter"]:::optimizer
            click FILTER "https://github.com/drakkar-software/octobot/blob/master/octobot/strategy_optimizer/optimizer_filter.py"
        end
        subgraph "Community & Error Tracking"
            COM_MGR["community_manager"]:::community
            click COM_MGR "https://github.com/drakkar-software/octobot/blob/master/octobot/community/community_manager.py"
            MQTT["community_mqtt_feed"]:::community
            click MQTT "https://github.com/drakkar-software/octobot/blob/master/octobot/community/feeds/community_mqtt_feed.py"
            SUPA_FEED["community_supabase_feed"]:::community
            click SUPA_FEED "https://github.com/drakkar-software/octobot/blob/master/octobot/community/feeds/community_supabase_feed.py"
            WSFEED["community_ws_feed"]:::community
            click WSFEED "https://github.com/drakkar-software/octobot/blob/master/octobot/community/feeds/community_ws_feed.py"
            SUPA_CLIENT["community_supabase_client"]:::community
            click SUPA_CLIENT "https://github.com/drakkar-software/octobot/blob/master/octobot/community/supabase_backend/community_supabase_client.py"
            SENTRY["sentry_tracker"]:::community
            click SENTRY "https://github.com/drakkar-software/octobot/blob/master/octobot/community/errors_upload/sentry_tracker.py"
        end
        subgraph "Updater"
            UPD_CORE["updater"]:::updater
            click UPD_CORE "https://github.com/drakkar-software/octobot/blob/master/octobot/updater/updater.py"
            BIN_UPD["binary_updater"]:::updater
            click BIN_UPD "https://github.com/drakkar-software/octobot/blob/master/octobot/updater/binary_updater.py"
            PY_UPD["python_updater"]:::updater
            click PY_UPD "https://github.com/drakkar-software/octobot/blob/master/octobot/updater/python_updater.py"
            UFAC["updater_factory"]:::updater
            click UFAC "https://github.com/drakkar-software/octobot/blob/master/octobot/updater/updater_factory.py"
        end
    end

    subgraph "External Services"
        EXCH["Exchanges (via CCXT)"]:::external
        SUPA_EXT["Supabase Backend"]:::external
        MQTT_EXT["MQTT Broker"]:::external
        WS_EXT["WebSocket Endpoint"]:::external
        SENTRY_EXT["Sentry & Chatwoot"]:::external
    end

    CLI --> CONFIG --> ENGINE
    ENGINE --> EXCH_PROD
    ENGINE --> EVAL_PROD
    ENGINE --> INT_PROD
    ENGINE --> SF_PROD
    EXCH_PROD -->|market data| AUTO_CORE
    EVAL_PROD -->|evaluations| AUTO_CORE
    INT_PROD -->|external events| AUTO_CORE
    SF_PROD -->|feeds| AUTO_CORE
    AUTO_CORE --> TRIGGER --> CONDITION --> ACTION --> CHANNEL
    CHANNEL -->|CCXT calls| EXCH
    EXCH -->|execution results| CHANNEL
    CHANNEL --> META
    CHANNEL --> PRUNE
    BACKCORE --> META
    BACKCORE --> EVAL_PROD
    SO_CORE --> META
    COM_MGR -->|stats| SUPA_EXT
    COM_MGR -->|stats| MQTT_EXT
    COM_MGR -->|stats| WS_EXT
    ENGINE --> COM_MGR
    UPD_CORE -->|poll| SUPA_EXT

    classDef core fill:#9f6,stroke:#060,stroke-width:1px
    classDef producer fill:#6cf,stroke:#039,stroke-width:1px
    classDef automation fill:#6cf,stroke:#039,stroke-width:1px
    classDef channels fill:#6c9,stroke:#093,stroke-width:1px
    classDef storage fill:#ccc,stroke:#666,stroke-width:1px
    classDef backtesting fill:#ccf,stroke:#339,stroke-width:1px
    classDef optimizer fill:#ccf,stroke:#339,stroke-width:1px
    classDef community fill:#f9c,stroke:#c60,stroke-width:1px
    classDef updater fill:#fc6,stroke:#c90,stroke-width:1px
    classDef external fill:#f96,stroke:#930,stroke-width:1px
```
