Vamshi
Start
A beginner’s technical field guide

Inside a trading system

What really happens after you choose a stock and tap Buy? Follow an order through a brokerage, risk checks, routers, market makers or exchanges, clearing, T+1 settlement, custody, and the systems that reconcile every dollar and share.

QuotesOrder booksOMSRiskSmart routingExchangesMarket makersFillsNSCCDTCT+1Custody

01 · Mental model

Four systems, one trade

A brokerage app is the visible edge of a regulated transaction network. Separate these four jobs and the ecosystem becomes much easier to reason about.

See the market

Reference data identifies the security. Market-data feeds provide bids, offers, trades, status, and sometimes full order-book depth.

Control the order

The broker authenticates the customer, checks buying power and restrictions, records the instruction, and decides where it may be sent.

Find a counterparty

An exchange, alternative trading system, wholesaler, or market maker matches or executes the order against another willing buyer or seller.

Finish ownership

Clearing calculates obligations and reduces counterparty risk. Settlement moves securities and money; custody updates the customer’s books and records.

Execution is not settlement. An execution creates a binding trade at a price and quantity. Settlement later completes delivery of the securities and payment. For most U.S. broker-dealer transactions in covered securities, the standard cycle has been T+1 since May 28, 2024.

02 · Market language

What the numbers mean

A quote is not a promise that unlimited shares are available. It is a snapshot of displayed willingness to trade, with size, timing, venue, and market conditions attached.

Best displayed bid
$99.98
600 shares

Highest displayed price buyers currently offer.

Best displayed ask
$100.02
400 shares

Lowest displayed price sellers currently offer.

Bid-ask spread: $0.04. A marketable buy typically interacts with offers; a marketable sell interacts with bids.
NBBO

Best bid and offer

The best protected displayed prices across relevant U.S. venues, consolidated into a national view.

VOL

Volume

Shares or contracts executed during a period. A 100-share trade adds 100 to reported share volume, not 200.

LIQ

Liquidity

The ability to trade size quickly with limited price impact. Spread, depth, resiliency, and activity are clues.

CAP

Market cap

Share price multiplied by shares outstanding. It measures equity value, not daily trading volume.

Why can the price move when I buy?
The best offer has finite size. A large market order may consume the first offer, then the next, producing multiple fills at different prices. Quotes can also cancel or change before your order arrives. The difference between an expected price and the actual average execution is often called slippage.
Displayed volume vs. total interest
Top-of-book data shows only the best displayed quote. Depth feeds show additional displayed levels. Some orders are partially displayed, non-displayed, midpoint-priced, conditional, or held by firms outside the visible book. Executed trade volume is different from resting quote size.

03 · Interactive trace

You tapped Buy

Step through a simplified U.S. retail stock order. Some stages happen in parallel or are provided by a clearing firm behind the customer-facing broker.

Customer order trace

Example: buy 10 shares of XYZ with a limit price.

0 / 10Ready to begin
1
Customer constructs the order

Symbol, buy or sell, quantity or notional, order type, limit or stop price, time in force, session, and optional tax-lot instructions.

2
App validates obvious errors

Valid symbol and increments? Required price supplied? Supported session? The client can help, but the server remains authoritative.

3
Broker authenticates and deduplicates

The API verifies the session and account, applies rate limits, and uses a client order ID or idempotency key to prevent accidental duplicates.

4
Pre-trade risk checks run

Buying power, position, settled funds, margin, short locate, options approval, concentration, restricted securities, trading halt, and regulatory controls.

5
OMS accepts the instruction

The order-management system assigns a durable broker order ID, journals the event, reserves cash or shares, and moves the order to an accepted state.

6
Router selects a destination

Based on price, displayed size, execution quality, speed, fees or rebates, venue health, customer instruction, and broker obligations.

7
Venue or dealer executes

A market maker may fill as principal, or an exchange/ATS matching engine pairs the order with resting interest. One order can receive several partial fills.

8
Execution report returns

Fill quantity, price, venue, time, liquidity flags, and trade identifiers flow back. Positions and buying power update, followed by a customer confirmation.

9
Trade is cleared and netted

Trade records are compared. NSCC generally becomes the central counterparty for eligible transactions and calculates each member’s net obligations.

10
Cash and securities settle

