Building tier · Reference card · Agents Academy

Building.
One sheet.

limitless-cli command shape, the data-freshness gate, the agents-starter directory layout, the custom-skill anatomy, and the patterns that turn raw CLI output into structured tool results. Pin it; print it; come back to it.

01

limitless-cli

M07
// TODO: confirm command surface limitless markets list limitless markets get <slug> limitless orders place ... limitless orders cancel <id> limitless positions get limitless trades list // JSON output for agents limitless --json markets list

Always pass --json when the agent will parse the output. Human-readable output is for humans.

02

Data-freshness gate

M08
limitless orderbook events \ <slug> --limit 1 --output json // → { events: [{ // createdAt, side, // price, matchedSize }], // totalPages } // freshness = now − createdAt

Gate before every order. Newest event older than your budget (60–120s) → skip the market.

03

agents-starter layout

M09
src/ core/ limitless/ sdk-trading.ts // @limitless-exchange/sdk wrapper markets.ts // market discovery redeem.ts // claim resolved positions portfolio.ts // positions / balances websocket.ts // live price stream polymarket/ // @polymarket/clob-client-v2 price-feeds/hermes.ts // Pyth Hermes SSE oracle telegram/ // optional alerts kelly.ts // fractional-Kelly sizing wallet.ts // signer / keys strategies/ base-strategy.ts // shared lifecycle cross-market-mm/ // flagship cross-venue MM oracle-arb/ // Pyth oracle vs Limitless certainty-closer/ // SDK-only, first dry-run SKILL.md // operating manual (~3.3k lines) tests/ // vitest contract gate .env // PRIVATE_KEY, LMTS_TOKEN_ID, LMTS_TOKEN_SECRET

Strategies extend base-strategy.ts (except cross-market-mm, which has its own runtime loop) and run on the official Limitless SDK. A coding agent drives the repo via SKILL.md; start with certainty-closer for your first DRY_RUN.

04

Custom skill

M10
// One skill = name + desc // + input + impl export const riskCheck = { name: "risk_check", description: "Verify an order is within risk caps before signing.", input_schema: { /* … */ }, async run(input) { // pre-trade checks return { ok, reason }; } };

Description is the most important field. The model decides when to call it from the description alone.

05

Tool result shape

M10
// Always structured + bounded { ok: boolean, data: { /* <= 4kB */ }, error?: { code, message }, truncated?: boolean }

Cap output at ~4kB. Anything bigger consumes context, drowns attention, and slows the loop. Truncate large lists; emit a follow-up tool to fetch detail on demand.

06

Tool idempotency

M10

Every state-changing tool needs a client-side nonce.

place_limit_order({ slug: "…", outcome: "yes", side: "buy", size: 100, price: 0.55, nonce: "uuid-v4" })

Retry with the same nonce is safe (server dedupes). New intent → new nonce.

07

Building tier pitfalls

Cross-module
  1. Parsing CLI human output. Always use --json. Human output reformats with version bumps and breaks parsers silently.
  2. Skill namespace collisions. Two skills named place_limit_order in different files → the model picks at random. Use one name, one impl.
  3. Tool-result truncation hidden from the model. When you cut a list, return truncated: true so the model can ask for more, not silently work on a partial view.
  4. agents-starter overfit. The starter is a starting point. Don’t treat its structure as canon for every agent, deviate as the trading style demands.
  5. Env vars in tool input. The model can hallucinate API keys into a tool call. Tools read env vars themselves; don’t accept them as arguments.
  6. No timeout on tool calls. A hung tool blocks the loop forever. Cap at 30s per tool; abort and return error.
08

Build flow

Cross-module
  • Step 1. Wire limitless-cli as a read-only tool. Verify the agent can browse markets without errors.
  • Step 2. Add the orderbook events freshness gate; skip any market whose newest trade is stale.
  • Step 3. Drop in agents-starter; replace its sample skill with one of yours.
  • Step 4. Add risk_check + cost_estimate as required pre-conditions for place_limit_order.
  • Step 5. Run on testnet / mock for 24h. Confirm zero hallucinated tool calls, zero state corruption, zero secret leaks.