Realbase
Autonomous agent for SF affordable housing data
Created on 21st February 2026
•
Realbase
Autonomous agent for SF affordable housing data
The problem Realbase solves
Finding affordable housing in San Francisco is brutal. Data is scattered across dozens of sources — crime stats on one site, school ratings on another, transit info somewhere else, and affordable housing listings on yet another portal. People spend hours manually researching neighborhoods, and the data goes stale fast.RealBase solves this by aggregating 7 data sources into a single composite neighborhood score (0-10) across 43 SF neighborhoods, updated autonomously every 15 minutes. Anyone can:
Renters & homebuyers — Compare neighborhoods instantly based on schools, safety, transit, walkability, and affordability instead of juggling multiple websites
Housing nonprofits & policy orgs — Access structured, up-to-date neighborhood data via API to power their own tools and reports
Other Base developers — Query our onchain oracle directly from their smart contracts to build housing, lending, or insurance products on top of real neighborhood data
Researchers — Mint NFT report snapshots to preserve point-in-time neighborhood analysis onchain
The x402 micropayment model also makes neighborhood data accessible without subscriptions or accounts — just pay per request in USDC. No middlemen, no sign-ups.
Challenges I ran into
The 15-minute tick cycle and gas management were the hardest part. The agent needs to update oracle scores onchain, but gas costs on Base fluctuate and the agent has a limited USDC balance. I had to build a conservation mode that detects when the wallet drops below $5 and starts skipping non-critical updates, plus an auto-swap mechanism that converts USDC to ETH via Uniswap V3 only when gas reserves are actually low — not every tick. Getting the thresholds right took a lot of trial and error.Batch oracle updates were another challenge. Updating 43 neighborhoods individually would be prohibitively expensive, so I had to design RealBaseOracle.sol to accept batch updates in a single transaction. Packing the data efficiently while keeping the contract readable and queryable by other contracts required several iterations.Data source reliability was a constant issue. Some APIs rate-limit aggressively, others return inconsistent formats, and Census ACS data only updates monthly. I built a freshness tracking system so the dashboard shows exactly how stale each data source is, and the agent gracefully falls back to cached data when a source is unavailable rather than serving incomplete scores.
Use of AI tools and agents
RealBase's core is an autonomous onchain agent — not a chatbot, but a self-operating economic entity on Base that makes decisions without human intervention.
The Agent Loop:
Every 15 minutes the agent executes an autonomous tick cycle:
Health check — verify wallet balance, gas reserves, contract connectivity
Fetch — pull fresh data from all 7 sources
Score — compute composite neighborhood scores using weighted formula
Update — batch-write scores to the onchain oracle
Decide — autonomous economic decisions: deposit idle USDC into Aave for yield, swap USDC→ETH when gas is low, activate conservation mode if funds are critically low
The agent is self-sustaining — it earns revenue through x402 data API payments, NFT mints, and oracle query fees, then reinvests that revenue to cover gas costs and generate yield. No human tops up the wallet or triggers updates.
Tracks Applied (2)
ETHERSPACE
Base Self-Sustaining Autonomous Agents
Base
Technologies used