TypeScript and Python SDK /
DFlow SDK
A dual-language SDK for DFlow prediction markets and Solana trading, from market discovery to live data and transactions.
- TypeScript
- Python
- REST
- WebSockets
- Solana
The problem
DFlow exposes a broad prediction-market and trading surface: events, markets, orderbooks, trades, series, search, swaps, orders, intents, tokens, venues, and live updates. Integrators should not have to rebuild authentication, request handling, response models, and transaction utilities for every product and language.
The SDK packages that surface behind one discoverable client in both TypeScript and Python, so an integration can move from reading a market to preparing a trade without switching abstractions.
System shape
The top-level client groups APIs by domain and shares configuration, authentication, transport, and error behavior. Typed resource clients cover the REST surface, while WebSocket subscriptions deliver price, trade, and orderbook changes for applications that need live state.
Trading helpers bridge API responses to Solana workflows such as quotes, swaps, transaction signing, positions, and redemption. The TypeScript and Python packages are distributed through npm and PyPI with parallel documentation and examples.
Engineering decisions
The two implementations stay conceptually aligned while remaining idiomatic in their own ecosystems. TypeScript exposes typed asynchronous clients; Python uses familiar naming and data access. Domain boundaries remain visible instead of collapsing the API into a single generic request method.
- Support single, list, search, and batch market operations without losing response types.
- Keep real-time subscriptions beside the REST resources they update.
- Expose signing and position helpers without hiding the underlying Solana transaction flow.
- Ship runnable quick starts for both package ecosystems.
What it demonstrates
The SDK is developer infrastructure: the product is the boundary other engineers consume. It demonstrates API modeling, cross-language consistency, live data, transaction-oriented integrations, documentation, examples, and package distribution as one coherent developer experience.