Skip to main content

General definitions

The protocol is aimed to be used through web-socket but is not limited to it, any bi-directional communication protocol can be used to implement this standard.

Every event is formatted in a JSON array like the following:

[type, request_id, method, arguments]
ElementDescription
typeThis element identifies the type of the event (see the table below)
request_idThis is a request ID set by the client to identify the request and the corresponding response. It must be an unsigned integer. It's absent for events.
methodmethod name to be called
argumentslist of arguments for the method

Types of messages

Type IDShort description
1Request
2Response
3Public event
4Private event

Numerical values

Because precision in finance matters a lot, the float type must not be used, it's an approximate data type which means values are round up. Decimal or String representation should be preferred. A common practice is to use Decimal type inside independent systems and String for communication between systems. This is why every numerical value which matters in this protocol is stored in a string.

Units of time definition

unitsymbol
seconds
minutem
hourh
dayd
weekw
monthM
yeary

The biggest unit of time possible must be chosen to represent a time period.

For example, 5m must be chosen instead of 300s.