Add capital efficiency risk simulation

This commit is contained in:
defiQUG
2026-04-27 11:26:55 -07:00
parent 1cf845cb3a
commit 818e864d2b
15 changed files with 1111 additions and 13 deletions

View File

@@ -0,0 +1,92 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Simulation-only capital efficiency policy for Chain 138/cW PMM treasury risk modeling. This is not a live leverage or mint/redemption contract configuration.",
"version": "1.0.0",
"updated": "2026-04-27",
"defaults": {
"paths": 1000,
"epochs": 365,
"seed": 138001,
"initialCapital": 1000000,
"alpha": 0.7,
"leverage": 2,
"spreadBps": 35,
"volumeEfficiency": 2,
"pmmK": 0.1,
"liquidityTargetUnits": 1000000
},
"parameterBands": {
"alphaBalanced": [0.65, 0.75],
"alphaYieldDominant": [0.75, 0.9],
"leverageSafe": [1, 1],
"leverageTarget": [2, 3],
"leverageUnstableAbove": 4,
"spreadCompetitiveBps": 10,
"spreadTargetBps": [30, 50],
"spreadVolumeRiskCeilingBps": 100,
"volumeEfficiencyPassive": 1,
"volumeEfficiencyActive": [2, 4],
"volumeEfficiencyHighlyOptimizedAbove": 5
},
"treasury": {
"yieldRatePerEpoch": 0.00035,
"volatilityDragLambda": 0.35,
"marketMakingScale": 0.04
},
"volatilityProcess": {
"sigma0": 0.03,
"sigmaBar": 0.03,
"kappa": 0.08,
"eta": 0.01
},
"pegDynamics": {
"p0": 1,
"beta": 0.25,
"imbalanceStd": 0.01,
"arbLiquidityCoefficient": 0.65
},
"risk": {
"minExternalLiquidityPct": 0.2,
"maxLtvBps": 6500,
"hardMaxLtvBps": 7500,
"liquidationLtvBps": 8000,
"hardMaxLeverage": 4,
"liquidationLossFraction": 0.08,
"sigmaCrit": 0.08,
"throttleLeverageMultiplier": 0.7,
"throttleAlphaMultiplier": 0.9,
"throttleSpreadBps": 50,
"maxSpreadBps": 100,
"circuitBreakerSpreadBps": 100,
"pegCircuitBreakerBps": 200,
"collateralVolatilityHaircut": 0.5,
"bankRunRedemptionFeeBps": 100
},
"gates": {
"maxDeployableLeverage": 3,
"maxLiquidationProbability": 0.02,
"maxDrawdownP95": 0.25,
"maxPegDeviationFrequency": 0.05,
"maxExternalLiquidityFloorViolations": 0
},
"optimizer": {
"paths": 250,
"maxCandidates": 250,
"topN": 10
},
"liveExecutionGuard": {
"status": "simulation_only",
"requiresBeforeContractWork": [
"smart_contract_audit_engagement",
"governance_approval",
"risk_dashboard",
"operator_runbook",
"treasury_liquidity_commitments"
],
"auditEngagementEvidence": null,
"governanceApprovalEvidence": null,
"riskDashboardEvidence": null,
"operatorRunbookEvidence": null,
"treasuryLiquidityCommitmentEvidence": null
}
}

View File

