# Typed Deribit

> A fully typed, validated async client for the Deribit API.

```python
from typed_deribit import Deribit

async with Deribit.new(testnet=True) as client:
  instruments = await client.http.market_data.get_instruments(
    currency='BTC', kind='future'
  )
  print(instruments)
```

## Why Typed Deribit?

- **🎯 Precise Types**: every request/reply method and channel subscription across
  `.http`, `.ws`, and `.streams` is typed, parameters and all — not `dict`/`Any`.
- **✅ Runtime Validation**: responses are validated against the real schema by default,
  not just typed on paper.
- **⚡ Async First**: async HTTP and WebSocket transports, with `.streams` running
  concurrently on its own dedicated connection.
- **📚 Full Surface**: every documented endpoint across `market_data`, `trading`,
  `account`, `wallet`, `block_rfq`, `block_trade`, `combo_books`, `matching_engine`,
  `session`, `subscription_management`, and `supporting` — not just the popular ones.

## Installation

```bash
pip install typed-deribit
```

## How To

- [Fetch Market Data](/typed/deribit/how-to/fetch-market-data)
- [Manage Account Data](/typed/deribit/how-to/manage-account-data)
- [Place & Manage Orders](/typed/deribit/how-to/place-and-manage-orders)
- [Manage Deposits & Withdrawals](/typed/deribit/how-to/manage-deposits-and-withdrawals)
- [Paginate Through Results](/typed/deribit/how-to/paginate-through-results)
- [Listen To Streams](/typed/deribit/how-to/listen-to-streams)

## Reference

- [API Keys Setup](/typed/deribit/api-keys)
- [Async Usage](/typed/deribit/reference/async-usage)
- [Error Handling](/typed/deribit/reference/error-handling)
- [Environment Variables](/typed/deribit/reference/env-vars)
- [Timestamps](/typed/deribit/reference/timestamps)

## Design Philosophy

Typed Deribit follows the principles outlined in [this blog post](https://tribulnation.com/blog/clients).

*Details matter. Developer experience matters.*
