> For the complete documentation index, see [llms.txt](https://docs.prophetmarket.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prophetmarket.ai/core-concepts/orders-and-matching.md).

# Orders and matching

*How an order is signed, matched and settled, and what maker and taker mean for you.*

Orders on Prophet are signed off chain and matched on chain. You sign a message authorising a trade at a specific price and size, that order is matched, and the exchange contract on Polygon performs the swap. USDC leaves the buyer's Safe, shares leave the seller's Safe, and both sides receive their new position on chain.

## Order types

| Type         | What it does                                                                      | When to use it                                                     |
| ------------ | --------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Limit order  | Buy or sell at your named price or better. Rests until it fills or you cancel it. | When price matters more than speed, and for any large size.        |
| Market order | Buy or sell immediately at the best available price.                              | When you want certainty of execution and accept the current price. |

A limit order is a statement of the worst price you will accept. If you name sixty five cents on a buy, you will fill at sixty five or better, and if nothing is available at that level your order waits. A market order makes the opposite trade off: it accepts whatever is currently available in exchange for filling now.

## Maker and taker

**Maker**

Your order rested first and someone else traded against it later. You provided the liquidity.

**Taker**

Your order crossed an existing order and executed immediately. You consumed the liquidity.

## Priority

Matching follows price then time. The best price is filled first, and among orders at the same price the older one fills first. There is no way to jump the queue at a given price other than improving your price.

**Price then time**

```
66¢ order placed 14:02   →  fills first  (better price)
65¢ order placed 13:40   →  fills second (same price, older)
65¢ order placed 14:05   →  fills third
```

## Partial fills and cancellation

A resting order can fill in pieces as different counterparties take portions of it. An order that is partially filled leaves the remainder resting at your price, and you can cancel that remainder at any time.

{% hint style="info" %}
**Failed trades simply do not fill**

If an on chain condition is not satisfied at settlement time, for example the balance is insufficient at the moment of settlement, the trade does not execute and the interface reflects the failure. Nothing is partially committed.
{% endhint %}

{% hint style="success" %}
**Use limit orders for size**

In a thin market a market order walks up the available prices and your average fill can be materially worse than the quote you saw. A limit order caps that exposure at the price you chose.
{% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.prophetmarket.ai/core-concepts/orders-and-matching.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
