Orderbook

To receive orderbook snapshot and notifications about changes in orderbook, the client must connect via WebSocket with the topic orderbook.

Message of type orderbook-snapshot is sent to the client after the connection is initiated with the orderbook topic or without any topic specified. This message represents the state of the orderbook at that moment. Subsequent messages of type orderbook-change are sent with the seqNo property incremented by one, reflecting changes to the orderbook.

Client can request new snapshot anytime with message of type orderbook-snapshot.


WS  wss://isot.okte.sk/api/v1/idm/ws?topics=orderbook

Snapshot message example

{
  "type": "orderbook-snapshot",
  "payload": {
    "seqNo": 6351,
    "timeDelta": 0,
    "data": [
      {
        "period": {
          "start": "2024-11-22T09:00:00Z",
          "end": "2024-11-22T10:00:00Z",
          "isBlock": false,
          "tradingEnd": "2024-11-22T08:30:00Z"
        },
        "statistics": {
          "lastTradeTime": "2024-11-22T07:35:29Z",
          "lastPrice": 179.9,
          "maxPrice": 179.9,
          "minPrice": 24,
          "totalVolume": 87764,
          "lastQuantity": 46,
          "priceDirection": 1
        },
        "ownStatistics": {
          "buy": {
            "quantity": 20.1,
            "remainingQuantity": 0,
            "weigtedAveragePrice": 6.1
          },
          "sell": {}
        },
        "buyList": [
          {
            "price": 62,
            "quantity": 6,
            "ownQuantity": 0
          }
        ],
        "sellList": [],
        "blockOrders": []
      },
      {
        "period": {
          "start": "2024-11-22T17:00:00Z",
          "end": "2024-11-22T19:00:00Z",
          "isBlock": true,
          "tradingEnd": "2024-11-22T16:30:00Z"
        },
        "buyList": [],
        "sellList": [],
        "blockOrders": [
          {
            "price": 37.6,
            "quantity": 23.1,
            "direction": "buy"
          }
        ]
      }
    ]
  }
}

Message fields description

Field Description Format
type Message type for snapshot Enum (orderbook-snapshot)
payload Message data OrderbookSnapshot object
     
OrderbookSnapshot    
seqNo Sequential message number for data consistency verification. Integer number
timeDelta Time difference between the current and previous change in milliseconds. Integer number
data Periods of orderbook Array of PeriodSnapshot objects
     
PeriodSnapshot    
period Delivery period specification Period object
statistics General trading statistics Statistics object
ownStatistics Own trading statistics of client OwnStatistics object
buyList Price levels for buy side Array of PriceLevel objects
sellList Price levels for sell side Array of PriceLevel objects
blockOrders Block orders Array of BlockOrder objects
     
Period    
start Delivery period start Date Time 8601 UTC
end Delivery period end Date Time 8601 UTC
isBlock Indication of whether it is a period for block orders. Boolean (true, false)
tradingEnd Trading end time for the period Date Time 8601 UTC
     
Statistic    
lastTradeTime Time of the last trade in period Date Time 8601 UTC
lastPrice Price of the last trade in period in EUR/MWh Float number (two decimal places)
lastQuantity Quantity of the last trade in period in MW Float number (one decimal place)
priceDirection Price trend Integer number (-1, 0, 1)
maxPrice Highest price of all trades in period in EUR/MWh Float number (two decimal places)
minPrice Lowest price of all trades in period in EUR/MWh Float number (two decimal places)
totalVolume Total trade volume for the trading period in MW Float number (one decimal place)
     
OwnStatistic    
buy Own statistics of buy side for period OwnStatisticSide object
sell Own statistics of sell side for period OwnStatisticSide object
     
OwnStatisticSide    
quantity Own traded volume in period in MW Float number (one decimal place)
remainingQuantity Remaining quantity of own orders for period in MW Float number (one decimal place)
weigtedAveragePrice Weighted average price of own trades in EUR/MWh Float number (two decimal places)
     
PriceLevel    
price Price in EUR/MWh Float number (two decimal places)
quantity Quantity in MW Float number (one decimal place)
ownQuantity Remaining quantity of own orders for price level Float number (one decimal place)
     
BlockOrder    
price Price in EUR/MWh Float number (two decimal places)
quantity Quantity in MW Float number (one decimal place)
direction Direction / side Enum (buy, sell)

Changes message example

