Categories
IT Books

๐–๐ก๐š๐ญ ๐ก๐š๐ฉ๐ฉ๐ž๐ง๐ฌ ๐ฐ๐ก๐ž๐ง ๐ฐ๐ž ๐›๐ฎ๐ฒ ๐จ๐ซ ๐ฌ๐ž๐ฅ๐ฅ ๐ฌ๐ญ๐จ๐œ๐ค๐ฌ?

๐“๐ซ๐š๐๐ข๐ง๐  ๐…๐ฅ๐จ๐ฐ
๐Ÿ”น Steps 1-4: Bob wants to buy 100 shares of Microsoft at a price of $247. The order is small, so it can go through DMA (Direct Market Access) to the exchange. The exchange gateway is responsible to normalize the order based on the exchangeโ€™s requirements and route to the exchange that provides the best price.

๐Ÿ”น Steps 5-6: The buy order is sent to the exchangeโ€™s trading engine, which validates the order and maintains the order state. The order goes to the ๐ฆ๐š๐ญ๐œ๐ก๐ข๐ง๐  ๐ž๐ง๐ ๐ข๐ง๐ž to find a match (same price, different buy/sell direction). The matching engine maintains an order book. Letโ€™s assume Bobโ€™s order cannot find a match at a price of $247, and stays in the order book, waiting to be taken.

๐Ÿ”น Steps 7-10: Alice wants to sell 10000 Microsoft shares at a price of $247. The sell order goes through the ๐š๐ฅ๐ ๐จ๐ซ๐ข๐ญ๐ก๐ฆ ๐ญ๐ซ๐š๐๐ข๐ง๐  ๐ž๐ง๐ ๐ข๐ง๐ž because it is relatively large, and Alice wants to minimize the market impact. The order is split into smaller orders and sent to the exchange.

๐Ÿ”น Steps 11-12: One of Aliceโ€™s split orders matches Bobโ€™s buy order in the matching engine: Bob gets a โ€œfully filledโ€ message, and Alice gets a โ€œpartially filledโ€ message. This trade is done.

๐Œ๐š๐ซ๐ค๐ž๐ญ ๐ƒ๐š๐ญ๐š ๐…๐ฅ๐จ๐ฐ
๐Ÿ”น Steps D1-D4:ย  Stock trading relies heavily on market data. The order book data and the candlestick chart are published via the market data publisher and exposed to various parties via the data service. The broker then listens to the data service and provides the data to the trading engines.

๐‘๐ž๐ฉ๐จ๐ซ๐ญ๐ข๐ง๐  ๐…๐ฅ๐จ๐ฐ
๐Ÿ”น Steps R1-R3: The reporter receives trading messages from the trading engines and persists them into the databases. These are the ๐›๐จ๐จ๐ค๐ฌ ๐š๐ง๐ ๐ซ๐ž๐œ๐จ๐ซ๐๐ฌ for the broker and the exchange

Leave a Reply Cancel reply