Skip to content

ThunderExchange is my open source stock exchange system featuring distributed gateway for order collection and ring buffer for high performance order matching. Beware this is my university project and is to be used at your own risk!

License

JanDoeTian/ThunderExchange

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning:boom:!

This is my university project and there is no guarantee to the quality of the system, please use for learning purpose only 🎓!

Introduction

ThunderExchange is an exchange system build with mainstream technologies such as Spring cloud, Vertx, Disruptor etc. It features a gateway module which serves as the HTTP server for the front-end, a order collector and maching core which sits in a centralized location such as a colocation centre.

The system consists of two parts, the regional part is spread across the globe and function as a regional gateway to accept orders that are nearest to client location, the colocation part is where the exchange sits.

This two part design guarantees scalability, reliability and high performance in the following way:

  • 👪 Scalability : To handle more client, just add more gateways and order collectors.
  • 🍼 Reliability: Traffic surge resistance and very little service down-time enabled by RAFT mechanism.
  • 🚀 High performance: Lockless multithreading with native thread-safe data structure provides blazing fast😻 order matching.

System Structure

Alt text

The System consists of 5 main parts, namely: App Service , Socket GateWay , Order Queue, Matching Engine and Publisher. Each of them serve a distinct function, with carefullly decoupled communications, they enable scability and high performance.

App Service:

Build with Spring framework, which is a popular Java application framework. It provides a comprehensive set of features for building applications, including a lightweight container, support for dependency injection, and tools for managing transactions and data access. Spring makes it easy to create complex, enterprise-grade applications that are modular, reusable, and easy to test.

The App Service module handles request from Frontend through REST protocol, this includes accounting functions such as query account balance, trading functions such as placing orders, view positions etc. More importantly, it serve as a consumer of MQTT for trades that have been published by the publisher module.

About

ThunderExchange is my open source stock exchange system featuring distributed gateway for order collection and ring buffer for high performance order matching. Beware this is my university project and is to be used at your own risk!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages