Kraken Limit Orders: Reading the Book and Interpreting API Errors
Summary
The document examines how to submit limit orders for an ETH/AUD pair through Kraken’s trading API. It walks through selling ETH against the bid side and buying ETH against the ask side, explaining the intended relationship among order direction, base and quote currencies, price, volume, and fee-currency flags. The examples use displayed order-book levels to estimate prices that could fill the requested quantities, assuming the book remains unchanged. These details are presented as a trader’s proposed interpretation, not as a confirmed validation of the order construction.
The response addresses the reported internal error rather than resolving the order-parameter questions. It says that Kraken’s internal error can reflect platform or API degradation, whereas insufficient funds should produce a distinct error. That diagnosis is based on documentation cited in the exchange and does not establish the cause of this particular failure. The discussion offers no execution test or proof that the proposed orders are valid, and order-book prices may change before submission.
Key ideas
- The example uses bids when selling base currency and asks when buying it.
- A limit price sets the least favorable price the trader is willing to accept, subject to available liquidity and order-book changes.
- The proposed order parameters are a question in the document, not a verified implementation.
- The response distinguishes a possible platform error from the separate insufficient-funds message.
Tags
Full text
# Trading currency on Kraken.com platform using their REST API (AddOrder), is this correct?
# Trading currency on Kraken.com platform using their REST API (AddOrder), is this correct?
I would like some confirmation on whether what I came up for buying/selling currency on kraken.com is valid.
Right now I get `{"error":["EGeneral:Internal error"]}` message from kraken.com, when I run my query. But I have not yet placed any money in my account. I prefer to be more confident in my query before I place deposits.
Can anybody confirm whether my working is correct given the case-study below?
Let's say the pair is `ETH/AUD`, I have just got its OrderBook and these are the first 2 rows from each ASKS and BIDS:
```
ETH/AUD
ASKS (price in ETH, volume in ETH):
1) 5659.070000 0.200
2) 5661.160000 0.278
BIDS (price in ETH, volume in ETH):
1) 5645.090000 0.103
2) 5645.080000 0.300
```
Case 1: I want to sell 0.25 ETH and buy the equivalent AUD.
I look at the BIDS (because I need the quote currency, AUD). I see that all of the 1st row and some of the 2nd row cover me. So, I will ask the platform to exchange at the worst price of the two rows (the last row at `1 ETH to 5645.080000 AUD`). Here is my query:
```
https://api.kraken.com/0/private/AddOrder?nonce=1639668091852&ordertype=limit&pair=ETH/AUD&price=5645.080000&validate=true&oflags=fcib&type=sell&volume=0.25
```
Some parameters explanation:
- `price=5645.080000`, `volume=0.25` : `volume` is my requirement. `price` is the worst price of the two rows of BIDS, which is the last row. See point (2) below how this combines with `ordertype=limit`
- `ordertype=limit` because I want to buy at this specific price or better. https://support.kraken.com/hc/en-us/articles/206899287-How-to-set-prices-for-limit-orders states that `The limit price is the price at which you want a limit order to be fulfilled or better`. So, I use the price in the 2nd row and that will definetely get me all of 1st row and some of the 2nd (provided the OrderBook does not change in the meantime).
- `oflags=fcib`, https://docs.kraken.com/websockets/ states `fcib = prefer fee in base currency, fciq = prefer fee in quote currency,` I want fee in base currency which I now own (ETH). In this way I first subtract the fee and then convert to AUD. I guess this can result in less fee amount because of less amount to be converted to AUD?
- `type=sell`, sell because I have BASE currency (ETH) and want to sell it to buy QUOTE currency (AUD). Right?
Case 2: The reverse: I want to sell 850.15 AUD and buy the equivalent ETH (which is around 0.15 ETH with above order book).
I look at the ASKS (because I need ETH). I see that some of the 1st row covers me. So, I will ask the platform to exchange at the 1st row price of ASKS (at `1 ETH to 5659.070000 AUD`). Here is my query:
```
https://api.kraken.com/0/private/AddOrder?nonce=1639668091852&ordertype=limit&pair=ETH/AUD&price=5659.070000&validate=true&oflags=fciq&type=buy&volume=0.15022786
```
Some parameters explanation:
- `price=5659.070000`, `volume=0.15022786` : `price` is set by the 1st row of ASKS. `volume` is calculated from my requirement of `850.15 AUD` divided by said price.
- `ordertype=limit` (as before).
- `oflags=fciq`, as before, I want fee in the currency I now own, which is quote (AUD). In this way I first subtract the fee and then convert to ETH.
- `type=buy`, I have QUOTE currency (AUD) and want to sell it to buy BASE currency (ETH). That's a buy right?
## Answer by Mayeul sgc (score 1)
https://quant.stackexchange.com/a/69135
Have you tried to run it again at a later time of the day? By checking the kraken documentation, it appears that the error is not related to your level of available funds but rather a Kraken system stability issue.
> EGeneral:Internal error When we are facing API degradation issues, these can translate into problems for both Kraken and cryptowat.ch in the form of service unavailable messages, 8XX errors on cryptowat.ch and site outages.
If you were lacking funds you would get a `EOrder:Insufficient funds (insufficient user funds)` message instead.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.