cristhedev / genlayer builds

Rainfall insurance tutorial

A ten-chapter tutorial: build insurance that pays out on its own when the season's rainfall falls short.

contract 0x4Ae2…7730 ↗network testnet bradburysource ↗docs →

Policies

#LocationSeasonThresholdPayoutStatus
Reading the contract…

Buy cover

Premium: 10% of the payout, paid now.

  1. 01Cover

    A farmer picks coordinates, a season and a rainfall threshold, and pays a premium of at least 10% of the payout.

  2. 02Wait

    Five days after the season ends, archive data is final and anyone can call settle.

  3. 03Settle

    Each validator fetches Open-Meteo rainfall. They must land on the same side of the threshold and within 2 mm, then the contract pays or expires the policy.