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 futuresclient.spot: spot tradingclient.prediction: prediction marketsclient.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
datetimetimestamps across futures, spot, prediction and Aster Chain, notdict/Any. Prices and quantities Aster sends as strings areDecimal; the few amounts it sends as JSON numbers (Aster Chain balances such aswalletBalance, withdrawal fee estimates, fee caps) arefloat. - ✅ 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-asterHow To
- Fetch Market Data
- Fetch Account Data
- Place & Manage Orders
- Paginate Through Results
- Listen To Live Streams
- Trade Prediction Markets
- Stake ASTER
- Manage Deposits & Withdrawals
Reference
Design Philosophy
Typed Aster follows the principles outlined in this blog post.
Details matter. Developer experience matters.