diff --git a/core/src/main/kotlin/com/r3corda/core/Utils.kt b/core/src/main/kotlin/com/r3corda/core/Utils.kt index cdd21bd822..86c4b29e51 100644 --- a/core/src/main/kotlin/com/r3corda/core/Utils.kt +++ b/core/src/main/kotlin/com/r3corda/core/Utils.kt @@ -288,4 +288,9 @@ fun Observable.bufferUntilSubscribed(): Observable { val subject = UnicastSubject.create() val subscription = subscribe(subject) return subject.doOnUnsubscribe { subscription.unsubscribe() } -} \ No newline at end of file +} + +/** Allows summing big decimals that are in iterable collections */ +fun Iterable.sum(): BigDecimal { + return this.fold(BigDecimal.valueOf(0)) { a: BigDecimal, b: BigDecimal -> a + b } +} diff --git a/core/src/main/kotlin/com/r3corda/core/math/Utils.kt b/core/src/main/kotlin/com/r3corda/core/math/Utils.kt deleted file mode 100644 index ec5c963f2b..0000000000 --- a/core/src/main/kotlin/com/r3corda/core/math/Utils.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.r3corda.core.math - -import java.math.BigDecimal - -fun Iterable.sum(): BigDecimal { - return this.fold(BigDecimal.valueOf(0)) { a: BigDecimal, b: BigDecimal -> a + b } -} \ No newline at end of file diff --git a/docs/source/initialmarginagreement.rst b/docs/source/initialmarginagreement.rst index 78a0fea976..becce56335 100644 --- a/docs/source/initialmarginagreement.rst +++ b/docs/source/initialmarginagreement.rst @@ -7,12 +7,9 @@ agreement; featuring the integration of complex and industry proven third party SIMM Introduction ----------------- -SIMM is an acronym for "Standard Initial Margin Model". - -Now this is a quite detailed and complicated subject, and I appeal to those of you who are know about this in depth to -be somewhat patient as I attempt to reduce it to the principal parts suitable for the demonstration. It is effectively -the calculation of what is known as a "margin" that is paid by one party to another when they agree a trade on certain -types of transaction. This margin is paid such that, in the event of one of the counterparties suffering a credit event +SIMM is an acronym for "Standard Initial Margin Model". It is effectively the calculation of a "margin" that is paid +by one party to another when they agree a trade on certain types of transaction. This margin is +paid such that, in the event of one of the counterparties suffering a credit event (a financial term and a polite way to say defaulting, not paying the debts that are due, or potentially even bankruptcy), then the party that is owed any sum already has some of the amount that it should have been paid. This payment to the receiving party is a preventative measure in order to reduce the risk of a potentially catastrophic default domino @@ -53,7 +50,7 @@ Initial Margin Agreement Process - Agree on the results of these steps - Calculate the initial margin - Agree on the calculation of the above with the other party - - In practise, pay (or receive) this margin (omitted for the sake of complexity for this example) + - In practice, pay (or receive) this margin (omitted for the sake of complexity for this example) Running the app diff --git a/docs/source/running-the-demos.rst b/docs/source/running-the-demos.rst index 4b47292968..2d3fc0e1b2 100644 --- a/docs/source/running-the-demos.rst +++ b/docs/source/running-the-demos.rst @@ -178,6 +178,8 @@ You should see some log lines scroll past, and within a few seconds the message SIMM and Portfolio Demo ----------------------- +.. note:: Read more about this demo at :doc:`initialmarginagreement`. + To run the demo run: **Windows**