The 10 correctness rules

The rules that, broken, produce plausible-looking wrong numbers on this chain.

Why this page exists

These rules are deliberately useful to people who will never be our customers. Every one of them describes a way to get a wrong answer that looks right, and every one of them is currently being got wrong somewhere in this market.

Publishing them is the strategy: rules get cited, and a correctness brand is built by being right in public rather than by asserting it in marketing copy.

The rules

FieldTypeDescription
R1pricesRobinhood REST prices are RAW UNDERLYING. Multiply by current_multiplier before comparing to anything onchain.
R2pricesChainlink prices are ALREADY multiplier-adjusted. Never apply uiMultiplier() to one — it squares the multiplier.
R3historyHistorical valuation uses the multiplier AT THAT BLOCK, never the current one. This is the bug in every incumbent's historical balance API.
R4balancesRaw balances are static across corporate actions. A balance unchanged across a split is correct, not stale.
R5returnsStock tokens track TOTAL return, not price return. Dividends are reinvested through the multiplier.
R6conflictsOnchain wins on conflict. Where REST and onchain disagree about a multiplier, onchain is authoritative — and log the divergence.
R7oraclesNever interpolate a stale oracle. Flag STALE_ORACLE with the staleness in milliseconds instead of inventing a value.
R8aggregationNever aggregate across sessions without a flag. VWAP and OHLCV spanning a session boundary mix regimes.
R9streamingEvery sequenced transaction reaches a terminal state — INCLUDED, DROPPED or REORGED. Never leave a pre-confirmation dangling.
R10failureDegrade loudly. A stale value is flagged, never silently substituted — a confidently-served wrong number is worse than an error.

Checking your own code

Our linter runs against any codebase, including one using a competitor's SDK. It flags raw balances multiplied by a price, historical queries missing as_of, cross-session comparisons, and Chainlink prices multiplied by uiMultiplier().

npx @robinhoodrpc/lint ./src

Related