{"openapi":"3.1.0","info":{"title":"Investing Math","version":"1.0.0","description":"Position sizing, drawdowns, Sharpe, DCA, dividends, FIRE and option payoffs for trading bots and planners. One call, one computed answer, no accounts or API keys. Machine-payable over x402.","x-guidance":"Investing Math: Position sizing, drawdowns, Sharpe, DCA, dividends, FIRE and option payoffs for trading bots and planners. Investing Math: /position-size, /drawdown-recovery, /risk-reward, /return-stats, /dca-vs-lump, /dividend-math, /inflation-adjust, /fire-number, /portfolio-risk, /option-payoff, /expected-move, /margin-call Each paid GET returns a computed verdict with the reasons, the source and what was NOT checked. A verdict of UNVERIFIED means a lookup failed: treat it as unknown. No account or key: pay per call in USDC over x402."},"servers":[{"url":"https://invest-math.x402tookit.com"}],"paths":{"/dca-vs-lump":{"get":{"operationId":"dca_vs_lump","summary":"Compare equal periodic buys (dollar-cost averaging) with one lump sum on the first date, over a list of prices.","description":"Compare equal periodic buys (dollar-cost averaging) with one lump sum on the first date, over a list of prices.","tags":["dca","lump-sum","investing","backtest"],"parameters":[{"name":"prices","in":"query","required":true,"description":"Price at each buy date, comma separated, 2 to 600 values","schema":{"type":"string"}},{"name":"perBuy","in":"query","required":true,"description":"Amount invested at each date","schema":{"type":"number"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"buys":{"type":["null","number"]},"totalInvested":{"type":["null","number"]},"dca":{"type":["null","object"],"properties":{"units":{"type":["null","number"]},"averageCost":{"type":["null","number"]},"finalValue":{"type":["null","number"]},"returnPct":{"type":["null","number"]}}},"lumpSum":{"type":["null","object"],"properties":{"units":{"type":["null","number"]},"cost":{"type":["null","number"]},"finalValue":{"type":["null","number"]},"returnPct":{"type":["null","number"]}}},"winner":{"type":["null","string"]},"finalPrice":{"type":["null","number"]},"priceChangePct":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"DCA_AHEAD","summary":"Investing 6000 in 6 equal buys ends at 6588.98 (9.82%, average cost 95.6143); one lump sum on day one ends at 6300 (5%). DCA finishes ahead by 288.98.","reasons":["Each DCA buy purchases amount / price units; the lump sum buys everything at the first price.","When prices trend up, the lump sum usually wins because more money is invested longer; when they fall first, DCA tends to win."],"buys":6,"totalInvested":6000,"dca":{"units":62.752146,"averageCost":95.614261,"finalValue":6588.975279,"returnPct":9.81625},"lumpSum":{"units":60,"cost":100,"finalValue":6300,"returnPct":5},"winner":"DCA","finalPrice":105,"priceChangePct":5,"degraded":false,"notChecked":["real-world frictions: fees, spreads, taxes and the interest that cash waiting to be invested could earn","what the prices do after the last date","…2 more"],"source":"computed locally","asOf":"2026-10-11T20:30:27.882Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/dca-vs-lump"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/dca-vs-lump"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/dca-vs-lump"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/dca-vs-lump"}}]}}},"/dividend-math":{"get":{"operationId":"dividend_math","summary":"Dividend yield, yearly income, and yield on cost and total dividends after years of dividend growth.","description":"Dividend yield, yearly income, and yield on cost and total dividends after years of dividend growth.","tags":["dividends","yield","income","yield-on-cost"],"parameters":[{"name":"price","in":"query","required":true,"description":"Share price","schema":{"type":"number"}},{"name":"annualDividend","in":"query","required":true,"description":"Dividend per share per year","schema":{"type":"number"}},{"name":"shares","in":"query","required":false,"description":"Shares held, default 100","schema":{"type":"number"}},{"name":"growthPct","in":"query","required":false,"description":"Yearly dividend growth in percent, default 0","schema":{"type":"number"}},{"name":"years","in":"query","required":false,"description":"Years to project, 1 to 60 (default 10)","schema":{"type":"integer"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"yieldPct":{"type":["null","number"]},"annualIncome":{"type":["null","number"]},"monthlyIncome":{"type":["null","number"]},"dividendAfterYears":{"type":["null","number"]},"yieldOnCostPct":{"type":["null","number"]},"cumulativeDividends":{"type":["null","number"]},"years":{"type":["null","number"]},"growthPct":{"type":["null","number"]},"positionValue":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COMPUTED","summary":"Yield 4%; 200 a year on 100 shares. After 10 years at 5% growth the dividend is 3.2578 a share (yield on cost 6.52%) and 2515.58 has been paid in total.","reasons":["Yield = dividend / price; yield on cost = future dividend / today's price.","Cumulative dividends are the sum of each year's dividend: year 1 is today's dividend, then it grows."],"yieldPct":4,"annualIncome":200,"monthlyIncome":16.666667,"dividendAfterYears":3.2577893,"yieldOnCostPct":6.51558,"cumulativeDividends":2515.578507,"years":10,"growthPct":5,"positionValue":5000,"degraded":false,"notChecked":["whether the dividend will be paid, cut or grown: it is a decision the company can change","share price changes, which this ignores (yield on cost uses today's price)","…2 more"],"source":"computed locally","asOf":"2026-10-11T20:30:28.143Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/dividend-math"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/dividend-math"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/dividend-math"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/dividend-math"}}]}}},"/drawdown-recovery":{"get":{"operationId":"drawdown_recovery","summary":"Gain needed to recover a percentage loss, or the maximum drawdown and recovery gain from a list of period returns.","description":"Gain needed to recover a percentage loss, or the maximum drawdown and recovery gain from a list of period returns.","tags":["drawdown","recovery","risk","portfolio"],"parameters":[{"name":"lossPct","in":"query","required":false,"description":"A loss in percent, 0 to 99.9, for the gain needed to get back to even","schema":{"type":"number"}},{"name":"returnsPct","in":"query","required":false,"description":"Period returns in percent, comma separated, e.g. 5,-10,3 (instead of lossPct)","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"lossPct":{"type":["null","number"]},"requiredGainPct":{"type":["null","number"]},"yearsAt10Pct":{"type":["null","number"]},"yearsAt7Pct":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COMPUTED","summary":"After a 50% loss you need a 100% gain to get back to even.","reasons":["Required gain = loss / (1 - loss): losses hurt more than the same-size gains help.","At 10% a year, recovery would take about 7.3 years."],"lossPct":50,"requiredGainPct":100,"yearsAt10Pct":7.273,"yearsAt7Pct":10.24,"degraded":false,"notChecked":["how long recovery takes: that depends on future returns","intra-period drops: a drawdown inside a period is invisible in period returns","…1 more"],"source":"computed locally","asOf":"2026-10-11T20:30:28.408Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/drawdown-recovery"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/drawdown-recovery"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/drawdown-recovery"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/drawdown-recovery"}}]}}},"/expected-move":{"get":{"operationId":"expected_move","summary":"The price range implied by volatility over a number of days: one and two standard deviations, from implied or historical vol.","description":"The price range implied by volatility over a number of days: one and two standard deviations, from implied or historical vol.","tags":["volatility","expected-move","options","range"],"parameters":[{"name":"price","in":"query","required":true,"description":"Current price","schema":{"type":"number"}},{"name":"volPct","in":"query","required":true,"description":"Annualised volatility in percent, e.g. implied volatility","schema":{"type":"number"}},{"name":"days","in":"query","required":true,"description":"Calendar days ahead, 0.1 to 3650","schema":{"type":"number"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"oneSigmaPct":{"type":["null","number"]},"oneSigmaMove":{"type":["null","number"]},"oneSigmaLow":{"type":["null","number"]},"oneSigmaHigh":{"type":["null","number"]},"twoSigmaLow":{"type":["null","number"]},"twoSigmaHigh":{"type":["null","number"]},"dailyMovePct":{"type":["null","number"]},"horizonDays":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COMPUTED","summary":"Over 30 days at 30% volatility, a one standard deviation move is about +/-8.6 (8.6%): roughly 68% of outcomes between 91.76 and 108.98, 95% between 84.2 and 118.77.","reasons":["One-sigma move = price x volatility x sqrt(days / 365); lognormal bounds use exp(+/- sigma).","Assumes a normal distribution of returns, which understates tail risk."],"oneSigmaPct":8.60073,"oneSigmaMove":8.6007327,"oneSigmaLow":91.758751,"oneSigmaHigh":108.98143,"twoSigmaLow":84.196684,"twoSigmaHigh":118.76952,"dailyMovePct":1.5703,"horizonDays":30,"degraded":false,"notChecked":["the real distribution: returns have fat tails, so moves beyond two standard deviations happen more often than a normal curve says","direction: the range is symmetric and says nothing about up or down","…1 more"],"source":"computed locally","asOf":"2026-10-11T20:30:28.673Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/expected-move"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/expected-move"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/expected-move"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/expected-move"}}]}}},"/fire-number":{"get":{"operationId":"fire_number","summary":"Financial-independence number from yearly spending and a withdrawal rate, and years to reach it from savings and contributions.","description":"Financial-independence number from yearly spending and a withdrawal rate, and years to reach it from savings and contributions.","tags":["fire","retirement","withdrawal-rate","planning"],"parameters":[{"name":"annualSpending","in":"query","required":true,"description":"Yearly spending you want to cover","schema":{"type":"number"}},{"name":"withdrawalRatePct","in":"query","required":false,"description":"Safe withdrawal rate in percent, 2 to 10 (default 4)","schema":{"type":"number"}},{"name":"currentSavings","in":"query","required":false,"description":"Invested savings today, default 0","schema":{"type":"number"}},{"name":"yearlyContribution","in":"query","required":false,"description":"What you add each year, default 0","schema":{"type":"number"}},{"name":"realReturnPct","in":"query","required":false,"description":"Yearly return after inflation in percent, default 5","schema":{"type":"number"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"fireNumber":{"type":["null","number"]},"impliedMultiple":{"type":["null","number"]},"withdrawalRatePct":{"type":["null","number"]},"monthlySpendingCovered":{"type":["null","number"]},"currentSavings":{"type":["null","number"]},"progressPct":{"type":["null","number"]},"yearsToTarget":{"type":["null","number"]},"reachable":{"type":["boolean","null"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"TARGET_AND_TIMELINE","summary":"Covering 40000 a year at a 4% withdrawal rate needs 1000000. From 100000 saving 20000 a year at 5% real return, that takes about 21.1 years.","reasons":["Target = spending / withdrawal rate (4% means 25 times spending).","Years = ln((target x r + contribution) / (savings x r + contribution)) / ln(1 + r), contributions at year end, return after inflation."],"fireNumber":1000000,"impliedMultiple":25,"withdrawalRatePct":4,"monthlySpendingCovered":3333.3333,"currentSavings":100000,"progressPct":10,"yearsToTarget":21.103,"reachable":true,"degraded":false,"notChecked":["whether any withdrawal rate is safe for you: the 4% rule comes from historical US data over 30 years, and longer retirements, other markets and bad early returns can break it","taxes, healthcare, Social Security and changing spending","…2 more"],"source":"computed locally","asOf":"2026-10-11T20:30:28.937Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/fire-number"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/fire-number"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/fire-number"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/fire-number"}}]}}},"/inflation-adjust":{"get":{"operationId":"inflation_adjust","summary":"What an amount costs or is worth after years of steady inflation, plus the real return after inflation for a nominal return.","description":"What an amount costs or is worth after years of steady inflation, plus the real return after inflation for a nominal return.","tags":["inflation","purchasing-power","real-return","planning"],"parameters":[{"name":"amount","in":"query","required":true,"description":"Amount in today's money","schema":{"type":"number"}},{"name":"inflationPct","in":"query","required":true,"description":"Yearly inflation in percent, -10 to 100","schema":{"type":"number"}},{"name":"years","in":"query","required":true,"description":"Years, 0 to 100","schema":{"type":"number"}},{"name":"nominalReturnPct","in":"query","required":false,"description":"A nominal yearly return in percent, to get the real return","schema":{"type":"number"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"futureCostOfToday":{"type":["null","number"]},"purchasingPowerOfAmount":{"type":["null","number"]},"cumulativeInflationPct":{"type":["null","number"]},"priceMultiple":{"type":["null","number"]},"halvingYears":{"type":["null","number"]},"realReturnPct":{"type":["null","number"]},"realGrowthOfAmount":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COMPUTED","summary":"At 3% inflation, what costs 100 today costs 134.39 in 10 years, and 100 then buys what 74.41 buys today. A 7% nominal return is a 3.883% real return (Fisher equation).","reasons":["Future cost = amount x (1 + inflation)^years; purchasing power is the inverse.","Real return = (1 + nominal) / (1 + inflation) - 1, slightly less than nominal minus inflation."],"futureCostOfToday":134.3916379,"purchasingPowerOfAmount":74.40939149,"cumulativeInflationPct":34.3916,"priceMultiple":1.3439164,"halvingYears":23.45,"realReturnPct":3.8835,"realGrowthOfAmount":146.3745355,"degraded":false,"notChecked":["actual inflation, which is not steady and differs by the goods you buy (use official CPI series for real data)","taxes on investment returns","…1 more"],"source":"computed locally","asOf":"2026-10-11T20:30:29.201Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/inflation-adjust"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/inflation-adjust"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/inflation-adjust"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/inflation-adjust"}}]}}},"/margin-call":{"get":{"operationId":"margin_call","summary":"Margin call price for shares bought on margin: your cash, the loan, the maintenance requirement and the trigger price.","description":"Margin call price for shares bought on margin: your cash, the loan, the maintenance requirement and the trigger price.","tags":["margin","leverage","margin-call","stocks"],"parameters":[{"name":"shares","in":"query","required":true,"description":"Shares bought","schema":{"type":"number"}},{"name":"price","in":"query","required":true,"description":"Purchase price per share","schema":{"type":"number"}},{"name":"initialMarginPct","in":"query","required":false,"description":"Share of the purchase paid with your own cash, 10 to 100 (default 50)","schema":{"type":"number"}},{"name":"maintenancePct","in":"query","required":false,"description":"Maintenance margin in percent of position value, 10 to 60 (default 25)","schema":{"type":"number"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"positionValue":{"type":["null","number"]},"ownCash":{"type":["null","number"]},"loan":{"type":["null","number"]},"leverage":{"type":["null","number"]},"marginCallPrice":{"type":["null","number"]},"dropToCallPct":{"type":["null","number"]},"dropToWipeoutPct":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COMPUTED","summary":"Position 5000 with 2500 of your own cash and a 2500 loan: a margin call triggers if the price falls to 33.3333, a 33.3% drop (2x leverage).","reasons":["Equity ratio = (price x shares - loan) / (price x shares); a call fires when it falls to the maintenance percent.","Call price = loan / (shares x (1 - maintenance)).","…1 more"],"positionValue":5000,"ownCash":2500,"loan":2500,"leverage":2,"marginCallPrice":33.333333,"dropToCallPct":33.3333,"dropToWipeoutPct":50,"degraded":false,"notChecked":["your broker's real rules: maintenance can be higher, house rules change without notice, and volatile stocks often carry 30 to 100% requirements","interest on the loan, which grows the debt and raises the call price over time","…2 more"],"source":"computed locally","asOf":"2026-10-11T20:30:29.462Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/margin-call"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/margin-call"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/margin-call"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/margin-call"}}]}}},"/option-payoff":{"get":{"operationId":"option_payoff","summary":"Expiry profit and loss for a long or short call or put: break-even, maximum gain and loss, and a payoff table.","description":"Expiry profit and loss for a long or short call or put: break-even, maximum gain and loss, and a payoff table.","tags":["options","payoff","break-even","expiry"],"parameters":[{"name":"type","in":"query","required":true,"description":"call or put","schema":{"type":"string"}},{"name":"side","in":"query","required":true,"description":"long or short","schema":{"type":"string"}},{"name":"strike","in":"query","required":true,"description":"Strike price","schema":{"type":"number"}},{"name":"premium","in":"query","required":true,"description":"Premium per share paid (long) or received (short)","schema":{"type":"number"}},{"name":"contracts","in":"query","required":false,"description":"Contracts of 100 shares, default 1","schema":{"type":"integer"}},{"name":"spot","in":"query","required":false,"description":"Price at expiry to evaluate","schema":{"type":"number"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"type":{"type":["null","string"]},"side":{"type":["null","string"]},"strike":{"type":["null","number"]},"premiumPerShare":{"type":["null","number"]},"contracts":{"type":["null","number"]},"breakEven":{"type":["null","number"]},"maxGain":{"type":["null","string"]},"maxLoss":{"type":["null","number"]},"premiumTotal":{"type":["null","number"]},"table":{"type":["array","null"],"items":{"type":"object","properties":{"priceAtExpiry":{"type":["null","number"]},"profitLoss":{"type":["null","number"]}}}},"atSpot":{"type":["null","object"],"properties":{"price":{"type":["null","number"]},"profitLoss":{"type":["null","number"]}}},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COMPUTED","summary":"long call (strike 100, premium 5, 1 contract): break-even 105, max gain unlimited, max loss 500. At 112 on expiry: 700.","reasons":["Profit and loss at expiry = direction x (intrinsic value - premium) x 100 x contracts.","Table shows profit and loss at expiry prices from 80% to 120% of the strike."],"type":"call","side":"long","strike":100,"premiumPerShare":5,"contracts":1,"breakEven":105,"maxGain":"unlimited","maxLoss":500,"premiumTotal":500,"table":[{"priceAtExpiry":80,"profitLoss":-500},{"priceAtExpiry":90,"profitLoss":-500}],"atSpot":{"price":112,"profitLoss":700},"degraded":false,"notChecked":["the value before expiry: time value, volatility and early exercise change the profit and loss","commissions, taxes, assignment and margin requirements for short options","…1 more"],"source":"computed locally","asOf":"2026-10-11T20:30:29.728Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/option-payoff"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/option-payoff"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/option-payoff"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/option-payoff"}}]}}},"/portfolio-risk":{"get":{"operationId":"portfolio_risk","summary":"Return and volatility of a two-asset mix from each asset's return, volatility and correlation, plus the lowest-risk weight.","description":"Return and volatility of a two-asset mix from each asset's return, volatility and correlation, plus the lowest-risk weight.","tags":["portfolio","diversification","correlation","volatility"],"parameters":[{"name":"weightA","in":"query","required":true,"description":"Share of asset A in percent, 0 to 100 (B is the rest)","schema":{"type":"number"}},{"name":"returnAPct","in":"query","required":true,"description":"Expected yearly return of A in percent","schema":{"type":"number"}},{"name":"returnBPct","in":"query","required":true,"description":"Expected yearly return of B in percent","schema":{"type":"number"}},{"name":"volAPct","in":"query","required":true,"description":"Yearly volatility of A in percent","schema":{"type":"number"}},{"name":"volBPct","in":"query","required":true,"description":"Yearly volatility of B in percent","schema":{"type":"number"}},{"name":"correlation","in":"query","required":true,"description":"Correlation of A and B, -1 to 1","schema":{"type":"number"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"weightAPct":{"type":["null","number"]},"weightBPct":{"type":["null","number"]},"expectedReturnPct":{"type":["null","number"]},"volatilityPct":{"type":["null","number"]},"weightedAverageVolPct":{"type":["null","number"]},"diversificationBenefitPts":{"type":["null","number"]},"minVarianceWeightAPct":{"type":["null","number"]},"minVarianceVolPct":{"type":["null","number"]},"returnPerUnitRisk":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COMPUTED","summary":"60% A / 40% B: expected return 6.4%, volatility 10.35% (the weighted average of the two volatilities would be 12%, so diversification saves 1.65 points).","reasons":["Portfolio variance = wA^2 sA^2 + wB^2 sB^2 + 2 wA wB rho sA sB; return is the weighted average.","The lowest-volatility mix is 6.6% A, at 5.91% volatility."],"weightAPct":60,"weightBPct":40,"expectedReturnPct":6.4,"volatilityPct":10.3507,"weightedAverageVolPct":12,"diversificationBenefitPts":1.6493,"minVarianceWeightAPct":6.62461,"minVarianceVolPct":5.90653,"returnPerUnitRisk":0.61832,"degraded":false,"notChecked":["whether the inputs are right: expected returns, volatility and correlation are estimates and correlations rise in crises","more than two assets and rebalancing costs","…2 more"],"source":"computed locally","asOf":"2026-10-11T20:30:29.991Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/portfolio-risk"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/portfolio-risk"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/portfolio-risk"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/portfolio-risk"}}]}}},"/position-size":{"get":{"operationId":"position_size","summary":"Position size from account size, risk percent, entry and stop: units to buy, dollars at risk, cost and R-multiple targets.","description":"Position size from account size, risk percent, entry and stop: units to buy, dollars at risk, cost and R-multiple targets.","tags":["position-sizing","risk","stop-loss","trading"],"parameters":[{"name":"account","in":"query","required":true,"description":"Account value","schema":{"type":"number"}},{"name":"riskPct","in":"query","required":true,"description":"Percent of the account to risk, 0.01 to 25","schema":{"type":"number"}},{"name":"entry","in":"query","required":true,"description":"Entry price","schema":{"type":"number"}},{"name":"stop","in":"query","required":true,"description":"Stop-loss price (below entry for long, above for short)","schema":{"type":"number"}},{"name":"feePct","in":"query","required":false,"description":"Round-trip fees as a percent of position value, default 0","schema":{"type":"number"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"direction":{"type":["null","string"]},"units":{"type":["null","number"]},"riskDollarsBudget":{"type":["null","number"]},"riskDollarsActual":{"type":["null","number"]},"positionCost":{"type":["null","number"]},"positionPctOfAccount":{"type":["null","number"]},"stopDistance":{"type":["null","number"]},"stopDistancePct":{"type":["null","number"]},"targets":{"type":["null","object"],"properties":{"oneR":{"type":["null","number"]},"twoR":{"type":["null","number"]},"threeR":{"type":["null","number"]}}},"needsLeverage":{"type":["boolean","null"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"SIZED","summary":"Long: buy 50 unit(s) at 50 for 2500 (25% of the account); a stop at 48 loses about 100, or 1% of the account.","reasons":["Units = floor(account x risk% / (distance to stop + fees per unit)).","Position cost fits inside the account without leverage.","…1 more"],"direction":"long","units":50,"riskDollarsBudget":100,"riskDollarsActual":100,"positionCost":2500,"positionPctOfAccount":25,"stopDistance":2,"stopDistancePct":4,"targets":{"oneR":52,"twoR":54,"threeR":56},"needsLeverage":false,"degraded":false,"notChecked":["slippage and gaps: a stop does not guarantee the exit price","whether the position fits your leverage, liquidity or margin limits","…1 more"],"source":"computed locally","asOf":"2026-10-11T20:30:30.256Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/position-size"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/position-size"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/position-size"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/position-size"}}]}}},"/return-stats":{"get":{"operationId":"return_stats","summary":"Performance stats from period returns: average, volatility, Sharpe, Sortino, compound growth and max drawdown.","description":"Performance stats from period returns: average, volatility, Sharpe, Sortino, compound growth and max drawdown.","tags":["sharpe","sortino","volatility","performance"],"parameters":[{"name":"returnsPct","in":"query","required":true,"description":"Period returns in percent, comma separated, at least 3","schema":{"type":"string"}},{"name":"periodsPerYear","in":"query","required":false,"description":"12 monthly (default), 52 weekly, 252 daily, 4 quarterly, 1 yearly","schema":{"type":"integer"}},{"name":"riskFreePct","in":"query","required":false,"description":"Annual risk-free rate in percent, default 0","schema":{"type":"number"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"periods":{"type":["null","number"]},"meanReturnPct":{"type":["null","number"]},"volatilityPerPeriodPct":{"type":["null","number"]},"annualisedVolatilityPct":{"type":["null","number"]},"annualisedMeanPct":{"type":["null","number"]},"sharpe":{"type":["null","number"]},"sortino":{"type":["null","number"]},"totalReturnPct":{"type":["null","number"]},"cagrPct":{"type":["null","number"]},"maxDrawdownPct":{"type":["null","number"]},"bestPeriodPct":{"type":["null","number"]},"worstPeriodPct":{"type":["null","number"]},"winRatePct":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"COMPUTED","summary":"12 periods: average 1.042%/period, volatility 6.79% a year, Sharpe 1.55, Sortino 3.45, CAGR 13.01%, max drawdown 2%.","reasons":["Sharpe = (mean - risk-free) / sample standard deviation x sqrt(periods per year); Sortino uses downside deviation below the risk-free rate.","Only 12 periods: treat the ratios as rough."],"periods":12,"meanReturnPct":1.04167,"volatilityPerPeriodPct":1.95934,"annualisedVolatilityPct":6.78735,"annualisedMeanPct":12.5,"sharpe":1.54699,"sortino":3.44721,"totalReturnPct":13.0071,"cagrPct":13.0071,"maxDrawdownPct":2,"bestPeriodPct":4,"worstPeriodPct":-2,"winRatePct":66.67,"degraded":false,"notChecked":["small samples: a Sharpe ratio from a dozen periods is very noisy","non-normal returns, fat tails and serial correlation, which the annualisation assumes away","…2 more"],"source":"computed locally","asOf":"2026-10-11T20:30:30.520Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/return-stats"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/return-stats"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/return-stats"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/return-stats"}}]}}},"/risk-reward":{"get":{"operationId":"risk_reward","summary":"Reward-to-risk ratio from entry, stop and target, the win rate needed to break even, and expectancy at your win rate.","description":"Reward-to-risk ratio from entry, stop and target, the win rate needed to break even, and expectancy at your win rate.","tags":["risk-reward","expectancy","trading","win-rate"],"parameters":[{"name":"entry","in":"query","required":true,"description":"Entry price","schema":{"type":"number"}},{"name":"stop","in":"query","required":true,"description":"Stop-loss price","schema":{"type":"number"}},{"name":"target","in":"query","required":true,"description":"Profit target price","schema":{"type":"number"}},{"name":"winRatePct","in":"query","required":false,"description":"Your expected win rate in percent, for expectancy","schema":{"type":"number"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":["null","string"]},"summary":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"direction":{"type":["null","string"]},"riskPerUnit":{"type":["null","number"]},"rewardPerUnit":{"type":["null","number"]},"rewardToRisk":{"type":["null","number"]},"breakEvenWinRatePct":{"type":["null","number"]},"winRatePct":{"type":["null","number"]},"expectancyR":{"type":["null","number"]},"expectancyPerUnit":{"type":["null","number"]},"positiveEdge":{"type":["boolean","null"]},"degraded":{"type":["boolean","null"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"source":{"type":["null","string"]},"asOf":{"type":["null","string"]},"disclaimer":{"type":["null","string"]}}},"example":{"verdict":"FAVOURABLE_RATIO","summary":"Risk 5 to make 15: 3R reward-to-risk; you must win 25% of trades to break even. At a 40% win rate the expectancy is 0.6R per trade (positive).","reasons":["Break-even win rate = 1 / (1 + R). Expectancy (in R) = win rate x R - loss rate x 1.","A good ratio does not make a trade good: the win rate has to hold up too."],"direction":"long","riskPerUnit":5,"rewardPerUnit":15,"rewardToRisk":3,"breakEvenWinRatePct":25,"winRatePct":40,"expectancyR":0.6,"expectancyPerUnit":3,"positiveEdge":true,"degraded":false,"notChecked":["whether the win rate you assume is realistic for this setup","fees, slippage and partial fills, which lower real expectancy","…1 more"],"source":"computed locally","asOf":"2026-10-11T20:30:30.782Z","disclaimer":"Screening signal computed from the named public source. Not financial, legal or investment advice; provided as is. Verify at the source before acting."}}}},"400":{"description":"A parameter was missing or out of range."},"402":{"description":"Payment Required"},"502":{"description":"The upstream source failed or timed out."}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0200"},"protocols":[{"x402":{"network":"eip155:8453","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/risk-reward"}},{"x402":{"network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/risk-reward"}},{"x402":{"network":"eip155:137","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/risk-reward"}},{"x402":{"network":"eip155:42161","scheme":"exact","currency":"USDC","endpoint":"https://invest-math.x402tookit.com/risk-reward"}}]}}}}}