Basis
The difference between the price of a futures contract and the price of the same asset on the spot market.
Basis is a measure of the gap between two prices for one and the same asset, taken at one and the same moment: the price of the derivatives contract and the price on the spot market. While there is still time left before settlement, these prices lead separate lives, and the basis shows how far apart they have drifted and in which direction.
How the basis behaves over time
The gap is sustained by time alone. The less time remains until the last trading day, the less there is left for the market to pay a premium or demand a discount for, and the difference narrows — this is what is known as basis convergence. For a deliverable futures contract the convergence is strict: at the moment of delivery the holder of the contract receives the underlying asset itself, so by settlement the two prices are bound to coincide, otherwise a straightforward arbitrage trade opens up. For cash-settled contracts the same effect is achieved through the closing price on which the final result is calculated.
Within the life of the contract the basis is moved by money market rates, expected payouts on the asset and the demand for hedging itself: when many participants want to sell the derivatives contract, they push its price below spot, even if the cost of money points the other way.
Example: how to see the basis on a stock
The price of the spot leg comes from the security's card, the price of the futures leg from the quote of the contract on the same stock, which is decoded through the futures contract code:
By subtracting from the contract price the share price scaled to one contract lot, you get the basis at the current moment. Tracking this difference day after day, the hedger sees neither profit nor loss but the quality of the protection: it is the behaviour of the basis, not the share price, that determines the outcome of a position built from spot and a short futures contract, and it is this behaviour that is described through basis risk and the hedge ratio.
What the basis gets mistaken for
The first mix-up is confusion with the spread between two contracts of different maturities: the difference "far minus near" belongs to the calendar spread, and spot plays no part in it at all. The second is comparing an index futures contract with the index itself without adjusting for the fact that the index does not take into account the upcoming payouts on its constituent securities: without this adjustment the basis is read with the wrong sign.
A separate regime is the perpetual futures contract. It has no settlement date, which means there is no mechanism that would pull the basis towards zero. Here the difference is held in check by regular payments between the two sides, and interpreting it as "time to expiration" makes no sense.
Formula
It is the sign of the basis that gives the market states their names: positive is contango, negative is backwardation.
How to read the number
The basis gathers into a single figure everything that the time to settlement is worth: the cost of money, the expected payouts on the asset and the convenience of owning it.