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

0 Members and 1 Guest are viewing this topic.

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag
Insurance fund is no more... it will just mean that all the remaining BitUSD will have slightly less collateral "on average".    You can think of all BitUSD being backed by "all collateral".   If a few shorts run out of collateral then the USD is still circulating.  It will reduce the "interest" paid to USD holders until the extra BitUSD is made up from market activities.

I disagree with your opinion that no insurance fund is necessary because of the rewards program. If a black swan event happens and there is temporarily not enough collateral to fully back the issued BitUSD, the market may respond by dropping the price of BitUSD below the peg until BitUSD fees eventually allow the BitUSD to be fully backed again. During this time, recent BitUSD buyers (who purchased before the black swan) will have had a sudden loss in their purchasing power (which is not great even if it is temporary). It would be smarter IMO for the DAC to have some reserves to immediately fix the collateral backing issue after a black swan event.

See further discussion of this here:
One other thing I didn't like in bytemaster's proposal was that he seemed to consider the interest to BitUSD as a substitute to the insurance fund. But someone who purchases some BitUSD right before a black swan event is still going to be damaged by it if they need to spend the money shortly afterward (the accumulated interest could only be considered a replacement of the lost value of BitUSD after some period of time of holding the BitUSD). So, I think it is important to keep a reasonable amount of BitUSD in an insurance fund (scaling with the amount of BitUSD issued).

But I don't like the way you say "reverse BitUSD destruction." I generally agree with the following idea:
Quote
A fund below its minimum capitalization level has first priority for income, and gradually takes a smaller fraction of the available income until it claims zero income at its maximum capitalization level. A fund above its maximum capitalization level will have negative income, actually paying its balance over time to one or both of the other funds until it is again at or below its maximum capitalization level.
But only applied to the insurance fund. I think that for each block a certain amount of BitUSD should be pulled out from that insurance fund to cover the interest added to all BitUSD balances during that block. That BitUSD is considered out of the possession of the DAC and cannot be reclaimed. If the fund levels in the insurance fund get too low, the interest rates should be lowered to build up the balance in the fund.

Offline bytemaster

The position is still closed from the 'interest fund's' bitUSDs..... if the interest fund is not sufficient then... The position is just closed (with no particular bitAssets being used) leading to slight reduction on overall/average collateralization?    Yes
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 tonyk

  • Hero Member
  • *****
  • Posts: 3308
    • View Profile
Xeldal's explanation above + the following additions/changes:

Condition2: The lowest price at which the asset can be repurchased to cover the short is within 10% of the moving average.


Condition2: The lowest price at which the asset can be repurchased to cover the short is up to 110% of the moving average.


4b. If all the collateral is used to repurchase the asset and the short position is still not fully covered, the uncovered (asset) amount is covered/provided by the system insurance fund.


? ? ? ? ?

Insurance fund is no more... it will just mean that all the remaining BitUSD will have slightly less collateral "on average".    You can think of all BitUSD being backed by "all collateral".   If a few shorts run out of collateral then the USD is still circulating.  It will reduce the "interest" paid to USD holders until the extra BitUSD is made up from market activities.
The last sentence suggest that in such cases, the position is still closed from the 'interest fund's' bitUSDs. Is this indeed the case, or the position is just closed (with no particular bitAssets being used) leading to slight reduction on overall/average collateralization?
Lack of arbitrage is the problem, isn't it. And this 'should' solves it.

Offline bytemaster

Xeldal's explanation above + the following additions/changes:

Condition2: The lowest price at which the asset can be repurchased to cover the short is within 10% of the moving average.


Condition2: The lowest price at which the asset can be repurchased to cover the short is up to 110% of the moving average.


4b. If all the collateral is used to repurchase the asset and the short position is still not fully covered, the uncovered (asset) amount is covered/provided by the system insurance fund.


? ? ? ? ?

