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
Market makers can decide against which book their orders can be placed
The Ecosystem Book provides strong semantics over execution. If trade happens off-chain it will be successfully executed on-chain
The 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
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.
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
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
Last updated