A product API, not a toolbox
createSwarm({ identity }) gives you wallet, markets, portfolio, perps, signals and risk — named after what you want to do, not after the protocol underneath.
Read the SDK reference
Cross-chain signing, balances, swaps, perps and prediction markets over a Turnkey wallet — as a typed SDK and as a CLI.
import {
createSwarm,
markets,
} from "@swarm-ai-labs/turnkey-extensions/runtime";
// Public market data — no wallet involved.
await markets.perps({ search: "ETH" });
await markets.funding({ minApr: 0.2 });
// Everything else, bound to one wallet and one budget.
const swarm = createSwarm({ identity, policy: { capUsd: 500 } });
await swarm.portfolio.holdings(); // the whole wallet, valued
await swarm.portfolio.positions(); // Hyperliquid + Binance + Polymarket + ADI
await swarm.perps.open({
coin: "ETH",
side: "buy",
notionalUsd: 250,
mode: "live",
});Or the same thing without writing any code:
swarm login --email you@example.com
swarm holdings
swarm positions
SWARM_BUDGET_USD=500 swarm market hyperliquid buy --coin ETH --notional 250 --confirm| Area | Chains and venues |
|---|---|
| Signing and sending | EVM (any chain id), Bitcoin, Solana, TRON, TON, Sui, NEAR |
| Balances and prices | Indexer-first reads with RPC fallback, CoinGecko merge, portfolio valuation |
| Swaps | 1Click (NEAR Intents), Uniswap v3, gas.zip, LI.FI, CoW limit orders |
| Perps | Hyperliquid, Binance USD-M futures |
| Prediction markets | Polymarket, ADI PredictStreet |
| AI | Envy signals, 0G Compute inference with TEE attestation |
Where to start
Writing code → SDK reference. Typing commands → CLI reference. Looking for one specific function → capabilities reference.