Bps values are out of 10,000 (e.g. 50 bps = 0.5%).
Pre-trade checks (RiskEngine)
Leverage bounds:sizeUsd >= collateralAmount * minLeverage and collateralAmount * maxLeverage >= sizeUsd.
Initial margin:
PnL, margin ratio, and liquidation (RiskEngine)
Unrealized PnL:Cross-margin liquidation (RiskEngine)
Account-level check, across every open cross position for one collateral token:Funding (FundingManager)
Fees (FeeCollector)
Trading fee:feeBps is takerFeeBps for market orders, makerFeeBps for limit orders.
Liquidation fee:
Liquidation settlement (Liquidator)
Slippage (Matcher, off-chain)
Points (PointsSystem)
tradePointsEarned accrues on both opening and closing a position, each counted separately. See Points & Referrals.