# Bots and frontrunning in order book prediction markets

### Trading strategies

A classic idea for running prediction markets is to use central limit order books. They can even be employed without the need of a market maker (in the sense of the exchange owner) providing liquidity and bringing assets into circulation. Normally, order books only match buyers with sellers of the same kind of asset. Since for binary option markets buying one option is equal to selling the other, one can also match buyers of one with buyers of the other option with each other, and similarly sellers among sellers.

This trick, which is also one of the core ideas of the Contro Protocol, may or may not be employed by order-book based prediction markets. &#x20;

Another of the key ideas behind Contro Protocol is the following realization. It is usually *not* a good strategy for a trader with understanding of an issue at hand to fill the largest amounts of their total investment at once. It is better for risk management and expected long-term profit to reserve funds to exploit all inefficiencies (disagreements with the market) throughout time. This typically would allow to bet on both sides such that effectively assets are bought low and sold high, locking in profit and reducing variance. This is opposed to repeated big gambles with nearly the full position, which would generate increasing risks and ultimately lead to loss with high probability as the (admittedly extremely) profitable branches in the tree of possible paths become increasingly unlikely.

**This means that many orders and transactions are needed for optimal use of a prediction market, which requires constant trading, when using order books.** Besides technical limitations on most current blockchains, this is a **problem for retail users** who may not want to submit many orders nor configure, trust, and use an external trading bot just to convey their insights what low prices for two assets are low enough to invest.

### **Frontrunning**

Even professional traders with insights **should not put large limit orders into the book** and wait. This is because on incoming new information, fair prices can suddenly dramatically change.&#x20;

{% hint style="info" %}
Most interesting prediction markets will face surprising moments of sudden reveal of new information: Think of e.g. a goal scored in a sports game, or some surprising announcement of numbers or statement of major political or economic decisions.&#x20;
{% endhint %}

**The trader who is the fastest to update their believes will then execute trades that fill against one side of the limits in the book.** **It is important to realize that those traders who are filled are (statistically) at a disadvantage.** Their limits may have been correct orders *before the new information was available, because at that point a future was still possible in which it would have made sense to buy options for that limit price.* But after the information arrived, this path of the future is ruled out. One particular direction has been randomly decided on, and the limit orders filling the first trader are always the losing ones.&#x20;

{% hint style="info" %}
For example, consider a limit to buy A at 45 cents or lower since the probability of A winning is known to be 50%. New information suddenly changes the probability down to 30% (and everyone agrees). At this moment, the future case in which A was winning, which could have been achieved with 50% chance, *has become less likely*. A decision has been made against A. In this moment, the traders selling A can get filled against the limit to buy A at 40, and the latter is a losing trade (on average). &#x20;
{% endhint %}

As a consequence, **it is irrational to put large limit orders into the book for markets like these where information often suddenly dramatically changes the fair prices**.&#x20;

Again, for all but the very fastest trader it becomes crucial to use trading bots that constantly place many minor trades, creating what looks like a *continuous stream of trades*, in situations where there is controversy in the market and no new information comes in. This is, trader A bets on A and B bets on B at the current prices, but instead of carrying out large market orders, for which there is not enough liquidity for the reasons mentioned, they sell to each other in tiny chunks. This is an inefficient and artificially complex procedure and causes noisy prices.
