
Original author: Frank Hu & Kester Wu, ByteTrade Lab
Original source: Medium
Compiled by: Qianwen, ChainCatcher
Preface
The aftermath of the FTX thunderstorm incident has not ended, and decentralization and transparency are attracting more and more attention. Migrating trading activities from CeFi to DeFi is not a question of "if", but a question of "when".
This article will focus on the innovative functions of derivatives DEX. For details in the previous article, please refer to "Taking GMX as an example to explain the innovation of on-chain perpetual contract protocols".
background
The collapse of centralized exchanges leading to the de-risking of self-custody/on-chain trading by centralized exchanges can be seen in the dominance of DEX vs. CEX in the market between October 2022 and December 2022.

Source: TheBlock,Defillama,ByteTrade
While the majority of on-chain trading volume still occurs on spot DEXs like Uniswap, on-chain derivatives protocols are also increasing in volume and TVL.


Quick overview of key points
Innovative features being implemented on the derivatives DEX include: cross-margining on dYdX, hybrid or 100% stablecoin AMM pools, social trading on KTX.
Cross margining on dYdX allows traders to open multiple positions that use the same collateral.
Derivative DEX utilizes two AMM designs: hybrid (stablecoin + asset), 100% stablecoin.
KTX adopts a hybrid AMM design and plans to leverage social trading to balance OI bias on the platform.
The decentralized options protocol operates on a peer-to-peer model. In the "peer-to-peer" model, liquidity is managed similarly to spot. Liquidity providers deposit assets into a pool where traders can then buy options.
Integration of options remains limited, with the most likely integration of options between derivatives DEXs and option protocols being for asset price hedging.
"Necessity is the mother of invention." There will be more DeFi adoption and more transactions on the chain, and protocols will be more likely to be able to work together.

In traditional finance, derivatives are financial assets whose prices are derived from underlying assets (stocks/bonds/commodities).
Derivatives DEX
This article will focus on some interesting features that DEX provides users.
Funds deposited to the contract address will only be used for the original purpose

Derivatives DEXs experienced a decline in trading volumes in December 2022. However, the innovation happening within the industry keeps people optimistic.
cross margin
Among many DEXs, cross margin is used exclusively by dYdX when opening a position. Compared to isolated margin, cross margin allows traders to open multiple positions that share the same collateral.

Cross Margin Diagram
The margin requirement for the entire account is the sum of the margin requirements for each position.
The margin calculation for a single position is as follows:
Initial Margin Requirement=ABS(SxPxI)
Maintenance margin requirement =ABS(SxPxM).
Note: S is the size of the position, P is the price of the oracle, I is the initial margin requirement, and M is the maintenance margin requirement.
Therefore, with the concept of cross-margin, calculating margin for an account simply requires the sum of all positions.
Total initial margin requirement = Σ(ABS(SxPxI))
Total maintenance margin requirement = Σ(ABS(SxPxM)).
Although cross margining is more flexible, it can be slightly cumbersome for traders who prefer margining on an isolated basis. On dYdX, isolated margin can only be achieved by creating a separate account (using a new wallet address).
AMM
dYdX operates an off-chain order book matching engine, while protocols like GMX, GainsNetwork, and KTX use AMMs to facilitate order execution.
Derivatives DEX utilizes two AMM designs:
1) Hybrid (stable currency + assets)
2) 100% stablecoin.
GMX and KTX utilize a mixed multi-asset pool of “50% stablecoins + 50% blue chip assets” to facilitate transactions. KTX is currently on the BNB Chain Testnet, where readers can try out the protocol.

Source: KTX
Gains Network, on the other hand, utilizes 100% DAI vaults to facilitate transactions.

On Gains Network, trades are conducted using DAI collateral, regardless of the trading pair. Leverage is synthetic and backed by DAI vaults, GNS/DAI liquidity, and GNS tokens. DAI is withdrawn from the vault to pay the trader's PNL if it is positive or to earn DAI from transactions whose PNL is negative.
In the table below, some of the main differences between the two designs are listed:

GMX and KTX will offer users leverage of up to 50x their trading assets. By using a hybrid design, protocols like MMX and KTX are limited by the amount of each individual asset in the pool. A summary of the benefits and challenges of these two AMM designs is as follows:

Social Trading
GMX and KTX LPs face the challenge of volatility in the underlying asset prices. Some protocols, such as Rage Trade and Umami Finance, are already addressing this challenge. However, few AMM derivatives protocols attempt to alleviate the challenge of balancing OI.
KTX’s goal is to establish an internal OI balancing mechanism through social trading.

Source: KTX

KTX social trading logic diagram
This feature has not been released yet, but the logic of social trading can be broken down into the following points:
1. Select the top traders from KTX’s trading competition based on total trading volume, total PnL(%) and PnL(USD). These traders will be divided into short and long traders.
2. Traders can participate in social trading by depositing assets/stablecoins into long/short vaults and minting receipt tokens.
3. The transaction size of the Social Trading Vault will be limited.
4. The minting/burning fees for vault receipts will also be adjusted based on KTX’s current OI. For example, if more trades were biased towards the long side, then it would be more expensive for traders to deposit money into the long vault, creating a natural balancing mechanism for OI on the protocol.
option

An option is a contract that gives its buyer the right to buy/sell an underlying asset at a specific price.

