Raxx · internal docs

internal · gated ↑ index

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

Status: Proposed 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

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