From 6b50260452c47caf877039b466ae5ce75684c402 Mon Sep 17 00:00:00 2001 From: Taconator Date: Sat, 14 Apr 2018 16:15:04 -0400 Subject: [PATCH 1/2] bsip35: Correcting units in Example #3 --- bsip-0035.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsip-0035.md b/bsip-0035.md index 9ebaa83..dee8e57 100644 --- a/bsip-0035.md +++ b/bsip-0035.md @@ -372,12 +372,12 @@ Assuming both orders are limit orders, they'll be processed as follows: * If Alice's order is maker, use `$3 / 80` as match price; since Alice's order is smaller, round in favor of Bob's order, so Alice will get `round_down(50 CORE * $3 / 80 CORE) = round_down($1.6) = $1`, - and Bob will get `round_up($1 * 80 CORE / $3) = round_up($26.67) = $27`, + and Bob will get `round_up($1 * 80 CORE / $3) = round_up(26.67 CORE) = 27 CORE`, the effective price would be `$1 / 27 = $0.037`; * If Bob's order is maker, use `$19 / 500` as match price; since Alice's order is smaller, round in favor of Bob's order, so Alice will get `round_down(50 CORE * $19 / 500 CORE = round_down($1.9) = $1`, - and Bob will get `round_up($1 * 500 CORE / $19) = round_up($26.3) = $27`, + and Bob will get `round_up($1 * 500 CORE / $19) = round_up(26.3 CORE) = 27 CORE`, the effective price would also be `$1 / 27 = $0.037`. # Specifications From c7bc11e8e161cfff379adb6d5fb63b92914cee2c Mon Sep 17 00:00:00 2001 From: Taconator Date: Sat, 14 Apr 2018 16:17:58 -0400 Subject: [PATCH 2/2] bsip38: Clarifications --- bsip-0038.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bsip-0038.md b/bsip-0038.md index 62dca9d..7a16725 100644 --- a/bsip-0038.md +++ b/bsip-0038.md @@ -53,6 +53,13 @@ position in margin call territory. ## The Definition of Target Collateral Ratio +For reference purpose, the collateral ratio of any given debt/short position +describes the ratio between the available collateral (e.g. core toke BTS) to +the debt that is owed (e.g. CNY, etc.) by the original borrower to the +blockchain. It is defined to be a dimensionless value as +`CR = collateral / (debt / feed_price)` where the price is measured in units of +the debt asset / units of the collateral asset (e.g. `CNY / BTS`). + "Target collateral ratio" is an optional value which can be set onto a short position, when the position being automatically liquidized (margin called), sell no more than required collateral until collateral ratio of the position @@ -108,7 +115,8 @@ target but not go too far beyond. That said, if a short position got matched with a big limit order, after partially filled, its collateral ratio should be **just** higher than specified target collateral ratio. Which means if `max_debt_to_cover` has no -fraction, need to plus it by one Satoshi; otherwise, need to round it up. +fractional component (e.g. 5.00 as opposed to 5.23), need to plus it by one +Satoshi; otherwise, need to round it up. An effectively same approach is to round down then add one Satoshi onto the result. @@ -264,7 +272,7 @@ The new option need to be presented and can be used in UI after the hard fork. When there are call orders to be filled, if `target_collateral_ratio` option is set, UI need to show exact amount of collateral that another trader is able to buy and exact amount of debt that need to pay according to the equation -described above. +described above. Note that this calculation will need to use the current `feed_price`. # Discussion