Author Topic: Options and Futures contracts  (Read 867 times)

0 Members and 1 Guest are viewing this topic.

Offline Gleepower

Options and Futures contracts
« on: December 26, 2017, 07:32:24 pm »
Would there ever be interest in getting options and futures smart contracts for bitshares? I think options especially would be a great boon for bitshares, since no one really offers options on bitcoin at the moment. Are there any barriers to getting these implemented? (expiry date, counterparty risk).

Offline zapata42

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
  • BitShares: zapata42
Re: Options and Futures contracts
« Reply #1 on: December 29, 2017, 10:16:27 pm »
I'm interested in this topic too.

More specifically on how to implement then.

I think it might already possible to do  some kind of European style option with cash settlement with the proper configuration of MPA and a custom price feed.

May be this has already been discussed?

What kind of underlying do you imagine? Crypto or stock/commo/... ?

Offline Gleepower

Re: Options and Futures contracts
« Reply #2 on: January 01, 2018, 10:53:09 pm »
Yes you're definitely on to something there. Owners of MPA (Smartcoins right?) have the right but not the obligation to settle at the feed price. Problem is that MPA is more than an option since it's not just a right to buy, it's a right to get it without handing over anything (e.g. a bitusd gives you 1 dollar worth of BTS, it doesn't just give you right to buy 1 BTS at a dollar price). I can't see directly tho how you recreate a european option from an MPA.

I was thinking it over and there's many routes you can go over. I was thinking one is where options are fully collateralized - those who write a call option for asset A at price P in terms of asset B would have to put up asset A (and those who write a put option would put up asset B) as collateral for the duration of the contract. The owner of the option could at any time exchange asset B's for asset A's at price P from the issuer.

Under this system, the underlying could be any bitshares asset.

It's nice and simple with no counterparty risk. However, being able to write naked options would be nice as well. But I think that would be much more complex and would also run the risk of default. Also using a feed price to have cash(bts?)-settled options on non-bitshares assets would be a boon as well.

I also think it would be great publicity for bitshares having options, because there is no good crypto-exchange for options AND our options would be secured by smart contracts so there is less scam risk.

Offline Gleepower

Re: Options and Futures contracts
« Reply #3 on: January 01, 2018, 11:33:01 pm »
Futures I haven't thought about - but potentially might need some sort of clearing party, no idea how this would interact with smart contracts/blockchain.

Offline zapata42

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
  • BitShares: zapata42
Re: Options and Futures contracts
« Reply #4 on: January 02, 2018, 05:41:58 pm »
I can't see directly tho how you recreate a european option from an MPA.

Let's say I want an Option on Bitcoin @ 15000$ at maturity 31/01/2018.
 
I had in mind a price feed like this:
Code: [Select]
if today <= maturity (31/01/2018)  then
    price_feed = max(bitcoin_price_in_usd - 15000, 0)
else
     price_feed = 0

At MPA issuance I will:
   -  put bitUSD as collateral (but it will work also with BTS, or bitBTC if I adjust the rate of the feed).
   -  put a feed publication rate of one hour, but any rate will work,
   -  put a short delay for force settlement like 1 minute.

Anyone will be able to borrow and sell  the Option on [email protected]$ to the price (aka strike) they feel right (using their prefered pricing model).
If I buy this option I will be able to take some profit if the Bitcoin price goes higher than 15000$ before the maturity. Afterwards it will be valueless.
This will enable leverage trading, and hedging.

I suppose there are various issues when the price_feed = 0 that will make this solution invalid.
One of those is that anyone can borrow the option without any collateral, a fix could be to set a minimum collateral value.

A similar setup could be done for futures, but we need to avoid any settlement before maturity, and force settle all the futures at maturity.

Do you think somethink like this makes sense and could work?

Offline Gleepower

Re: Options and Futures contracts
« Reply #5 on: January 02, 2018, 08:26:58 pm »
Damn that's pretty ingenious - it seems you're right in thinking you can implement them as an MPA. This is much better than my solution. As you say the main issues
for options are that they need a different collateral function one that's ideally related to the volatility of the price of the underlying against the collateral asset AND the current profit.

For a normal MPA, the collateral function is 
Code: [Select]
(collateral / debt * feed_price ).

The collateral function is a function of the feed_price and always needs to be above the MCR.

Off the top of my head, a collateral function of
Code: [Select]
(collateral / debt * feed_price + (0.2 * strikeprice))) would work
and solve your collateral of 0 when the feed price is 0 problem. For example, if the MCR is 1.2 - assume your call option is written and the bitcoin price is 15000 usd. Your
debt is 1 BTC. The feed price is 0. Therefore your collateral needs to be at least 1.2 * (15000*0.2 + 0) = 3600. If the price of bitcoin rose to
17000, then the feed price would be 2000 and you would have to put up at least 1.2 * (1500 + 2000) = 6000.

I think futures is much harder to do with the method however, if we made the feed price:

Code: [Select]
if today <= maturity then price_feed = bitcoin_price_in_usd - 15000)

we would need to do 4 different things:

1) have a different collateral function (as with options)
2) BOTH sides need to now put up collateral
3) we need to only allow settlement at maturity date
4) we need to have 'negative' settlement. For example, if I went long on a bitcoin future, and the price fell to 14500, and we reached
maturity date, then I would force settle for -500 bitusd.

This would be much more radical than an option, since buying a future would require putting up margin, whilst buying a bitusd or a btcoption (under our system)
can be a simple transfer.

I think a way of giving a custom collateral function to MPA would really make them more flexible to implement things like options (and potentially many other things).
« Last Edit: January 02, 2018, 09:04:58 pm by Gleepower »

Offline zapata42

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
  • BitShares: zapata42
Re: Options and Futures contracts
« Reply #6 on: April 05, 2018, 08:53:08 pm »
Bump up this thread.

I think the final proposal of @Gleepower it's a good start.

Is there anyone else interested in this topic?

May be we can just put it in a roadmap so poeple can speculate  ;)

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3182
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: Options and Futures contracts
« Reply #7 on: April 06, 2018, 07:42:05 am »
Yes, it's very interesting. Actually I have these in mind since the beginning. Wish someone can write down the specifications clearly so we can implement it faster.

If no need to change the back end, anyone can make a proof of concept UI for it.
« Last Edit: April 06, 2018, 07:43:41 am by abit »
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline zapata42

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
  • BitShares: zapata42
Re: Options and Futures contracts
« Reply #8 on: April 06, 2018, 08:28:39 am »
If no need to change the back end, anyone can make a proof of concept UI for it.

Unfortunately I think it needs a new margin call management formula.

Ideally an asset issuer should be able to provide a custom margin call formula through a small Domain Specific Language.
This would literally allow to build any type of products.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 3182
    • View Profile
    • Steemit Blog
  • BitShares: abit
  • GitHub: abitmore
Re: Options and Futures contracts
« Reply #9 on: April 06, 2018, 01:13:16 pm »
If no need to change the back end, anyone can make a proof of concept UI for it.

Unfortunately I think it needs a new margin call management formula.

Ideally an asset issuer should be able to provide a custom margin call formula through a small Domain Specific Language.
This would literally allow to build any type of products.
If we need to parse a formula, IMHO the scope is a bit too wide. We're not a generic smart contract platform. If the formula can be narrowed down to parameters only, I'm sure we can get it implemented.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline Hexler

Re: Options and Futures contracts
« Reply #10 on: April 06, 2018, 05:45:08 pm »
Thank you for sharing it's great

Offline ebit

  • Committee member
  • Hero Member
  • *
  • Posts: 1711
    • View Profile
    • 推荐链接
  • BitShares: ebit
Re: Options and Futures contracts
« Reply #11 on: April 07, 2018, 03:22:04 am »
i will support the worker .But the ultimate goal is to pump bts but not to hurt bts.I think MPA is not the best choice .UIA ,such as usdt cnc ,will be best .

In my mind ,the MPA should be quick turnaround .with the purpose of  hedging collateral risk.