In the rapidly evolving world of decentralized finance (DeFi), two foundational pillars support nearly every new blockchain: decentralized exchanges (DEXs) and lending protocols. DEXs, often built on Automated Market Maker (AMM) models, utilize bonding curves to facilitate trading with simple, efficient mathematics. Lending protocols, however, traditionally rely on oracles and complex components, introducing vulnerabilities and risks like oracle manipulation attacks.
What if lending could also harness the power of bonding curves? Timeswap, a novel protocol on Polygon, offers a groundbreaking solution: an AMM-based lending market without liquidations.
What Is Timeswap?
Timeswap is a unique lending protocol operating on the Polygon network. It leverages an AMM model to create permissionless, oracle-free lending markets, eliminating the need for liquidations. The protocol went live on March 22, 2022, and periodically opens small lending pools for user testing. Participants can lend USDC or borrow it by collateralizing MATIC.
The project raised a seed round in October 2021, with backing from prominent investors like Multicoin Capital, Mechanism Capital, and Defiance Capital. The founding team, primarily based in the Philippines, includes Ricsson Ngo, a financial mathematics graduate and former founder of an educational platform; Harshita Singh, ex-supply chain lead at Walmart India; and Ameeth Devadas, an early Polygon angel investor. Advisors include Dipesh Sukhani of Zapper.fi and Keyur Shah, former VP of Finance at Polygon.
Core Mechanism: The XYZ=k Model
Traditional lending protocols require liquidity providers (LPs) to fund pools, allowing borrowers to over-collateralize loans. If collateral value drops below a threshold, it triggers a liquidation to compensate LPs. This model depends on oracles for price feeds, creating attack vectors.
Timeswap replaces this with a bonding curve model using the formula XYZ = k, where:
- X is the principal token amount (e.g., lent assets).
- Y is the interest earned per second.
- Z is the collateral token amount.
- k is a constant, similar to Uniswap’s invariant.
For example, to create a 6-month DAI-ETH lending pool with:
- 10,000 DAI initial principal
- 15% target annual percentage yield (APY)
- 167% collateralization ratio
- ETH priced at 4,000 DAI
We calculate:
- X = 10,000 DAI
- Y = 0.0000475 DAI per second (15% APY)
- Z = (10,000 × 1.67) / 4,000 = 4.175 ETH
- k = 10,000 × 0.0000475 × 4.175 ≈ 1.98
Once the pool is initialized, three user types interact:
- Lenders add loanable assets.
- Borrowers collateralize and borrow.
- LPs provide liquidity to earn from spreads.
Changes in supply, demand, or liquidity proportionally adjust X, Y, and Z while maintaining k. Timeswap mints ERC-20 and ERC-721 tokens to represent user positions, redeemable at maturity.
Role 1: The Lender
Lenders deposit assets and receive four tokens:
- Bond Principal Tokens (BPT): Represent share of the principal pool.
- Bond Interest Tokens (BIT): Represent share of the interest pool.
- Insurance Principal Tokens (IPT): Cover unrealized principal losses.
- Insurance Interest Tokens (IIT): Cover unrealized interest losses.
At maturity, lenders redeem these tokens for their principal plus interest, using insurance tokens if the pool is insufficient.
Role 2: The Borrower
Borrowers deposit collateral to take loans, receiving an ERC-721 Collateral Debt Token (CDT) detailing interest obligations and locked collateral. Repaying the loan before maturity burns the CDT and releases collateral; default transfers collateral to lenders.
Role 3: The Liquidity Provider
LPs deposit both principal and collateral assets, earning LP tokens representing their share of pool fees generated from lending-borrowing spreads.
👉 Explore advanced lending strategies
How Lending and Borrowing Affect Parameters
Users can customize rates and collateral ratios. For instance, lenders can lower yields for higher collateral coverage, and borrowers can increase collateral to reduce interest. Transactions finalize based on pool parameters at execution.
Lender Example:
In a DAI/ETH pool with:
- X=10,000, Y=0.0000475 (15% APY), Z=4.16, k=1.979
- A lender deposits 1,000 DAI one month before maturity, choosing 10% APY.
They receive:
- 1,000 BPT (principal share)
- ~8.19 BIT (interest share for 30 days)
- IPT and IIT tokens calculated from parameter shifts, providing insurance coverage.
Borrower Example:
A borrower seeking 1,000 DAI at 10% APY must collateralize ETH. Calculations based on parameter adjustments determine required collateral. For instance:
- Minimum collateral (at constant Y) is 0.469 ETH.
- Adjusted for 10% rate, z-change is 0.18, leading to total collateral of ~0.4829 ETH (over 190% collateralization).
Advantages and Challenges
Benefits:
- No Oracle Risks: Eliminates manipulation attacks.
- Permissionless Markets: Long-tail assets can list freely.
- No Liquidations: Avoids forced sales and associated penalties.
Risks:
- Market Volatility: If collateral value plummets at maturity, lenders may receive undervalued assets, incurring losses.
- Complexity: Understanding token mechanics and parameter interactions requires sophistication.
Timeswap’s separation of principal and interest tokens addresses prior testnet issues where high APR scenarios let later lenders drain pools, harming early participants. Insurance mechanisms now safeguard both principal and interest.
Frequently Asked Questions
What makes Timeswap different from Aave or Compound?
Timeswap uses an AMM model instead of oracle-dependent loans. It avoids liquidations entirely and allows users to set custom rates and collateral ratios, creating more flexible, permissionless markets.
How are interest rates determined?
Rates are set by the bonding curve formula XYZ=k. Users choose their desired rate when transacting, but the actual rate depends on pool parameters at that time.
Is my principal safe as a lender?
While Timeswap includes insurance tokens to cover shortfalls, lenders could still face losses if collateral value drops significantly before maturity. It’s not risk-free but eliminates liquidation-related surprises.
Can I withdraw funds before maturity?
No, lending and borrowing positions are locked until the pool maturity date. This ensures parameter stability and calculates payouts accurately.
What assets are supported?
Currently, Timeswap runs on Polygon with major tokens like USDC and MATIC. The protocol aims to support any ERC-20 asset, enabling long-tail markets.
How do LPs earn yields?
LPs earn from the spread between lending and borrowing rates. Their returns come from fees generated by activity in the pool.
Conclusion
Timeswap represents a bold innovation in DeFi lending, replacing oracles and liquidations with a deterministic bonding curve. While it introduces new complexities and risks, its permissionless, attack-resistant design opens doors for underserved assets and strategies. As the protocol matures, it could evolve into a robust decentralized money market, offering a compelling alternative to traditional models.
The future of DeFi lies in experimentation and improvement, and Timeswap is a fascinating step forward. Users should approach with caution, understand the risks, and start with small positions to grasp the mechanics. 👉 Learn more about decentralized lending innovations