Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

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

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

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

nmushegian opened this issue Jan 19, 2015 · 13 comments
Assignees
Milestone

Comments

@nmushegian
Copy link
Contributor

https://bitsharestalk.org/index.php?topic=13453.0;topicseen

@vikramrajkumar
Copy link
Contributor

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

@theoreticalbts
Copy link
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).

@nmushegian
Copy link
Contributor Author

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

@theoreticalbts
Copy link
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.

@vikramrajkumar vikramrajkumar modified the milestones: 0.7.0, 0.6.0 Jan 19, 2015
@nmushegian
Copy link
Contributor Author

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

@bytemaster
Copy link
Contributor

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
@vikramrajkumar
Copy link
Contributor

cough c7d7257 cough

@vikramrajkumar
Copy link
Contributor

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

@bytemaster
Copy link
Contributor

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

@theoreticalbts
Copy link
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.

@theoreticalbts
Copy link
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

@theoreticalbts
Copy link
Contributor

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
@abitmore
Copy link
Member

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants