All projects

AridGuard [https://aridguard.replit.app]

Deterministic drought protection with instant, automated on-chain payouts.

Risk & Compliance

What it is

What it is
AridGuard is a decentralized parametric insurance application designed to protect farmers against severe drought conditions. Unlike traditional insurance that requires tedious manual damage assessments and lengthy claim processes, AridGuard is entirely deterministic. It leverages smart contracts and the Chainlink Cross-Chain Runtime Environment (CRE) to offer a fully automated insurance policy where payouts are guaranteed and instant if specific weather conditions are met.

The Problem it Solves
Traditional agricultural insurance is broken for smallholder farmers. When a severe drought destroys a crop, farmers need immediate liquidity to survive the season and prepare for the next. Instead, they are forced to deal with:

  • Slow Payouts: Manual claims processing can take months.
  • Subjective Assessments: Adjusters must physically visit farms to estimate damage, leading to disputes and high administrative costs.
  • Lack of Trust: Opaque corporate processes leave farmers unsure if their claim will actually be honored.

By removing the human element from the claims process, AridGuard dramatically reduces overhead costs, eliminates fraud, and ensures that capital reaches vulnerable farmers exactly when they need it most.

How it Works
AridGuard operates on a "parametric" model, meaning payouts are triggered by an objective, measurable metric (rainfall) rather than a subjective assessment of crop damage.

Onboarding & Purchase: A farmer connects their Smart Wallet via our Next.js frontend (powered by Coinbase OnchainKit). They select their geographic coordinates and pay a premium into the AridGuard smart contract deployed on Base Sepolia.

Continuous Monitoring: The Chainlink CRE off-chain compute environment takes over. Running on a scheduled cron job, the CRE workflow securely fetches real-time precipitation data for the covered coordinates from the OpenWeather API.

Consensus & Evaluation: To ensure data integrity, the CRE applies median aggregation to the weather data. It then continuously checks this data against the policy's predetermined drought threshold (e.g., rainfall dropping below 10mm in a month).

Automated Payout: If a drought condition is met, the farmer does not need to file a claim. The Chainlink CRE automatically executes a transaction to the AridGuard smart contract on Base, triggering the executePayout function. The smart contract instantly transfers the coverage amount directly to the farmer's wallet.

How it Works

AridGuard is built using a modern, three-tier Web3 architecture encompassing a user-facing frontend, a secure on-chain settlement layer, and a decentralized off-chain automation environment.

  1. The Frontend (User App)
    Tech Stack: Next.js (React), Tailwind CSS, Wagmi, Viem.

Wallet Integration: We integrated Coinbase OnchainKit to provide a seamless onboarding experience. This allows users to easily connect their Smart Wallets (or standard EOA wallets) using the and components, providing a smooth, Web2-like UX.

Functionality: The frontend allows users to view their regional drought threshold, review the premium cost, and execute the purchasePolicy smart contract transaction directly from the browser.

  1. The Smart Contracts (On-Chain Settlement)
    Tech Stack: Solidity, Hardhat, OpenZeppelin.

Network: Deployed on Base Sepolia testnet for fast, low-cost execution.

Functionality: The AridGuard.sol contract acts as the decentralized escrow and registry. It records policy details (farmer address, coordinates, premium paid) and holds the funds. Crucially, the contract features an onlyCRE access modifier on the executePayout function. This ensures that payouts can only be triggered by our authorized off-chain runtime, preventing user manipulation or premature claims.

  1. The Oracle & Automation Logic (Chainlink CRE)
    Tech Stack: Chainlink Cross-Chain Runtime Environment (CRE), TypeScript, OpenWeather API.

Functionality: This is the brain of the parametric insurance model. We built a serverless workflow using the @chainlink/cre-sdk that operates entirely off-chain:

Trigger: We use the CronCapability to schedule regular check-ins.

Data Fetching: We use the HTTPClient to securely call the external OpenWeather API, injecting a hidden API key via the CRE secrets manager (secrets.yaml).

Consensus: We apply consensusMedianAggregation() to ensure the weather data (precipitation levels) is reliable and tamper-resistant before acting on it.

Execution: If the script detects that the aggregated rainfall has dropped below the critical threshold, it utilizes the EVMClient to directly format, sign, and broadcast the executePayout transaction to our smart contract on Base Sepolia.

By combining Base for fast on-chain settlement with Chainlink CRE for secure off-chain compute and data fetching, we were able to build a truly autonomous and deterministic insurance protocol.

Links

Created by

  • Olamide Olajide