Skip to main content
Agent Tools
View .md

Risk Score

Every /v1/validate response includes a risk_score (0-100) and a recommendation that summarizes the overall risk of the proposed trade.

Recommendations

RecommendationMeaning
proceedRisk is within acceptable bounds. The trade can be executed as proposed.
proceed_with_cautionElevated risk detected. Consider reducing size, lowering leverage, or reviewing the specific flags.
abortHigh risk. One or more critical risk factors are present. The trade should not be executed as proposed.

How the Score Works

The risk score is a weighted composite of multiple independent risk models that run in parallel, analyzing dimensions including liquidation proximity, statistical loss estimates, market liquidity, funding costs, and position crowding.

When multiple risk factors are elevated simultaneously, the score increases non-linearly to reflect compounding risk. For example, high leverage combined with a thin order book is more dangerous than either condition alone.

Close Positions

When action is "close", the risk score is capped (always proceed). Closing a position reduces risk, so Canon does not block exits.

Using Recommendations in Your Agent

A minimal integration gates execution on the recommendation:

result = requests.post("https://api.canonprotocol.org/v1/validate", ...).json()

if result["recommendation"] == "proceed":
execute_trade()
elif result["recommendation"] == "proceed_with_caution":
reduce_size_and_trade()
else:
log_and_skip(result["flags"])

For more nuanced control, use the individual risk model outputs (slippage, liquidation, funding, etc.) to make asset-specific or strategy-specific decisions.