Git Product home page Git Product logo

limitorderbook's Introduction

LimitOrderBook

A crypto currency limit order book implementation done in Kotlin using Springboot with unit tests done with junit 5.

Requirements

Please install java jdk 17 or later

For Ubuntu/Debian-based distributions:

sudo apt update
sudo apt install default-jdk

Installation

Create security certs in used to create JWT tokens

  1. Create a direcory called certs inside your resources directory, and execute the following commands

  2. Generate private key with name keypair.pem

    openssl genrsa -out keypair.pem 2048
  3. Extract the public key from the RSA private key file keypair.pem

    openssl rsa -in keypair.pem -pubout -out public.pem
  4. Convert private key keypair.pem to PKCS8 format and save as private.pem

openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in keypair.pem -out private.pem

Usage

Postman documentation

Please use the following users for testing

username: Satoshi
password: password
username: Vitalik
password: password

Credits

Thanks to VALR for the challenge

limitorderbook's People

Contributors

hardu2203 avatar

Stargazers

 avatar

Watchers

 avatar

limitorderbook's Issues

Add authentication

Add JWT authorisation server to generate the JWT's

Also add security configuration to secure api endpoints

Add order tests

Create tests for all adding BUY and/or SELL orders

Bid/Buy

  • shouldAddOrderToBook
  • orderVolumesShouldMatchOrdersAtPrice

Ask/Sell

  • shouldAddOrderToBook
  • orderVolumesShouldMatchOrdersAtPrice

Add api endpoints

The API should have at-least the following endpoints:

  1. Get order book: Use this API as a reference for request and response payload https://api.valr.com/BTCZAR/orderbook
  2. Submit limit order: Use this API as a reference for request and response payload https://api.valr.com/v1/orders/limit. This can be a very simple data structure and does not need to cater for all the advanced usages. Feel free to ask if you have any questions here. (see https://docs.valr.com for the API reference if needed)
  3. Recent Trades : Similar to https://api.valr.com/BTCZAR/tradehistory

Create match order tests

Create tests to match existing orders with each other.

Bid/Buy

  • bidShouldMatchWithExistingAskOrder
  • bidShouldMatchWithExistingAskAndCreateBidForResidualVolume
  • bidShouldMatchMultipleAsks
  • shouldApplyFirstInFirstOutWhenMatching

Ask/Sell

  • askShouldMatchWithExistingBidOrder
  • askShouldMatchWithExistingBidAndCreateBidForResidualVolume
  • askShouldMatchMultipleBids
  • shouldApplyFirstInFirstOutWhenMatching

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.