BEWARE Trading 2 Non-Decimal Tokens on the BitShares DEX! 😱

I was "hanging out" in the Beyond Bitcoin Mumble Chat earlier today, and the topic came up of how to exchange WHALESHARE tokens for BEYONDBIT. I was saying that currently there's really no liquidity on BEYONDBIT/BTS, and @officialfuzzy said I should be looking at WHALESHARE/BEYONDBIT. So that's where the action's been hiding!

WHALESHARE: each token represents a 1% vote from @officialfuzzy
BEYONDBIT: each token represents a 1% vote from @fuzzyvest
For Whaleshares Discord Chat Members:
type "whalebot vp officialfuzzy 10%" to check current voting power and weight!

Except, upon pulling up the pair in Bitshares OpenLedger, I was greeted with this "oddity":

ws-bb-dex1.jpg

Notice anything wrong here? Why aren't those 1 WHALESHARE bids matching up with those 1 BEYONDBIT offers at presumably the same price?! It turns out the answer is the same as why you need to acquire some BTS before using your WHALESHARE tokens, lest you are charged one full WHALESHARE as a transaction fee, versus around 0.24 BTS!


(make sure you have BTS so your transaction fees are priced in fractional BTS!)

The problem here is that both tokens are designated with "integer" granularity. Currently, there is no such thing as either 1.25 WHALESHARE or 0.50 BEYONDBIT. They were not designed to be non-integer (decimal) assets! Normally, this is not an issue if you are trading them for BTS or some other decimal-based crypto currency or token. However, if you're trading one against the other, the bitshares DEX is basically doing exactly what it's supposed to do. It's not allowing transactions take place in fractional increments.

Besides the equal-price "display" issue, the REAL problem is that people are able to enter decimals on the DEX nonetheless! What you're seeing above is not a 1 bid / 1 offer market, but actually a 1 bid / 1.26 offered market! Okay great, so what happens if you try buying BEYONDBIT at 1.26? You'll get a lovely fill at 2 WHALESHARE, and you'll make the 1.25 seller VERY HAPPY! Because, of course, these tokens cannot actually trade fractionally, so the DEX adjusts the best way it knows how...

The real problem, however, that IS a bitshares bug, is this:

@gchicken-2: @alex - I tried to buy 1 beyondbit for 1.26315789 Whaleshare which resulted in me paying 2 whaleshares and only receiving 1 beyondbit. blockchain shows price of 2 whaleshare/beyondbit for both the place order and the fill order operation

@gchicken-2: i clicked the first 1. in the order book and it filled the price at 1.2631 but resulted in a price of 2!

It seems the bitshares DEX is actually ROUNDING UP his BID to the next higher integer amount. Instead of getting a 1.2631 fill (or a round down to 1 BEYONDBIT), the blockchain rounded him UP and he paid 2 WHALESHARE for a BEYONDBIT offered at 1.2631! Now, it is possible this is partially a GUI issue as well. If you click on the 1 price, the GUI does load the correct 1.2631 price. However, when he attempted to BUY that price, he paid 2 instead! This should not be possible. In fact, there should be no decimals allowed, and in this case, at worst, his BID should have been rounded down to 1, not 2. Luckily he only attempted to buy a single token!

UPDATE:

@jphenderson (TheWalrus) did a few more tests and discovered that it seems you CAN buy or sell at fractional amounts, but ONLY if the trade pairs off at an EXACT integer-based ratio (ie. 5 for 4, 2 for 1, etc). For example, he tried buying 4 BEYONDBIT for 1.25 each, and was charge 5 WHALESHARE (4 x 1.25 is exactly 5). When he tried to buy just 1 BEYONDBIT at 1.25, he was charged 2 WHALESHARE instead. Now here's where it gets interesting. It seems this may be a GUI design issue after all, because if you try to buy 1 unit of BEYONDBIT at 1.25, the GUI immediately adjusts the quantity to SELL to 2!

ws-bb-confirm-page2.jpg

Furtermore, after clicking "BUY", the CONFIRMATION POPUP window DOES let you know the EXPECTED price, as shown below, so you do have an additional chance to CANCEL before CONFIRMING the transaction! It would be nice, however, if there were an additional warning given by the GUI, because if you don't think to double-check that your LIMIT PRICE CAN BE ADJUSTED, you can EASILY forget to check and miss it completely!


ws-bb-confirm-page1.jpg

Oddly enough, I was able to manual change the "Total" WHALESHARE sell quantity to 1, which then correctly adjusted the price DOWN to reflect a sale at 1 for 1 instead of 2 for 1)!

How does BitShares handle PARTIAL FILLS?

Also be aware that if you have a larger LIMIT ORDER sitting on the exchange, and you receive a PARTIAL FILL, the BALANCE of your order may be REPRICED by the blockchain itself! This is something else I recently learned, as one of my "lowball" bids was just filled exactly this way! I had a BID to BUY 100 BEYONDBIT for 101 WHALESHARE (equivalent to a price of 1.01 each). Here's how my fills played out:

  • FILL ORDER sxe-trader bought 94 BEYONDBIT at 1 WHALESHARE/BEYONDBIT
  • FILL ORDER sxe-trader bought 6 BEYONDBIT at 1.1666666666666667 WHALESHARE/BEYONDBIT

Notice how even though the order was 100 at 1.01, once the 94 were filled at 0.01 better than my price, the remaining 6 were automatically repriced by the bitshares blockchain to buy at 1.16667 (which would round to exactly 7 WHALESHARE for 6 BEYONDBIT)! So beware, folks, it's a "jungle" out there! However, I must say I'm still pretty pleased with the price I bought them, especially given I had just purchased a few earlier today around 1.43 or so!

Finally...

Nonetheless, let this serve as another warning to all of you, especially if you attempt to trade two integer assets against each other via bitshares / openledger, to ALWAYS double-check that the LIMIT price shown MATCHES the LIMIT price you entered and expected! I have a feeling that based on this new finding, the current tokens will likely stay the same. However, @officialfuzzy may consider issuing future whale tokens with perhaps 1 or 2 decimal places, which may also open the door to tacking on that extra 0.1% additional "upvote" you've always wanted! lol

However, this has also revealed a much larger potential issue for trading such assets against one another, so just be warned, be aware, and be extra careful with your pricing in such cases!

As always, I appreciate your upvote, your follow and all your comments!

H2
H3
H4
3 columns
2 columns
1 column
29 Comments