Author Topic: API call to buy fixed amount of BTS?  (Read 1091 times)

0 Members and 1 Guest are viewing this topic.

Offline botfund

  • Full Member
  • ***
  • Posts: 174
    • View Profile
  • BitShares: botfund
This documentation may help you:

http://docs.bitshares.eu/api/cli_wallet.html#grapheneclassgraphene_1_1wallet_1_1wallet__api_1aeb0d71a0ed4c6d05a003e48c3a0cb6d3

Thanks for the reply and this confirms my understanding and I can't do things like "to buy 1000 BTS with best price". What I can do is "to buy as many BTS with 5 USD".

I think we need to add a feature so that I can do things like "to buy 1000 BTS with best price <= 0.006". We have 2 choices:
1. add buy_asset api call.
2. add a parameter in sell_asset to specify which asset amount should be fixed ( sell asset or receive asset).


Offline botfund

  • Full Member
  • ***
  • Posts: 174
    • View Profile
  • BitShares: botfund
I noticed that there's only sell_asset on wallet_api. This is fine because I can sell USD for BTS if I want to buy BTS.
But the issue is when I want to buy BTS at best price, I can't accurately specify amount of BTS I want.
Say I want to buy 1000 BTS and the lowest ask price is [100,0.005]. I want to buy 1000 BTS with highest price 0.006. What I can do is to call
sell_asset xxx 6 USD 1000 BTS .....
Now it will buy 1000+ BTS with 6 USD. But my purpose is to buy 1000 BTS using USD <= 6. It's counter-intuitive and quite different with most exchanges.

Is my understanding wrong? If not, I strongly recommend to allow a way to specify what amount I want to be fixed (BTS or USD) or add a buy_asset API.