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
  • Parameter Calibration Rationale
  • Key Parameters
  • Calculation
  • Input Data
  • Proof of MaxFundingVelocity Formula
  • Appendix B. Proof for the maxFundingVelocity formula
Edit on GitHub
Export as PDF
  1. Risk Methodology
  2. Perps Risk Framework

Maximum Funding Velocity

This section explains how the maximum funding velocity parameter is calibrated.

Parameter Calibration Rationale

Under a critical skew level (near the maximum), and given an extreme price change of the underlying asset over a certain horizon (i.e., a strong upward or downward price trend in the direction of the skew), the funding rate velocity must ensure that the accumulated funding payment exceeds or equals the profit from the price change (i.e., the market risk delta is hedged by the funding payment). This incentivizes users to close their positions and return the market to a neutral state, even without intervention from other participants.

Given the use of soft maxSkew restrictions, the theoretical maximum skew is equivalent to maxOI. Therefore, maxOI is used in maxFundingVelocityCalibration instead of maxSkew.

Throughout the considered period, the skew measured in tokens is assumed to remain constant. This represents a highly conservative assumption, positing the absence of arbitrageurs who might respond to increased funding rates.

Key Parameters

  • h=24hh = 24hh=24h is a risk horizon

  • yyy is the extreme price change within the risk horizon that is highly probable, determined by the underlying asset's quality category:

Quality Category
y

Very Good

5%

Good

10%

Medium

15%

Bad

40%

Very Bad

40%

Estimated figures in the table represent the median historical 95% CVaR for price returns within each specified quality category.

  • kkk is the proportional skew level (k=Kt/Kmax⁡k = K_{t}/K_{\max}k=Kt​/Kmax​). Given a low skew, the protocol's risk exposure from unrealized PnL is minimal, which justifies setting the critical threshold at 95%.

  • τ=1/24\tau = 1/24τ=1/24 is the frequency of the funding rate update, T=24T = 24T=24.

Calculation

maxFundingVelocity=ceil(yw⋅τ2⋅(S1+y⋅τ⋅S2),0)maxFundingVelocity = \text{ceil}\left(\frac{y}{w \cdot \tau^{2} \cdot (S_{1} + y \cdot \tau \cdot S_{2})}, 0\right)maxFundingVelocity=ceil(w⋅τ2⋅(S1​+y⋅τ⋅S2​)y​,0)

where

S1=∑t=1Tt=T⋅T+12S_{1} = \sum_{t=1}^{T} t = T \cdot \frac{T + 1}{2}S1​=t=1∑T​t=T⋅2T+1​
S2=∑t=1Tt2=T⋅(T+1)⋅(2T+1)6S_{2} = \sum_{t=1}^{T} t^{2} = \frac{T \cdot (T + 1) \cdot (2T + 1)}{6}S2​=t=1∑T​t2=6T⋅(T+1)⋅(2T+1)​
w=k⋅Kmax⁡skewScalew = \frac{k \cdot K_{\max}}{skewScale}w=skewScalek⋅Kmax​​

Kmax⁡K_{\max}Kmax​ is the maximum token-denominated skew determined under the oracle price at the moment of calibration.

The formal proof for the above formula is provided in the Appendix.

Input Data

Data Item
Description
Source
Period/Frequency
Processing

Price of the underlying asset over the historical period

Coingecko

Frequency: 1h Period: past 365 days

Simple percentage return is calculated over the risk horizon

Maximum dollar OI per market

RF

-

-

Skew scale parameter

RF

-

-

Proof of MaxFundingVelocity Formula

Appendix B. Proof for the maxFundingVelocity formula

Results below are derived for long positions, for short positions the calculation is similar.

PnL from the price change at the end of the horizon is the following:

PnLT=(pT−p0)⋅q=q⋅((1+y)⋅p0−p0)=y⋅p0⋅qPnL_{T} = (p_{T} - p_{0}) \cdot q = q \cdot ((1 + y) \cdot p_{0} - p_{0}) = y \cdot p_{0} \cdot qPnLT​=(pT​−p0​)⋅q=q⋅((1+y)⋅p0​−p0​)=y⋅p0​⋅q

where yyy is the percentage price return over the horizon.

Funding accrued per each period between the skew-modification events is calculated as follows:

ft=pt⋅q⋅rt⋅τf_{t} = p_{t} \cdot q \cdot r_{t} \cdot \tauft​=pt​⋅q⋅rt​⋅τ

where τ=hT\tau = \frac{h}{T}τ=Th​ is the time step measured in days.

Accumulated funding at the end of the horizon:

FT=∑ft=τ⋅q⋅∑pt⋅rt=τ⋅q⋅p0⋅∑(1+yt)⋅rtF_{T} = \sum f_{t} = \tau \cdot q \cdot \sum p_{t} \cdot r_{t} = \tau \cdot q \cdot p_{0} \cdot \sum (1 + y_{t}) \cdot r_{t}FT​=∑ft​=τ⋅q⋅∑pt​⋅rt​=τ⋅q⋅p0​⋅∑(1+yt​)⋅rt​

Assuming a linear price growth, we have:

