Documentation
SocialsStatisticsLaunch App
  • Welcome to Mars Protocol
  • Getting Started
    • How to set up a Wallet
    • Connect your wallet
    • Using a Credit Account
  • Credit Accounts
  • Perpetual Futures (Perps)
    • Perps Vault (Counterparty Vault)
    • Funding Rate Mechanism
    • Price Impact
    • Open Interest Caps
    • Vault Solvency Protection
    • Health Factor
    • Liquidations
  • Spot & Margin Trading
  • Lending & Borrowing
  • Leveraged Yield Farming
  • High Leverage Strategies
  • Managed Vaults
    • Creating a Vault
      • How to Resume Vault Creation After Failed Transaction
    • Managing a Vault
    • Depositing into Vault
  • Risk Methodology
    • Asset Listing
    • Protocol Risk Framework
    • Perps Risk Framework
      • Maximum Leverage & LTVs
      • SkewScale
      • Open Interest Caps
      • Maximum Funding Velocity
      • Mitigating Risks of Static Parameters
    • Deposit Caps Risk Framework
  • Governance
    • MARS Token
  • Smart Contracts
    • Address Provider
    • Account NFT
    • Credit Manager
    • Health
    • Incentives
    • Oracle
    • Params
    • Red Bank
    • Rewards Collector
    • Swapper
    • Zapper
    • Perps
  • Brand kit
    • The Mars Brand
  • Legal
    • Mars FUD Bible
    • Terms of Service
    • Privacy Policy
    • Cookie Policy
Powered by GitBook
On this page
  • SkewScale in the Price Impact Model
  • Parameter Calibration Rationale
  • Calculation
  • Input Data
  • Key Assumptions
  • SkewScale in the Funding Rate Model
  • Appendix. Proof for the skewScale formula
Edit on GitHub
Export as PDF
  1. Risk Methodology
  2. Perps Risk Framework

SkewScale

This section explains how the SkewScale parameter is calibrated in the price impact model and the funding rate model.

SkewScale in the Price Impact Model

Parameter Calibration Rationale

The parameter calibration aims to align price slippage in perp trading with that of underlying asset spot trading on external markets under balanced market conditions (zero skew). This ensures appealing trading execution when the market exhibits no directional bias.

Depending on the prevailing skew and the direction of the order, the actual slippage may be less than or exceed the slippage on the global market.

Calculation

skewScale=Depths%2⋅s%​​skewScale= \frac{Depth_{s\%}}{2⋅s\%}​​skewScale=2⋅s%Depths%​​​​

where

Depths%​=min(Depth+s%​,Depth−s%​)Depth_{s\%​}=min(Depth_{+s\%}​,Depth_{−s\%​})Depths%​​=min(Depth+s%​​,Depth−s%​​)

Depth±s%Depth_{\pm s\%}Depth±s%​ is the token-denominated global market depth. The final skewScale is rounded to a specific power of 10 depending on number' magnitude.

Formal proof is provided in the Appendix.

Input Data

Data Item
Description
Source
Period/Frequency
Processing

Coingecko

90-day median

Transform to tokens

Key Assumptions

  • Linear price impact model is used.

SkewScale in the Funding Rate Model

The same SkewScale parameter is utilized in the funding rate model through a mathematical transformation that establishes the relationship between funding velocity and market skew.

In the funding rate model, the rate is designed to be proportional to the skew relative to the maximum allowable skew:

rt=rt−1+velocity⋅skewmaxSkew⋅Δtr_{t} = r_{t-1} + velocity \cdot \frac{skew}{maxSkew} \cdot \Delta trt​=rt−1​+velocity⋅maxSkewskew​⋅Δt

We can rewrite this equation as follows:

rt=rt−1+velocity⋅skewScalemaxSkew⋅skewskewScale⋅Δtr_{t} = r_{t-1} + velocity \cdot \frac{skewScale}{maxSkew} \cdot \frac{skew}{skewScale} \cdot \Delta trt​=rt−1​+velocity⋅maxSkewskewScale​⋅skewScaleskew​⋅Δt

Let's define the following notation:

maxFundingVelocity:=velocity⋅skewScalemaxSkew​maxFundingVelocity := velocity \cdot \frac{skewScale}{maxSkew}​maxFundingVelocity:=velocity⋅maxSkewskewScale​​

Then we have the following model (which is used in production):

rt=rt−1+maxFundingVelocity⋅skewskewScale⋅Δtr_{t} = r_{t-1} + maxFundingVelocity \cdot \frac{skew}{skewScale} \cdot \Delta trt​=rt−1​+maxFundingVelocity⋅skewScaleskew​⋅Δt

Therefore, the same skewScale parameter is used in the funding rate model, given that maxFundingVelocity is determined using the aforementioned transformation.

Appendix. Proof for the skewScale formula

The price model with the market impact is the following:

pex=por⋅(1+KskewScale+q2⋅skewScale)p_{ex} = p_{or} \cdot \left( 1 + \frac{K}{skewScale} + \frac{q}{2 \cdot skewScale} \right)pex​=por​⋅(1+skewScaleK​+2⋅skewScaleq​)

where pexp_{ex}pex​ is the order execution price, porp_{or}por​ is the oracle price, qqq is the position size (positive or negative), KKK is the current skew (positive or negative), skewScale>0skewScale > 0skewScale>0 is the model parameter.

Let the current skew KKK is zero (the market is perfectly balanced).

According to the price model, when a user opens a position of size qqq, the percentage price slippage is the following:

Slippage=q2⋅skewScaleSlippage = \frac{q}{2 \cdot skewScale}Slippage=2⋅skewScaleq​

where SlippageSlippageSlippage is positive when q>0q > 0q>0 and negative otherwise.

When the slippage is known, the skewScaleskewScaleskewScale parameter can be found as follows:

skewScale=q2⋅SlippageskewScale = \frac{q}{2 \cdot Slippage}skewScale=2⋅Slippageq​

We use global slippage as a benchmark to calibrate the parameter. When opening a long position of size the slippage should be ss%s. Then we have the parameter value for longs:

skewScaleL=Depth+s%2⋅s%skewScale_L = \frac{Depth_{+s\%}}{2 \cdot s\%}skewScaleL​=2⋅s%Depth+s%​​

When opening the short position of size the slippage should be −s-s%−s. Then we have the parameter value for shorts:

skewScaleS=Depth−s%2⋅s%skewScale_S = \frac{Depth_{-s\%}}{2 \cdot s\%}skewScaleS​=2⋅s%Depth−s%​​

The minimum is taken to get the final parameter:

skewScale=min⁡(skewScaleL,skewScaleS)=Depths%2⋅s%skewScale = \min(skewScale_L, skewScale_S) = \frac{Depth_{s\%}}{2 \cdot s\%}skewScale=min(skewScaleL​,skewScaleS​)=2⋅s%Depths%​​

where

Depths%=min⁡(Depth+s%,Depth−s%)Depth_{s\%} = \min(Depth_{+s\%}, Depth_{-s\%})Depths%​=min(Depth+s%​,Depth−s%​)

This completes the proof.

Last updated 3 days ago

aggregated global market depth across leading exchanges and trading pairs

Depth±s%Depth_{\pm s\%}Depth±s%​
±2%\pm 2\%±2%