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

in beyondbitcoin •  7 years ago  (edited)

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!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hey @alexpmorris! Not to make this seem like a plug, but I did a little shoutout to you in my latest post here: https://steemit.com/steemit/@theywillkillyou/beginner-basics-your-steemit-wallet-steem-vs-sbd-vs-sp-powering-up-and-cashing-out

I hope you don't mind ;)

Happy to see you are finding issues and trying to solve them. Your skills are a valuable asset to the community. Thank you.

much appreciated @willybobob, thanks for the kind words! :)

  ·  12 days ago Reveal Comment
Loading...

thanks for info, i will make sure to be careful when i trade!

glad you found it helpful @cryptotraderx!

Good catch and thanks for the heads up! I would have walked right into that mistake if I traded them one for one.

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by alexpmorris from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, and someguy123. The goal is to help Steemit grow by supporting Minnows and creating a social network. Please find us in the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you like what we're doing please upvote this comment so we can continue to build the community account that's supporting all members.

Hmm, that's a big problem, but seems like it should be an easy fix, or at least they should issue a warning in the event they are going to use an entire whaleshare to pay commission.

hopefully now that it's out there and getting more exposure, they'll come up with some sort of fix for it!

the dex definitely shouldn't let you set a decimal price on a non dividable token.... however, I will talk to fuzzy and see if he will consider just trading them directly for bts and steem/steemdollars.

Thanks @alexpmorris - very informative as always! ;)

  ·  7 years ago (edited)

you're welcome ms. @michellectv, glad you found it "informative"! lol

Wow, dang, thanks for sharing!, I'll for sure be careful in the future!

no problem, @doubleddeyt, yeah be careful, it's a "jungle" out there! lol 😱

Good thing to bring up. Full tokens appear to "round" differently because of this. Or maybe it is because of the indivisible tokens. It ends up being that 1:1 can't be done and 1:2 is accepted and allowed so the seller doesn't get shorted. But the buyer may get shorted as a result apparently.

meep

right back at ya, meepster! 😱

I guess you have to be careful which websites are trading Bitcoins

  ·  7 years ago 

well played, keep up the good job

  ·  7 years ago 

great post , thank you for sharing :)
following you.

  ·  7 years ago 

Thanks for the information !!

  ·  7 years ago 

So we should wait for some days to get fixed all of this issue. Do you know how to buy whaleshares?

not saying you should necessarily wait, just be aware of the issue. if you buy BEYONDBIT:BTS you should be fine. Or just make sure your buy price matches a fixed ratio that can be easily matched. The best way to buy WHALESHARE is WHALESHARE:BTS in openledger

  ·  7 years ago 

But they say it cannot be bought. Have you bought some for yourself?

who is they? as you see above in the post, @jphenderson managed to buy some BEYONDBIT on the DEX yesterday. I also have some low bids on the BTS side as well.

By the way . Do you hear about UASF for bitcoin? Should I move btc wallet to exchanger who follow UASF?

The problem is I think bittrex still hasn't yet said anything about it, and they're one of the few that also supports STEEM/SBD. But I'm sure more will play out on all this before August 1st. Here's an excellent guide I found on the topic: https://www.weusecoins.com/uasf-guide/

Thank you, I will check it ! :)

  ·  7 years ago 

@alexpmorris thank you very much for the hint