Giter Site home page Giter Site logo

stock-exchange'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

stock-exchange's People

Contributors

rexcare avatar

Watchers

 avatar

Forkers

ziba1988

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.