Skip to content

devashishpuri/ExchangeMatchingEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExchangeMatchingEngine

Lightweight Exchnage Matching Engine for nodejs


Installation

$ npm i exchange-macthing-engine --save 

Usage

import { MatchingEngine, OrderSide } from 'exchange-macthing-engine';

const matchingEngine = new MatchingEngine();

/**
 * Place New Order (Instrument, Price, Quantity, Side)
 */
matchingEngine.newOrder('Instrument', 12.5, 5, OrderSide.buy);

/**
 * Trade Order
 */
matchingEngine.newOrder('Instrument', 12.5, 5, OrderSide.sell);

/**
 * Cancel Order (Order Id, Instrument)
 */
const orderResponse = matchingEngine.newOrder('Instrument', 12.5, 5, OrderSide.sell);
const order = orderResponse.data.order;

matchingEngine.cancelOrder(order.orderId, order.instrument);

About

Lightweight matching Engine for Exchange Simulation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published