Prayog functional overview

What a person can do on Prayog, what the exchange does on its own, and when each thing happens. The model is an NSE-style cash equity market, based on public information only. Prayog is a simulation and is not affiliated with any exchange.

How to read this

This page describes the target product: what a production exchange in this style offers. Each feature is tagged with when Prayog builds it:

Some things people think of as exchange features are really broker features: the broker's system holds the order and sends it to the exchange later (GTT, after-market orders, bracket orders). Those are marked as such. Prayog plays both roles, but the line matters for the design, because broker features live outside the matching engine.

The companion page, technical.html, explains how each feature is built and how data flows through the system.

1. The big picture: exchanges and trading firms

Videos about HFT describe the whole industry at once: exchanges, trading firms, feeds, FPGAs, monitoring, reporting. These belong to two different organisations on either side of a network cable:

Both sides have an "order book", which is a common source of confusion. The exchange's book is the real one. A trading firm rebuilds its own copy from the exchange's feed (a "book builder") so its strategy can read it without asking the exchange.

Trading firm (for example an HFT) Exchange Research & backtesting Tick data store Monitoring & alerting P&L, risk & reporting FPGAs, fast network cards Colocation, time sync Feed handlermarket data ingestion Book builderlocal copy of the book Strategy / signalsthe "alpha" Pre-trade risk checkslimits, fat-finger, kill Order managementOMS / EMS Order gatewayFIX / binary protocol Market data publisherbook + trades feed Matching enginethe official order book Sequencerone fair order of arrival Order gatewaychecks, rate limits Sessions & ops control Journal & replay Post-tradepositions, P&L, charges Monitoring, reports+ leaderboard (Prayog) Market surveillance Clearing & settlementclearing house, T+1 prices orders Prayog builds it Simplified, in the SDK, sample bot and agents (and your own bot) Not built (yet)

What each component does, and where Prayog stands

ComponentWhat it doesPrayog
Trading firm side
Colocation and networkServers rented inside the exchange's data centre, cables cut to equal length, microwave links between cities. Every metre is about 5 nsNot built. Everything runs on one machine
Time syncGPS and PTP clocks so every server agrees on time to within nanoseconds. Needed to measure latency and for regulators' timestampsNot built. Prayog uses a simulated clock
FPGAs and fast network cardsAn FPGA is a chip you program as a circuit rather than as software. HFT firms use them to decode the price feed and fire an order in well under a microsecond, faster than any CPU program. Fast network cards skip the operating system ("kernel bypass") to save microsecondsNot built. It's hardware. The software ideas behind it (no allocation, busy-spinning, one thread per core) show up in our engine
Feed handler (market data ingestion)Reads the exchange's raw feed, decodes it, spots missing messages by sequence number, and recovers themSimplified: the SDK's WebSocket client with gap detection (S12)
Book builderRebuilds each stock's order book from the feed so the strategy can read it locally in nanosecondsSimplified: the SDK keeps a local book from snapshot + updates (S12)
Strategy / signal engineDecides what to buy and sell: market making, arbitrage, momentum. This is the firm's secret ("alpha")Yours: your bot. Our agents (S13) are simple strategies that create the market
Pre-trade risk checksBlocks orders that break limits (position, order size, price far off the market, loss limit) before they leave the firm. Required by regulators after real disasters (Knight Capital lost $440m in 45 minutes in 2012)Exchange-side checks are built (max quantity, bands, rate limits, kill switch). Firm-side checks in the SDK could be a Phase 2 item
Order management (OMS / EMS)Tracks every order's state, handles partial fills and rejects, and decides which exchange to send to ("smart order routing")Simplified: the SDK tracks your orders. No routing, because there is only one exchange
Order gatewaySpeaks the exchange's order protocol (FIX or binary) and manages the sessionSimplified: REST and WebSocket JSON via the SDK
Tick data storeRecords every price update for research. Often terabytes a day, in specialised databasesNot built. Prayog's journal holds every event, so it could be exported later
Research and backtestingReplays history through a strategy to estimate how it would have performed, before risking moneyNot built. A natural Later item: replay a recorded Prayog day into your bot
Monitoring and alertingDashboards for latency, fills, errors and P&L; alerts when anything driftsBuilt for the exchange (S21). Your bot's own monitoring is up to you
P&L, risk and reportingReal-time P&L and exposure, end-of-day reconciliation with the broker, regulatory reportsBuilt on the broker side: positions, P&L, charges, blotter, leaderboard (S16–S19)
Exchange side
Order gatewayAccepts connections, authenticates, rate-limits, checks message shapeBuilt (S10)
SequencerPuts all orders from all members into one official arrival order, which is what makes "first come, first served" fairBuilt (S7)
Matching engineKeeps the official order books and applies the rules: priority, bands, sessions, self-trade preventionBuilt (S4–S6). S4 is done
Market data publisherSends book changes and trades to everyone at the same momentBuilt (S11)
Journal and replayRecords every input so the market can be rebuilt exactly after a crashBuilt (S8)
Sessions and ops controlOpens, halts and closes the market; kill switchesBuilt (S6, S19)
Post-trade, monitoring, reportsFor an exchange: trade reports and statistics. For a broker: positions, P&L, charges, contract notesBuilt (S15–S21), simplified
Market surveillanceLooks for manipulation: spoofing, wash trades, pump-and-dumpNot built (Later)
Clearing and settlementA clearing house guarantees every trade and moves cash and shares (T+1 in India)Not built (Later)
Prayog's focus in one line: build the exchange properly (the same architecture production exchanges use), add a thin broker layer for positions and P&L, and give trading firms (you, your bots, our agents) a starter kit. That kit is the SDK, which covers the trading-firm pipeline in simplified software form. The HFT-specific hardware (FPGAs, colocation, nanosecond clocks) is out of scope: it is a different, very expensive engineering field, and it doesn't change how the market itself works.

