4 FreeSwap Arbitrage Profit Analysis #
4.1 FreeSwap arbitrage profit #
To simplify the calculation, it is assumed that the FreeSwap trading and arbitraging process is as follows:
The A-Pool and the B-Pool initially have the same amount of two tokens, which are represented by and respectively;
In A-Pool, the user exchange with a quantity of for with a quantity of , causing the token price of the A-Pool to slide. And the sliding value is , triggering arbitrage operation between A-Pool and B-Pool;
After arbitrage, the number of tokens in the A-Pool and the B-Pool becomes and ï¼›
The changes in the amount of during the trade and arbitrage process are shown in the following table:
Sub Pools | A-Pool | B-Pool |
---|---|---|
Token State | ||
Initial State | ||
Post Trade | ||
Post Arbitrage |
According to the "constant-product invariant" formula, there are:
According to the arbitrage triggering conditions in , there are:
According to and , after arbitrage the maximum value increment of two sub-pools are:
After arbitrage, the increase ratio of value both in A-Pool and B-Pool will be:
According to , the amount of tokens exchanged between the two sub-pools during arbitrage operation can be calculated as follows:
It can be seen that after arbitrage, the number of tokens in the two sub-pools becomes:
That is, the number of tokens in the two sub-pools is equal, achieving a complete balance.
The above analysis is based on the assumption that the amount of tokens in A-Pool and the B-Pool are exactly the same. Let’s analyze below, if the amounts of tokens in A-Pool and the B-Pool are different, how much is the value increase of the two sub-pools after arbitrage according to FreeSwap protocol.
In this case, the changes in the amount of tokens during the trade and arbitrage process are shown in the following table:
Sub-Pools | A-Pool | B-Pool |
---|---|---|
Token Pair | ||
Initial State | ||
Post Trade | ||
Post Arbitrage |
Assuming that the Value ratio of A-Pool and B-Pool is represented by , the following relationship exists:
Jumping the dedcution process, it can be concluded that:
So after arbitrage, the K value increase ratio of A-Pool and B pool are:
It can be seen from and that increases monotonically with , while decreases monotonically with , which means that when the amount of funds in the two sub-pools is unbalanced, the more the amount of tokens in the sub-pool relative to the other one, the less the increase in value during arbitrage. On the contrary, the less the amount of tokens in the sub-pool, the more the increase in value during arbitrage. Therefore, when users add liquidity, it is more advantageous to choose to join the sub-pool with smaller amount of tokens, and on the round it helps improve the liquidity of this smaller pool. This internal regulation mechanism of FreeSwap protocol can make the amount of tokens in the two sub-pools to keep in a dynamic balance.
4.2 Equivalent transaction fee rate #
Assuming not by arbitraging, but by charging exchange fees, how much exchange fee rate should be charged to obtain the same value increase as ?
Let's represent this trade fee rate as . Since the FreeSwap protocol has two independent one-way sub-pools, considering the equivalence, when calculating , the single two-way trade pool should have the same token amount, which can be expressed as: . The user exchanges with the same amount of as for some amount of , denoted by . According to the "constant-product invariant" formula, there are:
After the completion of the exchange, because the exchange fees do not participate in "constant-product invariant" calculation, just directly enter the liquidity pool, resulting in an increase in the value of the overall token pool:
Compared with the value before the exchange, the Value increase of the whole pool is as follows:
Combining with , , let , we have:
As the calculation example, when = 1.01, 2.488‰, that is, if the arbitrage is automatically conducted while the price deviation of the two sub-pools reaches 1%, the profit of the liquidity pool provider is equivalent to charge exchange fee of 2.488‰ from trading users. Currently, UniSwap [2][3] charges an exchange fee of 3‰ from trading users, so FreeSwap can achieve approximately 83% of UniSwap's profit rate through only exchange arbitrage. Taking into account that the FreeSwap protocol can provide users with totally free exchange, it can attract more exchange users and increase exchange volume. By the increase in exchange volume, it is possible for FreeSwap to achieve the same profit level as UniSwap, or even exceed UniSwap while completely waiving any exchange fees.
It can also be deduced from :
According to the calculation, 1.0121‰ while = 3‰, that is, if FreeSwap performs arbitrage when the price deviation of the two sub-pools reaches 1.21%, it can obtain equivalent 3‰ of exchange fee income same as UniSwap.
4.3 Not applicable exchanges #
Since FreeSwap protocol relies on exchange arbitrage when the price of sub-pools deviate to a certain level, FreeSwap is not suitable for liquidity pools with both stable tokens exchanged. The exchange of stable tokens needs to minimize the price deviation as much as possible, it will not help attract exchange users by accumulating price deviation and then arbitraging.
FreeSwap is also not applicable to exchange deflationary tokens. As intenal exchange will be conducted between two sub-pools for arbitrage, and the transfer of deflationary token will cause token deflation, which is not beneficial to the sub-pool swapping in deflationary token. Moreover, arbitrage will increase the transfer times of deflationary token, finally accelerate token deflation rate, this effect violates the original intention of deflationary token.