> ## Documentation Index
> Fetch the complete documentation index at: https://cryptorobot.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Architecture and core concepts of the Cryptorobot.ai platform

## Platform Architecture

Cryptorobot.ai is built on a **real-time microservices architecture**. The API supports both REST and WebSocket transports, giving you flexibility in how you consume data.

```mermaid theme={null}
graph TD
    Client[Your Application] -->|REST / WebSocket| API[Cryptorobot.ai API]
    API --> Auth[Authentication]
    API --> Exchanges[Exchange Connections]
    API --> Strategies[Strategy Engine]
    API --> Traders[Trading Bots]
    API --> Insights[Market Data]
    Exchanges --> Binance[Binance]
    Exchanges --> Bybit[Bybit]
    Exchanges --> OKX[OKX]
    Exchanges --> More[50+ Exchanges]
    Strategies --> Backtest[Backtesting]
    Strategies --> AI[AI Generation]
    Traders --> Pods[Trading Pods]
```

## Transports

<CardGroup cols={2}>
  <Card title="REST API" icon="globe">
    Standard HTTP requests with JSON responses. Best for CRUD operations, one-off queries, and server-to-server integration.
  </Card>

  <Card title="WebSocket" icon="bolt">
    Persistent connections with real-time event streaming. Best for live price feeds, trade notifications, and bot status updates.
  </Card>
</CardGroup>

### REST Conventions

The API follows RESTful conventions for all resources:

| Action | HTTP Method | Path            | Description                 |
| ------ | ----------- | --------------- | --------------------------- |
| Find   | `GET`       | `/resource`     | List resources (paginated)  |
| Get    | `GET`       | `/resource/:id` | Get a single resource       |
| Create | `POST`      | `/resource`     | Create a new resource       |
| Patch  | `PATCH`     | `/resource/:id` | Partially update a resource |
| Remove | `DELETE`    | `/resource/:id` | Delete a resource           |

### Pagination

All `find` (list) endpoints return paginated results:

```json theme={null}
{
  "total": 142,
  "limit": 25,
  "skip": 0,
  "data": [...]
}
```

Use query parameters to control pagination:

| Parameter      | Type    | Default | Description                    |
| -------------- | ------- | ------- | ------------------------------ |
| `$limit`       | integer | 25      | Max items per page (max 100)   |
| `$skip`        | integer | 0       | Number of items to skip        |
| `$sort[field]` | 1 or -1 | —       | Sort by field (1=asc, -1=desc) |
| `$select[]`    | string  | —       | Fields to include in response  |

### Filtering

Query parameters support rich filtering:

```bash theme={null}
# Find strategies where type is "momentum"
GET /strategies?type=momentum

# Find trades after a date
GET /trades?createdAt[$gte]=2024-01-01

# Find with multiple conditions
GET /exchanges?active=true&$sort[createdAt]=-1&$limit=10
```

Supported operators: `$gt`, `$gte`, `$lt`, `$lte`, `$ne`, `$in`, `$nin`, `$or`.

## Core Resources

<AccordionGroup>
  <Accordion title="Exchanges" icon="building-columns">
    Exchange connections represent your linked cryptocurrency exchange accounts (Binance, Bybit, OKX, etc.). Through these, you can fetch balances, market data, and execute trades.
  </Accordion>

  <Accordion title="Strategies" icon="brain">
    Trading strategies define the rules for automated trading. They include technical indicators, entry/exit conditions, and risk parameters. Strategies can be backtested, optimized with hyperparameter tuning, or generated by AI.
  </Accordion>

  <Accordion title="Traders & Pods" icon="robot">
    Traders are live trading bot instances. Each trader runs inside a **Pod** — an isolated execution environment with its own configuration, API keys, and event stream.
  </Accordion>

  <Accordion title="Models & Signals" icon="signal">
    Machine learning models that generate trading signals. You can subscribe to signals and receive real-time notifications when conditions are met.
  </Accordion>

  <Accordion title="Insights" icon="chart-mixed">
    Market intelligence data including ETF flows, fear & greed index, crypto stress index, global market stats, and curated news feeds.
  </Accordion>

  <Accordion title="Portfolio" icon="chart-pie">
    Aggregate view of your holdings across all connected exchanges, including balance time-series, performance metrics, and trade history.
  </Accordion>
</AccordionGroup>

## Data Flow

```mermaid theme={null}
sequenceDiagram
    participant App as Your App
    participant API as Cryptorobot.ai
    participant Exchange as Binance

    App->>API: POST /exchanges (connect exchange)
    API-->>App: Exchange connected
    App->>API: POST /strategies (create strategy)
    API-->>App: Strategy created
    App->>API: POST /strategies/backtest (test it)
    API-->>App: Backtest results
    App->>API: POST /traders (deploy bot)
    API->>Exchange: Execute trades
    Exchange-->>API: Trade confirmations
    API-->>App: Real-time events (WebSocket)
```

## Rate Limits

| Tier       | Requests/min | WebSocket connections |
| ---------- | ------------ | --------------------- |
| Free       | 60           | 1                     |
| Pro        | 300          | 5                     |
| Enterprise | 1000         | 25                    |

See [Errors & Rate Limits](/guides/errors) for details on handling rate limit responses.