@@ -213,6 +213,69 @@
"seed": {
"type": "integer",
"description": "Optional RNG seed for deterministic runs; if omitted, derived from scenario name"
},
"capitalEfficiency": {
"type": "object",
"description": "Optional simulation-only treasury/risk Monte Carlo overlay. Does not configure live contracts.",
"properties": {
"enabled": { "type": "boolean", "default": false },
"paths": { "type": "integer", "minimum": 1 },
"epochs": { "type": "integer", "minimum": 1 },
"seed": { "type": "integer" },
"initialCapital": { "type": "number", "minimum": 0 },
"alpha": { "type": "number", "minimum": 0, "maximum": 1 },
"leverage": { "type": "number", "minimum": 1 },
"spreadBps": { "type": "number", "minimum": 0 },
"volumeEfficiency": { "type": "number", "minimum": 0 },
"pmmK": { "type": "number", "minimum": 0 },
"liquidityTargetUnits": { "type": "number", "minimum": 0 },
"treasury": { "type": "object" },
"volatilityProcess": {
"type": "object",
"properties": {
"sigma0": { "type": "number", "minimum": 0 },
"sigmaBar": { "type": "number", "minimum": 0 },
"kappa": { "type": "number", "minimum": 0 },
"eta": { "type": "number", "minimum": 0 }
}
},
"pegDynamics": {
"type": "object",
"properties": {
"p0": { "type": "number" },
"beta": { "type": "number" },
"imbalanceStd": { "type": "number", "minimum": 0 },
"arbLiquidityCoefficient": { "type": "number", "minimum": 0 }
}
},
"risk": { "type": "object" },
"stress": {
"type": "object",
"properties": {
"preset": {
"type": "string",
"enum": ["crash_40pct_external_asset", "high_vol_sigma_spike", "bank_run_redemption_spike", "bridge_shock"]
},
"epoch": { "type": "integer", "minimum": 0 },
"durationEpochs": { "type": "integer", "minimum": 1 },
"externalAssetReturn": { "type": "number" },
"sigmaAdd": { "type": "number" },
"redemptionFraction": { "type": "number", "minimum": 0 },
"imbalanceAdd": { "type": "number" },
"events": { "type": "array", "items": { "type": "object" } }
}
},
"optimizer": {
"type": "object",
"properties": {
"enabled": { "type": "boolean", "default": false },
"paths": { "type": "integer", "minimum": 1 },
"topN": { "type": "integer", "minimum": 1 },
"maxCandidates": { "type": "integer", "minimum": 1 },
"grid": { "type": "object" }
}
}
}
}
}
}

View File

@@ -0,0 +1,38 @@
{
"scenario": "bank_run_redemption_spike",
"graphMode": "design",
"topology": "hub",
"chainsIncluded": ["1", "56", "137"],
"tokensIncluded": ["cWUSDT", "cWUSDC"],
"epochBlocks": 300,
"epochs": 180,
"orderflowModel": {
"distribution": "pareto",
"volumeMinUnits": 2500,
"volumeMaxUnits": 80000,
"tradesPerEpoch": 25,
"paretoAlpha": 1.8
},
"oracleModel": "static",
"latencyModel": {
"finalityBlocksPerChainPair": {},
"rhoPerBlockBps": 0.5
},
"capitalEfficiency": {
"enabled": true,
"paths": 1000,
"epochs": 180,
"seed": 138403,
"initialCapital": 1000000,
"alpha": 0.68,
"leverage": 2,
"spreadBps": 45,
"volumeEfficiency": 2.5,
"stress": {
"preset": "bank_run_redemption_spike",
"epoch": 30,
"durationEpochs": 12,
"redemptionFraction": 0.25
}
}
}

View File

@@ -0,0 +1,31 @@
{
"scenario": "chain138_deployed_capital_efficiency",
"graphMode": "deployed",
"topology": "hub",
"chainsIncluded": ["138"],
"tokensIncluded": ["cUSDT", "cUSDC", "cEURC", "cEURT", "cXAUC", "cXAUT"],
"epochBlocks": 300,
"epochs": 120,
"orderflowModel": {
"distribution": "uniform",
"volumeMinUnits": 1000,
"volumeMaxUnits": 25000,
"tradesPerEpoch": 12
},
"oracleModel": "static",
"latencyModel": {
"finalityBlocksPerChainPair": {},
"rhoPerBlockBps": 0.5
},
"capitalEfficiency": {
"enabled": true,
"paths": 500,
"epochs": 120,
"seed": 138405,
"initialCapital": 1000000,
"alpha": 0.7,
"leverage": 2,
"spreadBps": 35,
"volumeEfficiency": 2
}
}

View File

@@ -0,0 +1,35 @@
{
"scenario": "crash_40pct_external_asset",
"graphMode": "design",
"topology": "hub",
"chainsIncluded": ["1", "56", "137"],
"tokensIncluded": ["cWUSDT", "cWUSDC"],
"epochBlocks": 300,
"epochs": 180,
"orderflowModel": {
"distribution": "uniform",
"volumeMinUnits": 5000,
"volumeMaxUnits": 30000,
"tradesPerEpoch": 15
},
"oracleModel": "static",
"latencyModel": {
"finalityBlocksPerChainPair": {},
"rhoPerBlockBps": 0.5
},
"capitalEfficiency": {
"enabled": true,
"paths": 1000,
"epochs": 180,
"seed": 138401,
"initialCapital": 1000000,
"alpha": 0.7,
"leverage": 2.5,
"spreadBps": 40,
"volumeEfficiency": 2.5,
"stress": {
"preset": "crash_40pct_external_asset",
"epoch": 30
}
}
}

