Build on Dexalot without the friction — a unified, async-first SDK that abstracts on-chain complexity and delivers seamless, production-grade access to trading, swaps, and portfolio management in a single client.
April 10, 2026 |
If you've ever tried to build a trading bot or integrate with an on-chain exchange, you know the pain. You're juggling RPC endpoints, managing nonces, signing transactions, parsing order books, handling retries — and that's before you even place your first order. We built the Dexalot SDK to take that weight off your shoulders so you can focus on what matters: your trading logic.
Today, we're open-sourcing it for the community — in both Python and TypeScript.
Dexalot is a decentralized exchange that runs a central limit order book (CLOB) on-chain. Unlike AMM-based DEXs where you swap against a liquidity pool, Dexalot matches buyers and sellers the way traditional exchanges do — with bids, asks, and a real order book. This gives traders tighter spreads, more control over execution, and a familiar experience.
But interacting with an on-chain CLOB programmatically has historically been rough. You need to authenticate, manage wallet nonces to avoid duplicate transactions, handle RPC provider failures, and keep up with blockchain-specific quirks. Every developer who wanted to build on Dexalot was essentially rebuilding the same plumbing from scratch.
The Dexalot SDK packages all of that into a single, clean client. One install. One object. Full access to trading, swaps, balances, and real-time market data.
The SDK covers three core areas of the Dexalot protocol, all accessible through a unified client.
Order Book Trading. Place limit orders, cancel them individually or in bulk, and query your open positions — all through straightforward method calls. The SDK handles the on-chain transaction signing, nonce management, and gas estimation behind the scenes. It also supports batch operations: place multiple orders in a single transaction, cancel a list at once, or do an atomic cancel-and-replace where your old orders are removed and new ones are submitted in one shot. For market makers and active traders, this means fewer round-trips and lower latency.
Simple Swaps. Not every trade needs a limit order. The SDK includes a request-for-quote (RFQ) swap flow: get a soft quote to check indicative pricing, lock in a firm quote with a 30-second expiry window, and execute — three steps, no order book management required. It's ideal for one-off trades or applications that need a simple "swap token A for token B" interface.
Portfolio and Transfers. Check your balances across your portfolio and connected chain wallets. Deposit tokens from supported chains into your Dexalot portfolio, withdraw them back out, and manage gas — all programmatically. If you're building a dashboard, a portfolio tracker, or an automated rebalancing system, these methods give you everything you need.
As DeFi matures, the gap between "I can trade on a DEX manually" and "I can build production systems on a DEX" is where the real opportunity lives. Bots, aggregators, portfolio managers, analytics platforms — they all need reliable programmatic access. That's what this SDK provides.
We're shipping native SDKs for both Python and TypeScript — the two languages that dominate crypto development. Python is where quantitative traders, data scientists, and bot builders live. TypeScript powers the web frontends, Node.js services, and serverless functions that much of the ecosystem runs on. Both SDKs share the same design philosophy: async-first, built-in error handling, type safety, and production-grade defaults. Whether you're writing a FastAPI trading service or a Next.js portfolio dashboard, you get a first-class client — not a thin wrapper around a REST API.
We didn't just wrap some API endpoints and call it a day. The SDK was designed with production workloads in mind, and a few of the architectural choices are worth highlighting.
Async from the ground up. Every I/O operation is asynchronous. The Python SDK is built on asyncio; the TypeScript SDK uses native async/await and Promises. There's no threading, no blocking calls buried under the hood. This means the SDK plays nicely with modern async frameworks and can handle concurrent operations without surprises. If you're running a trading service that monitors multiple pairs while managing orders, async is not optional — it's essential.
Smart caching that stays out of your way. The SDK uses a four-tier caching system that matches how exchange data actually behaves. Static data like deployment configurations is cached for an hour because it almost never changes. Token and trading pair metadata refreshes every 15 minutes. Balance data lives for 10 seconds. Order book snapshots expire after just one second. Each tier has sensible defaults, but you can tune every TTL to match your use case — or turn caching off entirely for development. Under the hood, the cache includes stampede protection: if ten concurrent requests ask for the same uncached data at the same time, only one actually fetches it. The rest wait for that single result. This prevents the "thundering herd" problem that can hammer APIs during cache misses.
Automatic retries and rate limiting. Network hiccups happen. RPC providers go down. The SDK includes configurable retry logic with exponential backoff — it won't give up on the first failure, but it also won't spam a struggling endpoint. Rate limiting is built in too, using a token-bucket approach that keeps you within server-side limits without you having to think about it.
RPC provider failover. If your primary RPC endpoint starts failing, the SDK automatically switches to a backup. You can configure multiple providers per chain, set failure thresholds, and define cooldown periods. If all providers go down, it falls back to the last known working one. For production systems, this kind of resilience isn't a nice-to-have — it's a requirement.
Security by default. Private keys are cleared from the configuration object immediately after the wallet account is created. The SDK rejects unencrypted HTTP RPC endpoints unless you explicitly override that protection. Error messages are sanitized before they reach your application, stripping out file paths, RPC URLs, and stack traces that could leak infrastructure details. There's even an encrypted secrets vault for storing sensitive values locally — your keys are encrypted at rest using Fernet encryption, and only the key names are visible in the vault file.
One design choice that deserves a callout is how the SDK handles errors. Instead of throwing exceptions for expected failures — a network timeout, a rejected order, an on-chain revert — every operation returns a Result object. You check .success, and if it's true, your data is in .data. If it's false, a human-readable error message is in .error.
This might sound like a small thing, but in practice it makes a big difference. Exception-based error handling in async code can be tricky and hard to reason about. The Result pattern makes failures explicit and predictable. Your trading bot won't crash at 3 AM because of an unhandled exception from a network blip — it'll see a failed result and do whatever your logic says to do about it.
For applications that need live market data, the SDK includes an optional WebSocket manager. Subscribe to order book updates for specific trading pairs and receive events through async callbacks. The connection handles reconnection automatically, and callbacks integrate with your async runtime naturally — whether that's asyncio in Python or the Node.js event loop in TypeScript. This is particularly useful for market-making bots that need to react to order book changes in real time.
The Python SDK is available on PyPI and the TypeScript SDK on npm. Install either one, set a couple of environment variables, and you're reading order books. If you want to trade, add your signing key — either through the encrypted secrets vault or by passing a signer object directly (we recommend the latter so your raw key never touches a config file).
The documentation includes a user guide with copy-paste examples for every major workflow, an architecture overview for contributors who want to understand the internals, and a caching guide for tuning performance. If you want the full picture, start there. If you want to jump straight to code, the getting-started tutorial covers setup through your first trade.
The SDK isn't a standalone island. It's designed to fit into the broader tooling ecosystem that developers already use. The async-first architecture means it integrates cleanly with frameworks like FastAPI and Express. The structured JSON logging option outputs one event per line with timestamps and metadata fields — ready for Datadog, Loki, Grafana, or whatever log aggregator your team runs. Configuration flows through environment variables, .env files, or constructor arguments, so it works the same way whether you're running locally, in Docker, or on Kubernetes.
For teams that operate across multiple environments, the SDK handles testnet and mainnet simultaneously within the same process. Cache namespaces are separated by endpoint, so a testnet client and a mainnet client won't contaminate each other's data. Switch between environments by changing a single configuration value.
This release covers the core trading, swap, and portfolio operations. We're actively working on expanding the SDK based on community feedback. If there's a feature you'd like to see, open an issue on the repo — or better yet, open a pull request.
We built Dexalot to bring the performance and precision of traditional exchange infrastructure to DeFi. The Python and TypeScript SDKs are how we make that accessible to every developer with a terminal and an idea.
Both the Dexalot Python SDK and TypeScript SDK are open source. Check the repositories for full documentation, examples, and contribution guidelines.
Python SDK | GitHub: github.com/Dexalot/dexalot-sdk-python
Python SDK | PyPi: pypi.org/project/dexalot-sdk
TypeScript SDK | GitHub: github.com/Dexalot/dexalot-sdk-typescript
TypeScript SDK | NPM: npmjs.com/package/@dexalot/dexalot-sdk
Happy trading.