Dark pool using hybrid execution model for private order matching with delayed execution
This project makes use of Protokit to create a custom sequencer, which enables private order matching.
My implementation is based off of a constant product liquidity pool (see acknowledgements), where users can provide liquidity in any LP. For each LP, I have also added a whitelist mechanism, which is in line with what a dark pool is.
In this project, here are the features of the Dark Pool I have implemented
Based off of the Protokit starter template, I have created a DarkPool and TokenRegistry runtime module for pool and token management.
Additionally, I created a DarkPoolMempool sequencer module to match orders whenever an incoming order is submitted. This checks against incoming method IDs and also stores a simple set in memory to avoid matching orders multiple time in a block. This will eventually be done in a cronjob.
The frontend is built using shadcn and Next.js. I have detailed my other approaches in the README.md, for your perusal.