LogoLogo
  • šŸ‘‹Welcome to Zeta
  • The Zeta DEX
    • šŸ”—Official Links
    • šŸ“šLearn how to trade on Zeta
      • šŸŽ“Introduction to Perpetuals
      • šŸ’øCompatible Wallets
      • šŸ“–Getting Started on Zeta
      • āœ…Order Types
      • šŸ’ŸMargin Account Parameters
      • šŸ“‘Asset Parameters
      • āš–ļøFunding Rates
    • šŸ”§Trading Specifications
      • Fee Tiers
      • Delisting Process
    • šŸ—ļøExchange Architecture
      • Margin Accounts
      • Margin System
        • Collateral Framework
        • Liquidations & Insurance
          • Insurance Fund
          • Socialized Loss
      • Oracles
      • Orderbook & Matching Engine
      • Trigger orders
      • Trading Mechanism
      • Perpetual Funding System
    • šŸ“±Mobile is LIVE !
    • šŸŒ‰Bridging Guide
      • šŸ’±From Exchanges
      • ā›“ļøFrom Other Chains
  • Rewards Programs
    • šŸŖ™$ZEX
      • šŸŖ™Staking
        • Staking $ZEX: Step-by-Step Guide
    • šŸ’±Trading Rewards Program
      • Z-Score Active Boosts
        • šŸŽZ-Loot
      • 🄩Stakers' Boosted Trading Rewards
      • $BERA Listing (Live)
      • šŸ—ƒļøEnded Trading Campaigns and Boosts
        • 🪐Jupiter x Zeta (Finished)
        • 1ļøāƒ£Season 1 (Finished)
          • 1ļøāƒ£Z-Score Season 1
            • šŸ‘„NFT Community Partners
          • ⚔S1 Zeta Cards
        • 2ļøāƒ£Season 2 (Finished)
          • 2ļøāƒ£Z-Score Season 2
            • šŸ“Bitcoin Halving (Finished)
            • 🐶$WIF Listing (Finished)
            • šŸ”“$RNDR Listing (Finished)
            • ⬛$TNSR Listing (Finished)
            • šŸ”®Pyth Stakers (Finished)
            • 🟄Backpack Boost (Finished)
            • šŸAssetDash Elements (Finished)
          • ⚔S2 Zeta Cards (Finished)
          • šŸŽ‰Community Airdrop (Finished)
        • $POPCAT Listing (Finished)
        • šŸ‘ÆReferral Z-Score Boost (Finished)
        • $EIGEN Listing (Finished)
        • 🟔$DBR Listing (Finished)
        • 🟔$GOAT Listing (Finished)
        • 🟪$DRIFT Listing (Live)
        • 🟪$PNUT Listing (Finished)
        • $PENGU Listing (Finished)
        • $TRUMP Listing (Finished)
    • šŸ”’Final Epoch
    • 🚰Maker Rewards Program
    • šŸ‘Øā€šŸ‘©ā€šŸ‘¦ā€šŸ‘¦Referrals Program
      • Genesis Epoch Referral Boost (Finished)
      • Breakpoint Referral Boost
    • šŸ«‚Content & Community Programs
      • Creators Program
      • Community Referral Program
  • Build with Zeta
    • šŸ’½SDKs
      • šŸPython SDK
        • Market Making Bot
      • 🧱Typescript SDK
        • šŸ“šExamples
          • šŸ‘¶Basic example
          • āš™ļøCranking
          • 🌊Liquidator
          • šŸš…Subscription
          • šŸ“¬Versioned Transactions
    • 😓REST Data API
    • šŸ’„Program ABI
    • šŸŽØBrand Assets
      • šŸ“£Brand Book
      • šŸ“°Media Kit
      • šŸŽØLogo & Visual Guidelines
  • Zeta X
  • Zeta Node
    • 🌐Validator Details
  • Legal
    • Terms and Conditions
    • Staking Terms and Conditions
    • Privacy Policy
    • Location Restrictions
    • TradingView
    • Audit Reports
  • Educational Resources
    • šŸ†•New to Solana? Start Here!
    • šŸ†˜Support
Powered by GitBook
On this page

Was this helpful?

  1. The Zeta DEX
  2. Exchange Architecture
  3. Margin System

Collateral Framework

Zeta currently only accepts USDC as collateral. So users can only deposit and withdraw USDC from the system. All trades are settled and margined in USDC.

The following specifications are used in the margin system:

Framework Element
Specification

Account Balance (AB)

USDC deposited in account.

Changes on deposit, withdrawal, position close and settlement

Unrealized PnL (UP)

Profit and loss from existing open positions, including unpaid funding

Initial Margin (IM)

Margin level required to open new orders

Maintenance Margin (MM)

Margin level required to maintain positions before liquidation

When a user places an order that adds to their existing position the initial margin requirements are checked. This is done to ensure that opening the position will not push the user into a state of bankruptcy - if this condition is violated users will (1) not be able to place an order, and (2) their existing open orders will be cancelled trustlessly. (3) Liquidators, when taking over a position must also pass this check:

AB+UPāˆ’IM+min(0,IPnL)>0AB + UP - IM +min(0, IPnL) > 0AB+UPāˆ’IM+min(0,IPnL)>0

where:

  • AB = Account Balance

  • UP = Unrealized PnL

  • IM = Initial Margin x (Opening Orders + Positions)

  • IPnL = instantaneous PnL from execution

When a user places an order that closes an existing position the maintenance margin requirements (including open orders) are checked. This is done to ensure that the user has sufficient funds in their account to place an order and is not currently being liquidated.

AB+UPāˆ’MM(O)+min(0,IPnL)>0AB + UP - MM(O) +min(0, IPnL) > 0AB+UPāˆ’MM(O)+min(0,IPnL)>0

where:

  • AB = Account Balance

  • UP = Unrealized PnL

  • MM (including open orders) = Maintenance Margin x (Opening Orders + Positions)

  • IPnL = instantaneous PnL from execution

The margin system also monitors a user's existing positions and orders to ensure that the user does not enter a state of bankruptcy:

AB+UPāˆ’MM>0AB + UP - MM > 0AB+UPāˆ’MM>0

where:

  • AB = Account Balance

  • UP = Unrealized PnL

  • MM = Maintenance Margin x (Positions)

User withdrawals are also considered by the Zeta margin system ensuring that a withdrawal does not push a user into bankruptcy. As such withdrawals are limited to:

AB+min(0,UPnL)āˆ’IMAB + min(0, UPnL) - IMAB+min(0,UPnL)āˆ’IM

where:

  • UP = Unrealized PnL

  • IM = Initial Margin x (Opening Orders + Positions)

Orders that close a position are not charged margin.

PreviousMargin SystemNextLiquidations & Insurance

Last updated 1 year ago

Was this helpful?

šŸ—ļø