Back of the Envelope

Observations on the Theory and Empirics of Mathematical Finance

[OS] Moving to Xubuntu

leave a comment »

About a year and a half back I talked about my transition to Lubuntu. I found it pretty perfect for my usage, and have had no major issues with it but Chrome has been misbehaving a bit since I moved to LTS 16.04. While fixes exist, I couldn’t find anything permanent, and since I had some time I thought it might be a good opportunity to try the slightly more endowed Xubuntu – with a slightly larger user base while remaining sufficiently lean.

In the last couple of days, I have tested Xubuntu on my office desktop (i5) and my Asus laptop (i3). Its boot time is similar to Lubuntu, and Chrome and Firefox open quickly enough (if anything, a bit quicker than Lubuntu). Many settings are similar to those in Lubuntu (e.g. setting proxy), but setting keyboard shortcuts is even easier. So far I am not missing Lubuntu.

Building upon the earlier discussion on Lubuntu, here are my settings for a minimalist Xubuntu (on an i3 machine with 4 GB RAM). I use them in the following order:

  1. Disk partitioning scheme:
    /boot = 4 GB, /root = 16 GB, /swap = 4 GB, /tmp = 4 GB
    /opt = 6 GB, /var = 6 GB, /usr = 24 GB, /usr/local = 16 GB

    /home takes up the remaining space. I also leave about 24 GB space free for emergency.

  2.  First update:
    sudo apt-get update && sudo apt-get upgrade && sudo apt-get install aptitude
  3. Essentials:
    sudo aptitude install synaptic xubuntu-restricted-extras chromium-browser
    sudo aptitude install gdebi libboost-all-dev swig cmake git xdotool vlc
    sudo aptitude install python-gpgme mencoder curl libcurl4-openssl-dev
    sudo aptitude install usb-creator-gtk p7zip keepass2 cryptsetup cryptmount
    sudo aptitude install lame alsaplayer-common alsaplayer-text soundconverter
    sudo aptitude install pdftk pdfchain djview4 zathura zathura-ps zathura-djvu
    sudo aptitude install gparted gimp getmail4 gnome-search-tool ibritish
  4. At this stage I set-up Dropbox in a separate partition and let the folders sync. In the meantime I create the necessary documentation infrastructure:
    sudo aptitude install emacs auctex pandoc markdown texlive-full

    You may install auctex and ess directly from the emacs package manager (containing the more recent versions). I install ess after getting R.

  5. Keyboard shortcuts: Settings Manager -> Settings Editor -> xfce4-keyboard-shortcuts
  6. Printer: If you have a duplex printer, and it does not automatically respect duplex settings, you may have to set it to ON from Settings -> Printer. If you have an HP printer, hplip-gui (available from synaptic) is also useful.
  7. Speedup boot: 
    • Remove unnecessary start-up services (and add any) from Settings Manager -> Session and Startup
    • Create a file ~/.gtkrc-2.0 and paste the following: Hat-tip BinaryTides
      gtk-menu-popup-delay = 0
      gtk-menu-popdown-delay = 0
      gtk-menu-bar-popup-delay = 0
      gtk-enable-animations = 0
      gtk-timeout-expand = 0
      gtk-timeout-initial = 0
      gtk-timeout-repeat = 0
  8. Python-specific: Hat-tip  Chris’ sandbox
    sudo aptitude install gfortran g++ build-essential pkg-config
    sudo aptitude install python-dev python3-dev python-pip python3-pip
    sudo aptitude install python3-tk libatlas-dev liblapack-dev libblas-dev
    sudo aptitude install libfreetype6 libfreetype6-dev libpng-dev libjpeg8-dev

    I no longer use Anaconda for Python and install all necessary packages within virtual environments (a useful intro is here (option 3)). Jorgen Schaefer’s elpy package means that I don’t have to leave emacs at all.

    In particular, after setting the virtual environments, I have the following installed packages (in that order) for data science/financial modeling related work in emacs:

    pip install numpy scipy pandas matplotlib
    pip install sympy seaborn jupyter scikit-learn statsmodels
    pip install rope jedi flake8 importmagic autopep8 yapf

Written by Vineet

January 9, 2017 at 8:53 pm

[Exec-Ed] “Practical Quantitative Finance using Python and QuantLib”

leave a comment »

Some bit of shameless self-promotion, for those with some interest in derivatives:

We are starting a new online executive program covering topics on derivatives pricing and computational finance using Python and QuantLib. The program begins in the 3rd week of January. If you’d like to join or are interested to know more, you may write to me or get in touch with our office. More details here.

Written by Vineet

January 1, 2017 at 6:19 pm

[Etc] So Long, Marianne

leave a comment »

R.I.P Leonard Cohen

Written by Vineet

November 13, 2016 at 2:01 pm

Posted in Stories

Tagged with ,

[PGP-I FM] Option bounds

leave a comment »

Put-Call Parity

We introduced these new products called Call and Put options by unbundling a forward and we had the following relationship:

\mbox{Long Forward = Long Call + Short Put}

 or alternatively,

F_T = S_T - K = \mbox{max}(S_T - K, 0) - \mbox{max}(K - S_T, 0)

\mbox{Value of Forward at T = Call Payoff at T - Put Payoff at T}

