Skip to content

Trading on Openfish

Openfish runs a Central Limit Order Book (CLOB) for prediction markets. In the current FISH deployment, matched trades update the Openfish off-chain ledger.

LayerCurrent behavior
Collateral unitFISH ledger balance.
MatchingIn-memory CLOB, restored from database on service startup.
SettlementOff-chain ledger updates persisted by the CLOB server.
DepositsBSC FISH through the Bridge service.
WithdrawalsBSC FISH through the Bridge service.
Market dataREST and WebSocket APIs.

Openfish separates credential derivation from day-to-day trading access.

TierMechanismRole
L1Wallet signatureDerive or recover API credentials.
L2HMAC-SHA256 API credentialsPlace orders, cancel orders, query private trading data.

L2 requests include the wallet address, timestamp, API key, passphrase, and HMAC signature. The HMAC message is the concatenation of timestamp, HTTP method, request path, and request body.

  1. Client creates an order for a market outcome token ID.
  2. Client signs the order and submits it to POST /order.
  3. CLOB validates authentication, market status, tick size, order amount, and ledger balance.
  4. Matching engine fills against resting liquidity by price-time priority.
  5. Fills are persisted as trades.
  6. Ledger balances and positions update immediately.
  7. Market and user WebSocket subscribers receive updates.
  8. Any remaining quantity stays live, expires, or is cancelled according to order type.
TypeBehavior
GTCGood Till Cancelled. Rests until filled or cancelled.
GTDGood Till Date. Expires at a specified timestamp.
FOKFill Or Kill. Must fill entirely or cancel immediately.
FAKFill And Kill. Fills available quantity and cancels the remainder.

The current deployment distinguishes chain balances from Openfish ledger balances.

BalanceWhere it livesUsed for
BSC wallet balanceUser wallet on BSCDepositing and receiving withdrawals.
Openfish ledger balanceCLOB databaseTrading and reserving order collateral.
Bridge gas funder balanceSystem wallet on BSCFunding withdrawals and BSC gas.

Bridge deposits credit ledger balance. Bridge withdrawals debit ledger balance and send the supported FISH token on BSC.

Fees are charged in FISH terms. Market-level fee rates come from the current market configuration: imported/system markets may carry creator_fee_rate, while template/cluster markets use the cluster or template fee settings. The older auction workflow is still present as a compatibility path, but it is not the default path for current system-created markets.

The Bridge only supports the FISH token on BSC. Other assets are outside the current deposit and withdrawal flow.