Deep Dive on Liquidity Providers of Timeswap

krish
Timeswap
Published in
9 min readJul 15, 2022

Introduction

For better capital efficiency a financial market needs two things, market participants and liquidity. Both of them are complementary. Market participants bring liquidity and better liquidity attracts larger participants, given there is demand. Liquidity is the fuel of the market. If there isn’t enough liquidity, the market will be volatile and there would be price inefficiencies for large orders.

An example of a liquid market would be cash or ‘stable coins’ which can always be converted into any asset/token. Non Fungible Tokens or NFTs can be looked at as a not very liquid market where liquidity is available only when someone wants to buy/sell the token.

Now, let’s look at liquidity from a lending/borrowing protocol’s point of view.

Liquidity for a Money Market

Most of us are familiar with providing liquidity on a DEX and the risks involved while doing so. But providing liquidity on a money market is something many aren’t familiar with. The concept of a liquidity provider for a money market is a new thing in itself.

Majority of money markets today are ‘Variable Rate’ i.e dynamic interest rate (AAVE, COMP, etc) markets. Here lenders are the liquidity providers. This is because ‘Interest Rate’ is the only parameter that’s market driven and ‘Collateral Ratio’ on these protocols is fixed(using Governance).

But unlike other money markets, on Timeswap both ‘interest rate’(APR) and ‘collateral ratio’(CDP) are market driven. Owing to our 3 variable AMM X*Y*Z=K, If more lending (🠕X) happens, both APR(🠗Y) and CDP(🠗Z) of the market decreases. On the other hand if more borrowing(🠗X) happens, both APR(🠕Y) and CDP(🠕Z) of the market increases. Hence, a Timeswap pool needs both lenders and borrowers as its ‘Market Makers’ or ‘Liquidity Providers’.

Before getting into liquidity providers of Timeswap, we need to first look at who the users are and what liquidity they need. Lenders and Borrowers are the two end users of a Timeswap pool. Lenders essentially want to earn APR and there should be collateral to protect the capital they’re lending. Borrowers on the other end need assets to borrow against their collateral. This means, a Timeswap pool needs collateral to secure a lender and assets to borrow(for a borrower).

Liquidity Providers of Timeswap

Timeswap Liquidity Providers add both erc20 ‘Asset’ and ‘Collateral’ tokens into the pool. They add the tokens in a ratio that maintains the constant product X*Y*Z=K of the pool. This helps deepen the liquidity of the pool by making sure both lenders and borrowers can transact larger amounts of tokens with less slippage.

LPs receive erc20 ‘Liquidity Tokens’(LT) which represent their ownership over the pool. The amount of LT an LP receives depends on the amount of liquidity they add into the pool in the form of asset and collateral.

LPs also receive an erc721 ‘Collateralized Debt Token’(CDT) which allows them to remove their ‘collateral tokens’ from the pool before maturity. In order to remove the collateral tokens from the pool, LPs need to repay debt attached to it. The rationale behind repaying is the value of collateral might be higher than the debt.

What are the incentives for LPs?

  1. LPs earn transaction fees from both lenders and borrowers. Lenders and Borrowers pay 1.5% of annualised fees on their transaction, out of this 1.25% goes to the LPs and 0.25% to the protocol treasury. This means, users pay 1.25% APR to LPs as a fee. The amount of fees an LP receives depends on ‘Amount of LT’ and the ‘Time period’ of Liquidity Provision. Time period is taken into consideration to avoid users from taking the majority of fees by providing a huge amount of liquidity just before the pool matures.
  2. LPs can also earn yield on their assets when Total Borrow > Total Lend. This additional borrowed amount is LP’s capital, hence LPs can earn Yield on it.

(Here Total Lent is 29.5K, whereas Total Borrowed is 35K. Therefore LPs can earn Yields on 35K — 29.5K = 5.5K USDC)

Once the pool is matured/expired, all the lending/borrowing have come to an end. It’s time for settlement! This is the time for LPs to withdraw their liquidity. LPs burn their Liquidity Tokens to claim their asset and collateral. If you hold 10% of all the Liquidity Tokens, then you can claim 10% of the asset and collateral tokens remaining in the pool after lenders share has been distributed.

Liquidity Providers as Junior Tranche

When a Timeswap pool matures, there are two parties yet to redeem their capital from the pool. Lenders and Liquidity Providers. Timeswap is designed in such a way that lenders get to claim the assets first and then LPs claim the remaining assets. This is what is known as Tranching. Lenders here act as a Senior Tranche and LPs act as Junior Tranches. LPs being a junior tranche get to claim after lenders.

Now, this is important because Timeswap loans are non-liquidatable and some borrowers might’ve defaulted. This means, a pool can have less assets(Repaid by borrowers) and more liabilities(Owing to Lenders). Collateral of Borrowers will pay the remaining liabilities. There can be a situation where LPs only receive Collateral from the pool when lenders claim all the Asset tokens left after a large number of defaults.

For eg:

Assume a USDC-ETH pool needs to repay 10,000 USDC, 7000 to Lenders and 3000 to LPs. But at Maturity there is only 9,000 USDC and 1 ETH in the pool. Lenders will be able to claim 7,000 USDC first, then LPs will proportionally share the remaining 2000 USDC and 1 ETH.

