CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/Fintech & Capital Markets

💹 Fintech & Capital Markets · State Machine

Stock Order Lifecycle

The states of a stock market order in a broking app, from placement through exchange matching to partial and full fills.

More Fintech & Capital Markets templates

Drawing diagram…

What this diagram shows

  • Risk checks run before the order reaches the exchange
  • An order can fill in several parts
  • Unfilled day orders expire at market close

Prompt used

State machine for a broker order: Created, RiskChecked (margin and limits), Rejected if checks fail, SentToExchange, Open on the order book, PartiallyFilled, Filled, Cancelled by the user, Expired at the end of the day for day orders.

Mermaid code
stateDiagram-v2
  [*] --> Created
  Created --> RiskChecked: Margin and limits OK
  Created --> Rejected: Insufficient margin
  RiskChecked --> SentToExchange
  SentToExchange --> Open: Accepted by exchange
  SentToExchange --> Rejected: Exchange rejects
  Open --> PartiallyFilled: Some quantity traded
  Open --> Filled: Full quantity traded
  PartiallyFilled --> Filled: Rest traded
  Open --> Cancelled: User cancels
  PartiallyFilled --> Cancelled: User cancels rest
  Open --> Expired: Market close
  PartiallyFilled --> Expired: Market close
  Filled --> [*]
  Cancelled --> [*]
  Expired --> [*]
  Rejected --> [*]

Related templates

C4 ArchitectureProFintech & Capital Markets

Digital Lending Platform

A digital lending app that takes a loan application from KYC to disbursal in minutes, using credit bureau data, bank statement analysis and e-mandates for repayment.

SequenceFintech & Capital Markets

Account Aggregator Consent Flow

How a lender gets a customer's bank statements through India's Account Aggregator network: consent request, approval in the AA app, and encrypted data sharing.

FlowchartFintech & Capital Markets

Buy Now Pay Later Checkout

How a Buy Now Pay Later option decides at checkout whether to approve a shopper and splits the purchase into instalments.

DeploymentProFintech & Capital Markets

Stock Broking Platform

Where a stock broking platform runs: low-latency order systems co-located near the exchange, and customer apps and back office in the cloud.

Database ERDFintech & Capital Markets

Loan Management Database Schema

Tables for a loan book: borrowers, loan products, loans, repayment schedules, payments and collection actions.

SequenceFintech & Capital Markets

Mutual Fund SIP Purchase Sequence

How a monthly SIP in a mutual fund works behind an investment app: mandate debit, order to the exchange platform, NAV allotment and units credited.