Tarot Deep Dive: Part One

We explore the core protocol mechanics which power leveraged yield farming.

The seer, curious about the mechanisms which drive this world, uncovers hidden truths at its core.

Tarot is a decentralized lending protocol for liquidity provider (LPs) to leverage their LP tokens for enhanced yield farming and staking rewards.

In this post, we’ll discuss the core mechanics of the Tarot Protocol. This includes lending pools, collateralization and liquidation mechanics, and the factory contracts that create new permissionless markets.

Core Contracts

The core contracts of the Tarot Protocol consist of the Factory and Deployers for lending pools’ constituent parts, Borrowables and Collateral. Anyone can create a new lending pool via the Factory in a permissionless manner. All lending pools are isolated. If a borrower is liquidated in one lending pool, other lending pools are not affected. Users may choose to borrow or lend in any lending pool.

In practice, the lending pools for highly liquid and stable token pairs, and token pairs with attractive yields, will be the most popular. A particular token may be borrowable in multiple lending pools, at different rates for each pool.

Lending Pools

Each lending pool is associated with a token pair. A lending pool consists of three (3) parts:

  • Borrowable0 — An interest-bearing contract for the first token (token0) in the token pair
  • Borrowable1 — An interest-bearing contract for the second token (token1) in the token pair
  • Collateral — A collateral contract for the LP token of the token pair

Lenders can deposit either token (token0 or token1) into its associated Borrowable contract for that token. In exchange, they receive an interest-bearing token, bTAROT, representing the underlying token with accrued interest. Later, they can exchange their interest-bearing token for the original token, with accrued interest, provided there is sufficient liquidity in the Borrowable for that token.

Borrowers can deposit the LP token for the token pair as collateral into the Collateral contract. With this collateral, a borrower can create a loan, which requires a certain amount of the underlying tokens, provided there is sufficient liquidity in both Borrowables to create the loan.

To enable leveraged yield farming, the Tarot Protocol uses tokens from Borrowable0 and Borrowable1 to add liquidity to the DEX for the token pair, adds the resulting LP tokens to the Collateral for the token pair, and sends the borrower cTAROT tokens, which represent the borrower’s initial collateral and borrowed LP tokens.

If, at any time, the collateral value for a borrower’s loan is less than the minimum collateral required, the loan can be liquidated. Anyone can liquidate a loan in a liquidatable state in a permissionless manner. The liquidator repays the loan and receives, in exchange, the value of the borrowed LP tokens multiplied by the liquidation incentive. This ensures the stability of the protocol.

Flash Borrowing

The Tarot Protocol optimistically sends the tokens when a borrower requires a loan, or when a liquidator attempts to liquidate a loan, in an atomic transaction.

As an example, consider the following transaction to create a 5X leveraged yield farming position:

  1. A borrower deposits 100 LP tokens as Collateral.
  2. Tarot optimistically sends both tokens in the token pair to the borrower in a loan. The loan is equivalent in value to 400 LP tokens.
  3. Tarot executes a callback contract to add these tokens as liquidity to the DEX for the token pair, and receives 400 LP tokens, which are deposited as Collateral. Now, all 500 LP tokens are deposited as collateral in the Tarot Protocol to back the loan.
  4. After the callback completes, Tarot checks that either the loan is repaid or there is sufficient collateral to back the loan. If the loan is not repaid and there is insufficient collateral for the loan, the entire transaction reverts.

At the end of this transaction, the borrower has a 5X leveraged yield farming position in LP tokens.

Future deep dives will cover the pricing of LP tokens, flash liquidation mechanics, and a powerful new DeFi construct: the leveraged yield farming vault.

Stay tuned for more details:

--

--

--

Tarot is a decentralized lending protocol on Fantom Opera.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

BoringDAO isn’t that boring

Russia Vs. Ukraine War, The Biggest Test For The Decentralized Finance Industry

Like Wollito on Facebook

[EVENT] The Exciting $50,000 CSO Swap & Burn Opportunity Is Here

RoboFi. RoboFi is a defi platform that envision a marketplace for revolutionary DAO crypto trading…

GamyFi (GFX) is the Native token of the GamyFi platform used to Reward the users and use the…

Coin of the Week #37; Stakenet (XSN) on Altcoin Magazine

Reviewing my 2017 predictions

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tarot

Tarot

Tarot is a decentralized lending protocol on Fantom Opera.

More from Medium

Defrost Finance to Use Chainlink Price Feeds for Collateral Valuation

Introducing TOR: The Stablecoin of Hector Finance + Information for Beta Testers

Tarot DAO: Governance Guide

Hundred Finance Integrates with FujiDAO