On settlement date, DTC book-entry movements and funds settlement complete delivery-versus-payment. Broker and custodian ledgers reconcile the result.

04 · State machine

An order is not simply “open”

Order state is event-driven. The customer app, broker OMS, router, clearing system, and venue may each maintain related but distinct state.

DRAFTlocal only
PENDINGvalidating
ACCEPTEDbroker-owned
PARTIALone or more fills
FILLEDexecution complete
CANCEL PENDINGnot yet canceled
CANCELEDterminal remainder
REJECTEDterminal
Select a state to see what it means.
The cancellation race: tapping Cancel sends another request. Until a confirmed canceled state returns, the original order may execute. Good interfaces say “cancel requested,” not “canceled,” during that uncertainty.

05 · Matching

Inside an order book

A continuous limit-order book commonly prioritizes better prices first and earlier orders at the same price next. Exact venue rules and specialized order types can be more complex.

Displayed XYZ book

SidePriceSharesDepth
Ask$100.08900
Ask$100.05500
Ask$100.02400
Spread: $0.04
Bid$99.98600
Bid$99.951,000
Bid$99.901,600

Send a buy order

This simulation walks the visible asks from lowest price upward. It ignores hidden liquidity, fees, price improvement, routing, and quote changes.

Simulated result
300 filled
Average: $100.02

The order can trade with the best displayed offer.

Marketable limit

A buy limit at or above the current ask can execute immediately, but never above its limit.

Resting limit

A buy below available offers can join a book and wait, expire, cancel, or execute if sellers reach it.

Price-time priority

Better price comes first; at one price, older displayed interest often has priority under venue rules.

06 · Components

The brokerage system map

Some brokers own this whole stack. Others are introducing brokers that use a carrying or clearing broker for custody, execution, books and records, or settlement.

Brokerage trading architecture with execution, post-trade, and market-data flows A customer order travels from app to API, OMS and risk, router, and execution venues. Execution reports update the ledger and clearing systems; market data feeds the app, OMS, and router; regulatory systems receive records. Web /mobileticket, quotes,portfolio API edgeauth, limits,idempotency OMS + riskstate, buyingpower, controls Router / EMSvenue selectionand execution Venuesexchange, ATS,market maker Market dataquotes, trades,reference data Ledgercash, lots,positions Clearing &custodysettle, reconcile Regulatorysystemsrecords, reports Solid green: order intent. Amber: execution/post-trade facts. Dashed blue: market data feeds decisions. Purple: regulatory records.
IAM

Identity & accounts

Onboarding, KYC/CIP, tax status, agreements, account type, permissions, authentication, and trusted devices.

PF

Portfolio service

Positions, cash, buying power, realized and unrealized P&L, tax lots, performance, and statements.

API

Order API gateway

Schema validation, authorization, rate limiting, idempotency, client order IDs, and stable external contracts.

OMS

Order management

Authoritative lifecycle, parent/child orders, amendments, cancels, execution allocation, event journal, and audit trail.

RISK

Pre-trade risk

Buying power, credit, fat-finger limits, position limits, margin, locates, restricted lists, and market status.

EMS

Execution management

Smart routing, venue adapters, FIX sessions, algorithmic schedules, execution reports, and transaction costs.

MD

Market data

Exchange and vendor feeds, normalization, symbol mapping, NBBO, candles, corporate actions, and entitlements.

REF

Reference data

Identifiers, listings, tick sizes, sessions, currencies, multipliers, options series, calendars, and security status.

LED

Double-entry ledger

Immutable postings for cash, securities, fees, accruals, holds, settlements, dividends, and corrections.

CLR

Clearing adapter

Trade capture, confirmations, allocations, NSCC/DTC or clearing-firm files, fails, breaks, and settlement status.

CA

Corporate actions

Dividends, splits, mergers, tenders, rights, voting, cost-basis adjustments, and due-bill processing.

REG

Compliance & surveillance

Books and records, communications, suitability/appropriateness, suspicious activity, best execution, and reporting.

REC

Reconciliation

Compare internal orders, fills, cash, positions, fees, and external statements; investigate every unexplained break.

OBS

Observability

Latency, rejects, stale data, route health, fill rates, queue lag, ledger imbalance, settlement fails, and incident tooling.

DOC

Documents & reporting

