Algo integration API specification
A small REST API for creators to register algos, stream trading signals, report health and upload backtests, plus webhooks that tell your server what subscribers executed. Version 1. Base URL https://fintrens.com/lantern/api/v1. OpenAPI 3.1 document.
Authentication
Every request carries an API key as a bearer token. Keys are scoped to one algo and one environment (sandbox or live). Rotate keys from the creator console; old keys stay valid for 24 hours.
Algos
Signals
A signal is an instruction the platform fans out to every subscriber's broker account, sized by their allocation. Multi-leg signals are atomic: either all legs are placed or none.
Sizing: lots_per_lakh scales quantity to each subscriber's allocation. Exchange rules allow LIMIT orders only; MARKET is rejected. Exit signals reference the entry via parent_signal_id.
Heartbeat
Three missed heartbeats pause the algo for new entries and notify subscribers; open positions are managed by the platform stop-loss.
Backtests
The trade log uses the same template as the Create a strategy upload: one row per leg, and legs that share a trade_id form one multi-leg trade. Download the CSV template.
| Column | Meaning | Example |
|---|---|---|
trade_id | Groups legs into one trade. Legs that share a trade_id are a multi-leg trade. | T1 |
leg | Leg number within the trade (1, 2, 3…). | 1 |
entry_time | Entry date and time: YYYY-MM-DD HH:MM (IST for India, ET for US stocks, UTC for crypto). | 2024-01-02 09:20 |
exit_time | Exit date and time, same time zone: YYYY-MM-DD HH:MM. | 2024-01-02 15:15 |
exchange | India: NSE, BSE, NFO, BFO, MCX, CDS, NCDEX or NCO. US stocks: NYSE, NASDAQ, ARCA or CBOE. Crypto: BINANCE. | NFO |
symbol | Underlying or stock symbol as in the scrip master. | NIFTY |
instrument | EQ (cash), FUT or OPT. | OPT |
expiry | Contract expiry, YYYY-MM-DD. Blank for EQ. | 2024-01-04 |
strike | Strike price. Options only. | 21700 |
option_type | CE or PE. Options only. | CE |
side | BUY or SELL. | SELL |
quantity | Units traded (lots × lot size, or contracts × 100 for US options), positive. Crypto can be fractional. | 50 |
entry_price | Average entry price, in ₹ for India and in $ / USDT for US stocks and crypto. | 120.50 |
exit_price | Average exit price, same currency. | 88.30 |
charges | Optional. Brokerage, taxes and fees for the leg, same currency. | 40 |
Webhooks (platform → creator)
Register a URL per algo. Payloads are signed with the same HMAC scheme. Retries: 5 attempts with exponential backoff.
| Event | When |
|---|---|
signal.filled | Aggregate fills for a signal reach 100% or valid_till passes |
signal.rejected | Validation or risk check failed (reason included) |
subscriber.joined / subscriber.left | Subscriber count and AUM change |
algo.paused | Missed heartbeats, exchange halt or risk breach |
payout.settled | Monthly subscription and profit-share payout |
Marketplace read API (public)
Read-only endpoints used by white-label partners and this site's assistant. No key required; 60 requests / minute per IP.
Errors and limits
| Status | Meaning |
|---|---|
400 validation_error | Schema violation; errors[] lists fields |
| 401 / 403 | Bad key, wrong environment or signature mismatch |
409 duplicate_client_ref | Same client_ref seen in the last 24 h (idempotent) |
422 risk_rejected | Stop-loss above listed SL, or order type not allowed |
| 429 | Rate limit: 120 signals / min per algo, 600 requests / min per key |
Sandbox
Sandbox keys hit https://fintrens.com/lantern/sandbox-api/v1, simulate fills against delayed market data and never reach a broker. Backtests submitted in sandbox count toward verification.