Chainworks API
Welcome to the Chainworks API documentation. Build powerful DeFi applications with our unified WebSocket API.
What is Chainworks?
Chainworks provides a WebSocket-based DeFi API that enables developers and institutions to easily access trading, token analysis, and other DeFi functionality across multiple blockchains.
Supported Chains
| Chain | Identifier | Type | Native Token |
|---|---|---|---|
| Ethereum | eth | EVM | ETH |
| Base | base | EVM | ETH |
| BNB Chain | bsc | EVM | BNB |
| Solana | sol | SVM | SOL |
Core Features
Token Trading
Execute swaps across multiple DEXes with optimal routing. Get quotes, build transactions, and send them with MEV protection.
Price Quotes
Real-time price quotes with slippage calculation, price impact analysis, and liquidity information.
Token Reports
Comprehensive token analysis including:
- Liquidity depth
- Buy/sell taxes
- Transfer limits
- Holder restrictions
- Market data
Multi-Chain Transfers
Build and send native currency and token transfers across all supported chains.
Quick Example
typescript
import { io } from "socket.io-client";
const socket = io(CHAINWORKS_API_URL, {
transports: ["websocket"],
auth: { token: CHAINWORKS_API_AUTH_TOKEN },
});
socket.on("connect", () => {
console.log("Connected to Chainworks API");
// Get a buy quote
socket.emit("/evm/buy/quote", {
chain: "eth",
token: "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
swapMode: "ExactIn",
amountIn: "1000000000000000000",
wallet: "0xYourWallet",
});
});
socket.on("/evm/buy/quote", (response) => {
if (response.success) {
console.log("Price:", response.result.price);
}
});Next Steps
- Quick Start — Set up your environment and make your first request
- Authentication — Learn how to connect with your credentials
- EVM Endpoints — Explore Ethereum, Base, and BSC APIs
- SVM Endpoints — Explore Solana APIs
- Playground — Test the API interactively