Trade economics check
trade_checkDeterministic 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).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Long-only: "buy". Shorts are rejected with SIDE_NOT_SUPPORTED. | |
| size | Yes | Exactly one of quantity (base units) or notional (quote currency, at the entry reference price). | |
| symbol | Yes | Label only; does not affect the math. | |
| exit_price | Yes | Expected exit reference (mid) price, before spread, slippage and fees. | |
| spread_bps | Yes | FULL bid/ask spread in bps; a taker leg pays half. | |
| entry_price | Yes | Entry reference (mid) price, before spread, slippage and fees. | |
| slippage_bps | Yes | Adverse slippage per taker leg, in bps. | |
| maker_fee_bps | Yes | ||
| taker_fee_bps | Yes | ||
| exit_liquidity | Yes | ||
| entry_liquidity | Yes | ||
| profit_buffer_bps | No | Optional required net return in bps; omitted means 0 (echoed in assumptions). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | Present when ok=false. Stable machine-readable code; field-level `errors` for VALIDATION_FAILED. | |
| usage | Yes | ||
| result | No | Present when ok=true: the canonical /check result. | |
| request_id | Yes | ||
| model_version | Yes | Calculation model version. Same version + same input = same output. |