Author Topic: price feeding review  (Read 3199 times)

0 Members and 1 Guest are viewing this topic.

Offline finn-bts

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: price feeding review
« Reply #45 on: November 23, 2018, 01:31:47 pm »
https://www.gdex.io/price here to check the premium data of bitCNY and bitUSD.
I tried him out. He looks great. Thank you.

Offline Thom

Re: price feeding review
« Reply #46 on: November 23, 2018, 03:16:48 pm »
Since very few were willing to contribute to this thread, I am posting a link to it here. @clockwork's description / proposal of how to conduct testing to achieve a tighter peg with sane limits is exactly why I started it.
Injustice anywhere is a threat to justice everywhere - MLK |  Verbaltech2 Witness Reports: https://bitsharestalk.org/index.php/topic,23902.0.html

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12846
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: price feeding review
« Reply #47 on: November 26, 2018, 01:27:11 pm »
I agree with @clockwork.
It seems to be an art to find a balance. Certainly we've learned alot from
BSIP42 even though some people in the community declare it a failure
already.

Maybe we can learn the lessons in such a way that it tells us how to use
a dynamic MCR once we have the backend fixed.

Sure...

My suggestion for dynamic adjustment once the backend is fixed is the following:


Set a range and centerpoint for MSSR..

Obviously, MSSR can't go below 100% so if we keep 110 as the "centerpoint", we allow witnesses to manipulate MSSR up to 120%.

This is our first, go to weapon when fighting a premium or discount.

If premium, we reduce MSSR down to 100 to reduce sell pressure and allow DEX price to climb and close premium

If discount, we increase up to 120 to increase bitUSD supply and close discount.

If we reach either of the limits and STILL in premium or discount, then and ONLY then do we start adjusting the MCR.

Again, let's keep something like 175 as a centerpoint and a range within which we can increase or decrease (say 150-200).

This means that if you keep your collateral above the max end of the range , you know you're safe making the adjustments predictable.

If we go beyond those ranges again, just leave it at those maxiumums or minimums. Behaviour will be the same as we used to have when it comes to premium or discount (sans adjustment) but will happen much less often and within a smaller range.

When "returning" from those maximums or minimums, we do it reversely... bring MCR back to centerpoint and then adjust MSSR afterwards (if still needed)

We've discusses the general idea on telegram and in other threads already.
Glad to see a witness propose an actual implementation.

+5% I like it
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline nutela

  • Newbie
  • *
  • Posts: 3
    • View Profile
  • BitShares: nut3l4
Re: price feeding review
« Reply #48 on: November 27, 2018, 05:49:27 pm »


BSIP42 narrowed the market space of BTS, in DEX, while trading pushed up the price in bitCNY, the feed price always go down as responding according to the negative feedback logic, BTS price in DEX have to follow BTS price in CEX, these discouraged more money to come.



"BTS price in DEX have to follow BTS price in CEX" Not sure what you are trying to say, BTS price on CEX would be logically more expensive since the CEX needs to have a price premium to exist.

Offline bitcrab

  • Committee member
  • Hero Member
  • *
  • Posts: 1265
    • View Profile
  • BitShares: bitcrab
  • GitHub: bitcrab
Re: price feeding review
« Reply #49 on: November 28, 2018, 03:43:23 am »
I agree with @clockwork.
It seems to be an art to find a balance. Certainly we've learned alot from
BSIP42 even though some people in the community declare it a failure
already.

Maybe we can learn the lessons in such a way that it tells us how to use
a dynamic MCR once we have the backend fixed.

Sure...

My suggestion for dynamic adjustment once the backend is fixed is the following:


Set a range and centerpoint for MSSR..

Obviously, MSSR can't go below 100% so if we keep 110 as the "centerpoint", we allow witnesses to manipulate MSSR up to 120%.

This is our first, go to weapon when fighting a premium or discount.

If premium, we reduce MSSR down to 100 to reduce sell pressure and allow DEX price to climb and close premium

If discount, we increase up to 120 to increase bitUSD supply and close discount.

If we reach either of the limits and STILL in premium or discount, then and ONLY then do we start adjusting the MCR.

Again, let's keep something like 175 as a centerpoint and a range within which we can increase or decrease (say 150-200).

This means that if you keep your collateral above the max end of the range , you know you're safe making the adjustments predictable.

If we go beyond those ranges again, just leave it at those maxiumums or minimums. Behaviour will be the same as we used to have when it comes to premium or discount (sans adjustment) but will happen much less often and within a smaller range.

When "returning" from those maximums or minimums, we do it reversely... bring MCR back to centerpoint and then adjust MSSR afterwards (if still needed)

in most of the cases, in bitCNY market, there is little difference between MSSR=120% and MSSR=102%, as most of the margin call orders are filled at the price which is very close to market price, I don't think that adjusting MSSR will give impact to premium/discount.

Offline clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 266
    • View Profile
  • BitShares: clockwork
Re: price feeding review
« Reply #50 on: November 28, 2018, 08:32:01 am »
Increasing MSSR will lower the margin call limit and eat away MORE of the bitUSD supply thus fighting discount without messing with MCR.

Similarly, decreasing MSSR will pull those orders away from market price to an extent thus fighting premium.

I think it should be our first adjustment before messing with MCR.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3496
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: price feeding review
« Reply #51 on: November 28, 2018, 11:01:55 am »
Increasing MSSR will lower the margin call limit and eat away MORE of the bitUSD supply thus fighting discount without messing with MCR.

Similarly, decreasing MSSR will pull those orders away from market price to an extent thus fighting premium.

