Skip to content
Defi Insurance

Defi Insurance

#insurtech #defi #agricultural

Created on 25th June 2025

Defi Insurance

Defi Insurance

#insurtech #defi #agricultural

The problem Defi Insurance solves

We want to create a DeFi platform for agricultural insurance based on weather data (Onchain Finance + Real World Assets). This idea is highly relevant in the context of Vietnam, where agriculture plays a vital role but farmers often face risks from extreme weather (floods, droughts). By combining DeFi, on-chain weather data, and RWAs (real-world assets like insurance contracts) with Chainlink technologies (VRF, CCIP, Data Streams, Automation, Functions), we can create a transparent, automated, and accessible solution.

The Problem:

  • Weather Risks: Vietnamese farmers, especially in the Mekong Delta (which contributes 95% of rice exports), suffer heavy losses from floods, droughts, and irregular rainfall.
  • Traditional Insurance: Complicated processes, high costs, delayed payouts, and poor accessibility for low-income farmers.
  • Lack of Transparency: Farmers struggle to trust insurance companies due to the lack of public information.

The Defi Insurance Solution:

  1. Weather Index Insurance: Automatically pays out based on weather data (e.g., rainfall exceeding 200mm over 5 consecutive days) instead of assessing actual damages => reducing costs and speeding up processing.
  2. DeFi: Eliminates intermediaries, reduces insurance premiums, and allows farmers to pay using USDC via Web3 wallets.
  3. RWA (Real World Assets): Tokenizes insurance contracts into NFTs (ERC-721) or ERC-20 tokens, enabling investors to provide liquidity to insurance pools and earn returns.
  4. Chainlink Integration:
  • Automation: Automatically handles claim payouts and profit distribution.
  • Functions: Integrates weather or agricultural data APIs to verify payout conditions.
  • Data Streams: Fetch weather data from trusted providers (e.g., AccuWeather, NOAA) to trigger payouts.
  • VRF (Verifiable Random Function): Ensures fairness in profit distribution among liquidity providers.
  • CCIP (Cross-Chain Interoperability Protocol): Transfers USDC and RWA tokens across blockchains.

Among them, two features — Automation and Functions — have already been successfully integrated and demonstrated in the video demo. The remaining features are currently being researched and developed as part of our product roadmap in the upcoming period.

Challenges we ran into

1. Lack of Relevant Example Code for Chainlink Weather Data
The scarcity of up-to-date example code for integrating blockchain with Chainlink weather data made us struggle at first, as adapting generic examples to insurance was tough.
So we studied Chainlink docs, tested proofs-of-concept with Hardhat and Remix, and consulted the community for guidance.

2. Transitioning from Chainlink Oracles to Functions
Switching to Chainlink Functions for flexibility required extensive contract rework due to its new JavaScript model.
So we tested thoroughly on the Avalanche Fuji testnet and iterated for reliability.

3. Challenges with Chainlink Automation
Setting up checkUpkeep and performUpkeep for automation was complex, leading to missed updates and inefficient gas use. We initially struggled with rotating between time-based, custom logic, and log trigger options, as each had its challenges—custom logic was hard to configure, and log triggers were unreliable for frequent updates.
So we studied docs, debugged with logs, and experimented with different trigger types. After testing, I settled on time-based triggers, which proved most suitable for consistent weather updates and payout schedules on the testnet.

4. Difficulties with Chainlink Functions & High Gas Fees
The 300,000 gas limit restricted scripts, causing callback failures due to on-chain processing or API issues, while high gas fees per call, especially on the mainnet, impacted scalability.
So we optimized JavaScript, reduced storage operations, batched updates, streamlined data in Functions, scheduled calls during low congestion, and considered subsidizing costs with premiums, using Hardhat for gas profiling on testnet.

Tracks Applied (2)

Onchain Finance

Our project brings agricultural insurance on-chain, allowing farmers to access parametric insurance products transparent...Read More

Avalanche Track

We leverage Avalanche for its low-cost, high-speed, and eco-friendly architecture—ideal for deploying scalable insurance...Read More
Avalanche

Avalanche

Discussion

Builders also viewed

See more projects on Devfolio