Skip to content

Instantly share code, notes, and snippets.

@QuasarChains
Created August 13, 2022 14:10
Show Gist options
  • Save QuasarChains/ce14557169f27d5e082ed08d8002b564 to your computer and use it in GitHub Desktop.
Save QuasarChains/ce14557169f27d5e082ed08d8002b564 to your computer and use it in GitHub Desktop.
CFD with Oracle
{"valueParameterInfo":[["Amount paid by party",{"valueParameterFormat":{"contents":[6,"₳"],"tag":"DecimalFormat"},"valueParameterDescription":"Amount that the _**party**_ will deposit at the beginning of the contract."}],["Amount paid by counterparty",{"valueParameterFormat":{"contents":[6,"₳"],"tag":"DecimalFormat"},"valueParameterDescription":"Amount that the _**counterparty**_ will deposit at the beginning of the contract."}],["Amount of Ada to use as asset",{"valueParameterFormat":{"contents":[6,"₳"],"tag":"DecimalFormat"},"valueParameterDescription":"Amount of Ada whose price in dollars change to monitor."}]],"slotParameterDescriptions":[["Party deposit deadline","The _amount paid by party_ must be deposited by this deadline, otherwise the contract is cancelled."],["Counterparty deposit deadline","The _amount paid by counterparty_ must be deposited by this deadline, otherwise the contract is cancelled and money is refunded."],["First window beginning","The first _**oracle**_ reading must be taken after this."],["First window deadline","The first _**oracle**_ reading must be taken before this, otherwise the contract is cancelled and money is refunded."],["Second window beginning","The second _**oracle**_ reading must be taken after this."],["Second window deadline","The second _**oracle**_ reading must be taken before this, otherwise the contract is cancelled and money is refunded."]],"roleDescriptions":[["Counterparty","The _**counterparty**_ will get the difference in the price of the asset if it increases."],["Party","The _**party**_ will get the difference in the price of the asset if it decreases."],["kraken","The _**oracle**_ provides the price of the asset at the beginning (first window) and at the end (second window) of the contract (in this case the _**oracle**_ provides the conversion rate between Ada and dollars)."]],"contractType":"ContractForDifferences","contractShortDescription":"Contract For Differences with Oracle. Two parties deposit Ada in a contract and after some time the Ada is redistributed among them depending on the change in price of an asset.","contractName":"CFD with Oracle","contractLongDescription":"At the beginning of the contract, _**party**_ and _**counterparty**_ deposit some Ada in the contract. At the end of the contract, all Ada deposited is redistributed depending on the change in price in dollars of an asset (as reported by the _**oracle**_). The asset in this contract is an amount of Ada. If the price in dollars of the asset increases, the difference goes to _**counterparty**_; if it decreases, the difference goes to _**party**_, up to a maximum of the amount deposited at the beginning.","choiceInfo":[["dir-adausd",{"choiceFormat":{"contents":[8,"ADA/USD"],"tag":"DecimalFormat"},"choiceDescription":"Exchange rate ADA/USD in the first window."}],["inv-adausd",{"choiceFormat":{"contents":[8,"USD/ADA"],"tag":"DecimalFormat"},"choiceDescription":"Exchange rate USD/ADA in the second window."}]]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment