Author Topic: price feeding review  (Read 17293 times)

0 Members and 1 Guest are viewing this topic.

Offline bitcrab

  • Committee member
  • Hero Member
  • *
  • Posts: 1928
    • View Profile
  • BitShares: bitcrab
  • GitHub: bitcrab
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 »
Email:bitcrab@qq.com

Offline binggo

  • Hero Member
  • *****
  • Posts: 2374
  • 世间太多瘪犊子
    • View Profile
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: 1928
    • View Profile
  • BitShares: bitcrab
  • GitHub: bitcrab
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 »
Email:bitcrab@qq.com

Offline clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 376
    • View Profile
  • BitShares: clockwork
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 abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
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.
BitShares committee member: abit
BitShares witness: in.abit

Offline clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 376
    • View Profile
  • BitShares: clockwork
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: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
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.
BitShares committee member: abit
BitShares witness: in.abit

Offline clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 376
    • View Profile
  • BitShares: clockwork
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 bitcrab

  • Committee member
  • Hero Member
  • *
  • Posts: 1928
    • View Profile
  • BitShares: bitcrab
  • GitHub: bitcrab
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.
Email:bitcrab@qq.com

Offline nutela

  • Newbie
  • *
  • Posts: 3
    • View Profile
  • BitShares: nut3l4


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 xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
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

Offline Thom

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 finn-bts

  • Sr. Member
  • ****
  • Posts: 234
    • View Profile
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 clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 376
    • View Profile
  • BitShares: clockwork
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)

Offline bitcrab

  • Committee member
  • Hero Member
  • *
  • Posts: 1928
    • View Profile
  • BitShares: bitcrab
  • GitHub: bitcrab
https://www.gdex.io/price here to check the premium data of bitCNY and bitUSD.
Email:bitcrab@qq.com