Vitalik Buterin



Offline



Activity: 331

Merit: 377







Sr. MemberActivity: 331Merit: 377 Mastercoin suggestion: Contracts for Difference November 04, 2013, 04:42:26 PM #1 Currently, Mastercoin has a feature in the works of encoding bets on the blockchain. For example, A and B can make a bet with each other where A and B can both put 5 MSC into a pool such that all 10 MSC will go to A if eToro Inc says that the value of gold in USD exceeds 1300 at the end of Oct 31, otherwise the 10 MSC will go to B. One interesting use case of on-blockchain bets that this mechanism does not adequately address, however, is hedging. Suppose that Joe, an average business owner, wants to use Mastercoin to take advantage of its financial features, but is too scared about the price volatility of MSC. He has 50 MSC in the system, but wants to have his currency exposure entirely in USD. Say 1 MSC = 40 USD now for simplicity. With bets, the one strategy that Joe has is to make staggered bets at every dollar - bet $50 that MSC will be below 39 USD, $50 that MSC will be below 38 USD, and so forth, and the same up to some threshold. For every dollar MSC falls, Joe would lose 50 USD, but he would also win one additional bet and thus gain 50 USD back; the exact opposite would happen if the value of MSC goes up by some number of dollars.



Contracts for difference are a much easier way of doing this. Essentially, Joe and Speculator Sam both put 10 MSC into a pool where, on Oct 31, the pool would pay Joe 10 MSC + 1.25 MSC for every USD that the value of MSC drops. Thus, if the value of MSC in USD drops to $39, Joe loses 50 USD from the value of MSC dropping, but he would also gain 1.25 MSC ~= 50 USD from the contract for difference. If MSC goes up to 41 USD, the opposite would happen. Obviously, if MSC goes up or down by a large enough ratio the contract would reach a point where either Joe or Sam is entitled to the entire 20 MSC (in our example, at $32 or $48). At this point, the CFD would automatically force-liquidate, giving the correct party all of the funds, at which point the loser would be required to make a new CFD if they want to return to the same level of exposure.



This would replicate much of the functionality of self-issued currencies; I think the two models could exist side by side and we'll see which model becomes more popular. Argumentum ad lunam: the fallacy that because Bitcoin's price is rising really fast the currency must be a speculative bubble and/or Ponzi scheme.

ripper234



Offline



Activity: 1358

Merit: 1002





Ron Gross







LegendaryActivity: 1358Merit: 1002Ron Gross Re: Mastercoin suggestion: Contracts for Difference November 04, 2013, 10:25:28 PM #2 Quote from: Vitalik Buterin on November 04, 2013, 04:42:26 PM Currently, Mastercoin has a feature in the works of encoding bets on the blockchain. For example, A and B can make a bet with each other where A and B can both put 5 MSC into a pool such that all 10 MSC will go to A if eToro Inc says that the value of gold in USD exceeds 1300 at the end of Oct 31, otherwise the 10 MSC will go to B. One interesting use case of on-blockchain bets that this mechanism does not adequately address, however, is hedging. Suppose that Joe, an average business owner, wants to use Mastercoin to take advantage of its financial features, but is too scared about the price volatility of MSC. He has 50 MSC in the system, but wants to have his currency exposure entirely in USD. Say 1 MSC = 40 USD now for simplicity. With bets, the one strategy that Joe has is to make staggered bets at every dollar - bet $50 that MSC will be below 39 USD, $50 that MSC will be below 38 USD, and so forth, and the same up to some threshold. For every dollar MSC falls, Joe would lose 50 USD, but he would also win one additional bet and thus gain 50 USD back; the exact opposite would happen if the value of MSC goes up by some number of dollars.



Contracts for difference are a much easier way of doing this. Essentially, Joe and Speculator Sam both put 10 MSC into a pool where, on Oct 31, the pool would pay Joe 10 MSC + 1.25 MSC for every USD that the value of MSC drops. Thus, if the value of MSC in USD drops to $39, Joe loses 50 USD from the value of MSC dropping, but he would also gain 1.25 MSC ~= 50 USD from the contract for difference. If MSC goes up to 41 USD, the opposite would happen. Obviously, if MSC goes up or down by a large enough ratio the contract would reach a point where either Joe or Sam is entitled to the entire 20 MSC (in our example, at $32 or $48). At this point, the CFD would automatically force-liquidate, giving the correct party all of the funds, at which point the loser would be required to make a new CFD if they want to return to the same level of exposure.



