---
# System prepended metadata

title: 'CS1680 Final Project:'
tags: [networks]

---

---
tags: networks
---


# CS1680 Final Project:

## Mini-Exchange 

Examples: NYSE, Chicago Options Exchange, Nasdaq

### The role of an exchange:

- A "broker" between buyers and sellers of financial instruments
- Dissemination of price information for securities trading on this exchange


### Our ideas:

Two main parts:
- Market data feed
- Matching engine/order book


### How it'll work:

Our exchange advertises a singular financial instrument.

Clients can connect to the exchange through a TCP connection. Once connected they have access to:
- Live market data feed advertising a makeshift price fluctuation using a generalized Wiener process, Ito process, etc. 
    - (uses UDP multicast, clients must specify a UDP port to listen to live market data)
- Access to an order book where they can place/cancel orders, and be notified when a trade has been executed
    - our exchange functions as a dark pool, which means clients cannot see the exchange's order book, so they do not know about what trades other clients are making
    - can place orders at arbitrary prices

The exchange must maintain: 
- the order book
    - essentially a state machine of all current orders
- a very simple matching engine 
    - will match buy orders with sell orders given that the prices of both orders match


### Types of orders

**Sell**: sell at a given price `s` or above

**Buy**: buy at a given price `b` or below