A call option gives the buyer of the option the right to buy an asset at a certain price, and a put option gives the buyer of the option the right to sell the asset at a certain price. On centralized exchanges, options are conducted on a peer-to-peer basis. The option is sold by someone who owns the underlying asset as collateral, and the option buyer can then purchase the option and pay a premium to the option seller.
For decentralized option protocols, options are conducted in a peer-to-peer pool model. In the peer-to-pool model, liquidity is managed similarly to spot AMMs. Liquidity providers deposit assets into a pool from which traders can then purchase options.
The figure below shows a simplified example of the peer-to-peer pooling pattern:

Option sellers can passively earn profits by providing liquidity in: (1) the underlying asset ($ETH/$DPX) and (2) the quoted asset ($USDC/$2CRV) to write call and put options respectively . These collateralized assets are deposited into a contract that sells a call option to the buyer at a fixed strike price, expiring at the end of the epoch (week/month).

Taking Dopex as an example, the peer-to-peer pool model has different option time frames (weekly/monthly/quarterly), but it also brings natural challenges of capital inefficiency and liquidity dispersion.
The building block mechanism surrounding the DEX option agreement
Options are very versatile and any financial gain can be created by using both put and call options. However, the integration of options is still limited, with the most likely integration between derivatives DEXs and options protocols being for asset price hedging.
Asset Price Hedging
Since protocols like GMX and KTX operate mixed multi-asset pools, LPs are exposed to large underlying asset price swings that can be hedged with options.
For example, by providing liquidity on GMX/KTX, LPs receive receiving tokens called $GLP/$KLP. $GLP functions like an ETF, with its price based on the underlying assets (mainly $BTC and $ETH), including fees generated by trading activity on GMX. As shown in the chart below, the price of $GLP was adversely affected by the decline in the prices of $ETH and $BTC. However, with the GLP pool comprised of roughly 50% stablecoins, $GLP experienced a 36% price drop, compared to 65% for $ETH and $BTC.

In this case, options can be used for risk management. As mentioned above, purchasing a call/put option gives the buyer the right to buy/sell the underlying asset at a certain price. Since LPs want to cut their losses, they naturally buy put options.
Arbitrum or the Bracket protocol on BNB Chain are providing this service to DeFi participants.
Bracket operates in a peer-to-pool mode, as shown in the figure below:

Investors will deposit stablecoin collateral and make an “offer” to the buyer. These "quotes" include out-of-the-money long/short contracts based on market spot prices at the time of purchase.
There are several variables to consider when purchasing a contract:

The profit of the buyer of the short contract is as shown in the figure:

When purchasing an option, the buyer receives an ERC-721 NFT uniquely associated with each Bracket contract. This NFT tracks ownership of the contract and makes the contract tradable, creating a potential secondary market.
The above points are packaged into a one-click experience. Bracket can integrate with other protocols through gadgets to provide seamless "markdown protection."

Source: Bracket Labs
GMX and KTX LPs can purchase price markdown protection with corresponding weightings of $ETH and $BTC.

challenge
One of the challenges Bracket may face is the automated pricing of options. Option pricing is very complex and involves many more variables (time to expiry, strike price, implied volatility, risk-free rate) than the simpler "constant product formula" used by spot DEXs.
Most peer-to-pool option protocols utilize the Black-Scholes model to price option premiums on-chain and ensure that prices are updated in an automated and timely manner.

black-shoes model
This operation is troublesome because:
1) The input values of the model are difficult to determine (for example, what is the risk-free interest rate of cryptocurrency?)
2) Input usually comes from outside the chain, requiring continuous oracle updates. The delay between the actual price change and the oracle update potentially allows the bot to profit from lagging option repricing. As we saw with the Mango/GMX vulnerability, oracles are also one of the most frequent attack vectors in DeFi.
3) A general-purpose blockchain is unlikely to provide the throughput required to update prices accurately and fully on-chain. Traditional market makers use custom hardware to update. Update 1000 option prices at each tick price change.
summary
Necessity is the mother of invention.
There will be more DeFi adoption and more transactions on the chain, and protocols will be more likely to be able to work together. With DEX (spot or derivatives) as the base layer, other protocols can be stacked on top like Lego bricks.
Some potential ideas that may be worth exploring include:
Increase earnings with covered options
For protocols like GMX and KTX, LP tokens have an implicit price based on the base token in the pool as well as billing. Under different circumstances, it may be possible to write coverage options on LP tokens to improve revenue and profit efficiency.
But there may be issues with option pricing.
Collateralized debt positions + minted stablecoins
LP tokens/shares have value in themselves as they represent a certain share of the pool. Banks can accept stocks/bonds as collateral for loans, and likewise lending protocols (Aave, Radiant Capital) will consider LP shares as collateral.
Problems you may face:
The collapse of DEX. When the price of LP shares falls, the liquidation of the lending agreement will cause the collapse of DEX TVL.
LP shares may be locked and cannot be liquidated immediately when the lock occurs. But a possible solution is to use semi-fungible tokens (ERC-3525).
(The above content is excerpted and reprinted with the authorization of partner MarsBit, original text link | Source: ChainCatcher)
Statement: The article only represents the author's personal views and opinions, and does not represent the objective views and positions of the blockchain. All contents and opinions are for reference only and do not constitute investment advice. Investors should make their own decisions and transactions, and the author and Blockchain Client will not be held responsible for any direct or indirect losses caused by investors' transactions.
This article takes dYdX, GMX, etc. as examples to explain in detail the innovative functions of derivatives DEX. It first appeared on Blockchain.
