Configurable Automated Limit Order Book
Small note: If editing the README, please conform to the standard-readme specification.
MIT © 2020 Jack McPherson
Configurable Automated Limit Order Book
Configurable Automated Limit Order Book
Small note: If editing the README, please conform to the standard-readme specification.
MIT © 2020 Jack McPherson
All types should have both serde
traits (i.e. Serialize
and Deserialize
) - as per C-SERDE.
Serialize
for Account
Deserialize
for Account
Serialize
for Order
Deserialize
for Order
Serialize
for Book
Deserialize
for Book
Currently, modifying account holdings are painful to interact with from a user's perspective.
add_balance
take_balance
add_holding
take_holding
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(()));
Assert fails, as Account::add_balance
returns AccountError::BalanceOutOfBounds
.
Assert succeeds, as Account::add_balance
returns Ok(())
.
add_balance
add_holding
Implement the actual order book data type. This will involve the actual matching engine implementation also.
book
moduleBook
typeBook
typeAccounts represent traders' balances and holdings.
account
moduleAccount
typeorders
moduleOrderType
typeOrder
typelet 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(()));
Assert fails, as Account::add_holding
returns AccountError::AssetNotFound
.
Assert succeeds, as Account::add_holding
returns Ok(())
.
Account::add_holding
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).
test_submit_equal_orders
test_submit_price_mismatch_nocross
test_submit_price_mismatch_cross
The getters in the account
module require consistent naming, compliant with C-GETTER.
Account
type to remove get_
prefixset_holdings
to set_holding
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.
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 |
Currently, master
is failing automated testing!
This is because cargo clippy
is upset with the current project state.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.