Hand it to your coding agent

One prompt with the typed-dydx install command, its env vars, and a working first call. Paste it into Claude Code, Cursor, or Codex.

Typed dYdX

A fully typed, validated async client for the dYdX Indexer, Chain (Cosmos gRPC + CometBFT), and Node APIs.

from typed_dydx import Dydx

async with Dydx.testnet(public=True) as client:
  market = await client.indexer.data.get_market('BTC-USD')
  candles = await client.indexer.streams.candles('ETH-USD', resolution='1MIN')
  async for candle in candles:
    print(candle)
    break
  await candles.unsubscribe()
  balances = await client.chain.bank.all_balances('dydx1...', resolve_denom=False)
  block = await client.chain.comet.block()
  result = await client.node.place_order(market, order={
    'side': 'BUY',
    'size': '0.0001',
    'price': '50000',
    'flags': 'LONG_TERM',
  })

Why Typed dYdX?

  • 🎯 Precise Types: Typed inputs and responses across the Indexer, Chain, and Node surfaces.
  • ✅ Runtime Validation: Indexer and Comet responses validated by default.
  • ⚡ Async First: Indexer HTTP and WebSocket streams, Cosmos gRPC queries, and signed node transactions.
  • 📚 Full Surface: client.indexer, client.chain, and client.node cover market data, account history, chain state, and order placement.

Installation

pip install typed-dydx

How To

Reference

Design Philosophy

Typed dYdX follows the principles outlined in this blog post.

Details matter. Developer experience matters.