Author Topic: The Market Peg Works!  (Read 23828 times)

0 Members and 1 Guest are viewing this topic.

Offline biophil

  • Hero Member
  • *****
  • Posts: 880
  • Professor of Computer Science
    • View Profile
    • My Academic Website
  • BitShares: biophil
+5% for jakub!

Sent from my SCH-S720C using Tapatalk 2

Support our research efforts to improve BitAsset price-pegging! Vote for worker 1.14.204 "201907-uccs-research-project."

Offline boombastic

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • AngelShares Explorer


First I will summarize the rules for BitAsset markets assuming the BTSX : USD market where BTSX is priced in terms of USD.  For the purpose of providing concrete examples, we will assume a median price of $0.03 per BTSX.

1) 51 delegates or more must publish a price feed at least once per day
     - if they do not publish the feed, then the market reverts to a 1hr moving average.
     - if a feed is published, the 1hr moving average is set to the feed.
2) No short orders can be published to the network at a price 11% above the 1 hour moving average. (ie: they must be less than 0.0333)
     - the minimal short quantity is 100 BTSX
3) Short orders will only be matched against asks that are below the moving average. (ie: people must be selling BTSX for less than $0.03)
     - the highest short order is matched first, so a short selling USD at $0.03333 will be matched against someone buying USD at $.02999 and the difference (0.003333) * volume is captured as a fee.
4) A margin call will be executed any time the highest bid is greater than 90% of the moving average and the highest bid is less than the call price.
    - the initial call price is 66% of the short price (ie: $0.022 for a short entered at $.033).  This is the price at which 75% of the collateral would be required to buy back the USD necessary to cover the position.
    - If a margin call is executed and there is any collateral left over, then 5% is kept as network fees and 95% is returned to the owner. 
5) There are no restrictions on what prices people can set for normal BitUSD/BTSX trading.  All parties will receive what they ask for.
6) Rounding errors are inevitable when using fixed point math, any such rounding error is deemed to be a network fee.
    - for example you may place an order to buy $1.00 USD but end up with $0.99999 USD. 
7) The network saves all fees earned in USD and in the event that a short position lacks the necessary collateral to cover during rapid market movements, then the network will provide the stored USD.
8) You cannot use the collateral of your short position to buy the USD necessary to cover the position.  This USD must be purchased separately. 
    - This requirement creates a kind of "virtual collateral" that all shorts must maintain so they can cover for either profit taking or loss prevention.
9) When you partially cover a position it will reduce your exposure, but your collateral is not returned until the position is fully covered. 


I fully agree with the new rules but I find it confusing when we talk about short orders while looking at the market of BTSX being priced in terms of USD. So I've made an attempt to translate the rules into USD/BTSX terms. Maybe some of you will find it useful. The changes are marked in bold. Please correct me if I made any mistakes.


The rules for BitAsset markets assuming the USD/BTSX market where USD is priced in terms of BTSX.  For the purpose of providing concrete examples, we will assume a median price of BTSX 30 per USD.

1.) 51 delegates or more must publish a price feed at least once per day
     - if they do not publish the feed, then the market reverts to a 1hr moving average.
     - if a feed is published, the 1hr moving average is set to the feed.

2.) No short orders can be published to the network at a price below 90% of the 1 hour moving average. (ie: they must be more than BTSX 27.00)
     - the minimal short quantity is 100 BTSX

3.) Short orders will only be matched against bids that are above the moving average. (ie: people must be buying USD for more than BTSX 30.00)
     - the lowest short order is matched first, so a short selling USD at BTSX 27.01 will be matched against someone buying USD at BTSX 30.01 and the difference (BTSX 3.00) * volume is captured as a fee.

4.) A margin call will be executed any time the lowest ask is less than 110% of the moving average and the lowest ask is more than the call price.
    - the initial call price is 150% of the short price (ie: BTSX 45.00 for a short entered at BTSX 30.00).  This is the price at which 75% of the collateral would be required to buy back the USD necessary to cover the position.
    - If a margin call is executed and there is any collateral left over, then 5% is kept as network fees and 95% is returned to the owner. 

