Veyronn Documentation

Margin and Risk

Collateral accounting, leverage, PnL, funding, liquidation, and market limits.

Veyronn uses six-decimal USD accounting. In formulas below, values are economically expressed in USD even though contracts store integer micro-USD.

Position size and leverage

size = collateral × leverage
leverage = size / collateral

The protocol checks requested leverage against both session limits and market maxLeverageBps.

PnL

long PnL  = size × (exitPrice - entryPrice) / entryPrice
short PnL = size × (entryPrice - exitPrice) / entryPrice

Funding and close fees are combined with price PnL during settlement.

Fees

fee = size × feeBps / 10,000

Open and close fee rates are configured per market. Liquidation fees are separately bounded by remaining equity.

Margin ratio

equityAfterFee = collateral + signedPnLAndFunding - closeFee
marginBps = equityAfterFee × 10,000 / positionSize

A position is liquidatable when marginBps falls below the market maintenance-margin requirement.

Funding

Funding is capped per market over an eight-hour basis and updates side-specific payment and credit indexes. The crowded side pays while the opposite side receives, bounded by elapsed time and configured maximum rate.

Market controls

Every successful open must satisfy:

  • protocol and market are not paused for new risk
  • market is active and not reduce-only
  • collateral meets the minimum
  • size stays below the market maximum
  • leverage stays within bounds
  • total open interest stays below capacity
  • post-trade long/short skew stays within the configured limit
  • oracle freshness and confidence pass
  • execution stays within wallet-specified slippage
  • vault liquidity can support the resulting exposure

Emergency modes

Protocol pause and reduce-only controls can prevent new risk while preserving designed close and risk-reduction paths. Each market also has independent active and reduce-only state.