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
  • Conditions:
  • topupHedge Function
  • rejectTopupRequest Function
  • cancelTopupRequest Function

Was this helpful?

Export as PDF
  1. Mechanics

Topup

Adjusting collateral requirements during the deal.

Once a deal is taken, both parties can send requests to each other in the form of a Topup request.

This is a request to add to the currently existing collateral. You can only add not remove collateral.

This feature is meant to give traders more freedom and control over their deal.

This is meant to increase your risk or profit exposure based on changing market sentiment.

Conditions:

  • Deal must be active and not expired or settled.

  • Requests are not limited.

  • One party sends a request first.

  • The other party has to accept request for it to be binding.

  • Collateral is then moved from both parties and locked in use.

  • For Call and Put Options, collateral is moved direct from Taker to Writer.

  • For Equity Swaps collateral is only locked in use, incrementing the value of the deal.

  • Once added the collateral cant be removed.

topupHedge Function

This function is unified to handle requests by both parties. It only accepts requests from taker or writer. It uses msg.sender to determine if party wants to increment topup request or initiate it.

It actively transfers token balances to lockedInUse on acceptance or request.

If a request is not accepted, the requester can increment the active request amount.

All requests are stored under the hedge struct, under the array hedge.topupRequests. It works alongside topupMap[topupRequestID].state as the global mapping that keeps track of the status of each request outside the hedge struct.

Depending on the party, after all the above are updated and msg.sender has enough balance in vault to proceed, we update topupMap[topupRequestID].amountWriter and topupMap[topupRequestID].amountTaker.

Finally, hedge.cost and hedge.amount are updated for the hedgeMap to reflect the new collateral amounts for the deal.

rejectTopupRequest Function

Rejecting and cancelling are handled outside of the topupHedge function. Using the functions:

rejectTopupRequest

cancelTopupRequest

Both which point to the same mapping topupMap used in request above.

Topup mapping is then updated to rejected or falsetopupMap[_requestID].state = 2; so the request disappears from the deal page.

cancelTopupRequest Function

A separate function to cancel the requests stored in the topupMap by request Id.

Only the creator of the request can cancel, on condition the request was not accepted already by the other party.

PreviousBuyNextZap

Last updated 11 months ago

Was this helpful?

⚙️