Xeon Protocol Docs
  • Quick Links
  • Welcome to Xeon Protocol
    • Introduction
    • Proposition
    • TAM
    • Mission
  • Ecosystem
    • Overview
    • Products
    • Mindmap
    • Core Engineering
  • OTC Tools
    • Lending
    • Call Options
    • Put Options
    • Equity Swaps
    • USPs
  • How It Works
    • Use Cases
    • Scenarios
    • Quick Guide
    • DynamicPacts
    • P/L Calculations
  • Staking XEON
    • How to Stake
    • Assignments
    • Rewards
  • 🌾Real Yield
    • Protocol Income
    • Farming Pools
    • Native Hedge Liquidity
    • Native Loan Collateral
    • Yield Farming
  • 👨‍🌾EARN WITH US
    • How to Earn
    • Hedge Mining
  • ☄️Fees
    • Model
    • Cashier Fees
    • Settlement Fees
  • ⚡Costing and Valuation
    • Highlights
    • Value in Pair Currency
    • Underlying Value
  • 💸ERC20 Hedging
    • Traditional Hedging
    • Neon Hedging Model
    • Traditional Costing Models
      • Binomial VS Monte Carlo
      • Binomial Model
      • Costing Example
      • Conclusion
    • Neon Costing Model
    • Writing Approach
    • Deleting a Hedge
    • Settlement
  • 🪶ERC20 Lending
    • Crypto Lending
    • Neon Lending Model
    • Neon Valuation Model
    • Writing Approach
    • Settlement
  • ⚙️Mechanics
    • ERC20 Vault Model
    • ERC20 Deposit/Withdraw
    • getPairAddress
    • Underlying Value
    • Write
    • Buy
    • Topup
    • Zap
    • Settlement
    • Mining
    • LockedInUse
    • 🧑‍🚀Development
      • Dev Format
      • GitHub
      • Deployments
      • Testnet
      • Security Audits
  • Brand Policy
Powered by GitBook
LogoLogo

Xeon Protocol © 2024

On this page

Was this helpful?

Export as PDF
  1. Mechanics

getPairAddress

All ERC20 tokens on our protocol are valued in their DEX paired currency.

In order to properly value all ERC20 tokens, we need to get the correct pair address and pair address decimal.

Neon Protocol developed a core helper function to the getUnderlyingValue function which assists in fetching the pair address of any ERC20 token from DEX-es.

getPairAddressZK function accepts any ERC20 address and relies on the following Uniswap Protocol functions:

  • IUniswapV2Factory

  • getPair

To get the pair address of the provided token address.

Support for pair addresses is limited to only:

  • WETH

  • USDT

  • USDC

Providing any ERC20 token does not return a pair address matching the above pairs will result in the getPairAddressZK returning the error: "TokenValue: token is not paired with WETH, USDT, or USDC"

getPairAddressZK returns the pairAddress and pairedCurrency addresses, as a default redundant check.

PreviousERC20 Deposit/WithdrawNextUnderlying Value

Was this helpful?

⚙️