
UPI for Electricity: Rooftop Solar Trading on Beckn and AWS Strands Agents
JanUrja is building a “UPI for Electricity” — an intelligent peer-to-peer renewable energy marketplace that combines AWS Strands Agents, deterministic energy tools, dynamic pricing, and grid-capacity checks to make local solar energy trading smarter and more sustainable.
What If Electricity Had UPI? Meet JanUrja — The Universal Energy Interface
A bakery just 50 meters from your roof is paid up to ₹9 for each unit of electricity. Your own rooftop panels send extra power to the grid, and you get only about ₹2.
Same area. Same sun. Nearly a four times gap, and the grid still treats it that way.
JanUrja is what I built. It is a public marketplace where homes with solar can sell power to nearby people who want it. Deals close right away on UPI. I call it UPI for Electricity, professionally known as UEI - Unified Energy Interface.
The issue: solar is rolling out faster than demand can absorb it :-
Under PM Surya Ghar: Muft Bijli Yojana, many homes and groups are putting solar on roofs. But the money math does not hold up.
- Net metering gives low returns. Extra solar brings around ₹2.00 to ₹2.50 per kWh in credits. Settlements can take weeks to months because of the adjustment process.
- Local buyers pay more. Bakeries, hospitals, and places that charge EVs in the same feeder pay around ₹7.50 to ₹9.00 per kWh under commercial rates.
- Midday stress shows up. When solar is pushed in without a plan, it can strain distribution transformers. It can also cause reverse flow on 11 kV lines. People often refer to this as the duck curve.
All of this comes back to how electricity is priced. Market places handle pricing by matching buyers and sellers in real time.
The plan: give electricity a fast money flow :-
UPI worked well because it is a shared payment standard. Any app could connect. JanUrja does the same idea for energy. It uses Beckn, the open protocol linked to India’s Digital Public Infrastructure. It also uses the Unified Energy Interface (UEI).
- Solar owners are listed as sellers. They share surplus offers as BPPs.
- Power seekers are listed as buyers. They find and request energy as BAPs.
- Payment is done through UPI escrow after smart meter data confirms that the energy was delivered.
-
The twist: an AI agent that respects the grid :-
A normal marketplace matches buyers and sellers. JanUrja also asks: can the grid handle the trade?
Built with the AWS Strands Agents SDK, JanUrja combines Gemini-powered natural-language reasoning with three deterministic tools:
- Energy matching: Finds suitable offers and rejects allocations that exceed configured feeder capacity.
- Dynamic pricing: Evaluates pricing instructions against configured price floors, tariff limits, and congestion rules.
- Impact calculation: Estimates potential CO₂ savings and economic impact.
The principle is simple: AI interprets the request; code calculates the numbers. That means critical pricing and capacity decisions don't depend on an LLM guessing the answer.
The AWS stack behind JanUrja :-
The project includes a serverless deployment architecture designed around:
- AWS Lambda + Lambda Function URL — run and expose the Python backend.
- Amazon DynamoDB — persist energy events and telemetry.
- AWS Systems Manager Parameter Store — securely store the Gemini API key.
- Amazon CloudWatch Logs — capture operational logs.
- AWS SAM — define and prepare the deployment.
The frontend uses React and Vite, while FastAPI powers the Python API layer. The AWS infrastructure is prepared in code; live cloud integrations are being verified separately.
Built to be tested, not just pitched:-
The latest reported local verification shows 34 automated tests passing, with the frontend production build completing successfully.
The tests cover energy matching, capacity constraints, pricing rules, environmental calculations, API behaviour, and mocked AWS integrations. Passing mocked tests is not the same as proving a live cloud deployment, so verifying the deployed end-to-end flow is a key next milestone.
Why it matters:-
JanUrja explores a future where surplus renewable energy can be discovered and coordinated more intelligently, consumers can find suitable local offers, and utilities remain part of the ecosystem.
The current prototype uses configured data and calculations; it is not yet a live electricity-trading network. Real-world deployment would require regulatory approval, authorised market arrangements, reliable metering, and verified settlement integrations.
But the opportunity is worth exploring: what if the value of clean energy could travel as intelligently as digital money?
Explore JanUrja:-
Built for Bharat Builds Environmental Hacks 2026, JanUrja brings together agentic AI, deterministic engineering, and a serverless AWS architecture to explore a smarter energy future.
UPI changed how India moves money. JanUrja asks how we could move the value of clean and green energy.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article