Skip to content

Instantly share code, notes, and snippets.

@dk14
Last active June 18, 2023 18:21
Show Gist options
  • Save dk14/36b79f5ffa27903ade4db05a2f82fe53 to your computer and use it in GitHub Desktop.
Save dk14/36b79f5ffa27903ade4db05a2f82fe53 to your computer and use it in GitHub Desktop.
EuropeanOption
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
Let
"strike"
(Constant 35000)
(Let
"premium"
(Constant 100)
(Let
"notional"
(Constant 1000)
(Let
"collateral_bob"
(Constant 300)
(When
[Case
(Deposit
(Role "Bob")
(Role "Alice")
(Token "" "")
(UseValue "premum")
)
(When
[Case
(Deposit
(Role "Bob")
(Role "Bob")
(Token "" "")
(UseValue "collateral_bob")
)
(When
[Case
(Choice
(ChoiceId
"dummy"
(Address "invalid")
)
[Bound 1 2]
)
Close ]
1687041400572
(When
[Case
(Choice
(ChoiceId
"WOLF_BTCADA_12121212_2121212"
(Address "oracle")
)
[Bound 0 1000000]
)
Close ]
1687041400572
(Let
"market"
(ChoiceValue
(ChoiceId
"WOLF_BTCUSD_12121212_2121212"
(Address "oracle")
))
(Let
"value"
(MulValue
(UseValue "notional")
(SubValue
(UseValue "market")
(UseValue "strike")
)
)
(If
(ValueLE
(UseValue "value")
(Constant 0)
)
Close
(Pay
(Role "Bob")
(Account (Role "Alice"))
(Token "" "")
(UseValue "value")
Close
)
)
)
)
)
)]
1687041400572 Close
)]
1687041400572 Close
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment