Iva

A Grocery agent on Telegram that finds the cheapest basket across apps, and she pays for her own AI

Iva

Created At

ETHGlobal Mumbai

Winner of

0G

0G - Agents That Pay for Themselves

Project Description

Most AI agents stop working the day their owner stops paying the API bill. Iva pays her own.

Iva is a Telegram grocery agent for India. Send her a shopping list as text, a photo of a note or a voice note. She checks Blinkit, Swiggy Instamart and Zepto at your address, matches the same product across all three apps (different brands, names and pack sizes) and gives you the cheapest basket, the money you save and a link to each product. On a real 3-item list in Mumbai she found Zepto ₹213 vs Instamart ₹288, a ₹75 saving.

How she keeps herself alive: each hunt costs 0.2 0G, paid into Iva's own wallet. She verifies the payment on 0G mainnet, then signs depositFor on the 0G Payment Layer to top up her own 0G compute account. No human tops her up. On mainnet a customer paid 4.8 0G and 7 seconds later Iva deposited 1.6 0G into her compute. A hunt costs her about 0.02 0G, so she earns roughly 10x what she spends.

She reads her own balance before every job and picks the best brain she can afford: rich (glm-5.3 sealed in a TEE), lean (a model about 50x cheaper) or survival (no AI, still answers). Her API key has a 2 0G/day limit enforced by 0G, so she degrades instead of crashing.

People come back: /watch re-checks your list every morning, and /deals shows live deals near you for free. Every winning price is published to Arkiv as an entity that expires after 6 hours, because grocery deals only last hours. She can also do the whole job: say "order" and she fills your Zepto cart through Zepto's official MCP, shows Zepto's bill and orders only after you reply YES.

Without 0G, Iva can't understand your list, match products or pay for her own thinking. She would be a dumb keyword script.

How it's Made

A Node.js agent running 24/7 as a service, plus a Next.js 16 website on Vercel.

Shops: one shared headless Chrome (playwright-core) with an isolated context per shop and location. Instead of scraping HTML, we read the JSON that each shop's own search page fetches (Blinkit, Instamart, Zepto) and normalise it to one shape: price, MRP, pack, price per kg or piece, stock and link. Direct API calls are blocked by request signing and Cloudflare, so letting the real page do the fetch was the reliable route.

AI on 0G Private Computer: the 0G Router (OpenAI-compatible). glm-5.3 sealed in a TEE reads lists and matches products across shops, qwen3-vl-plus reads photos, qwen3-omni-flash reads voice notes, and qwen3.7-flash is the cheap "lean" brain. We read each call's request ID and cost from x_0g_trace, show them to the user and log them in an append-only receipts file.

Self-paying loop (viem on 0G mainnet): a treasury loop runs every 30 s and on every payment. It verifies the payment from its receipt (sent to Iva, succeeded, never claimed before), credits hunts, then calls depositFor on the 0G Payment Layer to top up her compute. Before each job she reads Router /account/funds and Payment Layer balanceOf to pick rich, lean or survival. The API key has a 0G-enforced daily credit_limit, and 402/429 responses drop her to survival instead of crashing.

Arkiv (Rabdi testnet, @arkiv-network/sdk): schema iva.deal.v1 with indexed city, item, shop, unit price and time. Each hunt publishes up to 12 entities in one batched tx with a 6-hour expiry, through a queue, after the user already has their answer. Reads filter on Iva's wallet as owner, so nobody can inject fake deals.

Zepto: an MCP SDK client for Zepto's official MCP server with OAuth (dynamic client registration + PKCE). It shows Zepto's bill, needs an explicit YES and never retries an order call.

Hacky bits: some wallets underprice gas on 0G and their transactions never land, so the pay page sends legacy transactions with a gas-price floor and waits for the receipt. OKX Wallet's in-app browser returns fake hashes on 0G, so users can also pay from any wallet and paste the hash into the bot.

background image mobile

Join the mailing list

Get the latest news and updates

Iva | ETHGlobal