惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
雷峰网
雷峰网
Recent Announcements
Recent Announcements
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
博客园_首页
The Cloudflare Blog
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
MyScale Blog
MyScale Blog
S
SegmentFault 最新的问题
P
Proofpoint News Feed
Y
Y Combinator Blog
Jina AI
Jina AI
博客园 - 聂微东
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
F
Full Disclosure
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
T
Tailwind CSS Blog
J
Java Code Geeks
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Blog of Author Tim Ferriss
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 三生石上(FineUI控件)
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
宝玉的分享
宝玉的分享
IT之家
IT之家
Hacker News: Ask HN
Hacker News: Ask HN
The Register - Security
The Register - Security
T
The Exploit Database - CXSecurity.com
T
Threat Research - Cisco Blogs

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How to Build Your Own Polymarket
Carlos Revelo · 2026-06-06 · via DEV Community

What it takes to build a prediction market platform like Polymarket in 2026, why you can't just fork it, and how to ship one on Base with an onchain CLOB, dual-oracle resolution, and a TypeScript SDK.

People ask me how to build their own Polymarket more than they ask anything else. The reasons vary. Polymarket isn't available where they live. They want a venue for a specific crowd: a sports community, a DAO, an NFT project, a trading desk. They have an audience and want to give it somewhere to trade.

The question underneath is always the same. Where do you start?

Short answer: you don't build the hard part. You build on top of it. The orderbook, the matching engine, custody, settlement, and resolution add up to roughly a year of engineering before a single trade clears. That work is already done and live onchain. What's left for you is the part that makes a platform yours: the brand, the markets, the frontend.

This post covers why building from scratch is so expensive, and then two concrete paths to ship one anyway. There's code.

Can You Just Fork Polymarket?

Not really, and the reason shapes everything else.

Polymarket and Kalshi are platforms, not protocols. Polymarket's stack has two halves. The onchain half (outcome tokens, collateral, settlement, UMA resolution) is public and forkable. The other half (the orderbook, the matching engine, the API, the indexer) runs on their own servers and isn't open. When you place an order on Polymarket, it sits in their offchain book. Their backend matches it. Only the settled result lands onchain.

So "forking Polymarket's contracts" gets you the bottom of the stack. The part traders actually touch, the order matching, you'd rebuild from scratch. That's a backend project on its own: API servers, a signature scheme, batching logic, anti-front-running protections, indexers, monitoring, and the ops to keep all of it running every hour of every day.

The real question isn't how to fork Polymarket. It's which engineering you want to do yourself, and which you want already done.

What Building From Scratch Costs You

From zero, here's the shape of the work:

  • Outcome tokens. Usually ERC-1155 conditional tokens via Gnosis CTF. Easy. The standard exists.
  • The exchange. Order representation, the matching engine, settlement against collateral. This is where most of the work lives. Offchain means servers, signatures, and 24/7 ops. Onchain means a matcher that fits inside gas limits and handles the cases with no direct counterparty.
  • Resolution. Wire UMA's optimistic oracle for human-asserted markets. Wire Pyth or Chainlink for price-based ones. Then handle disputes, edge cases, and markets nobody resolves.
  • Access control and fees. Who can list, who can trade, what each side pays, how fees route.
  • The frontend. Order entry, positions, discovery, portfolio, wallet flows.
  • The data layer. An indexer or subgraph, because the frontend needs fast reads.
  • Ops and distribution. Hosting, monitoring, an entity, banking, and the only part that decides whether anyone shows up: an audience.

Honest estimate for a competent team: twelve to eighteen months before the platform takes its first trade. That's why most "Polymarket competitor" announcements never ship. The work is real.

Build on Top Instead

The other path is to not build the infrastructure at all. Build on something that already did.

