Mauritius is a pretty boring country, and given the apparent lack of proper casinos I elected to give Kraken a chance and try out their “margin trading” feature.
Long story short I ended up opening a short for 20 BTC around 749 EUR per. My lack of faith, disturbing as it was, ended up promptly rewarded with a well-deserved beating. After some additional servings of the same flavour of fail I figured that ending the blood-bath was well overdue.
Equipped with this firm intention, I merrily headed to the Kraken web interface, opened up the “positions” dashboard, and (naively, I confess) clicked the “Close position” button, or whatever it was labeled.
This opened the “New order” screen, with fields pre-filled to perform a margin trade in the opposite direction for the same amount, the logic being that it’d cancel out the existing position, effectively liquidating it.
Having proceeded to innocently click on the inviting “Submit” button I ended up blocked with a “Margin allowance exceeded message”. Pause. What the fuck did it even mean to not have enough margin to close a position? A second attempt yielded the very same result.
My subsequent message to their support plainly stated the issue:
I’ve been unable to close a 20 BTC short I opened around ~749 XBT/EUR.
I have more than enough funds on my account to take this loss without problems, yet your interface keeps telling me that closing my position would « Exceed my margin » !
This position is quite clearly in the red which is my responsibility, letting me close it and take my loss is your responsibility. I obviously can’t accept the loss part that’s due to your system not working correctly.
I should obviously not be limited by « margin » considerations when the trade I’m making is reducing my exposure and decreasing the size of my net position.
The position I want closed was opened with the [redacted] order, my account name is [redacted].
Please let me know ASAP.
A day later, after some excuses about “busy”, “working hard to clear the queue”, I got an actual answer from Mike, let’s call him Luc.
I am consulting with our trading specialists at the moment to confirm exactly what the cause of this may be. I do note that you currently have 4 open orders (albeit untouched ones). Can you cancel these orders and then attempt your position closing order again and let me know how it goes?
Kraken Client Engagement
Luc was indeed correct, I did have four untriggered STOP bids, they had however never been activated (the confusion in the vocabulary between “untouched”, as in “in the book but not yet touched” and “untriggered” as in “in the pending stops, but not triggered, and as such not even in the order book” continued throughout).
So far there were two problems: the first being that liquidating the position apparently required some sort of “margin allowance” in other words “borrowing money”, and the second being that Kraken’s support suggestion was to try something that should have had no effect on one’s ability to borrow money (cancelling orders that hadn’t been activated).
I therefore, logically, answered that:
If your engine has a measure of « allowed margin » that is impacted by these orders and prevented me from closing the position, then that’s obviously a bug on your end that requires fixing on your end, and compensation for the extra loss I’m incurring due to my impossibility to close the position.
After consulting with the “trading specialists”, Luc ended up telling me that, lo and behold, these untriggered orders somehow did indeed count against a borrowing limit, nevermind that closing a position shouldn’t require additional borrowing, and nevermind that I should have theoretically received the bulk of the funds required to buy back the shorted Bitcoins through the very sale of… the shorted Bitcoins!
We have confirmed that your open orders, even while untouched do count towards your total margin borrow limit due to this there was insufficient remaining EUR margin borrow limit for you to place one single order to close your position.
Your original position was a XBT/EUR sell on margin, meaning that the security borrowed for this was XBT so was counted against your XBT margin borrow limit.
Your original closing orders and the further closing position where you encountered the error are all XBT/EUR buy orders on margin which are counted against your EUR margin borrow limit. There is no way for us to tell in advance which pending orders you may have which will close or even reverse an open position so all are counted towards your margin borrow limit.
[Additional servings of apologies for inconveniences and SFYLs]
After pointing out to them how their own documentation plainly contradicted the actual behaviour of their system, they came back with the following gem:
The only problem we acknowledge here is that we could be more explicit in our documentation about the fact that orders placed which will create margin positions are counted towards your Margin Borrow limit as soon as they are created, regardless of whether they have been fully or partially filled yet. We will be updating our support centre documentation on Margin Borrow limits to make sure this is clearer.
So here we are, let’s kick back and let it sink in for a minute.
Ready? The translation reads: “yes, our software doesn’t behave like its documentation said it should, we will update this documentation, but this isn’t a bug, because reasons”. In other words: “Fuck you and SFYL lol”.
The gist of the insanity can be enumerated as follows:
- Liquidating existing positions is somehow subjected to borrowing limits, in addition to those already checked against when opening the position,
- These “borrowing limits” are computed by also taking into account orders that haven’t activated at all (not untouched, not filled partially, not filled completely, but NOT ACTIVATED AT ALL),
- When closing a position there’s suddenly no trace of the proceeds of the initial trade which created the position, which in any system that’s not completely insane, would obviously be used in priority when liquidating,
- Given these insane rules you can put yourself in a position where it is not possible to liquidate a position other by dicking around manually in small chunks and without the ability to place STOPs!
In conclusion I’ll point out once again the fucking elephant in the room: the proceeds of a trade with borrowed assets are somehow not yours to use to make the opposite trade in order to return said borrowed assets. Because Kraken is a special, and because they’ll soon update their documentation to redefine the meaning of the word “borrow”, and because “sorry for the inconvenience, don’t forget to protect your account with a second authentication factor”.
 Margin trading, for the noobs among us, basically consists in trading funds one doesn’t have by borrowing them, on the premise that one should at least provide enough cash upfront to cover for the variations in value of the resulting position.
For example, should one want to bet on a Bitcoin’s price increase, one could provide 1`000 EUR upfront, borrow 10`000 EUR and buy the equivalent of these 10`000 EUR in Bitcoin. Should the price of Bitcoin appreciate, one could, at any time, liquidate this position by selling the Bitcoin, return the 10`000 EUR to the lender, and pocket the difference as profit. Should one’s prediction end up incorrect, the loss would be accounted against the cash deposit. This is also referred to as “leveraged trading”. Usually, to minimize counterparty risk, the lender can force a position to be liquidated when the net loss gets close the to the deposited cash, also referred to as “collateral”.
 Again, for the noobs among us, STOP orders are orders that get automatically activated once the price reaches a certain point, they’re quite useful to automatically take a profit on profitable positions, or cut losses on unprofitable ones.
 Once in a while, paedopedia makes itself useful and aptly notes that: “A software bug is an error, flaw, failure or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways”
 For example, their “Margin borrow limits” state a Tier-3 trader could borrow 150 BTC and 25kEUR for the purpose of margin trading. If such a trader were to short BTC up to the borrowing limit, and given the current BTC market price (around ~900 EUR per), it would not be possible to liquidate this position in one go without hitting the EUR borrowing limit. In other words one would have to do it manually in at least six passes. And since apparently untriggered STOPs also count against these limits, one would not have the option to place stop-loss or take-profit orders for 100% of the position size. If that doesn’t demonstrate a completely broken design, I don’t know what else could…