# Kestrel vs Alpaca (and Alpaca MCP): Broker API vs a Perception + Latency Layer (/blog/kestrel-vs-alpaca-mcp)

2026-07-12 · kestrel.markets

## Answer card

Alpaca is a broker API (accounts, data, order routing) and an Alpaca MCP is a thin tool wrapper over it. Kestrel's live path is designed to use Alpaca as a bring-your-own broker, and adds the layer neither provides: perception (the chart is in text), latency (fire-then-inform), and an honest grade. With a raw broker the agent still reads ticks and decides in the request loop. Arm a `PLAN` and the runtime fires in milliseconds while the agent is still thinking.

## The thesis

**The two failures of LLM trading are interface (perception and latency), not intelligence.** A frontier model can reason about markets. What it cannot do is stare at a raw JSON tick stream and see a chart, and it cannot route an order inside a 200ms window while a token-by-token generation is still streaming. A broker API hands you the pipe to the market. It does not fix either failure. That is not a criticism of Alpaca; it is a statement about which layer the problem lives in.

## What each layer actually is

Alpaca (raw or via MCP) is the **broker and data primitive**: authenticate, pull bars and quotes, place and cancel orders, read positions. An Alpaca MCP server makes those same calls available to an agent as tools, genuinely useful, and the fastest way to let a model touch a live account. But an MCP tool call is still a synchronous request the agent makes from inside its own reasoning loop. The agent formats the tick data it gets back into its own context, decides, then calls `place_order`. It is in the hot path on every decision, and nothing records whether its judgment was any good.

Kestrel is the **perception and latency layer** that sits above whatever broker you bring:

- **VIEW (perception).** Renders the market as a compact text **Frame**, a chart-in-text sized for a context window. A vertical, append-only tape, one row per candle, newest last, candles expressed in basis points relative to the prior close and anchored by periodic keyframes. Perception cost is **O(new bars), not O(screen)**, and the append-only shape is KV-cache-friendly. A raw quote feed is neither.
- **WAKE (attention).** A standing subscription over a trigger algebra. Event-driven, not polling. It spends attention (tokens, wakes), never risk, so the agent is not burning a context window re-reading a quiet tape.
- **PLAN (latency).** A standing, bounded-risk contingent program: trigger, actions, bracket, invalidation, TTL. The runtime fires it in milliseconds and wakes the agent in parallel. This is **fire-then-inform**, and it is the whole point: **the agent is never in the hot path.**
- **GRADE (trust).** The honest, counterfactual result of a run. Contamination-fenced (LLM authors are graded only on post-training-cutoff, date-blinded days) because **weights leak what code fences can't stop**. It grades judgment, not parameters, with `VS ungated` and `VS null` counterfactuals in the syntax. A broker API gives you a fill; it never tells you whether the decision was skill.

Here is how an agent *could* express an intraday momentum idea as a Kestrel plan. Illustrative only, generic instruments: you would deploy a template like this into your own pod and arm it yourself:

```
IMPORT fade-ladder FROM ./armory/reversion.kestrel
USING signal SPX exec SPY 0dte

PLAN headline-chase budget 0.25R ttl 15:55 regime {intraday: trend}
  WHEN spot > hod AND velocity(5m) >= p95
  DO buy 2 +1 C @ min(fair, mid) peg cap fair
  TP 2.5x frac 0.5 @ fair
  EXIT spot < vwap held 120s @ fair
  INVALIDATE spot < hod - 30bp -> halt
```
*Target grammar; parser parity tracked in the kestrel repo.*

The `@ min(fair, mid) peg cap fair` matters: **a quote is not a value.** The runtime prices against fair value with book-aware guards, not whatever the last print happened to be. A raw `place_order` call has no such vocabulary: you pass a number and hope.

## The comparison

Radically fair. Alpaca is a broker primitive; Kestrel is a layer above it. Several rows below are ones where you do not need Kestrel at all.

| Dimension | Alpaca API (raw) | Alpaca MCP (thin wrapper) | Kestrel + kestrel.markets |
|---|---|---|---|
| Primary reader | Application code | An LLM agent | An LLM agent |
| Perception model | Raw bars/quotes (JSON) | Raw bars/quotes as tool output | Frame: chart-in-text, O(new bars) |
| Agent in the hot path? | N/A (your code is) | Yes, decides in the request loop | No, fire-then-inform |
| Latency floor | Network + your code | Network + model round-trip | Runtime fires in ms; agent wakes in parallel |
| Native interface / MCP | REST + WebSocket | MCP tools | HTTP+SSE canonical; SDK, CLI, MCP as equal projections |
| Agent-native auth (Envelope) | API keys | API keys | Envelope: {scope, budget, ceiling, expiry, revocation}, two-signer |
| Machine payment | No agent-native machine-payment surface | Same | 402 Offer settled by wallet (Stripe MPP / x402) |
| Evaluation honesty | Fills only, ungraded | Fills only, ungraded | Contamination-fenced Grade; VS ungated / VS null |
| Provenance | Account statements | Account statements | Certified deterministic Blotters + Grades, shareable proof URL |
| Live model (custody) | Alpaca custodies | Alpaca custodies | BYO broker via OAuth (roadmap); platform never takes custody |
| Data licensing | Alpaca-licensed feeds | Same | Databento served as derived works + BYO Alpaca |
| Activation path | Signup → API key | Signup → API key → wire MCP | Proof-before-account: trial capability → sim → proof URL |
| Pricing | Broker/data plans | Same | Free sim + certification; paid at the 402 boundary |
| Best for | Building your own trading app | Letting an agent poke a live account fast | Agents that must perceive, pre-commit, and be graded |

## Complement, not only rival

Kestrel does not replace Alpaca: the live path is designed to **use** it. In Kestrel's mode ladder (SIM → PAPER → LIVE), the LIVE broker is bring-your-own via OAuth — **Alpaca, IBKR, Robinhood** — added by you, never custodied by the platform. The platform hosts the scarce parts (deterministic execution, licensed data as derived works, provenance) and rents nothing it does not have to. **Certification over custody:** Kestrel is an open judge that sells the certificate; Alpaca keeps the money. **Sell the airport, not the pilots.**

## Where Kestrel is not the fit

Be honest about it:

- **You are building an application, not deploying an agent.** If your own code is the decision-maker and you want direct order routing, a broker API (with or without an MCP shim) is the right and simpler tool. Kestrel's perception and latency layers exist for an *external agent*; they add nothing to deterministic app code.
- **You need custody or a fully managed account today.** Kestrel is regulatory-clean by staying BYO-broker and never taking custody. Alpaca *is* the broker. Different job.
- **You want a turnkey broker wrapper, not a language.** Anonymous trial sims, certified Grades, shareable proof URLs, and 402 Offers run today; the free tier needs no signup. Kestrel is the perception, authority, and certification layer on top of your broker; Alpaca is the venue underneath it.
- **You do not care about grading.** If you will never ask "was that skill or luck," the honest-grade machinery is overhead you will not use.

## The shape of the difference

A broker API answers *how do I send this order.* An Alpaca MCP answers *how does an agent send this order.* Kestrel answers the two questions underneath both, *how does an agent see the market, and how does it act faster than it can think*, and then, unforgivingly, *was the judgment any good.* **A backtest is never flattering** when it is contamination-fenced, which is exactly why the grade means something.

## Citable one-liner

> Alpaca is the pipe to the market; Kestrel is how an agent perceives, pre-commits, and gets honestly graded before that pipe is ever touched.
