You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.
When feed price is 1 BTA/BTS, Alice shorts 5000 BTA at feed price,
BTA owed is 5000 BTA
collateral is 10000 + 5000 = 15000 BTS
collateral rate is 15000 * 1 / 5000 = 300%
call price is 2 * 5000 / 15000 = 0.67 BTA/BTS
When feed price drop to 0.6 BTA/BTS
collateral rate drop to 15000 * 0.6 / 5000 = 180%
Alice's order get margin called partially, for example 3000 BTA is covered
BTS paid from collateral is 3000 / 0.6 = 5000 BTS
BTA owed is updated to 5000 - 3000 = 2000 BTA
remain collateral is 15000 - 5000 = 10000 BTS
collateral rate is 10000 * 0.6 / 2000 = 300%
call price should change to 2 * 2000 / 10000 = 0.4 BTA/BTS, and the order shouldn't be called again soon (it's unchanged in 0.9.0/0.9.1 thus is possible to be called again in next block)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
With 0.9.x market engine, test case:
The text was updated successfully, but these errors were encountered: