Skip to main content
agents-starter is the canonical end-to-end starter for building an autonomous trading agent on Limitless. Fork it, set two env vars, and run a strategy in DRY_RUN within five minutes.
This is for individual traders, builders, and AI agents who want a working code template, not a partner integration. If you’re building a platform where other users trade through your product, see Programmatic API instead.

What’s included

agents-starter is a small TypeScript project. It uses the official @limitless-exchange/sdk for order placement, market data, and websocket streaming, plus a few hand-rolled helpers (Pyth price feed, Polymarket adapter, diagnostics) that aren’t in the SDK.
FileWhat it does
src/strategies/Three strategies: cross-market-mm (flagship — see Cross-market market making), oracle-arb, certainty-closer.
src/core/limitless/Thin wrappers over the SDK + utilities the strategies share.
src/core/kelly.tsFractional-Kelly position-sizing util.
src/scripts/One-shot diagnostic scripts (balance check, orderbook inspector).
SKILL.mdOpenClaw / Claude Code skill manifest — agents can read it and run the bot end-to-end.

5-minute setup

Generate a dedicated wallet for this bot. Fund it with only what you’re prepared to lose. Do not use your main wallet.
git clone https://github.com/limitless-labs-group/agents-starter.git
cd agents-starter
npm install

cp .env.example .env
chmod 600 .env
# Edit .env, fill in PRIVATE_KEY (your dedicated wallet) + a Limitless scoped HMAC token
Get your scoped HMAC token from the Limitless UI (see Authentication):
  1. limitless.exchange → Connect wallet
  2. API token modal → API Tokens tab → Derive
  3. Copy the tokenId + secret into .env as LMTS_TOKEN_ID + LMTS_TOKEN_SECRET

Run a strategy

Always start with DRY_RUN=true in .env — every order intent is logged but nothing signs or posts.
# Dry run (no real trades)
DRY_RUN=true npm run oracle-arb

# Live trading once you're satisfied with the dry-run log
DRY_RUN=false npm run oracle-arb
Use a small usdAmount for your first live runs (start at 22-5 per order). Strategies are conservative by default but no bot is bug-free.

Built-in strategies

Each strategy is an entry point — pick one or fork it.

cross-market-mm (flagship)

Cross-venue market making: quote on Limitless, hedge fills on Polymarket to stay delta-neutral. Earns the cross-venue spread plus Limitless maker rebates + LP rewards. It has its own full guide — see Cross-market market making.
npm run cross-market-mm            # dry-run by default

oracle-arb

Cross-references a Pyth (Hermes SSE) oracle price against Limitless markets that resolve on the same underlying. Submits FOK/FAK orders when the implied probability strays far enough from the oracle to cover fees + slippage. The price-feed / edge-detection archetype.
npm run oracle-arb

certainty-closer

The simplest on-ramp — SDK-only, no external feeds. Filters markets near resolution and buys the favourite, sized via fractional Kelly (src/core/kelly.ts). Honestly framed: on its own it has no independent edge (the edge is one you assert); it’s the cleanest example of the market-filter → decide → execute loop.
npm run certainty-closer

Bring your own strategy

The example strategies (oracle-arb, certainty-closer) extend BaseStrategy (src/strategies/base-strategy.ts); the flagship cross-market-mm has its own runtime loop. To build one on BaseStrategy:
  1. Implement tick() — return a list of TradeDecisions based on whatever signal you care about.
  2. Implement initialize() / shutdown() for setup + teardown.
  3. The base class runs the tick loop and handles order placement + DRY_RUN gating.
import { BaseStrategy } from './base-strategy.js';

export class MyStrategy extends BaseStrategy {
  async scan() {
    // your edge logic — return TradeDecision[]
  }

  async shouldExit() {
    // your exit logic — return positions to close
  }
}
Create a run.ts next to it that wires up the runtime, and add an entry to package.json scripts.

Under the hood

agents-starter uses the official @limitless-exchange/sdk for everything order-related. The signing path is EIP-712; the SDK handles venue-specific routing (default CTF vs neg-risk exchange) automatically based on the market metadata.
Taker delay. Some markets apply a short hold to marketable (taker) orders — the FOK/FAK orders strategies like oracle-arb submit — before the matching engine fills them. On such a market, order submission is asynchronous: the create-order response comes back with settlementStatus: "DELAYED" and an eligibleAt timestamp rather than a finished fill, and the actual fill arrives later over the order-events websocket (provisional MATCHED → terminal MINED / FAILED). Observe the fill on that stream — don’t treat the DELAYED response or the gap before the fill as an error. postOnly maker quotes are never delayed. See WebSocket Events.
For background on the protocol layers the agent is interacting with, see:

Authentication

API tokens, HMAC scoping, and which auth mode to use for which flow.

EIP-712 signing

The exact typed-data structure your wallet signs to place an order.

Venue system

Default CTF vs neg-risk exchange routing and why it matters.

WebSocket events

Real-time price + fill + portfolio updates.

AI agent operation

SKILL.md in the repo is the operating manual for an AI agent. Feed it to Claude Code, OpenClaw, or any coding agent with shell + file access. The agent handles:
  • Environment + dependency setup
  • Wallet configuration
  • Strategy selection based on what you ask
  • Deployment + monitoring + iteration
The manual covers SDK reference, partner integration flows, error handling, and known footguns — designed to remove the back-and-forth of “what API do I call for X?”

What’s next

Recently shipped, and on the roadmap:
  • Cross-market market making — the replicator strategy mirrors a Polymarket book onto Limitless as resting quotes and hedges fills back on Polymarket to stay delta-neutral. Earns the spread + Limitless maker rebates.
  • Inline tutorial prompts so a fresh agent run starts with “which strategy do you want?”
  • Per-strategy backtesting against historical fill data.

Support