Data Models (dccd.models)¶
Pydantic models for validating exchange API responses.
All raw exchange payloads are validated through Pydantic v2 models before
being stored. If a response field has an unexpected type (e.g. a non-numeric
price string) the model raises a ValidationError immediately, so corrupt
data never silently reaches the Parquet files.
Models at a glance¶
OHLCBar — one OHLCV candle returned by REST endpoints:
Field |
Type |
Notes |
|---|---|---|
|
float |
Unix timestamp in seconds. |
|
float |
OHLC prices. |
|
float |
Base-asset volume. |
|
float |
Quote-asset volume (price × volume). |
|
float | None |
VWAP. Populated by Kraken only; |
Trade — one individual trade from REST history or WebSocket streams:
Field |
Type |
Notes |
|---|---|---|
|
int | None |
Exchange trade ID. |
|
float |
Unix timestamp in seconds. |
|
float |
Trade price. |
|
float |
Trade size in base asset. |
|
str | None |
|
OrderBookEntry — one price level from a snapshot or diff stream:
Field |
Type |
Notes |
|---|---|---|
|
str |
|
|
str |
Price level stored as a string to preserve full exchange precision. |
|
float |
Total quantity available at this level. |
|
int | None |
Number of open orders. |
API reference¶
|
OHLCV bar returned by exchange REST APIs. |
|
Individual trade from WebSocket streams or REST history endpoints. |
|
Single order book level from REST snapshot or WebSocket streams. |