Napier
WebsiteNapier InterfaceContributor Blog
  • Home
  • Introduction
  • Frequently Asked Question (FAQ)
  • Napier Protocol
    • Napier V1
    • Napier V2
      • Glossary - Napier v2
      • Yield Tokenization
        • Principal Token and Yield Token
        • Napier Factory
        • Market-Based Economics
        • Market-Based Governance
      • Trading Systems
      • Calculation
  • Points
    • Napier Point
    • Point Integration
    • Referral System
  • The NPR Token
  • Governance
    • Napier DAO
    • Napier Foundation
    • Napier Labs
    • Multisigs & Addresses
  • User Guide
    • User Dashboard
    • Mint and Redeem
    • Trade
    • Pool
    • Point
    • DeFi - Coming Soon
    • Calculator - Coming Soon
  • Curator Guide
    • Verify Your Account
    • Create a New Market
      • How to Choose a Resolver
    • Collect Curator Fee
    • Delegate Roles
    • Renounce All Roles
    • Transfer Full Ownership of a Market
    • Create a Pool Gauge
    • Integrate Your Market with a Point Program
    • Set up Reward Proxy
    • Add a Point Incentive
    • Monitor a Market
    • Emergency Pause a Market
    • Register DeFi Integrations - Coming Soon
    • Add a Token Incentive - Coming Soon
    • Educate Users - Coming Soon
    • Deploy a Lending System - Coming Soon
    • Deploy a Vault System - Coming Soon
  • Developer Guide
    • Deployment
  • Securing Napier
    • Technical Partners
      • How to Use HyperNative for Your Market Management
    • Bug Bounty
    • Risk Documentation
  • Education
    • User Education
    • Curator Education
  • Whitepaper
  • The Supreme Law of Napier
  • Marketing Policy
  • Napier Brand Guidelines
Powered by GitBook
On this page
  1. Curator Guide
  2. Create a New Market

How to Choose a Resolver

PreviousCreate a New MarketNextCollect Curator Fee

Last updated 1 month ago

This guide will help you select the appropriate resolver for your use case.

Glossary

  • underlying token: The token that generates yield, typically a vault or lending position. For example, for Yearn v3 USDC vault, the underlying token is the Yearn vault token itself.

  • asset: The base token that the underlying token's value and yield are measured in. For example, for Yearn v3 USDC vault, the asset is USDC. The asset is what users deposit into and withdraw from the underlying token.

  • vault: The ERC20-compliant token that represents ownership of the underlying token. For ERC4626 vaults, this is the vault token itself. The vault token's balance represents the user's share of the total underlying assets.

  • resolver: A contract that fetches the exchange rate between vault shares and assets. The resolver determines how many asset tokens (e.g. USDC) one vault share is worth, accounting for any accumulated yield.

Simple Flowchart

You need to select a resolver based on the type of underlying token.

Important: This flowchart is a simplified guide. For each resolver, you need to verify the function signatures and return types match the specifications expected by the resolver.

Resolver Selection Guide in Simple Terms

  1. For Rebasing Tokens: If the underlying token automatically changes balances in wallets (rebasing), we don't natively support it.

  2. For Standard Vault (ERC4626): If the underlying token follows the standard ERC4626 standard, use ERC4626Resolver.

  3. For Tokens with Conversion Functions: If the underlying token has a function that tells you how many base assets you get for a certain amount of tokens, use CustomConversionResolver. The function must follow the spec of convertToAssets(uint256 shares) -> uint256 assets in ERC4626 except for the function name.

  4. For Tokens with Share Price Functions: If the underlying token has a function that tells you the conversion rate of how many assets is 1 share of the vault worth, use SharePriceResolver. The function signature must be like assetsPerShare() -> uint256 assets.

  5. For Tokens with External Price Sources: If the underlying token contract doesn't have any of the above, but there is a price oracle against the asset, ExternalPriceResolver may be used. For chainlink price feeds, ChainlinkPriceResolver is available out of the box.

  6. For Tokens with Constant Price: If the underlying token has a constant price, use ConstantPriceResolver.

  7. For Other Tokens: If the underlying token doesn't fit any of these categories, please contact us for support.

Caution: For ConstantPriceResolver, the conversion rate is constant. It means the underlying token doesn't generate any yield and the price doesn't take risk like depeg against asset into account.

Important: The conversion or price functions must return values with the correct decimal precision for proper conversion between the underlying token and the asset.

What Information You'll Need

Each resolver needs specific information:

  • ERC4626Resolver:

    • vault: The address of ERC4626 token. asset is automatically set as vault.asset() function result.

  • CustomConversionResolver:

    • vault: The ERC20 token address of your underlying token

    • asset: The ERC20 token address of the base asset (e.g., USDC for a USDC underlying token)

    • conversionFunctionSignature: The function signature of the function that converts shares to assets similar to convertToAssets() in ERC4626

      • Specification:

        • customConversionFn(uint256 shares) -> uint256 assets

        • shares is the number of shares to convert to assets

        • assets is the number of assets that one share is worth

  • SharePriceResolver:

    • vault: The ERC20 token address of your underlying token

    • asset: The ERC20 token address of the base asset

    • priceFunctionSignature: The function signature of the function that gives the price per share similar to convertToAssets(10 ** vault.decimals()) in ERC4626

      • Specification:

        • customPriceFn() -> uint256 assets

        • assets is the number of assets that one share is worth

  • ExternalPriceResolver:

    • vault: The ERC20 token address of your underlying token

    • asset: The ERC20 token address of the base asset

    • oracle: The address of the price oracle

    • priceFeedFunctionSignature: The function signature of the function on the oracle that provides the price

      • Specification:

        • priceFeedFn() -> uint256 assets

        • assets is the number of assets that one share is worth

  • ChainlinkPriceResolver:

    • vault: The ERC20 token address of your underlying token

    • asset: The ERC20 token address of the base asset

    • oracle: The address of Chainlink AggregatorV3Interface price oracle that returns vault price against asset

  • ConstantPriceResolver:

    • vault: The ERC20 token address of your underlying token

    • asset: The ERC20 token address of the base asset

Carefully verify all parameters before deployment. Vault share price or conversion rate function, or any oracle price feed are considered as trusted sources.

  • Resolver does not validate data freshness or staleness

  • Resolver cannot be upgraded or modified after deployment

  • Resolver assumes price/conversion functions always return valid, up-to-date values

  • The underlying functions must never revert.

  • The function signatures and return types must exactly match what the resolver expects

TIP: vault and asset must be ERC20 tokens. For example, even if the underlying token only accepts native token as deposit, asset must be canonical wrapped native token on the chain For example, WETH (0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2) for Native ETH on Ethereum

  • 0x4200000000000000000000000000000000000006 for WETH on Optimism

  • 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c for WBNB on BSC

  • 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270 for WMATIC on Polygon

  • 0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38 for WS_SONIC on Sonic

  • 0xFC00000000000000000000000000000000000006 for WFRXETH on Fraxtal

  • 0x5555555555555555555555555555555555555555 for WHYPE on HyperLiquid

  • 0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8 for WMNT on Mantle

  • 0x4200000000000000000000000000000000000006 for WETH on Base

  • 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1 for WETH on Arbitrum

  • 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7 for WAVAX on Avalanche