项目作者: Laffini

项目描述 :
A matching engine written in Java.
高级语言: Java
项目地址: git://github.com/Laffini/Java-Matching-Engine.git
创建时间: 2020-12-15T17:35:03Z
项目社区:https://github.com/Laffini/Java-Matching-Engine

开源协议:Apache License 2.0

下载


Java-Matching-Engine-Core

Java CI with Maven

A matching engine written in Java.

What is a matching engine?

A matching engine matches buy and sell orders in a market.

Matching Algorithm

The matching engine uses a price-time-priority algorithm.
The matching priority is firstly price, then time.
Market participants are rewarded for offering the best price and coming early.

Usage

The Java-Matching-Engine is broken up into multiple projects.
This is the ‘core’ project.
This project only contains the engine (no REST API, persistence, etc).

To use this project, you will need to include the ‘core’ package as part of your Spring configuration scanning (as seen below).

  1. @SpringBootApplication(scanBasePackages = "net.laffyco.javamatchingengine.core")
  2. public class ExampleApp {
  3. @Autowired
  4. private IOrderInterface orderInterface
  5. public static void main(final String[] args) {
  6. SpringApplication.run(ExampleApp.class, args);
  7. System.out.println(this.orderInterface.getOrders());
  8. }
  9. }

In the example above, we are interacting with the order book through the OrderInterface.
The example starts and prints the orders to the console (it will be empty as no orders have been added).
In most cases you will want to use some of the other Java-Matching-Engine projects as these add additional functionality (such as a REST API) that may suit your needs.

It is recommended that every user of this service audits and verifies all underlying code for its validity and suitability. Mistakes and bugs happen.