coinfloor / API

All you need to know about the APIs for Coinfloor's Trade Engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

trades not being 100% filled

npomfret opened this issue · comments

​Some of my orders are not being 100% filled. I have submitted several and they are being executed but the volume is not quite 100% of the volume I requested. I am trading using the API.

​For example: ​I submitted a limit bid order for at price 1800 for 0.1000 BCH/GBP on Mon Jan 08 21:18:49 GMT 2018. The order id was 129356589, the trade has executed and there is no open order remaining.​

The trade that was executed (according to your api) was:

{
"datetime": "2018-01-08 21:18:50",
"id": 1515446330350463,
"type": 2,
"bch": "0.0997",
"bch_gbp": "1800.00",
"gbp": "-179.46",
"fee": "0.54",
"order_id": 129356589
}

You can see the BCH quantity is no correct, it's a little short. This happens ​quite often, but not always - some trades are 100% filled​​.

This is an expected consequence of trading fees. When you place a bid order, an amount of the counter asset (GBP in your case) is reserved from your available balance. The exact amount reserved is computed as the quantity of the order (here, 0.1000 BCH), multiplied by the limit price of the order (here, £1800/BCH). To guarantee that your account balance can never go negative, trade fees are charged against the reserved amount, meaning that your order can purchase at a maximum a slightly smaller quantity than you ordered. You might wonder why the trade fee isn't reserved up front in addition to the order total. The reason is that the exact fee rate charged depends on your trailing 30-day trade volume at the time of the trade. The fee rate you would be charged at trade time is unknown at the time you place your order. Charging the trade fees against the reserved amount allows you to trade your entire counter asset balance without concern for variable fee rates.

Thanks for the reply.