Insurance fund is no more... it will just mean that all the remaining BitUSD will have slightly less collateral "on average".    You can think of all BitUSD being backed by "all collateral".   If a few shorts run out of collateral then the USD is still circulating.  It will reduce the "interest" paid to USD holders until the extra BitUSD is made up from market activities.
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 tonyk

  • Hero Member
  • *****
  • Posts: 3308
    • View Profile
Xeldal's explanation above + the following additions/changes:

Condition2: The lowest price at which the asset can be repurchased to cover the short is within 10% of the moving average.


Condition2: The lowest price at which the asset can be repurchased to cover the short is up to 110% of the moving average.


4b. If all the collateral is used to repurchase the asset and the short position is still not fully covered, the uncovered (asset) amount is covered/provided by the system insurance fund.


? ? ? ? ?
« Last Edit: September 06, 2014, 05:21:27 am by tonyk »
Lack of arbitrage is the problem, isn't it. And this 'should' solves it.

Xeldal

  • Guest
To clarify the margin call restraint.. I admit it was confusing re-reading it myself:

0) The "call price" is the price in terms of USD where 75% of the collateral would be required to repay the loan. 
       - it can be calculated as  DEBT / (.75*collateral) and has units of $ per BTSX
1) A margin call is looking to buy USD from those wanting to sell USD and needs to get USD as cheaply as possible.
       - but it gets confusing because the market is "reversed" and thus it should be viewed as the
         margin call is looking to SELL BTSX for as much as possible.
2) If there is someone willing to buy BTSX at a price more than the call price then NO call is executed
       - in other words it would require less than 75% of the collateral to cover against that buy.

3) Suppose there were "no buyers of BTSX anywhere close to the median" because someone bought up the order book.  This would normally result in #2 triggering and an automatic margin call, *except* that we have a safety valve that is the moral equivalent of someone offering to buy BTSX at 90% of the median price feed.  This means the market is free to set the price and automatically issue margin calls within 10% of the feed, but that shorts are protected against manipulation.

Quote from: bytemaster
Please rewrite it in a way that is clear for all.
I think your explanation made perfect sense but if I were to rewrite it, this is what I would say.

#4 Short Margin Call:
-The Collateral on a short must maintain a value of at least 133% of what it would cost to repurchase the asset that was sold with the short.
-A Margin call is a forced cover on a short and is executed when both of the following 2 conditions are met.
  Condition1: The Collateral Value is less than the minimum 133% of what it would cost to repurchase the asset that was sold with the short.
  Condition2: The lowest price at which the asset can be repurchased to cover the short is within 10% of the moving average.

in the event that both these conditions are met, A margin call is executed. The short is automatically covered by repurchasing the asset on the market at the cheapest available prices.  If there is any collateral left after the margin call, 5% of the remaining collateral is collected as a fee and the rest is returned to the owner.

You can calculate the price at which a call will be executed with the following formula:

BTSX_Call_Price =  BTSX_Collateral / Asset_Amount_Shorted  / 1.33

______________________________
I still have a question of whether this is the best approach.  As Condition 2 can remain FALSE until there is not enough collateral to cover the short.

Offline bytemaster

Quote from: jakub
I wonder why you prefer to look at the market in terms of BTSX being priced in USD and not the other way round?
+5% Its quite a mental workout flipping back and forth.  Its takes twice as long for me to figure things out because I'm never sure which way its trying to be said and often both sides are used.

Both work and mean the same thing obviously, its just few people, if any, think of shorting APPL in terms of going long USD or that their margin call will force them to sell their USD.  When I tell my brain "short=buy" or "margin call=sell" it returns "error".  Maybe that's just my own bugs.

so I would rewrite
Quote from: bytemaster
2) If there is someone willing to buy BTSX at a price more than the call price then NO call is executed
2)If there is someone willing to sell USD at a price less than the call price then NO call is executed

