trade_risk_score
Calculate a transparent deterministic 0–100 risk score for a proposed trade from entry, protection, sizing, account and portfolio context.
When to use
Use before an agent recommends or executes a trade and needs an auditable risk score rather than an opaque model judgment.
Selection guidance
Role: supporting. Use before an agent recommends or executes a trade and needs an auditable risk score rather than an opaque model judgment.
Use cases
- trade risk
- position sizing
- risk reward
- pre-trade check
- leverage check
Access
- REST:
POST https://rafid-agent-api.vercel.app/api/v1/trading/trade-risk-score - x402:
POST https://rafid-agent-api.vercel.app/api/v1/x402/trading/trade-risk-score - MCP tool:
trade_risk_score
Price: $0.25 USD per call. Payment options are deployment-configured; inspect /api/v1/payment-methods. Prices and payment semantics are unchanged from the canonical registry.
Get the full result
0.25 USD per call
Pay with USDC · request an x402 challenge
curl -X POST 'https://rafid-agent-api.vercel.app/api/v1/x402/trading/trade-risk-score' -H 'Content-Type: application/json' --data '{"trade":{"symbol":"BTCUSD","direction":"long","entryPrice":100,"stopLoss":95,"takeProfit":115,"quantity":1},"account":{"accountEquity":1000}}'Authorized x402 client · signed retry request
curl -X POST 'https://rafid-agent-api.vercel.app/api/v1/x402/trading/trade-risk-score' -H 'Content-Type: application/json' -H 'PAYMENT-SIGNATURE: <PAYMENT_SIGNATURE_FROM_AUTHORIZED_CLIENT>' -H 'X-Rafid-Payment-Journey: <PAYMENT_JOURNEY_FROM_CHALLENGE>' -H 'Idempotency-Key: <UNIQUE_REQUEST_ID>' --data '{"trade":{"symbol":"BTCUSD","direction":"long","entryPrice":100,"stopLoss":95,"takeProfit":115,"quantity":1},"account":{"accountEquity":1000}}'Use an x402-compatible client to parse PAYMENT-REQUIRED and authorize payment before retrying the same input with PAYMENT-SIGNATURE. Copying a request does not pay.
No crypto wallet? Use Rafid Credits
curl -X POST 'https://rafid-agent-api.vercel.app/api/v1/trading/trade-risk-score' -H 'Content-Type: application/json' -H 'Authorization: Bearer <RAFID_API_KEY>' -H 'X-Rafid-Payment-Method: credits' -H 'Idempotency-Key: <UNIQUE_REQUEST_ID>' -H 'X-Rafid-Payment-Journey: <PAYMENT_JOURNEY_FROM_CHALLENGE>' --data '{"trade":{"symbol":"BTCUSD","direction":"long","entryPrice":100,"stopLoss":95,"takeProfit":115,"quantity":1},"account":{"accountEquity":1000}}'Create an API key instantly via POST https://rafid-agent-api.vercel.app/api/v1/account/signup or at https://rafid-agent-api.vercel.app/get-started, then fund by card (Stripe) or USDC and save with monthly plans ($10–$500/mo).
Existing account balance: GET https://rafid-agent-api.vercel.app/api/v1/account/balance.
MCP Credits integration
POST https://rafid-agent-api.vercel.app/mcp/credits
Authorization: Bearer <OAUTH_ACCESS_TOKEN>
Idempotency-Key: <UNIQUE_REQUEST_ID>
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "trade_risk_score",
"arguments": {
"trade": {
"symbol": "BTCUSD",
"direction": "long",
"entryPrice": 100,
"stopLoss": 95,
"takeProfit": 115,
"quantity": 1
},
"account": {
"accountEquity": 1000
}
}
}
}OAuth metadata: authorization server · protected resource. Operator authorization and an existing funded account are required; OAuth does not grant credits.
Payment instructions and onboarding · API docs and schemas
These are copyable API integration requests. They do not open a checkout or execute a paid tool.
Related tools
Example input
{
"trade": {
"symbol": "BTCUSD",
"direction": "long",
"entryPrice": 100,
"stopLoss": 95,
"takeProfit": 115,
"quantity": 1
},
"account": {
"accountEquity": 1000
}
}Example output
{
"riskScore": 20,
"riskLevel": "low",
"riskAmount": 5,
"accountRiskPct": 0.005,
"riskRewardRatio": 3,
"positionExposurePct": 0.1,
"leverage": 0.1,
"riskFactors": [],
"positiveFactors": [
"Account risk is within the 6% threshold.",
"Risk/reward ratio is at least 1:1."
],
"warnings": [],
"calculationBreakdown": {
"components": {
"accountRisk": 3.3333,
"positionExposure": 8.3333
},
"thresholds": {
"maxPositionPct": 0.3,
"maxPortfolioRiskPct": 0.5,
"maxDailyLossPct": 0.06
},
"assumptions": []
}
}Input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"trade": {
"type": "object",
"properties": {
"symbol": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"direction": {
"type": "string",
"enum": [
"long",
"short"
]
},
"entryPrice": {
"type": "number",
"exclusiveMinimum": 0
},
"stopLoss": {
"type": "number",
"exclusiveMinimum": 0
},
"takeProfit": {
"type": "number",
"exclusiveMinimum": 0
},
"takeProfits": {
"maxItems": 20,
"type": "array",
"items": {
"type": "number",
"exclusiveMinimum": 0
}
},
"quantity": {
"type": "number",
"exclusiveMinimum": 0
},
"volatilityPct": {
"type": "number",
"minimum": 0
},
"liquidityScore": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"strategy": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"timeframe": {
"type": "string",
"minLength": 1,
"maxLength": 30
},
"leverage": {
"type": "number",
"exclusiveMinimum": 0
}
},
"required": [
"direction",
"entryPrice",
"quantity"
],
"additionalProperties": false
},
"account": {
"type": "object",
"properties": {
"accountBalance": {
"type": "number"
},
"accountEquity": {
"type": "number"
},
"availableMargin": {
"type": "number",
"minimum": 0
},
"marginUsed": {
"type": "number",
"minimum": 0
},
"maxPositionPct": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"maxPortfolioRiskPct": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"maxDailyLossPct": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"maxConcurrentPositions": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"additionalProperties": false
},
"existingPositions": {
"maxItems": 10000,
"type": "array",
"items": {
"type": "object",
"properties": {
"positionId": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"symbol": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"strategy": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"assetClass": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"direction": {
"type": "string",
"enum": [
"long",
"short"
]
},
"quantity": {
"type": "number",
"exclusiveMinimum": 0
},
"entryPrice": {
"type": "number",
"exclusiveMinimum": 0
},
"currentPrice": {
"type": "number",
"exclusiveMinimum": 0
},
"marketValue": {
"type": "number",
"minimum": 0
},
"stopLoss": {
"type": "number",
"exclusiveMinimum": 0
},
"fees": {
"type": "number",
"minimum": 0
},
"leverage": {
"type": "number",
"exclusiveMinimum": 0
},
"margin": {
"type": "number",
"minimum": 0
}
},
"required": [
"symbol",
"direction",
"quantity",
"entryPrice"
],
"additionalProperties": false
}
},
"historicalRisk": {
"type": "object",
"properties": {
"lossRate": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"maxDrawdownPct": {
"type": "number"
},
"averageRMultiple": {
"type": "number"
}
},
"additionalProperties": false
}
},
"required": [
"trade"
],
"additionalProperties": false
}Output schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"riskScore": {
"type": "integer",
"minimum": 0,
"maximum": 100
},
"riskLevel": {
"type": "string",
"enum": [
"low",
"moderate",
"high",
"critical"
]
},
"riskAmount": {
"type": [
"number",
"null"
]
},
"accountRiskPct": {
"type": [
"number",
"null"
]
},
"riskRewardRatio": {
"type": [
"number",
"null"
]
},
"positionExposurePct": {
"type": [
"number",
"null"
]
},
"leverage": {
"type": [
"number",
"null"
]
},
"safeLeverage": {
"type": [
"number",
"null"
]
},
"riskFactors": {
"type": "array",
"items": {
"type": "string"
}
},
"positiveFactors": {
"type": "array",
"items": {
"type": "string"
}
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
},
"calculationBreakdown": {
"type": "object",
"properties": {
"components": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "number"
}
},
"thresholds": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "number"
}
},
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"components",
"thresholds",
"assumptions"
],
"additionalProperties": false
},
"sourceTraceability": {
"type": "object",
"properties": {
"strategyPerformance": {
"type": "string",
"enum": [
"GROK",
"SIGNALFLOW",
"MERGED",
"NEW"
]
},
"tradeRisk": {
"type": "string",
"enum": [
"GROK",
"SIGNALFLOW",
"MERGED",
"NEW"
]
},
"portfolioExposure": {
"type": "string",
"enum": [
"GROK",
"SIGNALFLOW",
"MERGED",
"NEW"
]
},
"tradeLog": {
"type": "string",
"enum": [
"GROK",
"SIGNALFLOW",
"MERGED",
"NEW"
]
},
"notes": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"strategyPerformance",
"tradeRisk",
"portfolioExposure",
"tradeLog",
"notes"
],
"additionalProperties": false
}
},
"required": [
"riskScore",
"riskLevel",
"riskAmount",
"accountRiskPct",
"riskRewardRatio",
"positionExposurePct",
"leverage",
"riskFactors",
"positiveFactors",
"warnings",
"calculationBreakdown"
],
"additionalProperties": false
}Category: Trading Intelligence · hierarchy: supporting · idempotent: yes · side effects: no