This would replicate much of the functionality of self-issued currencies; I think the two models could exist side by side and we'll see which model becomes more popular.



Terrific idea Vitalik. This is powerful stuff - even if the Backed Currencies feature of Mastercoin completely fails (it's a super experimental feature), CFDs can totally make up for it in being a vehicle for people to directly invest in currencies, with the only risk they're exposing themselves to is the risk that the feed generator (eToro in this case) is lying ... but without any risk to the underlying assets.



Recommend Reading:



A CFD is always a contract between two parties - one of them is going long on a particular asset (USD in Vitalik's example), and the other one is going short on the same asset. The mastercoin blockchain serves as the mediator and makes sure each party has sufficient funds committed.



You could have several CFDs for the same asset pairs - there would be bids and asks, with varying margins (discount/overcharge over the real price of a USD). At any time there would be both bids and asks (parties desiring short and long positions on an asset). It is highly beneficial for market players to maintain correct positions on a CFD marketplace, because it's essentially free money - you can decide your own margin, which will be enough to cover any potential risk you encounter. So, with a large enough market, a new party desiring to buy or sell a CFD will always find a counterparty with a relatively low margin.



I believe this is The Missing Link - a surefire way to implement any kind of asset on mastercoin, in a way that requires the minimum amount of trust (just in the price feed - maybe in the future we'll be able to distribute that away as well). Backed Currencies were our previous route to achieving this goal, and they might still work, but CFDs will definitely work (we'll implement both of course). Terrific idea Vitalik. This is powerful stuff - even if the Backed Currencies feature of Mastercoin completely fails (it's a super experimental feature), CFDs can totally make up for it in being a vehicle for people to directly invest in currencies, with the only risk they're exposing themselves to is the risk that the feed generator (eToro in this case) is lying ... but without any risk to the underlying assets.Recommend Reading: http://en.wikipedia.org/wiki/Contract_for_difference A CFD is always a contract between two parties - one of them is going long on a particular asset (USD in Vitalik's example), and the other one is going short on the same asset. The mastercoin blockchain serves as the mediator and makes sure each party has sufficient funds committed.You could have several CFDs for the same asset pairs - there would be bids and asks, with varying margins (discount/overcharge over the real price of a USD). At any time there would be both bids and asks (parties desiring short and long positions on an asset). It is highly beneficial for market players to maintain correct positions on a CFD marketplace, because it's essentially free money - you can decide your own margin, which will be enough to cover any potential risk you encounter. So, with a large enough market, a new party desiring to buy or sell a CFD will always find a counterparty with a relatively low margin.I believe this is The Missing Link - a surefire way to implement any kind of asset on mastercoin, in a way that requires the minimum amount of trust (just in the price feed - maybe in the future we'll be able to distribute that away as well). Backed Currencies were our previous route to achieving this goal, and they might still work, but CFDs will definitely work (we'll implement both of course).

Executive Director

Co-founder of the Israeli Bitcoin Association Please do not pm me, use ron@bitcoin.org.il instead Mastercoin Executive DirectorCo-founder of the Israeli Bitcoin Association

ripper234



Offline



Activity: 1358

Merit: 1002





Ron Gross







LegendaryActivity: 1358Merit: 1002Ron Gross Re: Mastercoin suggestion: Contracts for Difference November 04, 2013, 10:38:43 PM #4 Quote from: dacoinminster on November 04, 2013, 10:34:54 PM Heck yes. Doing CFDs as a MasterCoin feature is a fantastic idea. The user experience is (probably) not as simple as it would be for escrow-backed currencies, but unlike those currencies, there isn't any doubt about whether this would work, or for how long.



BTW you could even have meta features based on it: I could basically entrust a certain amount of mastercoins to "any CFD that meets certain criterias". This way, even if the duration of the contract runs out, and my counterparty can withdraw their funds ... my CFD will automatically pop up to find the next counterparty, and I won't have to manually find another one. BTW you could even have meta features based on it: I could basically entrust a certain amount of mastercoins to "any CFD that meets certain criterias". This way, even if the duration of the contract runs out, and my counterparty can withdraw their funds ... my CFD will automatically pop up to find the next counterparty, and I won't have to manually find another one.

Executive Director

Co-founder of the Israeli Bitcoin Association Please do not pm me, use ron@bitcoin.org.il instead Mastercoin Executive DirectorCo-founder of the Israeli Bitcoin Association

ripper234



Offline



Activity: 1358

Merit: 1002





Ron Gross







LegendaryActivity: 1358Merit: 1002Ron Gross Re: Mastercoin suggestion: Contracts for Difference November 04, 2013, 10:51:09 PM #6 Quote from: dacoinminster on November 04, 2013, 10:47:58 PM Quote from: ripper234 on November 04, 2013, 10:38:43 PM BTW you could even have meta features based on it: I could basically entrust a certain amount of mastercoins to "any CFD that meets certain criterias". This way, even if the duration of the contract runs out, and my counterparty can withdraw their funds ... my CFD will automatically pop up to find the next counterparty, and I won't have to manually find another one.



So, if somebody maxes out one CFD, they automatically switch to another one with equivalent terms?



Whoa. Mind blown.



Of course, you can't be sure that there will always be a counter-party available for a given set of terms, but still, that failure scenario is very easy to understand.





So, if somebody maxes out one CFD, they automatically switch to another one with equivalent terms?Whoa. Mind blown.Of course, you can't be sure that there will always be a counter-party available for a given set of terms, but still, that failure scenario is very easy to understand.

Well, there will be a lot of incentive for people to offer CFDs at competitive rates.

So if I see that over time the margin for CFDs is always in the 0-1% range, if I buy a meta-CFD with a margin of 2%, it will always find a match (of course it will not cost me 2%, but rather the best the market can offer up to 2%). Well, there will be a lot of incentive for people to offer CFDs at competitive rates.So if I see that over time the margin for CFDs is always in the 0-1% range, if I buy a meta-CFD with a margin of 2%, it will always find a match (of course it will not cost me 2%, but rather the best the market can offer up to 2%).

Executive Director

Co-founder of the Israeli Bitcoin Association Please do not pm me, use ron@bitcoin.org.il instead Mastercoin Executive DirectorCo-founder of the Israeli Bitcoin Association

Luckybit



Offline



Activity: 714

Merit: 500









Hero MemberActivity: 714Merit: 500 Re: Mastercoin suggestion: Contracts for Difference November 04, 2013, 11:14:19 PM

Last edit: November 04, 2013, 11:39:43 PM by Luckybit #7 Quote from: ripper234 on November 04, 2013, 10:38:43 PM Quote from: dacoinminster on November 04, 2013, 10:34:54 PM Heck yes. Doing CFDs as a MasterCoin feature is a fantastic idea. The user experience is (probably) not as simple as it would be for escrow-backed currencies, but unlike those currencies, there isn't any doubt about whether this would work, or for how long.



BTW you could even have meta features based on it: I could basically entrust a certain amount of mastercoins to "any CFD that meets certain criterias". This way, even if the duration of the contract runs out, and my counterparty can withdraw their funds ... my CFD will automatically pop up to find the next counterparty, and I won't have to manually find another one.

BTW you could even have meta features based on it: I could basically entrust a certain amount of mastercoins to "any CFD that meets certain criterias". This way, even if the duration of the contract runs out, and my counterparty can withdraw their funds ... my CFD will automatically pop up to find the next counterparty, and I won't have to manually find another one.

These are some excellent ideas. Mastercoin could very well trigger a financial singularity and that is why I'm invested.



What is a list of features we could build on top of CFDs?



The feature you mention about any CFD which meets certain criteria, reminds me of something Mike Hearn was talking about with contracts. I endorse that idea, care to explore it further?



Dacoinminster you might want to take a look at this.

Sahai-Waters CPE ABE

http://www.youtube.com/watch?v=mD4L7xDNCmA#t=1311

http://eprint.iacr.org/2008/290.pdf

These are some excellent ideas. Mastercoin could very well trigger a financial singularity and that is why I'm invested.What is a list of features we could build on top of CFDs?The feature you mention about any CFD which meets certain criteria, reminds me of something Mike Hearn was talking about with contracts. I endorse that idea, care to explore it further?Dacoinminster you might want to take a look at this.

ripper234



Offline



Activity: 1358

Merit: 1002





Ron Gross







LegendaryActivity: 1358Merit: 1002Ron Gross Re: Mastercoin suggestion: Contracts for Difference November 04, 2013, 11:25:37 PM #8



Vitalik and me just put the idea out there, the next step would be to formalize it.



FYI, my top priority task right now is putting Willett's whitepaper in a format that's easy to fork on github.

Once that's done we can start specifying such features more precisely on top of the whitepaper itself. All in due time. Too many features, too little timeVitalik and me just put the idea out there, the next step would be to formalize it.FYI, my top priority task right now is putting Willett's whitepaper in a format that's easy to fork on github.Once that's done we can start specifying such features more precisely on top of the whitepaper itself.

Executive Director

Co-founder of the Israeli Bitcoin Association Please do not pm me, use ron@bitcoin.org.il instead Mastercoin Executive DirectorCo-founder of the Israeli Bitcoin Association

Vitalik Buterin



Offline



Activity: 331

Merit: 377







Sr. MemberActivity: 331Merit: 377 Re: Mastercoin suggestion: Contracts for Difference November 05, 2013, 05:43:52 AM #9



1. CREATE_CFD_OFFER(privkey, price_ticker, deadline, baseline, upside, downside, ratio)



Creates an offer to make a contract for difference, in which address(privkey) would receive UPSIDE - (PRICE - BASELINE) * RATIO at DEADLINE, where PRICE is the value of PRICE_TICKER at DEADLINE. Sends a payment of UPSIDE to a protocol-managed escrow, awaiting someone to accept the offer.



2. CANCEL_CFD_OFFER(offer_txid)



Self explanatory



3. MATCH_CFD_OFFER(privkey, offer_txid)



Accepts a given offer, and sends a payment of DOWNSIDE to a protocol-managed escrow.



Example:



Joe has 50 MSC (where 1 MSC is currently 40 USD), and wants to create an escrow with Speculator Sam to balance out his exposure against the USD. Joe makes the transaction:



CREATE_CFD_OFFER(Joe's privkey, eToro-USD, Nov 31 23:59, 40, 10, 10, 1.25)



This moves 10 MSC from Joe to the escrow. Speculator Sam matches the escrow.



Case 1: MSC drops to 38 USD by Nov 31.



Joe receives 10 - (38 - 40) * 1.25 = 12.5 MSC from the escrow fund, and Sam receives 7.5 MSC. Joe lost 100 USD from the MSC price going down, but gains 2.5 * 38 = 95 USD, essentially cancelling out the downside.



Note that he does have a tiny quadratic loss, but I think it's okay to leave that in there since it's relatively small; if it does become a problem we can always change the formula to UPSIDE - (PRICE - BASELINE) * RATIO / PRICE * BASELINE to account for this.



Case 2: MSC goes up to 43 USD by Nov 31.



Joe receives 10 - (43 - 40) * 1.25 = 6.25 MSC, and Sam gets the other 13.75 MSC.



Case 3: MSC drops to 32 USD on Nov 20.



The escrow fund triggers a liquidation, giving Sam 10 - (32 - 40) * 1.25 = 0 MSC, and Joe the full 20 MSC. Joe now needs a new CFD, just in case MSC keeps dropping.



Case 4: MSC goes up to 48 USD on Nov 12.



I'm sure you can figure it out for yourself



The idea is that on top of this the GUI designers would build a good interface, perhaps segregating CFDs by leverage and duration and even limiting to specific ones to promote standardization. It would essentially work like Bitfinex or any other leveraged trading exchange. Meni also made an argument that this mechanism would require people willing to speculate on MSC at 2x leverage; if this becomes problematic, the market will self-correct and put CFDs at a premium in the 2x leverage speculator's favor, at least until some people arbitrage away the difference by taking half their money into fiat and half into 2x leveraged CFDs. Here's some formalization:1. CREATE_CFD_OFFER(privkey, price_ticker, deadline, baseline, upside, downside, ratio)Creates an offer to make a contract for difference, in which address(privkey) would receive UPSIDE - (PRICE - BASELINE) * RATIO at DEADLINE, where PRICE is the value of PRICE_TICKER at DEADLINE. Sends a payment of UPSIDE to a protocol-managed escrow, awaiting someone to accept the offer.2. CANCEL_CFD_OFFER(offer_txid)Self explanatory3. MATCH_CFD_OFFER(privkey, offer_txid)Accepts a given offer, and sends a payment of DOWNSIDE to a protocol-managed escrow.Example:Joe has 50 MSC (where 1 MSC is currently 40 USD), and wants to create an escrow with Speculator Sam to balance out his exposure against the USD. Joe makes the transaction:CREATE_CFD_OFFER(Joe's privkey, eToro-USD, Nov 31 23:59, 40, 10, 10, 1.25)This moves 10 MSC from Joe to the escrow. Speculator Sam matches the escrow.Case 1: MSC drops to 38 USD by Nov 31.Joe receives 10 - (38 - 40) * 1.25 = 12.5 MSC from the escrow fund, and Sam receives 7.5 MSC. Joe lost 100 USD from the MSC price going down, but gains 2.5 * 38 = 95 USD, essentially cancelling out the downside.Note that he does have a tiny quadratic loss, but I think it's okay to leave that in there since it's relatively small; if it does become a problem we can always change the formula to UPSIDE - (PRICE - BASELINE) * RATIO / PRICE * BASELINE to account for this.Case 2: MSC goes up to 43 USD by Nov 31.Joe receives 10 - (43 - 40) * 1.25 = 6.25 MSC, and Sam gets the other 13.75 MSC.Case 3: MSC drops to 32 USD on Nov 20.The escrow fund triggers a liquidation, giving Sam 10 - (32 - 40) * 1.25 = 0 MSC, and Joe the full 20 MSC. Joe now needs a new CFD, just in case MSC keeps dropping.Case 4: MSC goes up to 48 USD on Nov 12.I'm sure you can figure it out for yourselfThe idea is that on top of this the GUI designers would build a good interface, perhaps segregating CFDs by leverage and duration and even limiting to specific ones to promote standardization. It would essentially work like Bitfinex or any other leveraged trading exchange. Meni also made an argument that this mechanism would require people willing to speculate on MSC at 2x leverage; if this becomes problematic, the market will self-correct and put CFDs at a premium in the 2x leverage speculator's favor, at least until some people arbitrage away the difference by taking half their money into fiat and half into 2x leveraged CFDs. Argumentum ad lunam: the fallacy that because Bitcoin's price is rising really fast the currency must be a speculative bubble and/or Ponzi scheme.

cunicula



Offline



Activity: 1064

Merit: 1003







LegendaryActivity: 1064Merit: 1003 Re: Mastercoin suggestion: Contracts for Difference November 08, 2013, 08:19:09 PM #13 Since this is for a short-term contract I agree that the proposed CFD scheme is feasible. With CFD, you are forced to settle the position at an expiration period.



This is very different from a pegged MastercoinUSD. With USD I can keep them in my wallet as long as I feel like.

I would also argue that this makes CFD much less useful to the average person.



But it's still a great idea. Nice to see this making progress instead of languishing because of misguided commitment to a flawed implementation.

cunicula



Offline



Activity: 1064

Merit: 1003







LegendaryActivity: 1064Merit: 1003 Re: Mastercoin suggestion: Contracts for Difference November 08, 2013, 08:26:14 PM #14 Quote from: ripper234 on November 05, 2013, 02:10:03 PM

The two features sound terribly similar.

I advise everyone to take a look at this comparison I just drew up between BitShares and Mastercoin CFDs The two features sound terribly similar.



1) With CFDs, you are forced to settle the position at an expiration period. This prevents unsustainable accumulation of debt which is central to BitPonzi.

2) With CFDs, there is no magical shower of interest payment. This removes the incentive for unsustainable accumulation of debt which is central to BitPonzi.

3) With CFDs, (I believe) there is an external data stream reporting prices. This means that prices aren't selected by magic. (again failure to employ magical thinking in your algorithm is a distinguishing feature from BitPonzi.) [You do face a challenge in dealing with potential data feed manipulation, however. ]





Again, I'm glad to see this new development. Capacity for change is essential to long-term success. This is why I have never let loose the rabid rabbit on Mastercoin and hope I never feel the need to. Here in lie three key differences distinguishing master CFDs from BitPonzi:1) With CFDs, you are forced to settle the position at an expiration period. This prevents unsustainable accumulation of debt which is central to BitPonzi.2) With CFDs, there is no magical shower of interest payment. This removes the incentive for unsustainable accumulation of debt which is central to BitPonzi.3) With CFDs, (I believe) there is an external data stream reporting prices. This means that prices aren't selected by magic. (again failure to employ magical thinking in your algorithm is a distinguishing feature from BitPonzi.) [You do face a challenge in dealing with potential data feed manipulation, however. ]Again, I'm glad to see this new development. Capacity for change is essential to long-term success. This is why I have never let loose the rabid rabbit on Mastercoin and hope I never feel the need to.

markm



Offline



Activity: 2604

Merit: 1038









LegendaryActivity: 2604Merit: 1038 Re: Mastercoin suggestion: Contracts for Difference November 09, 2013, 12:13:10 AM

Last edit: November 09, 2013, 12:29:06 AM by markm #15 I think that back when we discussed longcoins and shortcoins ideas it turned out that it is possible to not need a data feed.



Basically at any moment when either party saw a price somewhere that made them prefer that price, they could escape the longcoin/shortcoin position to cash in wherever it was that they thought would for them be a better deal.



It thus needed no oracles aka data feeds, since it is no one else's business but your own why it is that you exercised, or even whether you were in fact going to actually be able to get the better deal that had lured you into exercising.



Why should anyone but you need to know how much you are going to go sell something for elsewhere? If in fact you do know of some obscure marketplace where you can get a better price than others who only know of some well known markets not the lucrative markets you know of isn't it in your best interest not to reveal what price the asset is worth on some market somewhere but simply to close your position and go make your sale without telling everyone "oh by the way, right now gold is going for $XXXX.XX over at such and such a place" ?



I do not recall offhand the details of the setup that allowed people this freedom from third party claims about what things are worth, but isn't it in general better in a supposedly free market to be able to decide for yourself whether exercising or not is profitable for you, taking into account what prices you with your possibly extraordinary contacts and knowledge of markets can get, than to let some third party dictate how much your stuff is worth based on some oracle or market or feed that they themselves happen to prefer to use for making their own decisions as to what the current value of things is to them?



In the context of whether something is worth a meatspace dollar or not for example, if you yourself happen to find a buyer who is willing to pay a meatspace dollar for something shouldn't that be sufficient, shouldn't you be able to just sell the thing to that buyer for a dollar without having to reveal to the people you are doing long and short stuff with that you do know of an opportunity to get a dollar and maybe even reveal to them who what where you (or maybe anyone in general who knew of the opportunity) could go get a dollar at this particular moment?



Basically such a system even allows both the long position person and the short position person to totally dis-agree about the current value of a thing, while allowing both of them the freedom to go cash in at the value they believe they can get for it, whether or not the other party could get that same amount for it or not.



This could even go to totally personal opportunities, "oh my uncle will give me a hundred bucks for this first dollar I ever earned by trading, so I don't care that you believe it is only worth a dollar I am going to sell it for a hundred dollars too bad for you your uncle isn't so generous" type situations. When you want out of the position you get out, no one need know how much you got or hoped to get for the stuff you backed out of / withdrew from the long/short situation. No need for an oracle or feed telling everyone "by the way so and so's uncle will buy one for a hundred right now" etc.



The end result though was like a contract for difference except both parties got what they could get for a thing without any need to know what the other party or a third party arbiter/oracle/feed claimed a thing was worth.



(You sell your stuff where you think best for you, other chap sells his where he thinks best for him.)



It thus seemed like a pretty good setup, but I think the reason it never got pursued was that it had no leverage into it, and back when we were discussign it everyone was all about leverage, they wanted basically what the teenager's site that had died with everyone's funds was providing, an ability to bet small to win huge on changes in prices e.g. of bitcoins compared to dollars or dollars compared to bitcoins etc.



The longcoin/shortcoin approach I think basically needed collateral, so in those days with that audience all of whom wanted something for nothing without collateral it was anathema.



-MarkM-



Free website hosting with PHP, MySQL etc: Browser-launched Crossfire client now online (select CrossCiv server for Galactic Milieu) Free website hosting with PHP, MySQL etc: http://hosting.knotwork.com/