Pintel

precision prediction markets on yellow network with off-chain matching & ens as a query engine

Pintel

Created At

HackMoney 2026

Winner of

ENS

ENS - Integrate ENS

Prize Pool

Project Description

Prediction markets are one of the few categories where crypto has found real product-market fit — $959M in open interest, $2.7B in weekly volume. But every major platform today runs on binary bets: yes/no, up/down. This kills precision. If the question is "ETH above 1900?" and Alice predicts 1880 while Bob predicts 2000, Alice loses everything despite being only $30 off the actual price of 1910. She's punished for being accurate but directionally wrong. The thresholds are arbitrary, and the payout model doesn't reward skill.

Pintel fixes this with Gaussian distribution positions. Instead of picking a side, traders set mu (their predicted value) and sigma (their confidence). Every position is a bell curve. Narrow sigma means high conviction — higher payout if right, nothing if wrong. Wide sigma is a safer hedge. The Gaussian PDF — exp(-z²/2) / (σ√2π) — is computed entirely on-chain using PRBMath SD59x18 fixed-point arithmetic. Payouts are proportional to each position's PDF evaluated at the Chainlink settlement price, divided by the sum of all PDFs. This is the only platform that rewards accuracy as skill.

Markets are deployed as ERC-1167 proxy clones through a factory contract. Each market is simultaneously registered as an ENS subdomain under pintel.eth. Market metadata — question, category, status, total pool, position count — is stored in ENS text records. This turns ENS into a query engine for market discovery. Any frontend or protocol can resolve market data directly through ENS without needing a subgraph or centralized indexer. Trader reputation (wins, accuracy, total payout) is also synced to ENS text records, creating portable on-chain identity.

Positions are tradeable through a Yellow Network-powered orderbook. Yellow Network's ERC-7824 state channels provide a fully off-chain order matching engine. Each trader opens a channel session with ClearNode (Yellow's hub node) over WebSocket. Bids and asks are placed and matched off-chain as signed state updates — zero gas for the entire orderbook flow. Only when a trade matches does transferPosition() execute on-chain to move ownership. Unlike centralized off-chain orderbooks where orders live on a company server, Yellow Network orders are cryptographically owned by traders as signed channel state. This gives Pintel a decentralized orderbook with on-chain settlement guarantees.

Market resolution is automated via Chainlink. Price feeds provide the settlement value and Chainlink Automation keepers call resolveMarket() when a market's endTime passes. No manual intervention required.

How it's Made

Smart contracts are written in Solidity 0.8.24 with Foundry. The core math library (GaussianMath.sol) implements the full Gaussian PDF on-chain — exp(-z²/2) / (σ√2π) — using PRBMath's SD59x18 fixed-point type for 18-decimal precision. This was the hardest part. Solidity has no native exponentiation or square roots for signed decimals, so every operation (exp, div, sqrt, mul) goes through PRBMath's SD59x18 wrappers. The L2 norm, scaled PDF, peak value, and minimum sigma constraints are all pure functions in this library.

PintelMarketFactory uses OpenZeppelin's ERC-1167 Clones to deploy markets as minimal proxies pointing to a single PintelMarket implementation. This keeps deployment gas low (~100k vs ~2M for full contracts). The factory also handles ENS integration — on createMarket(), it registers a subdomain under pintel.eth by calling the ENS registry and resolver directly. Market metadata (question, category, status, totalPool, positionCount) is written to ENS text records via the resolver. This means any dApp can query market data by resolving <label>.pintel.eth — no subgraph, no indexer, no backend. We also write trader reputation (wins, accuracy, payout) to ENS text records via syncReputationToENS(), making trader identity portable.

The Yellow Network integration uses ERC-7824 state channels for the position orderbook. The frontend opens a WebSocket connection to Yellow's ClearNode sandbox and authenticates via wallet signature. Each user gets a channel session with ClearNode as the hub. When a trader places a bid or ask, it's sent as a signed state update through the channel — no on-chain transaction, no gas. ClearNode matches orders across sessions. On match, the frontend calls transferPosition() on-chain to move ownership. The hacky part: ClearNode's sandbox uses hub-and-spoke topology, so direct bilateral channels between traders aren't possible. We work around this by having both traders communicate through ClearNode as intermediary, with market-specific routing via a market field in sync messages. Orders are discovered via get_app_sessions and routed to the correct market.

ChainlinkResolver registers each market with a Chainlink price feed address. It implements Chainlink Automation's checkUpkeep/performUpkeep interface — keepers automatically detect expired markets and call resolveMarket() with the live price. batchResolve() handles multiple markets in one tx.

Frontend is Next.js 15 (App Router) with wagmi v2 for contract reads/writes, ConnectKit for wallet connection, and Recharts for the Gaussian curve visualization. Position forms let users drag sliders for mu and sigma and see their bell curve overlaid on the market's aggregate distribution in real time. Tailwind CSS v4 with Framer Motion for card hover effects.

The particularly hacky bits:

  • Computing e^(-x²) in Solidity with 18-decimal precision using chained PRBMath operations
  • Using ENS text records as a pseudo-database for market indexing — treating ENS as a read layer instead of just a naming service
  • Hub-and-spoke state channel orderbook where traders never open direct channels but still trade P2P through ClearNode routing
  • Minimal proxy clones + ENS subdomain registration in a single transaction

Deployed Contracts (Sepolia):

  • PintelMarket (impl): 0xe8fAe54b3358bF79C09b82D140B212828971f52B
  • PintelMarketFactory: 0xE41D71CE0F5C2A26946eE999C33B5a523F151759
  • ChainlinkResolver: 0xd480c456A7CbbDE3F209170bB587A977e1A5CFcf
  • MockERC20 (collateral): 0xEb2927E0274d4A1D52685610bf256468b79EEa4d
background image mobile

Join the mailing list

Get the latest news and updates

Pintel | ETHGlobal