Skip to content

Instantly share code, notes, and snippets.

@jakedx6
Created June 10, 2021 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakedx6/4d990a3faf7d03010bc2a818f11e68cf to your computer and use it in GitHub Desktop.
Save jakedx6/4d990a3faf7d03010bc2a818f11e68cf to your computer and use it in GitHub Desktop.
Coupon Bond Guaranteed
{"valueParameterDescriptions":[["Interest instalment","Amount of Lovelace that will be paid by the *Issuer* every 30 slots for 3 iterations."],["Principal","Amount of Lovelace that will be borrowed by the *Issuer*."]],"slotParameterDescriptions":[],"roleDescriptions":[["Guarantor","Provides a collateral in case the *Issuer* defaults."],["Investor","Provides the money that the *Issuer* borrows."],["Issuer","Borrows the money provided by the *Investor* and returns it together with three *Interest instalment*s."]],"contractType":"CB","contractName":"Coupon Bond Guaranteed","contractDescription":"Debt agreement between an *Investor* and an *Issuer*. *Investor* will advance the *Principal* amount at the beginning of the contract, and the *Issuer* will pay back *Interest instalment* every 30 slots and the *Principal* amount by the end of 3 instalments. The debt is backed by a collateral provided by the *Guarantor* which will be refunded as long as the *Issuer* pays back on time.","choiceDescriptions":[]}
When [
(Case
(Deposit
(Role "Investor")
(Role "Guarantor")
(Token "" "")
(AddValue
(MulValue
(Constant 3)
(ConstantParam "Interest instalment"))
(ConstantParam "Principal")))
(When [
(Case
(Deposit
(Role "Issuer")
(Role "Investor")
(Token "" "")
(ConstantParam "Principal"))
(Pay
(Role "Issuer")
(Party
(Role "Issuer"))
(Token "" "")
(ConstantParam "Principal")
(When [
(Case
(Deposit
(Role "Investor")
(Role "Issuer")
(Token "" "")
(ConstantParam "Interest instalment"))
(Pay
(Role "Investor")
(Party
(Role "Investor"))
(Token "" "")
(ConstantParam "Interest instalment")
(Pay
(Role "Investor")
(Party
(Role "Guarantor"))
(Token "" "")
(ConstantParam "Interest instalment")
(When [
(Case
(Deposit
(Role "Investor")
(Role "Issuer")
(Token "" "")
(ConstantParam "Interest instalment"))
(Pay
(Role "Investor")
(Party
(Role "Investor"))
(Token "" "")
(ConstantParam "Interest instalment")
(Pay
(Role "Investor")
(Party
(Role "Guarantor"))
(Token "" "")
(ConstantParam "Interest instalment")
(When [
(Case
(Deposit
(Role "Investor")
(Role "Issuer")
(Token "" "")
(AddValue
(ConstantParam "Interest instalment")
(ConstantParam "Principal")))
(Pay
(Role "Investor")
(Party
(Role "Investor"))
(Token "" "")
(AddValue
(ConstantParam "Interest instalment")
(ConstantParam "Principal"))
(Pay
(Role "Investor")
(Party
(Role "Guarantor"))
(Token "" "")
(AddValue
(ConstantParam "Interest instalment")
(ConstantParam "Principal")) Close)))] 150 Close))))] 120 Close))))] 90 Close)))] 60
(Pay
(Role "Investor")
(Party
(Role "Guarantor"))
(Token "" "")
(AddValue
(MulValue
(Constant 3)
(ConstantParam "Interest instalment"))
(ConstantParam "Principal")) Close)))] 30 Close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment