Do shorts fill below the price feed?

Started by biophil, December 03, 2014, 07:16:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

biophil

Quote from: bytemaster on December 04, 2014, 12:24:22 AM
Quote from: biophil on December 04, 2014, 12:00:14 AM
Quote from: toast on December 03, 2014, 10:20:23 PM
Quote from: arhag on December 03, 2014, 10:12:28 PM
Quote from: toast on December 03, 2014, 09:30:19 PM
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."

bytemaster

Quote from: biophil on December 04, 2014, 12:00:14 AM
Quote from: toast on December 03, 2014, 10:20:23 PM
Quote from: arhag on December 03, 2014, 10:12:28 PM
Quote from: toast on December 03, 2014, 09:30:19 PM
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: [url="http://bytemaster.bitshares.org"]http://bytemaster.bitshares.org[/url]
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.

biophil

Quote from: toast on December 03, 2014, 10:20:23 PM
Quote from: arhag on December 03, 2014, 10:12:28 PM
Quote from: toast on December 03, 2014, 09:30:19 PM
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."

arhag

Quote from: tonyk2 on December 03, 2014, 10:35:36 PM

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


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.


toast

Quote from: arhag on December 03, 2014, 10:12:28 PM
Quote from: toast on December 03, 2014, 09:30:19 PM
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.

arhag

Quote from: toast on December 03, 2014, 09:30:19 PM
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.

toast

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.

Markus

Quote from: alt on December 03, 2014, 01:07:27 PM
Quote from: Markus on December 03, 2014, 11:59:19 AM
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)

                // 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

#2
They should fill at the shorts min. price (i.e price limit), according to Agent86.
https://bitsharestalk.org/index.php?topic=11674.msg157545#msg157545

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."