For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Logo
Join CommunityStart Trading
HomeOverviewDIME UtilityTradingRisk & LiquidationsVTFsParadex ChainEcosystemREST APIWebSocket APIAgentic AI HubRelease Notes
HomeOverviewDIME UtilityTradingRisk & LiquidationsVTFsParadex ChainEcosystemREST APIWebSocket APIAgentic AI HubRelease Notes
  • Getting Started
    • Overview
    • Margin System
    • Margin Term Reference
    • Paradex Risk Checks
    • Mark Price Calculation
    • Cross Margin Requirement
    • Portfolio Margin
    • Price Bands
    • Position Limit
    • Funding Mechanism
    • Deleveraging
    • Liquidations
    • Socialized Losses
    • Trade flow and busts
Join CommunityStart Trading
On this page
  • Order Risk Check
  • Order Risk Check Conditions
  • Example
  • Health Check
  • Withdrawal Check

Paradex Risk Checks

Was this page helpful?
Edit this page
Previous

Mark Price Calculation

Next
Built with

Order Risk Check

Order Risk Check Conditions

An order is accepted if :

  • The account meets the Initial Margin Requirement after including the new order, i.e. Account Value≥Account Initial Margin Requirement\text{Account Value}\ge\text{Account Initial Margin Requirement}Account Value≥Account Initial Margin Requirement
  • Including the order does not result in an increase of the Initial Margin Requirement

Example

Setup :

  • Alice has 100 USD worth of collateral and uses Cross Margin mode
  • Mark Price XYZ-USD-PERP=100\text{Mark Price}_\text{ XYZ-USD-PERP}=100Mark Price XYZ-USD-PERP​=100

Alice successfully submits a buy XYZ-USD-PERP order of size 10

Assuming Initial Margin Fraction (IMF) of 10% (i.e. a maximum leverage of 10x), the Initial Margin Requirement is : 10%∗10∗100=100 USD10\%*10*100=100~\text{USD}10%∗10∗100=100 USD

Alice has no open position and therefore has an Account Value of 100 USD. The order is then accepted since the account meets the IMR condition.

Price drop :

The Mark Price of XYZ-USD-PERP drops to 98.

Account IMR=10%∗10∗98=98 USD\text{Account IMR}=10\%*10*98=98~\text{USD}Account IMR=10%∗10∗98=98 USD

Unrealized PnL=10∗(98−100)=−20 USD\text{Unrealized PnL}=10*(98-100)=-20~ \text{USD}Unrealized PnL=10∗(98−100)=−20 USD

Account Value=100−20=80 USD<Account IMR\text{Account Value}=100-20=80~\text{USD} < \text{Account IMR}Account Value=100−20=80 USD<Account IMR

Although Alice’s account value is below IMR, deleveraging check does not monitor the account since it has no open orders

Submission of an offsetting order :

Alice submits a sell order of size 5. Since this is an offsetting order which is smaller than the position size, it does not increase the Open Size therefore does not increase the Account IMR. The order is accepted.

Submission of another order that brings the total sell orders size above the position size

Later, Alice submits a new sell order of size 8. This is also an offsetting order but it does result in an increase in Alice’s XYZ-USD-PERP Open Size from 10 to 13. Therefore, this order increases the account IMR. Since the account also does not meet IMR, this order is rejected.

Health Check

Health Check is a periodic check on account’s Margin Ratio. This check is done once every 5 seconds. An account passes the health check if its account value is positive and the margin ratio is below 100%.

If an account’s Margin Ratio>100%\text{Margin Ratio}>\text{100\%}Margin Ratio>100%, the account will enter Liquidation.

Withdrawal Check

The maximum amount of USDC you can withdraw is determined by your Free Collateral Balance, but is capped by your Account USDC Balance. In other words, you can withdraw up to your Free Collateral Balance in USDC, but never more than the total USDC you currently have in your account.

Withdrawable USDC Amount=min⁡(Account USDC Balance,max⁡(0, Free Collateral BalanceUSDC Oracle Price))\begin{align*} \small\text{Withdrawable USDC Amount} = \min\bigg( & \text{Account USDC Balance}, \\ & \max\Big(0,\, \frac{\text{Free Collateral Balance}}{\text{USDC Oracle Price}}\Big) \bigg) \end{align*}Withdrawable USDC Amount=min(​Account USDC Balance,max(0,USDC Oracle PriceFree Collateral Balance​))​