# API Contract Specification

## Candles Endpoint

### POST /api/candles/bulk

**Request Body:**
```json
{
  "candles": [
    {
      "symbolId": 1,
      "openTime": "2025-10-17T00:00:00Z",
      "closeTime": "2025-10-17T01:00:00Z",
      "open": 1.123456789012345,
      "high": 1.123456789012345,
      "low": 1.123456789012345,
      "close": 1.123456789012345,
      "volume": 1000.123456789012345
    }
  ]
}
```

**Responses:**
- `201 Created`: Successfully created candles
- `400 Bad Request`: Invalid payload format
- `409 Conflict`: Duplicate candle exists (violates unique constraint)
- `500 Internal Server Error`: Server error

**Error Example (409):**
```json
{
  "success": false,
  "message": "Duplicate candle for symbol 1 at 2025-10-17 00:00:00"
}
```

## Precision Requirements
All numeric fields require 15 decimal precision:
```javascript
Joi.number().precision(15)