{
  "type": "orderbook-change",
  "payload": {
    "seqNo": 3278,
    "timeDelta": 3002,
    "data": [
      {
        "period": {
          "start": "2024-11-20T19:00:00Z",
          "end": "2024-11-20T20:00:00Z",
          "isBlock": false,
          "tradingEnd": "2024-11-20T18:30:00Z"
        },
        "statistics": {
          "lastTradeTime": "2024-11-19T15:41:28.885Z",
          "lastPrice": 291.27,
          "maxPrice": 291.27,
          "minPrice": 291.26,
          "totalVolume": 30.0,
          "lastQuantity": 10.0,
          "priceDirection": 1
        },
        "ownStatistics": {
          "buy": {},
          "sell": {
            "quantity": 0,
            "remainingQuantity": 291.27,
            "weigtedAveragePrice": 0
          }
        },
        "buyChanges": [
          {
            "index": 0,
            "action": "remove",
            "price": 94.84,
            "quantity": 5,
            "quantityDelta": -5,
            "ownQuantity": 0,
            "ownQuantityDelta": 0
          }
        ],
        "sellChanges": [
          {
            "index": 0,
            "action": "update",
            "price": 291.27,
            "quantity": 1.7,
            "quantityDelta": 0.7,
            "ownQuantity": 0,
            "ownQuantityDelta": 0
          },
          {
            "index": 0,
            "action": "add",
            "price": 291.26,
            "quantity": 5,
            "quantityDelta": 5,
            "ownQuantity": 0,
            "ownQuantityDelta": 0
          }
        ],
        "blockOrderChanges": [
          {
            "action": "add",
            "price": 21.8,
            "quantity": 11.2,
            "direction": "sell"
          }
        ],
        "action": "update"
      }
    ]
  }
}

Message fields description

Field Description Format
type Message type for chage Enum (orderbook-change)
payload Message data OrderbookSnapshot object
     
OrderbookSnapshot    
seqNo Sequential message number for data consistency verification Integer number
timeDelta Time difference between the current and previous change in milliseconds Integer number
data Updated periods of orderbook Array of PeriodChange objects
     
PeriodChange    
period Delivery period specification Period object
statistics General trading statistics Statistics object
ownStatistics Own trading statistics of client OwnStatistics object
buyChanges Price level changes for buy side Array of PriceLevelChange objects
sellChanges Price level changes for sell side Array of PriceLevelChange objects
blockOrderChanges Block orders Array of BlockOrderChange objects
action Type of change of period Enum (remove, update, add)
     
Period    
start Delivery period start Date Time 8601 UTC
end Delivery period end Date Time 8601 UTC
isBlock Indication of whether it is a period for block orders Boolean (true, false)
tradingEnd Trading end time for the period Date Time 8601 UTC
     
Statistic    
lastTradeTime Time of the last trade in period Date Time 8601 UTC
lastPrice Price of the last trade in period in EUR/MWh Float number (two decimal places)
lastQuantity Quantity of the last trade in period in MW Float number (one decimal place)
priceDirection Price trend Integer number (-1, 0, 1)
maxPrice Highest price of all trades in period in EUR/MWh Float number (two decimal places)
minPrice Lowest price of all trades in period in EUR/MWh Float number (two decimal places)
totalVolume Total trade volume for the trading period in MW Float number (one decimal place)
     
OwnStatistic    
buy Own statistics of buy side for period OwnStatisticSide object
sell Own statistics of sell side for period OwnStatisticSide object
     
OwnStatisticSide    
quantity Own traded volume in period in MW Float number (one decimal place)
remainingQuantity Remaining quantity of own orders for period in MW Float number (one decimal place)
weigtedAveragePrice Weighted average price of own trades in EUR/MWh Float number (two decimal places)
     
PriceLevelChange    
index Position of the change within the market depth for the period Integer number
action Type of price level change Enum (remove, update, add)
price Price in EUR/MWh Float number (two decimal places)
quantity Quantity in MW Float number (one decimal place)
quantityDelta Change in quantity compared to the previous amount in MW Float number (one decimal place)
ownQuantity Remaining quantity of own orders for price level Float number (one decimal place)
ownQuantityDelta Change in quantity compared to the previous amount in MW. Float number (one decimal place)
     
BlockOrderChange    
action Type of block order change Enum (remove, update, add)
price Price in EUR/MWh Float number (two decimal places)
quantity Quantity in MW Float number (one decimal place)
direction Direction / side Enum (buy, sell)

Snapshot request message example

{
  "type": "orderbook-snapshot"
}