I think it should be our first adjustment before messing with MCR.
Please keep in mind that if bitCNY is trading around par value, a big MSSR is only possible to pushes it away, especially when feed price is not adjusted.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 266
    • View Profile
  • BitShares: clockwork
Re: price feeding review
« Reply #52 on: November 28, 2018, 11:06:46 am »
Increasing MSSR will lower the margin call limit and eat away MORE of the bitUSD supply thus fighting discount without messing with MCR.

Similarly, decreasing MSSR will pull those orders away from market price to an extent thus fighting premium.

I think it should be our first adjustment before messing with MCR.
Please keep in mind that if bitCNY is trading around par value, a big MSSR is only possible to pushes it away, especially when feed price is not adjusted.

if it's trading near par , then hardly any premium/discount exists hence no reason to adjust MSSR.

The whole concept is about it being dynamic to tighten the peg.

Then again BSIP42 is voted out so all this is irrelevant

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3496
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: price feeding review
« Reply #53 on: November 28, 2018, 01:34:06 pm »
Since BSIP42 is voted out, I'm now feeding market price for CNY, with a floor to avoid global settlement.
Weighting algorithm didn't change.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 266
    • View Profile
  • BitShares: clockwork
Re: price feeding review
« Reply #54 on: December 04, 2018, 10:01:17 am »
I agree with @clockwork.
It seems to be an art to find a balance. Certainly we've learned alot from
BSIP42 even though some people in the community declare it a failure
already.

Maybe we can learn the lessons in such a way that it tells us how to use
a dynamic MCR once we have the backend fixed.

Sure...

My suggestion for dynamic adjustment once the backend is fixed is the following:


Set a range and centerpoint for MSSR..

Obviously, MSSR can't go below 100% so if we keep 110 as the "centerpoint", we allow witnesses to manipulate MSSR up to 120%.

This is our first, go to weapon when fighting a premium or discount.

If premium, we reduce MSSR down to 100 to reduce sell pressure and allow DEX price to climb and close premium

If discount, we increase up to 120 to decrease bitUSD supply and close discount.

If we reach either of the limits and STILL in premium or discount, then and ONLY then do we start adjusting the MCR.

Again, let's keep something like 175 as a centerpoint and a range within which we can increase or decrease (say 150-200).

This means that if you keep your collateral above the max end of the range , you know you're safe making the adjustments predictable.

If we go beyond those ranges again, just leave it at those maxiumums or minimums. Behaviour will be the same as we used to have when it comes to premium or discount (sans adjustment) but will happen much less often and within a smaller range.

When "returning" from those maximums or minimums, we do it reversely... bring MCR back to centerpoint and then adjust MSSR afterwards (if still needed)

Offline bitcrab

  • Committee member
  • Hero Member
  • *
  • Posts: 1265
    • View Profile
  • BitShares: bitcrab
  • GitHub: bitcrab
Re: price feeding review
« Reply #55 on: April 11, 2019, 07:45:19 am »
recently, bitCNY price feed is always 1%-2%+ lower than DEX price, at the same time , bitCNY still has an about 0.3% premium.

as bitCNY has a 2% force settlement offset, this provide chances for speculators to exploit debt position owners, this is not reasonable.

and at the same time, we heard many traders complained that the witnesses doing bad in price feeding, and this unconvinced them that BTS worth trust.

I feel we need to pay more attention on this, and need to review how to guarantee the price feed well enough.





my first consideration is that, we need to give the DEX price more weight, because:

1. price feed are serving DEX margin trading, naturally DEX price should have most weight.
2.DEX BTS/bitCNY pair has the biggest volume without any faking.
3.BTS/bitCNY is the closest price we can get, and is most direct, prices from other CEXs need always convert from USDT/BTC, many distortion there.

but at the same time, we cannot depend only on DEX price, as there's possibility that whales borrowed and manipulate market.

I suggest such an CNY price feeding algorithm for reference:

Code: [Select]
Pdex: DEX price that has been modified by bitCNY premium/discount factor
Pcex: price get from CEX

if Pdex>1.2*Pcex:  ## to cope with unusual exreme issues.
   Pfeed = Pcex
otherwise:
   Pfeed = max(Pcex, Pdex)
« Last Edit: April 11, 2019, 10:28:21 am by bitcrab »

Online binggo

  • Hero Member
  • *****
  • Posts: 884
    • View Profile
Re: price feeding review
« Reply #56 on: April 11, 2019, 09:09:21 am »
Pdex: DEX price that has been modified by bitCNY premium/discount factor
Pcex: price get from CEX

if Pdex>1.2*Pcex:  ## to cope with unusual exreme issues.
   Pfeed = Pcex
otherwise:
   Pfeed = max(Pcex, Pdex)

1.2 or 1.02?
or 1.05?
« Last Edit: April 11, 2019, 09:17:45 am by binggo »

Offline bitcrab

  • Committee member
  • Hero Member
  • *
  • Posts: 1265
    • View Profile
  • BitShares: bitcrab
  • GitHub: bitcrab
Re: price feeding review
« Reply #57 on: April 11, 2019, 10:30:36 am »
Pdex: DEX price that has been modified by bitCNY premium/discount factor
Pcex: price get from CEX

if Pdex>1.2*Pcex:  ## to cope with unusual exreme issues.
   Pfeed = Pcex
otherwise:
   Pfeed = max(Pcex, Pdex)

1.2 or 1.02?
or 1.05?

1.2, " Pdex>1.2*Pcex" is to define unusual conditions, however, to smooth the price change, maybe this logic can be updated to:

if Pdex>1.2*Pcex:  ## to cope with unusual exreme issues.
   Pfeed = (Pcex+Pdex)/2

« Last Edit: April 11, 2019, 10:32:56 am by bitcrab »