> For the complete documentation index, see [llms.txt](https://dev.spectra.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.spectra.finance/technical-reference/contract-functions/yield-token.md).

# Yield Token

The YT ([Yield Token](/glossary.md#yield-token)) represents the yield that is accrued by an [IBT](/glossary.md#ibt) (Interest Bearing Token). It is created when an IBT or an underlying asset is deposited into a [PrincipalToken](/technical-reference/contract-functions/principal-token.md), and the interest bearing token is split into [PT](/glossary.md#principal-token) and [YT](/glossary.md#yield-token).

The YT can be traded with other users to hedge or speculate on yields. A user holding a YT can claim his yield by calling [`claimYield`](/technical-reference/contract-functions/principal-token.md#claimyield) or [`claimYieldInIBT`](/technical-reference/contract-functions/principal-token.md#claimyieldinibt) on the Principal Token contract.

For more information, see [Tokenising Yield](/guides/tokenizing-yield.md).

YT.sol code can be found on [GitHub](https://github.com/perspectivefi/spectra-core/blob/main/src/tokens/YieldToken.sol).

## Methods

### transfer

```solidity
function transfer(
    address to,
    uint256 value
) public returns (bool success)
```

Standard ERC20 `transfer` function with a pre-transfer yield update.

<table><thead><tr><th width="190.33333333333331">Input Parameter</th><th width="115">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>to</code></td><td>address</td><td>The address to send the YT <code>to</code></td></tr><tr><td><code>value</code></td><td>uint256</td><td>The amount of the YT to send</td></tr></tbody></table>

<table><thead><tr><th width="189.33333333333331">Return Parameter</th><th width="121">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td>bool</td><td>A boolean value indicating whether the transfer was successful</td></tr></tbody></table>

### transferFrom

```solidity
function transferFrom(
    address from,
    address to,
    uint256 value
) public returns (bool success)
```

Standard ERC20 `transfer` function with a pre-transfer yield update.&#x20;

{% hint style="warning" %}
`from` must have previously approved `msg.sender` to transfer `value` using the standard ERC20 approval process.
{% endhint %}

<table><thead><tr><th width="190.33333333333331">Input Parameter</th><th width="115">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>from</code></td><td>address</td><td>The address to send the YT <code>from</code></td></tr><tr><td><code>to</code></td><td>address</td><td>The address to send the YT <code>to</code></td></tr><tr><td><code>value</code></td><td>uint256</td><td>The amount of the YT to send</td></tr></tbody></table>

<table><thead><tr><th width="189.33333333333331">Return Parameter</th><th width="121">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>success</code></td><td>bool</td><td>A boolean value indicating whether the transfer was successful</td></tr></tbody></table>

## View Methods

### getPT

```solidity
function getPT() public view returns (address)
```

Get the [Principal Token](/technical-reference/contract-functions/principal-token.md) associated with the yield token.

### decimals

```solidity
function decimals() public view returns (uint8)
```

Returns the number of decimals of the YT (same as the PrincipalToken's decimals). See [`decimals()`](/technical-reference/contract-functions/principal-token.md#decimals)

### balanceOf

```solidity
function balanceOf(address account) public view returns (uint256)
```

Returns the  balance of YT before[ expiry of the principal token](/technical-reference/contract-functions/principal-token.md#maturity) and return 0 after the expiry of the principal token.&#x20;

### actualBalanceOf

```solidity
function actualBalanceOf(address account) public view returns (uint256)
```

Returns the real balance of YT as defined in the balanceOf from ERC20 standard&#x20;

i.e the sum of incoming YT to the `account` minus the outgoing balance of YT tokens.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dev.spectra.finance/technical-reference/contract-functions/yield-token.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
