An order does not always fill in one clean trade. In a real market on the Kraken API, a single order can be matched against several resting orders at different sizes, so part of it executes and part is left working — or never fills at all. A bot that assumes every order fills completely will miscount its position, misprice its risk, and drift out of sync with what it actually holds. Handling partial fills correctly is quiet, unglamorous discipline, and it matters.
Why partial fills happen
When your order is larger than the liquidity available at your price, the exchange fills what it can and leaves the rest. The same happens when a limit order only partially matches before the market moves away from your level. Thin pairs, fast conditions, and larger sizes all make partial fills more likely. They are normal market behaviour, not an error.
Read the filled quantity, not the request
The first rule is to never assume. After placing an order, the bot reads how much actually filled rather than treating the requested size as done. The difference between requested and filled is the remainder that still needs handling, and acting on the request instead of the fill is how phantom positions appear.
Reconcile the remainder
The unfilled portion needs an explicit decision: leave it working at the same limit, cancel it, or re-price it. Each choice has consequences, and the bot records which one it made. Leaving an order working can mean it fills later at a moment you no longer want; cancelling locks in a smaller position than intended. There is no default that is right every time, which is why the decision is logged.
Recompute the real position
Once the fills are known, the bot recomputes its true position size and average entry price from the actual executions. This matters because every risk limit — per-trade exposure, the stop distance, the daily cap — must act on what you really hold, not on what you asked for. A position sized on the request rather than the fill can quietly breach a limit you thought was safe.
Log it so it stays accountable
Finally, the partial fill and its handling go into the execution audit trail, alongside the order that produced them. When you later review what the bot did, the partial and the choice that followed are there in order, so the position and its cost are fully reconciled rather than approximated.
Partial fills interact closely with the order type you chose, so it helps to understand limit versus stop-loss-limit orders and the wider set of order types on Kraken. Behaviour is described here in plain terms; always confirm the current specifics against Kraken's own API documentation.