Technical Whitepaper
Prediction markets turn collective opinion into probability estimates for real-world events. They've proven more accurate than polls, pundits, and most forecasting models. But existing platforms force users into a brutal tradeoff: either accept a centralized operator who can censor markets and freeze funds, or use a public blockchain where every trade is visible, front-runnable, and expensive.
Yogen takes a different path. Built on Canton Network with Daml smart contracts, Yogen delivers a fully decentralized prediction market with privacy-preserving transactions, sub-second finality, and zero MEV exposure. Users trade binary outcome shares through a Constant Product Market Maker (CPMM), with prices determined algorithmically and settlement handled trustlessly through on-chain escrow.
This paper describes Yogen's architecture, its AMM mechanism, the oracle resolution system, the security model validated through formal audit, and the Canton Network integration that makes it all possible without the tradeoffs that plague Ethereum-based alternatives.
Prediction markets aggregate dispersed information into a single price signal. When a "Will BTC exceed $100K by March?" contract trades at $0.72, the market collectively assigns a 72% probability to that outcome. Research from the University of Iowa's Electronic Markets and studies by Arrow et al. (2008) consistently show these mechanisms outperform expert forecasts across domains—elections, economic indicators, sporting events, and technology adoption timelines.
Centralized platforms like Kalshi and (the old) Polymarket operate under regulatory constraints that limit market creation, require KYC for every user, and maintain full custody of funds. They work, but they're gatekept.
Decentralized alternatives on Ethereum solve the custody problem but introduce new ones:
Yogen eliminates these tradeoffs by building on Canton Network—a privacy-first, enterprise-grade distributed ledger where only counterparties see transaction details. There's no public mempool to front-run, no gas auction to win, and finality happens in under a second.
The platform uses virtual currency (Canton Coin, or CC) distributed through a faucet, lowering the barrier to entry to zero. Users get 1000 CC on signup and can start trading immediately. No wallet setup, no token purchase, no friction.
| Component | Technology | Rationale |
|---|---|---|
| Frontend | Next.js 16, React 19, TypeScript | Server components, streaming SSR, type safety |
| Styling | TailwindCSS 4 | Utility-first, zero runtime CSS |
| Database | Supabase (PostgreSQL) | Row-Level Security, real-time subscriptions |
| Blockchain | Canton Network | Privacy, no MEV, sub-second finality |
| Smart Contracts | Daml | Formally verifiable, no reentrancy by design |
| Wallet | Embedded + Zoro SDK | Zero-friction onboarding + self-custody option |
| Oracle | Multi-source engine | Redundancy, cross-validation, manipulation resistance |
| Deployment | Vercel | Serverless, edge network, automatic scaling |
A typical trade flows through the system:
TokenEscrow contractTokenEscrow.ReleaseWithPayoutYogen uses a Constant Product Market Maker, the same core model that powers Uniswap and other leading DEX protocols. Each binary market maintains two liquidity pools: one for YES shares and one for NO shares.
Where k remains constant (before fees) across all trades. This guarantees that the market always has liquidity—there's never a situation where a user can't buy or sell.
Every new market is seeded with 1000 CC of virtual liquidity, split evenly:
This gives an initial price of 0.50 for both outcomes (50/50 probability), which is the maximum-entropy starting point when no information favors either side.
The price of an outcome share reflects the current pool ratio. Following the corrected formula from the security audit (finding L3):
Note that P(YES) + P(NO) = 1 always holds, which is a necessary property for a coherent probability market.
Why no_pool / total for YES price? When demand for YES shares is high, the yes_pool shrinks (shares are removed) and the no_pool grows (the other side absorbs the trade). A smaller yes_pool relative to no_pool means P(YES) increases—correctly reflecting higher demand pushing the price up.
When a user buys shares on a given side, the platform applies a 2% fee first, then calculates shares received:
Where sidePool is the pool corresponding to the outcome being purchased, otherPool is the opposing pool, and shares is the number of outcome shares the user receives.
Larger trades move the price more—a 10 CC bet in a 1000 CC pool barely shifts the price, but a 500 CC bet shifts it dramatically. This is natural slippage, and it's a feature: it makes price manipulation expensive.
The 2% fee is applied to the proceeds. Selling also experiences slippage—dumping a large position yields progressively worse prices per share.
Consider a market "Will ETH hit $5000 by March?" with current pools:
yes_pool = 400, no_pool = 600
P(YES) = 600 / 1000 = 0.60
P(NO) = 400 / 1000 = 0.40
Alice wants to buy 100 CC worth of YES shares:
fee = 100 × 0.02 = 2 CC
amountAfterFee = 98 CC
shares = 98 × 600 / (400 + 98)
= 58,800 / 498
≈ 118.07 YES shares
Alice now holds 118.07 YES shares at an effective cost of ~0.83 CC each. If the market resolves YES, each share pays out proportionally from the losing pool.
The 2% fee serves two purposes:
k and deepening liquidity over time.This isn't an anti-Ethereum stance—it's an engineering decision. For prediction markets specifically, Canton solves problems that Ethereum architecturally can't:
| Problem | Ethereum | Canton |
|---|---|---|
| Trade privacy | Every trade visible on-chain | Only counterparties see details |
| Front-running (MEV) | ~$600M extracted annually | Impossible by design |
| Finality | ~12 min (probabilistic) | Sub-second (deterministic) |
| Smart contract bugs | Reentrancy, overflow, etc. | Prevented by Daml's type system |
| Regulatory compliance | Pseudonymous, hard to comply | Privacy + compliance by design |
Canton uses a sub-transaction privacy model. When Alice buys YES shares from the AMM:
There's no public mempool. There's no block explorer showing every trade. Other users see the result (updated prices) but not who traded or how much.
Miner Extractable Value (MEV) is impossible on Canton because there's no public transaction ordering step. On Ethereum, validators choose which transactions to include and in what order—creating opportunities for sandwich attacks, front-running, and back-running.
Canton's consensus processes transactions through a sequencing layer that doesn't expose pending transactions to third parties. You can't front-run what you can't see.
For prediction markets, this matters enormously. Imagine a whale placing a $50,000 bet on a political outcome. On Ethereum, bots would see this pending transaction, buy ahead of it, and extract value. On Canton, the trade executes privately and atomically.
Daml is a purpose-built smart contract language created by Digital Asset. It compiles to a formally verified execution model (Daml-LF) and prevents entire classes of vulnerabilities by construction:
Canton Network's participant list includes Goldman Sachs, BNY Mellon, BNP Paribas, Broadridge, and others. This means the network has enterprise-grade infrastructure, SLAs, and regulatory engagement that pure crypto chains don't. For Yogen, this translates to a path toward regulated prediction markets without rebuilding the infrastructure layer.
The token system uses three core contracts:
TokenAccount holds a user's CC balance. Requires dual signatories (issuer + owner), meaning neither the platform nor the user can unilaterally move funds.
template TokenAccount
with
issuer : Party
owner : Party
balance : Decimal
where
signatory issuer, owner
TokenEscrow locks tokens for active bets. When a user places a trade, their CC moves from TokenAccount into TokenEscrow. The tokens can't be spent, withdrawn, or moved until the market resolves.
TokenAccountFactory manages token creation with a supply cap, preventing inflation and ensuring total CC in circulation never exceeds the defined ceiling.
Trades follow a propose-accept pattern with built-in protections:
BetProposal specifying the market, side, amount, and maxPrice (slippage tolerance)maxPricemaxPrice between proposal and execution, the trade is rejected and escrow is releasedThe PayoutPool contract manages post-resolution distribution: collects all escrowed tokens from a resolved market, calculates proportional payouts to winning positions, processes withdrawal requests through TokenEscrow.ReleaseWithPayout, and enforces the conservation invariant.
Yogen doesn't trust any single data source. The oracle resolution engine queries multiple independent sources and requires consensus before resolving a market:
| Source | Data Types | Examples |
|---|---|---|
| CoinGecko | Cryptocurrency prices | BTC, ETH, SOL price targets |
| Strykr Prism API | Crypto, markets, sentiment | Fear & Greed index, funding rates |
| ESPN | Sports outcomes | Game winners, scores, championships |
| FRED | Economic indicators | GDP, unemployment, interest rates |
| Custom API | Specialized data | Platform-specific metrics |
A single data point isn't enough. The oracle requires multiple consecutive confirmations from the same source before triggering resolution. This guards against API glitches, flash crashes that reverse quickly, and temporary data feed disruptions.
For price-based conditions (e.g., "BTC above $100K"), the oracle checks whether the condition holds across several polling intervals. Only after N consecutive confirmations does it mark the market as resolved.
The oracle supports a composable set of condition primitives:
price_above(asset, threshold) — Asset price exceeds thresholdprice_below(asset, threshold) — Asset price falls below thresholdteam_wins(team, game) — Sports team wins specific gamevalue_above(indicator, threshold) — Economic indicator exceeds thresholdfear_extreme_greed — Fear & Greed index enters extreme greed zone (>75)Each data source has independent rate limits configured to respect upstream API constraints. The oracle engine staggers requests and implements exponential backoff on failures. Rate limit state is persisted in PostgreSQL so it survives serverless cold starts—a detail that matters when your infrastructure is Vercel functions that can spin down between requests.
Admin-created markets support manual resolution as a fallback. This covers edge cases that automated oracles can't handle—"Will Congress pass bill X?" or "Will company Y launch product Z?" An admin with authenticated session access can trigger resolution with appropriate documentation.
Yogen underwent a security review that identified and addressed several vulnerability classes:
sidePool / totalPool, which inverted the price relationship. The corrected formula noPool / totalPool for YES price properly reflects supply-demand dynamics. Caught before mainnet deployment.TokenAccountFactory enforces a hard cap on total CC in circulation.Every token operation requires both the issuer and the owner to sign:
This eliminates admin key compromises, rug pulls, and unauthorized transfers—exploits that have collectively cost billions on other chains.
All bets are fully collateralized through the escrow pattern:
TokenAccount → TokenEscrow before the trade executesReleaseWithPayoutThere's never a moment where a bet exists without backing funds. The system can't become insolvent.
CC is Yogen's virtual currency—a unit of account within the prediction market ecosystem.
| Property | Value |
|---|---|
| Name | Canton Coin (CC) |
| Initial distribution | 1000 CC per user via faucet |
| Faucet cooldown | 2 minutes between claims |
| Supply | Capped via TokenAccountFactory |
| Tradability | Internal to Yogen platform |
| Trading fee | 2% on all trades |
The 2% trading fee flows into the PayoutPool system and is used for liquidity pool deepening (increasing k), platform operation costs, and future liquidity provider incentives.
The default experience uses an embedded wallet that removes all friction from onboarding:
yogen_xxx identifierFor users who want full control, Yogen integrates the Zoro SDK:
Planned wallet integrations include Dfns (MPC key management), C8 Enterprise Wallet (institutional custody), and 5N Loop (Canton-native). Each follows the same interface: the wallet signs transactions locally, the platform never holds keys.
When a market's condition is met (oracle confirms or admin resolves), the market status transitions from active → resolved, the winning outcome is recorded on-chain, and the settlement engine activates.
Winners receive proportional payouts from the total pool minus the 2% protocol fee:
The conservation invariant ensures:
No payout can exceed what's actually in the pool. This is enforced at both the application layer and the smart contract layer.
Fund movement happens through Canton atomically:
TokenEscrow contracts for winning positions execute ReleaseWithPayoutTokenAccount contractsThe entire settlement is atomic—either all payouts process or none do. No partial settlement state.
Prediction markets work. The research is clear, the track record is strong, and the demand is obvious. What's been missing is infrastructure that doesn't force users to choose between centralized convenience and decentralized sovereignty—or between privacy and transparency.
Yogen doesn't split that difference. It removes the tradeoff entirely. Canton Network provides the privacy, finality, and safety guarantees that prediction markets need. Daml prevents the smart contract bugs that have cost the broader crypto ecosystem billions. The CPMM mechanism provides continuous liquidity with well-understood mathematical properties. And the multi-source oracle system ensures markets resolve based on verified real-world outcomes, not a single point of failure.
The platform is live. The contracts are audited. The math checks out.
Trade what you know at yogenmarket.com.