# Timeswap 101: A simplified explainer

## A practical explainer for maximizing yield and capital efficiency with Timeswap pools

--

We have had tremendous success since our testnet launch three weeks ago and are overwhelmed by the incredible support shown by the community. We understand DeFi protocols are easy for DeFi natives, but a large part of our community is relatively new to the industry. Keeping this in mind, we have created this practical explainer to show you how Timeswap pools operate under varying market conditions and how to maximize your yield or leverage your assets with maximum capital efficiency.

# Timeswap AMM

Timeswap AMM works on the basis of 3 variables: Principal Pool (X), Interest Rate Pool (Y) and Collateral Factor Pool (Z). The interplay of these variables determines the interest rate and collateral factor required to interact with the pools.

X*Y*Z = K

Where,

Ratio Y/X is the max interest rate of the pool

Ratio Z/X is the min Collateralized Debt Position(CDP) of the pool

As a constant product equation, when any variable in the equation changes, the other two variables rebalance to maintain the constant product.

## Significance of APR & CDP

Before we explain how the algorithm behaves for a lending or borrowing transaction, let us discuss the significance of APR & CDP for lenders & borrowers

APR - Annual Percentage Rate is the expected yearly interest to be paid by a borrower or the expected yearly yield received by the lender.

CDP - For a borrower, it is the amount of collateral locked per unit of asset borrowed. For a lender, it is the collateral coverage per unit of asset lent.

The APR & CDP are important risk indicators that should be closely monitored by both borrowers and lenders as it can be used to arbitrage pools.

For example in the below pool, the insurance/CDP value of 99.85% for lending USDC is insufficient to make up for the loss if the borrower defaults. Lenders will have a high default risk attached to such transactions and they should not add assets to such a pool till the pool is arbitraged by the borrowers to the expected collateralization values.

# Lending

Lenders add assets to the Principal pool which increases X. To maintain the constant product, Y and Z will decrease which in turn reduces interest rates & CDP/insurance coverage for the next lender.

As more assets are lent into the pool, the interest rate & CDP reduces. Imagine a seesaw, where the lenders pile on to one end that corresponds to the available assets in the pool.

# Borrowing

Borrowers withdraw assets from the Principal Pool, reducing X . To maintain the constant product Y & Z will increase thereby pushing up the interest rate and CDP.

As borrowers withdraw more assets from the pool in the form of loans, both the CDP and the interest are increased further. Similar to the above example with a seesaw, the borrowers sit on the other end of the seesaw, across from the lenders.

# Arbitrage

Arbitrage is the simultaneous buying and selling or borrowing and lending of the same asset in different markets in order to benefit from price inefficiencies. Arbitrage emerges as a result of market inefficiencies, and it both exploits and addresses such inefficiencies.

Arbitrage is the mechanism by which Uniswap pools maintain their exchange prices as close as possible to market prices. Similarly in Timeswap pools, we expect arbitrageurs to normalize the interest rates & CDP to the market values.

Timeswap — External Market Arbitrage

One way to arbitrage Timeswap pools is to take advantage of other DeFi protocols such as Aave or Compound or any fixed term protocols such as Notional Finance or Yield Protocol. If the lending rates on Timeswap are higher compared to Notional or Yield, users can borrow from the external market and lend to Timeswap pools with a similar maturity. Similar transactions can also be executed on the borrowing side when there is an imbalance between markets.

Timeswap Pool Arbitrage

Another way to arbitrage is between two Timeswap pools. Consider there are two DAI-MATIC pools with similar maturity dates. Pool 1 offers 13.5% APR and Pool 2 offers 18.5%. You can borrow from the pool with a lower interest rate and lend into the pool with the higher interest rate to get~5% profit on this trade. Given that both pools have similar maturity, the users stand to make a profit. However, if the pools have wider maturities, then users have to take into account the time preference as well while arbitraging.

Undercollateralization

Another arbitrage opportunity is when Timeswap pools are undercollateralized. Borrowers can borrow from one market which is undercollateralized and lend the same asset into another market which is sufficiently collateralized.

The CDP value of 99.8% in this pool leads to undercollateralized loans i.e for a lender any transaction is a risky transaction due to high default risk owing to insufficient insurance coverage offered by the pool. This pool will be arbitraged by borrowers taking out loans till the CDP shifts to meet prevailing market rates.

# Risk/Reward

Using Timeswap you can control how much risk you are willing to take on to get those sweet rewards! The protocol will not lock you into a default risk, instead, the UI lets you customize the risk you incur for each transaction of lending or borrowing.

Toggling the customize risk slider reveals a scale that can be adjusted for APR. A lower APR will reflect a lower risk tolerance and a higher APR vice versa. This risk-taking calculation is reflected in the insurance/collateral that will be demanded.

For borrowing:

1. Lower APR will result in a higher amount of collateral locked.
2. Higher APR will result in a lower amount of collateral locked.

For lending:

1. Lower APR will result in a higher amount of insurance issued.
2. Higher APR will result in a lower amount of insurance issued.

We hope the above explanations helped you to better understand the powerful ways in which Timeswap pools operate under varying market conditions. Timeswap AMM offers a new breakthrough for market-driven interest rates & collateralization values which were previously not possible in DeFi. This opens up a whole host of new use cases which we will be covering in the subsequent posts. Stay tuned!

# Our Social Media

Website: www.timeswap.io