Skip to content
All library documents

OKEX WebSocket Contract Switching and Asynchronous Order Context

Article FMZ forum · Author: lightring

Summary

This document raises implementation questions about trading two OKEX futures maturities through one exchange object. Its example switches between the this-week and quarterly contracts to request tickers over WebSocket, then switches again before submitting asynchronous orders. The central concerns are whether changing contract type reconnects the WebSocket and whether an asynchronous order might use the later contract setting.

It also asks how to avoid any such interference and whether separate exchange objects for the same trading pair can maintain independent WebSocket connections. The document provides scenarios and questions, but no answers, tested behavior, or recommended workaround. It therefore identifies an important state-management and execution risk for cross-period arbitrage without establishing how the exchange library handles contract settings or concurrent calls.

Key ideas

  • The example uses one exchange object to retrieve prices for two futures maturities over WebSocket.
  • The document asks whether changing contract type reconnects the market data connection.
  • It questions whether asynchronous orders can observe a contract setting changed after submission begins.
  • Separate exchange objects are proposed as a possible way to isolate contract state and connections.
  • The document does not provide answers or empirical evidence for any of these questions.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.