Xeon Protocol
  • 🪐Welcome to Xeon
    • Introduction
    • Challenges
    • Mission
    • Ecosystem
    • Products
  • ✨OTC Tools
    • Features
    • Equity Swaps
    • Call Options
    • Put Options
  • 💻How It Works
    • Use Cases
    • Quick Guide
    • What Happened
    • P/L Calculations
  • 🔓Staking NEON
    • How to Stake
    • Assignments
    • Rewards
  • 🌾Real Yield
    • Protocol Income
    • Yield Farming
    • Farming Pools
    • Native Hedge Liquidity
    • Native Loan Collateral
  • 👨‍🌾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
    • Blockchain Hedging
    • Neon Hedging Model
    • Traditional Costing Models
      • Binomial VS Monte Carlo
      • Binomial Model
      • Costing Example
      • Conclusion
    • Neon Costing Model
    • Writing Approach
    • 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
      • Page 1
Powered by GitBook
On this page

Was this helpful?

  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

Last updated 1 year ago

Was this helpful?

⚙️