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
  • getUnderlyingValue
  • Functions that use this:
  • Conclusion

Was this helpful?

Export as PDF
  1. Mechanics

Underlying Value

Deriving the value of underlying tokens in their paired currency

PreviousgetPairAddressNextWrite

Last updated 1 year ago

Was this helpful?

This process is crucial for our protocol and is the core mechanism behind all our OTC tools.

All tokens deposited into our protocol have a underlying value derived. This refers to the process of determining the equivalent value of a particular ERC20 token in the paired currency.

The utility of deriving the underlying value of tokens can be found here:

getUnderlyingValue

This is the primary function of our protocol engine / core mechanisms.

The function accepts input of token address and amount, then returns the value (in paired currency) and the paired currency address to the caller.

It only measure the value of the ERC20 tokens being hedged, i.e. the underlying assets. The cost or premium is excluded from this.

Its depended on the following helper functions:

  • getPairAddressZK

  • IUniswapV2Pair

  • getReserves

  • token0() and token1()

Functions that use this:

  • writeHedge - used to derive createValue of the underlying tokens in the hedge.

  • buyHedge - used to derive the startValue of the underlying tokens in the hedge.

  • settleHedge - used to derive the endValue of the underlying tokens in the hedge, and to determine the payoff for each party in the hedge.

  • depositToken, withdrawToken - used to derive the paired value equivalent of each transfer.

  • getuserTokenBalances - used to retrieve the paired value for a specific balance of tokens held by a wallet on the protocol.

Conclusion

getUnderlyingValue function is the core function of our protocol engine. By embracing the fact that all ERC20 tokens have a measurable value in their paired currency, we open up the door to developing advanced OTC tools that are inclusive of all ERC20 tokens.

It enables Neon Protocol to build sound risk management and lending tools.

⚙️
Underlying ValueHow to value the underlying assets in a deal