Since this is a relationship about a product being ‘broken’ into its constituents, if this holds at time T (i.e. in future value terms), this must also hold today (i.e. in PV terms), and we have the following result:

\mbox{Value of Forward Today = Value of Call Today - Value of Put Today}

\mbox{PV}(S_T - K) = \mbox{Call Price Today (C) - Put Price Today (P)}

or more succinctly in PV terms as:

\boxed{S - PV(K) = C - P}

This is referred to as the Put-Call Parity in options markets.

Having introduced the machinery of payoff diagrams we may also see this graphically. Consider the following payoff. It is known by alternative names of a Call + Bond or a Protective Put.

call-bond-protective-put(Call + Bond / Protective Put; Click to zoom)

The reason they are are known by multiple names is that one can break the same payoff down alternatively as a portfolio of a Call Option (C) and a Zero-Coupon Bond (PV(K)), or a portfolio of a Put Option (P) and Stock (S) as:

call-bond(Call + Bond; Click to zoom)


protective-put2(Protective Put; Click to zoom)

Since both Call + Bond and Protective Put represent the same payoff at expiration (T), they must be valued at the same price. That is, we must have:

\begin{aligned} \mbox{Call Option + Zero Coupon Bond} = \mbox{Protective Put} &= \mbox{Put Option + Stock} \\ \Rightarrow \mbox{PV(Call Option) + PV(Zero Coupon Bond)} &= \mbox{PV(Put Option) + PV(Stock)} \end{aligned}

Writing the present values of a Call and Put Option as \mbox{C} and \mbox{P} respectively, we again get the Put-Call Parity as:

\boxed{C + PV(K) = P + S}

So if one knows the price of a Put Option on a stock with strike K and time to maturity T, one can find the price of the Call Option on the same stock for same strike K and time to maturity T.

Option Bounds

Call Option: Lower Bound

Continuing with the same examples of a Call + Bond and Protective Put we now compare the payoff from a Call + Bond with that from holding a Stock, i.e. geometrically we compare the following two payoffs:

call-bond-stock1(Comparing Call + Bond and Stock; Click to zoom)

It’s clear that when the stock price at expiration S_T is more than K, both a Call + Bond and a Stock have the same payoff, but whenever the stock price at expiration, S_T is less than K, a Call  + Bond offers K \ge S_T, but a Stock offers only S_T.

That is, in many ‘states of the world’ a Call + Bond offers the same payoff as holding a stock, but in some states it offers more than what holding a stock offers. This suggests that the present value of Call + Bond must always be more than or equal to that of holding a simple stock. That is, we must have:

\begin{aligned} \mbox{PV(Call + Zero Coupon Bond)} &\ge \mbox{Stock} \\ \Rightarrow \mbox{PV(Call Option)} &\ge \mbox{PV(Stock - Zero Coupon Bond)} \end{aligned}

Writing the present values of a Call as \mbox{C} gives us the Lower Bound for the present value (price) of a Call Option as:

\boxed{C \ge S - PV(K)}

A more trivial lower bound for a Call Option, is, of course C \ge 0. If the strike price K is ‘high enough’ (so as to make S - PV(K) < 0), then, technically, the lower bound for a Call Option must be:

\boxed{C \ge\mbox{max}\big[ S - PV(K), 0 \big]}

Call Option: Intrinsic Value

The fact that PV(K) \le K gives us another result that:

\begin{aligned} C &\ge \mbox{max}\big[S - PV(K), 0 \big] \\ \Rightarrow C &\ge \mbox{max}\big[ S - K, 0 \big] \end{aligned}

The term \mbox{max}\big( S - K, 0 \big) is referred to as the Intrinsic Value of the Call Option, and a European Call Option is always worth more than its Intrinsic Value.

For American Options, the difference between the Call Option Price and its Intrinsic Value is sometimes referred to as in the market as the ‘Time Value of the Call Option’ (not to be confused with the time value of money. It is an unfortunate choice of words, but that’s how it is.) One can think of the difference between the price of the Call Option and its Intrinsic Value as that part of the Call Option price that is the ‘reward for waiting for the potential upsid’ and possibly exercising the option when the stock price is even higher. This is another way to see why American Call is no more valuable than a European call, because there is always a positive ‘reward for waiting’ for a Call on a non-dividend paying stock.

Call Option: Upper Bound

Finding the Upper Bound for the Call Option price is a lot easier, and is just equal to the stock price. Think of it this way – no one is going to pay anyone to get the right to buy a stock, when one can just purchase it directly from the market, i.e. we must have:

\boxed{C \le S}

Put Option: Lower Bound

Again, similar to the way we proceeded in the case of a Call Option, we now compare the payoff from a Protective Put with that from holding a Zero-coupon bond, i.e. now geometrically we compare the following two payoffs:

protective-put-bond(Comparing Protected Put and a Zero Coupon Bond; Click to zoom)

This time is the other way around, and we say that when the stock price at expiration S_T is less than K, both a Protected Put and a Zero Coupon Bond have the same payoff K, but whenever the stock price at expiration, S_T is more than K, a Protected Put offers S_T \ge K, but a Zero Coupon Bond, of course, always offers only K.

That is, in few ‘states of the world’ a Protected Put offers the same payoff as holding a Zero Coupon Bond, but in many states it offers more than what holding a Zero Coupon Bond offers. Again, this suggests that the present value of a Protected Put must always be more than or equal to the price of a Zero Coupon Bond. That is, we must have:

\begin{aligned} \mbox{PV(Protected Put)} &\ge \mbox{PV(Zero Coupon Bond)} \\ \mbox{or } \mbox{PV(Put Option + Stock)} &\ge \mbox{PV(Zero Coupon Bond)} \\ \Rightarrow \mbox{PV(Put Option)} &\ge \mbox{PV(Zero Coupon Bond) - Stock} \end{aligned}

Similarly, writing the present value of a Put as \mbox{P} gives us the Lower Bound for the present value (price) of a Put Option as:

\boxed{P \ge PV(K) - S}

Just like in the case of a Call Option, a more trivial lower bound for a Put Option, is, of course P \ge 0. If the strike price K is ‘low enough’ (so as to make PV(K) - S \le 0), then, technically, the lower bound for a European Put Option must be:

\boxed{P \ge \mbox{max}\big[ PV(K) - S, 0 \big]}

Put Option: Intrinsic Value

The fact that PV(K) \le K doesn’t help us much in the case of a Put Option (why? Hint: Compare K - S with PV(K) - S – which is larger?). The term $latex\mbox{max}(K – S, 0)$, however, is still referred to as the Intrinsic Value of the Put Option, though now one can’t say that a European Put Option is always worth more than its Intrinsic Value. The same we can say for an American Put Option, however, because an American Put can always be exercised prior to maturity and therefore must be worth at least as much as its Intrinsic Value, i.e. for an American put:

\boxed{P_{\mbox{American}} \ge K - S}

Put Option: Upper Bound

Upper bound for the Put Option price is similarly argued. Because one can always put money in the bank, a Put Option must never be sold for more than the value of a Zero Coupon Bond with principal K, i.e. we must have:

\boxed{P \le PV(K)}

Alternatively, one could argue that the maximum payoff at maturity from a European Put Option is just K, so the maximum value of a Put Option today must be just the present value of K, i.e. PV(K).

Because it may be optimal for an American put to be exercised early, the corresponding upper bound for an American put is:

\boxed{P_{\mbox{American}} \le K}

Written by Vineet

October 28, 2016 at 7:11 pm

[PGP-I FM] Payoff diagrams

with one comment

Payoff diagrams are simply diagrammatic representation of payoffs at termination/expiration of a contract w.r.t value of the underlying S_T.

For example, for a baker’s forward contract (long forward) it is a plot of its payoff (S_T - K) at expiration (T) w.r.t the wheat’s spot price S_T. Let’s recap the payoffs for some of the contract we have already talked about, and then some:

  1. Long Forward: F = S_T - K
  2. Short Forward: -F = K - S_T
  3. Long Call: C = \mbox{max}(S_T - K, 0)
  4. Short Call: -C = \mbox{- max}(S_T - K, 0)
  5. Long Put: P = \mbox{max}(K - S_T, 0)
  6. Short Put: -P = \mbox{- max}(K - S_T, 0)

With this idea in place, we can also talk about the payoff diagram of an underlying itself w.r.t itself. This is of course trivial, because a stock is a stock is a stock, so if we buy a stock, that stock’s value is just the value of the stock.

Another easy one is that for a zero-coupon bond. A zero-coupon bond always return the face value at ‘expiration’ (maturity). It is often convenient in the context of options to talk about about a zero-coupon bond with face value K and expiration T, i.e coinciding with that implicit in the forward contracts/options.

Let’s draw some pictures now. Since they are all basically plots of very simple functions as \mbox{Payoff} = f(S_T), I take it that you recall enough of drawing functions of the kind y = f(x) from your school days to not spend time explaining how you would draw these. Here we go.

Long Forward and Short Forward

Payoff Diagram - Long Forward (Baker) and Short Forward (Farmer)

Payoff Diagram – Long Forward (Baker) and Short Forward (Farmer)

Long Call and Short Call

Payoff Diagram - Long Call (Baker's choice) and Short Call (Baker's obligation)

Payoff Diagram – Long Call (Baker’s choice) and Short Call (Baker’s obligation)

Long Put and Short Put

Payoff Diagram - Long Put (Farmer's choice) and Short Put (Farmer's obligation)

Payoff Diagram – Long Put (Farmer’s choice) and Short Put (Farmer’s obligation)

Stock (underlying) and Zero-coupon Bond

Payoff Diagram - Stock (or Wheat or any underlying) and Zero-coupon bond (face value K with maturity T)

Payoff Diagram – Stock (or Wheat or any underlying) and Zero-coupon bond (face value K with maturity T)

Note that all upward sloping lines have a slope of +1 and downward sloping lines have a slope of -1 (why?).

Written by Vineet

October 28, 2016 at 7:07 pm

[PGP-I FM] Options as unbundled forwards

with 2 comments

Let’s go back to our baker-farmer story and consider what happens at the termination/expiration of the forward contract. At expiration, if the ‘spot’ price of the wheat has gone up it is the farmer’s loss and the baker’s gain (because she is delivering wheat at the contracted delivery price instead of the now-higher spot price, and the baker is the lucky bugger who is getting to buy wheat at the lower contracted price when the market price at the end of the period is higher). That is, a forward contract is a zero-sum game.

