Skip to main content

Loan Token

Overview

Each Tenor market has its own unique Loan Token. A market's Loan Token is created during the market creation process and serves as a unique market identifier. Loan Tokens are ERC4626-compliant tokens that represent claims on the market's loan asset (e.g., USDC) in the Tenor protocol. Loan Tokens earn the reference Morpho market variable rate.

A market's loan token also serves as the redemption asset for Fixed Tokens at maturity. After maturity, any account can call the settle() method on a single Fixed Token to capture the exchange rate between 1 unit of the loan asset (e.g., USDC) and the value of Loan Tokens. The settlement exchange rate is then used to enable Fixed Token holders to redeem their Fixed Tokens for Loan Tokens at that rate.

The Loan Token contract enables Fixed Token holders to redeem their Fixed Tokens for Loan Tokens. During this settlement process, Fixed Tokens are burned and Loan Tokens are minted. Conversely, Fixed Debts can be settled converting the Fixed Debt into matured debts, and simultaneously burning Loan Tokens.

Loan Tokens also allow for setting a recipient for Morpho related incentives. Only the market's owner can set the recipient. Any external address can claim the incentives from the Morpho Universal Rewarder Contract to the benefit of the recipient.

Key Features

FeatureDescription
ERC4626 ComplianceImplements standard vault functionalities for deposit/withdrawal of underlying assets
Morpho InteractionsDeposits & redeems from the Morpho reference market
Rewards DistributionManages setting a recipient for the Morpho URD contract enabling the recipient to receive protocol rewards attributed to the reference Morpho market
Fixed Token CreationCreates Fixed Tokens (PTs) of different maturities
Fixed Tokens & Fixed Debts SettlementHandles settlement of Fixed Tokens and Fixed Debts after maturity

Core Functions

Vault Functions

As an ERC4626-compliant vault, Loan Tokens implement standard deposit, mint, withdraw, and redeem functions that handle the conversion between underlying assets (e.g., USDC) and shares (Loan Tokens).

Deposit and Mint

function deposit(uint256 assets, address receiver) external returns (uint256 shares)
function mint(uint256 shares, address receiver) external returns (uint256 assets)

These functions allow users to deposit underlying assets into the vault:

  • deposit: User specifies asset amount, receives corresponding shares
  • mint: User specifies share amount, deposits required assets
  • Both functions:
    • Transfer underlying assets from user to the Loan Token.
    • The Loan Token supplies the underlying assets to the Morpho reference market.
    • Mint corresponding Loan Token shares to receiver.

Withdraw and Redeem

function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares)
function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets)

These functions allow users to withdraw underlying assets from the vault:

  • withdraw: User specifies asset amount to receive
  • redeem: User specifies share amount (Loan Token amount) to burn
  • Both functions:
    • Burn the required Loan Token shares
    • Withdraw the corresponding amount of assets from the Morpho reference market
    • Transfer underlying assets to receiver Note that if the withdrawal is in excess of the available liquidity on the Morpho reference market, the method will revert.

Asset Conversion

function convertToShares(uint256 assets) external view returns (uint256 shares)
function convertToAssets(uint256 shares) external view returns (uint256 assets)

Helper functions for calculating conversions:

  • convertToShares: Calculate shares for given asset amount
  • convertToAssets: Calculate assets for given share amount
  • Rates based on:
    • Total assets supplied to Morpho
    • Current virtualMorphoSupplyShares
    • Any accumulated bad debt

Preview Functions

function previewDeposit(uint256 assets) external view returns (uint256 shares)
function previewMint(uint256 shares) external view returns (uint256 assets)
function previewWithdraw(uint256 assets) external view returns (uint256 shares)
function previewRedeem(uint256 shares) external view returns (uint256 assets)

Max Functions

function maxDeposit(address) external view returns (uint256 maxAssets)
function maxMint(address) external view returns (uint256 maxShares)
function maxWithdraw(address owner) external view returns (uint256 maxAssets)
function maxRedeem(address owner) external view returns (uint256 maxShares)

maxWithdraw and maxRedeem functions return the maximum possible amounts based on:

  • Available liquidity in Morpho
  • User's balance

Fixed Token Creation

function createFixedToken(Seconds maturity) external returns (IFixedToken fixedToken)
  • Creates a new Fixed Token instance for a specific maturity. Fixed Tokens are Principal Tokens (PTs) that can be converted to Loan Tokens at a certain redemption exchange rate at maturity.