An important reason why LPs are Junior Tranche and not Senior Tranche is the fact that LPs make the Market. This allows LPs to create a deeper liquidity at unhealthy parameters to attract volume in situations like very low CDP or very High APR which can lead to bad debt and market imbalance. Being a junior tranche, incentives of LPs are aligned towards creating a healthy market.

Risks Associated with Providing Liquidity

When you provide liquidity in a Timeswap pool, essentially you’re becoming both Lender and Borrower. Since you’re both lending/borrowing, you need to take both APR and CDP of the pool into consideration at the time of providing liquidity. The ‘Asset’ tokens which you’re adding will be available for borrowers to borrow, and the ‘Collateral’ tokens which you’re adding acts as collateral for lenders of the pool(until borrowers start borrowing). This makes it important for an LP to consider what’s the fair market APR and CDP. What rates will be attractive enough for lenders and viable for borrowers.

For an LP, the APR and CDP at which you provide liquidity should be the fair market rate. If the pool parameters or market rates significantly fluctuate from the rate at which you provided liquidity, then X*Y*Z=K ratio changes which can lead to potential risks for the LPs.

Two Risks which Timeswap LPs take are:
1) Divergence Spreads: Risk and Reward

2) Default Risk: Bad Debt

Let’s look into both of them:

1) Divergence Spreads

If demand for borrowing reduces from where you provided liquidity, you are at risk from divergence spreads. Whereas if demand for borrowing increases, you benefit off the divergence spreads.

Deeper explanation:

APR and CDP of a Timeswap pool can change depending on demand on Lending/Borrowing. At the same time, APR and CDP are adjustable for users depending on their risk profile. Lenders/Borrowers can select Higher APR with Low CDP(More Risk) or Low APR with High CDP(Low Risk). This can lead to a situation where we will have a difference in average APR of lenders and Borrowers. Both the above mentioned factors create divergence in pool parameters.

a. APR Spread: When avg APR of Borrowers is different from avg APR of Lenders, there is an APR spread created in the pool.

Negative Spread — Risk

If avg APR of Lenders > avg APR of borrowers, the APR spread is Negative. This means, borrowers will pay less and lenders will earn more, this additional earnings will come from LPs.

Eg. If APR spread of a pool is -2%, then this spread will be paid off from yield earned by LPs.

Positive Spread — Reward

If avg APR of lenders < avg APR of borrowers, then APR spread is Positive. This means, borrowers will be paying more than how much lenders earn, the additional earnings go to the LPs.

Eg. If APR spread of a pool is +2%, then LPs earn 2% yields on capital of Lenders.

b. CDP spread: When avg CDP of lenders is different from avg CDP of Borrowers, there is a CDP spread created in the pool.

Negative Spread — Risk

If total collateral backing lenders > total collateral locked by borrowers, CDP spread is negative. This spread is covered with collateral of LPs.
Eg. If CDP spread of a pool is -1 ETH, then essentially 1 ETH from LP deposits is backing the Lenders. In case borrowers default, this 1 ETH can be claimed by lenders.

Positive Spread — Reward

If total collateral backing lenders < total collateral locked by borrowers, CDP spread is Positive. LPs get to keep the collateral from this spread if borrowers default.
Eg. If the CDP spread of a pool is +1 ETH, then essentially there is 1 ETH additional in the pool. In case borrowers default, this 1 ETH can be claimed by LPs.

The economics of lending/borrowing are such that whenever there’s Negative Spread (Risk) on one Parameter, the other parameter is more likely to have Positive Spread (Reward). This makes risk exposure Game Theoretically sound.

Do note that the above mentioned Risks/Rewards are ‘Notional’, realised risks/rewards are determined at Maturity of the pool. This is where our second determinant Risk parameter comes forward.

2) Default Risk

Whenever borrowers don’t repay their loans, the pool gets exposed to bad debt. Borrowers don’t repay when the value of collateral locked is less than the debt they took. This happens when collateral token falls in value. Since LPs are Junior Tranche, ‘asset tokens’ of LPs become claimable for lenders, while LPs get to keep the collateral. This is what essentially determines the majority of Risks which LPs have. Borrowers not repaying causes maximum risks.

Remember, LPs are also lenders and borrowers. This means even LPs need to repay before maturity in order to unlock the underlying collateral. This repaid debt goes back to LP when they burn their Liquidity Tokens. To make sure it’s more convenient, we have integrated FlashRepay feature for LPs to repay without need for additional capital.

How can LPs hedge their Risk?

Majority of risk exposure of Liquidity Providers is dependent on ‘Default Risk’. A simple question to ask here is: ‘When will the borrowers Default?’ When the price of collateral falls!

Since most of the risk lies in collateral token losing its value, Liquidity Providers can hedge their positions by Shorting the collateral token using Futures contracts.

Eg. When providing liquidity in a USDC-MATIC pool, LPs can hedge by shorting MATIC on a Derivatives Exchange.

This was it for Liquidity Providers of Timeswap, hope you learned something useful. If you like the concept of LPs on a Money Market and would like to experience how it feels to be one, then check us out here. There will also be some awesome rewards in future for early Liquidity Providers, join discord to know more.

Happy Time Traveling 🧑‍🚀

Time Is Money ⏳

--

--

krish
Timeswap

Writing about DeFi || Content @TimeswapLabs ⏳