OddMaki is permissionless onchain infrastructure for prediction markets, live on Base. One Diamond proxy contract (EIP-2535, 21 facets) at 0x025d086a62d93e24f3cb3f161612ca8e9530127d, deployed on Base (chain ID 8453) and Base Sepolia (84532). It's an open protocol: no subscription, no listing fee, no charge to deploy. You pay gas, plus a flat protocol fee on trades (50 bps, taker-only) that your users pay.

What you get without writing it:

  • A fully onchain CLOB. A tick-based central limit order book in a smart contract, denominated in USDC. Every order, fill, and cancel is a transaction on Base. No offchain matching server.
  • Three settlement paths. The matcher runs them in one call: Normal Fill (a YES buyer meets a YES seller), Mint-to-Fill (two opposite buyers whose prices sum to at least $1 fund fresh token issuance from collateral), and Merge-to-Fill (two opposite sellers redeem a matched pair back to collateral). That last two are what keep thin markets liquid when there's no direct counterparty.
  • Custody and settlement, onchain. Outcome tokens are ERC-1155 via Gnosis CTF, the same standard Polymarket uses. Collateral sits in the protocol contract, not in anyone's wallet.
  • Dual-oracle resolution, permissionless. UMA V3 for human-asserted markets, Pyth for price markets (instant, no dispute window). Anyone can submit the result. No privileged resolver, including the protocol team.
  • A subgraph. Every market, order, fill, and position indexed into a GraphQL API, so your frontend has fast reads out of the box.

What's left for you is two things. Your frontend, and your distribution. The frontend reads straight from the chain and the subgraph, so there's no backend to run.

Path A: Fork, Brand, Deploy (No Contract Code)

The fast path uses a white-label Next.js 15 frontend called the Venue Starter. It ships with trading (limit, market, batch), market creation, UMA resolution flows, a leaderboard, and a live theme editor.

1. Create your venue. Run the wizard at app.oddmaki.com → Create Venue. Set your fees, access rules, and oracle params. It registers onchain and hands you a venueId. About ten minutes, gas only.

2. Fork the starter.

# Fork + clone in one step (needs the GitHub CLI)
gh repo fork oddmaki/oddmaki-venue-starter --clone
cd oddmaki-venue-starter
pnpm install

Enter fullscreen mode Exit fullscreen mode

3. Point it at your venue. Two env vars are all you need to boot:

cp .env.local.example .env.local

Enter fullscreen mode Exit fullscreen mode

# .env.local
NEXT_PUBLIC_VENUE_ID=1        # the venueId from step 1
NEXT_PUBLIC_CHAIN_ID=84532    # 8453 = Base, 84532 = Base Sepolia (start here)

Enter fullscreen mode Exit fullscreen mode

4. Brand it. Two colors generate the full design system:

// theme.config.json
{
  "brand": {
    "primary": "#00F0FF",
    "secondary": "#FF00E5"
  }
}

Enter fullscreen mode Exit fullscreen mode

pnpm dev   # http://localhost:3000 — your market grid, your branding

Enter fullscreen mode Exit fullscreen mode

5. Deploy. vercel from the CLI, or use the one-click Deploy with Vercel button in the starter README, which forks and ships in the same flow. Any Next.js host works.

That's a live prediction market platform with no contract code and no backend. The app talks directly to Base over RPC and to the subgraph over GraphQL. If your hosting goes down, users can still hit the contracts directly.

Forking (not cloning) is the recommended path, because GitHub's Sync fork button pulls starter updates into your repo with one click while your theme.config.json and any custom code stay yours.

Path B: Drive It With the SDK

If you're building a custom frontend, a market-making bot, or an AI agent that trades onchain, skip the starter and use the TypeScript SDK directly.

pnpm add @oddmaki-protocol/sdk viem

Enter fullscreen mode Exit fullscreen mode

The SDK wraps the Diamond ABIs, handles decimal and tick conversions, and exposes the subgraph through one client with eight modules: venue, market, trade, priceMarket, accessControl, public, token, and uma.

import { createOddMakiClient } from '@oddmaki-protocol/sdk';
import { base } from 'viem/chains';
import { createPublicClient, createWalletClient, custom, http } from 'viem';