Trade confirmations, account statements, tax documents, disclosures, routing reports, and customer notifications.

External APIs commonly involved: exchange or vendor market data, bank rails, identity and sanctions screening, clearing broker interfaces, securities lending, options clearing, tax-lot and document vendors, communications, and regulatory reporting. Each needs timeouts, replay controls, versioning, reconciliation, and a failure policy.

07 · Execution

Where can the order go?

The customer’s broker chooses or follows instructions for an execution destination. The best displayed price matters, but so do size, speed, likelihood, price improvement, venue health, and total execution quality.

EX

Exchange

A registered venue with rules, a matching engine, displayed or non-displayed orders, market data, and participant connectivity.

MM

Wholesaler / market maker

A dealer may execute a retail order as principal, sometimes at a price better than the displayed national quote.

ATS

Alternative trading system

A non-exchange trading venue, often called a dark pool when interest is not broadly displayed before execution.

INT

Internalization

A broker-dealer fills customer flow internally or against affiliated interest rather than sending it to an exchange.

What a smart order router evaluates

Market state

Protected quotes, depth, recent fills, volatility, auction phase, halts, locked or crossed markets, and odd-lot information.

Execution quality

Price improvement, speed, fill probability, partial-fill behavior, adverse selection, and historical performance by symbol and size.

Economics & obligations

Access fees, rebates, payment for order flow, customer instructions, regulatory duties, venue rules, and broker conflict management.

Payment for order flow
A market center may compensate a broker for routing certain customer orders. It creates a conflict that must be disclosed and managed; it does not remove the broker’s execution obligations. U.S. broker-dealers publish routing disclosures under SEC Rule 606.
Why one order becomes many “child” orders
A parent order may be split across venues, prices, and times to seek liquidity and limit market impact. Institutional algorithms may schedule participation, follow volume, target an arrival price, or work passively. Every child event must roll back into one coherent parent state.

08 · Post-trade

From fill to settled ownership

Post-trade infrastructure turns millions of bilateral executions into manageable obligations. Netting greatly reduces the number and value of movements that members must settle.

T · Execution

Trade created

Buyer, seller, security, quantity, price, time, and venue are recorded. Execution reports update customer-facing state.

T · Clearance

Compare and net

Eligible trades flow to NSCC. Through novation and central-counterparty processes, member obligations are netted and risk-managed.

Overnight / T+1

Prepare delivery

Firms fund obligations, resolve breaks, manage securities availability, and receive settlement instructions and net positions.

T+1 · Settlement

Deliver and pay

DTC book-entry securities movements and funds settlement complete obligations. Ledgers, custody, and customer records reconcile.

NSCC

Clearing

NSCC compares and clears eligible trades, calculates net obligations, provides central-counterparty services, and manages member risk.

DTC

Depository & settlement

DTC holds securities in fungible book-entry form for participants and processes securities movements and settlement activity.

CUST

Broker / custodian books

The customer commonly holds a beneficial interest in “street name”; the broker’s records identify the customer’s position.

Netting example: if one clearing member buys 100,000 shares and sells 96,000 shares of the same eligible security across many trades, its eventual net receive obligation may be 4,000 shares, subject to the clearing system’s rules and adjustments.
What if settlement fails?
A fail means securities or funds did not settle as required. Firms investigate inventory, instructions, financing, corporate actions, or counterparty issues and follow applicable close-out and risk processes. Customer interfaces should distinguish an executed position from final settlement status without creating accounting ambiguity.

09 · Ecosystem

Everyone around the trade

The customer rarely interacts directly with most of these parties, but the system depends on their contracts, connectivity, rules, capital, and records.

Investor or trader

Supplies the economic intent and bears the account’s gains, losses, fees, taxes, and strategy risk.

Introducing broker

Owns the customer experience and relationship while possibly outsourcing custody and clearing.

Clearing / carrying broker

May custody assets, maintain books and records, execute, issue confirmations, clear, and settle.

Execution venue

Exchange or ATS where orders interact under venue rules and a matching process.

Market maker

Dealer standing ready to buy or sell, manage inventory, quote, and supply liquidity.

Clearing agency

NSCC, DTC, OCC, FICC, or other infrastructure depending on product and transaction.

Custodian & bank

Safeguards assets, moves money, provides settlement banking, and services institutional accounts.

