workflow.run_funding_cost
Calculate the total funding cost (or income) for holding a perpetual futures position. Use when user asks "how much funding will I pay holding X days?" or "is funding eating my profit?". Returns: totalFundingUsdt (negative = you pay, positive = you receive), perIntervalUsdt.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | Yes | Number of days to hold | |
| side | Yes | ||
| sizeBase | Yes | Position size in base asset | |
| entryPrice | Yes | Entry price | |
| fundingRate | Yes | Funding rate per 8h period as fraction, e.g. 0.0001 | |
| contractType | No | linear = USDT-margined (default), inverse = coin-margined. For inverse, sizeBase is USD contracts and cost figures come out in the base coin. |