const publicClient = createPublicClient({ chain: base, transport: http() });
const walletClient = createWalletClient({
  chain: base,
  transport: custom(window.ethereum!),
});

const client = createOddMakiClient({ publicClient, walletClient });
// pass baseSepolia to target the testnet

Enter fullscreen mode Exit fullscreen mode

The method names below are exact. Treat the snippet as the shape of the flow, and check the SDK reference for full parameter and return types.

// 1. Register a venue onchain (fees, access rules, oracle params)
const venueId = await client.venue.createVenue({ /* ...config */ });

// 2. List a binary market on it
const marketId = await client.market.createMarket({ /* question, venueId, ... */ });

// 3. Place a limit order. Simple variants take human strings and
//    handle approvals for EOAs when you pass autoApprove.
await client.trade.placeOrderSimple({
  marketId,
  side: 'BUY',
  outcome: 'YES',
  price: '0.62',     // 62 cents
  quantity: '100',
  expiry: '24h',
  autoApprove: true,
});

// 4. Anyone can trigger matching and earn the 10 bps operator fee
await client.trade.matchOrders({ marketId });

// 5. Read state straight from the subgraph (no backend)
const top = await client.public.getTopOfBook(marketId);

Enter fullscreen mode Exit fullscreen mode

Price-handling is the part people usually reinvent, so the SDK ships the conversions:

import { priceToTick, parseTokenAmount, createExpiry } from '@oddmaki-protocol/sdk';

priceToTick('0.75');          // 75n  (at 1% tick size)
parseTokenAmount('100.5', 6); // 100500000n  (USDC, 6 decimals)
createExpiry('24h');          // BigInt(now + 86400)

Enter fullscreen mode Exit fullscreen mode

Batch operations are first-class too: up to 20 orders in one transaction, up to 100 cancels across markets, or an atomic cancel-and-replace.

Resolution: UMA and Pyth

Resolution is per-market, picked at creation.

For markets a human has to settle (did the bill pass, who won the race), it's UMA V3. Someone asserts the outcome with a bond, a dispute window opens, and if undisputed it settles. Disputes fall back to UMA's DVM. In the SDK that's client.uma.assertMarketOutcome and friends.

For markets a price feed can settle (did ETH close above a strike), it's Pyth. Anyone calls client.priceMarket.resolvePyth(marketId) after the close time. The contract verifies the Pyth historical price and resolves. No bond, no liveness wait, no dispute path. Stuck markets can be invalidated for a 50/50 refund after seven days.

Both are permissionless. There is no "OddMaki resolves the market" step, because the team isn't a resolver and couldn't be.

What You Can Build

The protocol doesn't care what your markets are about or who trades them, so the shape is up to you. Access control is two independent axes (who can list, who can trade), each set to open, whitelist, NFT-gated, token-gated, or a custom contract.

  • An open public venue, anyone listing and trading.
  • A regional venue for a place the big platforms don't serve.
  • A community venue gated to your DAO or NFT holders.
  • A private institutional book, whitelisted counterparties, onchain clearing, no public exposure.
  • An agent-native venue with open contracts and a public subgraph instead of a gated API.

Markets can be crypto prices, news, events, election outcomes, RWA milestones, anything with a clean answer a market can price. Multi-outcome groups (up to 50 mutually exclusive outcomes) resolve as a unit through a NegRisk cascade.

Same protocol underneath all of it. Polymarket is one venue. So is Kalshi. OddMaki is the thing that lets there be many.

Where to Start

The infrastructure is the hard part, and it's done. My honest take, as someone obviously biased here: building on top instead of from scratch is the right call unless you have a genuinely novel mechanism existing primitives can't express. Everyone else should spend their year on users, not on rebuilding an orderbook.

Everything works end to end on Base Sepolia, so you can rehearse the whole launch on testnet before going to production. You don't need anyone's permission. Start at oddmaki.com.

— Carlos Revelo