A possible later track: if you want to go deeper on the trading-firm side, the natural next steps are a backtester that replays a recorded Prayog day into a bot, firm-side risk checks in the SDK, and latency measurement from your bot to the exchange and back. It's listed in open decisions.

2. Prayog at a glance

The same picture at the level of what people do. Everything inside the exchange box happens in the moment an order arrives. The "after the trade" boxes update a moment later and can never slow down trading.

Traderweb terminal Bot developerPython SDK / API Simulated traderscreate the market Opsops page orders · modifies · cancels · ops commands prices · trades · your order updates Prayog exchange Order entrysign-in · rate limit · checks Matchingorder books · rules · sessions Market databook · trades · your orders Recordjournal · replay every event recorded trades After the trade (a moment later) Positions & P&L Charges Blotter & reports Leaderboard

The results of "after the trade" (P&L, blotter, leaderboard) show up in the trader's terminal and through the API, read from those services rather than from the exchange.

3. People and roles

RoleWhoHow they connectWhat they can do
Trader MVPA person trading by handWeb terminal at app.prayog.localhost, signed in through KeycloakPlace, modify and cancel orders; watch the book and charts; see positions, P&L and the leaderboard
Bot developer MVPA person running their own algorithmPython SDK or plain REST + WebSocket, with a client ID and secret as the API keyEverything a trader can do, but from code. Higher message rates, so rate limits matter
Simulated trader MVPPrayog's own agents that create the marketThe same public API as bots: no back doorQuote prices, trade on news-like shocks, add noise. They make the market feel alive
Ops MVPThe person running the exchangeOps page in the web app (role ops)Open, halt and close the market; kill switch per account; change the clock speed; watch health
Viewer PHASE 2Anyone not signed inPublic market data and leaderboardWatch only
Risk / compliance LATERSurveillance staffReports and alertsSpot wash trades, spoofing and unusual activity; review audit trails

4. Instruments

An instrument is something you can trade (here, a share of a made-up company). Every instrument has static settings that the exchange checks on every order.

