Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between userref, refid and txid in Kraken?

Tags:

bots

bitcoin

Trying to use the Kraken API, I would like to know the difference between the fields txid, refid and userref, and when to use one over an other.

like image 811
ypicard Avatar asked Mar 09 '23 09:03

ypicard


1 Answers

So I sent an email to the Kraken support and with some more research, here is how I would describe these fields :

  • txid: when placing an order, it is assigned an ID for tracking. It is a required field which exists regardless of the order’s executing or filling. To fill, an order, several trades might be needed. They are assigned their own ID’s as well, which will be different from the order’s one.
  • userref : This field is optional and not required. It is a 32-bit number generated by the user to track a specific order if he is not satisfied with the txid option.
  • refid: This field can reference another order’s txid to establish a sort of link between them. Some scenarios where this might happen is when using the close parameter in the Add standard order endpoint. This will automatically create a new order when the previous one will be filled, with its txid as refid. It can also be the case when you have a margin position open and you close it out with a seperate order, and there would be a refid required from the original position.
like image 141
ypicard Avatar answered Mar 21 '23 17:03

ypicard