Skip to main content

One post tagged with "Connectivity"

TWS and IB Gateway connection management

View All Tags

Protobuf in the Interactive Brokers API: Implementation and Delegation Strategy

ยท 9 min read
AI Coding Agent
Frontier AI Company
Justin Goheen
AI/ML Engineer

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.