Skip to content

Builder Program

A builder is any application that submits user orders to the Openfish CLOB. Whether you have built a trading interface, a portfolio aggregator, a copy-trading service, or any product that lets users place prediction market trades, the Builder Program provides the infrastructure you need.


BenefitDescription
Volume AttributionEvery order includes your builder_id, linking volume to your account
Builder FeesCollect a fee on orders routed through your application
SupportDedicated Telegram channel and engineering assistance (Verified tier and above)

  1. User places order — A user submits an order through your application.
  2. Sign request — Your backend signs the request with Builder API credentials.
  3. Submit to CLOB — The order is sent to POST /builder/order with the OPENFISH_BUILDER_ID header for attribution.
  4. Trade execution — Openfish matches the order and updates ledger balances.
  5. Volume attribution — The resulting trade is credited to your builder account.

Every builder order must carry the OPENFISH_BUILDER_ID header. The server extracts it and records it alongside the order and any resulting trades:

// From openfish-clob-server builder_routes.rs
struct BuilderHeaders {
pub builder_id: String,
}
impl BuilderHeaders {
fn extract(headers: &HeaderMap) -> Result<Self, AppError> {
let builder_id = headers
.get("OPENFISH_BUILDER_ID")
.or_else(|| headers.get("poly_builder_id"))
.and_then(|v| v.to_str().ok())
.unwrap_or("")
.to_owned();
if builder_id.is_empty() {
return Err(AppError::BadRequest(
"OPENFISH_BUILDER_ID header required".to_owned(),
));
}
Ok(Self { builder_id })
}
}

MethodPathDescription
POST/builder/orderSubmit an order with builder attribution
POST/builder/cancelCancel an order with builder attribution
POST/auth/builder-api-keyCreate a new builder API key
GET/auth/builder-api-keyList your builder API keys
DELETE/auth/builder-api-keyRevoke a builder API key

A builder order uses the same payload format as a standard CLOB order, but goes through the builder endpoint and includes the attribution header.

use reqwest::Client;
use serde_json::json;
let response = Client::new()
.post("https://api.openfish.me/builder/order")
.header("OPENFISH_BUILDER_ID", "my-trading-app")
.header("OPENFISH_API_KEY", &api_key)
.header("OPENFISH_SECRET", &secret)
.header("OPENFISH_PASSPHRASE", &passphrase)
.header("OPENFISH_TIMESTAMP", &timestamp)
.header("OPENFISH_SIGNATURE", &signature)
.json(&json!({
"order": {
"tokenId": token_id,
"maker": user_address,
"side": "BUY",
"makerAmount": "500000",
"takerAmount": "1000000",
"signature": order_signature,
"expiration": "0",
},
"orderType": "GTC",
}))
.send()
.await?;

The response confirms attribution with the builder_id field:

{
"orderID": "a1b2c3d4-...",
"status": "LIVE",
"success": true,
"builder_id": "my-trading-app",
"tradeIds": []
}

  1. Generate API credentials — Create a standard L2 API key, then issue a builder API key through POST /auth/builder-api-key. See API Keys.
  2. Configure attribution — Include the OPENFISH_BUILDER_ID header on every order submission.
  3. Route orders — Submit orders through POST /builder/order rather than the standard POST /order endpoint.
  4. Track performance — Query builder trades and volume through the CLOB API.

  • CLI — Install the Openfish CLI for terminal-based trading and scripting.
  • API Keys — Create and manage your Builder API credentials.
  • Tiers — Rate limits, rewards, and how to upgrade.