Order types: limit
What it does
Section titled “What it does”A limit order sells an amount for at least your price. It waits in its own box on chain until a settler can fill it at that price or better.
A big order can fill in parts. Each part is paid at least its share of your price, and the rest waits in a new order box until it fills or expires. You choose the smallest part you’ll accept, and the order never leaves a leftover smaller than that. See partial fills.
Each part’s proceeds are paid out to you as it fills; they don’t wait in the order.
When to use it
Section titled “When to use it”- You want a better price than the market’s now, and you’re happy to wait.
- Your order is bigger than one block can take. Each block lets a market’s price move only a little (about 1.5% of the pool’s reserve, shared by everyone), so a large order fills over several blocks.
What you pay
Section titled “What you pay”- The order fee comes out of each part’s payout, like a swap (30 bps by default, of which the pool keeps 20). See fees.
- An execution fee for each part, within your cap. Your cap is split across the parts in proportion to their size. Kadia’s settler charges only what each fill costs, and gives the rest back in your payout.
- A little ERG for each payout box. Ergo needs every box to hold a minimum of ERG, so the order carries enough for its payouts.
What can go wrong
Section titled “What can go wrong”- It may not fill. If the market never reaches your price before the order’s expiry, nothing trades, and the order is refunded.
- Settlers choose when to fill. They fill when it pays them to. Your price is always respected, but the timing isn’t promised.
- Cancelling after a part has filled means cancelling the new order box that holds the rest: a cancel is signed for one box, and each fill makes a new one.
- An order lives at most a year (262,800 blocks).
Technical details
Sources: kadia-dex docs/guide/how-it-works.md, docs/guide/fees.md and the order-type decisions in docs/decisions/ at commit 7ce1595 (7ce159587dc8c0bd78d6a5fbe0f7f8e7dde3920e).