hitbtc-com / hitbtc-api

HitBTC API
GNU Lesser General Public License v3.0
324 stars 153 forks source link

Socket API getTrades returns empty list when "till" is used #124

Open stark71 opened 6 years ago

stark71 commented 6 years ago

Establish websocket connection: wss://api.hitbtc.com/api/2/ws

from (honored): Send request: {"method": "getTrades", "params": {"symbol": "ETHBTC", "till": null, "from": "2018-02-05T18:51Z", "sort": "DESC", "limit": 10}, "id": "getTrades"} Response received: {"jsonrpc":"2.0","result":{"data":[{"id":183450196,"price":"0.096500","quantity":"3.098","side":"sell","timestamp":"2018-02-05T19:29:22.072Z"},{"id":183450195,"price":"0.096500","quantity":"0.137","side":"sell","timestamp":"2018-02-05T19:29:22.072Z"},{"id":183450194,"price":"0.096500","quantity":"1.200","side":"sell","timestamp":"2018-02-05T19:29:22.072Z"},{"id":183450193,"price":"0.096500","quantity":"0.072","side":"sell","timestamp":"2018-02-05T19:29:22.072Z"},{"id":183450153,"price":"0.096540","quantity":"0.047","side":"buy","timestamp":"2018-02-05T19:29:18.758Z"},{"id":183450148,"price":"0.096508","quantity":"1.195","side":"sell","timestamp":"2018-02-05T19:29:18.756Z"},{"id":183450147,"price":"0.096509","quantity":"0.268","side":"sell","timestamp":"2018-02-05T19:29:18.756Z"},{"id":183450146,"price":"0.096509","quantity":"7.089","side":"sell","timestamp":"2018-02-05T19:29:18.756Z"},{"id":183450145,"price":"0.096509","quantity":"2.486","side":"sell","timestamp":"2018-02-05T19:29:18.753Z"},{"id":183450143,"price":"0.096509","quantity":"1.425","side":"sell","timestamp":"2018-02-05T19:29:18.753Z"}],"symbol":"ETHBTC"},"id":"getTrades"}

Till not honored Send request: {"method": "getTrades", "params": {"symbol": "ETHBTC", "from": null, "till": "2018-02-05T18:51Z", "sort": "DESC", "limit": 10}, "id": "getTrades"} Response received: {"jsonrpc":"2.0","result":{"data":[],"symbol":"ETHBTC"},"id":"getTrades"}

Same thing happens when from & till are both present

hitbtc-com commented 6 years ago

Hi @stark71

Till specifies trades has timestamp earlier than 2018-02-05T18:51Z

stark71 commented 6 years ago

You have answered this issue after modifying the endpoint. The issue is no longer reproducible.

It took 4 months to get feedback.