yt=y⋅t⋅τy_{t} = y \cdot t \cdot \tauyt​=y⋅t⋅τ

Then

FT=τ⋅q⋅p0⋅∑(1+y⋅t⋅τ)⋅rtF_{T} = \tau \cdot q \cdot p_{0} \cdot \sum (1 + y \cdot t \cdot \tau) \cdot r_{t}FT​=τ⋅q⋅p0​⋅∑(1+y⋅t⋅τ)⋅rt​

The funding rate dynamics is the following:

rt=rt−1+c⋅τ⋅KtSkewScaler_{t} = r_{t-1} + c \cdot \tau \cdot \frac{K_{t}}{SkewScale}rt​=rt−1​+c⋅τ⋅SkewScaleKt​​

where ccc is the short notation for maxFundingVelocitymaxFundingVelocitymaxFundingVelocity.

Let r0=0r_{0} = 0r0​=0, Kt=k⋅KmaxK_{t} = k \cdot K_{max}Kt​=k⋅Kmax​, w=k⋅KmaxSkewScalew = k \cdot \frac{K_{max}}{SkewScale}w=k⋅SkewScaleKmax​​. At any given moment, the funding rate is defined as follows:

r1=c⋅τ⋅wr_{1} = c \cdot \tau \cdot wr1​=c⋅τ⋅w

r2=2⋅c⋅τ⋅wr_{2} = 2 \cdot c \cdot \tau \cdot wr2​=2⋅c⋅τ⋅w

⋮\vdots⋮

rt=t⋅c⋅τ⋅wr_{t} = t \cdot c \cdot \tau \cdot wrt​=t⋅c⋅τ⋅w

⋮\vdots⋮

By integrating the funding rate's behavior into the funding accumulation equation, the following is derived:

FT=τ2⋅q⋅p0⋅c⋅w⋅∑(1+y⋅t⋅τ)⋅tF_{T} = \tau^{2} \cdot q \cdot p_{0} \cdot c \cdot w \cdot \sum (1 + y \cdot t \cdot \tau) \cdot tFT​=τ2⋅q⋅p0​⋅c⋅w⋅∑(1+y⋅t⋅τ)⋅t

The sum ∑(1+y⋅t⋅τ)⋅t\sum (1 + y \cdot t \cdot \tau) \cdot t∑(1+y⋅t⋅τ)⋅t can be represented as follows:

∑(1+y⋅t⋅τ)⋅t=∑t+y⋅τ∑t2=S1+y⋅τ⋅S2\sum (1 + y \cdot t \cdot \tau) \cdot t = \sum t + y \cdot \tau \sum t^{2} = S_{1} + y \cdot \tau \cdot S_{2}∑(1+y⋅t⋅τ)⋅t=∑t+y⋅τ∑t2=S1​+y⋅τ⋅S2​

where

S1=∑t=T⋅T+12S_{1} = \sum t = T \cdot \frac{T + 1}{2}S1​=∑t=T⋅2T+1​

S2=∑t2=T⋅(T+1)⋅(2T+1)6S_{2} = \sum t^{2} = \frac{T \cdot (T + 1) \cdot (2T + 1)}{6}S2​=∑t2=6T⋅(T+1)⋅(2T+1)​

The cumulative funding is then expressed as:

FT=τ2⋅q⋅p0⋅c⋅w⋅(S1+y⋅τ⋅S2)F_{T} = \tau^{2} \cdot q \cdot p_{0} \cdot c \cdot w \cdot (S_{1} + y \cdot \tau \cdot S_{2})FT​=τ2⋅q⋅p0​⋅c⋅w⋅(S1​+y⋅τ⋅S2​)

By the end of the defined period, the total accumulated funding must be at least equal to the profit or loss that has not yet been realized due to price fluctuations:

FT≥PnLTF_{T} \geq PnL_{T}FT​≥PnLT​

Let's find the minimum maxFundingVelocitymaxFundingVelocitymaxFundingVelocity at which this inequality satisfies:

FT=PnLTF_{T} = PnL_{T}FT​=PnLT​

This gives the final equation for maxFundingVelocity:

τ2⋅q⋅p0⋅c⋅w⋅(S1+y⋅τ⋅S2)=y⋅p0⋅q\tau^{2} \cdot q \cdot p_{0} \cdot c \cdot w \cdot (S_{1} + y \cdot \tau \cdot S_{2}) = y \cdot p_{0} \cdot qτ2⋅q⋅p0​⋅c⋅w⋅(S1​+y⋅τ⋅S2​)=y⋅p0​⋅q

τ2⋅c⋅w⋅(S1+y⋅τ⋅S2)=y\tau^{2} \cdot c \cdot w \cdot (S_{1} + y \cdot \tau \cdot S_{2}) = yτ2⋅c⋅w⋅(S1​+y⋅τ⋅S2​)=y

The final outcome is achieved by solving the equation for ccc.

This completes the proof.

Last updated 3 days ago

ppp
K$,max=maxOI$K_{\$,max} = maxOI_{\$}K$,max​=maxOI$​
skewScaleskewScaleskewScale