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://api.rafidsystem.com/api/v1/trading/portfolio-exposure-check - x402:
POST https://api.rafidsystem.com/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.
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