LogoLogo
  • Overview
    • Introduction
    • Table of Contents
  • Token Information
    • Symmio Foundation
  • Protocol Architecture
    • Protocol Introduction
    • Technical Documentation
      • Building an Application with SYMM
        • Introduction and Diamond Explainer
        • Querying Info from the SYMM Diamond
        • MultiAccount
        • Creating an Account and Depositing Funds
        • Sending a Quote
        • Closing a Quote
        • Instant Trading
          • Instant Login (EOA)
          • Instant Login (Account Abstraction)
          • Sending a Quote (Instant Open)
          • Sending a Quote (Instant Close)
        • Frequently Used Queries
      • Solver Docs
        • Solver Docs (github)
        • Solver Implementation Guide (High Level Overview)
        • Building a Solver on SYMMIO
          • 1. Intent Creation
          • 2. Seeing the Intent
          • 3. Hedging Off-Chain
          • 4. Opening/Closing a Position On-Chain
          • Creating the APIs
            • GET Contract Symbols
            • GET Open Interest
            • GET Notional Cap
            • GET Price Range
            • GET Error Codes
            • GET Get Locked Params
            • GET Get Funding Info
            • POST Position State
          • Solver Flow Summary Example
          • Recommended Architecture for Solvers
          • Glossary
        • Conditional Orders Handler
        • Rasa Solver TP/SL Implementation
        • Instant Trading
          • Instant Trading (Solvers)
          • Rasa Instant Trading Implementation
          • Instant Trading Condition Checks
        • Fetching Gas Prices Script
        • How to Add a Market as a Solver
        • Verifying Account Abstracted Instant Actions (ERC-4337)
      • Frontend Docs
        • Setting up a Frontend with SYMMIO
        • Frontend SDK Setup Guide
        • MultiAccount Deployment Guide
        • Instant Trading (Frontends)
          • Account Abstracted Instant Actions (Frontends)
        • Implement a Trading Bot on Symmio (OLD)
          • Setup
          • Creating a Sub-Account
          • Minting Collateral Tokens (Optional)
          • Depositing and Allocating Tokens
          • Obtaining Muon Signatures
          • Sending a Quote
          • Monitoring Price for Execution
      • Contract Docs
        • SYMMIO CORE v0.82
        • Contracts Documentation 0.8.2
          • Main Flow
          • The SYMM Diamond
          • Facets
            • Account Facet
            • Control Facet
            • Funding Rate Facet
            • PartyA Facet
            • PartyB Facet
            • Liquidation Facet
            • View Facet
          • MultiAccount
            • PartyA
            • PartyB
          • SYMM App (Muon)
            • LibMuon
            • MuonStorage
        • Contracts Documentation 0.8.3
          • Facets
            • Control Facet
            • Account Facet
            • PartyA Facet
            • PartyB Facet
            • View Facet
            • Bridge Facet
            • Liquidation Facet (Implementation)
          • Modified Events
          • New Events
          • MuonStorage
        • Contracts Documentation 0.8.4
          • Main Flow (0.8.4)
          • The SYMM Diamond (0.8.4)
          • Facets
            • Account Facet (0.8.4)
            • Bridge Facet (0.8.4)
            • Control Facet (0.8.4)
            • Force Actions Facet (0.8.4)
            • Funding Rate Facet (0.8.4)
            • Liquidations Facet (0.8.4)
            • PartyA Facet (0.8.4)
            • PartyB Group Actions Facet (0.8.4)
            • PartyB Quote Actions Facet (0.8.4)
            • PartyB Position Actions Facet (0.8.4)
            • Settlement Facet (0.8.4)
            • View Facet (0.8.4)
          • MultiAccount (0.8.4)
            • SymmioPartyA
            • SymmioPartyB
          • SYMM App (Muon)
            • LibMuon (0.8.4)
            • MuonStorage (0.8.4)
      • Contract Addresses / Solver Endpoints
        • Mantle
        • Mode
        • IOTA
        • Base
        • BSC
        • Arbitrum
        • Polygon
        • Berachain
        • Solver Endpoints and Addresses
          • Perps Hub
          • Rasa Capital
          • Zenith
      • How to Query our Contracts
      • Muon API Queries
      • Solver Error Codes
      • Interacting with SYMMIO Contracts
    • Protocol higher level architecture
      • 12-Hour Fraud Proof Window
      • PartyB
      • Solver Settings
      • Max Leverage
      • Maintenance Margin (CVA) Calculations
    • Symmio Whitepaper
  • Building on Symmio
    • Builders introduction
    • Solving for Symmio
      • Solver documentation
      • Solver - Example Flow
    • Trading Fees
      • Perps - Settlement Costs
      • Pair Trading - Settlement costs
    • Exchanges (Frontends)
      • Frontend Introduction
      • SDK - SYMM client
      • Trade on Symmio
  • Legal & Brand & Security
    • Security (Audits / Bugbounty)
      • Bug bounty / Coverage
        • How to contact ?
      • Audits
        • SYMM - V0.8 - 0.81
          • Sherlock Audit - Jun 15, 2023
          • Smart State - Jul 2, 2023
        • SYMM - 0.82
          • Sherlock Audit -Aug 30, 2023
        • SYMM - 0.83
          • Sherlock Audit - Jun 17, 2024
        • SYMM - 0.84
          • Sherlock Audit - Oct 3, 2024
        • Vaults
          • Sherlock Audit - Jan 2, 2024
    • Terms of Service & Licensing
      • TRADEMARK & COPYRIGHT NOTICE
      • CONTACT US
      • TERMS OF SERVICE
      • FRONTEND LICENSE
        • Frontend Modifications
        • Frontend Use Grants
      • CONTRACT LICENSE
        • Contract Use Grants
        • Contract Modifications
    • Brand - Assets Logos
