# Rafid Trade Log Analysis API

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

Analyzes trading records to produce performance summaries, risk flags, anomaly detection, behavioral patterns, and data quality metrics for a trading account.

## Facts

- Endpoint: POST https://api.rafidsystem.com/api/v1/x402/trading/trade-log-analysis?utm_source=zero.xyz
- Price: $0.3/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-log-analysis-api-2981b602
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZpC-XzHqACvEsyrJmrIXi

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-log-analysis-api-2981b602 -d '<json body>'
```

Example prompt: Analyze my trade log — I have about 200 records and my account equity is $50,000. Flag any duplicates by deduplicating them and give me a full performance summary including PnL, win rate, risk flags, and behavioral patterns.

## When to prefer this

Use this endpoint when you need a comprehensive, structured breakdown of a trading history — covering PnL, risk, anomaly detection, behavioral analysis, and data quality in a single call. Prefer it over generic analytics when you need trading-domain-specific metrics like winning/losing streaks, session-based performance, strategy attribution, and trade record validation simultaneously.

## Known failure modes

- Invalid or empty records array returns an error
- Account equity below minimum (0) rejected
- Records array exceeding 100,000 items may be rejected
- Malformed trade record items degrade analysis quality and appear in execution metrics
- Invalid duplicateTradeIdPolicy enum value causes request failure
- Network or payment authorization failure returns HTTP 402

## 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 structured JSON object containing: a summary (total/open/closed trades, wins, losses, net PnL, fees, max winning/losing streaks, average holding duration in seconds), anomalies list, risk flags, data quality report (warnings, complete/incomplete trade counts), execution metrics (missing prices, complete/malformed/duplicate records, out-of-order timestamps), behavioral patterns, and performance breakdowns by symbol, session, and strategy.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "records": {
   "type": "array",
   "items": {},
   "maxItems": 100000
  },
  "accountEquity": {
   "type": "number",
   "minimum": 0
  },
  "duplicateTradeIdPolicy": {
   "enum": [
    "flag",
    "deduplicate"
   ],
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "summary": {
   "fees": 1,
   "wins": 1,
   "losses": 0,
   "netPnl": 9,
   "openTrades": 0,
   "totalTrades": 1,
   "closedTrades": 1,
   "maxLosingStreak": 0,
   "maxWinningStreak": 1,
   "averageHoldingDurationSeconds": 3600
  },
  "anomalies": [],
  "riskFlags": [],
  "dataQuality": {
   "warnings": [],
   "completeTradeCount": 1,
   "incompleteTradeCount": 0
  },
  "executionMetrics": {
   "missingPrices": 0,
   "completeRecords": 1,
   "malformedRecords": 0,
   "duplicateTradeIds": [],
   "outOfOrderTimestamps": 0
  },
  "behavioralPatterns": [],
  "performanceBySymbol": [],
  "performanceBySession": [],
  "performanceByStrategy": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/rafid-trade-log-analysis-api-2981b602/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)
