MFX Hub
Concepts

Events and the stream

One WebSocket, many subscriptions: account, results, market data and candles are channels on the same connection. Events are ordered per terminal with a sequence number, and every payload carries schema_version.

from mfx import Channel

async with client.stream() as stream:  # resumes by itself after a reconnect
    await stream.subscribe(Channel.EVENTS)
    async for msg in stream:
        if msg.type == "position.closed":
            ...

A gap in seq means a missed event: resume from the last one you processed and the stream replays what it holds, or tells you to resync from a fresh read when it cannot.