Powered by GitBook
LogoLogo

All rights to the people (c) 2023 Symmetry Labs A.G.

On this page
  • CVA and maxLeverage Formulas:
  • Example:
  • Integration with API endpoints
  • 2. Deriving cn (CVA/Notional Ratio)
  • 3. Calculating Maintenance Margin
  • 4. Calculating Max Leverage
  1. Protocol Architecture
  2. Protocol higher level architecture

Maintenance Margin (CVA) Calculations

Provided by Rasa Capital

CVA and Max Leverage:

Note: contract parameters — maintenance margin and maxLeverage — are set by Solvers based on their own risk assessment.

The Rasa Solver has the following (basic) settings.

1) logic is as follows

  • CVA is the overall maintenance margin ( in case of liquidation, part goes to liquidators as incentives, part to the non-liquidated party who they needs to unwind their positions )

  • CVA is a fixed proportion of initial notional:

cn = CVA/Notional=CVA/(deposit*leverage)

$CVA = cn * notional (with cn fixed per market)

cn depends on the volatility and risk of the coin.

  • When measured as a fraction of collateral, CVA increases with leverage:

cd = CVA/deposit = cn * leverage

  • In order to avoid excessive trader risk, leverage is capped so that maintenance margin (CVA) does not exceed 60% of deposit.

  • The initial CVA in dollar terms remains unchanged as long as the position in unchanged

2) parameters are as follows

  • cn=CVA/notional starts from just above to 1% (1.08% for BTC and ETH), is 1.3-1.5% for blue chips (most alt and layer 2 coins), 4%-5% for exotic coins (three very risky coins require even more margin)

  • maxLeverage (where cd=CVA/deposit = 60%) is 60x for ETH and BTC, 40-50x for alts and layer 2 (ARB, OP), and down to 20-25 for exotic coins (3 coins have lower leverage)

Overall, each Market has a different parameters depending on its volatility and risk, with max leverage falling as risk increases, see full list in Max Leverage.

CVA and maxLeverage Formulas:

maxLev= 60\%/ ($CVA/notional) = 60\%/ cn

maxLeverage is (expect for 3 coins) is in the 20-60 range

Example:

Consider a scenario where User A desires to engage in a trade with a leverage of buying a 10,000 USDT 60x BTC Long (the maximum leverage for BTC is set at 60x).

  1. Upon arrival, User A expresses an intent:

Tade Size: 10,000 USDT 
Leverage: 60x, 
Notional value: 600,000 USDT. 
Price: $34,676.1 per BTC, 
Size: 17.31 BTC.
  1. The frontend then responds with the Solvers required Maintenance Margin of:

CVA: 6499.84 USDT

The CVA (Credit Value Adjustment) for this trade is calculated as:

Should the unrealized profit and loss (uPnL) on his BTC position reach -$4000, User A will automatically be moved into the Liquidation Process by Liquidators. This example illustrates the interplay of leverage, CVA, and the liquidation threshold within the Rasa - Demo Solver environment facilitated through the SYMMIO frontend.

