Reya
  • Start Here
    • Why Reya?
  • REYA PRODUCTS
    • Reya DEX
      • Navigating Reya DEX
        • Dashboard: getting started
          • Creating your margin account
          • Moving funds
          • Checking your account
        • The Trading Screen
          • Trade form
          • Market Data Panel
        • LP Pool
      • Trading on Reya DEX
        • Perpetual Futures
        • Margin
        • Auto-exchange and Liquidations
        • Specifications
        • Conditional Orders
        • FlashSwap
        • Collateral liquidations
        • Settlement and cross-collateralization
      • Docs: Reya DEX REST API
      • Docs: Reya DEX WebSocket
    • Reya Network
      • The structure of Reya Network
      • The Liquidity Layer
        • Reya’s pool for perpetual futures
        • Offering liquidity in the passive pool
        • Deepdive into passive perps
        • Network Owned Liquidity
      • Derivatives Clearing
        • Automatic leveraging of PnL across instruments
        • Cross-collateralization
          • Haircuts
          • Auto-exchange conditions
          • Auto-exchange mechanism
        • Cross-margining
          • The margin system
        • The liquidation engine
          • Ranked liquidations
          • Dutch auction
          • Backstop LPs
          • Insurance Funds
          • Page 1
        • Spot markets
        • Reya Governance
      • What's the roadmap
      • Who's Behind Reya Network
    • rUSD / srUSD
      • rUSD
      • srUSD
      • srUSD How to and FAQs
  • COMMUNITY
    • Join the Reya Community
    • Incentives Overview
      • Experience (XP)
        • Technical details
      • Boosts
      • Ranks and Seasons
    • x.com
  • Technical Docs
    • Reya Python SDK
    • Contract Functions
      • Core
      • Passive Perp Instrument
      • Passive Pool
      • Oracle Adapter
    • Contract Addresses
    • Smart Contract Withdrawals
    • Audits
  • REYA RESOURCES
    • Blog
    • Beginner's Guide to Better Trading with Reya
    • Block Explorer
    • Glossary (coming soon)
    • FAQ (coming soon)
Powered by GitBook
On this page
  1. REYA PRODUCTS
  2. Reya Network
  3. Derivatives Clearing
  4. Cross-collateralization

Auto-exchange mechanism

PreviousAuto-exchange conditionsNextCross-margining

When one of the auto-excange conditions is breached, the system will forcefully convert other tokens into T by relying in external ‘auto-exchangers’ who receive a discount over market price as incentive. The amounts available will take into account both the amounts in the T-bubble, as well as those that can be moved from other bubbles.

The amount of collateral mmm of token SSS the auto-exchanger receives in exchange is computed as

(1−discountS/T)XS/T×m=n(1-\mathrm{discount}_{S/T})X_{S/T}\times m=n(1−discountS/T​)XS/T​×m=n

where both discountS/T\mathrm{discount}_{S/T}discountS/T​ and XS/TX_{S/T}XS/T​ will generally be a compound term, computed as products/quotients of the official pool discounts and exchange rates (one needs to trace the S→T path on the directed graph).

The following diagram illustrates the general flow.