Inspiration
The traditional power grid is fragile and centralized. We saw a validated demand for decentralized physical infrastructure networks (DePIN). Gradium was inspired by the need to turn neighborhoods into autonomous micro-economies, resulting in a visionary product with a strong future outlook.
What it does
Gradium is an AI-governed energy microgrid powered by zero-knowledge cryptography. It relies on three pillars:
- The Market (ERC-20 AMM): Nodes trade surplus solar via an on-chain automated market maker using the constant product formula:
$$ x \cdot y = k $$
- The Brain (DDPG AI): A reinforcement learning agent dynamically shifts the AMM swap fee to protect grid battery reserves based on the expected return:
$$ J(\mu)=\mathbb{E}_{r_i,s_i\sim E,a_i\sim\mu}[R_1+\gamma R_2+...] $$
- The Shield (zk-SNARKs): Groth16 zero-knowledge proofs allow nodes to settle trades on-chain without revealing private, physical location data.
How we built it
We architected the protocol with a strict focus on clean, maintainable code, modular design, and best-practice patterns. We built a 60FPS 3D Command Center using React and Three.js, a real-time DDPG inference engine using Python and FastAPI, and the ZK-AMM router using Solidity and Hardhat. This stack ensures an exceptional end-to-end user journey.
Challenges we ran into
Deploying a heavy PyTorch ML environment alongside a live WebSocket server caused massive memory limit (OOM) crashes in the cloud. We overcame this by decoupling the environment and dynamically routing our PyTorch tensors to CPU-only inference for production:
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
Accomplishments that we're proud of
We achieved a breakthrough approach by successfully fusing three notoriously complex domains: 3D web rendering, deep reinforcement learning, and zero-knowledge cryptography into a single, seamless live data stream.
What we learned
We learned the profound difference between training heavy AI models on GPUs versus optimizing them for lightweight CPU inference in production, as well as how to abstract complex cryptography into an intuitive UI.
What's next for Gradium
Gradium is well-positioned for longevity and eventual dominance in the DePIN sector. Next, we plan to migrate our smart contracts to an Ethereum L2 for cheaper settlement and integrate live weather APIs into the AI's state space to preemptively adjust energy prices based on incoming storms.
Built With
- docker
- ethers.js
- fastapi
- framer-motion
- groth16
- hardhat
- netlify
- openai-gym
- python
- pytorch
- railway
- react
- react-three-fiber
- solidity
- tailwind-css
- three.js
- typescript
- vite
- websockets
- zustand
Log in or sign up for Devpost to join the conversation.