ERC-5095 Principal token standard (Principal Token)

Stagnant · Vaults & DeFi · created 2022-05-01

A principal token is a token that can be exchanged for an underlying EIP-20 asset at a fixed future point in time (maturity). This standard unifies redemption mechanisms that previously varied across issuance protocols, so wallets and apps can handle them through a single interface.

Why it is needed

Because no standard existed for principal tokens, implementations varied across protocols. Representative examples include yield tokenization platforms, which strip off yield and leave only principal, and fixed-rate money markets that use principal tokens as the medium for lending and borrowing. Each had different function names and behavior, making integration at the application and wallet layers difficult. As a result, developers had to build a separate adapter for each principal token, and often separate adapters for the pool contract the token belonged to and for custody contracts as well, wasting significant development resources.

What to implement

In depth

Baseline requirements: EIP-20 and metadata

Every principal token must implement EIP-20, and balanceOf, transfer, totalSupply, and similar functions operate on the balance of the principal token itself. A non-transferable principal token may revert on transfer and transferFrom. It must also implement EIP-20's optional metadata extension (name, symbol), and these name and symbol values SHOULD somehow reflect the underlying asset's name and symbol, the issuing protocol, and, for yield tokenization, the source money market. EIP-2612 MAY be implemented optionally to improve signature-based approval UX.

underlying and maturity

The underlying function must return the address of the underlying EIP-20 token being redeemed for, and it must be an EIP-20 contract. The maturity function returns the Unix timestamp at which the principal token becomes redeemable. Neither function must ever revert (MUST NOT revert).

convertToUnderlying / convertToPrincipal

convertToUnderlying calculates the amount of underlying asset a given amount of principal tokens would be exchanged for under ideal conditions, while convertToPrincipal calculates, conversely, the amount of principal tokens needed to receive a given amount of underlying asset. Neither function may include fees (MUST NOT be inclusive of fees), neither varies by caller, and neither reflects actual exchange-time slippage or on-chain conditions. Except for overflow from abnormally large inputs, neither should revert, and results are always rounded down to zero. Even before maturity, they must calculate as if it were maturity, and the value represents the price an average user would expect, not any individual user.

maxRedeem / maxWithdraw

maxRedeem returns the maximum amount of principal tokens a holder can redeem via redeem, and maxWithdraw returns the maximum amount of underlying asset a holder can withdraw via withdraw. Both must reflect global limits as well as per-user limits, and must return 0 if redemption is fully and even temporarily suspended. If a revert would occur, they must return an underestimate of the actual maximum allowed, and neither function may ever revert.

previewRedeem / previewWithdraw

previewRedeem must return a value equal to or no greater than the amount of underlying asset that would be received if redeem were called in the same transaction, and previewWithdraw must return a value equal to or no less than the amount of principal tokens that would be burned by withdraw. Both functions ignore the limits represented by maxRedeem and maxWithdraw and always calculate assuming redemption succeeds, and both must include fees. They must not revert due to contract-specific limits, but may revert for other conditions that would actually cause redeem or withdraw to revert. Any unfavorable discrepancy between convertToUnderlying (or convertToPrincipal) and previewRedeem (or previewWithdraw) must be treated as slippage.

redeem / withdraw

redeem burns principalAmount of principal tokens from from after maturity and transfers the corresponding underlyingAmount to to, while withdraw conversely burns the principalAmount needed to receive exactly underlyingAmount from holder and transfers it to receiver. Both functions must emit a Redeem event, and both must support the redemption flow whether holder (or from) is msg.sender or msg.sender is an address approved via EIP-20. If the full requested amount cannot be redeemed (limit reached, slippage, insufficient balance, etc.), the function must revert. Interfaces or other contracts must not assume that the principal token contract itself holds the funds in custody, and some implementations may require a separate pre-request step before redemption.

Redeem event

The Redeem event indicates that from exchanged principalAmount of principal tokens for underlyingAmount of underlying asset and transferred it to to, and it must be emitted every time principal tokens are burned and underlying assets are withdrawn during redeem and withdraw. There is no separate event announcing maturity, since maturity arrives at a specific moment but there may be no activity at that exact time, making a precise maturity-notification event inefficient. Instead, integrators are encouraged to watch for the first Redeem event or track the maturity time themselves.

Design background and current status

This standard draws heavily on the design of EIP-4626 (the yield-bearing vault standard), but does not extend EIP-4626 directly, so as to avoid forcing principal tokens to implement unnecessary methods like mint or deposit. underlying and the core redemption logic depend directly on EIP-20, and detailed accounting and underlying-asset management are intentionally left unspecified by the standard, on the premise that principal tokens should be treated as a black box on-chain and inspected off-chain before use. This proposal is currently Stagnant, meaning it has stalled and is not progressing further.

Things to watch out for

Original ERC · ← ERCs