What is Margin Trading and Why Do We Need It?

There are easier applications to a decentralized lending platform, why pick margin trading? What on earth is it, anyway? Find out in #LendroidExplains, a light take on heavy concepts.

It’s not exactly rocket science, but it’s certainly got some thrust.

No one really needs Margin Trading. Just like no one really needs space programmes. Not a great beginning, was it. In one shot, it seems like I compared what we were doing with rocket science, and then proceeded to trash both concepts. I probably need to explain a little bit. Let’s start with the rocket science part.

As humans began to conquer the final frontier, the various spinoff technologies from space science transformed our lives in the already conquered frontier. Sample this — Artificial limbs, invisible braces, highway safety, firefighting equipment, temper foam, freeze drying, enriched baby food, water purification, OpenStack (!), EWT are all spinoffs of space programmes. Rocket science is dauntingly complex, and those engaged in it are on the outer reaches of their fields. But the process and success impacts the entire community for the better.

The point I am circumspectly making is this — Margin Trading is a complex financial instrument, which is bound to stretch the limits of the Ethereum blockchain. However, even as it takes off, it will open some incredible, not-seen-before possibilities in crypto.

Diving Right In

The exciting bit of this blog is the next section. Which is not to say you should skip this part. I just mean you’ve got to push through some dryness to reach the pool of enlightenment.

Easy does it. Let’s first look at an infantilized view of margin trading. It can be explained thus –

Trading 101

1. Buy something, say S, for a price, say P.

2. Sell S for a higher price, 2 times P.

3. Profit!

4. Or the price falls and you get…not profit.

Margin Trading 101

1. You have one P, the cost of S

2. But you think S will cost 2 times P tomorrow. In fact, you’re willing to bet on it.

3. You borrow 2 P more, from a lender and promise to pay him back tomorrow, with interest of half a P a day (really high, but what do you do)

4. You buy 3 P worth of S

5. You’re right, the price of S increases!

6. You sell 3 S for 6 P. You pay back the 2 P to the lender with interest

7. You’ve still got 3 and a half P. Profit yay!

8. Or you’re wrong and you get…not profit. Also, you owe 2 P and a half.

Since the reader is not an infant anymore, and is now conversant in this concept, here is a more studied take on margin trading. The version which will work during attempts to increase one’s cerebral status during a conversation.

Brace yourself. There’s going to be some detail here. –

If a trader wishes to monetize his confidence in the price of an asset increasing/decreasing, he would take a position by purchasing/selling the asset. If he is extremely certain, he would build a leveraged position by borrowing additional funds from a lender to magnify his profits See Figure.

While the positions are subject to market risks and the trader’s decisions, the loan terms are typically defined by a contract, replete with interest rates, a specific time frame for repayment of the loan amount, and legal/punitive action in case of defaulting. Despite its volatility (or perhaps because of it), margin trading is a widely adopted process globally. It is typically carried out through a centralized exchange, which manages the Margin Account.

For those of you thinking, “But this is risky. What if the trader is wrong?”, you’re on the right track. This is precisely what adds to the complexity and allure of Margin Trading. There are some levels that need to be maintained in a margin account.

A Trader is mandated to maintain some predetermined levels in his Margin Account at all times. A dip in these levels can trigger warnings or lead to automatic liquidation of the Margin Account.

While exchanges have defined a range of levels exclusive to particular economic systems, some of these levels are used consistently in exchanges around the world.

Initial Level: The trader deposits an initial margin, which is a certain percentage of the total traded value. The deposit can be in funds and/or in securities. This initial margin too is determined by the exchange. Centralized exchanges typically set the initial level at 40%. Trading can commence once the initial level is deposited. The trader’s adherence to the initial level is used to determine whether or not a loan can be granted.

Liquidation Level: Volatility and price are dynamic during trading, and the exchange lends itself to a certain level of uncertainty. However, there is a point at which confidence in the performance of the margin account disappears. The absolute level at which an account is liquidated — the collateral and positions sold off — is the liquidation level. Typically, if the initial level is at 30% to 40%, the liquidation level is set at 15% to 20%.

Consider the following scenario:

Assumption: 1 XYT(a fictional token) = 0.10 ETH; 1 XXT (a fictional token) = 0.20 ETH

A Margin Trader deposits 1000 XYT as collateral. For an initial margin of 40%, the Margin Trader gets 2.5 times the collateral value, that is, upto 250 ETH. This is the total borrowed amount which she then uses to open a position on XXT for an initial value of 1250 XXT. For a liquidation level set to 20%, Table 1 shows how a few possible scenarios can play out over a timeline. At each time ti, the Margin Level is calculated by the formula:

Margin Level = ((Net Value of Margin Account — Loss in Position) / total borrowed amount) * 100 %


Collateral value = 1000 XYT * 0.1 ETH = 100 ETH

Total borrowed value = 250 ETH

Position value = 1250 XXT * 0.2 ETH = 250 ETH

Interest accrued = 0 ETH

P/L = Position value — Total borrowed value = 0 ETH

Margin level = Collateral value/Total borrowed value =100/250 = 40%

Margin level = (Collateral value-Interest accrued + P/L) / Total borrowed value = (100–0+0) / 250 = 40%

The Margin Account is liquidated once the margin level reaches a below 20%.

Pool of Enlightenment — The Why of Margin Trading

Kudos on getting this far. You shall be amply rewarded with lightness and a dawning understanding.

For Margin Trading to flourish, it requires the entire decentralized ecosystem to step up in three vital areas.

Much mud has been slung at centralized exchanges — they’re vulnerable to attacks, they tend to take arbitrary, unilateral decisions, their services can sometimes slow down or collapse under strain, etc. However, the fact remains that the crypto exchanges in operation today offer an incredible, smooth user experience when they’re on their A-game. Decentralized exchanges still have some ground to go.

On the right, we have issues of on-chain computation to contend with. Its inviolability and security aside, the drag on time and cost are significant. Trading needs speed. For margin trading to be effective, some dramatic innovation in process as well as technology will have to occur. Fortunately, things are moving as we speak. More on this in subsequent blogs.

Finally, for any trading to flourish and sustain itself, it takes a serious amount of liquidity. For instance, on Bitfinex alone, the margin funding — funding for margin trading — was in excess of $560 million. This despite the inherent vulnerabilities, less than two years after they got hacked and less than a couple of months from a controversial decision (take your pick). On the happy side, this means that the demand for margin trading is strong. The challenge is to replicate the ease of use and speed on a decentralized system.

When these three aspects of the ecosystem are enhanced, the blockchain becomes an unbeatable economic force. Imagine for a second — a system where no central authority can hold or control your funds, where the risk and friction of trading are low, where, I repeat — no central authority can hold or control your funds. One can only guess at the range and complexity of financial instruments that will flourish as a result.

In effect, making Margin Trading work on the blockchain will lead to the evolution of the blockchain. And that, ladies and gentlemen, is why we do what we do.

Next up — what is decentralized lending and why do we need it?