5.) There are no restrictions on what prices people can set for normal BitUSD/BTSX trading.  All parties will receive what they ask for.

6.) Rounding errors are inevitable when using fixed point math, any such rounding error is deemed to be a network fee.
    - for example you may place an order to buy $1.00 USD but end up with $0.99999 USD. 

7.) The network saves all fees earned in BTSX and in the event that a short position lacks the necessary collateral to cover during rapid market movements, then the network will provide the stored BTSX.

8.) You cannot use the collateral of your short position to buy the USD necessary to cover the position.  This USD must be purchased separately. 
    - This requirement creates a kind of "virtual collateral" that all shorts must maintain so they can cover for either profit taking or loss prevention.

9.) When you partially cover a position it will reduce your exposure, but your collateral is not returned until the position is fully covered.

+5%


Sent from my iPhone using Tapatalk
http://bitshares.dacplay.org/r/boombastic
Support My Witness: mr.agsexplorer
BTC: 1Bb6V1UStz45QMAamjaX8rDjsnQnBpHvE8

Offline starspirit

  • Hero Member
  • *****
  • Posts: 948
  • Financial markets pro over 20 years
    • View Profile
  • BitShares: starspirit

First I will summarize the rules for BitAsset markets assuming the BTSX : USD market where BTSX is priced in terms of USD.  For the purpose of providing concrete examples, we will assume a median price of $0.03 per BTSX.

1) 51 delegates or more must publish a price feed at least once per day
     - if they do not publish the feed, then the market reverts to a 1hr moving average.
     - if a feed is published, the 1hr moving average is set to the feed.
2) No short orders can be published to the network at a price 11% above the 1 hour moving average. (ie: they must be less than 0.0333)
     - the minimal short quantity is 100 BTSX
3) Short orders will only be matched against asks that are below the moving average. (ie: people must be selling BTSX for less than $0.03)
     - the highest short order is matched first, so a short selling USD at $0.03333 will be matched against someone buying USD at $.02999 and the difference (0.003333) * volume is captured as a fee.
4) A margin call will be executed any time the highest bid is greater than 90% of the moving average and the highest bid is less than the call price.
    - the initial call price is 66% of the short price (ie: $0.022 for a short entered at $.033).  This is the price at which 75% of the collateral would be required to buy back the USD necessary to cover the position.
    - If a margin call is executed and there is any collateral left over, then 5% is kept as network fees and 95% is returned to the owner. 
5) There are no restrictions on what prices people can set for normal BitUSD/BTSX trading.  All parties will receive what they ask for.
6) Rounding errors are inevitable when using fixed point math, any such rounding error is deemed to be a network fee.
    - for example you may place an order to buy $1.00 USD but end up with $0.99999 USD. 
7) The network saves all fees earned in USD and in the event that a short position lacks the necessary collateral to cover during rapid market movements, then the network will provide the stored USD.
8) You cannot use the collateral of your short position to buy the USD necessary to cover the position.  This USD must be purchased separately. 
    - This requirement creates a kind of "virtual collateral" that all shorts must maintain so they can cover for either profit taking or loss prevention.
9) When you partially cover a position it will reduce your exposure, but your collateral is not returned until the position is fully covered. 


I fully agree with the new rules but I find it confusing when we talk about short orders while looking at the market of BTSX being priced in terms of USD. So I've made an attempt to translate the rules into USD/BTSX terms. Maybe some of you will find it useful. The changes are marked in bold. Please correct me if I made any mistakes.


The rules for BitAsset markets assuming the USD/BTSX market where USD is priced in terms of BTSX.  For the purpose of providing concrete examples, we will assume a median price of BTSX 30 per USD.

1.) 51 delegates or more must publish a price feed at least once per day
     - if they do not publish the feed, then the market reverts to a 1hr moving average.
     - if a feed is published, the 1hr moving average is set to the feed.

2.) No short orders can be published to the network at a price below 90% of the 1 hour moving average. (ie: they must be more than BTSX 27.00)
     - the minimal short quantity is 100 BTSX

3.) Short orders will only be matched against bids that are above the moving average. (ie: people must be buying USD for more than BTSX 30.00)
     - the lowest short order is matched first, so a short selling USD at BTSX 27.01 will be matched against someone buying USD at BTSX 30.01 and the difference (BTSX 3.00) * volume is captured as a fee.

4.) A margin call will be executed any time the lowest ask is less than 110% of the moving average and the lowest ask is more than the call price.
    - the initial call price is 150% of the short price (ie: BTSX 45.00 for a short entered at BTSX 30.00).  This is the price at which 75% of the collateral would be required to buy back the USD necessary to cover the position.
    - If a margin call is executed and there is any collateral left over, then 5% is kept as network fees and 95% is returned to the owner. 

5.) There are no restrictions on what prices people can set for normal BitUSD/BTSX trading.  All parties will receive what they ask for.

6.) Rounding errors are inevitable when using fixed point math, any such rounding error is deemed to be a network fee.
    - for example you may place an order to buy $1.00 USD but end up with $0.99999 USD. 

7.) The network saves all fees earned in BTSX and in the event that a short position lacks the necessary collateral to cover during rapid market movements, then the network will provide the stored BTSX.

8.) You cannot use the collateral of your short position to buy the USD necessary to cover the position.  This USD must be purchased separately. 
    - This requirement creates a kind of "virtual collateral" that all shorts must maintain so they can cover for either profit taking or loss prevention.

9.) When you partially cover a position it will reduce your exposure, but your collateral is not returned until the position is fully covered.

Brilliant, thanks for that. I had a hard time trying to reverse everything in my head as I read the original...

Offline liondani

  • Hero Member
  • *****
  • Posts: 3737
  • Inch by inch, play by play
    • View Profile
    • My detailed info
  • BitShares: liondani
  • GitHub: liondani
Could you also put the option of overlaying the real-world USD/BTSX price on the graph so that we can see how close the peg is holding? Or, putting a USD/BitUSD chart might be even better.

 +5%

Offline biophil

  • Hero Member
  • *****
  • Posts: 880
  • Professor of Computer Science
    • View Profile
    • My Academic Website
  • BitShares: biophil
Great news :)

For some visual information about how this works, I've added shorts and the 90% rule for shorts to my asset pages, check it out:

http://bitsharesblocks.com/assets/asset?id=USD

Btw you can click on "Bid","Ask" or "Short" to enable or disable a given series, oh and I added the "reserve fund" info as well :)

thanks for your efforts man!

Some suggestions: 
    remove the "point boxes" in the depth chart.
    display "shorts" as a 3rd volume on the depth chart that has "2 colors"... one for those over the median and one for those under.  We are adding this for the built in wallet.
    I would love to see a price history chart.   

1 and 3 done! Splitting the shorts will have to wait, but you'll find the price history below the market depth info! I used the hourly data only for now, looks like it's good enough.

That asset page is starting to get a little messy now however, will have to clean things up a bit next, but going to bed for now.

Looking great! this will be fantastic for on-the-fly peg checking :) Could you also put the option of overlaying the real-world USD/BTSX price on the graph so that we can see how close the peg is holding? Or, putting a USD/BitUSD chart might be even better.
Support our research efforts to improve BitAsset price-pegging! Vote for worker 1.14.204 "201907-uccs-research-project."

Offline James212

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
My main takeaway from all of this has been that this experiment is like learning to ride a bike. At first you don’t have the confidence to give yourself  momentum. Instead, you learn with training wheels. Once you have confidence to give yourself momentum, the training wheels can be removed and you’ll never forget how to ride a bike.

 +5%
BTS: theangelwaveproject

Offline svk

Great news :)

For some visual information about how this works, I've added shorts and the 90% rule for shorts to my asset pages, check it out:

http://bitsharesblocks.com/assets/asset?id=USD

Btw you can click on "Bid","Ask" or "Short" to enable or disable a given series, oh and I added the "reserve fund" info as well :)

thanks for your efforts man!

Some suggestions: 
    remove the "point boxes" in the depth chart.
    display "shorts" as a 3rd volume on the depth chart that has "2 colors"... one for those over the median and one for those under.  We are adding this for the built in wallet.
    I would love to see a price history chart.   

