Author Topic: Do shorts fill below the price feed?  (Read 2301 times)

0 Members and 1 Guest are viewing this topic.

Offline biophil

  • Hero Member
  • *****
  • Posts: 880
  • Professor of Computer Science
    • View Profile
    • My Academic Website
  • BitShares: biophil
Remember BM thinks backwards so actually it is

max(feed_price, ask_price)

And apparently the code is written in this backwards way! Thanks for the clarification. It took me half a minute after reading Markus's post to realize the code didn't have a huge bug.

It just doesn't make sense. It is one thing to say the price of BTS is X BitUSD. But saying the price of BTS is Y BitOil (in other words, the price of 1 BTS is Y barrels of light sweet crude oil) is just weird.

Not to mention that every single UIA market is "asset per dollar"... Apparently it was more logical to make USD the last reserved asset to maximize number of "correct" market orientations in backwards-land than it was to have a normal orientation and order assets by importance (BTS > USD > BTC > all later assets)

I know how design decisions go; you don't always think them through as well as you should, and then they're set in stone. But how BM ever thought this would be better is a complete mystery to me. This is probably the best evidence we have that "bytemaster is only human." :)

Well it happened because I coded everything as if the BitAsset were USD so that I could THINK in terms of USD and thus eliminate bugs caused by getting the order backwards all the time.  I picked a standard I could reason in and stuck with it. 

As far as the order of the assets I knew there was no "right way" and that we would have to let the user pick how they wanted to view it in the GUI.

Yeah, I get it. I'm not really complaining. Making choices like that is just part of the design process, and since you were the guy with the vision, you got to make the choices.

Sent from my SCH-S720C using Tapatalk 2

Support our research efforts to improve BitAsset price-pegging! Vote for worker 1.14.204 "201907-uccs-research-project."

Offline bytemaster

Remember BM thinks backwards so actually it is

max(feed_price, ask_price)

And apparently the code is written in this backwards way! Thanks for the clarification. It took me half a minute after reading Markus's post to realize the code didn't have a huge bug.

It just doesn't make sense. It is one thing to say the price of BTS is X BitUSD. But saying the price of BTS is Y BitOil (in other words, the price of 1 BTS is Y barrels of light sweet crude oil) is just weird.

Not to mention that every single UIA market is "asset per dollar"... Apparently it was more logical to make USD the last reserved asset to maximize number of "correct" market orientations in backwards-land than it was to have a normal orientation and order assets by importance (BTS > USD > BTC > all later assets)

I know how design decisions go; you don't always think them through as well as you should, and then they're set in stone. But how BM ever thought this would be better is a complete mystery to me. This is probably the best evidence we have that "bytemaster is only human." :)

Well it happened because I coded everything as if the BitAsset were USD so that I could THINK in terms of USD and thus eliminate bugs caused by getting the order backwards all the time.  I picked a standard I could reason in and stuck with it. 

As far as the order of the assets I knew there was no "right way" and that we would have to let the user pick how they wanted to view it in the GUI.

For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline biophil

  • Hero Member
  • *****
  • Posts: 880
  • Professor of Computer Science
    • View Profile
    • My Academic Website
  • BitShares: biophil
Remember BM thinks backwards so actually it is

max(feed_price, ask_price)

And apparently the code is written in this backwards way! Thanks for the clarification. It took me half a minute after reading Markus's post to realize the code didn't have a huge bug.

It just doesn't make sense. It is one thing to say the price of BTS is X BitUSD. But saying the price of BTS is Y BitOil (in other words, the price of 1 BTS is Y barrels of light sweet crude oil) is just weird.

Not to mention that every single UIA market is "asset per dollar"... Apparently it was more logical to make USD the last reserved asset to maximize number of "correct" market orientations in backwards-land than it was to have a normal orientation and order assets by importance (BTS > USD > BTC > all later assets)

