Deterministic workflows
A deterministic workflow answers a specific trader question by orchestrating several calculation primitives and applying a classification layer on top. The answer is always the same for the same inputs — no model variation, no hallucination, no rounding drift.
Calculator vs workflow
Calculators are primitives — they compute one number. Workflows are decision tools — they chain primitives and tell you what to do with the result.
Returns a number. You interpret it. "Liquidation price: $76,925." What does that mean for this setup? Up to you.
Returns a verdict + explanation. "WARN: liquidation is 9.5% away — closer than your stop. Consider reducing leverage." The decision layer is built in.
Taxonomy: three layers of abstraction
TradingCalc organises its tools into three levels. Each level builds on the one below.
PnL, Liquidation price, Breakeven, Position size, Funding cost
Max safe leverage, Scenario PnL table, Compound funding decay
Pre-trade check, Risk/reward, Carry trade, DCA entry, Scale-out, Funding breakeven
How a workflow is built
Each workflow is a pure TypeScript function in src/lib/workflows/ that calls one or more calculator modules, aggregates the outputs, and applies a classification rule. The UI layer renders the verdict — it never touches the math.
All 6 workflows
Runs four primitives in one pass. Surfaces the liquidation distance, carry cost, and required margin before you commit capital.
Computes expected reward vs defined risk. Verdict is based on the R:R ratio and a configurable minimum threshold.
Sizes the delta-neutral hedge and computes the net funding yield after hedging costs — shows if the carry is actually profitable.
Distributes position size across price levels. Shows the blended average entry and checks liquidation safety at full deployment.
Plans partial exits at multiple targets. Shows the PnL at each level, the reduced risk after each close, and the running breakeven.
Given an unrealized profit and a funding rate, computes how long you can hold before carry cost neutralises the gain.
Why determinism matters specifically for workflows
A probabilistic workflow (e.g. an LLM asked “should I open this trade?”) will give a different answer each time, even for identical inputs. For a one-off analysis that may be fine. For a risk monitor that fires alerts, a backtester replaying 10,000 trades, or an AI agent making sequential decisions — it is not.
Deterministic workflows are also composable: the output of “Is this trade worth taking?” can feed directly into “How should I size the position?” — and the combined result is still auditable end-to-end.
Use workflows via API
Every workflow is callable through the REST API and the MCP layer. The same function that powers the UI is the one your agent or bot calls.
Start with a workflow
Open the pre-trade check, enter your setup, and get a verdict in under 10 seconds. No account needed.