Skip to main content
Glama

Treasury Depeg & Concentration

treasury_risk
Read-onlyIdempotent

Stablecoin / on-chain treasury risk. Given a book of positions [{asset, amountUsd, apyPct, venue, chain, pegTarget, depegProbAnnual}], returns concentration (Herfindahl by asset/venue/chain + breaches over a limit), depeg stress (explicit scenarios + a worst-single-depeg scan), weighted and risk-adjusted yield. Self-checked: HHI == Σw², weights sum to 1, depeg-loss identity. Call to size a treasury's real risk — issuer/venue/chain concentration and depeg exposure — not just its headline APY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
positionsYestreasury holdings
depegFloorNoworst-single-depeg stress floor (default 0.90)
depegScenariosNo[{asset, price}] explicit depeg stresses
concentrationLimitPctNoflag any single exposure above this (default 25)

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.
verdictNoplain-language verdict
totalUsdNototal treasury size in USD
depegStressNoexplicit depeg scenarios + worst-single-depeg scan
concentrationNoHerfindahl (HHI) by asset/venue/chain + limit breaches
weightedApyPctNoholdings-weighted headline APY (%)
riskAdjustedApyPctNoyield after expected depeg loss (%)
expectedAnnualDepegLossUsdNoexpected annual loss from depeg probabilities (USD)

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds value by disclosing internal consistency checks (HHI identity, weight sum, depeg-loss identity) and the worst-single-depeg scan. This goes beyond what annotations provide, though it could detail rate limits or auth needs.

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?

The description is two sentences with clear front-loading: first sentence defines inputs and outputs, second adds self-check and a usage call. It is efficient and well-structured, though slightly dense; a minor split could improve readability.

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

Completeness4/5

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

Given the presence of an output schema, the description sufficiently covers the tool's functionality: concentration, depeg stress, risk-adjusted yield. It mentions explicit scenarios and worst-single-depeg scan. It does not detail all output fields or edge cases, but the output schema compensates.

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 description coverage is 100% (all parameters described). The description adds context by explaining how parameters like positions and depegScenarios feed into the computation: 'returns concentration... depeg stress... weighted and risk-adjusted yield.' This clarifies the role of each parameter beyond schema definitions.

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 the tool's purpose: assessing stablecoin/treasury risk. It specifies the input format (positions with fields) and outputs (concentration, depeg stress, adjusted yield). This distinguishes it from sibling tools like event_vol or lp_risk by focusing on treasury concentration and depeg exposure.

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?

The description explicitly tells when to use the tool: 'Call to size a treasury's real risk — issuer/venue/chain concentration and depeg exposure — not just its headline APY.' This contrasts with simpler yield tools. However, it does not explicitly mention when not to use or name specific alternatives, so a perfect score is not warranted.

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