primitive.hedge_ratio
Calculate the short perpetual futures position size needed to hedge a spot holding. Use when user asks "how much should I short to hedge my BTC?" or "what margin do I need for a 100% hedge?". Returns: hedgeNotional, requiredMargin, estimatedFundingCost.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| leverage | No | Leverage on the perp short. Default 1. | |
| spotSize | Yes | Spot position value in USDT | |
| hedgeRatio | No | Percentage of spot to hedge, e.g. 100 for full hedge, 50 for half. Default 100. | |
| fundingRatePct | No | Current 8h funding rate as percentage, e.g. 0.01. Used for cost estimate. |