The concept of the perpetual swap, also known as a perpetual future or 'perp,' was conceived on a hiking trail in Hong Kong in 2015. BitMEX co-founder Ben Delo, a mathematician, was discussing a problem with his friend Bavik, a derivatives trader. At the time, BitMEX had been experimenting with various futures contracts, including quarterly, monthly, weekly, 48-hour, and 24-hour contracts, but none of them were working as intended.

Customers were complaining about their positions closing without warning, and they wanted a product that combined the benefits of spot trading with the leverage of derivatives. Delo's conversation with Bavik led to a crucial question: what if a future never expired? Bavik's response was that, mathematically, it would be worth infinity.

However, he also suggested a solution: charge traders the bitcoin overnight rate, similar to how LIBOR is used in traditional finance. The problem was that such a rate did not exist at the time. Delo decided to build it, and in doing so, he created one of the most significant financial products of the 21st century.

To understand the impact of the perpetual swap, it's essential to consider what BitMEX was trying to achieve before it became the most liquid bitcoin market in the world. When Delo and Arthur Hayes founded the exchange in 2014, their focus was on institutional hedgers, not retail traders. However, the institutions never came, and instead, sophisticated retail traders arrived, seeking to speculate with high leverage.

BitMEX adapted to this demand, offering 100x leverage by Halloween 2015, thanks to Delo's real-time margining system. The issue with futures contracts, even short-dated ones, was the basis, or the premium at which a futures contract trades above the spot price of the underlying asset. This concept was not well understood in crypto at the time, leading to customer complaints about bitcoin prices being too high on the exchange.

The perpetual swap, launched in May 2016, addressed these issues with a straightforward mechanism: a futures contract with no expiry date, anchored to the spot price through a daily funding rate. Longs paid shorts, or vice versa, depending on whether the swap was trading above or below spot.

The early funding rate was derived from third-party lending markets, but it eventually became clear that a dynamic approach was needed to adjust the rate based on market conditions. The solution involved looking inward at how the swap was trading rather than relying on external lending markets.

BitMEX began measuring the gap between the swap and spot prices over an eight-hour window, treating it as an implied basis, and back-calculating the annualized rate from it. This dynamic equilibrium allowed market makers to anchor the swap back to the spot price, creating a self-sustaining mechanism. By 2017, BitMEX had become the most liquid bitcoin market, processing $3-4 billion daily, with the perpetual swap at its core. The concentration of liquidity was a direct result of the swap's design, which consolidated market maker capital into a single instrument.

Competitors took notice, and soon every major exchange in crypto offered its own perpetual swap, built on the funding rate architecture that Delo had created. Today, the perpetual swap is considered one of the most successful financial products in history, with an estimated $40-50 trillion in annual turnover. BitMEX chose not to patent the product, opting instead to focus on building and letting the market decide its value. With traditional finance regulators now taking notice, the perpetual swap may soon become a staple of mainstream finance, a testament to the power of innovation in the crypto space.