Skip to main contentThe Kuru Router Contract governs all the markets- it is the default owner of all markets and can be used to upgrade markets to a new implementation. The Router is also used to deploy all markets. It stores market params for every market and hence can be easily used to route through markets. The Kuru Margin Account takes care of all accounting related to limit orders and backstop liquidity AMMs.
Each market on Kuru comprises of an OrderBook and discretised AMM liquidity. Simply said, you can discretise a CPAMM and transform it into an OrderBook if you calculate the amount of tokens which have to flow in or out between two price points. The OrderBook contract treats the AMM liquidity as a first-class citizen, so it can aggregate between limit orders on the book and the AMM liquidity while maintaining price priority.
Markets on Kuru need to be initialised with a given set of parameters which suit the base/quote pair. You will find recommendations on how to set these in the same repo. If you are going YOLO, please note that a low sizePrecision will wreck the backstop liquidity and wrong pricePrecision might make it impossible to place limit orders on certain pairs.
Since matching is done fully onchain, taker orders essentially ‘crank’ maker orders and credit the outputs to the makers. Hence, to avoid potential DOS, we use the margin account for all debits and credits related to limit orders. However, taker orders can choose which path they want to take.
The complete ABI for all Kuru smart contracts is available in the Kuru-SDK.