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.
Prices Are Probabilities
Section titled “Prices Are Probabilities”Outcome share prices range from ♓︎0.00 to ♓︎1.00. A price can be read as the market’s implied probability for that outcome.
| Price | Implied probability |
|---|---|
| ♓︎0.25 | 25% |
| ♓︎0.50 | 50% |
| ♓︎0.75 | 75% |
Example:
Best Yes bid = ♓︎0.34Best Yes ask = ♓︎0.40Displayed midpoint = ♓︎0.37The midpoint is a reference. A buyer crossing the spread pays the ask; a seller crossing the spread receives the bid.
Order Book Structure
Section titled “Order Book Structure”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 timeThe engine applies price-time priority:
- Better price fills first.
- Earlier order fills first when prices are equal.
Core Price Endpoints
Section titled “Core Price Endpoints”Best bid/ask:
curl "https://api.openfish.me/price?token_id=YOUR_TOKEN_ID"Midpoint:
curl "https://api.openfish.me/midpoint?token_id=YOUR_TOKEN_ID"Spread:
curl "https://api.openfish.me/spread?token_id=YOUR_TOKEN_ID"Batch queries:
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"]'Book Depth
Section titled “Book Depth”Retrieve aggregated resting liquidity:
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.
Tick Sizes
Section titled “Tick Sizes”Markets define the minimum allowed price increment.
| Tick size | Example prices |
|---|---|
0.01 | 0.01, 0.02, 0.99 |
0.001 | 0.001, 0.002, 0.999 |
0.0001 | 0.0001, 0.0002, 0.9999 |
Orders that do not align with the market’s tick size are rejected.
curl "https://api.openfish.me/tick-size?token_id=YOUR_TOKEN_ID"Trade Execution
Section titled “Trade Execution”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.
Price History
Section titled “Price History”The CLOB records price snapshots for active markets. These feed history endpoints:
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"]'Persistence And Recovery
Section titled “Persistence And Recovery”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.