All projects

Sonder

Sonder is a lending protocol that allows users to borrow USDC against their Polymarket prediction market shares (YES/NO tokens) as collateral.

DeFi & Tokenization CRE & AI Prediction Markets Risk & Compliance Tenderly

What it is

Typically, prediction market shares (ERC-1155) are vault shares minted to the bettor in exchange for their USDC. This is a great model, but the only problem is that most prediction markets often take a long while before they are resolved, thats USD value locked for that same amount of time. One of the most popular markets right now on Polymarket is "Democratic Presidential Nominee 2028" with $758M Vol locked resolves Nov 7, 2028. That is $758M locked away from circulation for about 2 years.

I am solving this problem with sonder, a lending protocol that allows users to borrow USDC against their Polymarket prediction market shares (YES/NO tokens) as collateral. with select markets live on the protocol currently it allows shareholders of select market borrow up to 40% of the value of the shares they hold.

Here's exactly how it works.

  1. User buys into a prediction market. YES/NO shares worth $1,000 at the time of purchese (Now user has $1,000 locked, that he cannot use.)
  2. User hears about sonder, visits the application and connects their wallet that holds the market shares.
  3. Sonder reads the wallet and discovers selected market shares held by the user, calculates the value by fetching real time price from polymarket and offering up to 40% of the entires shares value in USDC.
  4. User accepts offer with interest and is credited $400 USDC
  5. Health and safety checks are performed at intervals to ensure platform safety with position liquidation check and execution all orchestrated and handle by the chainlink CRE
  6. User receives emails on health status, liquidation warnings and liquidation executions.
  7. User can repay loan with interests and creclaim their share holdings.

This provides values for heding positions, emergency funds, and other investment opportunity user may come about.

Visit - https://cute-malasada-aa7a8a.netlify.app/ for detailed flow.

How it Works

Sonder runs on a hybrid architecture — part on-chain DeFi, part decentralized off-chain intelligence, stitched together with Chainlink CRE and Google Gemini.

  1. The Decentralized Intelligence Layer (Chainlink CRE)
    The core of Sonder's autonomous risk engine is a TypeScript workflow compiled to WebAssembly and run across Chainlink's Decentralized Oracle Network (DON). Think of it as a distributed brain that never sleeps.
    A CRE CronCapability kicks the workflow on a regular schedule. From there, the DON pulls live asset prices straight from the Polymarket CLOB API and community sentiment from the Gamma API — no intermediaries, no hand-holding. When it spots a price swing worth acting on, the CRE EVMClient broadcasts an updatePrice() transaction signed by the oracle network's consensus mechanism, not a centralized hot wallet sitting on someone's server.
  2. The AI Guardian (Google Gemini)
    If the CRE workflow catches a severe price anomaly — say, a sudden 10%+ drop — it doesn't just react. It thinks first.
    Before anything hits the chain, we run an off-chain AI Guardian pipeline using Google Gemini (Flash 2.5), wired directly into the CRE workflow. Gemini gets the raw numbers and the qualitative context: recent Polymarket comments, community chatter, the works. We also use Google Search Grounding, so Gemini can cross-reference the anomaly against real-world news in real time. Is this genuine market panic, or just noise? The model returns a deterministic JSON verdict before any action is taken.
  3. Smart Contracts (Solidity + Run Environment)
    The lending protocol is written in Solidity (^0.8.24) and deployed on a Tenderly Virtual TestNet forking Polygon mainnet — giving us gasless, fast iteration against real-world state.
    The architecture has two key contracts working in tandem. The Vault holds users' ERC-1155 Polymarket YES/NO tokens as collateral. The LendingPool handles everything else: USDC deposits, borrows, health factor tracking, and liquidations. Both are built with Foundry and OpenZeppelin (ERC20, ERC1155, ReentrancyGuard).
    One thing we're genuinely proud of: instead of the standard utilization-based interest model, we built a Probability-Based Interest Rate Model. Your borrowing rate is tied directly to the implied probability of your Polymarket collateral's outcome. The riskier your position, the more that's reflected in what you pay.
  4. The Execution Layer (Off-chain Watcher)
    While CRE handles the decentralized intelligence, a TypeScript daemon runs a tight autonomous loop using Bun — monitoring health factors and listening for risk events bubbling up from the contracts.

When a user's health factor dips below the warning threshold, the watcher fires a formatted HTML email alert via the Resend API, immediately. If things get worse and a position becomes liquidatable, the executor steps in and finalizes the on-chain collateral seizure.

Links

Created by

  • Nwachukwu Michael