View File

@@ -0,0 +1,37 @@
{
"scenario": "high_vol_sigma_spike",
"graphMode": "design",
"topology": "hub",
"chainsIncluded": ["1", "56", "137"],
"tokensIncluded": ["cWUSDT", "cWUSDC"],
"epochBlocks": 300,
"epochs": 180,
"orderflowModel": {
"distribution": "lognormal",
"volumeMinUnits": 1000,
"volumeMaxUnits": 60000,
"tradesPerEpoch": 20
},
"oracleModel": "static",
"latencyModel": {
"finalityBlocksPerChainPair": {},
"rhoPerBlockBps": 0.5
},
"capitalEfficiency": {
"enabled": true,
"paths": 1000,
"epochs": 180,
"seed": 138402,
"initialCapital": 1000000,
"alpha": 0.72,
"leverage": 2.5,
"spreadBps": 40,
"volumeEfficiency": 3,
"stress": {
"preset": "high_vol_sigma_spike",
"epoch": 30,
"durationEpochs": 36,
"sigmaAdd": 0.08
}
}
}

View File

@@ -0,0 +1,43 @@
{
"scenario": "leverage_sweep_1x_to_4x",
"graphMode": "design",
"topology": "hub",
"chainsIncluded": ["1", "56", "137"],
"tokensIncluded": ["cWUSDT", "cWUSDC"],
"epochBlocks": 300,
"epochs": 180,
"orderflowModel": {
"distribution": "uniform",
"volumeMinUnits": 5000,
"volumeMaxUnits": 30000,
"tradesPerEpoch": 15
},
"oracleModel": "static",
"latencyModel": {
"finalityBlocksPerChainPair": {},
"rhoPerBlockBps": 0.5
},
"capitalEfficiency": {
"enabled": true,
"paths": 1000,
"epochs": 180,
"seed": 138404,
"initialCapital": 1000000,
"alpha": 0.7,
"leverage": 2,
"spreadBps": 40,
"volumeEfficiency": 2.5,
"optimizer": {
"enabled": true,
"paths": 250,
"topN": 12,
"grid": {
"alpha": [0.65, 0.7, 0.75, 0.8],
"leverage": [1, 2, 2.5, 3, 3.5, 4],
"spreadBps": [30, 40, 50],
"pmmK": [0.1, 0.15],
"liquidityTargetUnits": [500000, 1000000]
}
}
}
}

View File

@@ -169,6 +169,36 @@
}
}
}
}
},
"capital_efficiency_enabled": {
"type": "boolean",
"description": "True when the simulation-only capital efficiency Monte Carlo overlay was run"
},
"capital_efficiency_paths": { "type": "integer", "minimum": 1 },
"capital_efficiency_epochs": { "type": "integer", "minimum": 1 },
"initial_capital": { "type": "number", "minimum": 0 },
"alpha": { "type": "number", "minimum": 0, "maximum": 1 },
"leverage": { "type": "number", "minimum": 1 },
"spread_bps": { "type": "number", "minimum": 0 },
"volume_efficiency": { "type": "number", "minimum": 0 },
"pmm_k": { "type": "number", "minimum": 0 },
"liquidity_target_units": { "type": "number", "minimum": 0 },
"roi_mean": { "type": "number" },
"roi_p05": { "type": "number" },
"roi_p95": { "type": "number" },
"pnl_distribution": {
"type": "object",
"properties": {
"p05": { "type": "number" },
"p50": { "type": "number" },
"p95": { "type": "number" }
}
},
"max_drawdown_p95": { "type": "number", "minimum": 0 },
"liquidation_probability": { "type": "number", "minimum": 0, "maximum": 1 },
"peg_deviation_frequency": { "type": "number", "minimum": 0, "maximum": 1 },
"external_liquidity_floor_violations": { "type": "integer", "minimum": 0 },
"volatility_throttle_events": { "type": "integer", "minimum": 0 },
"spread_adjustment_events": { "type": "integer", "minimum": 0 }
}
}