GithubHelp home page GithubHelp logo

jovinjijo / se Goto Github PK

View Code? Open in Web Editor NEW
18.0 3.0 3.0 2.84 MB

A very simplified implementation of a stock exchange.

TypeScript 98.65% HTML 1.05% CSS 0.30%
stockexchange stock stocks sharemarket shares equity stock-exchange trading trading-platform stock-market

se's Introduction

Gitpod ready-to-code

Stock Exchange

Demo

This is a very simplified implementation of how a stock exchange works. I have no financial background, so I'm open to suggestions on logic used, variable/class names. Feel free to point out any mistakes.

I started out just to try out a TypeScript project and implemented the core logic which is now contained in the @se/core package (yes, this is a monorepo).

@se/core

@se/core has the logic for order matching, placing orders, orders getting confirmed, keping track of orders of users, orderbook of a symbol and so on.

Check the tests folder for usage instructions.

@se/api

@se/api uses the core library and provides the API which is used by the @se/ui for fetching data. This is build on Express.js and Socket.io.

Check the docs folder for the postman collection.

@se/ui

This is created on React with Socket.io for sockets, Material-UI for UI components and Lightweight Charts by TradingView for charting.

Check the GitPod link for a working demo.

What's in Scope

  • Order matching
  • Order placing
  • Tracking users' orders, holdings and funds
  • Charting prices

What's not in Scope

  • Clearing house?

    This list is incomplete.

Repository highlights

  • Monorepo (using lerna with yarn; couldn't get it working with yarn workspaces because of a dependency issue; VS Code was not liking yarn2)
  • Precommit hooks (husky -> lint-staged, commitlint)
  • Conventional Commits
  • Extensive testing(unit tests, code coverage ^80%)

Get Started

yarn install
yarn run build-watch
yarn start

Open this in Postman for APIs

To-do

  • Persistence
  • Different types of orders (Limit and Market are supported as of now; support for Stop loss, Cover Orders, Bracket Orders)
  • Cancelling orders
  • Roles (Traders, Admins)
  • Leverage
  • Trading hours
  • Pre-market trading
  • Automatic square-off
  • Tick Size
  • Circuit Breakers

se's People

Contributors

jovinjijo avatar pauljoshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

se's Issues

Volume notified not accurate

//TODO : Issue -> For same LTP if multiple orders are settled, notifyLtpUpdate and addTick will be done only for the time when LTP changed.

Issue -> For same LTP if multiple orders are settled, notifyLtpUpdate and addTick will be done only for the time when LTP changed.
Problem with that is, quantity/volume which is notified in notifyLtpUpdate and addTick would be inaccurate and would be only for the order when LTP changed.
notifyLtpUpdate and addTick won't be called for subsequent orders, where LTP remains the same.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.