SettingMeaningExampleStatus
SymbolShort name, upper caseABCMVP
Tick sizeSmallest price step. Every price must be a multiple5 paise: ₹100.05 is valid, ₹100.03 is rejectedMVP
Lot sizeSmallest quantity step. 1 for Indian cash equities1 shareMVP (fixed at 1)
Reference priceThe price bands are measured from (normally yesterday's close)₹100.00MVP (static)
Price bandHow far from the reference price an order may be priced today. NSE uses 2%, 5%, 10% or 20% bands depending on the stock10% band on ₹100 → valid ₹90.00 to ₹110.00MVP
Max order quantityLargest single order. Protects against "fat finger" mistakes100,000 sharesMVP
StatusActive, suspended, or delistedA suspended stock accepts no ordersPHASE 2
Daily reference rolloverNext day's reference = today's closing priceClose ₹104.20 → tomorrow's band ₹93.80–₹114.60LATER

5. The trading day

An exchange is not always open for continuous trading. The day has sessions, and each session allows different actions. NSE's cash market day, from public information (check current NSE circulars before relying on exact minutes):

Pre-open call auction Continuous trading (normal market) orders match the moment they cross Closing price set Post-close at close price 09:00 09:15 15:30 15:50 16:00 Phase 2 MVP Later MVP has three states: CLOSED, OPEN, HALTED. Open and close times are env vars (default 09:15–15:30).
SessionWhat happensOrders allowedStatus
ClosedNothing trades. Open orders from the day are gone (DAY validity)None. Broker-side "after-market orders" queue outside the exchangeMVP
Pre-open: order entry (NSE 09:00–09:08, ends at a random moment in the last minute)Orders are collected but nothing matches. The ending is random so nobody can game the last secondPlace, modify, cancel limit and market ordersPHASE 2
Pre-open: matching (≈09:08–09:12)A call auction picks one opening price, the one where the most shares can trade, and all crossing orders trade at itNonePHASE 2
Buffer (≈09:12–09:15)A quiet gap before continuous trading startsNonePHASE 2
Open / continuous (09:15–15:30)Every incoming order is matched immediately against the book by price-time priorityAll order types and actionsMVP
HaltedTrading paused by ops or by a circuit breaker. The book is keptCancels only (common policy). New orders and modifies are rejectedMVP (ops halt)
Closing priceNSE sets the official close from trades near the end of the day; in 2026 it began moving some stocks to a closing auctionDepends on methodLATER
Post-close (≈15:50–16:00)Trading only at the closing priceLimit orders at the close priceLATER
Simulated time. Prayog's clock is simulated. At 1× it follows real time; ops can speed it up (for example 10×, so a full day takes 37.5 minutes). Every session change is driven by that clock, so a replay of the day sees exactly the same session changes.

6. Order types and validity

An order has a type (how its price works) and a validity (how long it lives). Prices are always whole paise.

TypeHow it worksExampleWhere it livesStatus
LimitBuy at this price or lower / sell at this price or higher. Whatever does not fill immediately rests on the bookBUY 10 ABC @ ₹100.00ExchangeMVP
MarketTake whatever the book offers, best price first, until filled. Never rests. Prayog stops at the price band; any remainder is cancelledSELL 10 ABC at marketExchangeMVP
Stop-loss limit (SL)Sleeps until the last traded price touches the trigger, then becomes a limit orderSELL 10, trigger ₹95.00, limit ₹94.50Exchange (NSE holds stop orders)PHASE 2
Stop-loss market (SL-M)Like SL, but becomes a market order when triggeredSELL 10, trigger ₹95.00Exchange or brokerLATER
Disclosed quantity (iceberg)Only part of the order shows on the book; the rest refills as it trades. Lets large orders hide their sizeBUY 10,000, show 1,000ExchangeLATER
GTT / OCO, bracket and cover ordersConditional orders held by the broker, sent to the exchange when the condition is met"If ABC hits ₹120, sell 10"BrokerLATER
ValidityMeaningStatus
DAYLives until the market closes, then expires. The default on Indian exchangesMVP
IOC (immediate or cancel)Fill what you can right now; cancel the rest at once. Never rests. Bots use this a lotPHASE 2
FOK (fill or kill)All or nothing, right now. Not offered on NSE cash; common elsewhereLATER
GTC (good till cancelled)Survives across days. On Indian markets this is a broker feature (GTT), not an exchange oneLATER (broker)

7. Order lifecycle

Every order moves through a small set of states. Each arrow is an event the exchange publishes, so the order's state is always rebuildable from its events.

Submitted Rejected Open Partially filled Filled Cancelled Expired OrderRejected OrderAccepted Trade cancel last Trade day ends one Trade fills it all cancel or day ends (OrderCancelled) more Trades

Open and Partially filled are the live states: the order can still trade, be modified or be cancelled. The other four are final. "Expired" is published as OrderCancelled with a reason; we will add an EXPIRED reason when sessions arrive in S6.

The quantities always add up: ordered = filled + open + cancelled. Prayog's property tests check this for thousands of random order flows.

8. Actions

Every action is described the same way: who does it, when it is allowed, what happens step by step, and what comes out.

A. Access

Sign in MVP

Who
Trader, ops
When
Any time
What happens
  1. The web app sends you to Keycloak's login page.
  2. Keycloak checks your password and returns a signed access token (a JWT) naming your account and roles.
  3. The web app sends that token with every request. The gateway checks the signature; it never sees your password.
Edge cases
Tokens expire after minutes and are refreshed silently. A disabled account cannot get a new token.

Create bot credentials (API key) MVP

Who
Bot developer (ops issues them in the MVP)
What happens
A Keycloak client with a client ID and secret is created. The bot trades those for a token ("client credentials" flow) and then calls the same API as the web app.
Why it matters
Bots and humans use one API, so a bot can never do something a human cannot.

Rate limiting MVP

Who
Applied by the gateway to every account
What happens
Each account has a bucket of tokens that refills at a fixed rate (for example 50 per second). Each order, modify or cancel takes a token. An empty bucket means RATE_LIMITED, and the order never reaches the engine.
Why
One runaway bot must not slow the market for everyone. Real exchanges cap message rates and charge for excessive order-to-trade ratios.

B. Orders

Place a limit order MVP

Who
Trader, bot, simulated trader
When
Session OPEN (and pre-open in Phase 2)
What happens
  1. The gateway checks the token, the rate limit and the message shape.
  2. The engine validates it: known symbol, quantity 1 to max, price on tick, price inside the band, session open, account enabled. The first failure decides the reject reason.
  3. If valid it gets an order ID and an OrderAccepted event.
  4. It matches against the opposite side while prices cross: best price first, oldest first at a price. Each match is a Trade at the resting order's price.
  5. Whatever is left rests on the book at the back of the queue for its price.
Outcomes
OrderRejected, or OrderAccepted followed by zero or more Trades
Example
Asks: 5 @ ₹100.00, 5 @ ₹100.10. You BUY 8 @ ₹100.05 → trade 5 @ ₹100.00; 3 rest as the new best bid at ₹100.05.

Place a market order MVP (S5)

When
Session OPEN
What happens
Same as a limit order, but with no price of your own: it sweeps the opposite side best price first. It stops at the price band (this protects you from buying at absurd prices in a thin book), and any remainder is cancelled with reason NO_LIQUIDITY. It never rests.
Edge cases
Empty opposite side → accepted, then fully cancelled with NO_LIQUIDITY. Many brokers turn market orders into limit orders a few percent away ("market protection"); Prayog's band limit plays that role.

Place an IOC order PHASE 2

What happens
A limit order that never rests: it fills what it can at its limit or better, and the rest is cancelled at once.
Why bots like it
No forgotten orders left on the book if the bot crashes.

Place a stop-loss order PHASE 2

What happens
  1. Accepted but kept off the visible book, waiting.
  2. When a trade prints at or through the trigger price (≤ trigger for a sell, ≥ trigger for a buy), it becomes a normal limit order and joins the back of the queue.
  3. From there it behaves as a limit order.
Edge cases
One trade can trigger many stops, and their fills can trigger more ("stop cascade"). The engine must process triggered stops in a fixed, deterministic order (trigger price, then arrival).

Modify an order MVP (S5)

Who
The order's owner
When
Session OPEN; the order is still live
What happens
  • Reduce quantity: keeps its place in the queue. You are giving up size, which harms no one queued behind you.
  • Increase quantity or change price: goes to the back of the queue at the (new) price, as if new. Otherwise you could join a queue early with 1 share and later grow to 10,000, jumping everyone.
  • New price crosses the book: it trades immediately, like a new order.
  • Reduce to the filled amount or below: treated as a cancel of the open part.
Outcomes
OrderModified (with any Trades), OrderCancelled, or OrderRejected (UNKNOWN_ORDER if already filled)

Cancel an order MVP (S5)

When
OPEN or HALTED; the order is still live
What happens
The open part is removed from the book. Shares already filled stay filled.
Race
A cancel can arrive just after the order fully filled. That is normal and gets OrderRejected(UNKNOWN_ORDER). The client must handle "too late to cancel".

Cancel all (mass cancel) PHASE 2

What happens
Cancels all of an account's live orders, optionally for one symbol. Bots use it on startup and before shutting down.

C. Exchange rules (things the exchange does by itself)

Price-time priority matching MVP

Rule
Best price first; at the same price, the earliest order first. Trades happen at the resting order's price, so an aggressive order can get a better price than its limit ("price improvement").
Why
It rewards whoever offers the best price, and then whoever offered it first. That encourages people to show liquidity early.

Price band rejection MVP (S6)

Rule
A limit price outside today's band is rejected with PRICE_OUTSIDE_BAND. Market orders stop at the band edge.
Why
It limits damage from mistakes and panic: no single day can move a price more than the band.

Self-trade prevention MVP (S6)

Rule
If an incoming order would trade with a resting order from the same account, the incoming order's remainder is cancelled with SELF_TRADE_PREVENTION. Trades already made with other accounts stand.
Why
Trading with yourself creates fake volume (a "wash trade"), which regulators forbid. Other modes exist (cancel the resting order, or both); cancel incoming is simplest and the most common default.

Expiry at end of day MVP (S6)

When
When the session moves to CLOSED
What happens
Every live DAY order is cancelled, in a fixed order (by symbol, then order ID), so a replay produces the same events.

Opening call auction PHASE 2

What happens
  1. During order entry, orders collect without matching.
  2. At the end, the exchange tries every candidate price and picks the one where the most shares can trade. Ties go to the smallest leftover imbalance, then the price closest to the previous close.
  3. All crossing orders trade at that one price. The leftovers move into continuous trading.
Why
Overnight news piles up. One fair opening price is better than a chaotic first second of trading.

Circuit breakers LATER

What happens
Stock level: the price band already acts as a circuit filter. Market level: when the index falls 10%, 15% or 20% the whole market halts for a set time (SEBI's index circuit breakers). In Prayog this would be an automatic HALTED state.

D. Market data

Order book (depth) MVP (S11)

What you get
On subscribe, a snapshot of every price level (price, total shares, number of orders). After that, an update for each level that changes. Each message has a sequence number, so a gap tells you to ask for a fresh snapshot.
Levels
Aggregated by price ("level 2"). Individual orders are not shown, and neither are account IDs.

Trade prints and ticker MVP (S11)

What you get
Every trade, anonymous: price, quantity, time, and which side was the aggressor. The terminal builds the last price, day high/low, volume and candlestick charts from these.

Your own order updates MVP (S11)

What you get
A private stream of your own orders' events (accepted, filled, cancelled, rejected). Only you see it.

E. After the trade

Positions MVP (S16)

What
Shares held per account and symbol: buys add, sells subtract. A negative position is a short sale.
When
Updated from each trade event a moment after the trade (asynchronously, off the order path).

P&L MVP (S16)

Realised
Profit locked in by closing a position. Computed against your average buy price (or FIFO lots; see decisions).
Unrealised
Profit on paper for what you still hold, valued at the last traded price. It moves with every trade print.
Net
Realised + unrealised − charges

Charges MVP (simple) · LATER (Indian detail)

MVP
A flat brokerage per trade plus a percentage fee, set in config.
Later
The full Indian stack: brokerage, STT, exchange transaction charges, SEBI turnover fee, stamp duty (buy side) and GST on brokerage and fees. Each has its own base and rate, and rounding rules matter.

Trade blotter and reports MVP (S19)

What
A list of your orders and trades with times, prices and charges, plus a P&L summary. The production version adds a daily contract note (the legal trade confirmation) and CSV export.

Leaderboard MVP (S17)

What
Accounts ranked by net P&L, updated live. Shows totals only, never individual trades.

Settlement LATER

What
In India, shares and cash actually change hands one business day after the trade (T+1). Until then the shares are "unsettled". Prayog would simulate cash and holdings balances and a daily settlement run.

Buying power and margin checks PHASE 2

What
Before accepting an order, check that the account can pay for it (cash minus what open orders have already reserved) or has enough shares to sell. In the MVP, accounts have unlimited money: fine for a game, wrong for a realistic broker.
Design impact
This check must happen on the order path and be deterministic, so balances live inside the engine (or a risk stage before it), not in the database.

F. Operations

Open, halt, resume, close the market MVP

Who
Ops, or the sim clock at the configured times
What happens
A SessionStateChanged event. Halting keeps the book but stops matching; closing expires DAY orders.

Kill switch MVP

Global
Ops sets the market to HALTED. Everything stops at once.
Per account
Ops disables one account: all its live orders are cancelled (reason KILL_SWITCH) and new ones are rejected (ACCOUNT_DISABLED). This is the tool for a misbehaving bot.

Change clock speed MVP

What happens
Ops changes the multiplier (1×, 10×, 60×). Sim time runs faster; nothing else changes. Because ticks are recorded, a replay is still exact.

Replay a session MVP (S8)

What happens
Feed the recorded input journal back into a fresh engine. The output must be byte-for-byte identical (checked with a SHA-256 checksum). This is how bugs are reproduced and how the exchange recovers after a crash.

Add or suspend an instrument PHASE 2

What happens
In the MVP, instruments come from config at startup. Later they become commands that go through the journal, so they replay too.

G. Simulated market

Simulated traders MVP (S13)

Kinds
  • Market makers keep a buy and a sell order around a fair price and earn the spread. They are why the book is never empty.
  • Momentum traders buy after rises and sell after falls.
  • Mean-reversion traders do the opposite.
  • Noise traders trade randomly in small size and keep volume flowing.
  • News shocks move each stock's hidden "fair value" now and then, so prices trend.
Rule
They use the public API like any bot: no special access. Their random choices are seeded, but because orders travel over the network their arrival order varies, so a run is not exactly repeatable. The exchange's replay is.

9. Worked example: one trader's morning

Instrument ABC: tick 5 paise, reference ₹100.00, band 10% (₹90.00–₹110.00). Charges for the example: ₹10 per trade.

Sim timeActionBook before (best)ResultPosition · avg price
09:15:00Ops opens the marketemptySessionStateChanged(OPEN)—
09:15:02Market maker quotes 100 @ ₹99.95 / 100 @ ₹100.05—Two orders rest—
09:20:10You BUY 10 @ ₹100.10 (limit)ask ₹100.05Trade 10 @ ₹100.05 (resting price: 5 paise saved)+10 · ₹100.05
09:31:00You BUY 10 @ ₹101.95ask ₹102.05No cross; your bid rests and becomes the best bid+10
09:33:40Momentum bot SELLS 10 at marketbid ₹101.95 (yours)Trade 10 @ ₹101.95; you are filled+20 · ₹101.00
10:05:00You SELL 15 @ ₹103.00bid ₹103.10Trade 15 @ ₹103.10+5 · ₹101.00
10:30:00Last trade on ABC prints at ₹102.50—Unrealised P&L is revalued+5

Average price after both buys: (10 × 100.05 + 10 × 101.95) ÷ 20 = ₹101.00.
Realised on the sale: (103.10 − 101.00) × 15 = ₹31.50.
Unrealised on the 5 left: (102.50 − 101.00) × 5 = ₹7.50.
Charges: 3 trades × ₹10 = ₹30.00. Net P&L: 31.50 + 7.50 − 30.00 = ₹9.00.

Internally every one of those numbers is whole paise (₹101.00 = 10,100 paise). An average price that isn't a whole number of paise is kept as a total cost (paise × shares) instead, so no rounding happens until display.

10. Functional decisions still open

These change behaviour users can see. Each has a recommended default; we decide when the session that needs it starts.

DecisionOptionsRecommendedNeeded by
What can you do while HALTED?Nothing / cancels only / cancels and modifiesCancels only: people can reduce risk, but nothing new tradesS6
Realised P&L methodAverage cost / FIFO lotsAverage cost: simpler, and what most Indian broker P&L screens show for intradayS16
Short sellingAllowed freely / allowed intraday only (square off by close) / not allowedAllowed freely in the MVP; intraday-only with auto square-off in Phase 2 (that's how Indian cash shorts work)S16
Starting cashUnlimited / fixed (e.g. ₹10 lakh) with buying-power checksUnlimited for MVP; fixed in Phase 2. It makes the leaderboard fairerPhase 2
Leaderboard metricNet P&L / return % / risk-adjusted (Sharpe-like)Net P&L first; return % once cash is fixedS17
Trading-firm trackNone / backtester replaying a Prayog day / SDK-side risk checks / bot latency measurementDecide after the MVP; the backtester gives the most learning for algo workAfter MVP
Which Phase 2 features firstIOC, stop-loss, pre-open auction, buying power, mass cancelIOC and mass cancel (small, and bots need them), then buying power, then the auctionAfter MVP

11. Glossary

TermMeaning
Bid / askA buy order's price / a sell order's price. Best bid = highest bid; best ask = lowest ask
SpreadBest ask − best bid. Narrow spread = cheap to trade
Resting / passive / makerAn order waiting on the book; it "made" liquidity
Aggressive / incoming / takerAn order that trades on arrival; it "took" liquidity
Crossed bookBest bid ≥ best ask. Must never last in continuous trading: those orders should have traded
Depth / level 2Total quantity at each price, per side
Tick sizeSmallest allowed price step
Price band / circuit filterToday's allowed price range for a stock
Leaves quantityThe part of an order still open
Call auctionCollect orders, then trade everything at one price that maximises volume
Wash tradeTrading with yourself; blocked by self-trade prevention
Paise1/100 of a rupee. All Prayog prices are whole paise
T+1Settlement one business day after the trade