Settlement Functions

Settle Fixed Tokens

function settleFixed(
IFixedToken fixedToken,
uint256 amount
) external returns (uint256 shares)
  • Snapshots the settlement exchange rate if not already snapshot
  • Converts matured Fixed Tokens into Loan Tokens at the settlement exchange rate
  • Fixed Tokens are burned and Loan Tokens are minted

During the settleFixed process the newly created Loan Tokens increase the Share amount but does not directly increase the asset amount. The protocol mints Loan Tokens without receiving assets from the minter. No deposits or redemptions on Morpho occur as part of the settlement of Fixed Tokens. In order for the Loan Token to asset exchange rate between to not change as a result of the settlement of Fixed Tokens the protocol increases the supplied assets (Morpho Shares) pro-rata using the current Loan Token to asset exchange rate.

The increase of Loan Tokens due to the settlement of Fixed Tokens means that if all Loan Token holders were to redeem their Loan Tokens for assets the redemptions would at some point revert due to the amount of Morpho Shares held by the contract being lower than the virtualMorphoSupplyShares variable held by the contract.

In order to increase the likelihood of redemptions occuring, the protocol tracks a sharesBackingExcess variable that is decreased by the number of Loan Token Shares settled. A negative sharesBackingExcess variable means that third party accounts can settle borrowers with matured debts back to Morpho in order increase the Morpho Shares backing of Loan Tokens.

Settle Debt

function settleDebt(
IFixedToken fixedToken,
address user,
uint256 maxDebtSettled,
uint256 maxRepaidShares
) external returns (
uint256 sharesRepaid,
uint256 debtSettled,
ExchangeRate settlementExchangeRate
)
  • Settles Fixed Debts for Loan Token Debts after maturity at the settlement exchange rate

The settlement of debts decreases the amount of Loan Tokens shares in circulation. This can cause the amount of Loan Tokens (shares) to decrease while the assets (Morpho Shares) are unchanged. In order to ensure that the Loan Token to asset exchange rate does not decrease, the protocol decreases the virtualMorphoSupplyShares. This means that the Loan Token contract holds more actual Morpho Shares than its internal tracking. The protocol increases the sharesBackingExcess by the amount of Loan Tokens burned during the settlement process. If the sharesBackingExcess of the Loan Token is positive, all Loan Token holders could redeem their Shares for assets (assuming the reference Morpho market is liquid). In a case where the sharesBackingExcess is positive, third party accounts can't settle borrowers with matured debts, because the Loan Token is already sufficiently liquid.

Rewards Management

function setRewardsRecipient(address rewardsRecipient) external;
  • The owner of the market can set the reward recipient address that will receive the rewards claimed from the Morpho Universal Reward Distributor contract.
function claimRewards(address token, uint256 amount) external
  • Claims rewards from the Morpho Universal Reward Distributor and sends the rewards to the rewards recipient

Bad debt accrual considerations

In order for the Loan Tokens Shares to asset exchange rate to be monotonic, the Loan Token tracks bad debt accrual in the reference Morpho money market. Via the internal _morphoSupplyPosition() method the Loan Token looks if the current amount of assets held by the Loan Token has decreased between the current timestamp and the last Loan Token action. If it decreased, the Loan Token with track the amount internally. This will counterbalance the effect of the bad debt accrual.

Virtual Shares Management

The Loan Token checks if the assets held by the vault are lower than the last time an action was performed. If the assets are lower, it means there was bad debt accrual on the Morpho reference market. The Loan Token tracks the bad debt accrual and compensates for it using the badDebtAssets variable. In doing so it ensures that the Loan Token exchange rate to the loan asset is monotonic over time. Therefore bad debt accrual on Morpho does not decrease the Loan Token's exchange rate.

Burning of Loan Token Shares on the first mint

The Loan Token is created during the market creation process. As part of the market initialization transaction, the initializer is required to pay a small amount of the asset currency to mint an initial amount of Loan Token Shares. These shares are then burned, mitigating the risk of an inflation attack.

Exchange Rate Behavior

The exchange rate between Loan Token shares and assets:

  • Starts at 1:1 on the initial deposit during market initialization
  • Increases as yield accumulates in Morpho
  • Is not affected due to bad debt accumulation on Morpho
  • Is not affected due to Fixed Token and Fixed Debt settlement