{"slug":"hubvibe-io-com-work-finance-analytics-9013fd","title":"Deterministic trading mathematics over a price series you supply or a ticker fet","host":"hubvibe-io.com","method":"POST","resource":"https://hubvibe-io.com/work/finance/analytics","category":"market","description":"Deterministic trading mathematics over a price series you supply or a ticker fetched live: returns and CAGR, annualized volatility, Sharpe and Sortino, max drawdown, historical and parametric VaR/CVaR, beta, alpha and correlation vs a benchmark, SMA/EMA, RSI, Bollinger bands, Black-Scholes price wit","price_listed":0.5,"price_asked":0.5,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":1036,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"kelly":{"win_loss_ratio":1.5,"win_probability":0.55},"option":{"rate":0.04,"strike":120,"time_to_expiry_years":0.5,"type":"call"},"prices":[100,101.5,99.8,102.2,103.9,103.1,105.4,104.2,106.8,108,107.1,109.5,111.2,110.4,112.9,114.3,113,115.8,117.1,116.2,118.6,120],"risk_free_rate":0.04,"windows":{"bollinger":10,"ema":[5],"rsi":14,"sma":[5,10]}},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"additionalProperties":false,"oneOf":[{"required":["prices"]},{"required":["symbol"]}],"properties":{"alpha":{"description":"Tail probability for VaR/CVaR. Default 0.05.","exclusiveMinimum":0,"maximum":0.5,"type":"number"},"benchmark_prices":{"description":"Benchmark series for beta/alpha/correlation, same order as `prices`.","items":{"oneOf":[{"description":"A price.","exclusiveMinimum":0,"type":"number"},{"additionalProperties":true,"description":"{date, close}.","properties":{"close":{"exclusiveMinimum":0,"type":"number"},"date":{"type":"string"}},"required":["close"],"type":"object"}]},"maxItems":100000,"minItems":2,"type":"array"},"benchmark_symbol":{"description":"Benchmark fetched live (e.g. SPY) for beta/alpha/correlation.","pattern":"^[A-Za-z][A-Za-z0-9.\\-]{0,11}$","type":"string"},"kelly":{"additionalProperties":false,"description":"Bet parameters for the Kelly fraction (enables kelly).","properties":{"win_loss_ratio":{"description":"Average win / average loss (b in b:1).","exclusiveMinimum":0,"type":"number"},"win_probability":{"maximum":1,"minimum":0,"type":"number"}},"required":["win_probability","win_loss_ratio"],"type":"object"},"metrics":{"description":"Which results to compute. Default: returns, volatility, sharpe, sortino, drawdown, var, moving_averages, rsi, bollinger, plus beta/black_scholes/kelly when their inputs are given.","items":{"enum":["returns","volatility","sharpe","sortino","drawdown","var","beta","moving_averages","rsi","bollinger","black_scholes","kelly"],"type":"string"},"minItems":1,"type":"array","uniqueItems":true},"option":{"additionalProperties":false,"description":"European option to price with Black-Scholes-Merton (enables black_scholes).","properties":{"dividend_yield":{"description":"Continuous yield, default 0.","minimum":0,"type":"number"},"rate":{"description":"Continuous risk-free rate; default risk_free_rate.","type":"number"},"spot":{"description":"Default: the last price of the series.","exclusiveMinimum":0,"type":"number"},"strike":{"exclusiveMinimum":0,"type":"number"},"time_to_expiry_years":{"exclusiveMinimum":0,"type":"number"},"type":{"enum":["call","put"],"type":"string"},"volatility":{"description":"Annual volatility as a fraction; default: the series' annualized log-return volatility.","exclusiveMinimum":0,"type":"number"}},"required":["type","strike","time_to_expiry_years"],"type":"object"},"periods_per_year":{"description":"Annualization basis: 252 trading days (default), 12 months, 365 days, 52 weeks.","maximum":100000,"minimum":1,"type":"integer"},"prices":{"description":"Prices oldest first: numbers, or {date, close} objects. Use this OR `symbol`.","items":{"oneOf":[{"description":"A price.","exclusiveMinimum":0,"type":"number"},{"additionalProperties":true,"description":"{date, close}.","properties":{"close":{"exclusiveMinimum":0,"type":"number"},"date":{"type":"string"}},"required":["close"],"type":"object"}]},"maxItems":100000,"minItems":2,"type":"array"},"range":{"description":"History range with `symbol`, default 1y.","enum":["1d","5d","1mo","3mo","6mo","1y","2y","5y"],"type":"string"},"risk_free_rate":{"description":"Annual risk-free rate as a fraction (0.04 = 4%). Default 0.","maximum":10,"minimum":-1,"type":"number"},"symbol":{"description":"Fetch the series live instead of `prices` (daily closes). Use this OR `prices`.","pattern":"^[A-Za-z][A-Za-z0-9.\\-]{0,11}$","type":"string"},"windows":{"additionalProperties":false,"description":"Indicator windows. Default sma [20,50,200], ema [12,26], rsi 14, bollinger 20.","properties":{"bollinger":{"oneOf":[{"maximum":5000,"minimum":2,"type":"integer"},{"items":{"maximum":5000,"minimum":2,"type":"integer"},"maxItems":10,"minItems":1,"type":"array"}]},"ema":{"oneOf":[{"maximum":5000,"minimum":2,"type":"integer"},{"items":{"maximum":5000,"minimum":2,"type":"integer"},"maxItems":10,"minItems":1,"type":"array"}]},"rsi":{"oneOf":[{"maximum":5000,"minimum":2,"type":"integer"},{"items":{"maximum":5000,"minimum":2,"type":"integer"},"maxItems":10,"minItems":1,"type":"array"}]},"sma":{"oneOf":[{"maximum":5000,"minimum":2,"type":"integer"},{"items":{"maximum":5000,"minimum":2,"type":"integer"},"maxItems":10,"minItems":1,"type":"array"}]}},"type":"object"}},"required":[],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"$schema":"https://json-schema.org/draft/2020-12/schema","description":"The 200 body of every paid /work call. `result` is the worker's own output (its schema is per route); everything else is the same on every /work route. A receipt for the job is at `receipt_url`.","properties":{"billing_warning":{"description":"Present only when the charge was recorded with a caveat.","examples":["settlement pending"],"type":"string"},"price_usd":{"description":"What this call cost, in USD.","examples":[0.02],"type":"number"},"provenance":{"description":"How the result was produced: which providers ran and how long each took.","properties":{"attempts":{"description":"Provider attempts made, including retries and failovers.","examples":[1],"type":"integer"},"elapsed_ms":{"description":"Wall-clock milliseconds for the whole job.","examples":[340],"type":"integer"},"providers_used":{"description":"Providers that served the job.","examples":[["coinbase-advanced-trade-public"]],"items":{"description":"Provider name.","examples":["coinbase-advanced-trade-public"],"type":"string"},"type":"array"},"steps":{"description":"Every step the job ran, in order.","items":{"description":"One step of the job.","properties":{"ms":{"description":"Milliseconds the step took.","examples":[312],"type":"integer"},"ok":{"description":"Whether the step succeeded.","examples":[true],"type":"boolean"},"provider":{"description":"Provider that served the step.","examples":["coinbase-advanced-trade-public"],"type":"string"},"reason":{"description":"Failure reason, on a failed step.","examples":["provider_timeout"],"type":"string"},"step":{"description":"Step name inside the worker.","examples":["quote"],"type":"string"}},"required":["step","ok","ms"],"type":"object"},"type":"array"}},"required":["steps","providers_used","attempts","elapsed_ms"],"type":"object"},"receipt_id":{"description":"Receipt id for this job.","examples":["rcpt_9f1c2b3a4d5e6f70"],"type":"string"},"receipt_url":{"description":"Where to fetch the machine-readable receipt (free, no payment).","examples":["/work/receipts/rcpt_9f1c2b3a4d5e6f70"],"type":"string"},"result":{"properties":{"as_of":{"description":"Date or timestamp of the last price (from the dates given or the source).","examples":["2026-09-25"],"type":["string","null"]},"beta":{"description":"Against the benchmark; null unless one was given.","properties":{"alpha_annualized":{"description":"Annualized Jensen's alpha.","examples":[0.31],"type":["number","null"]},"benchmark_annualized_volatility":{"description":"Benchmark volatility, annualized.","examples":[0.18],"type":["number","null"]},"beta":{"description":"cov/var vs the benchmark.","examples":[1.12],"type":["number","null"]},"correlation":{"description":"Pearson correlation of period returns.","examples":[0.83],"type":["number","null"]},"n":{"description":"Aligned returns used.","examples":[21],"type":"integer"}},"required":["n","beta"],"type":["object","null"]},"black_scholes":{"description":"Black-Scholes-Merton.","properties":{"d1":{"description":"d1.","examples":[0.11],"type":"number"},"d2":{"description":"d2.","examples":[-0.04],"type":"number"},"delta":{"description":"dV/dS.","examples":[0.54],"type":"number"},"gamma":{"description":"d2V/dS2.","examples":[0.024],"type":"number"},"inputs":{"description":"The inputs used, including any defaulted from the series.","properties":{"dividend_yield":{"description":"q.","examples":[0],"type":"number"},"rate":{"description":"r.","examples":[0.04],"type":"number"},"spot":{"description":"S.","examples":[120],"type":"number"},"strike":{"description":"K.","examples":[120],"type":"number"},"time_to_expiry_years":{"description":"T.","examples":[0.5],"type":"number"},"volatility":{"description":"sigma.","examples":[0.217],"type":"number"}},"required":["spot","strike","rate","volatility","time_to_expiry_years","dividend_yield"],"type":"object"},"price":{"description":"Option value.","examples":[4.83],"type":"number"},"rho":{"description":"dV/dr per 1.0 of rate.","examples":[29.8],"type":"number"},"theta":{"description":"dV/dt per year.","examples":[-6.9],"type":"number"},"type":{"description":"Option type.","enum":["call","put"],"examples":["call"],"type":"string"},"vega":{"description":"dV/dsigma per 1.0 of volatility.","examples":[33.1],"type":"number"}},"required":["type","price","delta","gamma","vega","theta","rho","inputs"],"type":["object","null"]},"bollinger":{"description":"Bollinger bands at the last price.","properties":{"bandwidth":{"description":"(upper-lower)/middle.","examples":[0.134],"type":["number","null"]},"k":{"description":"Band width in standard deviations.","examples":[2],"type":"number"},"lower":{"description":"Lower band.","examples":[105.9],"type":"number"},"middle":{"description":"SMA.","examples":[113.5],"type":"number"},"percent_b":{"description":"Where the last price sits in the band (0 lower, 1 upper).","examples":[0.93],"type":["number","null"]},"upper":{"description":"Upper band.","examples":[121.1],"type":"number"},"window":{"description":"Window.","examples":[20],"type":"integer"}},"required":["window","k","middle","upper","lower"],"type":["object","null"]},"checked_at":{"description":"When this node read the source (UTC). Nothing here is cached.","examples":["2026-09-26T18:00:00Z"],"format":"date-time","type":"string"},"drawdown":{"description":"Maximum drawdown.","properties":{"duration_periods":{"description":"Periods from peak to trough.","examples":[1],"type":"integer"},"max_drawdown":{"description":"Largest peak-to-trough fall as a fraction (negative or 0).","examples":[-0.0167],"type":"number"},"peak_index":{"description":"Index of the peak.","examples":[3],"type":"integer"},"recovery_index":{"description":"First index back at the peak; null when not recovered.","examples":[6],"type":["integer","null"]},"trough_index":{"description":"Index of the trough.","examples":[4],"type":"integer"}},"required":["max_drawdown","peak_index","trough_index","recovery_index","duration_periods"],"type":["object","null"]},"first_date":{"description":"First date when dates were given.","examples":["2026-08-26"],"type":["string","null"]},"kelly":{"description":"Kelly criterion.","properties":{"bet":{"description":"Whether the fraction is positive.","examples":[true],"type":"boolean"},"fraction":{"description":"Kelly fraction p - (1-p)/b.","examples":[0.25],"type":"number"},"half_kelly":{"description":"Half Kelly.","examples":[0.125],"type":"number"},"win_loss_ratio":{"description":"b.","examples":[1.5],"type":"number"},"win_probability":{"description":"p.","examples":[0.55],"type":"number"}},"required":["win_probability","win_loss_ratio","fraction","half_kelly","bet"],"type":["object","null"]},"last_date":{"description":"Last date when dates were given.","examples":["2026-09-25"],"type":["string","null"]},"method":{"description":"Every formula used, in words.","examples":["simple returns p_t/p_{t-1}-1 and log returns..."],"type":"string"},"metrics_computed":{"description":"Metrics present (non-null) in this result.","examples":[["returns","volatility","sharpe"]],"items":{"description":"A metric name.","examples":["returns"],"type":"string"},"type":"array"},"moving_averages":{"description":"Simple and exponential moving averages at the last price.","properties":{"ema":{"additionalProperties":{"type":["number","null"]},"description":"Value per window, keyed by the window length.","examples":[{"20":116.4,"50":110.2}],"properties":{},"required":[],"type":"object"},"last_price":{"description":"Last price, for comparison.","examples":[120],"type":"number"},"sma":{"additionalProperties":{"type":["number","null"]},"description":"Value per window, keyed by the window length.","examples":[{"20":116.4,"50":110.2}],"properties":{},"required":[],"type":"object"}},"required":["sma","ema","last_price"],"type":["object","null"]},"n":{"description":"Prices in the series.","examples":[22],"type":"integer"},"n_returns":{"description":"Period returns (n - 1).","examples":[21],"type":"integer"},"notes":{"description":"Caveats about undefined or aligned metrics.","examples":[[]],"items":{"description":"A caveat.","examples":["rsi needs at least 15 prices."],"type":"string"},"type":"array"},"periods_per_year":{"description":"Annualization basis.","examples":[252],"type":"integer"},"returns":{"description":"Return statistics.","properties":{"annualized_mean_return":{"description":"mean_period_return * periods_per_year.","examples":[2.2],"type":"number"},"best_period":{"description":"Largest period return.","examples":[0.0227],"type":"number"},"cagr":{"description":"Compound annual growth rate over n_returns/periods_per_year years.","examples":[7.9],"type":["number","null"]},"first_price":{"description":"First price.","examples":[100],"type":"number"},"last_price":{"description":"Last price.","examples":[120],"type":"number"},"mean_log_return":{"description":"Mean log return per period.","examples":[0.0087],"type":"number"},"mean_period_return":{"description":"Mean simple return per period.","examples":[0.0088],"type":"number"},"n_returns":{"description":"Period returns.","examples":[21],"type":"integer"},"total_return":{"description":"last/first - 1.","examples":[0.2],"type":"number"},"worst_period":{"description":"Smallest period return.","examples":[-0.0167],"type":"number"}},"required":["n_returns","first_price","last_price","total_return","mean_period_return"],"type":["object","null"]},"risk_free_rate":{"description":"Annual risk-free rate used.","examples":[0.04],"type":"number"},"rsi":{"description":"Relative strength index.","properties":{"value":{"description":"Wilder RSI 0-100; null when too few prices.","examples":[71.2],"type":["number","null"]},"window":{"description":"Window.","examples":[14],"type":"integer"}},"required":["window","value"],"type":["object","null"]},"sharpe":{"description":"Annualized Sharpe ratio; null when undefined.","examples":[9.8],"type":["number","null"]},"sortino":{"description":"Annualized Sortino ratio; null when undefined.","examples":[23.6],"type":["number","null"]},"source":{"description":"Where the series came from.","properties":{"benchmark_n":{"description":"Benchmark prices used.","examples":[250],"type":["integer","null"]},"benchmark_symbol":{"description":"Benchmark ticker when fetched.","examples":["SPY"],"type":["string","null"]},"provider":{"description":"Provider that served the series.","examples":["nasdaq-data-api"],"type":["string","null"]},"range":{"description":"Range fetched, with type symbol.","examples":["1y"],"type":["string","null"]},"symbol":{"description":"Ticker, with type symbol.","examples":["AAPL"],"type":["string","null"]},"type":{"description":"Inline prices or a live-fetched series.","enum":["prices","symbol"],"examples":["prices"],"type":"string"}},"required":["type"],"type":"object"},"var":{"description":"Value at risk, one period.","properties":{"alpha":{"description":"Tail probability.","examples":[0.05],"type":"number"},"historical_cvar":{"description":"Mean loss beyond the VaR.","examples":[0.0167],"type":["number","null"]},"historical_var":{"description":"Loss not exceeded with probability 1-alpha, as a positive fraction.","examples":[0.0158],"type":"number"},"horizon_periods":{"description":"Horizon in periods.","examples":[1],"type":"integer"},"parametric_var":{"description":"Normal-model VaR, -(mean + z*std).","examples":[0.0137],"type":["number","null"]},"parametric_z":{"description":"z at alpha.","examples":[-1.6449],"type":"number"}},"required":["alpha","horizon_periods","historical_var","parametric_z"],"type":["object","null"]},"volatility":{"description":"Dispersion of returns.","properties":{"annualized":{"description":"period_std * sqrt(periods_per_year).","examples":[0.217],"type":["number","null"]},"downside_deviation_annualized":{"description":"Annualized downside deviation vs the risk-free rate.","examples":[0.09],"type":["number","null"]},"log_return_std":{"description":"Sample standard deviation of log returns.","examples":[0.0136],"type":["number","null"]},"period_std":{"description":"Sample standard deviation of period returns.","examples":[0.0137],"type":["number","null"]}},"required":["period_std","annualized"],"type":["object","null"]}},"required":["source","n","n_returns","periods_per_year","risk_free_rate","metrics_computed","returns","volatility","sharpe","sortino","drawdown","var","beta","moving_averages","rsi","bollinger","black_scholes","kelly","notes","method","as_of","checked_at"],"type":"object"},"status":{"const":"ok","description":"Present only on a delivered result.","type":"string"},"worker":{"description":"Catalog name of the worker that ran.","examples":["market.quote"],"type":"string"}},"required":["status","worker","price_usd","result","provenance","receipt_id","receipt_url"],"title":"finance.analytics response","type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-09-27","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.5,"price_match":true,"latency_ms":1036,"error":null}],"description_full":"Deterministic trading mathematics over a price series you supply or a ticker fetched live: returns and CAGR, annualized volatility, Sharpe and Sortino, max drawdown, historical and parametric VaR/CVaR, beta, alpha and correlation vs a benchmark, SMA/EMA, RSI, Bollinger bands, Black-Scholes price with Greeks, and the Kelly fraction. Exactly rounded sums, every formula named in the result, the same input always the same numbers; no LLM in the path. Input: prices or symbol, plus options.","last_updated":"2026-09-27T03:12:18.362Z","schemes":["exact"]}