Inspiration

Midday on a Lagos street: one roof has panels producing more than the house uses, and the shop next door is running a petrol generator. Generator power costs ₦750–950 per kWh, several times the ₦207–225 Band A grid tariff. The power is right there. What's missing is a trustworthy way to meter it, pay for it and prove it was green, without the same kilowatt-hour being claimed twice.

What it does

Prepaid power from your neighbour's roof. Lagos users already load prepaid units onto their meter, so Sunpool borrows that habit:

Sell surplus. A rooftop owner lists spare kWh. Before the meter signs the reading, an AI verification check compares it with live Lagos sunlight (Open-Meteo), what the seller already sold today on-chain and their neighbours. Impossible amounts are refused with a plain-language reason. Buy power. A neighbour loads kWh from a phone wallet (MetaMask or MiniPay) and pays in a dollar stablecoin on Celo. The seller is paid instantly. Certificates. Each sale mints one renewable energy certificate (ERC-721) carrying the meter ID, reading ID, time and energy. No double counting. Every meter reading has an ID the contract consumes once. Replaying a sold reading reverts with ReadingAlreadyConsumed, and the app demonstrates this live against the deployed contract, no wallet needed. Forecast and fair price. An hourly generation forecast with a confidence band and a suggested price, driven by live irradiance.

How we built it

Contracts: Solidity (ReadingRegistry, EnergyMarket, RECToken) on OpenZeppelin 5 with Hardhat, 20 tests covering double claims, bad signatures, settlement math and access control. Deployed and verified on Celo Sepolia. Meter readings are EIP-712 signed. App: Next.js App Router, TypeScript, Tailwind, wagmi and viem. Server route handlers run the simulated meter, market indexing, the forecast (/api/forecast), reading verification (/api/verify, 19 unit tests) and a cheapest-first matcher (/api/match). Data: Open-Meteo irradiance for Surulere, Lagos, with a labelled clear-sky fallback. CO₂ is estimated at 0.456 kg/kWh (Nigeria grid 2025, Ember via Our World in Data).

Challenges we ran into

Test USDm was practically unobtainable on Celo Sepolia, so the live market settles in test USDC. The contracts accept any ERC-20 stablecoin. Public RPC nodes prune old blocks, so the indexer derives timestamps for old events instead of fetching blocks. Electricity can't travel through an app. We designed for the realistic first deployment: a shared line in an estate, compound or mini-grid.

Accomplishments that we're proud of

The full loop works on a public testnet with real wallets: list, verify, buy, pay, certificate. The double-claim proof runs against the live contract. Every number on screen is on-chain or sourced, and simulated data is labelled as simulated.

What we learned

Most of the trust problem in energy trading sits at the meter, not on the chain. A smart contract can guarantee "once", but only the meter can attest "real". That's why the verification check and the threat model matter as much as the contracts.

What's next for Sunpool

Approach a Lagos estate or mini-grid operator (Lagos now licenses them through LASERC) about a first pilot. Device-signed readings from certified smart meters or inverter cloud APIs, one revocable key per meter. Mainnet launch inside MiniPay, auto-listing of forecast surplus and standing buy orders. Honesty notes: meter data is simulated (a server-side key signs readings). Payments and certificates are real Celo Sepolia testnet transactions. CO₂ figures are estimates.

Built With

  • celo
  • eip-721
  • erc-721
  • hardhat
  • metamask
  • minipay
  • next.js
  • open-mateo
  • openzeppelin
  • react
  • solidity
  • tailwindcss
  • typescript
  • usdc
  • vercel
  • viem
  • wagmi
Share this project:

Updates

Submission history