← Blog

Introducing Typed: Exchange Clients That Actually Work

2026-05-11 · Marcel Claramunt ·
devtypedpythonopen-source

Why we built our own async, validated Python clients for every crypto exchange we trade on — and why we're making them public.

The problem with exchange APIs

Every exchange has an API. Most of them are bad.

Not broken — just bad in the quiet, invisible way that costs you hours. The response says "side": "buy" but the docs say it should be "BUY". The timestamp is milliseconds on one endpoint and seconds on another. A field is documented as optional but always present — until one day it isn't. Error codes live in a different section of the docs than the endpoint that throws them.

You don't discover any of this until you're live.

We trade our own capital on these venues. We built our own tools to do it. At some point we realised that the client layer — the thing that sits between your code and the exchange — was doing far more work than it should, and none of it was being shared.

What Typed is

Typed is a collection of async, typed, validated Python clients for crypto exchanges. One package per venue. One consistent interface. Zero surprises.

Each client:

  • Is fully typed — every request parameter, every response field, annotated with Python types you can actually use
  • Is validated at the boundary — responses are parsed and checked before they reach your code, so you catch bad data from the exchange, not bad assumptions in your logic
  • Is async-first — built on httpx and asyncio, no sync wrappers bolted on after the fact
  • Uses plain Python types wherever possible — no mandatory SDK imports to construct a simple parameter

A real example:

from typed_hyperliquid import HyperliquidClient

async with HyperliquidClient() as client:
    fills = await client.get_user_fills(address="0xabc...")
    for fill in fills:
        print(fill.coin, fill.side, fill.sz, fill.px)

fill.side is a Literal["A", "B"], not a raw string. fill.px is a Decimal, not "101000.0". You know what you're working with.

Why open source

We use every line of this on our own book. That means it has to be correct — not test-correct, but production-correct. When Hyperliquid changes their API, we notice within hours because our own trading breaks.

That's a higher standard of maintenance than most open-source projects get. Making it public costs us nothing, and it might save someone else the week we spent figuring out the edge cases.

The packages are published under GPLv3 on PyPI under the typed-* namespace.

What's available

Four clients are in production today:

  • typed-hyperliquid — full coverage of the Hyperliquid API, including WebSocket streams
  • typed-alchemy — Alchemy's NFT, token, and transaction APIs
  • typed-mexc — MEXC spot and futures APIs
  • typed-dydx — dYdX v4 indexer, chain modules, Comet RPC, and order placement

Several more are in active development: Ethereum, Etherscan, Bit2Me. Planned: Bybit, Binance, Bitget.

You can track progress on the Typed page.

Install

pip install typed-hyperliquid
pip install typed-alchemy
pip install typed-mexc
pip install typed-dydx

Feedback, issues, and PRs welcome on GitHub.