Nexus Mutual Integration
DeFi protocols lose user funds to exploits regularly: Euler Finance—$197M, Beanstalk—$182M, Wintermute—$160M. On-chain insurance stopped being marketing option and became hygiene minimum for TVL >$1M protocols. Nexus Mutual—only mature decentralized insurer with real payouts and transparent underwriting pool. Integration—not three lines of code; work with nontrivial API, custom coverage products and on-chain governance.
How Nexus Mutual Works
Nexus Mutual operates on mutual model: NXM-holders are underwriters bearing payout risk. Coverage issued as Cover NFT (ERC-721) with parameters: amount, currency (ETH/DAI), period (30–365 days), product type.
Since v2 (2023), structure changed fundamentally. StakingPool appeared—separate underwriter pools per protocol, and Products—configurable coverage parameters. Opened integration possibility directly in protocol UI: user insures position without leaving nexusmutual.io.
Available Coverage Types via API
Protocol Cover—smart contract risk coverage for specific protocol. Pays on successful on-chain voting recognizing incident. Most requested type.
Custody Cover—custodian risk coverage (centralized exchange, custodial wallet). Relevant for yield aggregators holding funds on CEX.
EtherPosition Cover—ETH 2.0 staking risk coverage via Lido, Rocket Pool and other liquid staking protocols.
Technical Integration Details
Cover Broker Contract
Direct integration via Cover Broker pattern. Nexus Mutual provides ICover interface with buyCover function. Calling directly from UI without intermediary—awkward, need to form CoverData structure, pass poolAllocationRequests. Cover Broker abstracts this.
struct BuyCoverParams {
uint24 coverId; // 0 for new
address owner;
uint24 productId; // Nexus product ID
uint8 coverAsset; // 0=ETH, 1=DAI
uint96 amount; // coverage amount
uint32 period; // in seconds
uint256 maxPremiumInAsset;
uint8 paymentAsset;
uint256 commissionRatio; // up to 25% broker commission
address commissionDestination;
bytes ipfsData;
}
Field commissionRatio lets protocol earn on insuring own users—up to 25% premium goes to commissionDestination. Real revenue stream most integrators ignore.
Getting Quote
Quote requested via Nexus Mutual off-chain API (https://api.nexusmutual.io/v2), not on-chain. /quote endpoint takes productId, period, coverAmount, coverAsset and returns premiumInNXM, premiumInAsset and poolAllocations list—which StakingPool covers what risk portion.
These poolAllocations must pass to buyCover tx. If data stale (>10 minutes), tx reverts with CoverAmountNotAvailable. Common integration error—caching quotes longer than 5–7 minutes.
Checking Active Coverage On-Chain
After purchase, user gets Cover NFT at address. For displaying insurance status in protocol UI—query ICoverViewer:
function coverData(uint256 coverId) external view returns (CoverData memory);
Returns productId, coverAsset, amountPaidOut, gracePeriod. Field gracePeriod important: even after coverage period expires, user can submit claim within grace period (usually 35 days) if incident happened before expiration.
Workflow
Analysis (0.5 day): determine coverage type (Protocol/Custody/EtherPosition), StakingPool list with sufficient capacity for your protocol, your productId in Nexus system.
Cover Broker Contract Development (1 day): wrapper over ICover, parameter checks, events for indexing.
Quote Service Backend (0.5 day): cache with 5-minute TTL, retry on CoverAmountNotAvailable, fallback on API unavailable.
UI Component (1 day): insurance purchase form with amount/period choice, active coverage display via ICoverViewer, expiration notifications.
Testing (0.5 day): fork-tests on Ethereum mainnet via Foundry, edge case checks (zero pool capacity, max period).
Total: 2–3 days. Timelines increase if custom premium distribution logic or multiple coverage type integration. Cost calculated individually.







