BitShares Forum

Main => General Discussion => Topic started by: theoretical on August 31, 2014, 05:05:52 am

Title: Role of the price feeds in 0.4.10 version?
Post by: theoretical on August 31, 2014, 05:05:52 am

bytemaster said 0.4.10 "switches to price feeds rather than moving average" here:  https://bitsharestalk.org/index.php?topic=8011.msg105611#msg105611

Does anyone know exactly how the price feeds will be used, and what they'll be used for?

There was some discussion that the median price feed might be used as the margin call price, and/or as a basis for floor / ceiling on trading.  Is the feed used for one of these purposes?

If the median is going to be used in one of these roles, or otherwise seriously affect my trading activity, the UI needs to show it.  By "accessible" I mean some way to filter red (outdated) feeds, sort the remaining price feeds, and put some kind of bar where the median is.

If price feeds need constant and accurate updates to make the market work, we need to make sure delegates are educated about their new responsibilities to maintain a current price feed, and give them a little time to set up scripts or other procedures to make that happen.

If price feeds have a major role in 0.4.10, information about the change needs to be a lot more accessible than a single post buried many replies deep that simply says "we've switched to price feeds."
Title: Re: Role of the price feeds in 0.4.10 version?
Post by: puppies on August 31, 2014, 08:08:08 am
I believe the median price feed will be used as a floor that you will not be able to short below.  You will still be able to buy/sell above and below that, and I believe it is the buying and selling price that will trigger margin calls. 
Title: Re: Role of the price feeds in 0.4.10 version?
Post by: bytemaster on August 31, 2014, 07:42:27 pm
I believe the median price feed will be used as a floor that you will not be able to short below.  You will still be able to buy/sell above and below that, and I believe it is the buying and selling price that will trigger margin calls.

It is the combination of highest bid and median that will trigger a margin call.   If the feed were to fall to 0, but there were still bids, then no margin will be called. 
Title: Re: Role of the price feeds in 0.4.10 version?
Post by: bitmeat on August 31, 2014, 07:44:26 pm
I believe the median price feed will be used as a floor that you will not be able to short below.  You will still be able to buy/sell above and below that, and I believe it is the buying and selling price that will trigger margin calls.

It is the combination of highest bid and median that will trigger a margin call.   If the feed were to fall to 0, but there were still bids, then no margin will be called.

Shouldn't an actual trade price trigger the margin call?
Title: Re: Role of the price feeds in 0.4.10 version?
Post by: bytemaster on August 31, 2014, 07:47:33 pm
I believe the median price feed will be used as a floor that you will not be able to short below.  You will still be able to buy/sell above and below that, and I believe it is the buying and selling price that will trigger margin calls.

It is the combination of highest bid and median that will trigger a margin call.   If the feed were to fall to 0, but there were still bids, then no margin will be called.

Shouldn't an actual trade price trigger the margin call?

No... the mere fact that the highest offer is less than the call price is good enough.  I should have been more precise... "If the feed were to fall to 0, but there were still bids above the call price that are not being accepted, then those bids are a more accurate measure of price than the feed".    A "feed" is in theory an actual trade price on a foreign exchange.
Title: Re: Role of the price feeds in 0.4.10 version?
Post by: theoretical on August 31, 2014, 08:07:51 pm

And how can I find the median price feed?  Is that information somewhere in the GUI?  Or do I have to write a script to pull all the price feeds from the JSON-RPC and calculate the median myself?
Title: Re: Role of the price feeds in 0.4.10 version?
Post by: bytemaster on August 31, 2014, 08:09:28 pm

And how can I find the median price feed?  Is that information somewhere in the GUI?  Or do I have to write a script to pull all the price feeds from the JSON-RPC and calculate the median myself?

blockchain_get_feeds_for_asset USD

The last item will have the name "MEDIAN" if there are 51 feeds less than 1 day old.   Otherwise "no median" exists.
Title: Re: Role of the price feeds in 0.4.10 version?
Post by: tonyk on August 31, 2014, 08:22:30 pm
I believe the median price feed will be used as a floor that you will not be able to short below.  You will still be able to buy/sell above and below that, and I believe it is the buying and selling price that will trigger margin calls.

It is the combination of highest bid and median that will trigger a margin call.   If the feed were to fall to 0, but there were still bids, then no margin will be called.

Shouldn't someone (read you) post some brief (like 10-15 lines) of the new market rules in 0.4.10? And update them as changes come along.
Title: Re: Role of the price feeds in 0.4.10 version?
Post by: ElMato on September 02, 2014, 04:59:13 pm
That will be very useful, i need it to explain the whole thing on friday ...
Title: Re: Role of the price feeds in 0.4.10 version?
Post by: ElMato on September 02, 2014, 06:57:25 pm
Please help me with my understanding so far.

Market On:
 - ask side >= 10M BTSX
 - bid side >= 10M BTSX
 - 51 feed not older than 24hs

Rules:
 - Median price of feeds is calculated by the hour (?)
 - If the price moves by more than 1% in a given trading round then trading is temporarily suspended for 5 minutes (?)
 - Cant short below Median price

By the time a bid matches a short:

    1) a margin order is created with 2x collateral (ej: short 10 USD @ 35 BTSX => new margin order with 700 BTSX collateral = 350 from short + 350 from bid)

    2) margin call is triggered when the highest bid is less than the call price and is within 10% of the Median price. (?)
       call price for the margin order will be 700 BTSX * 0.75 / 10 USD = 52.5 BTSX/USD

    3) collateral can be added to move the call price (wallet_market_add_collateral)

    4) To cover my short i have to buy same amount of USD on market first and then cover with wallet_market_cover.