Implication for a Portfolio while Providing Liquidity on Uniswap

Ruslan Ovechkin
5 min readFeb 8, 2021

This is a basic analysis to understand implication of providing liquidity on Uniswap for a portfolio. E.g. given two assets A and B, we want to see how a portfolio consisting of liquidity pair of A/B can be compared to a portfolio of holding A,B separately. To simplify things further we will select one of the assets (A) to be a dollar. This ensures that we can evaluate portfolios against a stable currency. This analysis ignores all transaction fees as well as fees earned for providing liquidity.

Uniswap is a decentralized exchange which is used to “swap” or trade ERC-20 tokens on Ethereum blockchain. It uses so called automatic market making mechanism (AMM). A user holding tokens A and B can add them in equal proportions of value to an AMM liquidity pool and earn exchange fees when tokens are traded. For details on how AMM works see Uniswap documentation.

Uniswap AMM equation:

where A ,B — number of units of token A and B, k — some factor which stays constant for a given liquidity stake.

Price (or rate) r of a token B expressed in units of token A can be computed as

For example assuming A is USD and B is ETH, then r = $100 means 1 ETH costs $100: r*1 ETH = $100

Comparison between holding token A,B in portfolio vs providing liquidity on Uniswap

Let’s compare profitability of holding tokens A and B in a portfolio vs providing liquidity of A/B pair on Uniswap. By providing liquidity, we can earn exchange fees.

Assuming A0, B0 number tokens at the moment T0 when liquidity is provided, then according to (1)

and the rate (2):

At any moment T total number of tokens A from (1) and (2):

Similarly:

Then total stake value S_uni in Uniswap from (3) and (4) expressed in units of A:

By definition of k

then

where x- ratio between price of token B at time T and T0.

If funds were kept in portfolio, then their value at moment T would be

Then the difference D would be

and the difference in percents would be D*100%.

This difference D is represented on the graph below

Difference between value of Uniswap LP and portfolio

If value of token B declines 50%, then Uniswap portfolio will lose an extra 5% compared to holding A,B separately. Similarly if token B appreciates 2X, then Uniswap LP stake would loose about 5% as well compared to a regular portfolio. If price of a token returns back to its original value when liquidity was provisioned to Uniswap (time T0), then all losses will be reverted. However if funds have to be pulled from Uniswap when r != r0 (r0 is the price at time T0), then funds would be irreversibly lost.

Thus liquidity provisioning to Uniswap always bears cost compared to the case when funds are kept in portfolio. However this cost is relatively small and reversible and can be compensated over time by fees earned.

Comparison between holding token A in portfolio vs providing liquidity on Uniswap

Since Uniswap automatically adjusts price of tokens according to (1), one can come up with a naive “risk-free” fee earning trading strategy using Uniswap. Assume portfolio contains 2*$A dollars, lets pick up a token B, such that its LP can be farmed further. We can select token B with high LP farming reward, then split the original portfolio in half with $A on one side and B = A0/r0 on the other. We can add it as LP to Uniswap, stake resulting LP in a farming contract, earn rewards hoping the total value of our portfolio will stay close to 2*$A, no matter what the price of token B. Our goal here is 1) not to lose money and 2) earn farming rewards thus achieving “risk-free” farming.

Total value of LP in Uniswap at time T according to (5):

where x = r/r0, price ratio between time T0 when liquidity was provided and given time T.

Our original portfolio value is S_pf = 2*A0, then difference is

The graph of this difference is below.

Difference between Uniswap LP and cash portfolio

If price of a token declines 50%, then Uniswap stake will lose 25% of its value in units of A. If a token B appreciates 2X, we only get 40% return. This such approach is naive and not risk-free. However as in the first case the loss is reversible when r returns to its initial value r0. If farming reward is substantial, e.g. at least greater than 25% over the time when token B loses half of its value, then this approach is profitable. Thus selecting relatively stable token B with farming reward 20–30% one can achieve relatively low-risk profitable portfolio.

If token B appreciates Uniswap LP will also benefit from the appreciation compared to cash-only portfolio.

Conclusion

Uniswap is a useful protocol to earn additional income, however it is not without a risk. In both of the considered examples Uniswap LP is inferior to simply holding token in a portfolio or holding cash (token A) unless Uniswap trading fees or farming reward compensates for the risk.

--

--