🏦Market Making (FLP Vault)
Last updated
Last updated
Below are the topics that we will be covering in this section:
Similar to other pool-based DEXs, Flex Perpetuals has its own liquidity pool, called the FLP, which provides the market making liquidity for traders.
The FLP vault provides liquidity for leveraged traders on Flex Perpetuals. In addition, it also functions as the counter party to these leveraged traders. The profits and losses from counter trading on the platform also accrue to FLP stakers.
To compensate the depositors of the FLP vault for providing the market making liquidity, Flex Perpetuals allocates the largest share of the protocol fees to these users along with other benefits (more details here).
The FLP vault comprises of three assets, as follow:
Asset | Target Weight |
---|---|
FLP might also contain other assets as they are collected from collateral of losing trades. These assets will be swapped into USDbC, WETH & WBTC periodically to maintain the desired target weight.
Below, we share with you the technical architecture on our Market Making feature:
User deposits assets into the Flex Perpetuals FLP & receive FLP tokens which are staked in the platform to earn revenue & incentives.
The liquidity in the FLP pool is used to market make for traders at Flex Perpetuals, and consequently, accrues profits/losses from counter trading & fees
Fees are then distributed back to FLP stakers in the form of USDbC along with esFDX incentive rewards
By depositing assets in the FLP vault, you will earn the following benefits:
45% of FLEX's protocol revenue, paid in USDbC
Profits (or losses) from counter trading on Flex Perpetuals
esFDX rewards based on the size of your FLP stake & emission rates
Flex Perpetuals put in multiple measures to minimize the risk of LPs taking on too much one-sided exposure, allowing them to continually earn on protocol generated fees.
Flex Perpetuals reserves the liquidity in FLP to be paid as profits to traders. There is a max utilization for FLP, beyond which new positions are not allowed to be opened (traders are still allowed to reduce their OIs). This parameter is in place to ensure some liquidity is always available for LPs to withdraw.
Each individual trading position will have an in-profit price target where a position will be automatically closed for users. This guardrail is put in place to limit the downside to the LPs. The ADL price is market-specific and is a function of initial margin requirement. It is set at level that balances between the risk for LPs vs. the attractiveness for traders.
FLEX keeps track of the net global PnL of all traders against the FLP pool. Once the net global PnL hits a percentage threshold relative to the FLP's TVL, the protocol will start auto deleveraging open positions, starting from the most in-profit positions, to de-risk the overall platforms and LPs.
The Profit reserve buffer is calculated using the formula below:
Each market will have its own open interest limit, which can be set separately for the short side and the long side.
The Open Interest Limit defines the maximum ongoing open interest that each asset can have on each side, beyond which new open interest are not allowed.
The Funding Rate is charged on the traders’ position, similar to the borrowing rate. The Funding Rate helps bring a balance between long and short OI on Flex Perpetuals, thus ensuring our LPs are not too exposed to one side of the market. FLEX utilizes a velocity-based funding rate model. Instead of the typical model where the long-short skew determines the funding rate, our model have the skew determine the velocity of the funding rate.
This slight adjustment in the formula has a large implication. With the traditional model, there is no incentive to completely eliminate the skew as funding would immediately go to zero, and some arbitrage strategies -e.g., carry trade, would no longer be viable.
With the velocity-based model the rate will only gradually increase or decrease overtime. So even after the skew is offset, the funding rate will persist overtime until the market has shifted to the other side, creating a better incentive model to maintain the neutrality for the market.
Example:
The BTC Perp market currently has $1,000,000 in LONG positions and $200,000 in SHORT positions. Three scenarios can happen for this market from here:
Skew stays long - No one enters (or exits) this market. Funding rates will continue drifting upwards. Longs pay shorts an increasing amount over time.
Skew becomes neutral - Traders bring the skew to neutral (1,000,000 LONG and 1,000,000 SHORT.) Funding rates will stay the same. Longs pay shorts the same amount each hour.
Skew flips to short - Traders flip the skew to SHORT (500,000 LONG and 1,000,000 SHORT). Funding rates will decrease. Longs pay shorts a decreasing amount each hour. Eventually, if the state persists, Shorts will start paying Longs.
For more information on the Funding Rate model, please visit here.
Flex Perpetuals employs a mechanism called "Adaptive Pricing" as another way to incentivize / penalize traders to help bring balance between the long and short open interest of each trading asset. When a user opens or closes a trading position, the Adaptive Pricing mechanism applies a premium or a discount on top of the oracle price based on the resulting skew after the transaction is executed between the long and short open interest of the asset.
If the long open interest is larger than the short open interest, a premium will be applied to the price of the asset. On the other hand, if the short open interest is larger than the long open interest, a discount will be applied to the oracle asset price. The premium/discount from the Adaptive Pricing mechanism will encourage or discourage traders to open long or short positions on the asset accordingly.
Below is a table summarizing the premium and discount applied to the price in different scenarios.
Max Skew Scale (USD): 300,000,000
ETH Oracle Price (USD): 1,800
ETH Open Interest: 0
Alice opens long position on ETHUSD with the position size of $1M. The price that Alice will get is calculated as follows:
marketSkew = 0
premiumDiscountBefore = 0 / 300,000,000 = 0
premiumDiscountAfter = (0 + 1,000,000) / 300,000,000 = 0.00333333
priceBefore = 1,800 + (1,800 * 0) = 1,800
priceAfter = 1,800 + (1,800 * 0.00333333) = 1,805.999994
adaptivePrice = (1,800 + 1,805.999994) / 2 = 1,802.999997
Alice will enter this position with the adaptive price of 1,802.999997. This price is not in favor of Alice, because Alice opened a long position that caused the market to skew towards the long side. Hence, Alice received a premium vs. Oracle price on her entry price from the Adaptive Pricing mechanism.
Bob then opens a short position on ETHUSD with the position size of $500k. Assuming there was no price movement after Alice opened her position and the Oracle Price of ETH is still at $1,800, the price that Bob will get is:
marketSkew = +1,000,000
premiumDiscountBefore = 1,000,000 / 300,000,000 = 0.00333333
premiumDiscountAfter = (1,000,000 + -500,000) / 300,000,000 = 0.00166667
Note that the size delta for Bob's position will be negative as he is shorting.
priceBefore = 1,800 + (1,800 * 0.00333333) = 1,805.999994
priceAfter = 1,800 + (1,800 * 0.00166667) = 1,803.000006
adaptivePrice = (1,805.999994 + 1,803.000006) / 2 = 1,804.5
Bob will enter his short position at the adaptive price of 1,804.5. This is a favorable price to Bob because Bob’s position reduced the market skew from the long.
For more information, please check out the Adaptive Pricing calculator here. - TBC
The adaptive trading fee is charged as a percentage of the trader's position size on top of the trading fee. This takes our security to the next level and improves user experience at the same time as it enables us to:
List more crypto markets including ones with lower market cap
Increase Max. Trade Size
The adaptive trading fees are implemented on ALL crypto markets EXCEPT BTC and ETH, where users can still enjoy the same flat low 0.02% trading fees.
Alice wants to open a Long AERO position with a size of 300,000 USD
1% Ask orderbook depth = 750,000 USD (i.e., market buy order of 750k USD would move the price up 1% on Binance)
epochDelta = 0; (Alice is the first to trade in the 15-min window)
Volatility of AERO is 0.0035
k1 = 1.25; k2 = 0.02
AERO’s fixed trading fee = 0.05%
Plugging all the values into the formula, we see that the adaptive fee for Alice will be 0.05% + 0.013% = 0.063%.
The graph below shows how the total fee would be for Alice, based on her trade size. As you can see, if Alice’s trade is < ~$100,000 USD, her trading fee will be roughly just 0.07% (no impact from ATF), and the max 1% fee is hit if her trade is > ~$620k USD.
For the formula and the example calculation of the Adaptive Trading Fee, please visit here.
Open Interest Skew | Adaptive Pricing Applied on Entry / Close Price |
---|---|
WETH
20%
WBTC
25%
USDbC
55%
Long > Short
Premium
Short > Long
Discount