Implementation of simple matching algorithm which can find match for encrypted orders. Algorithm proposed in this paper. This matching algorithms is implemented with bfv fully homomorphic encryption algorithm to facilitate order matching for encrypted orders. We used bfv and operator library by Janmajayamall
- Define
buy
andsell
orders here - Build project by running
cargo build
inbfv
,caird/operators
andprivate-clob
directories. As the algorithm usesbfv
andoperators
library and apis. - Run the matching algorithm using
cargo run
inprivate-clob
directory. For your convenience some sample orders has been already defined inorder.json
.
On successfull execution of the algorithm you'll see two arrays buy and sell array. In which non-zero element conveys order settlement and zero element indicates that the order can't be fullfilled.