Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add BSIP 31: Update Short Position's Margin Call Price After Partially Called Or Settled #55

Merged
merged 4 commits into from
Feb 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ Number | Title |
[28](bsip-0028.md) | Worker Proposal Improvements | Bill Butler | Protocol | Draft
[29](bsip-0029.md) | Asset issue change to require owner authority | Fabian Schuh | Protocol | Draft
[30](bsip-0030.md) | Always Allow Increasing Collateral Ratio If Debt Not Increased | Abit More | Protocol | Draft
[31](bsip-0031.md) | Update Short Position's Margin Call Price After Partially Called Or Settled | Abit More | Protocol | Draft
65 changes: 65 additions & 0 deletions bsip-0031.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
BSIP: 0031
Title: Update Short Position's Margin Call Price After Partially Called Or Settled
Author: Abit More <https://github.com/abitmore>
Status: Draft
Type: Protocol
Created: 2018-02-16
Discussion: https://github.com/bitshares/bitshares-core/issues/343,
https://github.com/bitshares/bitshares-core/issues/649
Replaces: -
Worker: To be done

# Abstract

Currently, when a short position get partially called or settled, the call
price won't change, that said, even if its actual collateral ratio is higher
than others, higher than minimum required, it will still be selling collateral
at a low price, taking precedence over other short positions.

This behavior is causing several issues:
* it's somehow unfair, thus brought bad experience to shorters, and
* it prevents black swan event from being triggered in time when needed,
because the collateral ratio of the 2nd even overall short positions may
be too low but not being checked, thus risks the pegging system.

This BSIP proposes a mechanism to improve this situation.

# Motivation

Make the exchange system more user-friendly.

# Rationale

To attract more users, the system should be fair, should be well balanced.

It's common sense that short positions with least collateral ratio should
get margin called first. This can be achieved if always update the margin
call price after every fill.

# Specifications

In `fill_order( const call_order_object& ...)` function of `database` class,
update `call_price` field of `call_order_object` after debt or collateral
changed to a non-zero value.

In addtion, after `call_price` get updated, the iterators initialized with
`by_price` index may be invalidated, so need to review / revise involved code,
E.G. `check_call_orders(...)` function of `database` class.

# Discussion

[to be added if any]

# Summary for Shareholders

[to be added if any]

# Copyright

This document is placed in the public domain.

# See Also

* https://github.com/bitshares/bitshares-core/issues/343
* https://github.com/bitshares/bitshares-core/issues/649
* https://bitsharestalk.org/index.php?topic=25926.0