COBE
Links
Languages, Libraries & Stacks
Share project
About COBE
COBE - Cartesi Order Book Exchange App Rollup is a verifiable off-chain CLOB exchange built with Cartesi Rollups. COBE's core processing and matching engine is built with Python but it works on Ethereum 🤯 Thanks to the unique architecture of Cartesi, our exchange can get actions of users from the underlying layer, however can process them off-chain with 100% verifiability. COBE reads inputs from the L1 smart contract, processes transactions, and reports the execution traces. These execution proofs can be verified by anyone.
Why Cartesi? COBE is just a demonstration to show what can be done with Cartesi’s Linux runtime. By using Cartesi, we managed to write a complex, but MVP level, matching engine in Python. In current VMs like EVM, it is not easy and not feasible to build a perfect matching engine. Cartesi offers the flexibility of RISC architecture and Linux Runtime which means we can write even more complex processes. We can even write it with Javascript, Rust or C++.
How it's Made
COBE has 4 main components.
- Cartesi Rollup - this is the part where transactions are processed, which means the order book and the engine lives inside this rollup. This rollup is coded with Python and uses two main classes to manage the Order Book and Portfolio.
- Indexer API - this indexer API continuously polls the Rollup GraphQL to get the reports (events). By using events, it creates an SQL database in order to serve the UI faster and better. Also, the indexer has a built-in Rest API inside of it which serves the orderbook and balances the UI.
- UI - UI shows the ask and bid book and user balances. UI allows people to deposit ERC20s into their portfolio, and add ask or bid orders.
- L1 - L1 uses generic Cartesi Rollup contracts, like InputFacet, portal, and DApp etc.