Verifiable data driven programatic orders using Brevis and Cow Protocol
μMoo harnesses the power of Brevis' ZK coprocessor to analyze historical trading data from the blockchain in a verifiable manner. By utilizing Brevis' capabilities, we fetch and process historical trade events to compute essential statistical metrics like mean prices and z-scores, all backed by zero-knowledge proofs that validate our calculations. These proven statistical insights are then used to create conditional orders through CoW Protocol's advanced order framework. When our smart contract receives the verified statistical data from Brevis, it automatically determines optimal trading conditions based on the z-score and price comparisons. Once these conditions are met, the contract creates and submits orders to CoW Protocol, which handles the actual trade execution using its sophisticated batch auction mechanism and solver network. This creates a seamless, automated trading system where every step - from historical data analysis to trade execution - is both transparent and mathematically verifiable. The integration of Brevis and CoW Protocol enables users to implement sophisticated trading strategies that are driven by provable on-chain data, eliminating the need for trusted oracles or centralized price feeds while maintaining complete transparency in the trading logic.
We implemented a custom circuit in Go using the Brevis SDK that:
The circuit processes token pair events from CoW Protocol's settlement contract, ensuring all statistical computations are verifiable and transparent.
Our system consists of two main contracts:
We leverage CoW Protocol's ComposableCow framework for conditional order creation and execution: