====== Prices, Volumes & Data Types ====== [[developers:apiv2|◀ WebSocket API (V2)]] ===== Prices and Decimals are Represented as Strings ===== Two wrapper types carry exact numbers as strings: * [[https://github.com/CTS-Futures/t4-api-tools/blob/main/proto/t4/v2/common/price.proto#L12|Price]] * [[https://github.com/CTS-Futures/t4-api-tools/blob/main/proto/t4/v2/common/price.proto#L6|Decimal]] message Price { string value = 1; } // e.g. "4200.50" message Decimal { string value = 1; } // e.g. "1.50" T4 uses text to avoid binary floating-point rounding. **Parse them into your language's native decimal type**, not a ''double''. ''Price'' is used for market/order prices; ''Decimal'' is used for order volumes and cash values. ===== Volumes ===== * **Order routing** — volumes (''volume'', ''max_show'', ''max_volume'', fill volumes) are ''Decimal''. This allows the API to support fractional exchange quantities (e.g. Kalshi). * **Market data** — depth and trade volumes are plain integers (''int32''). ===== System Price format ===== T4 publishes prices in different formats. The setting controls how prices are formatted in the trading and all other platform API's (chart's, etc.) If you expect ES to look like ''5954.75'' instead of ''595475'', choose **Real**. Set [[https://github.com/CTS-Futures/t4-api-tools/blob/main/proto/t4/v2/common/enums.proto#L35|PriceFormat]] on [[https://github.com/CTS-Futures/t4-api-tools/blob/main/proto/t4/v2/auth/auth.proto#L9|LoginRequest]] to choose how ''Price'' strings are formatted: ^ PriceFormat ^ Description ^ Example (ES) ^ | ''PRICE_FORMAT_REAL'' | Human-readable decimal placement used by most trading UIs. | 5954.75 | | ''PRICE_FORMAT_DECIMAL'' | Raw exchange representation, without UI-friendly decimal placement. | 595475 | | ''PRICE_FORMAT_CLEARING_DECIMAL'' | Typically used for data imports and exports only. | 595475 | See [[developers:systempricing|System Price Format]] for more information.