HeadroomDESK

Funding and swap cost calculator

What holding a position costs over time: the funding a perpetual pays or receives at each funding time you hold through, or the overnight swap on a CFD or FX position. You type the rate your venue or broker shows; nothing is fetched.

1 · Your position

Instrument
Position side
BTC
USD
%
Funding interval
days
hours
×

Funding over the holding time

–

Funding times held through
–
Each funding
–
As a share of position value
–
As a share of the margin
–

3 · How it is calculated

Runs in your browser. Nothing you type leaves this page.

A perpetual has no expiry; funding keeps its price near the index. At each funding time, longs pay shorts when the rate is positive and shorts pay longs when it is negative. This calculator counts the funding times your holding window crosses and multiplies.

The rate is the one you type: rates change every interval, so a long hold is an estimate unless you use the average you expect. Funding times are counted on the interval's grid from 00:00 UTC.

Arithmetic on your inputs, not advice. On a prop-firm account, swaps and commissions usually count in equity, so they use up the day's room too.

What the number means, with a worked example

How to read this number: what it means, the formula in plain words, a worked example, the common mistake and the venue's rule. The full arithmetic and more examples follow.

How to read the result

The funding cost, in five parts

What the number means

The total funding this position pays or receives over the time you hold it, at the rate you type. Funding is a payment between longs and shorts at each funding time, not a fee to the venue: with a positive rate, longs pay and shorts receive.

The formula, in plain words

Count the funding times your holding window crosses: those after you open and at or before you close, on the venue's grid. At each one the position's value times the rate changes hands. Multiply the two.

each funding = size · price · rate total = funding times · each funding

The rate is the funding rate per interval as the venue shows it, and it can be negative; the grid is 00:00 UTC plus whole intervals.

One worked example

The calculator's starting inputs: a long of 1 BTC at 60,000, 0.01% every 8 h, held 3 days. Wherever the hold starts, 72 hours on the 8-hour grid cross the same number of funding times.

  1. Each funding1 × 60,000 × 0.01% = 6.00 USD
  2. Funding times72 h ÷ 8 h = 9
  3. Total paid9 × 6.00 = 54.00 USD

Panel 2 shows 54.00 USD: 0.090% of the position's value, 0.90% of the margin at 10×.

The common mistake

Counting a small rate once. The rate is paid at every funding time. Held 30 days on the 8-hour grid, this position pays it 90 times: 540.00 USD, 9.00% of the margin at 10×. On a 4-hour contract it is paid 180 times.

Source and venue rule

  • Rate and interval: you type them from the venue's funding page for the contract. Headroom fetches and stores no funding rates, so there is no read date to show.
  • Funding grid: 00:00 UTC plus whole intervals. Venues differ on whether a position opened or closed at the funding time itself pays.
  • CFD and FX swap: the swap per lot and the triple night from your broker's contract specification.

The venue's funding history is the record: if it shows a different amount, the venue's number counts.

The arithmetic

funding times counted = those strictly after you open and at or before you close (on the grid 00:00 UTC + k × interval) position value = size × price each funding = ± position value × rate (long +, short −; a positive result is paid) total = funding times × each funding share of value = total / position value share of margin = total / (position value / leverage) CFD / FX swap nights charged = nights + 2 × triple nights total = lots × swap per lot per night × nights charged
funding rate
the rate per interval your venue shows for the contract, for example 0.01% every 8 hours; it can be negative
funding interval
how often funding is exchanged on that contract; many BTC perpetuals use 8 hours, some contracts use 4 or 1
share of value
the price move, in your favour, that would just offset the funding over the hold
swap per lot
the overnight financing your broker's contract specification shows per lot, negative when charged
triple night
a night that carries three nights' swap to cover a weekend; the broker's contract specification says which weekday

Funding is a payment between traders, not a fee to the venue. A position that pays a small rate every eight hours for a month pays it about ninety times; that is the number this calculator makes visible.

Worked examples

Illustrative inputs, not market rates. Computed by the reference code the calculator is tested against.

Illustrative inputs. Funding amounts in USD; swap in the account currency.
InputsResult
Long 1 BTC at 60,000.0, 0.01% every 8 h, opened 10:00 UTC, held 3 days, 10×9 funding times; 54.00 paid; 0.90% of the margin
Short, same position and rate9 funding times; 54.00 received; 0.90% of the margin
Long 0.1 BTC at 70,000.0, 0.01% every 8 h, held 30 days, 3×90 funding times; 63.00 paid; 2.70% of the margin
Long 0.25 BTC at 80,000.0, 0.00125% every 1 h, held 24 h, 5×24 funding times; 6.00 paid; 0.15% of the margin
Opened at 08:00 UTC exactly, closed 16:00 UTC, 8 h grid1 funding time; 10.00 paid
Opened 08:00 UTC, closed 15:59 UTC0 funding times; nothing changes hands
CFD: 2 lots, swap −7.50 per lot per night, 5 nights of which 1 triple7 nights charged; 105.00 charged

What this does not cover

  • Rates that change from one interval to the next. Type the average rate you expect, or run the calculator for each stretch.
  • The exact second of a funding time. Venues differ on whether a position opened or closed at the funding time itself pays; open or close a minute away from it to be sure which side you are on.
  • Position value moving with the price. The venue values the position at its mark price at each funding time; this calculator holds it at the price you type.
  • Rate caps, interest components and per-venue rounding. The venue's own funding page and history are the final word.

When not to use this

Do not read a funding rate as a forecast of price. It describes what one side pays the other, not where the market goes.

Related

Last reviewed (UTC).