# Technical Architecture

### **Overview:**&#x20;

* **Frontend**: Web-based interface built with React and TypeScript.
  * Includes an IDE-like code editor for advanced users.
  * Chat interface powered by LLM for natural language strategy creation.
  * Visualization components for backtest/live results (charts, graphs).
  * UI elements: sliders, dropdowns, toggles, tables, and searchable marketplace listings.
* **Backend**: Python-based microservices.
  * Handles strategy parsing, backtesting (using Freqtrade), and live trading.
  * RESTful or GraphQL API layer for authentication, strategy management, and marketplace operations.
  * Token-based authentication (e.g., JWT).
* **Containerization & Isolation**:
  * All microservices run in Docker containers, orchestrated via Kubernetes.
  * User sessions/strategies isolated in containers to prevent data leaks.
  * Follows Docker best practices (read-only file systems, security profiles).

### **2. Infrastructure (Hosted on GCP)**

* **Kubernetes Cluster**:
  * Autoscaling handles spikes in load (e.g., during backtests).
  * Load balancers distribute traffic across pods.
  * Secrets managed via Kubernetes Secrets.
* **Networking & Security**:
  * VPC with private subnets for databases and compute clusters.
  * Public subnets for UI/API gateways.
  * All traffic encrypted with TLS/SSL.
  * Role-based access control (RBAC) for Kubernetes resources.
  * API rate limiting and OAuth 2.0/JWT-based access control.
* **Storage & Logging**:
  * Historical price data stored in BigQuery or Cloud Storage.
  * Backtest results (CSV, JSON, performance charts) stored in Cloud Storage.
  * Logs and metrics sent to Cloud Logging and Monitoring.
  * Persistent volumes for data, logs, and backtest results.
* **Databases**:
  * Managed databases (Cloud SQL or Firestore) store user data, strategies, and marketplace metadata.
* **Failover & Redundancy**:
  * Geo-redundant hosting for high availability.
  * Automated backups and restore procedures for critical data.

### **3. Freqtrade Integration**

* Leverages Freqtrade for both backtesting and live trading.
* Custom adapters support:
  * Data cleaning and transformation.
  * Indicator calculations.
  * Order execution and management.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://modern-stoic-ai.gitbook.io/hypertrade-ai/getting-started/technical-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
