question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Help with HuobiPro market buy trading limits: min amount and cost

See original GitHub issue
  • Programming Language version: JS (React Native 0.57.8)
  • CCXT version: 1.18.193
  • Exchange: huobipro

Hi, I have a question regarding trading limits for HoubiPro: does limits.amount.min, in this case, represent the minimum cost of the order, instead of the minimum amount of base currency?

The warning returned while creating an order without the price argument states that:

[…] To switch off self warning exception and specify cost in the amount argument, set .options[createMarketBuyOrderRequiresPrice] = False.[…]

so it seems that if I don’t set that flag, I have to specify the base currency amount, right?

However, I receive an invalid-amount error response even if the amount is greater than limits.amount.min.

An example could be ADA/BTC, whose minimum amount is reported to be 0.1: huobipro.createOrder('ADA/BTC', 'market', 'buy', 191.03, 0.000011)

I have a successful outcome only if the cost of the order exceeds what is reported in the minimum.

Thanks in advance for your time. Please let me know if you need some more information.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
syron0commented, Mar 11, 2019

Great, I can confirm that now it’s solved and working correctly. Thanks for your support!

1reaction
syron0commented, Mar 11, 2019

Thank you a lot for the detailed answer.

This is the verbose output generated by the already mentioned createOrder call:

'fetch:'
, 'huobipro', 'POST', 'https://api.huobi.pro/v1/order/orders/place?AccessKeyId=XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXX&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2019-03-11T09%3A20%3A32&account-id=XXXXXXX&amount=0&symbol=adabtc&type=buy-market&Signature=qG2m0Fzn25gRjrDEDnbpDlE98d0r5TJpIBzGk%2F82S84%3D',
'Request:'
, { 'Content-Type': 'application/json' }
, '{"account-id":XXXXXXX,"amount":"0","symbol":"adabtc","type":"buy-market"}'
'handleRestResponse:'
, 'huobipro', 'POST', 'https://api.huobi.pro/v1/order/orders/place?AccessKeyId=XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXX&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2019-03-11T09%3A20%3A32&account-id=XXXXXXX&amount=0&symbol=adabtc&type=buy-market&Signature=qG2m0Fzn25gRjrDEDnbpDlE98d0r5TJpIBzGk%2F82S84%3D', 200, undefined,

'Response:',
{ 'Cf-Ray': '4b5c74010dcfbe61-MXP',
  Server: 'cloudflare',
  'Expect-Ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
  'X-Request-Id': 'ee0811d9affd4130728890db4eaa936d',
  'X-Application-Context': 'dawn-broker-pro:default,prd:8080',
  'Content-Type': 'application/json;charset=UTF-8',
  'Set-Cookie': '__cfduid=d1c4a34825653d669d936ae94d229a16f1552296033; expires=Tue, 10-Mar-20 09:20:33 GMT; path=/; domain=.api.huobi.pro; HttpOnly',
  Date: 'Mon, 11 Mar 2019 09:20:33 GMT'
},
'{"status":"error","err-code":"invalid-amount","err-msg":"Parameter `amount` is invalid.","data":null}'

Please note that I have replaced AccessKeyId and account-id with “X”, hoping it’s not a problem.

Reading the log, it seems that the requested amount is actually invalid: 0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Minimum & Maximum Trading Amount for Buying Crypto ...
The minimum & maximum trading amount differs according to your verification status and tiers. Minimum trading amount per order. Maximum trading amount per...
Read more >
Change Log – Huobi API Reference v1.0 - GitHub Pages
Release Time (UTC +8) API New / Update 2022.06.24 POST /v2/sub‑user/api‑key‑generation update 2022.06.17 POST /v1/dw/withdraw/api/create update 2022.01.21 GET v1/common/symbols , GET v1/common/currencys Update
Read more >
Huobi Review 2022: Fees, Payment Methods, Safety!
Read our extensive Huobi review and find out which payment method does Huobi accepts? which coins can you buy and sell? is it...
Read more >
Beginners Guide on How to Use Huobi to Trade Crypto
In this video, I take you through the popular cryptocurrency exchange Huobi Global. I show you how to deposit your crypto, trade with...
Read more >
The Ultimate Huobi Review | CoinStats Blog
The Huobi Pro exchange platform is among the best trading platforms of traditional financial markets. Price feeds, a market chart, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found