1. Official links
  2. Repos overview
  1. Definitions
Term Description
Underlying Base asset (e.g., DAI, USDC, ETH, RAI...)
Target Yield-bearing token of a yield source
Principal Token (PT) Token that represents the principal amount of the Target. In traditional finance, it is equivalent to zero-coupon bond.
Yield Token (YT) Token that represents accrued yield and future yield.
Adapter Module for Tranche to interact with external protocols. (e.g. Lido, Swell, Renzo, etc.)
  1. Protocol overview

    https://github.com/sherlock-audit/2024-05-napier-update/blob/main/napier-v1/docs/SPECIFICATION.md

    Why Principal Tokens should be traded on Twocrypto metapool?

  2. SC overview

    1. Principal Token (PT): A token that represents the principal amount of a yield-bearing asset. It is a token that is pegged to the value of the underlying asset. For example, if the underlying asset is WETH and the yield-bearing asset is stETH, Napier will issue stETH-PT (maturity-3 November 2024), which will be traded with discount against WETH and as the maturity date approaches, the discount will decrease and the price will converge to 1 WETH.
    2. 3LST-PT TriCrypto: A Curve TriCrypto-NG pool containing stETH-PTrETH-PT and sfrxETH-PT, which is used as base pool for a Napier pool and TwoCrypto pools.
    3. 3LST NapierPool: A Napier pool that contains 3LST-PT TriCrypto LP Token and WETH. Technically, it's a lot like Pendle AMM, but it's more like a Metapool because it contains LP token as an asset.
    4. Principal Token Metapool (Twocrypto) : Curve TwoCrypto contract that allows users to deposit and withdraw principal tokens. Technically, it is a just a regular TwoCrypto but this pool assets are Napier Principal Token and TriCrypto LP Token.
    5. Metapool Router: The entry point for users. It is responsible for routing requests to the appropriate Metapool and zapping the assets into the Metapool. Those swaps are done through 3LST-PT TriCrypto3LST NapierPool and Principal Token. MetapoolRouter supports native ETH only as a underlying asset.
    6. Metapool Factory: A factory contract that allows owner to create new TwoCrypto contracts. It's just a wrapper around the permissionless TwoCryptoFactory contract but with some additional restrictions; assets must be Principal Token and TriCrypto LP Token, where these Underlying Tokens are WETH.
  3. UpgradeableAdapter

/// @custom:storage-location erc7201:napier.adapter.lst
struct LSTAdapterStorage {
    /// @notice Rebalancer of the ETH buffer, can be set by the owner
    /// @notice The account can request a withdrawal
    address rebalancer;
    /// @notice Desired buffer percentage in WAD
    uint256 targetBufferPercentage;
    /// @notice Tranche contract for restricting access to prefundedDeposit and prefundedRedeem
    address tranche;
    /// @notice Total of ETH pending withdrawal request
    uint128 totalQueueEth;
    /// @notice Amount of ETH available (Buffer), does not include pending withdrawal. Internal accounting of ETH
    uint128 bufferEth;
    /// @notice Mapping of the withdrawal request ID to the amount of ETH
    mapping(uint256 requestId => uint256 queueEth) queueWithdrawal;
    /// @notice Packed data for the stake limit state
    StakeLimitTypes.Uint256Data packedStakeLimitData;
}
  1. How Metapool works

overview.png

Untitled

  1. FAQ

    1. Add links to relevant protocol resources
    2. What’s Yield stripping?
    3. I got an error when building contracts.
      1. git clone --recurse-submodules [email protected]:sherlock-audit/2024-05-napier-update.gitAnd then run forge build on each dir. Please add --skip=test if you got an error because of too big contract. For testing, you have to set up python venv. For more details, please read README.

    FAQ: PT & Adapters

    1. What’s buffer in LSTAdapter?
      1. LST adapter is a vault that manage LST and ETH balance. Those vaults hold some WETH as a buffer which allows users to withdraw WETH without waiting. e.g. StETHAdapter StETHAdapter is a tokenized vault itself. Under the hood, it basically converts some deposited WETH into stETH and vice-versa, but redeeming stETH is not simple. Withdrawing ETH from Lido takes two steps; request and claim. To ensure that Napier's users can withdraw at any time, some of the WETH is left unconverted into stETH. This remaining WETH is referred to as a buffer.
    2. what is the scale thing in Adapter ?
      • scale is vault share price in terms of underlying asset. Tranche need to track scale values to compute how much yield is accrued by user

    FAQ: Metapool and Router

    1. The reason why MetapoolRouter doesn’t have method to swap YT for ETH.

       - We found it’s impossible to implement on the current version. Users can exit position after the maturity. These kinds of findings would be not valid.
      
    2. Adapter doesn’t allow users to redeem assets for ETH. It can be a valid finding?

      • No. It’s trade-off based on design decision.
    3. Why Balancer if flashloan is used for swapping ETH for YT?

      • Otherwise,swapETHForYT function is not efficient: Ideally users should swap 0.1 (small amount) ETH for 1 YT because YT is just a yield portion. But if router doesn’t use flashloan, users have to swap ETH more than it should. e.g. in theory 1 YT is worth 0.1 ETH but users have to swap 1 ETH and get 0.9 ETH refund at the end of txn. This is because NapierPool and Twocrypto don’t support flash swap.
    4. Adapter is NOT ERC4626 compliant.