Raxx · internal docs

internal · gated

ADR 0013 — MBT: Raxx-native paper-trading engine, displacing per-user Alpaca OAuth for paper

Status: Deferred (2026-05-29) Date: 2026-04-22 Deciders: product owner (user), software-architect Related: ADR 0002 (no stored credentials), ADR 0003 (GDPR by default), ADR 0014 (Alpaca scope reframe), docs/architecture/mbt-paper-trading-engine.md, docs/architecture/multi-tenant-alpaca.md Supersedes: ADR 0008, ADR 0009, ADR 0010, ADR 0011 (original multi-tenant Alpaca design, PR #184) Parent epic: #183


Status update — 2026-05-29

Current paper-trading path does not use a Raxx-native engine. paper_order_service.py routes all paper trades to the Alpaca paper endpoint. The MBT engine described in this ADR was never built.

Why deferred: The 2026-05-23 launch posture is operator-testing-ready, not public launch. At operator-testing scale, building a full paper-trading simulator in parallel with live-trading infrastructure would represent significant dual implementation cost with no customer-facing return. The Alpaca paper endpoint provides sufficient fidelity for the current operator-testing window.

Re-evaluation triggers — any one of these reopens this ADR:

  1. Broker paper endpoint fidelity issues emerge in production (incorrect fills, missing corporate actions, options expiration failures).
  2. Launch posture changes from personal-use-only to real customers or multi-broker BYOB — at that point per-user Alpaca paper complexity and data sovereignty concerns return.
  3. Regulatory pressure on routing paper-trade volume through a real-broker endpoint (e.g. counsel flags that Alpaca paper usage has reporting obligations we did not anticipate).

Current state of the invariants this ADR was designed to satisfy:

This ADR remains in the record. The motivation, design, and alternatives documented below are correct and should be used as the starting point when any re-evaluation trigger fires.


Context

The original multi-tenant design (PR #184, superseded ADRs 0008-0011) routed every user through Alpaca OAuth for paper and live trading. This over-depended on Alpaca:

Realization: Alpaca's paper trading is a simulator. We can be that simulator. Doing so eliminates per-user OAuth complexity for paper (vast majority of users), restores the "no stored credentials" invariant for that majority, makes tier retention trivial (our DB), gives us data sovereignty, and keeps Raxx out of Broker-API / BD territory forever. We become a research + paper + broker-handoff platform, not a broker.

Decision

Raxx builds MBT — a native paper-trading engine — and uses it as the default execution surface for all users. Alpaca is scoped to (a) one shared server-side market-data account, and (b) optional per-user live-broker handoff for Pro+ users who graduate from paper (see ADR 0014).

Scope

Out of scope (intentional)

Migration

Dark → shadow (double-write MBT alongside Alpaca paper for parity diff) → flagged per-user cutover → GA (Alpaca paper writes disabled). Detailed in mbt-paper-trading-engine.md §10.

Consequences

Positive

Negative

Neutral

Alternatives considered

Stay with the PR #184 plan (per-user Alpaca OAuth for paper)

Rejected. The reasons to change are the positive consequences above: invariant compliance, tier retention, data sovereignty, onboarding friction. The reasons to stay were mostly "less engineering for us" — real, but outweighed.

MBT for paper, but route all live via our own broker/clearing partnership (Broker API)

Rejected and permanently off-roadmap. BD status + FINRA-regulated clearing is a regulatory lift Raxx does not want. Live routes stay user-to-Alpaca OAuth via the live-handoff pattern (ADR 0014). Pro tier adds a second broker (per pricing matrix — likely IBKR or tastytrade) via the same handoff pattern.

Use a third-party simulator library / service

Considered, rejected. No mature off-the-shelf options simulator exists that covers our scope (multi-leg options, corporate actions, tier retention). Commercial options (e.g. QuantConnect-as-backend) cede too much of the product. Open-source options-pricing libraries (e.g. QuantLib) help at the math layer but do not solve the account/order/fill surface. Build remains correct.

Minimal v1 scope (equities only, no options)

Rejected for product reasons. Persona is options-forward ("Weekly-Income Pat"). Options parity in v1 is a product requirement, not a nice-to-have.

Compliance checklist

Revisit when