All projects

CCIP Based Intents Bridge \ Layer7

Intent based ERC-4626 bridge vault with CCIP settlement, CRE monitoring, and AI risk proofs

DeFi & Tokenization CRE & AI

What it is

SDL CCIP Bridge (Alternative name: Layer7) is a complete cross-chain bridge liquidity system built on Chainlink. At its core is LaneVault4626, an ERC-4626 vault that tracks every wei of LP liquidity across five accounting buckets: free liquidity, reserved liquidity, in-flight liquidity, bad debt reserves, and protocol fees. Settlement messages flow back to the vault via a Chainlink CCIP adapter with 3-layer security (source allowlisting, replay protection, and payload domain binding). Three CRE workflows autonomously monitor vault health, run AI-powered policy analysis, and track the FIFO redemption queue, writing verifiable keccak256 risk proofs to a Sepolia registry contract.

LPs deposit assets into the vault and receive ERC-4626 shares. When a bridge route opens, the operator reserves liquidity from the free bucket, moving it to the reserved bucket (subject to a utilization cap). A solver fills the bridge order on the destination chain, moving reserved liquidity to in-flight. When settlement completes, a CCIP message arrives at the LaneSettlementAdapter. On success, fee income is split: a cut goes to the bad debt reserve, an optional cut to protocol fees, and the rest flows to LPs via increased share price. On loss, the bad debt reserve absorbs what it can, and any uncovered loss reduces share price for all LPs.

If LP liquidity is fully utilized, withdrawals enter a FIFO redemption queue managed by LaneQueueManager. Shares are escrowed, requests are non-cancelable (preventing gaming), and the queue processes strictly in order as liquidity becomes available.
Three Chainlink CRE workflows run autonomously on a unified cycle. The Vault Health Monitor reads all five liquidity buckets plus policy parameters via EVMClient every 15 minutes, classifying risk as OK, Warning, or Critical. The AI Advisor sends vault state to GPT-5.2 via HTTPClient with consensusIdenticalAggregation, receiving structured policy recommendations. The Queue Monitor tracks redemption queue depth and coverage ratios. A composite intelligence layer cross-correlates all three workflows: high utilization alone might be fine, but high utilization plus a growing queue plus an AI risk flag is a cascade. Every assessment is hashed (keccak256 of timestamp, workflow name, risk level, and domain metrics) and written to SentinelRegistry on Sepolia as a permanent, tamper-proof audit trail.

Cross-chain bridges move billions, but the vaults behind them are black boxes. LPs have no visibility into how much liquidity is reserved, in-flight, or stuck. Utilization can spike, redemption queues can grow, and bad debt can accumulate silently. Nobody watches continuously. SDL CCIP Bridge solves this by combining strict on-chain accounting (5 buckets, every wei tracked), secure CCIP settlement (3-layer validation), autonomous CRE monitoring (3 workflows reading live contract state), AI-driven policy optimization, and verifiable on-chain risk proofs. The result is a bridge vault where LPs can trust the accounting, verify the monitoring, and know that an AI advisor is continuously evaluating whether policy parameters need adjustment.

How it Works

Smart Contracts (Solidity 0.8.24, Foundry): 4 contracts totaling 766 nSLOC. LaneVault4626 is the core ERC-4626 vault with 5 liquidity buckets, dual state machines (route + fill lifecycle), utilization cap enforcement, and inline accounting invariant checks. LaneSettlementAdapter extends Chainlink's CCIPReceiver to handle settlement messages with source allowlisting, replay protection (3-tuple keccak256 key), and payload domain binding. LaneQueueManager implements a strict FIFO redemption queue with non-cancelable requests. LaneVaultScaffold provides off-chain simulation parity for invariant model validation.

Chainlink CCIP: LaneSettlementAdapter imports CCIPReceiver, Client (Any2EVMMessage), and IRouterClient from @chainlink/contracts-ccip. The _ccipReceive function validates source chain/sender allowlisting, checks replay keys, verifies payload version/vault/chainId, then routes to the vault's reconcileSettlementSuccess or reconcileSettlementLoss function.
Chainlink CRE SDK (@chainlink/cre-sdk@^1.0.9): 3 workflow projects using Runner, handler, EVMClient, HTTPClient, CronCapability, consensusIdenticalAggregation, getNetwork, and encodeCallMsg. All 3 are registered on the CRE Workflow Registry on Ethereum mainnet. The vault-health workflow reads 11 on-chain values per run (5 buckets + totalAssets + totalSupply + policy params + pause state + queue depth + LINK/USD price feed).

Chainlink Data Feeds: LINK/USD price feed read via AggregatorV3Interface.latestAnswer() for TVL computation in the vault-health and bridge-ai-advisor workflows.
AI Analysis: Flask server (bridge_analyze_endpoint.py) with GPT-5.2 for structured risk assessment and policy recommendations. All AI calls go through HTTPClient with consensusIdenticalAggregation to ensure DON consensus. The server converts null values to 0 for deterministic JSON output.
On-Chain Proofs: TypeScript bridge script using viem computes keccak256(encodeAbiParameters(...)) proof hashes for each workflow's output and writes them to SentinelRegistry on Sepolia. 4 proof types: vault-health, bridge-advisor, queue-monitor, and bridge-composite.
Testing: 83 Foundry tests across 11 files (3,332 LOC). Includes 8 full lifecycle E2E tests, 15 advanced edge-case audits, 14 attack scenarios, fuzz testing with 4.16M invariant assertions at 10K runs, and deep audit tests. Three security audits performed (initial, deep re-audit, CRE/AI review). OpenZeppelin v5.0.2 for ERC-4626, AccessControl, ReentrancyGuard, SafeERC20.

Links

Created by

  • Avi