Introducing YFX V4, The Optimal Solution for Decentralized Perpetual Protocol

YFX.COM
7 min readApr 9, 2024

--

As one of the earliest launched decentralized perpetual contract protocols, the YFX project started in 2020. After three years and three iterations, YFX underwent a transformation to become community-driven at the beginning of 2024. The project is now managed by community geek representative 0xEuler and several developers from the technical community. Following its reorganization, the YFX team, in response to current market demands for decentralized perpetual contracts, has launched the new V4 version. The design of V4 significantly enhances the capital efficiency and fairness of the YFX protocol.

Story of YFX

V1: Development of YFX V1 began in 2020 and was first released at the beginning of 2021. As one of the pioneers of decentralized perpetual contract products, YFX introduced the PvPool trading model, bringing Contract for Difference (CFD) onto the blockchain. After nearly three years of development in the decentralized perpetual contract industry, trading models such as PvPool, and centralized price feeding have been adopted by leading protocols like GMX and GNS.

V2: In the YFX V2 version, we added features such as position merging, funding fees, limit orders, and stop-loss/take-profit, successfully transitioning from CFDs to true perpetual contracts.

V3: YFX V3 included additions like ChainLink price feeds, dual position mode, interest, invitation systems, and merged liquidity pools, making the protocol more comprehensive.

After reviewing the entire DeFi market and the development trajectory of the previous YFX team, we continued the long-term vision of the YFX protocol, which is to build a fair decentralized perpetual protocol. With this goal, we redesigned YFX V4 to bring it as close as possible to the most complete decentralized perpetual contract solution in the current DeFi market.

Features of YFX V4

  1. LP Leverage

Unlike traditional CEXs like Binance and BitMex, where traders (Takers) and market makers (Makers) trade in the same model and can engage in up to 100x leverage trading, in most decentralized perpetual contract products including YFX, GMX, and GNS, traders trade with liquidity pools, preventing Makers from using leverage. This results in low capital efficiency for LPs.

YFX V4 introduces an innovative solution to this issue by providing leverage to LPs, allowing them to use up to 200x leverage when adding liquidity. This means LPs can buy the liquidity pool’s YLP at 200x leverage, multiplying their profits by 200 times when the YLP price increases, though this also introduces greater risk.

In this trading model, the capital pool of YFX undergoes a fundamental change. Based on the value of the capital pool, the YLP Price will vary. Essentially, buying YLP means going long on the capital pool, betting that traders will lose money over a certain period.

2. Fair Index Price Oracle:

In YFX V3, we introduced a ChainLink on-chain oracle price comparison mechanism to prevent our Oracle from failing. In the product design of YFX V4, we further optimized by introducing real-time prices from two leading market oracles, ChainLink and PYTH, as the index price for YFX, ensuring the fairness and transparency of index prices.

ChainLink solution: We use ChainLink’s DataStream and Automation to execute market orders and determine if limit orders, stop-loss/take-profit, and liquidation should be triggered.

PYTH solution: We accept real-time prices published by PYTH and verify signatures using PYTH’s official contracts.

Through cooperation with ChainLink and PYTH, YFX has completely solved the issue of open and fair index pricing, making trading fairer. Everyone can verify that YFX’s index prices come from ChainLink or PYTH.

3. New LPB-AMM

In YFX V4, we introduce a new LP Balance Automated Market Maker (LP-AMM) model. The trading depth for users is determined by the LP Balance. The more LP Balance there is, the better the trading depth for users, and vice versa.

In the classic UniSwap AMM model, the x*y=k curve is used to calculate the market’s liquidity. In the LP-AMP model of YFX, we introduce a new y=kx+b function and use a segmented function to simulate the depth chart in CEX, ultimately achieving a depth chart similar to the one below.

