> For the complete documentation index, see [llms.txt](https://sagebet.gitbook.io/sagebet-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sagebet.gitbook.io/sagebet-documentation/sagebet/market-and-trading-basics/orderbook-basics.md).

# Orderbook Basics

Overview of SageBet's orderbook and how to use them

## Orderbook overview

An orderbook for a prediction market is a mechanism that allows participants to buy and sell shares of specific outcomes. These shares typically represent the probability of a particular event occurring. In this case, the values range from 1¢ to 99¢, with each cent signifying a 1% probability.

Market Orders and Limit Orders are two types of orders that participants can use to trade in a prediction market. Let's discuss each of these order types and how they function within the orderbook.

1. Market Orders: A market order is an order to buy or sell a share at the best available price in the market at the time the order is placed. This means that the participant is willing to accept any price to execute the trade immediately. The advantage of a market order is its quick execution, but the downside is that the participant may not get the most favorable price.

For example, suppose you want to buy a share representing a 60% chance of a specific outcome occurring. You place a market order to buy this share. The order will be filled at the best available price in the market, which could be higher or lower than 60¢, depending on the current supply and demand.

2. Limit Orders: A limit order is an order to buy or sell a share at a specific price or better. This means that the participant sets the maximum price they are willing to pay (for a buy order) or the minimum price they are willing to accept (for a sell order). Limit orders provide more control over the execution price but may not be filled if the market price does not reach the specified limit.

Using the previous example, if you want to buy a share representing a 60% chance of an outcome occurring, you can place a 60¢ buy limit order. This means you are only willing to buy the share at a price of 60¢ or lower. If there are no sell orders at 60¢ or lower, your limit order will remain in the orderbook until a matching order is placed or you decide to cancel the order.

The orderbook contains a list of all the buy and sell orders in the market. The orders are organized into two columns: the "bids" column, which lists buy orders from highest to lowest, and the "asks" column, which lists sell orders from lowest to highest. The difference between the highest bid and the lowest ask is called the "spread."

When a limit order is placed, it is added to the appropriate side of the orderbook (bids for buy orders and asks for sell orders) and sorted by price. Orders at the same price are typically sorted by the time they were placed. When a market order is placed, it is matched with the best available limit order on the opposite side of the orderbook, resulting in a trade.

In summary, an orderbook for a prediction market is a tool that facilitates the trading of shares representing the probability of specific outcomes. Market and limit orders are the two primary methods for executing trades, each with its advantages and disadvantages. The orderbook keeps track of all orders and helps match buyers and sellers, enabling efficient price discovery and trade execution.

##


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://sagebet.gitbook.io/sagebet-documentation/sagebet/market-and-trading-basics/orderbook-basics.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
