Allspark
  • šŸ‘‹Welcome to Allspark
  • šŸŒFundamental
    • Introduction
      • Blast Native Yield
      • Dapp
    • Omniyield Gateway
    • Glossary of Terms
      • Omniliquidity
      • Omniyield
  • šŸŽ®Joyful Perp Trade
    • Duel Trade
      • Backgroup And Story
      • Trading Mechanism
      • FAQ
      • How to Use
    • Mantissa Mode
      • Trading Mechanism
      • ALP-Mantissa
      • FAQ
    • Degen Mode
  • šŸ¦Omniyield Perpetual DEX
    • ALP Liquidity
      • Buy / Sell ALP
      • ALP Staking
      • ALP Pool Portfolio
      • Target Ratio and Fees
      • Other
        • Slippage
        • Price Impact
    • Margin System
      • Collateral Framework
      • Liquidations
      • Oracles
    • Liquidation
    • Tutorials
      • Stake
      • Trade
    • Risk Stratification
    • Referral Program
    • Terms
  • šŸ”„Omniyield Platform
    • Overview
    • Methodology
      • Solution For Omnistake
      • Solution For Omniwithdraw
    • Vaults
  • šŸŽ‡New Universe Campaign
    • New Universe (PHASE 1)
Powered by GitBook
On this page
  1. Omniyield Perpetual DEX
  2. Margin System

Collateral Framework

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

The following specifications are used in the margin system:

Framework Element
Specification

Account Balance (AB)

$USDB 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 Allspark 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

Last updated 1 year ago

šŸ¦