MARGINAL
MARGINAL is a decentralized compute allocation market on 0G network.It is an on-chain protocol that introduces real economic logic into how compute gets allocated to Agents.
Videos
Description
Description of what?
Progress During Hackathon
<p><span style="color: rgb(64, 64, 64)">Here's a comprehensive overview of the journey:</span></p><p></p><p>Project Conception and Architecture (Initial Phase)</p><p> Created Marginal as a proof-of-efficient compute platform where AI agents compete in on-chain auctions for inference tasks. Efficient agents earn rewards; inefficient ones get slashed.</p><p> Tech Stack: Chose Solidity for contracts (OpenZeppelin-based), Python for agents (using OpenAI-compatible APIs), and Next.js/TypeScript for the frontend. Integrated 0G ecosystem components: On-Chain (EVM), Storage, and Compute.</p><p> Key Decisions: Focused on decentralization, using 0G for blockchain, storage, and inference to avoid centralized dependencies.</p><p></p><p>2. Smart Contract Development</p><p> Contracts Built: Developed AuctionHouse.sol (manages auctions and bidding), StakeVault.sol (handles staking and slashing), and MarginalNFT.sol (for agent registration and rewards).</p><p> Testing and Deployment: Wrote Hardhat tests, deployed to 0G testnet/mainnet. Addresses: AuctionHouse (0x17758a3324B65FEbDccDdf3659A4eDD5487d861A), StakeVault (0xe2119bf943999647A8C5EA025Ea13C98c020A39F), MarginalNFT (0xa17931723B7fAED34F8532a95F8b62DD27a06102).</p><p> Challenges: Ensured gas efficiency and security audits for on-chain operations.</p><p></p><p>3. Agent Development</p><p> Components: Built base_agent.py, executor.py (runs tasks), auctioneer.py (manages auctions), auditor.py (verifies results), and supporting scripts.</p><p> Integration: Agents interact with contracts via Web3.py, use 0G Storage for state/logs, and leverage 0G Compute for AI inference (e.g., Groq API).</p><p> Features: Implemented bidding logic, profit margins, and decentralized execution to ensure fair competition.</p><p></p><p>4. Frontend Development</p><p> UI/UX: Created a Next.js app with pages for Dashboard, Auctions, Agents, Tasks, and History. Used Tailwind CSS, wagmi/RainbowKit for wallet integration, and Recharts for analytics.</p><p> Responsive Design: Initially attempted mobile optimization but simplified to desktop-first due to build issues with Framer Motion.</p><p> Sidebar Evolution: Started with complex mobile toggles, simplified to hover-expand desktop sidebar, removed it temporarily per feedback, then restored for production.</p><p></p><p>5. Integration, Testing, and Deployment</p><p> Full Stack Connection: Connected frontend to contracts (via wagmi), agents to blockchain/storage, and ensured end-to-end task flow.</p><p> Testing: Ran contract tests, agent simulations, and frontend builds. Deployed to Vercel (https://frontend-mu-ebon-51.vercel.app) with multiple iterations to fix build failures.</p><p> Deployment: Used Hardhat for contracts, Vercel for frontend, and manual scripts for agents. Repository: https://github.com/haleem15/Marginal.</p><p></p><p>6 :Current State and Achievements</p><p> - Live System: Contracts on 0G mainnet, agents operational, frontend deployed and functional.</p><p> Key Metrics: Supports agent registration, auction bidding, task execution, and reward distribution. Built for scalability with 0G's decentralized infra.</p><p> Challenges Overcome: Resolved build issues, simplified UI for reliability, and ensured 0G ecosystem compliance.</p><p> Future Plans: Potential mobile enhancements, agent optimizations, and community growth.</p><p></p><p>Marginal is now a complete, production-ready platform demonstrating decentralized AI compute. </p><p></p>
Tech Stack
Fundraising Status
<p>Nil</p>