Brief Introduction to Derify protocol

Derivation Lab
7 min readApr 1, 2021

The birth of Derify protocol was a natural development.

Our team (Derivation Lab) has been providing quantitative trading and market making services for many years (since 2017); when Uniswap shined in 2020, we saw the opportunity in this field: if accessible, robust and decentralized liquidity is created for quantitative traders like us, then the “traditional industry” of market making will see unprecedented innovation. Furthermore, based on our trading experience, if there is an effective and sustainable liquidity pool for hedging, innovative DeFi products will find their stage to shine (just like the innovative financial products in traditional finance industry, mostly derivatives).

When this idea struck us, we immediately began to develop our decentralized derivatives trading protocols.

The design process of the Derify protocol is strenuous. We grow from the idea of handing the risk to the market completely (risk control based on market value of our tokens) to a well organized risk control system, from AMM-like market making mechanism to a new hedged market making mechanism (hedged AMM / hAMM), from standard liquidity mining to position mining. Our solutions have been re-adjusted many times until this current version — one of the best and most concise solutions for derivatives trading so far.

Let us hereby explain the basics of Derify protocol as follows:

Contract Calculation

Spot trading protocols are based on the logic of “exchange”, while derivatives trading (here we use CFDs as an example) is essentially “price speculation”.

To illustrate, spot trading works as traders exchange quantity a of asset A for quantity b of asset B, thus every transaction always results in a decrease of one asset and an increase of another in the liquidity pool; while derivatives transaction works as traders deposit amount m of margin to the liquidity pool in the beginning, and extract amount e of equity from the liquidity pool at the end moment, according to the correspondent specifications of the derivative and price of the underlying asset (the remaining equity can be larger, smaller or equal to the initial margin).

The process of calculating remaining equity from margin is the “contract calculation”, which is the core concept of derivatives trading and Derify protocol.

Hedged Market Making

One of the most significant risk in derivatives trading is “counterparty risk”, that the counterparty of your contract may default. In the above-mentioned case, the liquidity pool may not able to pay out the remaining equity if the remaining equity is larger than the initial margin deposited.

The success of AMM model used by Uniswap promotes the peer-to-pool liquidity solution in crypto community, but traditional AMM does not support derivatives trading (because only one asset is involved in the transaction).

Thus, we improved the formula from x*y=k to X+Y=0.

The goal of Derify protocol is to create a liquidity pool with fully hedged counterparty risk, in our formula, X represents the sum of long positions in a certain derivative (always a positive number), and Y represents the sum of short positions in that derivative (always a negative number); X+Y=0 means that the long and short positions hedged each other and eliminates the counter party risk, so this mechanism is called “hedged automatic market making” or hAMM.

To illustrate, during the whole process of contract calculation, suppose traders deposit amount m of margin, and eventually withdraw amount e of equity. The asset price may fluctuate and the possibility of e>m always exists until the position is closed. Obviously, if X+Y is not equal to 0, and the price change is consistent with the direction of the net unhedged position (“naked position”), which reflected by the sign of X+Y, the liquidity pool will be at deficit and in the end fail to pay the equity (vice versa, but let’s focus on the worst case scenario). Only when X+Y=0, changes in asset price will not affect the total remaining equity in the liquidity pool.

Although X+Y=0 is the perfect balance state, naked position may still exists, which brings the risk of draining the liquidity pool into depletion. To cover the risk of the naked positions, exchanges needs a small naked position and a large liquidity pool.

Position Change Fee

In order to reduce the naked position, traditional centralized exchanges use “Funding Fees” to reward the positions that reduce its risk exposure, and punish positions that increases its risk exposure. Funding Fees also synergize well with orderbook model, market makers will make orders to help reducing the naked position.

However, in a peer-to-pool exchange, Funding Fees are suicidal, Funding Fees are charged every 4 to 8 hours, during this period the exchange is totally exposed. Because of their decentralized nature, decentralized exchanges cannot roll back transactions or receive money injections by the holding company, any decentralized exchange will not survive major price shock that happened during the 8-hour period if they use the Funding Fee mechanism.

