Raw definition
{
"name": "trade_check",
"title": "Trade economics check",
"description": "Deterministic pre-trade economics check for a long (buy) round trip. Call it before placing a trade: given size, entry/exit reference prices, maker/taker roles, fees, spread and slippage, it returns whether the trade still clears after all costs (result.economically_clears, result.reason), the net P&L and return, a per-leg cost breakdown, the break-even and minimum profitable exit prices, and every assumption applied. No predictions, no market data, no execution. Costs 1 prepaid credit per successful check; invalid input costs nothing. Requires \"Authorization: Bearer smk_...\" (get a key at https://smolabot.arison8.com).",
"inputSchema": {
"type": "object",
"required": [
"symbol",
"side",
"size",
"entry_price",
"exit_price",
"entry_liquidity",
"exit_liquidity",
"maker_fee_bps",
"taker_fee_bps",
"spread_bps",
"slippage_bps"
],
"properties": {
"side": {
"enum": [
"buy"
],
"type": "string",
"description": "Long-only: \"buy\". Shorts are rejected with SIDE_NOT_SUPPORTED."
},
"size": {
"oneOf": [
{
"type": "object",
"required": [
"quantity"
],
"properties": {
"quantity": {
"type": "number",
"exclusiveMinimum": 0
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"notional"
],
"properties": {
"notional": {
"type": "number",
"exclusiveMinimum": 0
}
},
"additionalProperties": false
}
],
"description": "Exactly one of quantity (base units) or notional (quote currency, at the entry reference price)."
},
"symbol": {
"type": "string",
"maxLength": 64,
"minLength": 1,
"description": "Label only; does not affect the math."
},
"exit_price": {
"type": "number",
"description": "Expected exit reference (mid) price, before spread, slippage and fees.",
"exclusiveMinimum": 0
},
"spread_bps": {
"type": "number",
"minimum": 0,
"description": "FULL bid/ask spread in bps; a taker leg pays half."
},
"entry_price": {
"type": "number",
"description": "Entry reference (mid) price, before spread, slippage and fees.",
"exclusiveMinimum": 0
},
"slippage_bps": {
"type": "number",
"minimum": 0,
"description": "Adverse slippage per taker leg, in bps."
},
"maker_fee_bps": {
"type": "number",
"minimum": 0,
"exclusiveMaximum": 10000
},
"taker_fee_bps": {
"type": "number",
"minimum": 0,
"exclusiveMaximum": 10000
},
"exit_liquidity": {
"enum": [
"maker",
"taker"
],
"type": "string"
},
"entry_liquidity": {
"enum": [
"maker",
"taker"
],
"type": "string"
},
"profit_buffer_bps": {
"type": "number",
"minimum": 0,
"description": "Optional required net return in bps; omitted means 0 (echoed in assumptions)."
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"ok",
"model_version",
"request_id",
"usage"
],
"properties": {
"ok": {
"type": "boolean"
},
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"errors": {
"type": "array"
},
"message": {
"type": "string"
}
},
"description": "Present when ok=false. Stable machine-readable code; field-level `errors` for VALIDATION_FAILED."
},
"usage": {
"type": "object",
"required": [
"credits_used",
"credits_remaining"
],
"properties": {
"credits_used": {
"type": "number"
},
"credits_remaining": {
"type": "number"
}
}
},
"result": {
"type": "object",
"description": "Present when ok=true: the canonical /check result."
},
"request_id": {
"type": "string"
},
"model_version": {
"type": "string",
"description": "Calculation model version. Same version + same input = same output."
}
}
},
"annotations": {
"readOnlyHint": false,
"openWorldHint": false,
"idempotentHint": false,
"destructiveHint": false
}
}