Skip to main content
Agent Tools
View .md

Risk Flags

The flags array in the response identifies specific risk conditions detected for the trade. Use flags to understand why a score is elevated and to make targeted decisions in your agent logic.

Flag Reference

Order Book Flags

FlagSeverityDescription
thin_bookWarningOrder book has insufficient depth relative to the trade size
high_slippageWarningExpected slippage is elevated
extreme_slippageCriticalExpected slippage is very high, or trade exceeds available book depth

Liquidation Flags

FlagSeverityDescription
near_liquidationCriticalPosition is close to liquidation price
near_backstopCriticalPosition is close to the backstop liquidation threshold
high_leverageWarningEffective leverage is elevated
adl_riskWarningAuto-deleveraging risk detected for a profitable high-leverage position
partial_liquidationWarningLarge position where partial liquidation would cause amplified slippage

Funding Flags

FlagSeverityDescription
funding_anomalyWarningFunding rate is statistically abnormal
funding_expensiveWarningProjected annualized funding cost is elevated
cex_funding_divergenceWarningHyperliquid funding rate diverges significantly from CEX rates

Market Impact Flags

FlagSeverityDescription
high_impactWarningExpected market impact is elevated
low_volumeWarningTrade size is large relative to the asset's recent volume

VaR Flags

FlagSeverityDescription
high_varWarningValue-at-Risk is elevated relative to notional
limited_historyInfoInsufficient historical data for full statistical analysis
new_listingInfoAsset has limited trading history

Open Interest Flags

FlagSeverityDescription
oi_at_capCriticalAsset is at the exchange's open interest cap
oi_near_capWarningOpen interest is approaching the cap

Portfolio Flags

FlagSeverityDescription
concentration_riskWarningPortfolio is heavily concentrated in a single asset
correlated_exposureWarningMultiple positions are correlated in the same direction

Oracle Flags

FlagSeverityDescription
oracle_divergenceWarningMark price diverges significantly from oracle/index price

Data Quality Flags

FlagSeverityDescription
stale_cacheInfoCached market data may be slightly delayed

Using Flags in Agent Logic

Flags let you build nuanced responses beyond just checking recommendation:

result = requests.post(...).json()

# Block on critical flags
critical = [f for f in result["flags"] if f in ["extreme_slippage", "near_liquidation", "near_backstop", "oi_at_cap"]]
if critical:
agent.abort(f"Critical risk: {critical}")

# Adjust for warnings
if "thin_book" in result["flags"]:
# Reduce size to match available liquidity
size = min(size, result["slippage"]["depth_50bps"] * 0.5)

if "funding_expensive" in result["flags"]:
# Only enter if expected alpha exceeds funding cost
if expected_return < result["funding"]["annualized_pct"]:
agent.skip("Funding cost exceeds expected return")

if "correlated_exposure" in result["flags"]:
# Already exposed to this direction, reduce allocation
size *= 0.5