BitShares Forum
Main => General Discussion => Topic started by: alt on December 03, 2014, 04:57:00 am
-
let's assume current feed price is 0.02USD/BTS
the ask order:
a1. 0.019
a2. 0.02
....
the short order:
b1. interest 10%, limit 0.025
b2. interest 30%, limit 0.019
the bid order:
c1. 0.0195
c2. 0.018
which two orders will execute first?
from the source code, looks like a1 match b2 first, am I wrong?
-
Why would b2 get executed at all? Its limit is below the feed.
Also it's a bit confusing that a1 refers to two different orders :)
-
sorry, bid order is c1,c2.
from the source code,when c1 is less than feed price, short order will execute first.
and short order is sort by interest rate.
so b2 is the first order to execute
来自我的 HUAWEI P7-L00 上的 Tapatalk
-
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!
-
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 );
}
}