portfolio_exposure_check
Aggregate supplied open and proposed positions into gross, net, directional and concentration exposure with stop-risk and margin indicators.
When to use
Use when an agent needs to assess portfolio concentration or directional exposure before adding or modifying a position.
Selection guidance
Role: supporting. Use when an agent needs to assess portfolio concentration or directional exposure before adding or modifying a position.
Use cases
- portfolio exposure
- concentration check
- gross exposure
- net exposure
- margin usage
Access
- REST:
POST https://rafid-agent-api.vercel.app/api/v1/trading/portfolio-exposure-check - x402:
POST https://rafid-agent-api.vercel.app/api/v1/x402/trading/portfolio-exposure-check - MCP tool:
portfolio_exposure_check
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/portfolio-exposure-check' -H 'Content-Type: application/json' --data '{"positions":[{"symbol":"BTCUSD","direction":"long","quantity":1,"entryPrice":100,"currentPrice":105,"stopLoss":95}],"account":{"accountEquity":1000}}'Authorized x402 client · signed retry request
curl -X POST 'https://rafid-agent-api.vercel.app/api/v1/x402/trading/portfolio-exposure-check' -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 '{"positions":[{"symbol":"BTCUSD","direction":"long","quantity":1,"entryPrice":100,"currentPrice":105,"stopLoss":95}],"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/portfolio-exposure-check' -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 '{"positions":[{"symbol":"BTCUSD","direction":"long","quantity":1,"entryPrice":100,"currentPrice":105,"stopLoss":95}],"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": "portfolio_exposure_check",
"arguments": {
"positions": [
{
"symbol": "BTCUSD",
"direction": "long",
"quantity": 1,
"entryPrice": 100,
"currentPrice": 105,
"stopLoss": 95
}
],
"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
{
"positions": [
{
"symbol": "BTCUSD",
"direction": "long",
"quantity": 1,
"entryPrice": 100,
"currentPrice": 105,
"stopLoss": 95
}
],
"account": {
"accountEquity": 1000
}
}Example output
{
"grossExposure": 105,
"netExposure": 105,
"longExposure": 105,
"shortExposure": 0,
"exposurePctOfEquity": 0.105,
"largestConcentrationPct": 0.105,
"leverage": 0.105,
"positions": [
{
"symbol": "BTCUSD",
"direction": "long",
"exposure": 105,
"concentrationPct": 0.105,
"openRisk": 5
}
],
"concentrationFlags": [],
"riskFlags": [
"Portfolio is fully long."
],
"summary": "Portfolio has 1 position(s), gross exposure 105 and net exposure 105.",
"accountEquity": 1000,
"openRisk": 5,
"marginUsage": 0,
"availableFreeMargin": 1000
}Input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"positions": {
"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
}
},
"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
},
"proposedPosition": {
"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
},
"correlations": {
"maxItems": 100000,
"type": "array",
"items": {
"type": "object",
"properties": {
"symbolA": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"symbolB": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"correlation": {
"type": "number",
"minimum": -1,
"maximum": 1
}
},
"required": [
"symbolA",
"symbolB",
"correlation"
],
"additionalProperties": false
}
}
},
"required": [
"positions"
],
"additionalProperties": false
}Output schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"grossExposure": {
"type": "number",
"minimum": 0
},
"netExposure": {
"type": "number"
},
"longExposure": {
"type": "number",
"minimum": 0
},
"shortExposure": {
"type": "number",
"minimum": 0
},
"exposurePctOfEquity": {
"type": [
"number",
"null"
]
},
"largestConcentrationPct": {
"type": [
"number",
"null"
]
},
"leverage": {
"type": [
"number",
"null"
]
},
"positions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"symbol": {
"type": "string"
},
"direction": {
"type": "string",
"enum": [
"long",
"short"
]
},
"exposure": {
"type": "number",
"minimum": 0
},
"concentrationPct": {
"type": [
"number",
"null"
]
},
"openRisk": {
"type": [
"number",
"null"
]
}
},
"required": [
"symbol",
"direction",
"exposure",
"concentrationPct",
"openRisk"
],
"additionalProperties": false
}
},
"concentrationFlags": {
"type": "array",
"items": {
"type": "string"
}
},
"riskFlags": {
"type": "array",
"items": {
"type": "string"
}
},
"summary": {
"type": "string"
},
"accountEquity": {
"type": [
"number",
"null"
]
},
"openRisk": {
"type": [
"number",
"null"
]
},
"marginUsage": {
"type": [
"number",
"null"
]
},
"availableFreeMargin": {
"type": [
"number",
"null"
]
},
"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": [
"grossExposure",
"netExposure",
"longExposure",
"shortExposure",
"exposurePctOfEquity",
"largestConcentrationPct",
"leverage",
"positions",
"concentrationFlags",
"riskFlags",
"summary",
"accountEquity",
"openRisk",
"marginUsage",
"availableFreeMargin"
],
"additionalProperties": false
}Category: Trading Intelligence · hierarchy: supporting · idempotent: yes · side effects: no