bsip35: handle settling after globally settled

This commit is contained in:
abitmore 2018-02-23 18:56:36 +00:00
parent b00e7f33ab
commit 8a06150338

View file

@ -204,6 +204,8 @@ may be paying something for nothing in current system):
* when matching a limit order with a call order, process the limit order * when matching a limit order with a call order, process the limit order
* when matching a force settle order with a call order, process the settle order * when matching a force settle order with a call order, process the settle order
* when globally settling, process the settlement fund * when globally settling, process the settlement fund
* when force settling after an asset has been globally settled, paying the force
settle order from global settlement fund, process the settle order
## The Improved Solution (This BSIP) ## The Improved Solution (This BSIP)
@ -236,6 +238,10 @@ The detailed rules proposes in this BSIP (new rules highlighted):
collateral amount collateral amount
* **when the asset is not a prediction market, if a call order would pay * **when the asset is not a prediction market, if a call order would pay
nothing, let it pay 1 Satoshi (round up).** nothing, let it pay 1 Satoshi (round up).**
* when paying a settle order from global settlement fund, in favor of global
settlement fund, round down receiving collateral amount
* **when the asset is not a prediction market, if the settle order would
receive nothing, raise an exception (aka let the operation fail).**
Take the example mentioned in the 4th comment of [bitshares-core Take the example mentioned in the 4th comment of [bitshares-core
issue #132](https://github.com/bitshares/bitshares-core/issues/132): issue #132](https://github.com/bitshares/bitshares-core/issues/132):
@ -310,6 +316,12 @@ need to check the label, if found it's completed, process next asset.
In `global_settle_asset(...)` function of `database` class, check each `pays`, In `global_settle_asset(...)` function of `database` class, check each `pays`,
once it's zero, and the asset is not a prediction market, let it be `1`. once it's zero, and the asset is not a prediction market, let it be `1`.
## When Paying A Settle Order From Global Settlement Fund
In `do_apply(...)` function of `asset_settle_evaluator` class,
after calculated `settled_amount`, check if it is zero. If the answer is `true`,
and the asset is not a prediction maket, throw a `fc::exception`.
# Discussion # Discussion
There is an argument suggests when matching call orders, we should always There is an argument suggests when matching call orders, we should always