1 and 3 done! Splitting the shorts will have to wait, but you'll find the price history below the market depth info! I used the hourly data only for now, looks like it's good enough.

That asset page is starting to get a little messy now however, will have to clean things up a bit next, but going to bed for now.
Worker: dev.bitsharesblocks

jakub

  • Guest

First I will summarize the rules for BitAsset markets assuming the BTSX : USD market where BTSX is priced in terms of USD.  For the purpose of providing concrete examples, we will assume a median price of $0.03 per BTSX.

1) 51 delegates or more must publish a price feed at least once per day
     - if they do not publish the feed, then the market reverts to a 1hr moving average.
     - if a feed is published, the 1hr moving average is set to the feed.
2) No short orders can be published to the network at a price 11% above the 1 hour moving average. (ie: they must be less than 0.0333)
     - the minimal short quantity is 100 BTSX
3) Short orders will only be matched against asks that are below the moving average. (ie: people must be selling BTSX for less than $0.03)
     - the highest short order is matched first, so a short selling USD at $0.03333 will be matched against someone buying USD at $.02999 and the difference (0.003333) * volume is captured as a fee.
4) A margin call will be executed any time the highest bid is greater than 90% of the moving average and the highest bid is less than the call price.
    - the initial call price is 66% of the short price (ie: $0.022 for a short entered at $.033).  This is the price at which 75% of the collateral would be required to buy back the USD necessary to cover the position.
    - If a margin call is executed and there is any collateral left over, then 5% is kept as network fees and 95% is returned to the owner. 
5) There are no restrictions on what prices people can set for normal BitUSD/BTSX trading.  All parties will receive what they ask for.
6) Rounding errors are inevitable when using fixed point math, any such rounding error is deemed to be a network fee.
    - for example you may place an order to buy $1.00 USD but end up with $0.99999 USD. 
7) The network saves all fees earned in USD and in the event that a short position lacks the necessary collateral to cover during rapid market movements, then the network will provide the stored USD.
8) You cannot use the collateral of your short position to buy the USD necessary to cover the position.  This USD must be purchased separately. 
    - This requirement creates a kind of "virtual collateral" that all shorts must maintain so they can cover for either profit taking or loss prevention.
9) When you partially cover a position it will reduce your exposure, but your collateral is not returned until the position is fully covered. 


I fully agree with the new rules but I find it confusing when we talk about short orders while looking at the market of BTSX being priced in terms of USD. So I've made an attempt to translate the rules into USD/BTSX terms. Maybe some of you will find it useful. The changes are marked in bold. Please correct me if I made any mistakes.


The rules for BitAsset markets assuming the USD/BTSX market where USD is priced in terms of BTSX.  For the purpose of providing concrete examples, we will assume a median price of BTSX 30 per USD.

1.) 51 delegates or more must publish a price feed at least once per day
     - if they do not publish the feed, then the market reverts to a 1hr moving average.
     - if a feed is published, the 1hr moving average is set to the feed.

2.) No short orders can be published to the network at a price below 90% of the 1 hour moving average. (ie: they must be more than BTSX 27.00)
     - the minimal short quantity is 100 BTSX

3.) Short orders will only be matched against bids that are above the moving average. (ie: people must be buying USD for more than BTSX 30.00)
     - the lowest short order is matched first, so a short selling USD at BTSX 27.01 will be matched against someone buying USD at BTSX 30.01 and the difference (BTSX 3.00) * volume is captured as a fee.

4.) A margin call will be executed any time the lowest ask is less than 110% of the moving average and the lowest ask is more than the call price.
    - the initial call price is 150% of the short price (ie: BTSX 45.00 for a short entered at BTSX 30.00).  This is the price at which 75% of the collateral would be required to buy back the USD necessary to cover the position.
    - If a margin call is executed and there is any collateral left over, then 5% is kept as network fees and 95% is returned to the owner. 

5.) There are no restrictions on what prices people can set for normal BitUSD/BTSX trading.  All parties will receive what they ask for.

6.) Rounding errors are inevitable when using fixed point math, any such rounding error is deemed to be a network fee.
    - for example you may place an order to buy $1.00 USD but end up with $0.99999 USD. 

