Spectra Developer Docs
  • Developers Documentation
  • Getting Started
  • Guides
    • Tokenizing Yield
    • Providing Liquidity
    • Deploy PT and Curve Pool
    • Routing
    • IBT Additional Rewards
    • Locking APW for veAPW
    • Voting and Earning Rewards
  • Technical Reference
    • Deployed Contracts
    • Contract Functions
      • Principal Token
      • Yield Token
      • Registry
      • RateOracle
      • Factory
      • Access Manager
      • RouterUtil
      • Router
      • GovernanceRegistry
      • Voter
      • VotingReward
        • BribeVotingReward
        • FeesVotingReward
      • FeeDistributor
      • Spectra4626Wrapper
    • Yield Calculations
    • Spectra's Automated Market Makers
      • Rate Adjusted StableSwap pools
  • Glossary
  • INTEGRATION REFERENCE
    • Spectra Oracles
      • TWAP Oracles
      • Deterministic Oracles
        • Linear APR model
        • Linear Discount Model
        • Zero Coupon Bond Model
        • Comparison
      • Oracle Deployment
        • Deterministic Oracles Deployment
        • TWAP Oracles Deployment
Powered by GitBook
On this page
  • Methods
  • transfer
  • transferFrom
  • View Methods
  • getPT
  • decimals
  • balanceOf
  • actualBalanceOf
  1. Technical Reference
  2. Contract Functions

Yield Token

PreviousPrincipal TokenNextRegistry

Last updated 11 months ago

The YT () represents the yield that is accrued by an (Interest Bearing Token). It is created when an IBT or an underlying asset is deposited into a , and the interest bearing token is split into and .

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 or on the Principal Token contract.

For more information, see .

YT.sol code can be found on .

Methods

transfer

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

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

Input Parameter
Type
Description

to

address

The address to send the YT to

value

uint256

The amount of the YT to send

Return Parameter
Type
Description

success

bool

A boolean value indicating whether the transfer was successful

transferFrom

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

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

from must have previously approved msg.sender to transfer value using the standard ERC20 approval process.

Input Parameter
Type
Description

from

address

The address to send the YT from

to

address

The address to send the YT to

value

uint256

The amount of the YT to send

Return Parameter
Type
Description

success

bool

A boolean value indicating whether the transfer was successful

View Methods

getPT

function getPT() public view returns (address)

decimals

function decimals() public view returns (uint8)

balanceOf

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

actualBalanceOf

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

Returns the real balance of YT as defined in the balanceOf from ERC20 standard

i.e the sum of incoming YT to the account minus the outgoing balance of YT tokens.

Get the associated with the yield token.

Returns the number of decimals of the YT (same as the PrincipalToken's decimals). See

Returns the balance of YT before and return 0 after the expiry of the principal token.

Principal Token
PrincipalToken
Tokenising Yield
GitHub
Yield Token
IBT
PT
YT
claimYield
claimYieldInIBT
decimals()
expiry of the principal token