I know how design decisions go; you don't always think them through as well as you should, and then they're set in stone. But how BM ever thought this would be better is a complete mystery to me. This is probably the best evidence we have that "bytemaster is only human." :)
Support our research efforts to improve BitAsset price-pegging! Vote for worker 1.14.204 "201907-uccs-research-project."

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag

You guys are too picky... My local store is regularly selling me 0.42 2-liter bottles of coke per dollar and my local car dealer even offered me 0.000045 cars per dollar just last week.

 :P  +5%

zerosum

  • Guest

You guys are too picky... My local store is regularly selling me 0.42 2-liter bottles of coke per dollar and my local car dealer even offered me 0.000045 cars per dollar just last week.


Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
Remember BM thinks backwards so actually it is

max(feed_price, ask_price)

And apparently the code is written in this backwards way! Thanks for the clarification. It took me half a minute after reading Markus's post to realize the code didn't have a huge bug.

It just doesn't make sense. It is one thing to say the price of BTS is X BitUSD. But saying the price of BTS is Y BitOil (in other words, the price of 1 BTS is Y barrels of light sweet crude oil) is just weird.

Not to mention that every single UIA market is "asset per dollar"... Apparently it was more logical to make USD the last reserved asset to maximize number of "correct" market orientations in backwards-land than it was to have a normal orientation and order assets by importance (BTS > USD > BTC > all later assets)
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag
Remember BM thinks backwards so actually it is

max(feed_price, ask_price)

And apparently the code is written in this backwards way! Thanks for the clarification. It took me half a minute after reading Markus's post to realize the code didn't have a huge bug.

It just doesn't make sense. It is one thing to say the price of BTS is X BitUSD. But saying the price of BTS is Y BitOil (in other words, the price of 1 BTS is Y barrels of light sweet crude oil) is just weird.

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
Remember BM thinks backwards so actually it is

max(feed_price, ask_price)

So you should be able to profit from shorting.
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline Markus

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
I don't know if this is related to your problem but I experienced a situation I would call a bug as well:

Imagine the feed is 0.02 USD/BTS
There are no open short orders and no relevant open bids.
There is one open ask at 0.019 (so on the far side of the peg, something happening not often in the current market).

Now I post a short order limited at 0.019.

What happens is that the trade is executed because it matches an ask. BUT because shorts are always executed at the feed I actually pay 0.02 even though this is above my limit!

short will execute at price of min(feed price, limit price)
Code: [Select]
                // Always execute shorts at the feed price
                mtrx.bid_price = *_feed_price;

                // Skip shorts that are over the price limit.
                if( _current_bid->state.short_price_limit.valid() )
                {
                  if( *_current_bid->state.short_price_limit < mtrx.ask_price )
                  {
                      _current_bid.reset(); continue;
                  }
                  mtrx.bid_price = std::min( *_current_bid->state.short_price_limit, mtrx.bid_price );
                }
            }

zerosum

  • Guest
They should fill at the shorts min. price (i.e price limit), according to Agent86.
https://bitsharestalk.org/index.php?topic=11674.msg157545#msg157545
« Last Edit: December 03, 2014, 09:19:10 pm by tonyk2 »

Offline biophil

  • Hero Member
  • *****
  • Posts: 880
  • Professor of Computer Science
    • View Profile
    • My Academic Website
  • BitShares: biophil
For a brief period today, BitCNY was trading at a huge premium to real CNY. I entered a couple small shorts to try to take advantage of the opportunity, and it looks like it worked, but I wanted to get it from a dev:

When a bitAsset trades at a premium, do shorts fill at the price feed, or do they fill at the ask price (which is below the price feed)? Obviously, it is absolutely crucial that the answer be the latter. It's not usually been an issue for BTS because most of the time, BitAssets trade at a discount. But if they suddenly start trading at a premium, it's essential that people can profit by short selling.
Support our research efforts to improve BitAsset price-pegging! Vote for worker 1.14.204 "201907-uccs-research-project."