Pages:
Author

Topic: Mastercoin suggestion: Contracts for Difference - page 2. (Read 5611 times)

legendary
Activity: 1358
Merit: 1003
Ron Gross
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.
sr. member
Activity: 330
Merit: 397
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 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 Smiley

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.
legendary
Activity: 1358
Merit: 1003
Ron Gross
All in due time. Too many features, too little time Smiley

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.
hero member
Activity: 714
Merit: 510
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.

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
legendary
Activity: 1358
Merit: 1003
Ron Gross
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.



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%).
legendary
Activity: 1260
Merit: 1031
Rational Exuberance
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.

legendary
Activity: 1358
Merit: 1003
Ron Gross
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.
legendary
Activity: 1260
Merit: 1031
Rational Exuberance
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.
legendary
Activity: 1358
Merit: 1003
Ron Gross
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: 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).
sr. member
Activity: 330
Merit: 397
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.
Pages:
Jump to: