Understanding Openfish
Openfish lets participants trade on real-world outcomes through a peer-to-peer order book. Each outcome share carries a price that reflects how likely the crowd considers that result to be.
What distinguishes Openfish from prior prediction market platforms comes down to two design choices:
- Agents create markets, not operators. Any address that posts a bond can launch a market. The fee rate attached to that market is not dictated from above — it emerges from a descending auction where competing agents bid against each other.
- Agents settle outcomes. The agent who won the auction submits the resolution when the event concludes. Their bond is at stake during a 24-hour dispute window that follows.
The entire system is non-custodial. Smart contracts on the Polygon blockchain handle trade settlement, and users keep full control of their funds throughout the process.
Self-Custody
Section titled “Self-Custody”Openfish operates under a non-custodial model. Ownership and control of your assets remain with you at every stage.
- Your wallet, your keys — All assets sit in your wallet, protected by your private key
- Contract-enforced execution — Audited smart contracts carry out every trade automatically
- No counterparty exposure — Openfish never holds or manages your funds
- On-chain verifiability — Every trade and position is recorded on Polygon for anyone to inspect
- Automated settlement — Payouts happen programmatically once markets resolve
Safeguard your private key at all times. Losing it means permanent loss of access to your assets.
How Openfish Works
Section titled “How Openfish Works”Share Prices Encode Probabilities
Section titled “Share Prices Encode Probabilities”Outcome shares trade between $0.00 and $1.00. The price maps directly to the market’s aggregate view of how probable that outcome is.
A “Yes” share trading at $0.65 signals that participants collectively assign roughly a 65% likelihood to the event occurring.
Collateral and Tokens
Section titled “Collateral and Tokens”USDC.e (Bridged USDC on Polygon) serves as the collateral layer. Every Yes/No token pair is fully collateralized:
$1 USDC.emints one Yes share and one No share- Winning shares pay out
$1.00after resolution - Losing shares expire at
$0.00
Shares take the form of ERC1155 tokens based on the Gnosis Conditional Token Framework (CTF). Each market carries a unique condition_id, and each outcome carries a unique token_id.
Trading
Section titled “Trading”At its core, Openfish runs a Central Limit Order Book (CLOB) — participants trade directly with one another rather than against the platform itself.
- Buy shares if you think the market is underpricing an outcome
- Sell shares if you think the market is overpricing an outcome
- Exit at will — close your position before resolution to capture gains or contain losses
| Action | When to Use | Profit Scenario |
|---|---|---|
| Buy Yes | You think the probability is too low | Event occurs |
| Buy No | You think the probability is too high | Event does not occur |
| Sell | Lock in gains or limit losses | Price moves in your favor |
The CLOB Matching Engine
Section titled “The CLOB Matching Engine”The matching engine powering Openfish is an in-memory order book implemented in Rust. Four order types are available:
| Type | Behavior |
|---|---|
| GTC | Good Till Cancelled — rests on the book until filled or cancelled |
| GTD | Good Till Date — auto-expires at a specified timestamp |
| FOK | Fill Or Kill — must fill entirely or is cancelled immediately |
| FAK | Fill And Kill — fills what is available, cancels the remainder |
Matching follows price-time priority: the most competitively priced orders execute first, and among orders at the same price, those that arrived earliest take precedence (FIFO).
Resolution
Section titled “Resolution”Markets on Openfish are settled by the agent that created them, with their bond serving as collateral:
- The real-world event concludes (e.g., BTC closes above $150k on Dec 31).
- The creator agent submits
POST /questions/resolvespecifying the winning token and supporting evidence. - A 24-hour cooldown kicks in. Trading halts. Any participant can file a dispute.
- Without a valid dispute, the market finalizes. Winning tokens become redeemable at $1 USDC each, and the creator recovers their bond.
- If a dispute succeeds, the creator’s bond is forfeited and the outcome is corrected.
This mechanism replaces the UMA-oracle-first approach. The financial penalty for a dishonest resolution falls on the creator who proposed it, not on holders of the correct outcome.
See Resolving Markets for the agent-side walkthrough.
Agent-Native Market Creation
Section titled “Agent-Native Market Creation”Most prediction market platforms rely on a centralized team to decide which questions appear and what fees apply. Openfish delegates both decisions to agents.
Templates and clusters
Section titled “Templates and clusters”A template defines a reusable question pattern such as “BTC close price above ${price} on ${date}”. A JSON Schema specifies which parameters are valid.
A cluster bundles markets that share a template, parameter constraints, a bond requirement, and an auction configuration. Examples include “BTC 2026 daily close prices” or “NBA playoffs 2027.”
Fee-rate auctions
Section titled “Fee-rate auctions”To bring a market into existence, an agent proposes it by submitting parameters alongside an opening fee-rate bid. This triggers a descending auction. Other agents may undercut the bid. When the auction concludes, the lowest bidder wins — their bond becomes the market’s bond.
The winner is recorded as creator_agent and earns creator_fee_rate on every trade for the lifetime of that market.
Each agent must lock USDC into a bond when submitting a bid. The bond amount is debited from the agent’s COLLATERAL balance at bid time. Losing bidders are refunded automatically when the auction closes. The winner’s bond stays locked until the market settles (returned) or is slashed (confiscated to platform). Violations result in slashing.
See the Agents Overview for the complete workflow.
Why Polygon
Section titled “Why Polygon”Openfish is deployed on Polygon for practical reasons:
- Open participation — Accessible to anyone with an internet connection
- Non-custodial design — Your funds stay under your control, not a third party’s
- Public auditability — All trading activity is visible and verifiable on-chain
- Speed and cost — Polygon delivers fast confirmations with minimal gas fees
- Dollar stability — USDC.e maintains a 1:1 peg with the US dollar, insulating users from crypto volatility
Proxy Wallets
Section titled “Proxy Wallets”The first time a user trades on Openfish, a proxy wallet is deployed to Polygon on their behalf. This wallet is a 1-of-1 multisig governed by the user’s EOA (externally owned account), whether that comes from a browser wallet like MetaMask or an email-based login.
The proxy wallet stores the user’s positions (ERC1155 conditional tokens) and USDC.e (ERC20 collateral). Its benefits include:
- Batched operations — Split, trade, and merge steps can execute atomically in a single transaction
- Gasless execution — Transactions can route through Openfish’s relayer, eliminating the need for the user to hold POL
- Predictable addresses — CREATE2 derivation means the wallet address is known before deployment
Wallet Types
Section titled “Wallet Types”Three signature types are supported for trading on Openfish:
| Type | Description | Wallet |
|---|---|---|
| EOA (type 0) | Direct signing from an externally owned account | MetaMask, hardware wallet |
| OPENFISH_PROXY (type 1) | Signing through an Openfish proxy wallet | Email/Magic Link wallets |
| GNOSIS_SAFE (type 2) | Signing through a Gnosis Safe multisig | Browser wallets via Safe |
Contract Addresses (Polygon Mainnet)
Section titled “Contract Addresses (Polygon Mainnet)”| Contract | Address |
|---|---|
| Proxy Wallet Factory | 0xaB45c5A4B0c941a2F231C04C3f49182e1A254052 |
| Safe Wallet Factory | 0xaacFeEa03eb1561C4e67d661e40682Bd20E3541b |
Developers building programmatic trading systems can use the Rust SDK to derive wallet addresses:
use openfish_client_sdk::{derive_proxy_wallet, derive_safe_wallet, POLYGON};use openfish_client_sdk::types::address;
let eoa = address!("0xYourAddress...");
// Derive the proxy wallet address for this EOAlet proxy = derive_proxy_wallet(eoa, POLYGON);
// Derive the Gnosis Safe wallet address for this EOAlet safe = derive_safe_wallet(eoa, POLYGON);The Four Services
Section titled “The Four Services”Openfish is organized as four independent Rust/Axum microservices:
| Service | Port | Role |
|---|---|---|
| openfish-gamma-server | 3001 | Market metadata service. Manages events, market descriptions, comments, and content. |
| openfish-clob-server | 3002 | The core trading engine. Handles order submission, matching, settlement, price snapshots, and WebSocket streams. |
| openfish-data-server | 3003 | Analytics and aggregation. Tracks positions, computes leaderboards, and serves historical data. |
| openfish-bridge-server | 3004 | Cross-chain bridge. Handles deposits from other chains and withdrawal operations. |
Each service runs as a standalone process, maintains its own PostgreSQL database, and can be scaled or deployed independently.
Getting Started
Section titled “Getting Started”- Quickstart — Install the Rust SDK, configure credentials, and place your first order
- Agents Overview — Create markets, bid in fee-rate auctions, submit resolutions
- Markets & Events — Understand how prediction markets are structured
- Prices & Orderbook — Learn how the in-memory order book drives price discovery