# Tokenizing Yield

As mentioned in [getting-started](https://dev.spectra.finance/getting-started "mention"), the fundamental concept of tokenizing yield means that the future yield generated is separated from the underlying principal asset. So if a yield of 3% is generated on 100 USDC after 1 year, the 3% yield (3 USDC) is the yield, and 100 USDC is the principal.

<figure><img src="https://3623833415-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcXt3S5lwK1ZdxfuW16Uj%2Fuploads%2FSdnmFYiad0mz3jVA74EM%2FAave%20aTokens.png?alt=media&#x26;token=520d47db-8b39-4f19-be53-5822ba19e3b0" alt=""><figcaption></figcaption></figure>

## Step by step

### 1. Find a PrincipalToken

Each Principal Token is associated to an [Interest Bearing Token (IBT)](https://dev.spectra.finance/glossary#ibt) and has a specific duration (a specific expiry date).&#x20;

* PTs are designed to operate with any ERC4626 Tokenized Vault token.&#x20;
* Each IBT is associated to an underlying. The underlying assets of the IBT are verified using [`ERC4626.asset()`](https://eips.ethereum.org/EIPS/eip-4626#asset)

{% hint style="info" %}
Available ERC4626 Vaults on the relevant network can be found at [https://erc4626.info](https://erc4626.info/). \
\
Additionally, new Principal Tokens for any Interest Bearing Token that complies with the ERC-4626 standard can be deployed without the need for special permissions, see[ how to deploy PT and LP Vault in a permisionless manner](https://dev.spectra.finance/guides/deploy-pt-and-curve-pool).
{% endhint %}

{% hint style="success" %}
**Explore the APY of any ERC4626 with Vision.**&#x20;

Make informed decisions and visit [vision.perspective.fi](https://vision.perspective.fi/) to gain access to the Vision API and dashboard, and to explore the historical interest rates of any ERC4626.
{% endhint %}

To find a relevant PrincipalToken:

* All Principal Tokens deployed using the [Factory](https://dev.spectra.finance/technical-reference/contract-functions/factory)  can be accessed through the  [Registry](https://dev.spectra.finance/technical-reference/contract-functions/registry). The number of tokens deployed is determined using  [`Registry.pTCount()`](https://dev.spectra.finance/technical-reference/contract-functions/registry#ptcount). The PT at each index from 0 to `ptCount` is retrievable using [`Registry.getPTAt()`](https://dev.spectra.finance/technical-reference/contract-functions/registry#getptat).
* The correctness of the address for the Interest Bearing Token (IBT) tokenized in the PT contract is ensured by using the  [`getIBT()`](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#getibt) method. , and the yield rate is ascertained either by visiting [https://vision.perspective.fi](https://vision.perspective.fi/) or by examining the conversion rate over the last few blocks using [`IBT.convertToAssets()`](https://eips.ethereum.org/EIPS/eip-4626#converttoassets).
* The maturity and duration of the PT are checked using [`PT.maturity()`](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#maturity).

### 2. Deposit

Deposit either the underlying asset (e.g. USDC) or an [Interest Bearing Token](https://dev.spectra.finance/glossary#ibt) of the underlying asset (e.g. aUSDC).

{% hint style="info" %}
The relevant allowance of the token must be approved for the associated PrincipalToken contract before depositing.
{% endhint %}

* If depositing the underlying asset, use PrincipalToken's [`deposit()`](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#deposit).
* If depositing the interesting bearing token, use [`depositIBT()`](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#depositwithibt).

### 3. Receive PT and YT

During the deposit, the depositor receives:

* **Principal Token (PT):** This represents the original amount deposited, i.e. the principal amount. This is also referred to as 'shares' of the PrincipalToken.
* **Yield Token (YT)**: Minted by the PrincipalToken contract, the Yield Tokens represents the generated yield from the deposited principal. YT holders can claim the yield generated by the corresponding deposited IBTs over time as they hold the token.

<figure><img src="https://3623833415-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcXt3S5lwK1ZdxfuW16Uj%2Fuploads%2FQNWbjpNymL5BYopIo16x%2Fchrome_KiSsKbf7lW.png?alt=media&#x26;token=bce733f7-7c97-4fc1-bae5-9da0d3bb7377" alt=""><figcaption><p>Depositing IBTs which are then split into Principal Tokens (PT) and Yield Tokens (YT).</p></figcaption></figure>

### 4. Before expiry

Before the expiry/maturity, a YT/PT holder can:

* Claim the yield generated by the YT, see [`claimYield()`](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#claimyield)&#x20;
* Trade or sell YT to hedge interest rate risks.&#x20;
* Trade or sell PT, speculating on interest rates without exposure to the principal asset.
* Earn additional yield by providing liquidity to the IBT-PT pairs on AMMs. See [Providing Liquidity](https://dev.spectra.finance/guides/providing-liquidity).
* Withdraw the equivalent assets in proportion to the amount of PT and YT they currently hold, i.e. convert their PT and YT to the underlying asset (e.g. USDC) and exit their position. See [`withdraw()`](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#withdraw) and [`redeem()`](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#redeem) .

{% hint style="info" %}
Before expiry a user needs the same amount of PT and YT to be able to[`withdraw()`](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#withdraw) or [`redeem()`](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#redeem).
{% endhint %}

### 5. After expiry

After expiry/maturity, the token holder could:

* Redeem the underlying assets of the PT, see [`redeem()`](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#redeem) and [`withdraw()`](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#withdraw)
* Claim the remaining yield of the YT see [claimYield()](https://dev.spectra.finance/technical-reference/contract-functions/principal-token#claimyield).

{% hint style="info" %}
The token holder after expiry does not need to be the same as the depositor. Both PT and YT are transferable tokens.

E.g. they could have purchased the PT at a discount and waited for expiry, earning a fixed yield since all PT are redeemable to the underlying asset at expiry.
{% endhint %}
