Skip to content

Instantly share code, notes, and snippets.

@dk14
Created June 20, 2023 21:47
Show Gist options
  • Save dk14/635bb19a31f4370334261728d549e36d to your computer and use it in GitHub Desktop.
Save dk14/635bb19a31f4370334261728d549e36d to your computer and use it in GitHub Desktop.
EuropeanCall
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
Let
"strike"
(Constant 100000)
(Let
"premium"
(Constant 100000000)
(Let
"threshold"
(AddValue
(UseValue "strike")
(DivValue
(UseValue "premium")
(Constant 1000000)
)
)
(Let
"notional_btc"
(Constant 1)
(Let
"margin"
(Constant 300000000)
(When
[Case
(Deposit
(Role "Bob")
(Role "Alice")
(Token "" "")
(UseValue "premium")
)
(When
[Case
(Deposit
(Role "Bob")
(Role "Bob")
(Token "" "")
(UseValue "margin")
)
(When
[Case
(Choice
(ChoiceId
"DO NOT ENTER, SKIP TO NEXT TIMEOUT INSTEAD"
(Address "invalid1vrxx3rjangevudlrejgp9m508uc26jd02n7lmdz365n4wrca35y5j")
)
[Bound 0 0]
)
Close ]
51687041400575
(When
[Case
(Choice
(ChoiceId
"WOLF_BTCADA"
(Address "addr_test1vrxx3rjangevudlrejgp9m508uc26jd02n7lmdz365n4wrca35y5j")
)
[Bound 0 1000000]
)
(Let
"market"
(ChoiceValue
(ChoiceId
"WOLF_BTCADA"
(Address "addr_test1vrxx3rjangevudlrejgp9m508uc26jd02n7lmdz365n4wrca35y5j")
))
(Let
"value"
(MulValue
(UseValue "notional_btc")
(SubValue
(UseValue "market")
(UseValue "strike")
)
)
(Let
"alice_profit"
(SubValue
(UseValue "value")
(DivValue
(UseValue "premium")
(Constant 1000000)
)
)
(If
(ValueLE
(UseValue "value")
(Constant 0)
)
(Pay
(Role "Alice")
(Account (Role "Bob"))
(Token "" "")
(MulValue
(NegValue (UseValue "value"))
(Constant 1000000)
)
Close
)
Close
)
)
)
)]
91687041400572 Close
)
)]
51687041400572 Close
)]
31687041400572 Close
)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment