margin call price is 150%, not 200% #1273

Closed
nmushegian opened this Issue Jan 19, 2015 · 13 comments

Comments

5 participants

This comment has been minimized.

Show comment Hide comment
@vikramrajkumar

vikramrajkumar Jan 19, 2015

Member

@theoreticalbts Can you also confirm whether the 300% collateral claim is true, or whether it is actually 200%?

Member

vikramrajkumar commented Jan 19, 2015

@theoreticalbts Can you also confirm whether the 300% collateral claim is true, or whether it is actually 200%?

This comment has been minimized.

Show comment Hide comment
@theoreticalbts

theoreticalbts Jan 19, 2015

Contributor

300% collateral is currently implemented.

I think the intent was always to make margin calls happen when the short side lost 1/2 of their capital, which occurs at 150% when the initial capital is 200% (as it was before the change to 300% / 30 days).

Contributor

theoreticalbts commented Jan 19, 2015

300% collateral is currently implemented.

I think the intent was always to make margin calls happen when the short side lost 1/2 of their capital, which occurs at 150% when the initial capital is 200% (as it was before the change to 300% / 30 days).

This comment has been minimized.

Show comment Hide comment
@nmushegian

nmushegian Jan 19, 2015

Contributor

I think the intent now is to make 200% the call price since that is what is being advertised

Contributor

nmushegian commented Jan 19, 2015

I think the intent now is to make 200% the call price since that is what is being advertised

This comment has been minimized.

Show comment Hide comment
@theoreticalbts

theoreticalbts Jan 19, 2015

Contributor

NB, if we implement this, we'll have to grandfather existing shorts into their current margin call prices. We don't want to be in the business of changing the terms of financial derivative instruments after people have already bought them.

We have to also consider partial covering.

Contributor

theoreticalbts commented Jan 19, 2015

NB, if we implement this, we'll have to grandfather existing shorts into their current margin call prices. We don't want to be in the business of changing the terms of financial derivative instruments after people have already bought them.

We have to also consider partial covering.

@vikramrajkumar vikramrajkumar modified the milestones: 0.7.0, 0.6.0 Jan 19, 2015

This comment has been minimized.

Show comment Hide comment
@nmushegian

nmushegian Jan 19, 2015

Contributor

Yes, only apply this for future shorts. I don't see why we have to consider partial covers if we do that.

Contributor

nmushegian commented Jan 19, 2015

Yes, only apply this for future shorts. I don't see why we have to consider partial covers if we do that.

This comment has been minimized.

Show comment Hide comment
@bytemaster

bytemaster Jan 20, 2015

Contributor

Someone changed this back. I remember very clearly using *3 /4 as the multiple in prior versions.

Contributor

bytemaster commented Jan 20, 2015

Someone changed this back. I remember very clearly using *3 /4 as the multiple in prior versions.

bytemaster added a commit that referenced this issue Jan 20, 2015

This comment has been minimized.

Show comment Hide comment
@vikramrajkumar

vikramrajkumar Jan 20, 2015

Member

cough c7d7257 cough

Member

vikramrajkumar commented Jan 20, 2015

cough c7d7257 cough

This comment has been minimized.

Show comment Hide comment
@vikramrajkumar

vikramrajkumar Jan 27, 2015

Member

Why was this returned back to 3/4 from 2/3 yet again: 211c5e1#diff-aa03531d90e90a2437e8cba9b668e0ccR400

Member

vikramrajkumar commented Jan 27, 2015

Why was this returned back to 3/4 from 2/3 yet again: 211c5e1#diff-aa03531d90e90a2437e8cba9b668e0ccR400

This comment has been minimized.

Show comment Hide comment
@bytemaster

bytemaster Jan 27, 2015

Contributor

It wasn't changed back to 2/3... it still reads 3/4.

Contributor

bytemaster commented Jan 27, 2015

It wasn't changed back to 2/3... it still reads 3/4.

This comment has been minimized.

Show comment Hide comment
@theoreticalbts

theoreticalbts Jan 28, 2015

Contributor

Yeah, turns out these are both wrong. Suppose you're shorting 100K BTS combined with 50K BTS going long at $0.02 / BTS, the debt is $1000 and the collateral is 150K BTS. The debt's BTS value at price p (where P is dollars per BTS, i.e. $0.02 / BTS) would be debt_value(p) = debt / p. Then 300% initial collateralization can be expressed as:

collateral = 3 * debt_value(initial_price)

If margin call happens at 200% collateralization level, you have

collateral = 2 * debt_value(call_price)

which simplifies to collateral = 2 * debt / call_price, solving for call_price gives

call_price = 2 * debt / collateral

In general when we have collateralization level of L percent, we have

   collateral = (L/100) * debt_value(call_price)
-> call_price = (L/100) * debt / collateral
              = (debt / collateral) / (100/L)
              = (debt / (k * collateral))      where k = 100/L

Defining call_collateral = collateral * k, we have call_price = debt / call_collateral which is what's actually implemented in the code:

  call_collateral.amount *= <something>;
  call_collateral.amount /= <something else>;

something / something else should be k, for L = 200% we have k = 1/2.

Contributor

theoreticalbts commented Jan 28, 2015

Yeah, turns out these are both wrong. Suppose you're shorting 100K BTS combined with 50K BTS going long at $0.02 / BTS, the debt is $1000 and the collateral is 150K BTS. The debt's BTS value at price p (where P is dollars per BTS, i.e. $0.02 / BTS) would be debt_value(p) = debt / p. Then 300% initial collateralization can be expressed as:

collateral = 3 * debt_value(initial_price)

If margin call happens at 200% collateralization level, you have

collateral = 2 * debt_value(call_price)

which simplifies to collateral = 2 * debt / call_price, solving for call_price gives

call_price = 2 * debt / collateral

In general when we have collateralization level of L percent, we have

   collateral = (L/100) * debt_value(call_price)
-> call_price = (L/100) * debt / collateral
              = (debt / collateral) / (100/L)
              = (debt / (k * collateral))      where k = 100/L

Defining call_collateral = collateral * k, we have call_price = debt / call_collateral which is what's actually implemented in the code:

  call_collateral.amount *= <something>;
  call_collateral.amount /= <something else>;

something / something else should be k, for L = 200% we have k = 1/2.

This comment has been minimized.

Show comment Hide comment
@theoreticalbts

theoreticalbts Jan 28, 2015

Contributor

So k is simply the debt-to-collateral ratio at margin call. k = 1/2 is desired (debt is 1/2 collateral).

I will call this BTS_BLOCKCHAIN_MCALL_D2C_NUMERATOR / BTS_BLOCKCHAIN_MCALL_D2C_DENOMINATOR

Contributor

theoreticalbts commented Jan 28, 2015

So k is simply the debt-to-collateral ratio at margin call. k = 1/2 is desired (debt is 1/2 collateral).

I will call this BTS_BLOCKCHAIN_MCALL_D2C_NUMERATOR / BTS_BLOCKCHAIN_MCALL_D2C_DENOMINATOR

This comment has been minimized.

Show comment Hide comment
@theoreticalbts

theoreticalbts Apr 7, 2015

Contributor

Ran through the numbers with current order book, this is definitely fixed. Probably by 5fcfef1

Contributor

theoreticalbts commented Apr 7, 2015

Ran through the numbers with current order book, this is definitely fixed. Probably by 5fcfef1

@vikramrajkumar vikramrajkumar modified the milestones: dvs/0.10.0, dvs/0.9.0 Apr 8, 2015

This comment has been minimized.

Show comment Hide comment
@abitmore

abitmore May 7, 2015

Owner

To be simple, if one shorts 100K BTS combined with 50K BTS going long at $0.02 / BTS, how much should the call price be? It's $0.01 in bts/0.8.x or earlier, but $0.013 in bts/0.9.0 and bts/0.9.1

Owner

abitmore commented May 7, 2015

To be simple, if one shorts 100K BTS combined with 50K BTS going long at $0.02 / BTS, how much should the call price be? It's $0.01 in bts/0.8.x or earlier, but $0.013 in bts/0.9.0 and bts/0.9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment