Skip to main content
Glama

Cross-Venue Portfolio Gate

portfolio_gate
Read-onlyIdempotent

Cross-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

TableJSON Schema
NameRequiredDescriptionDefault
accountNoOR: a Hyperliquid account address (0x…) — the full live book (positions, margins, equity, venue liquidation prices) is pulled keylessly; explicit positions take precedence.
betaTierNobeta regime for the factor stress: mild | moderate | severe — cross-event validated tiers (pre-registered). Default = worst-case single-event table; explicit betas override.
positionsNolegs: {venue, asset|symbol, side long|short, size, entryPrice, markPrice?, margin|leverage, maxLeverage|maintMarginRate|marginTiers}. A Hyperliquid symbol auto-fills live mark/leverage/tiers.
shockScenariosPctNocorrelated market moves (%) to stress; default [5,10,20,30]

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNofalse when the engine rejected the input
modelNomodel assumptions used
proofNoVerifiability 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.
checksNoGround-truth self-checks; the result is untrustworthy if any fails.
positionsNoper-leg breakdown with each liquidation price
concentrationNoHHI + effective number of independent bets
positionsCountNonumber of legs analyzed
totalNetNotionalNonet notional after long/short netting
nearestLiquidationNothe leg that liquidates FIRST — the binding constraint
netExposureByAssetNoTRUE net exposure per underlying (longs netted against shorts)
totalGrossNotionalNosum of |notional| across legs
correlatedShockStressNoper-scenario: how many legs liquidate simultaneously at a correlated ±X% move

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations (readOnlyHint, openWorldHint), the description discloses self-checks (exposure reconciliation, liquidation invariants), auto-filling of live data, and the correlated-crash stress methodology. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is somewhat long but front-loaded with purpose. Each sentence adds necessary detail about functionality, self-checks, and parameters. Could be slightly more structured, but efficient given complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (cross-venue, stress testing, multiple inputs), the description fully covers purpose, inputs, behavior, and output characteristics. Output schema exists, so return values are documented separately.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, baseline 3. Description adds value by explaining the positions array format, account behavior (keyless live pull), betaTier meaning, and default shock scenarios, enriching the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it evaluates cross-venue portfolio risk, returning net exposure, first-to-liquidate leg, concentration, and crash stress. It distinguishes from siblings like perp_gate or options_risk by focusing on multi-venue aggregation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides usage context: call to check if independent bets are secretly one correlated position. Explains how to input a Hyperliquid address or explicit positions. Does not explicitly list when not to use or compare to alternatives, but context is strong.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.6/5.0
Disambiguation5/5

Each tool addresses a distinct risk domain (event volatility, execution verification, LP risk, options, perps, portfolio, attestation, sizing, treasury) with no overlap; descriptions are precise and differentiate clearly.

Naming Consistency5/5

All tool names follow a consistent snake_case pattern combining a domain prefix with a verb or metaphor (e.g., _risk, _gate, _verify), making them predictable and easy to parse.

Tool Count5/5

The 9 tools cover a broad range of DeFi risk computations without being excessive; each tool serves a clear, non-redundant purpose within the server's scope.

Completeness5/5

The tool set provides comprehensive coverage for a risk analysis server: event risk, execution quality, LP risk, options and perps greeks, portfolio stress, attestation, sizing, and treasury risk; no obvious gaps for the intended domain.

Resources