Cross-Venue Portfolio Gate
portfolio_gateCross-venue portfolio risk. Given positions across venues [{venue, asset|symbol, side, size, entryPrice, margin|leverage, maxLeverage|marginTiers}] — OR just account: a Hyperliquid 0x address, whose FULL live book (positions, margins, account equity, the venue's own liquidation prices) is pulled keylessly — returns TRUE net exposure per underlying, the leg that liquidates FIRST (the binding constraint), concentration (HHI / effective independent bets), and a correlated-crash stress counting how many legs liquidate SIMULTANEOUSLY when the market moves ±X% (correlation→1, the Oct-10-2025 crash regime). Pass Hyperliquid symbols to auto-fill live mark/leverage/margin-tiers. Self-checked (exposure reconciliation, per-leg liquidation invariant, nearest=min, monotone stress, venue-liquidation cross-check). Call to see whether independently-sized bets are secretly ONE bet that blows up together.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | No | OR: a Hyperliquid account address (0x…) — the full live book (positions, margins, equity, venue liquidation prices) is pulled keylessly; explicit positions take precedence. | |
| betaTier | No | beta regime for the factor stress: mild | moderate | severe — cross-event validated tiers (pre-registered). Default = worst-case single-event table; explicit betas override. | |
| positions | No | legs: {venue, asset|symbol, side long|short, size, entryPrice, markPrice?, margin|leverage, maxLeverage|maintMarginRate|marginTiers}. A Hyperliquid symbol auto-fills live mark/leverage/tiers. | |
| shockScenariosPct | No | correlated market moves (%) to stress; default [5,10,20,30] |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | false when the engine rejected the input | |
| model | No | model assumptions used | |
| proof | No | Verifiability envelope: echoed inputs, engine codeHash, contentHash of this exact result, self-checks, EIP-712 signature (EAS-ready). Re-run the open engine on `inputs` to reproduce the result byte-for-byte. | |
| checks | No | Ground-truth self-checks; the result is untrustworthy if any fails. | |
| positions | No | per-leg breakdown with each liquidation price | |
| concentration | No | HHI + effective number of independent bets | |
| positionsCount | No | number of legs analyzed | |
| totalNetNotional | No | net notional after long/short netting | |
| nearestLiquidation | No | the leg that liquidates FIRST — the binding constraint | |
| netExposureByAsset | No | TRUE net exposure per underlying (longs netted against shorts) | |
| totalGrossNotional | No | sum of |notional| across legs | |
| correlatedShockStress | No | per-scenario: how many legs liquidate simultaneously at a correlated ±X% move |