Scommettiamo_che

Home   »   Scommettiamo_che

When
    [Case
        (Deposit
            (Role "Party")
            (Role "Party")
            (Token "" "")
            (Constant 100000000)
        )
        (When
            [Case
                (Deposit
                    (Role "Counterparty")
                    (Role "Counterparty")
                    (Token "" "")
                    (Constant 100000000)
                )
                (When
                    [Case
                        (Choice
                            (ChoiceId
                                "start"
                                (Role "kraken")
                            )
                            [Bound 0 100000000000]
                        )
                        (When
                            []
                            150
                            (When
                                [Case
                                    (Choice
                                        (ChoiceId
                                            "end"
                                            (Role "kraken")
                                        )
                                        [Bound 0 100000000000]
                                    )
                                    (Let
                                        "Price at end"
                                        (SubValue
                                            (ChoiceValue
                                                (ChoiceId
                                                    "start"
                                                    (Role "kraken")
                                                ))
                                            (ChoiceValue
                                                (ChoiceId
                                                    "end"
                                                    (Role "kraken")
                                                ))
                                        )
                                        (If
                                            (ValueGT
                                                (UseValue "Price at end")
                                                (Constant 0)
                                            )
                                            (Pay
                                                (Role "Counterparty")
                                                (Account (Role "Party"))
                                                (Token "" "")
                                                (Constant 100000000)
                                                Close 
                                            )
                                            (Pay
                                                (Role "Party")
                                                (Account (Role "Counterparty"))
                                                (Token "" "")
                                                (Constant 100000000)
                                                Close 
                                            )
                                        )
                                    )]
                                180 Close 
                            )
                        )]
                    90 Close 
                )]
            60 Close 
        )]
    30 Close 
{"valueParameterDescriptions":[],"slotParameterDescriptions":[],"roleDescriptions":[["Counterparty","Party that gets the difference in trade price if it increases."],["Party","Party that gets the difference in trade price if it decreases."],["kraken","Oracle party that provides the exchange rate for ADA/USD."]],"contractType":"CD","contractName":"Contract for Differences with Oracle","contractDescription":"\"Party\" and \"Counterparty\" deposit 100 Ada and after 60 slots these assets are redistributed depending on the change in price of 100 Ada worth of dollars between the start and the end of the contract. If the price increases, the difference goes to \"Counterparty\"; if it decreases, the difference goes to \"Party\", up to a maximum of 100 Ada.","choiceDescriptions":[["dir-adausd","Exchange rate ADA/USD at the beginning of the contract."],["inv-adausd","Exchange rate USD/ADA at the end of the contract."]]}

Leave a Reply

Your email address will not be published. Required fields are marked *