DocsRisk Engine

Risk Parameters

Every knob in the risk engine, its default, and where it is set — with source citations.

Risk parameters exist at three levels: the on-chain desk configuration, the keeper's off-chain copy configuration, and the session policy. All values below are verified against the deploy scripts and keeper source.

On-chain desk configuration (RiskModule.configureDesk)

ParameterMeaningMainnet default (DeployMainnet)Testnet default (DeployTestnet, when MAX_FILL_USDG set)
maxFillUsdgMax notional per copy5,000 USDGMAX_FILL_USDG env
maxPositionUsdgMax value per token position20,000 USDG5,000 USDG
maxGrossExposureUsdgMax sum of position values50,000 USDG10,000 USDG
maxDrawdownBpsHalt threshold below high-water NAV/share2,000 (20%)2,000 (20%)
maxStalenessSecMax oracle price age120 s120 s

Env overrides: MAX_FILL_USDG, MAX_POSITION_USDG, MAX_GROSS_USDG, MAX_DRAWDOWN_BPS, MAX_STALENESS_SEC.

Related vault-level bounds:

ParameterDefaultSetter
DeskVault.depositCapUsdg50,000 USDG on mainnet; 0 (unlimited) on testnetsetDepositCap / DEPOSIT_CAP_USDG env
DeskVault.maxStalenessSec120 ssetMaxStalenessSec

Session multipliers (RiskModule.setSessionRisk)

SessionDefault bpsSize
Regular10,000100%
Pre-market3,00030%
After-hours3,00030%
Closed0rejected

Source: DEFAULT_SESSION_POLICY in keeper/src/session.ts; the deploy scripts wire the same values on-chain.

Keeper copy configuration (keeper/src/index.ts)

ParameterValueMeaning
baseCopyBps500Copy 5% of the leader's notional
maxFillUsdg2,000 USDGKeeper-side per-fill cap
maxPositionUsdg5,000 USDGKeeper-side per-position cap
maxGrossExposureUsdg10,000 USDGKeeper-side gross cap
maxDrawdownBps2,000Keeper-side halt threshold
maxStalenessSec120Keeper-side staleness bound
Slippage (paper)25 bpsSimulated worse-price fill

Sizing pipeline

text
requested  = leaderNotional                    (USDG base units)
intended   = requested × baseCopyBps / 10_000
           × sessionBps / 10_000
allowed    = intended
           ≤ maxFillUsdg
           ≤ maxPositionUsdg − positionValue   (buys)
           ≤ maxGrossUsdg − grossExposure      (buys)
           ≤ cashUsdg                          (buys, keeper-side)
           ≤ positionValue                     (sells)

A copy whose allowed size rounds to zero is skipped (size rounds to zero / size reduced to zero).