Skip to main content
Glama

TradingCalc MCP: Options, Forex, Risk Stats, Prediction Markets, On-Chain & Crypto Futures

Spread Payoff

workflow.run_spread_payoff
Read-only

Payoff, breakeven(s), and max profit/loss for a Deribit BTC/ETH vertical spread (2 legs, same option type, opposite direction, e.g. a bull call spread) or an iron condor/butterfly (4 legs: 2 calls + 2 puts) at a scenario price. Coin-settled, and the max profit/loss are genuinely NOT the flat, textbook USD-settled values: because each leg's own payoff is divided by the settlement price, (1) a debit vertical spread's peak payoff occurs exactly at its short strike, not "anywhere beyond it" - and its profit is a finite WINDOW that closes again at a high enough price, decaying back toward a full loss of the premium paid, and (2) an iron condor/butterfly's max loss is genuinely UNBOUNDED toward price->0 (maxLossCoin: null) if it has a put wing, unlike the "capped at wing width" USD-settled result - only the call side is actually bounded. Edge cases: 2 to 4 legs; strikes and premiums above zero; quantity and scenarioPrice above zero; the leg combination must form a vertical spread, iron condor or iron butterfly, otherwise it is an error naming the problem. Not covered: early exercise, margin, fees, Greeks, legs on different expiries (calendar and diagonal spreads), the probability of profit and the value before expiry. Use when user asks about a bull/bear call/put spread, vertical spread, iron condor, or iron butterfly, e.g. "what's my max loss on this BTC call spread?" or "where do my iron condor breakevens sit?". Returns: structureType (vertical_spread/iron_condor/iron_butterfly, inferred from the legs given), netDebitCoin (negative = credit received), scenarioPayoffCoin, scenarioPnlCoin/Usd, breakevenPrices (0-3, ascending), maxLossCoin/maxProfitCoin (null = unbounded), isProfitable. With exchange "binance" (USDT-settled, flat payoff) the textbook shapes apply instead of the coin-settled ones above: an iron condor's max loss is bounded (wing width less the credit) and a debit spread keeps its full profit above the short strike; it returns: structureType, netDebitUsdt, scenarioPayoffUsdt, scenarioPnlUsdt, breakevenPrices (ascending), maxLossUsdt (the worst P&L, negative when a loss; null = unbounded) and maxProfitUsdt (null = unbounded), isProfitable; USDT is not converted to USD.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "legs": "<legs>",
      "quantity": "<quantity>",
      "scenarioPrice": "<scenarioPrice>"
    },
    "name": "workflow.run_spread_payoff"
  }
}

Input Schema

NameRequiredDescriptionDefault
legsYesExactly 2 legs (same option type, opposite position - a vertical spread) or 4 legs (2 calls + 2 puts - an iron condor/butterfly). Each leg: { optionType: call|put, position: long|short, strike: number, premiumCoin: number } for Deribit, premiumUsdt instead of premiumCoin for Binance.
currencyNoUnderlying. Default BTC. XAU and XAG (gold, silver) only with exchange binance.
exchangeNoVenue whose settlement rules apply. "deribit" (default): BTC/ETH, coin-settled, premium in the base coin. "binance": BTC/ETH/XAU/XAG, USDT-settled, flat payoff max(0, S-K) per unit, premium in USDT (leg premiumUsdt); the result carries exchange and settlement fields.
quantityYesNumber of spread/condor units
scenarioPriceYesUnderlying price in USD to evaluate the payoff at

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • changedInput schema / properties / currency / description
      Previous value: -"Underlying coin. Default BTC."New value: +"Underlying. Default BTC. XAU and XAG (gold, silver) only with exchange binance."
    • changedInput schema / properties / currency / enum
      Previous value: -[
      -  "BTC",
      -  "ETH"
      -]New value: +[
      +  "BTC",
      +  "ETH",
      +  "XAU",
      +  "XAG"
      +]
    • addedInput schema / properties / exchange
      Added value: +{
      +  "description": "Venue whose settlement rules apply. \"deribit\" (default): BTC/ETH, coin-settled, premium in the base coin. \"binance\": BTC/ETH/XAU/XAG, USDT-settled, flat payoff max(0, S-K) per unit, premium in USDT (leg premiumUsdt); the result carries exchange and settlement fields.",
      +  "enum": [
      +    "deribit",
      +    "binance"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / legs / description
      Previous value: -"Exactly 2 legs (same option type, opposite position - a vertical spread) or 4 legs (2 calls + 2 puts - an iron condor/butterfly). Each leg: { optionType: call|put, position: long|short, strike: number, premiumCoin: number }."New value: +"Exactly 2 legs (same option type, opposite position - a vertical spread) or 4 legs (2 calls + 2 puts - an iron condor/butterfly). Each leg: { optionType: call|put, position: long|short, strike: number, premiumCoin: number } for Deribit, premiumUsdt instead of premiumCoin for Binance."
    • changedInput schema / properties / legs / items / properties / premiumCoin / description
      Previous value: -"Premium per contract, in the base coin"New value: +"Deribit only. Premium per contract, in the base coin"
    • addedInput schema / properties / legs / items / properties / premiumUsdt
      Added value: +{
      +  "description": "Binance only. Premium per unit, in USDT",
      +  "type": "number"
      +}
    • changedInput schema / properties / legs / items / required
      Previous value: -[
      -  "optionType",
      -  "position",
      -  "strike",
      -  "premiumCoin"
      -]New value: +[
      +  "optionType",
      +  "position",
      +  "strike"
      +]
  2. Changed2 schema fields changed
    • addedInput schema / properties / legs / items / properties / optionType / description
      Added value: +"Option type: \"call\" or \"put\""
    • addedInput schema / properties / legs / items / properties / position / description
      Added value: +"Option position: \"long\" (bought) or \"short\" (sold)"
  3. Added

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnly/non-destructive/closed-world; the description goes far beyond them by explaining the non-obvious coin-settled payoff mechanics (debit spread profit is a finite window peaking at the short strike; iron condor put-side max loss is unbounded, returned as null) and how the Binance USDT-settled path returns different shapes. It also discloses validation behavior (invalid leg combinations produce an error naming the problem) and the no-conversion rule for USDT.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded, but the middle is a dense, repetitive digression on coin-settled versus textbook payoff shapes (the same contrast is restated for the Binance branch), and the routing guidance an agent needs to select the tool arrives after that block. The two parallel return-field lists are long but do earn their place since no output schema exists.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With five parameters, nested leg objects, two settlement regimes and no output schema, the description covers everything an agent needs: valid leg counts and combinations, positivity constraints, venue-dependent fields, and full return-field semantics for both exchange branches.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3, but the description adds real meaning: netDebitCoin negative means credit received, null maxLoss/maxProfit means unbounded, and the leg set must form a recognized structure or the call fails. It also ties premiumCoin to Deribit and premiumUsdt to Binance, reinforcing the venue coupling that the schema only states per-field.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence states a specific computation (payoff, breakevens, max profit/loss) over a precisely enumerated resource set: 2-leg vertical spreads and 4-leg iron condors/butterflies on Deribit BTC/ETH, with an explicit extension to Binance. The tool is clearly distinguishable from adjacent siblings like run_options_payoff or run_straddle_strangle because the leg topologies it accepts are spelled out.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit trigger phrasing ("Use when user asks about a bull/bear call/put spread, vertical spread, iron condor, or iron butterfly") with two concrete example queries, plus a "Not covered" list excluding early exercise, margin, fees, Greeks, calendar/diagonal spreads, probability of profit and pre-expiry value. The one gap is that it never names an alternative sibling tool to route to when the request falls outside that scope.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.