LemmaSwap will initially charge a 0.3% “fee” on each trade. There are two different types of trades that affect what profits liquidity providers can expect. The first type is a trade that involve swapping a cryptocurrency for another cryptocurrency (such as ETH for BTC), and the second type is one that involves swapping a cryptocurrency for a stablecoin or vice versa (such as ETH for USDL or USDL for ETH).
For the first type of trade, LemmaSwap has to execute two transactions on the underlying perpetual futures market in order to hedge itself properly. As such, if the spread on the underlying perpetual futures DEX is 0.1%, then the total transaction cost excluding slippage will be 0.2%. The remaining 0.1% will be divided between the liquidity providers whose assets were used to facilitate the transaction.
For the second type of trade, LemmaSwap only has to execute one transaction on the underlying perpetual futures market. As such, if the spread on the underlying perpetual futures DEX is 0.1%, then the total transaction cost excluding slippage will be 0.1%. The remaining 0.2% will be divided between the liquidity providers whose assets were used to facilitate the transaction.
Staked USDL and synthetic token holders receive a pro rata percentage of spot trading fees generated by LemmaSwap on their corresponding markets.
For example, for a ETH/USDC swap, if there is $1000 worth of ETH* minted, $500 worth of staked USDL minted with ETH, and $1500 worth of staked USDL minted with USDC then a third of the 0.2% fee would go to ETH* holders and two thirds would go to staked USDL holders.
Every time a user sells a given spot asset for stablecoins on LemmaSwap, Lemma’s short position on that market increases. Every time a user buys a given spot asset with stablecoins, Lemma’s long position on that market increases. However, since longs and shorts “cancel” each other out, LemmaSwap can only ever be net long, net short or 0 on any given market. As a result, the funding rate LemmaSwap will pay or receive on that net position will tend to be quite small relative to the overall amount of liquidity provided to the protocol.
Ideally, the net funding rate payments generated by LemmaSwap would be positive or near 0. These payments can be calculated as below:
- A: LemmaSwap’s net position, A > 0 if more longs and A < 0 if more shorts
- TWAP_vAMM : Time-Weighted Average Price for the vAMM (a type of perpetual futures DEX)
- TWAP_index : Time-Weighted Average Price returned by the oracle
- If A < 0 and TWAP_vAMM > TWAP_index then F < 0 and the net funding rate payment will be negative, ie. LemmaSwap makes money
- If A > 0 and TWAP_vAMM > TWAP_index then F > 0 and the net funding rate payment will be positive, ie. LemmaSwap loses money
and so on.
When Lemma’s net position is long on a given market, the respective synthetic token holders for that market will receive or pay the funding rate. When Lemma’s net position is short on a given market, staked USDL holders will receive or pay the funding rate.
If the contract price of the perpetual is consistently under the spot price, it means two things:
- Funding rates are negative and therefore short traders are paying a fee to long traders
- The price LemmaSwap quotes for spot swaps is better than the current oracle spot price, and is therefore "incentivizing" more longs
The opposite also holds. As a result, LemmaSwap continuously seeks to be on the right side of funding rates and to improve the net exposure of its liquidity providers.
If the contract price drops below the spot price by more than a given threshold, LemmaSwap can perform an automatic arbitrage to improve its funding rate position. It does so by selling some of its spot position and increasing its long position, thereby staying delta neutral. The threshold is the sum of the fees charged by the spot DEX used to sell the spot position and the fees charged by the perpetual futures DEX used to increase the long position. Once again, the opposite also holds true.
For example, for a spot market with a 0.3% fee and perpetual futures market with a 0.1% fee, the threshold would be 0.4%. If the entire LemmaSwap notional was short, the max loss due to negative funding rate payments would be capped at about ~77% over the course of a year.