{"uid":"cap_WSkshfRtG4IwnDRMCZLSR","slug":"api-quantoracle-dev-fe604f58","name":"QuantOracle Portfolio Rebalance Plan","description":"Free, fast quant finance calculators powered by a deterministic, multi-chain API. Black-Scholes, options profit, Kelly, VaR, crypto liquidation, and more.","url":"https://api.quantoracle.dev/v1/portfolio/rebalance-plan?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","title":"RebalancePlanIn","required":["current_holdings","target_weights"],"properties":{"min_trade_usd":{"type":"number","title":"Min Trade Usd","default":10,"minimum":0,"description":"Minimum trade size in USD (smaller drifts are ignored)"},"target_weights":{"type":"object","title":"Target Weights","description":"Asset symbol -> target weight (must sum to ~1.0)","additionalProperties":{"type":"number"}},"current_holdings":{"type":"object","title":"Current Holdings","description":"Asset symbol -> current dollar value","additionalProperties":{"type":"number"}},"transaction_cost_bps":{"type":"number","title":"Transaction Cost Bps","default":10,"minimum":0,"description":"One-way transaction cost in bps (incl. spread + commission)"}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"target_weights":{"BTC":0.5,"ETH":0.3,"SOL":0.2},"current_holdings":{"BTC":50000,"ETH":30000,"SOL":20000}},"response":{"ms":16.54,"_meta":{"url":"https://quantoracle.dev","docs":"https://api.quantoracle.dev/docs","powered_by":"QuantOracle"},"trades":[],"num_trades":0,"drift_after":{"BTC":0,"ETH":0,"SOL":0},"drift_before":{"BTC":0,"ETH":0,"SOL":0},"target_weights":{"BTC":0.5,"ETH":0.3,"SOL":0.2},"total_cost_bps":0,"total_cost_usd":0,"current_weights":{"BTC":0.5,"ETH":0.3,"SOL":0.2},"max_drift_after":0,"portfolio_value":100000,"max_drift_before":0,"post_rebalance_weights":{"BTC":0.5,"ETH":0.3,"SOL":0.2}}},"exampleRequest":{"target_weights":{"BTC":0.5,"ETH":0.3,"SOL":0.2},"current_holdings":{"BTC":50000,"ETH":30000,"SOL":20000}},"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_bOvXGXX_DyEBZb0f4xVZQ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates an optimal set of trades to rebalance a crypto portfolio toward target allocation weights, minimizing drift and transaction costs","exampleAgentPrompt":"My crypto portfolio is currently BTC $50,000, ETH $30,000, SOL $10,000, and USDC $10,000 — can you generate a rebalancing plan to hit target weights of 40% BTC, 35% ETH, 15% SOL, 10% USDC, with a minimum trade size of $500 and transaction costs of 10 bps?","exampleUseCases":null,"resultDescription":"Returns a list of specific buy/sell trades (asset, action, amount in USD, estimated cost), the number of trades, portfolio value, current vs target weights, drift before and after rebalancing, total rebalancing cost in USD and basis points, and post-rebalance weights — all computed in under 15ms.","failureModes":["Missing or invalid target_weights that don't sum to 1.0 — returns 400 validation error","current_holdings with negative or zero values — returns 400 bad request","min_trade_usd larger than portfolio imbalances — may result in zero trades returned","transaction_cost_bps outside valid range — returns 400 validation error","Network timeout or service unavailability — returns 5xx error","Payment failure via x402 protocol — returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need a precise, cost-aware rebalancing trade plan for a multi-asset crypto portfolio with specific target weights. Prefer this over generic allocation calculators when you need drift analysis (before and after), transaction cost accounting in basis points, and a minimum trade threshold to avoid dust trades. Best for agents managing automated portfolio rebalancing workflows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T18:39:32.444Z","isFirstParty":false,"canonicalSlug":"api-quantoracle-dev-fe604f58"}