the following is confusing, possible mix of traditional and reverse terms. 'No buyer because of buying up the book' doesn't make sense.  should be selling down the book?
Quote from: bytemaster
3) Suppose there were "no buyers of BTSX anywhere close to the median" because someone bought up the order book.
or better, should it be:
Suppose there were "no sellers of USD anywhere close to the median" because someone bought up the order book.

Please rewrite it in a way that is clear for all.
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.

Xeldal

  • Guest
Quote from: jakub
I wonder why you prefer to look at the market in terms of BTSX being priced in USD and not the other way round?
+5% Its quite a mental workout flipping back and forth.  Its takes twice as long for me to figure things out because I'm never sure which way its trying to be said and often both sides are used.

Both work and mean the same thing obviously, its just few people, if any, think of shorting APPL in terms of going long USD or that their margin call will force them to sell their USD.  When I tell my brain "short=buy" or "margin call=sell" it returns "error".  Maybe that's just my own bugs.

so I would rewrite
Quote from: bytemaster
2) If there is someone willing to buy BTSX at a price more than the call price then NO call is executed
2)If there is someone willing to sell USD at a price less than the call price then NO call is executed

the following is confusing, possible mix of traditional and reverse terms. 'No buyer because of buying up the book' doesn't make sense.  should be selling down the book?
Quote from: bytemaster
3) Suppose there were "no buyers of BTSX anywhere close to the median" because someone bought up the order book.
or better, should it be:
Suppose there were "no sellers of USD anywhere close to the median" because someone bought up the order book.


jakub

  • Guest
To clarify the margin call restraint.. I admit it was confusing re-reading it myself:

0) The "call price" is the price in terms of USD where 75% of the collateral would be required to repay the loan. 
       - it can be calculated as  DEBT / (.75*collateral) and has units of $ per BTSX
1) A margin call is looking to buy USD from those wanting to sell USD and needs to get USD as cheaply as possible.
       - but it gets confusing because the market is "reversed" and thus it should be viewed as the
         margin call is looking to SELL BTSX for as much as possible.
2) If there is someone willing to buy BTSX at a price more than the call price then NO call is executed
       - in other words it would require less than 75% of the collateral to cover against that buy.

3) Suppose there were "no buyers of BTSX anywhere close to the median" because someone bought up the order book.  This would normally result in #2 triggering and an automatic margin call, *except* that we have a safety valve that is the moral equivalent of someone offering to buy BTSX at 90% of the median price feed.  This means the market is free to set the price and automatically issue margin calls within 10% of the feed, but that shorts are protected against manipulation.

I wonder why you prefer to look at the market in terms of BTSX being priced in USD and not the other way round?
Indeed that's the way BTSX is priced on external exchanges but on the internal exchange inside Bitshares X I think the other way is less confusing. Especially when we refer to those people who issue bitUSD as shorts.


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.

It seems this translation of rule #4 is correct, isn't it? (in the USD/BTSX perspective)
« Last Edit: September 05, 2014, 04:36:42 pm by jakub »

Offline bytemaster

To clarify the margin call restraint.. I admit it was confusing re-reading it myself:

0) The "call price" is the price in terms of USD where 75% of the collateral would be required to repay the loan. 
       - it can be calculated as  DEBT / (.75*collateral) and has units of $ per BTSX
1) A margin call is looking to buy USD from those wanting to sell USD and needs to get USD as cheaply as possible.
       - but it gets confusing because the market is "reversed" and thus it should be viewed as the
         margin call is looking to SELL BTSX for as much as possible.
2) If there is someone willing to buy BTSX at a price more than the call price then NO call is executed
       - in other words it would require less than 75% of the collateral to cover against that buy.

3) Suppose there were "no buyers of BTSX anywhere close to the median" because someone bought up the order book.  This would normally result in #2 triggering and an automatic margin call, *except* that we have a safety valve that is the moral equivalent of someone offering to buy BTSX at 90% of the median price feed.  This means the market is free to set the price and automatically issue margin calls within 10% of the feed, but that shorts are protected against manipulation.

