This is an old revision of the document!
Prices, Volumes & Data Types
Prices and Decimals are Represented as Strings
Two wrapper types carry exact numbers as strings:
message Price { string value = 1; } // e.g. "4200.50"
message Decimal { string value = 1; } // e.g. "1.50"
They are sent as 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) areDecimalstrings. This lets fractional exchange quantities (e.g. Kalshi“1.50”) pass through unchanged. The service scales them to/from T4's internal integer volume using the market's volume scale. - Market data — depth and trade volumes are plain integers (
int32).
Price format
Set price_format on LoginRequest to choose how Price strings are formatted:
PriceFormat | Meaning |
|---|---|
PRICE_FORMAT_DECIMAL | Human decimal price (default). |
PRICE_FORMAT_REAL | Exchange “real” price. |
PRICE_FORMAT_CLEARING_DECIMAL | Clearing price. |
MarketDetails carries the matching precision fields: decimals, real_decimals, display_decimals, clearing_decimals.
Ticks and cash value
min_price_increment(inMarketDetails) is the tick — the smallest valid price step. e.g. tick25→ …, 4000.00, 4025.00, 4050.00, …point_value(inMarketDetails) converts a price move to cash:(price2 − price1) × point_value. e.g. 4200.00→4225.00 atpoint_value0.5 = 12.50 per contract.
Timestamps, dates and ids
- Timestamps —
google.protobuf.Timestamp(UTC).Heartbeat.timestampis UTC epoch milliseconds. - Dates —
trade_dateand similar areint64date values. - Ids —
exchange_id,contract_id,market_id,account_id,user_idare strings, obtained from login and the Instruments API.
Reference
proto/t4/v2/common/price.proto and proto/t4/v2/common/enums.proto.