Issuer & transfer agent

The company creates securities; transfer agents maintain issuer ownership records and process issuer actions.

Data providers

Exchanges, securities information processors, and vendors distribute quotes, trades, reference data, and analytics.

Regulators & SROs

SEC, FINRA, exchanges, state regulators, and others establish and enforce applicable requirements.

Securities lenders

Provide borrow inventory for short selling, market making, settlement, and financing.

Asset managers

Funds, pensions, advisers, and institutions place larger orders, often through institutional workflows and custodians.

10 · Instructions

Different ways to ask

An order type encodes a tradeoff among price protection, execution certainty, timing, visibility, and control. Support and exact behavior vary by broker and venue.

MKT

Market order

Prioritizes immediate execution, not a specific price. It can sweep multiple price levels and behave poorly in thin or fast markets.

LMT

Limit order

A buy cannot execute above its limit; a sell cannot execute below it. Price is controlled, but execution is not guaranteed.

STP

Stop order

Activates after a stop condition and commonly becomes a market order. The eventual execution can differ sharply from the stop price.

S-L

Stop-limit

Activates into a limit order. It controls the worst permitted price but may remain unfilled during a gap.

TR

Trailing stop

The stop follows favorable price movement by an amount or percentage, then stops moving when price reverses.

MOC

Auction orders

Market-on-close, limit-on-close, and opening instructions seek participation in a venue’s opening or closing auction.

Time in force and execution conditions

Day

Expires if not completed during the broker-defined trading day or session.

GTC

Good ’til canceled, subject to broker expiration policy and corporate-action handling.

IOC

Execute immediately to the extent possible; cancel the remainder.

FOK

Fill the entire quantity immediately or cancel it, when supported.

Post only

Do not remove displayed liquidity; reject or reprice if it would immediately execute, per rules.

All or none

Do not execute partially, though immediacy may not be required.

Extended hours

Eligible for premarket or after-hours sessions with typically different liquidity and risk.

Not held

Gives a broker discretion over time and price, typically in institutional workflows.

11 · Products

“Trading” is many markets

Different products have different units, venues, valuation, leverage, clearing, settlement, market hours, risks, and backend data models.

Stocks

Equity ownership in companies. Exchange-listed shares trade across fragmented venues; corporate actions and voting matter.

ETFs

Exchange-traded pooled portfolios. Authorized participants can create and redeem large blocks, helping connect price to underlying value.

Options

Contracts with strike, expiration, call/put, multiplier, exercise, assignment, complex margin, and OCC clearing.

Bonds

Debt instruments with coupons, maturity, yield, accrued interest, credit risk, and often dealer-based trading.

Mutual funds

Typically transact once daily at a calculated NAV rather than continuously in an exchange order book.

Futures

Standardized derivatives traded on futures exchanges, marked to market with margin and central clearing.

FX

Currency pairs trade in a global dealer and venue network with spot, forward, swap, and futures structures.

Cryptoassets

Venue, custody, regulation, settlement, market-data quality, and asset rights differ significantly from securities markets.

Commodities

Exposure often comes through futures, options, funds, or physical markets with delivery and storage considerations.

12 · Approaches

Types of trading and investing

These labels describe holding period, decision process, or execution method. They are not mutually exclusive and do not imply profitability.

Long-term investing

Own assets for years based on expected cash flows, diversification, goals, or broad-market exposure.

Position trading

Hold for weeks to months around fundamental, macro, thematic, or technical views.

Swing trading

Seek multi-day or multi-week price movements, commonly using technical and catalyst signals.

Day trading

Open and close positions within a day. Execution cost, leverage, speed, discipline, and loss control dominate.

Scalping

Many short-duration trades seeking small edges. Sensitive to spread, fees, queue position, and latency.

Market making

Quote both sides, earn spread or incentives, and manage inventory and adverse-selection risk.

Arbitrage

Trade related prices that appear inconsistent, while managing timing, funding, basis, model, and execution risk.

Systematic / quant

Rules or models generate signals, size positions, execute, and monitor portfolios with controlled automation.

Event-driven

Trade around earnings, mergers, restructurings, index changes, economic data, or other discrete events.

Pairs / relative value

Long one exposure and short another to express a relationship rather than an outright market direction.

Trend following