« Last Edit: September 05, 2014, 02:21:20 pm by bytemaster »
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 tonyk

  • Hero Member
  • *****
  • Posts: 3308
    • View Profile
Quote
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.
 
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.   
@jakub, Markus, Xeldal, others if interested.

Here is how I read 4), even though I realize I am changing the content as written.
A margin call will be executed any time the
1.lowest ask is more than the call price.
2.highest bid is more than 90% of the moving average.
...
Reading it again I seem to not be correct.... It should be

2.lowes ask is less than 110% of the moving average.

in other words:

  110% of call price > forced cover price => call price

additionally the 110% are not from the cover price but from the moving average; so it can 'slowly grow to more than 110% if it is not filled right way. (or it can wait for reversal. Or can it???, maybe the system sells those bitUSD right away)

Clarification on BM's part will be appreciated.
« Last Edit: September 05, 2014, 01:17:18 pm by tonyk »
Lack of arbitrage is the problem, isn't it. And this 'should' solves it.

Offline Markus

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
I'll try to explain how I understand.
Quote
a) the lowest ask is less than 110% of the moving average
AND
Quote
b) lowest ask is more than the call price.

This is to prevent a margin call to be triggered if the spread widens but your call price is still a fair bit above the average trading price.

For example you shorted at 30 BTSX so your call price is 45 BTSX.
Now if the moving average of actual trades was 40 BTSX and the lowest ask went up to 50 BTSX the margin would not be triggered because condition a) is not fulfilled. The lowest ask can rise to these levels without trades actually occuring at that price.
Your margin would only be called if the moving average rose above 40.909 BTSX.

One thing to have clarified by BM: Is the initial margin really 66% (or flipped 150%)? My current experience trading with 0.4.12 is more like 75% (133%)

jakub

  • Guest
Thanks Jakub, that was helpful.

4) A margin call will be executed any time the highest bid is greater than 90% of the moving average

4.) A margin call will be executed any time the lowest ask is less than 110% of the moving average

I just spent the last 40 mins staring this one down. I couldn't make sense of it.  Tell me if I've understood.  This is so that a short volatile spike (manipulation) can't trigger the margin call?  It requires a sustain movement, where both conditions must be true?? 
Quote
the lowest ask is less than 110% of the moving average
AND
Quote
lowest ask is more than the call price.

If I've understood correctly:
How many hours would the ask have to be more than 110% of the average before the short runs out of collateral?
If you consistently gain 10.01% hour after hour.  The first condition is never true and margin doesn't get called, right?

I had the most doubts about rule #4 as well. It's possible I got it wrong as I do not fully understand BM's intentions regarding #4 so this one was translated 'mechanically'.
I guess we need BM to clarify what the intentions are in this case.

Xeldal

  • Guest
Thanks Jakub, that was helpful.

4) A margin call will be executed any time the highest bid is greater than 90% of the moving average

4.) A margin call will be executed any time the lowest ask is less than 110% of the moving average

I just spent the last 40 mins staring this one down. I couldn't make sense of it.  Tell me if I've understood.  This is so that a short volatile spike (manipulation) can't trigger the margin call?  It requires a sustain movement, where both conditions must be true?? 
Quote
the lowest ask is less than 110% of the moving average
AND
Quote
lowest ask is more than the call price.

If I've understood correctly:
How many hours would the ask have to be more than 110% of the average before the short runs out of collateral?
If you consistently gain 10.01% hour after hour.  The first condition is never true and margin doesn't get called, right?

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi

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.

with this rule, It seems like a mistake at the source code? I think should be  if( mtrx.ask_price > max_short_bid )
Code: [Select]
                       if( mtrx.ask_price <= max_short_bid )
                       {
                          // wlog( "skipping short ${x} < max_short_bid ${b}", ("x",mtrx.bid_price)("b", max_short_bid)  );
                          // TODO: cancel the short order...
                          _current_bid.reset();
                          continue;
                       }