# Rafid Trade Risk Score

> Rafid Trade Risk Score is a paid API for AI agents from api.rafidsystem.com, paid per call via x402, $0.25/call, status unknown (last checked 2026-10-10).

Calculates a structured risk score and breakdown for a proposed trade, including risk level, risk/reward ratio, position exposure, and account-level risk metrics.

## Facts

- Endpoint: POST https://api.rafidsystem.com/api/v1/x402/trading/trade-risk-score?utm_source=zero.xyz
- Price: $0.25/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/rafid-trade-risk-score-26457baa
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kIVBPLU_eWFQwaDOaHor8

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability rafid-trade-risk-score-26457baa -d '<json body>'
```

Example prompt: Score the risk of a long trade on BTCUSDT at an entry price of 65000 with a quantity of 0.5, a stop loss at 63000, and a take profit at 70000, using 5x leverage — my account balance is 10000 and I have 2000 in margin already used.

## When to prefer this

Use this endpoint when you need a structured, quantitative risk assessment of a specific trade before execution, especially when you want account-level context (margin, equity, daily loss limits) factored into the score. Prefer it over generic portfolio analytics when you need per-trade risk/reward ratios, position exposure percentages, and actionable risk factors in a single call. It is well-suited for AI trading agents that need to gate order execution based on a risk threshold.

## Known failure modes

- Missing required trade fields (direction, entryPrice, quantity) returns a 400 validation error
- Invalid enum value for direction (not 'long' or 'short') causes schema rejection
- Negative or zero values for prices, quantities, or leverage are rejected by exclusiveMinimum constraints
- Providing an account with insufficient fields may result in partial scoring without account-level risk metrics
- Network or payment failure (x402 protocol) may prevent the call from completing

## How this service works

Rafid Agent API provides structured intelligence and paid APIs for AI agents across property, company and risk, supplier, finance, document, website, automotive, logistics, recruitment, trading, voice, video and business-planning workflows.

## Output

Returns a JSON object with a numeric riskScore (0–100), a riskLevel label (e.g. 'low', 'medium', 'high'), riskAmount in currency units, accountRiskPct, positionExposurePct, leverage, riskRewardRatio, arrays of riskFactors and positiveFactors, warnings, and a calculationBreakdown showing component scores, applied thresholds, and any assumptions made.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "trade": {
   "type": "object",
   "required": [
    "direction",
    "entryPrice",
    "quantity"
   ],
   "properties": {
    "symbol": {
     "type": "string",
     "maxLength": 100,
     "minLength": 1
    },
    "leverage": {
     "type": "number",
     "exclusiveMinimum": 0
    },
    "quantity": {
     "type": "number",
     "exclusiveMinimum": 0
    },
    "stopLoss": {
     "type": "number",
     "exclusiveMinimum": 0
    },
    "strategy": {
     "type": "string",
     "maxLength": 100,
     "minLength": 1
    },
    "direction": {
     "enum": [
      "long",
      "short"
     ],
     "type": "string"
    },
    "timeframe": {
     "type": "string",
     "maxLength": 30,
     "minLength": 1
    },
    "entryPrice": {
     "type": "number",
     "exclusiveMinimum": 0
    },
    "takeProfit": {
     "type": "number",
     "exclusiveMinimum": 0
    },
    "takeProfits": {
     "type": "array",
     "items": {
      "type": "number",
      "exclusiveMinimum": 0
     },
     "maxItems": 20
    },
    "volatilityPct": {
     "type": "number",
     "minimum": 0
    },
    "liquidityScore": {
     "type": "number",
     "maximum": 1,
     "minimum": 0
    }
   },
   "additionalProperties": false
  },
  "account": {
   "type": "object",
   "properties": {
    "marginUsed": {
     "type": "number",
     "minimum": 0
    },
    "accountEquity": {
     "type": "number"
    },
    "accountBalance": {
     "type": "number"
    },
    "maxPositionPct": {
     "type": "number",
     "maximum": 1,
     "minimum": 0
    },
    "availableMargin": {
     "type": "number",
     "minimum": 0
    },
    "maxDailyLossPct": {
     "type": "number",
     "maximum": 1,
     "minimum": 0
    },
    "maxPortfolioRiskPct": {
     "type": "number",
     "maximum": 1,
     "minimum": 0
    },
    "maxConcurrentPositions": {
     "type": "integer",
     "maximum": 9007199254740991,
     "exclusiveMinimum": 0
    }
   },
   "additionalProperties": false
  },
  "historicalRisk": {
   "type": "object",
   "properties": {
    "lossRate": {
     "type": "number",
     "maximum": 1,
     "minimum": 0
    },
    "maxDrawdownPct": {
     "type": "number"
    },
    "averageRMultiple": {
     "type": "number"
    }
   },
   "additionalProperties": false
  },
  "existingPositions": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "symbol",
     "direction",
     "quantity",
     "entryPrice"
    ],
    "properties":
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "leverage": 0.1,
  "warnings": [],
  "riskLevel": "low",
  "riskScore": 20,
  "riskAmount": 5,
  "riskFactors": [],
  "accountRiskPct": 0.005,
  "positiveFactors": [
   "Account risk is within the 6% threshold.",
   "Risk/reward ratio is at least 1:1."
  ],
  "riskRewardRatio": 3,
  "positionExposurePct": 0.1,
  "calculationBreakdown": {
   "components": {
    "accountRisk": 3.3333,
    "positionExposure": 8.3333
   },
   "thresholds": {
    "maxPositionPct": 0.3,
    "maxDailyLossPct": 0.06,
    "maxPortfolioRiskPct": 0.5
   },
   "assumptions": []
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/rafid-trade-risk-score-26457baa/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.rafidsystem.com](https://www.zero.xyz/host/api.rafidsystem.com/llms.txt)
