Skip to main content

Typed dYdX

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

PyPI version Python versions Docs License



from dydx import Dydx

async with Dydx.testnet(public=True) as client:
  market = await client.indexer.data.get_market('BTC-USD')
  stream = await client.indexer.streams.candles('ETH-USD', resolution='1MIN')
  async for candle in stream:
    await stream.unsubscribe()
  balances = await client.chain.bank.all_balances('dydx1...')
  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 endpoint inputs and responses across dYdX services.
  • ✅ Runtime Validation: Validated Indexer and Comet responses by default.
  • ⚡ Async First: HTTP, WebSocket streams, gRPC queries, and transaction helpers.
  • 📚 Full dYdX Surface: client.indexer, client.chain, and client.node.

Installation

pip install typed-dydx

How To

Reference

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

typed_dydx-2.1.0.tar.gz (255.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

typed_dydx-2.1.0-py3-none-any.whl (404.7 kB view details)

Uploaded Python 3

File details

Details for the file typed_dydx-2.1.0.tar.gz.

File metadata

  • Download URL: typed_dydx-2.1.0.tar.gz
  • Upload date:
  • Size: 255.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for typed_dydx-2.1.0.tar.gz
Algorithm Hash digest
SHA256 b0038fcbaf3a6c311ec03a81d96e80aea5b2b2eb6385711d38c9f63bbc0bb6b4
MD5 8cc587f7d5641aed2dfd14ac24fd3901
BLAKE2b-256 497e6b6a7bb0f0fec8050585b8a649b2570e9f276bc1ed67ca7516ce4dfca7c1

See more details on using hashes here.

File details

Details for the file typed_dydx-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: typed_dydx-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 404.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for typed_dydx-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b726d768aac28285a8bffd63f7deeca56d464f9697f38f6697753f15dc9ee2b
MD5 f8d976fb8fa95389039208224dc54019
BLAKE2b-256 a657d65d044dcb29870feee99d649dfa7a4fa9dd79318d7ba9411275d3a54e49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page