Loops House




ProofMarket
Autonomous storage budget triage on Filecoin — reads its own runway, pauses the lowest-priority dataset when the budget gets tight.

FilecoinTLDR Builder Challenge - Cycle 4
Links
Team
1 member- PROwner
Prasad Kapure
Overview
ProofMarket is an autonomous storage budget triage agent for the FilecoinTLDR Builder Challenge — Cycle 4. Every read and every action is signed by the user's own wallet on Calibration testnet — no demo account, no mock data.
THE PROBLEM Storage agents on Filecoin answer one question: "Can I afford to keep storing this?" ProofMarket answers a better one: "Which of my datasets is worth protecting when I can't afford all of them?"
HOW IT WORKS The agent reads its own USDFC balance, lockup rate, and runway (in epochs) directly from Filecoin Pay via the Synapse SDK using the connected wallet. Each user-owned dataset has a declared_value (priority 1–10) set by the owner. The triage rule is simple:
- Runway ≥ 100M epochs → do nothing (HEALTHY)
- Runway < 100M epochs → terminate the payment rail of the dataset with the lowest declared_value (CRITICAL)
- Paused dataset + recovered runway → decide whether resuming is safe (RESUME_SAFE / RESUME_AVAILABLE / RESUME_INSUFFICIENT)
FIVE DISTINCT OUTCOMES — every one reachable from the live UI:
- healthy — no action, runway is fine
- critical — pause the lowest-priority dataset
- resume_safe — runway is healthy enough to bring the dropped dataset back
- resume_available — runway recovered, resume is feasible
- resume_insufficient — runway recovered but resuming would re-violate the threshold, so the agent refuses and explains why
EVERY ACTION IS ONCHAIN, SIGNED BY THE USER
- Pause = Warm Storage terminateService call, signed by MetaMask, confirmed on Filfox
- Resume = new onchain data set + payment rail, signed by MetaMask
- Deposit / Withdraw = real USDFC transfers to Filecoin Pay, signed by MetaMask
- Create datasets = real PDP upload + createDataSetAndAddPieces, signed by MetaMask
- Claude (via OpenRouter) explains every decision in natural language, with a rules-based fallback so the agent never depends on an external API
WALLET-MODE DEMO FLOW
- Open the dashboard and connect MetaMask on Calibration testnet
- Top up 10 USDFC → real transfer, real tx hash, visible on Filfox
- Click "Create demo datasets" → uploads 2 onchain datasets with priorities 9 and 3
- Click "Check now" → outcome is HEALTHY at full runway
- Click "To critical" → withdraws everything above the 100M-epoch threshold
- Click "Check now" → outcome flips to CRITICAL, picks the lower-priority dataset
- Click "Pause" → MetaMask signature → tx confirmed on Filfox
- Visit the Verification tab → see the full onchain history scoped to your wallet, with tx hashes and Filfox links
SCALABILITY / SCOPE HANDLING
- Datasets are persisted per-address in the backend (datasets-{addr}.json) and mirrored in localStorage for instant load
- Interventions are persisted per-address (interventions-{addr}.json) and shown only for the connected wallet
- Disconnecting the wallet falls back to the demo account's history, so the Verification page is informative with or without MetaMask
- Error class detection — if a pause was already terminated onchain (e.g. receipt didn't reach the client), the next attempt is caught as DataSetPaymentAlreadyTerminated and the local state is reconciled to match reality instead of showing a raw revert error
STACK TypeScript · React · Vite · Tailwind CSS · Express · viem · @filoz/synapse-sdk · @filoz/synapse-core · wagmi · RainbowKit · OpenRouter · Claude · Filecoin Calibration testnet (chain ID 314159)
LINKS
- Live demo: https://proof-market-pink.vercel.app
- Source: https://github.com/pk1427/ProofMarket
- Backend: https://proofmarket-1.onrender.com