BitShares Forum

Main => General Discussion => Topic started by: armin on December 28, 2018, 03:06:15 pm

Title: Did somebody notice the margin call wall had 15M BTS Eaten yesterday?
Post by: armin on December 28, 2018, 03:06:15 pm
3 situations could have occurred:

1) Somebody bought 15M BTS from margin wall

2) CNY shorters recollateralized (unlikely)

3) Feed price increased which increased which caused MCRs to increase (not possible feed is the exact same price today)

Anybody know what happen?

Yesterday call price = 0.2392, call amount = 51.2m BTS
Title: Re: Did somebody notice the margin call wall had 15M BTS Eaten yesterday?
Post by: alt on December 28, 2018, 11:47:22 pm
1. the GUI show you wrong infomation, it didn't show you all the margin call orders.
2. s500 have buy back all his debt recent days, there are nearly 10M BTS have been sold from this account.
Title: Re: Did somebody notice the margin call wall had 15M BTS Eaten yesterday?
Post by: armin on December 29, 2018, 12:10:09 am
yes I see the GUI keep changing margin call from 50m BTS to 30m BTS, looks like a bug. You calculate the correct amount using api call?
Title: Re: Did somebody notice the margin call wall had 15M BTS Eaten yesterday?
Post by: alt on December 29, 2018, 12:28:22 am
yes I see the GUI keep changing margin call from 50m BTS to 30m BTS, looks like a bug. You calculate the correct amount using api call?
yes, there are about 20M bitCNY debt in the state "margin call" right now. for the feed price 0.2733
Title: Re: Did somebody notice the margin call wall had 15M BTS Eaten yesterday?
Post by: armin on December 29, 2018, 03:04:34 pm
I just calculated it and it comes down to 12.2m CNY/47M BTS, how did you get the 20M CNY number?

Actually I have an old wallet from before that also says 12.2m (seems like the calculation broke in recent releases?)

But u are right, web wallet is wrong still
Title: Re: Did somebody notice the margin call wall had 15M BTS Eaten yesterday?
Post by: startail on December 30, 2018, 03:23:16 pm
I'm keen on understanding if this is displayed wrong in the GUI.
How did you get to these numbers and did you account for the "Target collateral ratio"?

Armin, you missed one possible scenario I think.

4) A position updated their target collateral ratio, removing some of the required sell to reach collateral ratio.

Say that one position doesn't have a target at all, then the whole position will be put to market (as long as they are under MCR I believe). If a position has a target on the other hand, it will only put so much on the market that is required to reach MCR ratio.

Please tell me if I'm wrong, but that's how I understood it to work.
Title: Re: Did somebody notice the margin call wall had 15M BTS Eaten yesterday?
Post by: armin on December 30, 2018, 05:14:09 pm
I'm keen on understanding if this is displayed wrong in the GUI.
How did you get to these numbers and did you account for the "Target collateral ratio"?

Armin, you missed one possible scenario I think.

4) A position updated their target collateral ratio, removing some of the required sell to reach collateral ratio.

Say that one position doesn't have a target at all, then the whole position will be put to market (as long as they are under MCR I believe). If a position has a target on the other hand, it will only put so much on the market that is required to reach MCR ratio.

Please tell me if I'm wrong, but that's how I understood it to work.

Yes you are correct, I did not account this into my calculation, I will try to see if I can calculate it with the target CR as well.

yes I see the GUI keep changing margin call from 50m BTS to 30m BTS, looks like a bug. You calculate the correct amount using api call?
yes, there are about 20M bitCNY debt in the state "margin call" right now. for the feed price 0.2733

@alt, did you count target CR as well?
Title: Re: Did somebody notice the margin call wall had 15M BTS Eaten yesterday?
Post by: alt on December 31, 2018, 01:02:28 am
@alt, did you count target CR as well?
for now, the feed price is 0.2727, count target CR, there are totally 4.5M bitcny in force margin call state, 
Title: Re: Did somebody notice the margin call wall had 15M BTS Eaten yesterday?
Post by: armin on December 31, 2018, 01:34:57 am
thank you, let me verify.
Title: Re: Did somebody notice the margin call wall had 15M BTS Eaten yesterday?
Post by: armin on December 31, 2018, 08:59:00 pm
@alt, did you count target CR as well?
for now, the feed price is 0.2727, count target CR, there are totally 4.5M bitcny in force margin call state,

Actually, I calculated it higher than web wallet still. For feed 0.2642, I got 8.855m CNY in called state when accounting for target_collateral_ratio.

Pseudocode:

For each call order,

if callOrder has target_collateral_ratio key,
target = (get target_collateral_ratio) / 1000
requiredCollat = target * debt
currentCollat = collateral * feed_price
delta = requiredCollat - normalizedCollat
marginCall += delta

requiredCollat come from this equation, for example:

1.5 MCR = 75K CNY in collateral / 50k CNY debt

1.76 MCR = 88K CNY in collateral / 50K CNY debt

Here, requiredCollat is 1.76 * 50K = 88K CNY