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: Do shorts fill below the price feed?  (Read 452 times)

0 Members and 1 Guest are viewing this topic.

Offline biophil

  • Hero Member
  • *****
  • Posts: 814
  • Incentives run the world
    • View Profile
    • Sign up for a Bitshares account!
  • BTS: zebulon
Do shorts fill below the price feed?
« on: December 03, 2014, 07:16:46 PM »

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.

zerosum

  • Guest
Re: Do shorts fill below the price feed?
« Reply #1 on: December 03, 2014, 09:16:33 PM »
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 Markus

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
Re: Do shorts fill below the price feed?
« Reply #2 on: December 03, 2014, 09:24:33 PM »
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 );
                }
            }

Offline toast

Re: Do shorts fill below the price feed?
« Reply #3 on: December 03, 2014, 09:30:19 PM »
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 arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BTS: arhag
  • GitHub: arhag
Re: Do shorts fill below the price feed?
« Reply #4 on: December 03, 2014, 10:12:28 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.

Offline toast

Re: Do shorts fill below the price feed?
« Reply #5 on: December 03, 2014, 10:20:23 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.

zerosum

  • Guest
Re: Do shorts fill below the price feed?
« Reply #6 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.


Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BTS: arhag
  • GitHub: arhag
Re: Do shorts fill below the price feed?
« Reply #7 on: December 03, 2014, 11:52:51 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%

Offline biophil

  • Hero Member
  • *****
  • Posts: 814
  • Incentives run the world
    • View Profile
    • Sign up for a Bitshares account!
  • BTS: zebulon
Re: Do shorts fill below the price feed?
« Reply #8 on: December 04, 2014, 12:00:14 AM »
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." :)

Offline bytemaster

Re: Do shorts fill below the price feed?
« Reply #9 on: December 04, 2014, 12:24:22 AM »
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: 814
  • Incentives run the world
    • View Profile
    • Sign up for a Bitshares account!
  • BTS: zebulon
Re: Do shorts fill below the price feed?
« Reply #10 on: December 05, 2014, 03:22:18 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


 

Google+