Subscription

Server

The server’s (gateway’s) TOML config has an optional list of regex to be matched against reference data downloaded from the exchange.

Market data will automatically be subscribed for any symbol that can be matched.

Clients can dynamically request new symbols using the Subscribe request.

Client

The handshake protocol between client and server includes a pre-configured regex list.

The server will automatically respond with cached snapshots for all matching symbols.

The client may dynamically request more symbols using the Subscribe request.

The server will only process these requests when it already has reference data where the symbol can be matched.

The server will NOT cache these subscriptions in the case that new symbols are later created by the exchange.

The server will NOT process the subscription request if it already has subscribed the symbol.

If the server knows about the symbol (from reference data) AND the symbol was not already subscribed from the exchange, the server will proceed to set up the subscription with the exchange.

Example

The gateway can be configured without any symbols.

The client can be configured with a regex that captures everything, e.g. ".*".

Because the gateway has an empty subscription list, the client will not receive anything upon connecting.

The client can later send a Subscribe request to instruct the gateway to dynamically set up new symbols.

When the gateway receives the initial snapshot from the exchange, it will broadcast it.

Since the client subscribed to everything, it will receive the new snapshot.

Errors

The gateway will log a warning if the symbol is unknown (no reference data).

The gateway will not send a snapshot if the market data was already subscribed from the exchange. This snapshot would already be received through the client’s subscription to “everything”.

There is currently no Ack from the gateway.