At the time of the settlement, one side will realize a gain at the expense of the other side. But if the point for both parties was to lock a price in advance, it is not a problem and both would not have too much of a problem resigning to their fate. After all, there will be times when farmer will gain at the expense of the baker.

Let’s quantify that gain/loss now. If the price of the wheat is S_T at the termination time T, and the forward contract delivery price was set at K, the baker’s payoff is S_T - K (the baker is happy when S_T > K) and the farmer’s payoff is K - S_T (the farmer is happy when K > S_T).


While the zero-sum game and all that is fine, farmer nonetheless would like to have a choice to sell at the market price when the price of wheat has increased, and not necessarily feel obliged to sell at a lower price as she has to in a forward contract. Similarly, baker would also like to have a choice to buy the wheat directly from the market if the price of wheat has gone down.

Forward contracts being legally binding do not obviously serve this desire. Again, well-functioning markets provide such felt needs to be addressed.

This is how Options come into the picture. Options serve exactly this felt need of both the farmer and the baker. Options are products that provide farmer the choice to sell the wheat at the contracted price when it suits her interest- that is, exactly when the price has gone down (a “Put Option”), and the baker the choice to buy the wheat at the contracted price when it suits his interest – exactly when the price has gone up (a “Call Option”).

If you think about it an Option basically provides an ‘escape clause’ from the forward contract – it allows the farmer to escape when the price has gone up, and the baker to escape when the price has gone down. The natural question then is how do we make it work. If the farmer has to have a choice, then there has got to be some baker out there who is ready to buy from her. Similarly, if the baker has to have a choice and that choice has to be respected, then there has got to be some farmer out there to sell it to him. Otherwise the whole system kinda breaks down.

Put Option

Let’s consider a Put Option first. It gives the farmer the right to sell at the contracted price K if the price of wheat at expiration has gone down, i.e. when S_T < K. That is, her payoff from the Put Option is K - S_T > 0 – i.e. when the price of the wheat is lower it is in her interest to sell at the contracted price.

But when the price of the wheat has gone up, she is well within her rights not to use the ‘option’ and sell wheat at the prevailing higher market price (S_T > K), so there is no profit no loss – just the piece of paper with Put Option written on it which expires worthless. So her payoff then is simply the larger of K - S_T and 0, or simply \mbox{max}(K - S_T, 0).

Call Option

A Call Option provides baker the choice to buy at the contracted price K when the price of wheat has gone up. Again, the story works similarly. That is, his payoff from the Call Option is S_T - K > 0 – i.e. when the price of the wheat is higher it is in his interest to buy at the contracted price.

But, again, when the price of the wheat has gone down, he is well within his rights not to use the ‘option’ and buy the wheat at the prevailing lower market price  (S_T < K), so there is no profit no loss – just the piece of paper with Call Option written on it which expires worthless. So his payoff then is simply the larger of S_T - K and 0, or simply \mbox{max}(S_T - K, 0).

Jolly good things, aren’t they then, these Options? Keeping only give the upside while keeping the downside to zero. Well, yes. And like all good things in life, they also come with a price attached – that is they are not free. Both must pay a price to buy such Options. And who, pray, must they pay this price to?

For a farmer’s Put to work, and the baker’s Call to work, there has to be a baker to buy from the farmer when she uses her Put and there has to be a farmer when baker uses his Call. That is, for a farmer’s option to sell to be respected there must be a baker who is forced to buy. Similarly, for a baker’s choice to buy to be respected, there must be a farmer who is forced to sell. It should be clear now who these prices must be paid to. When a farmer buys a Put, she pays a price to a baker who is then forced to buy from her when she wants to sell at the contracted price K. Similarly, a baker would buy a Call from a farmer who is then forced to sell it to him when he wants to buy at K.

So now we have four sides. Farmer’s choice to sell is matched by the baker’s obligation to buy from her, and the baker’s choice to buy is matched by the farmer’s obligation to sell. Nice little trick isn’t it?

So what financial market participants have done is that they unbundled/broken-down a forward contract into two parts. A baker now either has a choice to buy (when he buys a Call) or is being forced to buy (when he has sold a Put). Similarly, a farmer either has a right to sell (when she buys a Put) or is being forced to sell (when she has sold a Call).

It is market parlance to speak of a baker’s forward contract to buy as Long Forward, a seller’s forward contract to sell as Short Forward, a baker’s choice to buy as Long Call, a farmer’s choice to sell as Long Put and so on.

That is for a baker we have,

\mbox{Always Buy (Long Forward) = Choice to Buy (Long Call) + Forced to Buy (Short Put)}

which mathematically is

S_T - K = \mbox{max}(S_T - K, 0) - \mbox{max}(K - S_T, 0)

and for a farmer we have:

\mbox{Always Sell (Short Forward) = Choice to Sell (Long Put) + Forced to Sell (Short Call)}

or mathematically,

K - S_T = \mbox{max}(K_T - S, 0) - \mbox{max}(S_T - K, 0)

It is also useful to ‘draw’ the diagram of their payoffs as the spot price at termination S_T varies. These are very useful and handy, but this we leave it for the next post.

