innblockchain-exchange-matching-engine
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

InnblockchainExchangeMatchingEngine

A Light Weight Matching Engine for Crypto Exchange


Installation

$ npm i innblockchain-exchange-matching-engine --save 

Usage

import { MatchingEngine, OrderSide } from 'innblockchain-exchange-matching-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);

Package Sidebar

Install

npm i innblockchain-exchange-matching-engine

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

17.2 kB

Total Files

5

Last publish

Collaborators

  • vignesh-innblockchain