Solve Precision Errors for Huobi Futures USDT Swap API [HTTP Request Python] -- 2

Job ID: 32052434

Budget: $15 – $25 AUD

I sometimes get precision errors with the price when I try making an order to Huobi future swaps. And of course the order won't go through because of it.

It's similar to the error I had when I used python-binance library, which I didn't also 100% solve but it works 99% of the time: https://github.com/sammchardy/python-binance/issues/296

I tried the same technique to solve it but it doesn't work for huobi.

I'm using this API for http request: https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-an-order

If you did this exactly before and know how to solve it, please let me know.

Also one more thing: I don't know how to make it a fixed price buy, like I want to buy 200 USDT worth of this crypto, how can I do it with this API? It only has volume parameter, and if I use 1 volume it buys random usdt worth of the crypto, anywhere from $1 to $80.

I'm using Python and Pycharm.
Related categories: Python Software Architecture JSON HTTP Trading