Integration with API endpoints

Endpoint Structure

GET /get_locked_params/{symbol}?leverage={leverage}

Example:

https://base-hedger82.rasa.capital/get_locked_params/BTCUSDT?leverage=60

The endpoint returns the following response:

{
  "cva": "40",       // CVA (% of deposit)
  "lf": "20",        // Liquidation Fee (% of deposit)
  "leverage": "60.0", // Allowed leverage
  "partyAmm": "40",  // Party A’s initial margin (% of deposit)
  "partyBmm": "0"    // Party B’s initial margin (0 for single-sided)
}

2. Deriving cn (CVA/Notional Ratio)

cn represents the total Maintenance Margin (CVA + LF) as a percentage of the notional value. The cn is ultimately defined by the solver. This should reflect the risk of the asset.

Formula

Example Calculation

Using the API response for BTCUSDT:

{
  "cva": "40",       // CVA (% of deposit)
  "lf": "20",        // Liquidation Fee (% of deposit)
  "leverage": "60.0", // Allowed leverage
  "partyAmm": "40",  // Party A’s initial margin (% of deposit)
  "partyBmm": "0"    // Party B’s initial margin (0 for single-sided)
}
  • cva = 40%, lf = 20%, leverage = 60x

  • Deposit = 100 USDT (for illustration).


3. Calculating Maintenance Margin

The Maintenance Margin can derived from cn and the notional value.

Formula

Example

  • Notional = Deposit × Leverage = 100USDT × 60 = 6,000 USDT

  • cn = 1% (from above).


4. Calculating Max Leverage

The maximum allowed leverage (maxLeverage) is determined by the CVA/Deposit cap (cd ≤ 60%) and cn.

With higher cn the maxLeverage must decrease proportionally

Formula

Example

For BTCUSDT with cn = 1%:

Example Scenarios:

Asset Type

cn

Max Leverage

BTC/ETH

1%

( 0.6 / 0.01 = 60x )

Blue-Chip Alts

1.5%

( 0.6 / 0.015 = 40x )

Exotic Coins

4%

( 0.6 / 0.04 = 15x )

Example for Rasa BTCUSDT:

{
      "price_precision": 1,
      "quantity_precision": 3,
      "name": "BTCUSDT",
      "symbol": "BTC",
      "asset": "USDT",
      "symbol_id": 1,
      "is_valid": true,
      "min_acceptable_quote_value": 120,
      "min_acceptable_portion_lf": "0.003000000000000000",
      "trading_fee": "0.000600000000000000",
      "max_leverage": 60,
      "max_notional_value": 2100000,
      "rfq_allowed": true,
      "hedger_fee_open": "0.0006",
      "hedger_fee_close": "0.0006",
      "max_funding_rate": "200",
      "min_notional_value": "100",
      "max_quantity": "1000",
      "lot_size": "0"
    },
PreviousMax LeverageNextSymmio Whitepaper

Last updated 24 days ago

User A navigates to the

Solver endpoints provide real-time parameters for collateral requirements via a REST API. See Rasa's endpoints .

cn=cva+lf100×leveragecn = \frac{\text{cva} + \text{lf}}{100 \times \text{leverage}}cn=100×leveragecva+lf​
cn=40+20100×60=606,000=0.01cn = \frac{40 + 20}{100 \times 60} = \frac{60}{6,000} = 0.01cn=100×6040+20​=6,00060​=0.01
Maintenance Margin=cn×Notional\text{Maintenance Margin} = cn \times \text{Notional}Maintenance Margin=cn×Notional
Maintenance Margin=0.01×6,000=60USDT\text{Maintenance Margin} = 0.01 \times 6,000 = 60 \text{USDT}Maintenance Margin=0.01×6,000=60USDT
maxLeverage=0.6cn\text{maxLeverage} = \frac{0.6}{cn}maxLeverage=cn0.6​
maxLeverage=0.60.01=60x\text{maxLeverage} = \frac{0.6}{0.01} = 60xmaxLeverage=0.010.6​=60x

The endpoint should return this maxLeverage as a parameter in the endpoint.

SYMMIO frontend.
here
contract-symbols
CVA=10,000×0.60=6000USDTCVA=10,000×0.60 = 6000USDTCVA=10,000×0.60=6000USDT