Seek persistence in price direction using systematic entry, sizing, and exit rules across assets or horizons.

Hedging

Use offsetting positions to reduce a specific risk; the goal may be protection rather than standalone profit.

Signal is not execution. A strategy may correctly predict direction and still lose after spread, slippage, fees, borrow cost, funding, taxes, market impact, latency, or poor risk sizing. Production systems model the full implementation path.

13 · Controls

Why an order may be restricted

The app cannot simply forward every request. Account agreements, product rules, broker policies, regulations, venue state, risk, and operational conditions shape what is accepted.

Cash availability

Purchases require sufficient cash or margin capacity. Cash accounts also have rules around paying for trades and use of sale proceeds.

Margin

Borrowed funds increase exposure. Initial and maintenance requirements can change; a broker may liquidate positions when equity is insufficient.

Short selling

The broker generally needs a reasonable basis to believe shares can be borrowed, marks the sale short, and manages borrow and close-out obligations.

Options permissions

Strategies can require approval tiers, disclosures, financial information, margin, and controls for exercise and assignment risk.

Concentration & volatility

Brokers can impose house margin, quantity, notional, price-band, or concentration limits beyond regulatory minimums.

Restricted securities

Halts, sanctions, corporate actions, low-priced securities, unsupported listings, insider controls, or broker policy can block trading.

Market access controls

Automated pre-trade checks prevent orders exceeding thresholds, duplicating unexpectedly, or entering erroneous prices and sizes.

Frequent intraday activity

Account type, margin status, broker policy, and evolving FINRA requirements can affect frequent same-day trading. Current broker disclosures matter.

AML and fraud

Account takeover, manipulation, suspicious funding, identity mismatch, and unusual transfer behavior can trigger reviews or holds.

Buying power is not one number
A system may calculate cash available to trade, settled cash, withdrawable cash, overnight margin buying power, intraday buying power, options buying power, and security-specific capacity. Open orders reserve resources, while fills, deposits, withdrawals, market movement, and margin requirements change them.
Risk checks must be fast and correct
Pre-trade risk sits on the latency-sensitive path but protects the firm and customer. Systems use cached account state, atomic reservations, conservative fallbacks, versioned limits, and post-trade recalculation. When state is uncertain, rejecting or reducing risk is usually safer than guessing.

14 · Market states

The market changes modes

Trading systems must understand sessions, auctions, halts, price bands, corporate actions, and exceptional conditions rather than assuming a single continuous market.

PRE

Premarket

Usually thinner liquidity, wider spreads, different venue participation, and broker-specific eligibility.

OPEN

Opening auction

Aggregates interest to establish an opening price, with imbalance messages and auction-specific instructions.

CORE

Continuous session

Orders interact continuously under venue matching rules during regular market hours.

LULD

Price bands & pauses

Limit Up-Limit Down mechanisms and other controls can prevent trades outside permitted bands or pause a symbol.

HALT

Trading halt

News, regulatory, operational, or volatility events can stop trading. Orders may be rejected, queued, or handled under specific rules.

CLOSE

Closing auction

Concentrates liquidity to determine an official close used by funds, indexes, benchmarks, and valuation processes.

Corporate actions can rewrite positions: splits change share quantity and price basis; dividends create receivables; mergers exchange or cash out securities; symbol and identifier changes require coordinated updates across orders, market data, custody, tax lots, statements, and charts.

15 · Data & operations

Correctness beats a pretty screen

Trading systems combine nanosecond market events with multi-day financial obligations. Durable event history, accounting discipline, clocks, and reconciliation are foundational.

Real-time streams

Quotes, trades, orders, executions, positions, risk, route health, and alerts move through low-latency event systems.

Immutable journal

Every state transition carries identity, sequence, time, source, and payload so history can be reconstructed.

Financial ledger

Balanced postings represent money and securities. Derived screens should never become the source of accounting truth.

Reconciliation

Internal records are compared with venues, clearing firms, banks, depositories, and custodians every day.

Surveillance

Detect manipulation patterns, suspicious trading, insider concerns, account abuse, and policy violations.

Best-execution review

Measure routes and outcomes using price, improvement, speed, likelihood, size, and comparable alternatives.

Business continuity

Backup sites, recovery objectives, kill switches, degraded modes, communication plans, and rehearsed incident playbooks.

