Fee Operations (F)

Transaction Fee

We will charge transaction fees when users buy/sell FT/XT in the pool according to their yields. In TermMax, we define the yield as the net profit of the trade at maturity. For example, if a user pays δy\delta_y UT to buy FT, he will mint δy\delta_y XT and εδy\varepsilon\delta_y FT first and sell the δy\delta_y XT for δx\delta_x FT according to the swap operation. The cost of the trade is δy\delta_y UT and the gain is εδy+δx\varepsilon\delta_y + \delta_x FT. At maturity, 11 FT can be redeemed for 11 UT. Therefore the yield of the trade can be derived as Eq.F-1\text{Eq.F-1}.

yield=εδy+δxδy (Eq.F-1)yield = |\varepsilon\delta_y+\delta_x-\delta_y| \text{ (Eq.F-1)}

The yield of other swap operations can be derived in the same way.

The transaction fee for each trade is calculated based on the yield of the operation and its type. There are two types of operations: lending (buy FT/sell XT) and borrowing (buy XT/sell FT), each with a distinct fee ratio. Using the lending and borrowing fee ratios, we can determine the transaction fee for both types of operations.

General Formula

txFee=yield×feeRatio=ϵδy+δxδy×feeRatio (Eq.F-2)txFee = yield \times feeRatio = |\epsilon\delta_y+\delta_x-\delta_y| \times feeRatio \text{ (Eq.F-2)}

For lending:

lendTxFee=yield×lendFeeRatio=ϵδy+δxδy×lendFeeRatiolendTxFee = yield \times lendFeeRatio = |\epsilon\delta_y+\delta_x-\delta_y| \times lendFeeRatio

For borrowing:

borrowTxFee=yield×lendFeeRatio=ϵδy+δxδy×borrowFeeRatioborrowTxFee = yield \times lendFeeRatio = |\epsilon\delta_y+\delta_x-\delta_y| \times borrowFeeRatio

Transaction Fee Distribution

TermMax, a fixed lending and borrowing protocol, provides fixed rates and maturity dates. In line with the fixed-income market norms, trading yields within the pool gradually decrease from the market opening date to the maturity date. The transaction fees also decline in tandem with this trend. To incentivize liquidity providers (LPs) to keep their liquidity in the pool for as long as possible, we have developed a diamond-hand strategy, designed to reward long-term LPs—our "diamond-hand partners"— generously.

In Fig.F-1\text{Fig.F-1}, the yellow triangle represents the accumulated transaction fee in the pool from the market opening time to the maturity time, decreasing over this period. Conversely, the green triangle represents the fee distribution structure designed to incentivize our diamond-hand LPs. Under this system, LP rewards increase from the beginning to the end of the period.

When a LP decides to withdraw liquidity, only the rewards represented by the bright-green triangle will be distributed. These rewards are allocated based on the LP’s share relative to the total LP supply and the total LP reward pool (illustrated as the bright-yellow trapezoid).

Rewardtotal:Rewarddistributed=Areatrapezoid:Areatriangle=(hc+ho)×(tcto)2:hc×(tcto)2=hc+ho:hc (eq.1)Reward_{total}:Reward_{distributed}\\=Area_{trapezoid}:Area_{triangle}\\=\frac{(h_c+h_o) \times (t_c-t_o)}{2}:\frac{h_c' \times (t_c-t_o)}{2} \\= h_c+h_o:h_c' \text{ (eq.1)}

According to Triangle similarity theorems, we can derive

hotmto=hctmtc=hctcto (eq.2)\frac{h_o}{t_m-t_o} = \frac{h_c}{t_m-t_c}=\frac{h_c'}{t_c-t_o} \text{ (eq.2)}

With eq.1\text{eq.1} and eq.2\text{eq.2}, we can derive

Rewardtotal:Rewarddistributed=hc+ho:hc=(tmto)+(tmtc):tctoReward_{total}:Reward_{distributed}=h_c+h_o:h_c'=(t_m-t_o)+(t_m-t_c):t_c-t_o

Therefore,

Rewarddistributed=Rewardtotal×(tcto)2tmtotcReward_{distributed} = \frac{Reward_{total} \times (t_c-t_o)}{2 \cdot t_m-t_o-t_c}

The reward of the LP with lpAmtlpAmt will be

RewardLP=Rewarddistributed×lpAmtlpSupplyRewardtotal=Rewardtotal×(tcto)×lpAmt(2tmtotc)×(lpSupplyRewardtotal) (Eq.F-3)Reward_{LP} = Reward_{distributed} \times \frac{lpAmt}{lpSupply-Reward_{total}} \\ = \frac{Reward_{total} \times (t_c-t_o) \times lpAmt}{(2 \cdot t_m-t_o-t_c) \times (lpSupply-Reward_{total})} \text{ (Eq.F-3)}

The RewardtotalReward_{total} will be accumulated in terms of LP tokens holding by the market. Therefore, we need to subtract the RewardtotalReward_{total} from total lpSupplylpSupply when calculate the share of the lpAmtlpAmt against lpSupplylpSupply.

Last updated