Written by Vineet

October 28, 2016 at 7:01 pm

[PGP-I FM] Futures contracts

leave a comment »

Forward Contracts

It turns out that all forward contracts we have discussed have some common features – in particular:

  1. The farmer and the baker have to meet: Had the farmer (baker) not known the baker (farmer) s/he’ll still be faced with the risk of having to sell (buy) the wheat a lower (higher) price. So both counter-parties in the trade must find each other to even have a contract in the first place.
  2. The contract is agreed upon before the delivery of the underlying asset (called the “deliverable instrument”): When the farmer and the baker meet, the farmer agrees to make the delivery of the wheat at some future date. It’s not an ‘on-the-spot’ transaction.
  3. The time at which the delivery is to be made (called the “expiration date”) is agreed upon in advance: The farmer and the baker mutually agree upon the time (and often the location) at which the farmer will delver the wheat.
  4. Forward contracts can be highly customized: The farmer and the baker may, for all they like, agree to the quantity of wheat till the last ‘gram’. They may settle that the baker will pick up the wheat from the farmer’s house at a particular time (say, before/after lunch) on the expiration date. Or the farmer may agree to deliver the wheat at a particular location at the baker’s house or warehouse. It’s a lot like you going to your tailor to get a custom suit stitched – right to the shape of buttons, it’s your choice.
  5. The price at which the delivery is to be made (called the “delivery price”): Quite importantly, the farmer and the baker agree on the price at which the farmer will deliver the wheat to the baker on the expiration date (this is kinda really the whole point, isn’t it?).
  6. No money changes hands at the time the contract is entered into.
  7. Both parties cannot get out of the contract before the expiration date: By their very nature forward contracts are very illiquid.
  8. At least legally, both the farmer and the baker are obligated to honour the contract: While this may not be an issue for a farmer and a baker in a village who know each other, this is of crucial importance in the real world.
  9. In a primitive village economy it’s a farmer and baker coming together, but in the modern world, typically both the counter-parties are a financial institution, like a bank. (And they do so because most big banks deal with each other very frequently, and ‘know’ each other.)

Now this last couple of features above makes it little problematic for forward contracts. And why, pray this be so?

The problem is that if the expected price of wheat changes during the life of the contract (that is, before the delivery is made but after the contract is entered into), then both the farmer and the baker have an incentive to renege on their obligation. How?

Let’s say the farmer and the baker meet and agree on a price of 100, i.e. farmer agrees that she’ll sell the wheat to the baker at the end of, say, 1 month at 100 a bushel. And then, say, in a fortnight’s time both farmer and the baker find that there are lot of birthdays coming up in the village around the end of the month, and there will be a disproportionate demand for breads, i.e. the demand for wheat flour will be high.

Now, if our smart baker has already entered into the forward contract with the baker, he’ll be all smiles knowing that he has already locked-in the price at which he is going to procure the wheat. But the poor guy perhaps doesn’t know that our lady friend farmer has other plans. When the time comes, she may just, say, well too bad for you that we entered into a contract, but I am afraid I can’t sell you a bushel for just 100 , when the market price is 120. You might say that the farmer is spoiling her ‘trust quotient’, and she can be sure that she’ll have one less friend in the village, but, hey, it’s money we are talking about.

Now I am not saying she will do it, but there will be a mighty big temptation for her to do so. The fact that being a part of a community acts as natural enforcer doesn’t take away the problem. Again, consider the case, if for some reason at the end of a fortnight now both come to know that there’ll be lesser demand for wheat. Now it’s the baker who is faced with a dilemma.

So herein lies the problem. The fact that a forward contract requires both parties to honour their contract makes it difficult to operationalize it in the ‘real world’. While in a small village both parties may, and in all probability, will, know each other, in a place like Mumbai, even if you go and try hunting for a counter-party you may never find him/her in time because you’ll probably be stuck in a jam near Andheri (or these days even Bandra), or if you are going through an intermediary, your broker may just form a cartel with your counter-party and fleece you by offering a forward price that is clearly to your disadvantage (but which may still be the best you could do).

The problem, therefore, is not just about ‘trust’ or ‘honour’ . The fact that an unforeseen circumstance (say, a flood) can make one of the parties renege on their contract makes it practically a big problem. Not to mention the fact that even if the farmer wanted to get out of the contract, because say, she was robbed of all her wheat, and she needs the wheat for her consumption, she can’t do so even if it’s for a ‘right’ reason. The baker still would feel cheated as he is stranded if the farmer fails to deliver the wheat for whatever reason.

For people or entities who knew each other well they could still (and do) enter into forward contracts (for example, big banks who transact with each other on a daily basis they do have a fairly high turnover of outstanding forward contracts – but they ‘know’ each other and their businesses quite well), for a farmer and the baker (as for an exporter and an importer), there are these problems.

So, just like most good things in life, forward contracts also come with riders attached.

Let’s revisit our earlier example and make it concrete. Let’s say when the baker and the farmer meet after a fortnight, say, over a social occasion they agree that the fair expected price at the delivery time would be 120. That is, if they had settled on a forward contract on this day, both would agree that the fair price at the delivery time would be 120.

