Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: How do I Trade from the Console?  (Read 321 times)

0 Members and 1 Guest are viewing this topic.

Offline kosh

  • Newbie
  • *
  • Posts: 8
    • View Profile
How do I Trade from the Console?
« on: March 12, 2015, 10:18:55 PM »

Hello,

I've been having a difficult time with the Bitshares GUI being unstable and buggy. I did manage to execute a single trade with the GUI, it crashed as the trade was being executed but it still went though--I was able to confirm this by viewing my balance via the console. The web wallet is stable, but trading appears to be disabled. As a result I've spent some time learning how to perform various actions on the console.

I don't mind using the console instead of the GUI. After consulting the documentation and I can't seem to figure out how to execute a trade. Would someone kindly help by providing common examples? I'd like to know how to trade BTS for various market assets and back again.

Thanks!
"The avalanche has already started, it is too late for the pebbles to vote."

Offline Riverhead

Re: How do I Trade from the Console?
« Reply #1 on: March 13, 2015, 05:59:18 AM »

Couple of tips:

1) The console has help docs: "help wallet_market_submit_ask" for example.
2) The console has tab completion. This is handy for finding commands. Type wallet_market_<tab><tab> to see all the commands starting with wallet_market_

The market is split into two main command sections:

blockchain_market_
wallet_market_

With tab completion and the help command you should be able to dig out everything you need.

Offline pc

  • Hero Member
  • *****
  • Posts: 1012
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BTS: cyrano
  • Witness: cyrano
  • Payrate: 100%
Re: How do I Trade from the Console?
« Reply #2 on: March 13, 2015, 10:00:26 AM »
"blockchain_market_order_book <quote> <base>" shows the order book. The order of the currencies given is important - if you receive an "invalid market" message, try swapping the currency symbols. Example:

Code: [Select]
>>> blockchain_market_order_book USD BTS
     BIDS (* Short, + Relative, - Relative Limit)                            |                                   ASKS                                 
TOTAL                     QUANTITY                                     PRICE | PRICE                                        QUANTITY                     TOTAL   COLLATERAL
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
849.9251 USD              100,291.17310 BTS               0.008474576271 USD*| 0.008983918785 USD                        3.07216 BTS                0.0276 USD
463.3051 USD              54,670.00194 BTS                0.008474576271 USD*| 0.008984725966 USD                        2.30392 BTS                0.0207 USD
...
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                             SHORT WALL                                      |                                   MARGIN                                 
TOTAL                     QUANTITY                       INTEREST RATE (APR) | CALL PRICE                                   QUANTITY                     TOTAL   COLLATERAL    EXPIRES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                             | 0.004026912700 USD                   18,624.67120 BTS               99.9999 USD      5 days in the future   37,249.34241 BTS
...
Maximum Short Price: 0.00905770052507467 USD / BTS     

Note that the base and quote currencies are swapped as compared to the GUI. This also means the prices are inverted, and you have to think of buying/selling BTS for BitUSD.

In the above example, on the ASK side someone is trying to sell 3.07216 BTS at a price of 0.008983918785 USD/BTS for a total of 0.0276 USD (so actually he's trying to buy .0276 USD for 111.31 BTS/USD). On the BID side, someone is trying to buy 100,291 BTS at 0.008474576271 USD/BTS (so actually he's trying to sell 849.9251 USD at 118 BTS/USD). The asterisk on the BID side indicates that this is not a normal BID but a SHORT.

At the bottom, on the left side you can see the SHORT WALL (i. e. all shorts currently executing at the price feed), and on the right side an incomplete list of open cover orders with their margin price and expiration time. The last line contains the price feed.

So, if you want to buy some BitUSD from the short above you have to place an ASK order like this:

Code: [Select]
wallet_market_submit_ask <account_name> 291 BTS 0.008474576 USD
Similarly, to sell your BitUSD to the above ask you have to place a BID:

Code: [Select]
wallet_market_submit_bid <account_name> 3.07216 BTS 0.00898392 USD
Note that due to rounding issues it is a good idea to bid a slightly higher price and to ask a slightly lower price.

Please vote for my BitShares witness "cyrano" and for my STEEM witness "cyrano.witness"!
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline kosh

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How do I Trade from the Console?
« Reply #3 on: March 13, 2015, 12:51:16 PM »
Thanks a lot PC.

Speaking of "rounding issues" is there a technical reason why the Bitshares devs decided to go with 5 decimal places of precision and not 8 as is far more common with crypto-currency?
"The avalanche has already started, it is too late for the pebbles to vote."

Offline pc

  • Hero Member
  • *****
  • Posts: 1012
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BTS: cyrano
  • Witness: cyrano
  • Payrate: 100%
Re: How do I Trade from the Console?
« Reply #4 on: March 13, 2015, 08:32:40 PM »
Speaking of "rounding issues" is there a technical reason why the Bitshares devs decided to go with 5 decimal places of precision and not 8 as is far more common with crypto-currency?

Yes. The "double" data type commonly used in many programming languages has 52 bits of precision. I. e. it can represent 2^52 different numbers with the same exponent. That's slightly more than 10^15, so it is precise on 15 decimals.

The numerical maximum number of bitshares supported by the client is 10 billion (there are other limits in place, so the actual maximum is lower than that), that's 10^10. With 5 decimal places that's also 10^15 different values. In other words, with more than 5 decimals a "double" would not have sufficient precision to represent every possible amount of BTS.
Please vote for my BitShares witness "cyrano" and for my STEEM witness "cyrano.witness"!
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

 

Google+