Data governance

Entitlements, lineage, retention, privacy, clock synchronization, schema controls, and reproducible calculations.

Typical failures and responses

Stale quote feed

Mark data stale, switch source, restrict risky order types, and never present old prices as current without warning.

Unknown venue state

Stop new routing, reconcile sequence numbers, query status, and avoid replaying orders without deduplication.

Late execution report

Preserve uncertain state, handle cancel/fill races, request drop-copy truth, and reconcile customer and venue records.

Ledger mismatch

Block unsafe withdrawals or trading as needed, identify the break, post controlled corrections, and retain an audit trail.

Clearing file missing

Use operational alerts and expected-file controls, contact counterparties, reconstruct from trusted records, and manage deadlines.

Runaway algorithm

Enforce rate, notional, loss, and position limits; cancel open orders; trigger a kill switch; investigate before restart.

16 · Organization

Who builds the platform?

Team names vary, but ownership usually follows the customer lifecycle, trading path, financial records, and regulatory responsibilities.

Team
Owns
Works closely with
Brokerage product
Order ticket, portfolio experience, disclosures, education, notifications, and customer journeys.
Trading, compliance, design, support.
Accounts & identity
Onboarding, KYC, agreements, permissions, tax status, authentication, and account maintenance.
Compliance, fraud, customer ops.
Market data
Feed handlers, normalization, reference data, pricing, candles, entitlements, and data quality.
Trading, product, quant, vendors.
Order management
Order API, state machine, journal, cancel/replace, execution capture, and customer status.
Risk, routing, ledger, support.
Execution & routing
Venue connectivity, FIX, smart routing, algorithms, drop copy, and transaction-cost analysis.
OMS, market structure, compliance.
Risk & margin
Buying power, credit, margin, position limits, stress, locates, liquidations, and kill switches.
Trading, finance, compliance.
Clearing & custody
Trade capture, settlement, positions, stock record, corporate actions, transfers, and external clearing interfaces.
Ledger, operations, finance.
Money movement
ACH, wires, cards where applicable, bank links, holds, withdrawals, and cash reconciliation.
Fraud, ledger, treasury, support.
Ledger & accounting
Cash and securities books, fees, accruals, corrections, subledgers, and financial controls.
Every transaction domain.
Compliance engineering
Surveillance, reporting, retention, disclosures, restricted lists, case systems, and auditability.
Legal, operations, trading.
Fraud & security
Account takeover, identity abuse, suspicious transfers, secrets, access, detection, and incident response.
Identity, money movement, compliance.
Platform / SRE
Compute, messaging, databases, deployment, observability, resilience, capacity, and disaster recovery.
All engineering teams.
Brokerage operations
Trade breaks, settlements, corporate actions, transfers, reconciliations, exceptions, and customer escalations.
Clearing, support, engineering.
Quant / research
Execution analytics, forecasts, risk models, pricing, strategy research, and controlled model deployment.
Data, risk, trading, product.

17 · Vocabulary

The short dictionary

Core terms used throughout market structure and brokerage technology.

Ask / offer
Price at which a seller is willing to sell.
Bid
Price at which a buyer is willing to buy.
Clearing
Confirming, netting, risk-managing, and preparing trades for settlement.
Custody
Safekeeping and servicing financial assets and related records.
Depth
Displayed order quantity available at multiple price levels.
Execution
A completed match or dealer fill at a price and quantity.
FIX
Financial Information eXchange, a widely used electronic trading protocol.
Liquidity
Ability to trade with low delay, cost, and price impact.
Margin
Collateral and borrowing framework supporting leveraged positions.
Market impact
Price movement caused by executing or revealing an order.
NBBO
National Best Bid and Offer across protected displayed quotations.
Netting
Offsetting obligations to reduce required settlement movements.
OMS
Order management system: authoritative order lifecycle and records.
Settlement
Final transfer of securities and payment between obligated parties.
Slippage
Difference between expected or reference price and actual execution.
Spread
Difference between best bid and best ask.
T+1
Settlement on the next business day after trade date.
Volume
Quantity of shares or contracts executed during a period.

18 · Read next

Primary U.S. sources

Rules and market structure evolve. These regulator, SRO, infrastructure, and exchange sources support the factual portions of this guide and are the right place to verify current requirements.