Our lady friend farmer, of course, isn’t too happy at the turn of the events and would prefer to sell the wheat in the market at the higher expected price in the market rather than deliver the wheat to the baker when the time comes at the agreed price of 100. She is definitely getting tempted to side with the devil on this one and deceive the baker.

But let’s say our lady friend is not bad at heart. She has good intentions, but is still concerned about her financial loss, and given a choice she would rather not lose baker’s friendship. If she expects the price of the wheat to still go higher than the today’s expected future price of 120, she may think, well alright the price in the future could still end up higher than 120, and maybe it’s a good idea to just gracefully ‘walk out of the relationship’ with the baker and just pay-up for his loss of 120 – 100 = 20.

It’s baker’s loss because it is the farmer who ‘wants out of the relationship’, and it is the baker who ends up ‘without a partner’ (ok, wheat) and so must be compensated. Or rather, more boringly, now the baker is stuck with the possibility of having to buy the wheat at the higher expected delivery price of 120 when he was promised wheat at 100.

So, if the farmer could pay up 20 to the baker, baker would say, ok, my friend I understand, but now that you’ve been honest and compensated me for the fact that I’ll have to enter into a new contract with another farmer, we are good. So long, and thanks for all the fish.

In fact, it’s also possible that the farmer and the baker may not have to ‘break-up’ at all. If the farmer is not sure that the wheat price is going to keep rising, and her best estimate is that it’ll end up near 120, then both could still ‘settle their disagreement’ if farmer pays up 20 to the baker. This is workable because if the expected price of the wheat, say, were to go down in a week’s time (but still before delivery), if the baker ‘honors the relationship’, and now pays to the farmer, it’ll be all good in the village. Everybody’s life can go on in the atmosphere of trust and good-will.

Imagine now that there are many such bakers and farmers in the village, and not enough social gatherings. This leaves us with a village with lot of worried bakers and farmers. And if they could not meet like our original couple, and if there were only a single rotten egg, it would lead to a vicious cycle of distrust and antipathy.

Human beings are good at resolving such situations by deciding on a neutral third party. In the village this would mean someone everybody knows and trusts, say someone from the gram panchayat. In that case, they may decide that they would monitor the expected future price every week after the forward contract is signed, and settle their profits and losses with the panchayat. So, if the price of wheat goes down, the bakers of the village would come and pay up their losses, and if the price of wheat goes up, the farmers would do the same. Existence of a neutral, trusted third-party again results in a nice (as against a lousy) equilibrium (I guess that is what, in some sense, a judicial system also ensures).

Of course, this arrangement in the village would work only if our panchayat member is a trusted fellow, and if for some reason either a baker or a farmer is unable to keep his/her end of the bargain, that is pay up the ‘margin’ of loss that is due, he should be able to compensate the other party still.

However, the first and an even bigger problem is that of existence. The question of a forward contract ‘coming into the world’ doesn’t even arise if the farmer (exporter) and the baker (importer) can’t meet. For them to even enter into a contract means they must find each other first. So there is a search (transaction) cost involved.

Fast forward this primitive village economy to the modern world, where as it is there is a deficit of trust for reasons of scarcity of time, resources, opportunities and what not, an entity like panchayat doesn’t suffice. But as it is often the case, left to their own devices, one can trust the financial market participants to come up with a workaround.

For a financial market participant the solution is very clear – create markets. Create a platform to bring the farmers and bakers of the world together. Having a common marketplace reduces transaction costs by bringing the participants together. And when finance people talk about markets, more often than not they have in mind a clearing exchange, and in the case of forward contracts they are called futures exchanges.

Futures Contracts

The way the exchange manages the ‘trust’ of the counter-parties is exactly the same way as the panchayat in the village. They settle the profits and losses ‘every so often’. But because in a city like Mumbai, one can’t afford to run around and find the person who refuses to settle his end of the bargain, and there are more crooks in Mumbai, the mechanism of “margining” in exchanges are run by strict rules.

But the fact that having a market, or an exchange, allows buyers and sellers to come together doesn’t solve the problem of default. If anything, perhaps, it exacerbates it. If even a few people started defaulting on the exchange, for lack of trust, the whole system will very quickly break down. So what is the solution?

At this point one of my colleagues draws a nice analogy of this problem with that of a pawnbroker’s in a big city. A pawnbroker is someone who gives loan to people who can’t get it otherwise, and his (a pawnbroker typically is a “he”) obvious worry is that his money won’t come back. And for a right reason – the kind of people who go to a pawnshop to borrow money are exactly the ones who have a bad (or no) credit history. And what is his solution? His solution is that he asks for a collateral of value much more than the value of the loan that he is giving out. (Contrast this with the problem of a moneylender’s in a village – would he ask for the same collateral as a pawnbroker in Mumbai?)

The solutions that markets came up for this problem is that they agreed to make the exchange as the counter-party for all forward contracts (either entered into by a farmer or a baker). And, like a pawnbroker, exchanges made a system of asking for collateral from the counter-parties in the forward contract, and this new kind of forward contract in which exchange was the intermediary counter-party for the farmer and the baker, they called the futures contracts (not “future”, but futures, with an “s”) – very similar to a forward, but different enough to warrant a new name.

