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
buyandsellorders here - Build project by running
cargo buildinbfv,caird/operatorsandprivate-clobdirectories. As the algorithm usesbfvandoperatorslibrary and apis. - Run the matching algorithm using
cargo runinprivate-clobdirectory. 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.