Liquidity Insurance with CRE and Cassa
A tokenized insurance market for liquidity risk on trading pairs using CRE to query CEX and DEX APIs
What it is
We built a Cassa insurance market where users can buy and underwrite coverage against liquidity deterioration for a given trading pair (e.g., ETH/USDC), using CRE to fetch market data from centralized and decentralized venues to settle the insurance policy.
Cassa vaults issue two tokens against a deposited asset: an insurance token (IT) and an underwriting token (UT). Users can trade these tokens to take a position on the outcome of the vault’s policy. At expiration, their combined redemption value equals the underlying, with the split determined by the policy.
We built a policy around expected slippage. A CRE workflow queries Binance, Bybit, and KyberSwap APIs and computes the best achievable execution price for a given reference order (e.g., sell 1k ETH for USDC) and writes it on-chain along with the current spot price. We use the gap between spot and execution price to measure how much liquidity has deteriorated. The bigger the gap, the higher the insurance payout for IT holders, at the expense of underwriters.
To go alongside this, we built an explorer interface that lets anyone inspect live CRE workflows and a tool that allows users to verify the workflow code by re-deriving the workflow’s ID from the source code and configuration and comparing it with the ID registered on-chain.
Typically, large traders and protocols have no way to hedge against a sudden liquidity crunch on a specific trading pair. By using CRE to source and aggregate real cross-venue market data on-chain, we make that risk quantifiable, priceable, and tradeable through Cassa's policy mechanism.
How it Works
CRE Workflow and Workflow ID Re-derivation: Go monorepo with three components: a CRE workflow (based on cre-sdk-go) that fetches order books and quotes from Binance, Bybit, and KyberSwap, computes spot and execution prices, and writes consensus reports on-chain; Solidity contracts with a workflow-gated oracle receiver and a Cassa insurance policy that derives settlement ratios from price slippage; and a Go script that re-derives workflow IDs locally to match CRE's deploy-time hashing.
CRE Explorer: TypeScript monorepo with three apps: a React + Vite frontend (Tailwind CSS, React Query), a Fastify REST API backed by PostgreSQL, and a blockchain indexer that watches on-chain CRE events via RPC and enriches them into the database.
Links
Created by
- Lucas Gleba
- Luca Bernardi
- Francesco Mangia