API Documentation
Market Data
Pulsed Order Book
Order Book RPC provides a 50ms pulsed stream of the order book up to 20 levels.
Sample Code
Copy
import grpc
import market_data_pb2
import market_data_pb2_grpc
def stream_orderbook(symbol: str):
channel = grpc.secure_channel('mds.qfex.com:443', grpc.ssl_channel_credentials())
stub = market_data_pb2_grpc.MarketDataServiceStub(channel)
request = market_data_pb2.GetSymbol(symbol=symbol)
for book in stub.GetOrderBook(request):
print(book)
if **name** == '**main**':
stream_orderbook('SP500-USD')
Example Response
Copy
symbol: "SP500-USD"
timestamp {
seconds: 1746911241
nanos: 829600944
}
asks {
price: 566.6
quantity: 1.411
}
bids {
price: 563.5
quantity: 1.418
}
bids {
price: 540
quantity: 0.002
}
bids {
price: 530
quantity: 0.002
}
bids {
price: 500.5
quantity: 0.001
}
sequence: 6313309
On this page
Assistant
Responses are generated using AI and may contain mistakes.