The exchange-traded futures contracts offered almost everything what forward contracts did, but in a stroke of genius, exchanges came up with a way that prevented default exactly where it was most likely to occur – among traders who did not know each other. And what is truly a marvel of modern finance is that while banks have had a history of defaulting (and very much so in the recent past), very rarely have exchanges collapsed the way banks have.

As by now you should be able to guess, for futures contracts to be traded on an exchange they must be standardized. So, unlike forward contracts which could be customized right down to a T, futures contracts, by their nature of being traded on an exchange, must be standardized. In fact, it’s now a good time to list down the features of futures contracts:

  1. Exchange Traded: Futures are exchange traded. By construction all futures contracts are traded on exchange, and as a consequence, just like stocks, everybody can see what is being traded at what price and so on. Unlike, forward contracts, then, they are not opaque and highly transparent. An implication is that futures contracts are highly liquid. At any point the buyers and sellers of the futures contract can buy from or sell to the exchange. This means that if a farmer ‘sold’ wheat on the futures exchange, if she now desires, she could unwind her contract by entering into an offsetting contract with the exchange at the going price. We’ll elaborate on this point later.
  2. Standardization: Futures contracts are highly standardized. For a commodity/investment asset to be traded on the exchange, it has to standardized. So if wheat/rice is harvested in particular months, the delivery dates of the futures contracts will be closer to those dates – that is, for a specific asset futures contracts have a fixed/limited number of delivery dates. Not only delivery dates, often the location and the ‘grade’ of a good (different grades of wheat are grown and priced differently) is also pre-specified exactly by the exchange.
  3. Anonymity: The farmer and the baker need never know about each other. For both the farmer and the baker, the counter-party is the exchange. That is, both the farmer and the baker could protect themselves against the risks they face by entering into forward contracts with the exchange that are mirror images of each other. So while exchange is the counter-party for both the farmer and the baker, on a net basis the exchange has exactly offset its exposure. That is, unlike in a forward contract the farmer and the baker are not dealing with each other at all. The consequence is that all the default risk is assumed by the exchange.

And how does an exchange protect itself from default by the farmer or the baker? This goes back to the ‘stroke of genius’ we referred to on part of the exchange. The key idea here is “margining”.

Futures Exchanges and “Margining“: The idea of Mark-to-Market

So the ‘stroke of genius’ by futures exchanges was to modify the system adopted by bakers and farmers in the village, and implement it in the context of the modern financial markets as this is what make futures contract really work in the market place. The key idea is Mark-to-Market.

1. Mark-to-Market: Exchanges made the system of settling profits and losses on part of the bakers and the farmers more systematic  ‘every so often’ and called it mark to market:

  • Settlement every business day: First of all exchanges made ‘every so often’ specific and this is one of the crucial feature of futures contracts traded on the exchange. The profits and losses of the bakers and farmers are settled every business day. This makes sense, because it may be easy for a panchayat member to locate a particular baker or a farmer who fails to pay up at the end of a week or so, in modern cities this is not only prohibitive but also may not be possible.
  • Anonymous trading: This above feature of marking to market, in fact, is what allows the exchange to become a counter-party to any entity. It could be anyone who needs the wheat, need not just be the baker. So, the counter-party may never know each other at all. And in today’s modern world, they could even be situated in different geographical regions. As long as they can transfer money to the exchange’s bank account when the margin payment is due that’s all what is needed. This is made possible because exchanges require settling the profits and losses in the contracts every day.
  • Settlement price: Just like in the case of the baker and farmer who settled their profits and losses on the basis of the future expected price at the time of delivery (120), the futures contracts are also settled on the basis of the futures price prevailing on the settlement day. So once the futures contract has been entered into between the exchange and the baker, and the next day the futures price changes (because perhaps the spot price and the cost of carry have changed), the profits and losses are settled on the basis of the futures price prevailing on that day. Think of it this way. If the contract was signed yesterday, and futures price for the same delivery date today has gone up to 120, the farmer would have been better off had she got into agreement with the baker today rather than yesterday. So her loss based on changed futures price is 120 – 100 = 20. The amount/loss settled is referred to as the “margin money” or “variable margin” or “mark-to-market margin”.
  • Settling profit and losses: Since futures exchange is the counter-party for both the baker and the farmer, when the price of the wheat goes up, the exchange gains vis-a-vis the farmer (collects 120 – 100 = 20 from the farmer), but loses viz-a-viz the baker (pays up  120 – 100 = 20 to the baker received from the farmer). But because both parties are obligated to settle their losses every day, exchange is in a position to transfer the proceeds it receives from the losing party.
  • Obligation of the exchange: Profit and loss settlement by the exchange subsumes that the exchange is never going to default on its obligation. Even if the baker defaults, the exchange must still honor the farmer’s contract, and still ‘buy’ the wheat at the agreed futures price on the delivery date. (The fact that exchange never has to do so is another matter. See point 3 below.)

2. Initial Margin: Although daily mark to market helps reduce the default risk for the exchange, it does not completely eliminate it. So, just like a pawnbroker, exchanges also require both counter-parties to keep a collateral with the exchange. As you would expect, since the exposure of the exchange is only to the extent of the margin money every day, the collateral required by the exchange is just the maximum amount it expects the wheat price to fluctuate every day. This margin is called the initial margin, and both the baker (if the expected future price of wheat falls) and the farmer (if the expected future price of wheat rises) have to pay this to the exchange before they can enter into any futures contract with the exchange.

