Why do my order costs vary?

The Kraken API is not perfect. One quirk is that you cannot specify the quote amount, e.g. 10 EUR, when placing an order. Instead, you have to specify the amount in base currency, e.g. 4 XTZ. As the quote amount has to be fixed, we have to compute the base amount (volume) by dividing the quote amount by the ask price. However, especially for smaller altcoins, this calculation may not hold for the entire order volume.