EIPs Explained

ERC-5095 · Stagnant · ERC · 2022-05-01

ERC-5095: Principal Token

A standard ERC-20 interface for principal (zero-coupon) tokens that become redeemable for a fixed amount of an underlying token at a maturity timestamp, so fixed-rate DeFi products can be integrated uniformly.

What problem does it solve?

Fixed-rate lending markets and yield-tokenization protocols split a yield-bearing position into "principal" and "yield" parts. The principal part behaves like a zero-coupon bond: buy it at a discount today, redeem it for the underlying token at maturity. Each protocol shaped these tokens differently, so wallets, AMMs and aggregators needed a custom adapter per protocol.

ERC-5095 defines one interface for such Principal Tokens (PTs), closely modeled on the ERC-4626 vault API.

How it works

A PT is an ERC-20 token (with metadata; ERC-2612 permit optional) plus:

Function Purpose
underlying() The ERC-20 token PTs redeem into
maturity() Unix timestamp at or after which PTs are redeemable
convertToUnderlying(pt) / convertToPrincipal(u) Ideal, fee-free conversion as if at maturity; rounds down
maxRedeem(holder) / previewRedeem(pt) / redeem(...) Burn an exact PT amount for underlying
maxWithdraw(holder) / previewWithdraw(u) / withdraw(...) Receive an exact underlying amount, burning what is needed

A Redeem(from, to, amount) event must be emitted on redemption. There is no deposit or mint function: how PTs are created is protocol-specific, which is why the authors did not simply extend ERC-4626.

Maturity has no event, since nothing on-chain fires exactly at a timestamp. Integrators should compare block.timestamp with maturity() or watch for the first Redeem.

Sample code

Redeeming matured PTs with ethers v6 (argument order follows the spec's interface, see "Things to know"):

import { Contract, Wallet, JsonRpcProvider } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const wallet = new Wallet(process.env.PRIVATE_KEY!, provider);

const pt = new Contract(process.env.PT!, [
  "function maturity() view returns (uint256)",
  "function underlying() view returns (address)",
  "function maxRedeem(address) view returns (uint256)",
  "function previewRedeem(uint256) view returns (uint256)",
  "function redeem(uint256 principalAmount, address to, address from) returns (uint256)",
], wallet);

const now = BigInt((await provider.getBlock("latest"))!.timestamp);
if (now < (await pt.maturity())) throw new Error("not matured yet");

const amount = await pt.maxRedeem(wallet.address);
console.log("will receive:", await pt.previewRedeem(amount));
await (await pt.redeem(amount, wallet.address, wallet.address)).wait();

Pricing intuition: if a PT for 1 unit of underlying trades at 0.95 with one year to maturity, the implied fixed yield is about 1 / 0.95 - 1, roughly 5.3%.

Things to know

  • Status is Stagnant: the proposal is not progressing toward finalization.
  • The spec's interface lists redeem(principalAmount, to, from), while its reference implementation uses redeem(principalAmount, from, to). With both arguments as addresses, a mismatch compiles fine and silently swaps them; check the actual contract ABI.
  • previewRedeem/previewWithdraw include fees; convertTo* are display estimates only. In the reference implementation the preview functions revert before maturity.
  • PTs should mirror the underlying's decimals.
  • Review each implementation: a token can match the interface yet not actually custody the underlying.
  • ERC-5115 (Draft) covers standardized yield (SY) tokens, a related building block in yield tokenization.

#defi #fixed-rate #zero-coupon #token #yield

Details

Authors
Julian Traversa (@JTraversa), Robert Robbins (@robrobbins), Alberto Cuesta Cañada (@alcueca)
Status
Stagnant
Type
Standards Track / ERC
Created
2022-05-01
Requires

Machine-readable: Markdown · JSON