We introduce a major innovation to replace the Funding Fees with Position Change Fee. We charge a one-off fee for transactions which cause increase in the amount of naked positions (|X+Y|), and all of them will be used to reward transactions which cause decrease in naked positions, therefore encouraging arbitrageurs to restore the balance of X+Y=0, and cover the risk exposure of the system.

This reward and punishment mechanism is inspired by AMM’s idea to attract arbitrageurs using its spread with the external market.

Position Mining

In order to increase the liquidity pool, traditional centralized exchanges (including many peer-to-pool forex exchanges) have a specific pool of their own money, traditional decentralized exchanges tend to have a specific pool supported by LPs looking for mining rewards.

However, the nature of derivatives trading shows us a new way of risk control: in derivatives trading, the profit of a certain position is always covered by the loss of the position in the opposite direction. Thus, as long as you hold a position, you are covering the position in an opposite direction, holding positions provides liquidity, X-Y, which means the total holdings of the long and short positions, is our liquidity.

Our rewards for liquidity providers are distributed by “position mining”, traders earn mining rewards by opening and holding positions.

In addition, the beauty of Mathematics also brings additional benefits — because all positions are treated equally as liquidity and positions can be leveraged, thus the position mining can also be leveraged — you can mine with 10 times leverage directly (the current upper limit of leverage) to obtain 10 times mining income for yourself. We also provide a two-way position opening function to ensure that you can immediately create a set of fully hedged and never-closed two-way positions with zero error, safely provide liquidity and obtain mining revenue.

We do not have a special pool to exclusively paying off profitable positions, nor do we distribute mining rewards in project tokens. It is impossible for a liquidity pool which is only responsible for paying off profitable positions to sustain a huge annual profit, unless the annual profit is paid in project tokens and the token prices keep mooning. In market fluctuations, such mechanism only lead to a “death spiral” — when price of tokens plummeted, the annualized return become worse, then more tokens will be issued to attract miners; but the more tokens issued, the lower the token price will be, leads to lower return and worse risk resistance.

Overview of Risk Management

During extreme market conditions, most exchanges will arbitrarily liquidate users profitable positions to reduce risk exposure.

Derify protocol prepared a double-layer security firewall to ensure the safety of user funds. And we hereby promise — no trader’s income will be shared due to temporary losses on the exchange. Traders always get what they own — this is our serious promise to traders.

The first layer of protection is the insurance pool. The insurance pool is filled with 40–70% of the trading fee income and the our earnings from loss position. The insurance pool has a net cash inflow during normal situations, thus it is sufficient to cover the profitable positions on occasional market fluctuations and ensure all users can realize their profit.

The second layer of protection is the bond mechanism. Taking into account the extreme situations that the insurance pool is depleted (similar to the plummet on March 12, 2020). During these rare occurrences, our bond mechanism will be activated, all positions cannot be fully realized by the insurance pool will be compensated by bonds.

The Derify protocol bond (bDRF) is a stable coin, which can always be converted to a commonly used stable coin (such as BUSD/USDT/DAI) at a 1:1 rate in the official exchange pool (bond pool). The only difference is that the redemption of those bonds requires time for the exchange pool to be filled (by the overflow of the insurance pool).

That is to say, when there is a “Black Swan” event, because of the long-term net cash inflow of the insurance pool, we will use such future cash inflow as collateral to provide sufficient payment and liquidity for profitable users. As long as the exchange is earning money in the long-term (including trading fees), the bond can always be repaid. We also have a bond interest pool, bond holders can receive guaranteed interest by staking the bonds into the pool.

Summary

In this first article, we presented the basic concepts of Derify protocol, hopefully bringing some unique inspiration and resonance to you.

Our goal is to provide a capable and robust infrastructure for the DeFi ecosystem. We hope more DeFi products could provide liquidity like we do, or bring other new ideas to the market.

We hope more people get to know us, share our existence and join our journey of developing DeFi derivatives.

Thanks for your time reading this, we will continue to present other aspects of the protocol in the future.

Please spread the words, for the future of DeFi community.

Follow/Subscribe to us for more updates!

--

--