Bitcoin Forum

Economy => Exchanges => Topic started by: bitcoinAmeS on September 30, 2014, 10:18:26 AM



Title: bitfinex api
Post by: bitcoinAmeS on September 30, 2014, 10:18:26 AM
Hi all,

I am trying to call the bitfinex api for my trading system but I encounter an issue, not sure if it is the api problem of just my stupidity. Please help if you guys have any idea.

Let's say I have placed an order to buy 5 BTC, and the order gets fully filled by 5 different trades. I can't find any api that tells me that and I can only know if the order has been filled or not.

I can get the order status using the /order/status end point, I can also get the /mytrades end point to get the recent trades, but it does not have a way to tell me how they are linked. It seems they are not giving out any method for us to get the information.

Anyone have the same problem? Or able to help out a bit?

Thanks :)





Title: Re: bitfinex api
Post by: qxzn on October 02, 2014, 09:19:04 PM
You basically can't be certain that you have the right fills with bitfinex's api. What we do is:

1. periodically poll for open orders
2. when we notice something vanishes from the open orders list, call out to /order/status to see whether it's been filled or cancelled
3. for the orders which are still open from on open_orders call to the next, check if the open size changed, and if so, generate a fill for the difference.

This will give you the right fill quantity/price over all, but if fills are split into lots of partials, sometimes they will show up grouped into one larger fill.