# Order

Traders can place maker and taker orders on the Exchange

There are two order types: passive orders and non-passive orders. Passive orders are orders that **add liquidity** to the order book while non-passive orders are orders that **remove liquidity** from the order book.

## Order books&#x20;

Market makers can decide against which book their orders can be placed

The [Ecosystem Book](https://layer-akira.gitbook.io/layerakira-documentation/integration/technical-overview/ecosystem-book) provides strong semantics over execution. If trade happens off-chain it will be successfully executed on-chain

The [Router Book](https://layer-akira.gitbook.io/layerakira-documentation/integration/technical-overview/router-book) provides weak semantics over execution but opens access to more liquidity. If trade happened off-chain, it might not necessarily succeed on-chain if the taker revokes allowance to exchange. This happens where:

* the taker does not have enough funds to run the trade at the time of the on-chain settlement, or&#x20;
* the taker changes the owner of the taker contract so signature validation will fail

To incentivize market makers to place orders against the Router Book, the Exchange will provide better fees and in case of failed trade makers will receive some compensation for the unrealized opportunity.

## Fee mechanics:

* Orders placed passively in the order book will incur a *maker fee*
* When orders remove liquidity from the order book, they will incur a *taker fee*, which is subsequently distributed between LayerAkira and the Routers.&#x20;
* Takers are responsible for covering the *gas fee*, which is paid in the base currency of the chain. This can also be paid in whitelisted cryptocurrencies such as USDC/USDT at the appropriate conversion rate. Gas fees are allocated to cover the essential gas needed for on-chain trade settlement

## Order types:

If the *price* is worse than the best on the counter side, the order is treated as invalid and rejected

When placing a non-passive taker order, the taker must specify the worst-case fill price. This serves as the protection price.

* ***post\_only*** specifies if an order can only be passive
* ***full\_fill\_only*** specifies if the *taker order* can be filled fully up to the protection price
* ***best\_level\_only*** specifies if the *taker order* must be filled on the current best level only
* ***Fill or KILL** up to protection price*:
  * *full\_fill\_only=true* and *best\_level\_only=false* and *is\_market\_order*
  * Will only be fully filled if the book has sufficient liq in the interval: *\[best\_market\_price, price]*
  * else order rejected by the exchange
* ***Fill or KILL*** at best market price:
  * *full\_fill\_only=true* and *best\_level\_only=true* and *is\_market\_order*&#x20;
  * Will only be fully filled if only the book has sufficient liq at the *best\_market\_price* level
* ***IOC** up to protection price*:
  * *full\_fill\_only=false* and *best\_level\_only=false*
  * Will be filled up to *protection price* incl.:
    * if *is\_market\_order*, the remaining part cancelled
    * if !*is\_market\_order* and *post\_only=false*, the remaining part is placed into the order book at the *protection price/best\_price*
* ***IOC** up to at best market price*:
  * *full\_fill\_only=false* and *best\_level\_only=true*
  * Will be filled up to the *best level* incl.:
    * if *type="MARKET"*, the remaining part cancelled
    * if *type="LIMIT"* and *post\_only=false*, the remaining part is placed into the order book at the *fill* price
* Ordinary passive order:
  * *type="LIMIT"* and *post\_only=true*

####
