Commit graph

57 commits

Author SHA1 Message Date
Bruno BELANYI 7c2a25a6b0 kraken: make multi-threaded
Some checks reported errors
continuous-integration/drone/push Build was killed
2022-03-24 17:54:37 +01:00
Bruno BELANYI a95df7a00f kraken: book: make 'Order' default constructible 2022-03-24 17:50:36 +01:00
Bruno BELANYI 654be9fc70 kraken: link with 'boost::thread' 2022-03-24 17:50:20 +01:00
Bruno BELANYI 22fe2ad421 nix: add 'boost' dependency 2022-03-24 17:50:01 +01:00
Bruno BELANYI 3998b9839f kraken: refactor to interleave input and output 2022-03-24 17:19:42 +01:00
Bruno BELANYI 8bba52d3b9 kraken: engine: expose 'process_single_order' 2022-03-24 17:19:02 +01:00
Bruno BELANYI e601250e7b kraken: parse: expose 'parse_single_order' 2022-03-24 17:18:23 +01:00
Bruno BELANYI d159cfb877 kraken: engine: non-const 'output' on listener 2022-03-24 17:17:44 +01:00
Bruno BELANYI 8474ed0c69 kraken: csv: expose 'read_csv_line' 2022-03-24 17:17:09 +01:00
Bruno BELANYI 6fc5502b99 doc: talk about improvements to matching
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-13 18:04:18 +01:00
Bruno BELANYI a681671efa data: add invalid scenarios
Those are not supported by my engine, as they have remaining quantities
on a trade match.
2022-03-13 18:04:18 +01:00
Bruno BELANYI ea8c880cca data: add simple tests for matching
Matching is done with asking price, when there is a difference.
2022-03-13 18:04:18 +01:00
Bruno BELANYI 14645524e2 doc: add warning about trade matching
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-12 14:24:33 +01:00
Bruno BELANYI afe78c4d8c doc: mention '--enable-trade'
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-12 14:03:52 +01:00
Bruno BELANYI 4b06f591c6 tests: integration: check when trade enabled 2022-03-12 14:03:06 +01:00
Bruno BELANYI 832abfb224 kraken: add '--enable-trade' 2022-03-12 13:59:44 +01:00
Bruno BELANYI ef027c77f6 doc: adjust README w/ trade matching 2022-03-12 13:57:21 +01:00
Bruno BELANYI 1cf45d9125 kraken: engine: DRY in trade matching 2022-03-12 13:56:08 +01:00
Bruno BELANYI bc20b1ee9a tests: unit: engine: add 'engine_trade' suite 2022-03-12 13:49:20 +01:00
Bruno BELANYI ce9457fabd kraken: engine: add trading on cross behaviour
It is limited, and mostly untested, I would need more explicit semantics
for the border cases to make it more robust.
2022-03-12 13:48:57 +01:00
Bruno BELANYI 68a7e55238 data: add trading data 2022-03-12 13:47:56 +01:00
Bruno BELANYI 803452bfa2 doc: add README 2022-03-12 13:19:15 +01:00
Bruno BELANYI 8534a74c87 kraken: engine: DRY in top-of-book handling 2022-03-12 12:40:23 +01:00
Bruno BELANYI fae4a9d5c7 kraken: engine: refactor 'cancel' ordering
Now that we have a way to reverse-lookup for cancel orders, we are not
linear in the number of active orders.
2022-03-12 12:40:23 +01:00
Bruno BELANYI acbae579b3 kraken: utils: make 'StrongType' copyable 2022-03-12 12:08:27 +01:00
Bruno BELANYI c62f79cbb2 tests: add integration tests
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-12 11:39:39 +01:00
Bruno BELANYI fa563f2f59 kraken: make functional binary 2022-03-12 11:39:39 +01:00
Bruno BELANYI e5ddd16da2 tests: unit: add 'engine' suite 2022-03-12 11:39:39 +01:00
Bruno BELANYI 37b04a678a kraken: engine: fix comparisons 2022-03-12 11:39:39 +01:00
Bruno BELANYI 5f1fbac76c data: add additional test cases
I was too tired last night (this morning...) I inverted a couple comparisons.

Those simple tests helped isolate the issue.
2022-03-12 11:39:39 +01:00
Bruno BELANYI 4515fc1c36 kraken: engine: add 'CsvEngineListern.output'
Otherwise it would be difficult to actually get access to the output...
2022-03-12 11:39:39 +01:00
Bruno BELANYI 0817e7ac7e kraken: engin: add 'Engine'
This is the brains of the operation, the matching engine.
2022-03-12 11:39:39 +01:00
Bruno BELANYI 346dfc4e17 kraken: engine: add 'CsvEngineListener'
This is the listener that implements the expected output.
2022-03-12 11:07:20 +01:00
Bruno BELANYI e3b2d29463 kraken: engine: add 'EngineListener'
The `Engine` will be in charge of updating the book, triggering the
listener on each event.
2022-03-12 11:07:20 +01:00
Bruno BELANYI 21ff896730 kraken: move 'Order' definition to 'book'
I think it makes more sense to centralise these important types in the
`book` library.
2022-03-12 11:07:20 +01:00
Bruno BELANYI 7c9b61b654 test: unit: add tests for input parsing 2022-03-12 11:07:20 +01:00
Bruno BELANYI d1f61e6e61 kraken: include 'src' in build directory
Needed for the `config.h` file to be included correctly.
2022-03-12 11:07:20 +01:00
Bruno BELANYI 8c33e298da data: add example CSV files 2022-03-12 11:07:20 +01:00
Bruno BELANYI 0157c7b193 kraken: parse: order: add ordering 2022-03-12 11:07:20 +01:00
Bruno BELANYI f0ffc652d5 kraken: utils: strong-type: derive order 2022-03-12 11:07:20 +01:00
Bruno BELANYI 7f5f1f9e04 kraken: add 'config.h' 2022-03-12 11:07:20 +01:00
Bruno BELANYI 12f458cf94 kraken: parse: add input file parser 2022-03-12 11:07:20 +01:00
Bruno BELANYI 9550598a87 kraken: parse: define 'Order' type
Use strong typing for the various components of the order.
2022-03-12 11:07:20 +01:00
Bruno BELANYI b7182826ab kraken: utils: add 'StrongType'
I foresee the need to disambiguate a lot of `int`s.
2022-03-12 11:07:20 +01:00
Bruno BELANYI 382f374031 clang-format: break after template declarations 2022-03-12 11:07:20 +01:00
Bruno BELANYI bd072e1025 kraken: csv: fix comma separation logic
Unfortunately, `std::ostream_iterator` puts its separator *after* every
element, not *in-between* each element.
2022-03-12 11:07:20 +01:00
Bruno BELANYI 6ee4e5b554 tests: unit: csv: add 'write_csv' suite
The disabled tests are expected failures (which GTest does not support),
once fixed they will be enabled.
2022-03-12 11:07:20 +01:00
Bruno BELANYI 3539cd4a34 tests: unit: csv: qualify 'read_csv' tests better 2022-03-12 11:07:20 +01:00
Bruno BELANYI 23b71018ac kraken: csv: add writing functionality
Once again, pretty naive, but it will do.
2022-03-12 11:07:20 +01:00
Bruno BELANYI 0dee0e12dc kraken: csv: move type aliases to 'csv.hh' header
As we need to share it with the CSV writing files.
2022-03-12 11:07:20 +01:00