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

# Market Data

> Real-time prices, indicators, market flow, and regime classification

Hyperoru provides a comprehensive market data layer that feeds into strategies, signals, and analytics. Data flows from exchanges through caches into the services that consume it.

## Price data

Real-time price data is fetched by background tasks and stored in the PriceCache for instant access.

<CodeGroup>
  ```bash Get current price theme={null}
  curl https://api.production.hyperoru.com/api/crypto/price/BTC \
    -H "Authorization: Bearer $TOKEN"
  ```

  ```json Response theme={null}
  {
    "symbol": "BTC",
    "price": 67523.40,
    "timestamp": "2025-07-15T14:30:00Z"
  }
  ```

  ```bash Get multiple prices theme={null}
  curl https://api.production.hyperoru.com/api/crypto/prices?symbols=BTC,ETH,SOL \
    -H "Authorization: Bearer $TOKEN"
  ```
</CodeGroup>

## K-line data (candlesticks)

Historical and real-time candlestick data at multiple timeframes.

```bash theme={null}
curl "https://api.production.hyperoru.com/api/klines?symbol=BTC&interval=1h&limit=100" \
  -H "Authorization: Bearer $TOKEN"
```

### Supported timeframes

| Interval   | Code  | Use case                         |
| ---------- | ----- | -------------------------------- |
| 1 minute   | `1m`  | Scalping, high-frequency signals |
| 5 minutes  | `5m`  | Short-term momentum              |
| 15 minutes | `15m` | Intraday trading                 |
| 1 hour     | `1h`  | Swing trading, general analysis  |
| 4 hours    | `4h`  | Position trading                 |
| 1 day      | `1d`  | Trend analysis, regime detection |

Each candle contains:

```json theme={null}
{
  "open_time": 1689350400000,
  "open": 67500.0,
  "high": 67800.0,
  "low": 67200.0,
  "close": 67523.4,
  "volume": 1234.56,
  "close_time": 1689354000000
}
```

## Technical indicators

Pre-computed indicators available through the API and the program strategy MarketData object.

| Indicator           | Parameters                       | Output                            |
| ------------------- | -------------------------------- | --------------------------------- |
| **RSI**             | Period (default: 14)             | Single value 0–100                |
| **MACD**            | Fast (12), slow (26), signal (9) | MACD line, signal line, histogram |
| **Bollinger Bands** | Period (20), std dev (2)         | Upper, middle, lower bands        |
| **EMA**             | Period                           | Single smoothed value             |
| **SMA**             | Period                           | Single average value              |
| **ATR**             | Period (14)                      | Volatility measure                |

```bash theme={null}
curl "https://api.production.hyperoru.com/api/crypto/indicators?symbol=BTC&indicator=rsi&period=14" \
  -H "Authorization: Bearer $TOKEN"
```

## Market flow

Real-time order flow and market microstructure data.

<AccordionGroup>
  <Accordion title="Cumulative Volume Delta (CVD)" icon="arrow-trend-up">
    Tracks the net difference between buy and sell volume over time. Rising CVD with rising price confirms bullish momentum.

    ```bash theme={null}
    curl "https://api.production.hyperoru.com/api/market-flow/cvd?symbol=BTC&interval=1h" \
      -H "Authorization: Bearer $TOKEN"
    ```
  </Accordion>

  <Accordion title="Orderbook depth" icon="layer-group">
    Aggregated bid/ask depth at configurable price levels, useful for identifying support/resistance zones.

    ```bash theme={null}
    curl "https://api.production.hyperoru.com/api/market-flow/depth?symbol=BTC&levels=20" \
      -H "Authorization: Bearer $TOKEN"
    ```
  </Accordion>

  <Accordion title="Taker volume" icon="chart-bar">
    Buy vs sell taker volume over time. Spikes in taker volume often precede significant price moves.

    ```bash theme={null}
    curl "https://api.production.hyperoru.com/api/market-flow/taker-volume?symbol=BTC&interval=5m" \
      -H "Authorization: Bearer $TOKEN"
    ```
  </Accordion>

  <Accordion title="Large orders" icon="diamond">
    Detection of large individual orders that may indicate institutional activity or whale movements.

    ```bash theme={null}
    curl "https://api.production.hyperoru.com/api/market-flow/large-orders?symbol=BTC&min_value=100000" \
      -H "Authorization: Bearer $TOKEN"
    ```
  </Accordion>
</AccordionGroup>

## Market regime classification

The regime classifier categorizes current market conditions into discrete states:

| Regime            | Description                                  |
| ----------------- | -------------------------------------------- |
| **Trending Up**   | Sustained directional move with bullish bias |
| **Trending Down** | Sustained directional move with bearish bias |
| **Ranging**       | Price oscillating within a defined range     |
| **Volatile**      | High volatility without clear direction      |
| **Calm**          | Low volatility, narrow range, low volume     |

```bash theme={null}
curl "https://api.production.hyperoru.com/api/market-regime?symbol=BTC" \
  -H "Authorization: Bearer $TOKEN"
```

```json theme={null}
{
  "symbol": "BTC",
  "regime": "trending_up",
  "confidence": 0.82,
  "duration_hours": 18.5,
  "timestamp": "2025-07-15T14:30:00Z"
}
```

<Tip>
  Use the `{market_regime}` template variable in prompt strategies to condition AI decisions on the current market state.
</Tip>

## Sampling pool

The sampling pool collects periodic market snapshots used for AI context. Each snapshot captures prices, volumes, and indicator values across all watchlist symbols.

```bash theme={null}
curl "https://api.production.hyperoru.com/api/sampling/latest?limit=10" \
  -H "Authorization: Bearer $TOKEN"
```

Snapshots in the sampling pool are automatically included in prompt strategies via the `{sampling_data}` template variable, giving the LLM a rolling window of recent market context.