3. Early Close-out

  • Default on the margin payment: If one of the counter-party fails to keep its side of the bargain, and does not pay up the margin money at the end of the business day, the exchange confiscates its initial margin, and closes out that side of the contract by entering into an offsetting contract with another counter-party. Since the futures are on standardized contracts and exchanges offer liquidity, it’s never a problem for the exchange to find another counter-party at the going futures price (remember that if there are not enough takers at a particular, the supply-demand dynamics ensures that the futures price would adjust). If the baker fails to pay up when the price of wheat has fallen down to say, 80, the exchange will first of all say good-bye to the baker’s initial margin and use some of that money to transfer the profit due to the farmer. Now because the exchange is stuck with the obligation of having to buy the wheat at 100, when the prevailing futures price is 80, the exchange will enter into a futures contract with another counter-party to sell the wheat at the prevailing futures price, i.e. it will find another baker. By doing so it has taken care of its obligation to buy the wheat from the farmer. From next business day on-wards, the original situation would return, as both the original farmer and the (new) baker would resume mark to market. Note that in the entire process, the farmer need never know about the default on the margin by the baker.
  • Early exit: An advantage of this possibility of early closing out is that any counter-party can get out of the futures contract by paying up the mark to market margin. Let’s continue with the same example. So, if the next day after the contract has been entered into, the price of wheat has gone down to 80, the baker has reasons to worry that he may be in a soup if the price of wheat keeps falling (as he’ll have to pay up margin money every day). Having an exchange as the counter-party, and the fact that the futures contracts are liquid, gives the baker a choice to walk out of his contract without any impact to anyone as long as he keeps paying his margin money. So, in this case, he may just pay up his loss of 20 loss and enter into an offsetting contract with the exchange to sell wheat at 80 with the same time to delivery. So exchange, in its account books now, would just have an offsetting entry and baker can go live his life in peace without having to bother about the margin payments to the exchange. And if the price is going up, the farmer is free to do the same thing. If the price goes up to 120, she may just pay up her loss of 20 and walk out of the whole thing by just entering into an offsetting contract (to buy) with the exchange.
  • Choice not to take delivery: Extend the idea of early exit to the delivery date, and its clear why both parties may choose not to take/give delivery of the wheat at all. On the day of the delivery, both parties may just choose to settle the last margin payment and at the same time enter into an offsetting futures contract with the exchange for delivery on the same date. So, ignoring time value of money, the net cash for each would be exactly the same as 100, and by doing so both parties have exactly hedged their exposure to the rise (for baker) or fall (for farmer) of wheat price

4. Hedging and Basis Risk: A natural question to ask at this point is why would all the bakers and farmers wish to come to exchange when they may need to hedge exposure to very specific kind of wheat when the exchange provides liquidity and contracts for only  very specific kind of wheat. The answer to this lies in correlation. If we are talking about the same commodity (wheat), it’s very likely that the price movements in different qualities and grades of wheat will be highly correlated. So even if prices of different grades of wheat may not move in perfect lock-step with each other, they would still be safely assumed to change very closely together.

So, in that case, say, if the price of the wheat traded on the exchange has gone down by 20\%, it’s likely that the price of the wheat that the baker wants to hedge himself against would be trading say, at 23\% or 18\%. In that case, if the baker has a futures contract with the exchange, while he is gaining as a counter-party with the exchange, in the markets he is losing. And wasn’t that his really worry in the first place. What if the price of wheat goes up in the future? By entering into the futures contract he is better of by 20, but in the real market place he is worse off by either 23\% or 18\% depending on the ‘state of the world’. So on the ‘net basis’ he is either gaining by 20 - 18 = 2\% or losing by 23 - 20 = 3\%.

If the two grades of wheat were moving in a perfect lock-step with each other his net gain/loss would have been zero. But because the futures exchange does not provide exactly the same kind of wheat that he wants to hedge, there is a residual exposure still left, but more-or-less he is still protected, because exposure in futures contract and the spot are highly negatively correlated, the diversification effect implies that the variance of his losses would be a lot lower compared to if he hadn’t hedged. The residual exposure because the asset to be hedged is not exactly the same as the instrument used for hedging is known as the basis risk.

We close this post with a simple example of marking to market.


Time t = 0 (F = 100) t = 1 (F = 80) t = 2 (F = 90) t = 3 (F = 110) t = 3 (Delivery at F = 110)
Baker’s Inflow/Outflow 80 – 100 = -20 90 – 80 = 10 110 – 90 = 20 -110 (Net = 0-20+10+20-110 = -100)
Farmer’s Inflow/Outflow 100 – 80 = 20 80 – 90 = -10 90 – 110 = -20 110 (Net=0+20-10-20+110 = 100)
Exchange’s Net -20 + 20 = 0 10 – 10 = 0 20 – 20 = 0 – 100 + 110 = 0

Needless to say, futures contract requires that the users have enough liquidity to meet daily margin payments. Liquidity constraints applicable to most retail investors means that it’s mostly companies or institutions that typically hedge using futures contracts.

Written by Vineet

October 25, 2016 at 12:39 am