Clim Protocol
Parametric drought insurance for farmers using Chainlink oracles and automation
What it is
Clim Protocol is a decentralized parametric insurance platform that provides automatic drought protection for small farmers in Brazil's semi-arid region. The protocol tokenizes climate events as ERC-1155 tokens that pay out automatically when precipitation falls below a defined threshold (e.g., <150mm in 90 days).
What it is:
A fully on-chain insurance system where farmers purchase protection tokens and receive instant payouts when drought conditions are verified by Chainlink oracles, without any bureaucratic processes or inspections.
How it works:
- Farmers purchase Climate Event Tokens (CET) paying a premium to the protocol
- Chainlink Functions continuously monitors real precipitation data from Open-Meteo API
- When the event period ends, Chainlink Automation triggers settlement
- If drought occurred (precipitation < threshold), Chainlink Functions validates the data
- Smart contracts automatically transfer funds from the Liquidity Pool to farmers' wallets
- Entire process is transparent, auditable, and happens in hours instead of months
Problem it solves:
- For Farmers: Access to affordable climate insurance without bureaucracy, with instant payouts
- For Investors: New DeFi yield opportunity providing liquidity to the insurance pool (8-15% ROI)
- For Society: Financial resilience for 28M people living in drought-prone regions
Key Innovation:
First parametric insurance using Chainlink's CRE (Runtime Environment) workflow that orchestrates 8 capabilities (Cron, EVM Read, HTTP Fetch, DON Consensus, Compute, EVM Write, Event Trigger, Loop) in a single composable workflow.
How it Works
Smart Contracts (Solidity + Foundry):
- 6 core contracts: ClimProtocol (Facade), ClimateEventFactory, ClimateEventToken (ERC-1155), LiquidityPool, SettlementEngine, ClimateOracle
- Built with OpenZeppelin v5.0 (AccessControl, ReentrancyGuard)
- 66/66 tests passing (100% success rate)
- Deployed on Sepolia testnet
Chainlink Integration:
- Chainlink Functions: Fetches real precipitation data from Open-Meteo Archive API via custom JavaScript code
- Chainlink Automation: Implements AutomationCompatible interface for automatic settlement triggers
- Chainlink CRE Workflow: TypeScript workflow orchestrating the complete settlement lifecycle with 8 CRE capabilities
Frontend (Next.js 16):
- PWA with RainbowKit + Web3Auth (social login)
- Multi-language support (EN/PT/ES)
- Dark/light theme
- Dashboard, protection purchase, liquidity provision, settlement redemption
Data Source:
- Open-Meteo Archive API (historical precipitation data)
- Geographic coordinates for Brazilian semi-arid region
Development Tools:
- Foundry (forge, anvil, cast)
- Bun runtime (CRE workflow)
- TypeScript + viem + wagmi
- PowerShell scripts for automation
Links
Created by
- Cássio Chagas
- Davi Marques
- Alex Joubert
- Leonardo Roberto