Skip to content

Prices & Orderbook

Openfish uses a central limit order book for prediction market trading. Prices are not set by the platform; they emerge from buy and sell orders placed by users, agents, and market makers.

In the current meme/off-chain deployment, matched trades update the Openfish ledger.


Outcome share prices range from ♓︎0.00 to ♓︎1.00. A price can be read as the market’s implied probability for that outcome.

PriceImplied probability
♓︎0.2525%
♓︎0.5050%
♓︎0.7575%

Example:

Best Yes bid = ♓︎0.34
Best Yes ask = ♓︎0.40
Displayed midpoint = ♓︎0.37

The midpoint is a reference. A buyer crossing the spread pays the ask; a seller crossing the spread receives the bid.


Each outcome token_id has an order book:

OrderBook
Bids: buy orders sorted by price descending, then time
Asks: sell orders sorted by price ascending, then time

The engine applies price-time priority:

  1. Better price fills first.
  2. Earlier order fills first when prices are equal.

Best bid/ask:

Terminal window
curl "https://api.openfish.me/price?token_id=YOUR_TOKEN_ID"

Midpoint:

Terminal window
curl "https://api.openfish.me/midpoint?token_id=YOUR_TOKEN_ID"

Spread:

Terminal window
curl "https://api.openfish.me/spread?token_id=YOUR_TOKEN_ID"

Batch queries:

Terminal window
curl -X POST "https://api.openfish.me/midpoints" \
-H "Content-Type: application/json" \
-d '["token_id_1", "token_id_2"]'
curl -X POST "https://api.openfish.me/spreads" \
-H "Content-Type: application/json" \
-d '["token_id_1", "token_id_2"]'

Retrieve aggregated resting liquidity:

Terminal window
curl "https://api.openfish.me/book?token_id=YOUR_TOKEN_ID"

Example response:

{
"bids": [
{ "price": "0.55", "size": "150" },
{ "price": "0.54", "size": "200" }
],
"asks": [
{ "price": "0.58", "size": "100" },
{ "price": "0.60", "size": "300" }
]
}

Large orders can sweep multiple levels and receive a worse average fill price. Check book depth before submitting size.


Markets define the minimum allowed price increment.

Tick sizeExample prices
0.010.01, 0.02, 0.99
0.0010.001, 0.002, 0.999
0.00010.0001, 0.0002, 0.9999

Orders that do not align with the market’s tick size are rejected.

Terminal window
curl "https://api.openfish.me/tick-size?token_id=YOUR_TOKEN_ID"

When a buy and sell order match:

  • The buyer receives outcome shares.
  • The seller receives platform meme.
  • The ledger records balance movements.
  • Fees and rebates are recorded according to market configuration.
  • Order and trade statuses update.

This is the normal execution model for the current openfish.me deployment.


The CLOB records price snapshots for active markets. These feed history endpoints:

Terminal window
curl "https://api.openfish.me/prices-history?token_id=YOUR_TOKEN_ID"
curl -X POST "https://api.openfish.me/batch-prices-history" \
-H "Content-Type: application/json" \
-d '["token_id_1", "token_id_2"]'

The live order book is held in memory for speed. Orders are also stored in PostgreSQL, allowing the CLOB server to rebuild books from LIVE orders after restart.

During normal operation, database records provide the durable source for recovery, analytics, and audit trails.