project screenshot 1
project screenshot 2
project screenshot 3

μMoo

Verifiable data driven programatic orders using Brevis and Cow Protocol

μMoo

Created At

ETHGlobal Bangkok

Winner of

Brevis - Build Data-driven dApps with Brevis ZK Coprocessor 1st place

CoW DAO - Programmatic Orders 1st place

Project Description

Problems in DeFi Trading

1. Lack of Data-Driven DeFi

  • Most DeFi trading decisions are based on sentiment or basic indicators
  • Complex statistical analysis is missing from on-chain trading
  • Historical data analysis isn't readily available for smart contracts
  • Traders can't leverage sophisticated metrics like z-scores or standard deviations on-chain
  • Limited ability to validate trading strategies using historical performance

2. Oracle can't be trusted

  • Traditional oracles rely on centralized data providers
  • No mathematical proof of data validity
  • Price manipulation risks through oracle attacks
  • Single point of failure in data sourcing
  • Limited transparency in price calculation methodologies

3. Manual Trading Limitations and Lack of Verifiable Automated Strategies

  • Delayed reactions to market movements
  • Inconsistent execution of trading strategies
  • No way to prove strategy performance on-chain
  • Limited transparency in automated trading systems
  • Difficulty in verifying historical performance

Introducing μMoo

μ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.

How it's Made

Core Components and Integration

1. Brevis Circuit for Statistical Analysis

We implemented a custom circuit in Go using the Brevis SDK that:

  • Fetches historical trade events from the blockchain
  • Computes critical statistical metrics:
    • Mean prices over a specified time window
    • Z-scores to measure price movement significance
    • Latest price comparisons for trade direction
  • Generates zero-knowledge proofs validating these calculations

The circuit processes token pair events from CoW Protocol's settlement contract, ensuring all statistical computations are verifiable and transparent.

2. Smart Contract Architecture

Our system consists of two main contracts:

  • PriceStatsHandler Contract: Handles the Brevis proof verification and stores statistical data
  • Conditional Order Contract: Integrates with CoW Protocol's ComposableCow framework

3. CoW Protocol Integration

We leverage CoW Protocol's ComposableCow framework for conditional order creation and execution:

  • Orders are created based on verified statistical data
  • Trade direction (buy/sell) is determined by price comparison
background image mobile

Join the mailing list

Get the latest news and updates