ib_async-dx
ib_async without the gateway. The program you already wrote against ib_async, with no IB Gateway, no Trader Workstation and no JVM between it and the venue.
Two lines change
A program written against ib_async talks to IB Gateway or Trader Workstation over a socket on localhost, and that process talks to the venue. ib_async-dx puts the ib-dx engine where the gateway was: it logs in, holds the trading, market-data, historical and security-definition connections open, and answers every call ib_async makes.
- from ib_async import IB, Stock
+ from ib_async_dx import IB, Stock
ib = IB()
- ib.connect("127.0.0.1", 4001, clientId=1) # a gateway on localhost
+ ib.connect(username="...", password="...") # a paper session; paper=False for live
That is the whole change. ib_async_dx is ib_async: the same names, the same
objects and the same submodules, run by ib_async’s own code, installed as a
dependency. Two classes differ: IB, a subclass of ib_async’s whose connect
takes a login instead of a gateway’s address, and IBC, which has no gateway
to start. The rest of the program — its events, its *Async calls, its
Ticker and Trade, its util — runs unmodified, with the engine in place of
the one layer that knew there was a socket.
Tip
Leave the credentials out of
connectand it readsIB_USERNAMEandIB_PASSWORDfrom the environment. Where those are set, the connect line can stay exactly as it was for a paper account: the host and port are not used, and the client id is carried into the login. The port does not choose paper or live; addpaper=Falsefor a live account.
What goes away
The gateway
Nothing to install, launch, log into on a schedule, or restart. No window either: it runs in a container, over ssh, on a machine with no display.
The JVM
No heap to size, and no JVM garbage collector pausing the process your ticks pass through.
The localhost socket
The engine runs inside your Python process. Nothing listens on a port, and ticks are delivered in-process.
IBC and the watchdog
No login window to script and no gateway to restart when it wedges. The engine logs in itself, and rebuilds a dropped connection on the session it already holds. ib_async's own Watchdog still runs, as a reconnect loop, with the login its IBC names.
What you get
ib_async, exactly
ib_async_dx exports ib_async's 103 names, and every one but IB and IBC is ib_async's own object, its __version__ among them. A test holds the two packages to that on every run.
Every call it makes, carried
ib_async's IB makes 67 calls on its transport at 2.1.0, and every one lands on the engine. A test reads that list out of ib_async's own source on every run.
Nothing in between
The engine is compiled Rust, running in your process through PyO3. There is no second process that can be wedged while your program looks healthy.
More than a gateway forwards
What the venue states that no documented call asks for — the order types the account may use, its algorithms, the features it has enabled, the whole option model — is a method on IB. Beyond ib_async lists them, with the four ib_async bugs fixed here.
Honest about its limits
A field the engine cannot carry is refused, as a gateway refuses a message it cannot read, instead of going out as something other than what was asked. The few things taken and not applied, and everything else that differs from ib_async over a gateway, are written down with the reason for each.
Where to go next
Status
Under active development. The Python package is here with its suite: 318
tests, 315 of which run offline on every push to main and every pull
request, on Python 3.11, 3.13 and free-threaded 3.14t, 2 that need a live
login, and 1 a Python version condition excludes. ib_async’s own
suite is written to run against the engine too, and has not been run against
the venue at this revision; see Evidence.
A Rust client — ib_async’s model in Rust spelling, on the engine’s public API — is coming. It is not in this repository yet.
Neither ib_async-dx nor the engine is published to PyPI or crates.io yet; both install from their repositories: see Getting started.
Note
An independent project. It is not affiliated with ib_async or its maintainers, nor with Interactive Brokers. ib_async-dx runs ib_async’s own code as a dependency and does not copy it. ib_async is BSD-2-Clause, and ib_async-dx is AGPL-3.0.