Market Data Service is a high-performance financial data API that provides comprehensive Symbol prices of different markets through both RESTful endpoints and real-time WebSocket connections.

API_CONTRACT.md 887B

API Contract Specification

Candles Endpoint

POST /api/candles/bulk

Request Body:

{
  "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):

{
  "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)