candella
v0.0.1
Published
Candella Copytrade SDK. Push algo signals that fan out to followers' brokers.
Maintainers
Readme
Candella SDK (JavaScript / TypeScript)
The official JavaScript and TypeScript SDK for Candella Copytrade. Push your algo's signals into Candella with one signed call, and Candella fans them out to your followers' brokerage accounts.
Zero runtime dependencies (uses the built-in fetch and node:crypto,
Node 18+). Full API reference: https://candella.dev/copytrade/developers
Install
npm install candellaQuickstart
import { Copytrade } from "candella";
const cc = new Copytrade({ apiKey: "...", secret: "...", strategyId: "my-algo" });
await cc.startSession(); // arms live execution when your algo wakes
// right next to your own broker order:
await webull.placeOrder("SPY", "buy", 10); // your execution, your account
await cc.signal("SPY", "buy", 10, 512.3); // the copy signal, one line
// options use canonical OCC fields (broker-neutral; Candella re-encodes per follower):
await cc.signalOption("SPY", "BTO", 5, 3.1, { expiry: "2026-07-18", strike: 520, right: "C" });
await cc.endSession(); // when your algo sleepsHow it works
- Identity is server-side. You never send which lead or account you are; your API key resolves that. You only describe the trade.
- Sessions are the consent gate. Signals only fan out to real accounts while a session is active. A signal sent with no active session is recorded and dropped before any order, which is how you integration-test safely.
- Idempotency. Pass a stable
signalId(your order id or a hash) for safe retries. If omitted, a content hash of the signal is used, so an identical re-send collapses instead of double-firing. - Emit explicit closes. A
sellorstcsignal must accompany every exit, or followers hold positions that never close. - Latency floor around one second, dominated by the downstream broker write rather than this client. Good for minute-bar and swing strategies, not sub-second HFT.
Credentials
Generate an API key and secret on your Algo keys page.
Development
git clone https://github.com/jwlutz/candella-sdk-js
cd candella-sdk-js
npm install
npm test
npm run buildLicense
MIT
