representing CFDs using colored coins

0 views
Skip to first unread message

Alex Mizrahi

unread,
Jan 27, 2013, 9:39:45 AM1/27/13
to bitc...@googlegroups.com
In the previous message I've described how colored coins can represent prediction market contracts.
It works when we have only two outcomes like YES or NO, but what if want something more flexible, like making a bet on price moves?


In finance, a contract for difference (or CFD) is a contract between two parties, typically described as "buyer" and "seller", stipulating that the seller will pay to the buyer the difference between the current value of an asset and its value at contract time. (If the difference is negative, then the buyer pays instead to the seller.) In effect CFDs are financial derivatives that allow traders to take advantage of prices moving up (long positions) or prices moving down (short positions) on underlying financial instruments and are often used to speculate on those markets.

(Note that what I'm describing here might not work exactly like traditional CFDs, but is probably close enough.
Although it's also quite like NDF, see below.)

This can be implemented in a way similar to prediction market I described in previous message, but it is a bit more complex as buyer of a CFD might be at loss and would need to pay the seller.
Thus we need to incorporate initial margin into contract.

So we'll issue two kinds of coins with value calculated using this formula:

LONG-CFD price = I + Q(P_e - P_s)
SHORT-CFD price = I + Q(P_s - P_e)
Where:
I: initial margin
Q: quantity of underlying asset
P_e: price per unit (in bitcoins) in the end (at time when contract expires and settlement is made)
P_s: price per unit (in bitcoins) at start, e.g. price at time contract is made

Issuer/operator shall buy back these coins at these prices when settlement is made. (It's also possible to roll it over: contract will be swapped for a new contract +/- variation margin.)

But price might fluctuate in between. 
Issuer can either act as a market maker to make CFD price matching current asset price. (I.e. P_e = current price in formula above.)
Or he can let it float, thus making these contracts more like non-deliverable forwards (NDF). (I.e. P_e = forward price).

In any case, sum of price of LONG-CFD and SHORT-CFD is always 2 * I (price at start and at end cancels out), 
so issuer can always sell pairs of such contracts and have zero-exposure himself. (But in that case there is an implied forward price, so it's like a NDF.)

Now there is a fundamental problem with decentralized markets: you cannot represent below-zero values. 
E.g. if somebody bought a LONG-CFD and price have tanked, he owns operator some money, but there is no way to get that money if it was anonymously purchased.

We have to deal with it and always assume that profit and loss are capped. I.e. one cannot lose more than his initial margin and variation margin at time contract is bought.

This works similar to stop-loss and take-profit, but these are not orders investor might tweak, they are inherent features of instrument itself.
Issuer/operator must pick some reasonable stop-loss and take-profit conditions.

Let's get back to formula:
LONG-CFD price = I + Q(P_e - P_s)
Price goes to zero when P_e = P_s - I/Q. This is an equivalent of stop-loss price (and take-profit  price for SHORT-CFD).
If we want an equivalent of stop-loss at 25% price fall we should set I = Q*P_s*0.25.

In this case settlement will be exact as long as price is within 25% range of initial price. If it goes outside of this range profit and loss are capped.

In general, if we want settlement to be exact in price range (1-k)*P_s...(1+k)*P_s we need I = Q*P_s*k.

Thus 
LONG-CFD price = Q*(k*P_s + P_e - P_s)
SHORT_CFD price = Q*(k*P_s + P_s - P_e)

It is possible to use escrow/primary dealers construct just like with prediction market:
issuer will provide a pair of CFDs for 2 * Q* k * P_s BTC in escrow.
Primary dealers then can either sell them in pairs, or act as market-makers.

Settlement becomes more complex: as both sides of CFD can have value in them both are needed to unblock deposited funds.
Issuer's market intervention might be necessary to force investors to be reasonable and to sell coins to primary dealers at a reasonable price.





Meni Rosenfeld

unread,
Jan 27, 2013, 9:52:23 AM1/27/13
to bitc...@googlegroups.com
Related:

https://bitcointalk.org/index.php?topic=82530.0
https://bitcointalk.org/index.php?topic=86069.0

ABSORB is basically like your suggestion but purer, focusing entirely on the endpoints. POLY makes sure the amounts are never negative.
--
 
 

Alex Mizrahi

unread,
Jan 27, 2013, 3:48:26 PM1/27/13
to bitc...@googlegroups.com
ABSORB is basically like your suggestion but purer, focusing entirely on the endpoints.

Well, the difference is that purchase of a CFD/NDF is financially equivalent to purchase of underlying commodity, as long as price stays within the range.

Which means that it is easy to understand your position, use it for hedging etc.
Both for trader and for issuer/market maker.

While ABSORB is a weird kind of an option contract, and it's hard to estimate value of that option. (It depends on volatility and stuff like that.)

Here's an example:
Suppose I sell a some product for 11 BTC, price is fixed in Bitcoin, payment is done only when it ships.
But I need to pay supplier $100 before I ship (from my own reserves). 
Current exchange rate is 10 USD for 1 BTC. So I should get 1 BTC profit on this trade if exchange rate does not change.

I don't want an exposure to exchange rate fluctuations on for this trade, so I buy a CFD on $100 USD.

Once I'll receive payment from customer I will sell CFD which will cover exchange rate difference, and buy $100 USD to replentish reserves, and my profit on this trade is exactly 1 BTC no matter what happens to exchange rate.

In numbers: CFD on $100 USD with 25% price range and 0.1 BTC per USD initial price costs (only margin):
 0.25*100*0.1 = 2.5 BTC.

Suppose at the time I received payment from customer Bitcoin exchange rate tanked to 8 USD per BTC. 
(20% drop.) Now USD price is 0.125 BTC and CFD price is

 2.5 + 100*(0.125-0.1) = 5 BTC.

I need 12.5 BTC to buy $100 USD, so in the end my profit is:

  11 BTC   (from customer)
 + 5  BTC  (sold CFD)
 - 2.5 BTC (bought CFD)
 -12.5 BTC (bought 100 USD @8)
 = 1 BTC 

Exactly as planned.

If I didn't use a CFD I would have had 1.5 BTC loss.

Note that I'm not paying any premium for this exchange rate protection, only costs are transaction fees and spreads which should be minimal on liquid and efficient market.

You cannot do that with options, option has a price which I pay even if I don't use it. On the other hand, if exchange rate goes in opposite direction I might get some nice profit.

So options are far less suitable for this kind of thing where one doesn't look for extra profit but simply wants to eliminate his exposure.

ABSORB is even worse than options because premium is huge and it covers only part of risk.

Now, say, what happens if it goes outside of price range? If it goes slowly then it's possible to roll it over into a different issue of CFD.
If it jumps quickly then we can say that initial margin wasn't enough for observed volatility.
But still it is better than nothing.
Also, issuer can offer non-limited profit if he can hedge that...

Yoni Johnathan Assia

unread,
Jan 27, 2013, 4:59:00 PM1/27/13
to bitc...@googlegroups.com
Great definition of a CFD price.

Its worth adding the ability to add leverage to the equation, so the price change will be Q*L(P1-P2), so you could not only risk 10% of the required margin (like stop loss) you could leverage the change.
For example, lets assume price of one barrel of oil is 10 BTC 
You could use 1 BTC to buy one contract in X1 leverage
Or you could use 1 BTC to buy one contract in X10 leverage

if the price goes to 10.1, then 
in X1 You will make 0.1 profit 
in 1 You will make 1 BTC  profit (you doubled your initial margin)

Another element to add is the spread, which should be the market maker revenue, a market maker could also use an algorithm (simple inventory management), where he issues he always issues both long and short, and skews the middle price and increases his spread based on his exposure.

This could be very usefull contracts, and is a good example of issueing hard assets currencies that are only begged to the issuers gurentess of market making.






--
 
 

Meni Rosenfeld

unread,
Jan 28, 2013, 8:41:35 AM1/28/13
to bitc...@googlegroups.com
Yoni - the Q in Alex's formula already takes care of the leverage. If the initial price of the longCFD asset is I and it represents Q units of the underlying commodity, you get a leverage of Q/I.

A market maker will need of course some spread but that is a layer above the primary definition of the CFD.
--
 
 

Meni Rosenfeld

unread,
Jan 28, 2013, 9:00:02 AM1/28/13
to bitc...@googlegroups.com
Sorry, Q*P_s/I.

Alex Mizrahi

unread,
Jan 28, 2013, 9:00:37 AM1/28/13
to bitc...@googlegroups.com

Yoni - the Q in Alex's formula already takes care of the leverage. 

Yep.
Basically, margin requirements define leverage: e.g. 5% margin corresponds to 20x leverage.

E.g. suppose price of 1 USD is 0.06 BTC.
With 5% margin requirement initial price of CFD is 0.05 * 0.06 = 0.03.
Thus with 1 BTC I can buy 333 USD CFDs.

However, I can buy only 16.6 USD on spot market.

Thus 5% margin requirement corresponds to 20x leverage.

>  If the initial price of the longCFD asset is I and it represents Q units of the underlying commodity, you get a leverage of Q/I.

Q * P_s/I


Meni Rosenfeld

unread,
Jan 28, 2013, 9:21:02 AM1/28/13
to bitc...@googlegroups.com
Hi Alex,

1. You're preaching to the choir wrt the need for a determined position on the underlying asset, and in the next items I'll explain why ABSORB is a useful approximation.

2. In the ABSORB OP I've given a formula for the "baseline value", which is what I estimate the market value of the asset to be under the reasonable assumption of exponential Brownian motion.

3. If the range is narrow enough (you want the range to be narrow in order to allow high leverage), the process is approximated by normal Brownian motion, and then my formula reduces to a simple linear interpolation. In other words, in these conditions the market value of the contract is a linear (affine actually) function of the underlying rate - just like in your suggestion.

4. The value being linear, it represents a position of a specified multiple of the underlying rate (the slope of the line). So it can be used for hedging and whatnot.

5. I'm not clear if you want the CFD to have a set settlement date or if you want absorbing states. If the former the market value of the contract won't be linear in price.

6. If we use your suggestion with absorbing states, the fundamental difference from ABSORB is that the issuer guarantees a linear value throughout the price range; and in ABSORB the value is guaranteed only at endpoints, and the interpolation is done by the market. This is similar to a shelf under load - if it's short or supported throughout its length it's straight, if it's long and unsupported it gets curved. Likewise, with your CFD the issuer gives linear support, while with ABSORB either the range is short (organically leading to linearity) or you get a nonlinear formula.

7. Even with a nonlinear formula, you can still use it for hedging (and I gave a formula for the equivalent position), though it's much more involved as you'd need to adjust the amount of contracts held to the current price. Even if the formulae don't reflect the market value 100% accurately they are still useful to get the overall trends.

8. Both ABSORB and POLY were devised by starting with a simple CFD as you described and thinking how to extract their essence to get something simpler. ABSORB has a range but eschews intermediate issuer intervention. POLY is persistent (no range) but requires continuous backing by the issuer. If it's feasible technically there is indeed an advantage to an asset that has a linear value using both a range and continuous issuer backing.
--
 
 

Reply all
Reply to author
Forward
0 new messages