Inspiration

As renewable energy sources like solar panels become more popular, many prosumers generate more electricity than they can consume, while others still rely on expensive, non-renewable grid energy. We wanted to bridge this gap by creating a decentralized system where neighbors can easily trade energy with each other. Our inspiration was to democratize energy distribution, reduce transmission losses by promoting local usage, and incentivize green energy behaviors through gamification.

What it does

SunSwap is a comprehensive peer-to-peer (P2P) energy trading platform and microgrid coordinator. It features:

  • Interactive Energy Map: Users can see buyers and sellers in real-time, filtering them by distance, price, and surplus amount.
  • P2P Trading & Smart Contracts: Prosumers can set their energy prices, while buyers can accept offers or propose counter-offers. All transactions are settled via simulated smart contracts.
  • Hash-chained Certificates: Every kWh traded generates a verifiable, blockchain-like certificate of renewable energy origin, ensuring transparency.
  • Microgrid Coordination: The app monitors neighborhood groups, visualizing energy flows, forecasting PV production using weather APIs, and advising when to sell or store energy.
  • EcoTokens & Gamification: Users earn tokens, badges, and track their saved CO2 (translated into planted trees) to encourage clean energy trading.
  • SunBot AI Assistant: An integrated helper that provides real-time insights, like the best time to sell or buy energy, directly guiding the user.

How we built it

We developed a responsive web application (accessible via desktop and mobile devices). The core trading logic relies on real-time matching of buyers and sellers, integrating interactive map visualizations with a heat-map toggle. The energy certificates are secured using a hash-chained ledger to simulate immutable blockchain records—we even built a feature to simulate and detect tampering! To handle the dynamic pricing, we integrated live grid prices to guide users on setting competitive rates.

Challenges we ran into

One of the main challenges was designing an intuitive user interface for a complex process like energy trading. We had to ensure that features like smart contract animations, real-time map updates, and the hash-chained ledger were easy to understand for an average user. Additionally, orchestrating the microgrid logic—balancing supply, demand, and battery storage across a neighborhood—required careful data structuring and simulation.

What's next for SunSwap

We plan to integrate real IoT data from smart meters (via CSV imports or live APIs) to replace simulated demo data. We also aim to expand the SunBot capabilities to automatically execute trades based on user preferences and weather forecasts, making local energy trading a completely seamless experience.

Built With

  • ai
  • chatbot
  • datavisualization
  • interactivemap
  • react19
  • reactrouter
  • smartcontracts
  • tailwindcss
  • typescript
  • vite
Share this project:

Updates

Submission history