# Title Team Members TA Documents Sponsor
14 Hardware Accelerated High-Frequency trading system
Anthony Yu
Kevin Lim
Richard Deng
Mingjia Huo design_document2.pdf
# Hardware Accelerated High-Frequency trading system

Team Members:
- Richard Deng (ruichao4)
- Siyi Yu (siyiyu2)

# Problem

In the financial market today there is a lot of need to optimize the trading/execution latency to support automated quantitative trading systems. While most of the computer software run on generic operating systems and the CPU executing the logic has many parts of unnecessary instructions/procedures, the automated trading strategy can be highly optimized with hardware to achieve low latency and high frequency

# Solution

We plan to build a trading system that uses one PCB to connect to a fake exchange and get/send binary market data and use highly optimized FPGA to consume this market data and make decisions based on the data

# Solution Components

## Fake exchange
This will be a piece of software that simulates an exchange in real-time. This fake exchange will only have one security to trade and will be receiving three types of binary-encoded messages (add order, cancel order, update order) from the market participants using a certain protocol, building a full-depth limit orderbook based on the order received, automatically trade two orders when the bid side and ask side meet, and re-broadcasting the trade message with the other three client messages in binary encoded form following the same protocol. To test our strategy we will simulate the market data received from market participants, constantly adding limit ask/bid at the same price level in high frequency

## Networking Hardware
This will be a PCB with ESP8266 and other parts/ports to communicate with the fake exchange through the network. We plan to use UDP since it is what most exchanges will use. This part will be optimized to reduce the connectivity latency between the fake exchange and the trading system and feed the data to the FPGA.

## FPGA Trading Strategy
This will be an FPGA optimized for trading strategy, making decisions based on the binary data received from the Networking Hardware, sending the decision back to the networking PCB and which will send it back to the exchange. We plan to have two simple strategies:
1. High-frequency market-making: making a spread of $a ~ $b by sending limit bid at $a and limit ask at $b, adjust the spread based on Best Bid Offer (BBO) market data. This part is to test how fast our trading system can be adjusted based on real-time information changes.
2. High-filling rate limit order: send a limit bid order whenever there is a limit ask order at $a. This part is designed to test the latency of our trading system and is extremely useful in options trading where the bid-ask spread is very large and has a low order filling rate.

# Criterion For Success

We plan to test the latency and frequency after the project is finished. We will use another pure-software trading system running on a computer that has exactly the same strategy as the one using hardware, and we expect the highest possible frequency and the average latency of our hardware trading system when connecting and trading on our fake exchange to be significantly faster than purely software trading strategies.

Electronic Mouse (Cat Toy)

Jack Casey, Chuangy Zhang, Yingyu Zhang

Electronic Mouse (Cat Toy)

Featured Project

# Electronic Mouse (Cat Toy)

# Team Members:

- Yingyu Zhang (yzhan290)

- Chuangy Zhang (czhan30)

- Jack (John) Casey (jpcasey2)

# Problem Components:

Keeping up with the high energy drive of some cats can often be overwhelming for owners who often choose these pets because of their low maintenance compared to other animals. There is an increasing number of cats being used for service and emotional support animals, and with this, there is a need for an interactive cat toy with greater accessibility.

1. Get cats the enrichment they need

1. Get cats to chase the “mouse” around

1. Get cats fascinated by the “mouse”

1. Keep cats busy

1. Fulfill the need for cats’ hunting behaviors

1. Interactive fun between the cat and cat owner

1. Solve the shortcomings of electronic-remote-control-mouses that are out in the market

## Comparison with existing products

- Hexbug Mouse Robotic Cat Toy: Battery endurance is very low; For hard floors only

- GiGwi Interactive Cat Toy Mouse: Does not work on the carpet; Not sensitive to cat touch; Battery endurance is very low; Can't control remotely

# Solution

A remote-controlled cat toy is a solution that allows more cat owners to get interactive playtime with their pets. With our design, there will be no need to get low to the ground to adjust it often as it will go over most floor surfaces and in any direction with help from a strong motor and servos that won’t break from wall or cat impact. To prevent damage to household objects it will have IR sensors and accelerometers for use in self-driving modes. The toy will be run and powered by a Bluetooth microcontroller and a strong rechargeable battery to ensure playtime for hours.

## Subsystem 1 - Infrared(IR) Sensors & Accelerometer sensor

- IR sensors work with radar technology and they both emit and receive Infrared radiation. This kind of sensor has been used widely to detect nearby objects. We will use the IR sensors to detect if the mouse is surrounded by any obstacles.

- An accelerometer sensor measures the acceleration of any object in its rest frame. This kind of sensor has been used widely to capture the intensity of physical activities. We will use this sensor to detect if cats are playing with the mouse.

## Subsystem 2 - Microcontroller(ESP32)

- ESP32 is a dual-core microcontroller with integrated Wi-Fi and Bluetooth. This MCU has 520 KB of SRAM, 34 programmable GPIOs, 802.11 Wi-Fi, Bluetooth v4.2, and much more. This powerful microcontroller enables us to develop more powerful software and hardware and provides a lot of flexibility compared to ATMegaxxx.


- Product: [](url)

- Datasheet: [](url)

## Subsystem 3 - App

- We will develop an App that can remotely control the mouse.

1. Control the mouse to either move forward, backward, left, or right.

1. Turn on / off / flashing the LED eyes of the mouse

1. keep the cat owner informed about the battery level of the mouse

1. Change “modes”: (a). keep running randomly without stopping; (b). the cat activates the mouse; (c). runs in cycles(runs, stops, runs, stops…) intermittently (mouse hesitates to get cat’s curiosity up); (d). Turn OFF (completely)

## Subsystem 4 - Motors and Servo

- To enable maneuverability in all directions, we are planning to use 1 servo and 2 motors to drive the robotic mouse. The servo is used to control the direction of the mouse. Wheels will be directly mounted onto motors via hubs.


- Metal Gear Motors: [](url)

- L9110H H-Bridge Motor Driver: [](url)

## Subsystem 5 - Power Management

- We are planning to use a high capacity (5 Ah - 10 Ah), 3.7 volts lithium polymer battery to enable the long-last usage of the robotic mouse. Also, we are using the USB lithium polymer ion charging circuit to charge the battery.


- Lithium Polymer Ion Battery: [](url)

- USB Lithium Polymer Ion Charger: [](url)

# Criterion for Success

1. Can go on tile, wood, AND carpet and alternate

1. Has a charge that lasts more than 10 min

1. Is maneuverable in all directions(not just forward and backward)

1. Can be controlled via remote (App)

1. Has a “cat-attractor”(feathers, string, ribbon, inner catnip, etc.) either attached to it or drags it behind (attractive appearance for cats)

1. Retains signal for at least 15 ft away

1. Eyes flash

1. Goes dormant when caught/touched by the cats (or when it bumps into something), reactivates (and changes direction) after a certain amount of time

1. all the “modes” worked as intended

Project Videos