All projects

Policy2Protocol

Convert plain-English treasury risk policies into autonomous cross-chain DeFi compliance and execution.

CRE & AI Risk & Compliance

What it is

Policy2Protocol is a natural-language compliance and automation layer for multi-chain DeFi treasuries. Today, DAOs and DeFi protocols manage funds across many chains (Ethereum, Base, etc.), but treasury monitoring and risk management are still largely manual. Teams rely on passive dashboards that only display metrics such as utilization, APR, or stablecoin deviation, while governance processes are slow and reactive. By the time a proposal passes or a human operator intervenes, the opportunity may be lost or the risk may already have materialized.
Policy2Protocol solves this by allowing DAO risk managers to define treasury management policies in plain English, such as:
"If utilization exceeds 85% or stablecoin deviation is above 2%, withdraw funds and rebalance to the safest chain."
The system automatically converts this policy into a structured workflow that continuously monitors on-chain metrics and enforces the policy without manual intervention.
The process works in several steps. First, a user enters a policy through the frontend. An AI parser (using Claude) converts the natural language policy into a structured configuration describing monitoring intervals, thresholds, metrics, and allowed actions. If no API key is present, a deterministic rule-based parser is used as a fallback. This configuration is then deployed as a Chainlink Runtime Environment (CRE) workflow.
The CRE workflow runs on a decentralized oracle network (DON) and executes on a scheduled basis, for example every five minutes. It reads metrics such as liquidity rates or utilization from lending pools on multiple chains and evaluates whether the defined thresholds are breached. If the policy conditions are met, the workflow produces a consensus report describing the required action, such as rebalancing funds.
This report is sent to a Protocol Smart Wallet (PSW) contract that performs the enforcement on-chain. The wallet can withdraw funds from the current pool, send assets across chains using Chainlink CCIP, and deposit them into the destination pool offering safer or higher yield conditions. Because the action is triggered through the CRE consensus network, the decision is decentralized and verifiable.
Every step of the process produces on-chain events and logs, creating a transparent and immutable compliance record. This allows DAOs and treasury managers to audit when policies were triggered, what actions were executed, and how funds moved across chains.
By combining natural language policy definition, decentralized monitoring, and automated cross-chain execution, Policy2Protocol introduces a verifiable compliance layer for DeFi treasuries. It reduces operational risk, removes reliance on slow governance decisions, and transforms treasury policies from passive guidelines into actively enforced rules.

How it Works

Policy2Protocol is built as a full-stack decentralized system combining a modern web interface, AI-powered policy parsing, Chainlink automation workflows, and cross-chain smart contract execution.
The frontend is built with Next.js, TypeScript, and Tailwind CSS, providing an interface where DAO operators can define treasury policies in plain English, review the generated configuration, deploy workflows, and view compliance logs. Wallet connectivity is handled using RainbowKit and Wagmi, allowing users to interact with deployed smart contracts directly from the UI.
The policy parsing layer uses Anthropic Claude to convert natural language policies into structured JSON configurations. This parser extracts key parameters such as monitoring intervals, metrics (APR, utilization, deviation), thresholds, and allowed actions. If an API key is not available, the system falls back to a deterministic rule-based parser to ensure the workflow can still be generated.
The parsed configuration is then used to generate a Chainlink Runtime Environment (CRE) workflow written in TypeScript. This workflow runs on a Chainlink Decentralized Oracle Network (DON) and is triggered on a schedule using cron-based automation. During each execution cycle, the workflow reads on-chain metrics from lending pools across multiple chains and evaluates the defined policy conditions using consensus among oracle nodes.
When a policy threshold is breached, the workflow produces a consensus report that contains encoded execution parameters for a treasury action, such as rebalancing funds.
On the smart contract layer, the system uses Solidity contracts built with Foundry and OpenZeppelin. The core contract, called the ProtocolSmartWallet (PSW), receives the consensus report and executes the required treasury action. This can include withdrawing liquidity from a lending pool, transferring assets across chains, and depositing them into a new pool.
For cross-chain asset movement, the project integrates Chainlink CCIP, which enables secure token transfers and messaging between chains. In the demo implementation, funds can move between Ethereum Sepolia and Base Sepolia, where destination smart wallets automatically deposit assets into higher-yield pools.
Finally, all actions emit on-chain events such as report receipt, cross-chain message sending, and fund deposits. These events are indexed and displayed in the frontend as verifiable compliance logs, providing a transparent audit trail of treasury policy enforcement.
Together, these components create an automated pipeline that transforms plain-language treasury policies into decentralized, cross-chain financial operations.

Links

Created by

  • Ayush
  • Shubham