This is an old revision of the document!
Pricing and Data Types
The WebSocket API represents market prices using the Price type, and cash values in the Decimal type. Both of these types wrap a string value for precision and consistency across different programming languages.
Note: Clients should always parse Price and Decimal values into their programming language’s native decimal if available.
Price and Decimal Types
The Price type is used for market prices, while the Decimal type is used for cash values in messages. Both follow the same structure:
- Price – Represents a price in the market (e.g., bid/ask prices, last traded price).
- Decimal – Represents numerical values such as volumes, margins, or risk parameters.
Example representation:
* Price = `"4200.50"` * Decimal = `"5.25"`
Proto Converter Tools
The T4 API Tools repository provides tools for converting between .NET decimals and Protobuf Price/Decimal types.
Note: Reach out to support if you would like an API tool for a language we have not covered yet.
Platform | Proto Converter Tool |
---|---|
.Net | ProtoConverters.cs |