The order's limit price is to be determined by the best available price in the resting order book and the specified maximum slippage. If best available price doesn't exist (i.e. that side of the order book is empty), order creation fails.
For a BUY order, suppose the best (lowest) SELL price in the
resting order book is p_best, the order's limit price will be
calculated as:
p_best * (1 + max_slippage)
For a SELL order, suppose the best (highest) BUY price in the
resting order book is p_best, the order's limit price will be
calculated as:
p_best * (1 - max_slippage)
The order is to have the specified limit price.