Git Product home page Git Product logo

calob's Introduction

calob's People

Contributors

jmcph4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

calob's Issues

Implement serde traits for all types

Description

All types should have both serde traits (i.e. Serialize and Deserialize) - as per C-SERDE.

Tasks

  • Implement Serialize for Account
  • Implement Deserialize for Account
  • Implement Serialize for Order
  • Implement Deserialize for Order
  • Implement Serialize for Book
  • Implement Deserialize for Book

Account convenience methods improperly check arithmetic

Reproduction

let acct: Account = Account::new(1, "John Doe".to_string(), 0, HashMap::new());
let res: Result<(), AccountError> = acct.add_balance(1);
assert_eq!(res, Ok(()));

Actual Behaviour

Assert fails, as Account::add_balance returns AccountError::BalanceOutOfBounds.

Expected Behaviour

Assert succeeds, as Account::add_balance returns Ok(()).

Tasks

  • Invert conditions in bounds checks for add_balance
  • Invert conditions in bounds checks for add_holding

Implement order book

Description

Implement the actual order book data type. This will involve the actual matching engine implementation also.

Tasks

  • Define book module
  • Define Book type
  • Define error types
  • Define constructor for Book type
  • Define getters/setters
  • Define operations
    • Submit
    • Cancel
  • Write tests

Implement accounts

Description

Accounts represent traders' balances and holdings.

Tasks

  • Define the account module
  • Define the Account type
  • Define constructor
  • Define getters and setters
  • Write tests

Implement orders

Description

Tasks

  • Define orders module
  • Define OrderType type
  • Define Order type
  • Define constructor
  • Define getters/setters
  • Write tests

Cannot add new asset to accounts

Reproduction

let acct: Account = Account::new(1, "John Doe".to_string(), 0, HashMap::new());
let res: Result<(), AccountError> = acct.add_holding("MSFT".to_string(), 1);
assert_eq!(res, Ok(()));

Actual Behaviour

Assert fails, as Account::add_holding returns AccountError::AssetNotFound.

Expected Behaviour

Assert succeeds, as Account::add_holding returns Ok(()).

Tasks

  • Handle case of new key submitted to Account::add_holding

Rename existing unit tests to comply with new testing scheme

Description

As described in #9, the new testing scheme is much more structured than the current ad-hoc names the unit tests are given.

The new naming scheme should be:

test_[function]_[test_case]

E.g.

test_submit_bid_lesser_lesser

Would target test case 1 (as defined in #9).

Tasks

  • Rename test_submit_equal_orders
  • Rename test_submit_price_mismatch_nocross
  • Rename test_submit_price_mismatch_cross

Combinatorial Testing of Order Book

Description

This is a tracking issue for unit testing of the limit order book implementation, i.e. the book::Book type.

Once this issue is completed, the matching engine should have basic combinatorial test coverage.

Tasks

Case Side Price Quantity
1 Bid Lesser Lesser
2 Bid Lesser Equal
3 Bid Lesser Greater
4 Bid Equal Lesser
5 Bid Equal Equal
6 Bid Equal Greater
7 Bid Greater Lesser
8 Bid Greater Equal
9 Bid Greater Greater
10 Ask Lesser Lesser
11 Ask Lesser Equal
12 Ask Lesser Greater
13 Ask Equal Lesser
14 Ask Equal Equal
15 Ask Equal Greater
16 Ask Greater Lesser
17 Ask Greater Equal
18 Ask Greater Greater
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

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.