⚡️ Spark protocol

Inspiration

Do you know where all the electricity you consume comes from? What's the impact on the planet of your energy consumption? People are very disconnected from their energy consumer habits. Also, big electricity providers are struggling to offer different products tailored to the needs and beliefs of their customers.

What it does

Spark is the first protocol that allows consumers to decide which electricity source they want to power their homes. With live data on price and CO2 emissions for each electricity source, customers can personalize their energy consumption. Every day, the protocol will update sources generated electricity and user energy balances according to their preferences.

How I built it

The contract is built on Polygon. Every day, using Chainlink Automation it will trigger the API calls simulating the electricity meters measures and the source energy production. (The API is a netlify serverless function).

On the front-end side, I've built a NextJS application with Wagmi and RainbowKit libraries. I personally enjoy a lot working with TailwindCSS and giving a unique style to my projects.

All the sources data displayed is stored on IPFS.

Challenges I ran into

There were a lot of different pieces to the puzzle this project was. Probably the hardest thing was dealing with the logics happening inside the contract. As when users consume electricity, the same amount is deduced from the source pool; also user's debt is calculated in this process 💸

Accomplishments that I'm proud of

I had never used an oracle before and I'm proud to say that I not just learned what it is, but implemented Automation and API calls on Chainlink.

And the web application looks incredible 😍

What we learned

What's an oracle and work with Chainlink.

Also my time management is so messed up! I'm trying to get better at this 🙉

What's next for Spark protocol

There are a lot of things that I'm missing. First (and more hurtful to not have implemented) is a payment system to pay your debt. Second would be using real consumer data, connecting to IOT devices, maybe bridging Helium (TBD) 🤯

Also the UI needs more polishment and definitely a better admin panel.

Built With

Share this project:

Updates