All projects

Souzu

Souzu is a programmable rolling VWAP settlement protocol for DeFi powered by Chainlink CRE.

DeFi & Tokenization Tenderly

What it is

Product Link: https://souzu.netlify.app/
What is Souzu
Souzu is a programmable VWAP settlement protocol designed to bring institutional-grade trade execution to DeFi. In traditional financial markets, large trades are commonly executed using Volume Weighted Average Price (VWAP) to reduce market impact and execution risk. However, this execution standard has largely been absent in DeFi due to technical limitations.

Souzu leverages Chainlink CRE (Conditional Runtime Execution) to enable VWAP-based settlement for on-chain trading. By combining off-chain computation with trustless on-chain settlement, Souzu allows large trades to settle at a volume-weighted market price instead of a single-point execution price.
What problem it solves
In DeFi today, large trades often suffer from significant slippage and execution risk because most trades are executed at a single block price. Without VWAP-style execution, large orders can move markets and create unfavorable pricing.

This limitation has prevented institutional-scale trading strategies from operating effectively on-chain.

Souzu solves this by introducing programmable VWAP settlement to DeFi, allowing trades to settle based on the volume-weighted average price over a defined observation window rather than a single transaction price.

This reduces slippage, smooths volatility, and enables more sophisticated trading strategies.
How it works
Souzu uses Chainlink CRE to coordinate a multi-step execution workflow:

  1. Trade Matching
    Two counterparties match through an RFQ-style order and lock their assets into the protocol.

  2. Market Observation Window
    A VWAP observation window begins (e.g. 12 hours), during which trading data is collected.

  3. Data Aggregation & Computation
    Souzu aggregates tick-level trading data from multiple major centralized exchanges.
    Chainlink CRE processes this data off-chain and computes the rolling VWAP while filtering outliers.

  4. Trustless Settlement
    Once the observation window ends, the final VWAP price is submitted on-chain and the trade is automatically settled.

This workflow integrates external market data with off-chain computation and on-chain execution through Chainlink CRE.
Chainlink CRE Integration
Souzu uses Chainlink CRE to orchestrate the full execution pipeline:

• Fetching external trading data from multiple exchanges
• Performing VWAP computation off-chain
• Triggering automated on-chain settlement

This demonstrates how CRE can coordinate external data ingestion, complex computation, and deterministic blockchain execution within a single workflow.

Tenderly Integration
Souzu also leverages Tenderly’s VTN environment to simulate the full protocol lifecycle.

By fast-forwarding blockchain time, we can execute fill → oracle price → settlement / refund flows within a single test run, validating the entire smart contract pipeline end-to-end.

This environment also provides realistic on-chain states for frontend testing and allows backend indexers to reconstruct protocol state from historical blocks, improving system resilience and recovery after downtime.
Conclusion
Souzu demonstrates how Chainlink CRE can unlock institutional-grade trading infrastructure in DeFi.
By enabling programmable VWAP settlement on-chain, Souzu reduces execution risk and slippage for large trades.

We believe that with Chainlink CRE, DeFi can move closer to the scale and execution standards of traditional financial markets.

How it Works

Souzu is built as a hybrid RFQ + VWAP settlement system with three main components: an off-chain orderbook with backend triggers, on-chain smart contracts for custody and settlement, and a Chainlink CRE workflow for decentralized VWAP computation.

  1. Off-chain Orderbook (RFQ)
  • The maker signs an EIP-712 order off-chain (specifying amount, minimum output, delta bps, and deadline) and submits it to the backend orderbook.
  • A taker discovers and accepts the quote, executing it directly on-chain via a single fill.
  1. On-chain Smart Contracts (Custody & Settlement)
  • Initiation: The taker calls the fill() function on the VWAPRFQSpot.sol contract. The contract verifies the maker's EIP-712 signature, locks both the maker's and taker's funds, and records the settlement window (e.g., a 12-hour startTime to endTime window).
  • Settlement: After the 12-hour window expires, anyone can call settle(). The VWAPRFQSpot contract reads the finalized VWAP price from the oracle (ChainlinkVWAPAdapter), applies the agreed-upon deltaBps, and distributes the funds to the maker and taker deterministically.
  • Fallback: If settlement cannot happen or the oracle fails to provide data within a specified grace period, anyone can call refund() to return the original deposits back to the respective parties.
  1. Chainlink CRE Workflow (Decentralized VWAP Computation)
  • The Chainlink CRE workflow fetches 1-hour OHLCV candles from five major CEX APIs: Binance, OKX, Bybit, Coinbase, and Bitget.
  • It calculates the 12-hour rolling VWAP, applies circuit breakers and outlier filtering, and aggregates the result into a consolidated consensus report.
  • Architecture Validation (Production vs. Demo):
    • In Production: A native CRE cron job triggers all Decentralized Oracle Network (DON) nodes to independently run the workflow. The nodes use OCR consensus to verify the median price and submit a signed report to the ChainlinkVWAPAdapter.
    • In Current Demo: To simulate this environment without a live DON, our backend runs an hourly cron job that triggers a Settler microservice. This service runs cre workflow simulate to execute the exact same workflow code on a single node and submits the raw report to a ManualVWAPOracle for staging.

Code Layout (High Level)

  • Frontend (chainlink-vwap-fe): The web application serving the UI (live at souzu.netlify.app).
  • Backend API & Services (chainlink-vwap-be): Manages the off-chain orderbook, detects on-chain events, and executes settlement triggers.
  • CRE Workflow + Contracts (chainlink-vwap-contract-cre):
    • Workflow: workflow.go & workflow.yaml alongside a Settler microservice (cmd/server) and trigger utility (cmd/trigger).
    • Contracts:
      • VWAPRFQSpot.sol (Main exchange and settlement logic)
      • ChainlinkVWAPAdapter.sol (Oracle receiver implementing IReceiver for Chainlink Forwarder)
      • ManualVWAPOracle.sol (Used for staging and simulation)

Links

Created by

  • Rengar
  • Ping
  • Anna
  • Tim
  • Paul