7.) The network saves all fees earned in BTSX and in the event that a short position lacks the necessary collateral to cover during rapid market movements, then the network will provide the stored BTSX.

8.) You cannot use the collateral of your short position to buy the USD necessary to cover the position.  This USD must be purchased separately. 
    - This requirement creates a kind of "virtual collateral" that all shorts must maintain so they can cover for either profit taking or loss prevention.

9.) When you partially cover a position it will reduce your exposure, but your collateral is not returned until the position is fully covered. 

Offline bytemaster

...
     - the minimal short quantity is 100 BTSX
...

Thanks for the summary!

Why the 100 BTSX minimum?  Shouldn't the transaction fees take care of this?  Not a terribly big deal, but this is another arbitrary number to worry about updating when the value rises, and it's nice for newbies to be able to experiment on a micro scale.

Because shorts that are above the median get "processed" every block and skipped. 
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 Troglodactyl

  • Hero Member
  • *****
  • Posts: 960
    • View Profile
...
     - the minimal short quantity is 100 BTSX
...

Thanks for the summary!

Why the 100 BTSX minimum?  Shouldn't the transaction fees take care of this?  Not a terribly big deal, but this is another arbitrary number to worry about updating when the value rises, and it's nice for newbies to be able to experiment on a micro scale.

Offline bytemaster

Great news :)

For some visual information about how this works, I've added shorts and the 90% rule for shorts to my asset pages, check it out:

http://bitsharesblocks.com/assets/asset?id=USD

Btw you can click on "Bid","Ask" or "Short" to enable or disable a given series, oh and I added the "reserve fund" info as well :)

thanks for your efforts man!

Some suggestions: 
    remove the "point boxes" in the depth chart.
    display "shorts" as a 3rd volume on the depth chart that has "2 colors"... one for those over the median and one for those under.  We are adding this for the built in wallet.
    I would love to see a price history chart.   
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 liondani

  • Hero Member
  • *****
  • Posts: 3737
  • Inch by inch, play by play
    • View Profile
    • My detailed info
  • BitShares: liondani
  • GitHub: liondani
Great news :)

For some visual information about how this works, I've added shorts and the 90% rule for shorts to my asset pages, check it out:

http://bitsharesblocks.com/assets/asset?id=USD

Btw you can click on "Bid","Ask" or "Short" to enable or disable a given series, oh and I added the "reserve fund" info as well :)

thanks for your efforts man!

Offline svk

Great news :)

For some visual information about how this works, I've added shorts and the 90% rule for shorts to my asset pages, check it out:

http://bitsharesblocks.com/assets/asset?id=USD

Btw you can click on "Bid","Ask" or "Short" to enable or disable a given series, oh and I added the "reserve fund" info as well :)
So awesome!! Looks great on my phone. Now I'll NEVER get any work done.
I'm not seeing any bids (black) on the graph...

They should be there, but the depth of bids is only ~5k BTSX in the range I'm showing, so if Asks and Shorts are activated you'll have a hard time seeing the bids. Try disabling the asks and shorts, you should see the bids show up then. I just pushed a new version that includes the 11% upper range where shorts get accepted by the market, assuming I understood BM correctly..

If you have any more feedback on the plots we should probably move this conversation to my thread about the site itself..
Worker: dev.bitsharesblocks

Offline Riverhead

Great news :)

For some visual information about how this works, I've added shorts and the 90% rule for shorts to my asset pages, check it out:

http://bitsharesblocks.com/assets/asset?id=USD

Btw you can click on "Bid","Ask" or "Short" to enable or disable a given series, oh and I added the "reserve fund" info as well :)
So awesome!! Looks great on my phone. Now I'll NEVER get any work done.
I'm not seeing any bids (black) on the graph...
« Last Edit: September 04, 2014, 09:12:15 pm by Riverhead »

Offline svk

Great news :)

For some visual information about how this works, I've added shorts and the 90% rule for shorts to my asset pages, check it out:

http://bitsharesblocks.com/assets/asset?id=USD

Btw you can click on "Bid","Ask" or "Short" to enable or disable a given series, oh and I added the "reserve fund" info as well :)
Worker: dev.bitsharesblocks