New Price Impact, Premium (Index Premium), and Market Price Model: In YFX V1, V2, and V3, the trading price relied only on the index price and slippage formula, leading to imbalances between long and short positions. Over time, decentralized perpetual contract products adopting the PvPool model began to explore issues such as Price Impact, Depth, Premium, and Funding, each offering different solutions.

4. Premium, Market Price

The premium index measures the difference between the Market Price and the Index Price. The system adjusts the Premium and Market Price based on the net direction of traders’ positions, aiming to maintain a balance between long and short positions. Specifically, when traders’ net positions are long, the Premium is positive, and the Market Price is higher than the Index Price. This increases the cost of opening new long positions, suppressing the formation of new long positions. Conversely, if traders choose to go short, reducing the net long positions, the opening price will be advantageous, thus reducing the overall market premium.

When an imbalance between long and short positions occurs, the Premium will increase, and the Market Price will deviate from the Index Price. At this time, the Price Impact will be more favorable to the side with smaller positions, gradually balancing long and short positions.

The Market Price is calculated based on the index price and the current premium as follows:

When a user’s net position is long:

market price = index price * (1 + current premium)

When a user’s net position is short:

market price = index price * (1 — current premium)

5. New Earning System

YFX will initiate its first mining event after migrating to Arbitrum, including YFX Staking, Position Mining, LP Mining, Trade Mining, and Invite Mining.

Under this incentive system, all platform participants, including Traders, Makers, and inviters, will receive appropriate rewards.

6. Up to 70% Referral Rebate

Thanks to YFX being a decentralized exchange, every transaction fee can be returned in real-time to the inviter’s address, allowing us to execute any rebate strategy transparently. YFX V4 designed a tiered referral system that offers up to 20% fee discounts and 70% fee rebates. High ratio rebates facilitate better cooperation with community nodes, making it easier for YFX to acquire trading users and build a large trading community. YFX will truly become a community-driven decentralized perpetual contract trading platform.

7. MPC Wallet

After years of exploration in the blockchain industry, MPC wallets are becoming an effective way for Web2.0 users to migrate to Web3.0, as users can log in to their wallet systems using Email, Google, Twitter, Facebook, Discord, and other accounts, effectively lowering the threshold for using DeFi products.

Therefore, we have integrated third-party MPC wallets (Currently using Particle Wallet) into V4, providing users with the quickest digital wallet solution. This will allow users not to rely on browser plugin wallets or mobile wallets like MetaMask and Coinbase to use YFX services.

Conclusion:

In summary, YFX V4, as a decentralized perpetual contract protocol, is committed to providing a fair, efficient trading environment. It introduces various innovative mechanisms, such as LP Leverage, LPB-AMM, and Premium, aimed at optimizing capital efficiency, increasing trading depth, and maintaining overall market balance and stability. Moreover, YFX V4 has designed a rich earning system, covering mining, rebates, and other benefits to attract active participation from all parties.

Finally, the introduction of MPC wallets will further lower the usage threshold, promoting seamless migration from Web2.0 to Web3.0 users. Through a series of designs and optimizations, YFX V4 aims to offer users a fair, transparent, liquid, and innovation-driven decentralized perpetual contract trading experience.

Write at the end

The DeFi industry is never short of pioneers, and YFX has also played such a role three years ago. Perhaps we are not adept at the most Fomo of market marketing. However, as a team of geeks, whether it was the core team of YFX before or the decentralized community team now, we have always adhered to a 100% responsible attitude towards users in developing YFX. For every update and iteration, we have made ample preparations, bringing the safest code and the most user-friendly features to users. Even if our innovation is not exceptional in this era, we are still striving to find the optimal solution for the Perpetual Trading Protocol. YFX V4 is the answer we can provide at this moment, and we hope you like it.

0xEuler

April 2024

--

--

YFX.COM
YFX.COM

Written by YFX.COM

Decentralized Perpetual Exchange. Trade BTC, ETH and more with up to 100x leverage directly from your wallet at https://www.yfx.com.

No responses yet