Hand it to your coding agent

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

Typed Aster

A fully typed, validated async client for the Aster API.

from typed_aster import Aster

async with Aster.new(public=True) as client:
  book = await client.futures.market.depth('BTCUSDT', limit=5)
  print(book['bids'][0])

One Aster client covers four surfaces:

  • client.futures: perpetual futures
  • client.spot: spot trading
  • client.prediction: prediction markets
  • client.chain: Aster Chain (staking, transfers, withdrawals, and on-chain reads by address)

Public market data needs no credentials. Everything signed uses Aster's Pro API wallets. See Authenticated Setup.

Why Typed Aster?

  • 🎯 Precise Types: Typed order unions and datetime timestamps across futures, spot, prediction and Aster Chain, not dict/Any. Prices and quantities Aster sends as strings are Decimal; the few amounts it sends as JSON numbers (Aster Chain balances such as walletBalance, withdrawal fee estimates, fee caps) are float.
  • ✅ Runtime Validation: Every REST, JSON-RPC and WebSocket response is validated by default, not just typed on paper.
  • ⚡ Async First: Async HTTP plus WebSocket market and user-data streams, built for concurrent workflows.
  • 📚 Full Surface: Every documented Pro API endpoint, including strategy orders, sub-accounts, builders, prediction outcomes and staking.

Installation

pip install typed-aster

How To

Reference

Design Philosophy

Typed Aster follows the principles outlined in this blog post.

Details matter. Developer experience matters.