> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trysoar.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Matching

> Price-time priority, self-trade prevention, and the fee curve

Everything on this page changes what your orders do. It is the part of the venue's
behaviour you have to model to quote well.

## Price-time priority

Orders match best-price-first. Among orders at the same price, the one that arrived
first trades first.

Two consequences worth designing around:

* **Improving your price jumps the queue.** A better price is always ahead of a worse
  one, regardless of when either arrived.
* **Amending loses your place unless you are shrinking.** Priority survives only when
  `price` is unchanged and `qty` does not increase. Size down and you keep your spot;
  change the price *or add size* and you go behind everyone already resting there. If
  being early at a price matters, get there first — there is no other way to the front.

## Whole-cent prices

Prices are integers from **1 to 99** cents. There is no sub-penny pricing, so the book
has exactly 99 usable levels and ties at a price are common — which is why arrival
order matters as much as it does.

0¢ and 100¢ are settlement values, not prices.

## Matching has already happened when you get a response

`POST /v1/orders` returns after your order has been matched. The `status` in the
response is the outcome, not an acknowledgement — see
[Order lifecycle](/concepts/order-lifecycle).

## Complementary matching

A `buy no` at 40¢ and a `buy yes` at 60¢ are opposite sides of the same trade and will
match each other. One market, one book, two ways of naming a position. If this is new,
read [Binary markets](/concepts/binary-markets#one-market-two-outcomes) first — a bot
that models `yes` and `no` as separate books quotes against itself.

## Self-trade prevention

Your own orders never trade with each other.

When an incoming order of yours would match your own resting order, the venue
**decrements and cancels** instead of filling:

1. both orders are reduced by the overlapping quantity
2. no fill is generated and no trade prints
3. matching continues past the skipped order

If an order's entire quantity is consumed this way, it ends up `canceled` with nothing
traded.

<Warning>
  For a two-sided quoter this is the behaviour to plan around. If your bid crosses
  your own ask — after a price update, or because you widened one side and not the
  other — you do not get a fill and you do not keep your quotes. You lose both, and
  your inventory does not move.

  Keep your own quotes from crossing rather than relying on the venue to sort it out.
</Warning>

## Fees

Fees are charged on **the price you named**, not on the canonical price: a `buy no` at
35¢ is charged against 35, not against 65.

The curve is parabolic. With `r` the market's fee rate, `q` the quantity, and `p` your
price in cents:

```
fee_cents = ceil( r × q × p × (100 − p) / 10,000 )
```

| Property | Consequence |
| - | - |
| Zero at the extremes | A 1¢ or 99¢ trade is effectively free. |
| Largest at 50¢ | Maximum uncertainty costs the most to trade. |
| Symmetric | 30¢ and 70¢ cost the same. |
| Rounded up to the cent | The minimum non-zero fee is 1¢. |

Each market publishes `maker_fee_rate` and `taker_fee_rate` as **decimal strings** —
`"0.0007"` is 0.07% — and they are strings precisely so float parsing cannot mangle
them. Read them off the market rather than assuming a venue-wide rate; they differ by
market and maker is not always the same as taker.

<Note>
  Fees are small in the current paper-money beta. At a `"0.0007"` taker rate, 100
  contracts at 50¢ rounds up to 1¢ in total. Treat the per-market rate fields as the
  source of truth rather than hard-coding a number, and do not build a strategy whose
  edge depends on fees staying at beta magnitude.
</Note>

## Time in force

`gtc` rests, `ioc` takes what is there and cancels the rest, `fok` fills entirely or
does nothing at all — consuming no liquidity when it cannot.

Omitting the field gives `gtc`. See
[Binary markets](/concepts/binary-markets#time-in-force).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.