# Typed Hyperliquid

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

```python
from typed_hyperliquid import Hyperliquid

async with Hyperliquid.new(public=True) as client:
  async with client.streams.trades('BTC') as trades:
    async for msg in trades:
      for trade in msg:
        print(trade['px'], trade['sz'], trade['side'])
```

## Why Typed Hyperliquid?

- **🎯 Precise Types**: Typed endpoint inputs and responses, not `dict`/`Any`.
- **✅ Runtime Validation**: Responses validated by default, not just typed on paper.
- **⚡ Async First**: HTTP, request-response WebSocket, and subscription streams, built for concurrent workflows.
- **📚 Full Surface**: `client.info`, `client.exchange`, and `client.streams` -- perps, spot, and every documented info/exchange/stream endpoint, not just the popular ones.

## Installation

```bash
pip install typed-hyperliquid
```

## How To

- [Place & Manage Orders](/typed/hyperliquid/how-to/place-and-manage-orders)
- [Fetch Market Data](/typed/hyperliquid/how-to/fetch-market-data)
- [Fetch Your Balances & Positions](/typed/hyperliquid/how-to/fetch-balances-and-positions)
- [Fetch Your Transactions](/typed/hyperliquid/how-to/fetch-transactions)
- [Listen To Your Trades](/typed/hyperliquid/how-to/listen-to-your-trades)
- [Listen To Public Data](/typed/hyperliquid/how-to/listen-to-public-data)

## Reference

- [Authenticated Setup](/typed/hyperliquid/authenticated-setup)
- [Async Usage](/typed/hyperliquid/reference/async-usage)
- [Error Handling](/typed/hyperliquid/reference/error-handling)
- [Environment Variables](/typed/hyperliquid/reference/env-vars)
- [Timestamps](/typed/hyperliquid/reference/timestamps)
