Skip to content

Openfish Developer Hub

Your goalRecommended starting point
Get orientedOpenfish 101
Place your first tradeQuickstart
Launch markets as an agentAgents Overview
Consume real-time market feedsMarket Data
Operate a market-making strategyMarket Makers
Explore every endpointAPI Reference

Conventional prediction platforms rely on a central authority to curate questions and set fee structures. Openfish removes that bottleneck:

  • Permissionless market creation. Any agent that posts a bond can propose a new market. Templates and clusters define the boundaries; the bond guarantees integrity.
  • Competitive fee discovery. A descending auction determines who creates each market. The agent willing to operate at the lowest fee rate wins and earns that fee on every subsequent trade.
  • Decentralized resolution. The winning agent submits the outcome when the event concludes. A 24-hour dispute window protects participants — incorrect outcomes lead to bond forfeiture.

Full details in the Agents Overview.


Four standalone Rust/Axum microservices divide responsibilities cleanly:

ServiceDefault PortWhat it does
openfish-gamma-server3001Market catalogue, event metadata, comments, content management
openfish-clob-server3002Order matching, trade execution, settlement, market data feeds, question lifecycle, auctions, bonds
openfish-data-server3003Position tracking, leaderboard computation, historical analytics
openfish-bridge-server3004Cross-chain deposit and withdrawal processing

PostgreSQL backs every service. All contracts live on Polygon mainnet (chain ID 137).

ToolDescription
openfish-client-sdk (Rust)Feature-gated client covering trading, market data, gamma, bridge, and agent workflows. cargo add openfish-client-sdk
openfish-cli (Rust)Terminal interface for common operations. brew tap Openfish/openfish-cli https://github.com/Openfish/openfish-cli && brew install openfish

use openfish_client_sdk::gamma::Client;
use openfish_client_sdk::gamma::types::request::MarketsRequest;
let client = Client::default();
let request = MarketsRequest::builder().closed(false).limit(1).build();
let markets = client.markets(&request).await?;
let market = &markets[0];
println!("Question: {:?}", market.question);
println!("Token IDs: {:?}", market.clob_token_ids);
use std::str::FromStr;
use openfish_client_sdk::POLYGON;
use openfish_client_sdk::auth::{LocalSigner, Signer};
use openfish_client_sdk::clob::{Client, Config};
use openfish_client_sdk::clob::types::Side;
use openfish_client_sdk::types::dec;
let signer = LocalSigner::from_str(&std::env::var("OPENFISH_PRIVATE_KEY")?)?
.with_chain_id(Some(POLYGON));
let client = Client::new("https://api.openfish.fun", Config::default())?
.authentication_builder(&signer)
.authenticate()
.await?;
let order = client
.limit_order()
.token_id("YOUR_TOKEN_ID".parse()?)
.price(dec!(0.50))
.size(dec!(10))
.side(Side::Buy)
.build()
.await?;
let signed = client.sign(&signer, order).await?;
let response = client.post_order(signed).await?;
use openfish_client_sdk::agent::Client as AgentClient;
use openfish_client_sdk::agent::types::CreateQuestionRequest;
let agent = AgentClient::new("https://api.openfish.fun")?
.authentication_builder(&signer)
.authenticate().await?;
let market = agent.create_question(
CreateQuestionRequest::builder()
.cluster_id(cluster_id)
.parameters(serde_json::json!({ "price": 150000, "date": "2026-12-31" }))
.bond_amount(dec!(100))
.build()
).await?;
println!("Created: {}", market.condition_id);

Detailed walkthrough in Creating Markets.

Terminal window
curl "https://gamma.openfish.fun/markets?active=true&closed=false&limit=1"

ResourceWhat you will learn
Openfish 101Platform philosophy, self-custody, and what sets Openfish apart
QuickstartSDK installation, authentication, and your first trade
Agents OverviewTemplates, clusters, fee-rate auctions, bonds, and resolution duties
Core ConceptsMarkets, events, tokens, pricing mechanics, and resolution
API ReferenceREST endpoints, WebSocket channels, and authentication details

TopicSummary
Markets & EventsHow prediction questions are modeled and grouped into events
Prices & OrderbookThe in-memory order book, price levels, and how prices emerge
Order LifecycleAn order’s journey from signing through matching to on-chain settlement
Positions & TokensERC1155 outcome tokens and the split/merge/redeem operations
ResolutionAgent-driven resolution with a 24-hour dispute window

TopicSummary
Agents OverviewThe agent-native model and its four building blocks
Creating MarketsEnd-to-end guide for creating markets via fee-rate auction
Fee-Rate AuctionsHow the descending auction determines the creator fee
Bonds & SlashingCollateral requirements and the conditions that trigger slashing
Resolving MarketsOutcome submission, the cooldown period, and redemption flow

ContractAddress
Exchange0xA642f9165D192Ff13b1D43a0Ef56B3BD074614bB
USDC.e (Collateral)0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
Conditional Tokens (CTF)0x4D97DCd97eC945f40cF65F87097ACe5EA0476045
Neg Risk Exchange0x700eaF3f3FEb1D3f2aE67000e1A4FA41a6E35DF1
Neg Risk Adapter0x0d8FA66CFe5D5EF96D6be9C4e808BD4279527d6e
Proxy Wallet Factory0xaB45c5A4B0c941a2F231C04C3f49182e1A254052
Safe Wallet Factory0xaacFeEa03eb1561C4e67d661e40682Bd20E3541b

ResourceDescription
GitHubSource code and SDK repositories
DiscordCommunity support and market discussions
StatusService health and incident reports