Protobuf in the Interactive Brokers API: Implementation and Delegation Strategy
Starting with TWS/Gateway API server version 201, Interactive Brokers introduced protobuf-encoded messages alongside the legacy text-based protocol. This change required a careful architectural decision: re-implement protobuf handling from scratch, or delegate to the official ibapi implementation while preserving ib-interface's asynchronous, event-driven design.
This post walks through the protobuf addition in IBKR's API, the problems it created for third-party clients, and how we solved it in ib-interface through strategic delegation to ibapi's encode/decode methods.