Chapter 3: WLPToken (Wrapped LP Token - ERC4626)

In Chapter 2: LPToken, we learned about the special LPToken you receive when you deposit assets into an SPA Pool. We saw that its balance automatically changes (rebases) as the pool earns fees.

While this rebasing feature accurately reflects your growing share of the pool, it can be tricky to handle for other parts of the decentralized finance (DeFi) world. Many DeFi protocols, like lending platforms or yield aggregators, are designed to work with standard tokens whose balances only change when explicitly transferred.

What Problem Does the WLPToken Solve?

Imagine you have that special LPToken certificate from Chapter 2. The certificate itself represents your share, but the underlying value of it keeps changing automatically. Now, suppose you want to deposit this certificate into a digital vault that only accepts standard-sized items and doesn’t understand these self-changing numbers. It gets confused!

The WLPToken (Wrapped LP Token) solves this problem. It acts like a standard-sized frame for your valuable, but unusually behaving, LPToken certificate.

What is a WLPToken?

WLPToken stands for Wrapped LP Token. It’s a different kind of token that “wraps” your original LPToken.

Here’s the core idea using our analogy:

  1. The Certificate: Your LPToken represents your share of the pool, and its value (balance) fluctuates.
  2. The Frame: The WLPToken contract acts like a vault or a frame maker.
  3. Framing: You deposit your LPToken certificate into the WLPToken contract (the vault).
  4. The Framed Picture: In return, the vault gives you a WLPToken. Think of this as a standard token representing the framed certificate.
  5. Fixed Quantity: The number of WLPToken frames you hold stays constant unless you send or receive them, just like a regular token.
  6. Value Still Changes: The value represented by each WLPToken frame still goes up (or down) based on the underlying LPToken certificate inside it. If the LPToken earns more fees, each WLPToken becomes worth more LPTokens.
  7. Standard Compliance (ERC4626): The WLPToken follows a popular standard called ERC4626. This standard defines a common way for “tokenized vaults” to work, making the WLPToken instantly compatible with many other DeFi protocols that understand this standard.

In simple terms: WLPToken turns your rebasing LPToken into a standard, non-rebasing token ( apparently) that holds the value of your LP position, making it easier to use elsewhere in DeFi.

How Do I Use It?

Let’s say you have some LPTokens from providing liquidity, but you want to use their value in another DeFi protocol that requires a standard ERC20 token. You’d use the WLPToken contract.

Use Case: Wrapping LPTokens to get WLPTokens.