Funding

Crypto Funding Costs: How to Reconcile a Trading Bot's Results

Crypto Funding Costs: How to Reconcile a Trading Bot's Results

Crypto Funding Costs: How to Reconcile a Trading Bot's Results

New Hope — Crypto Funding Costs: How to Reconcile a Trading Bot's Results

Funding is a periodic payment associated with a perpetual contract. It can increase or reduce a position's result, so the difference between entry and exit prices does not always explain the change in account funds. Checking a trading bot's records requires separate treatment of executions, trading fees and funding payments that have actually settled.

This guide concerns accounting, not which side of a market to trade. Its formulas apply to the explicitly stated example conditions. Rates are invented for arithmetic and are not current charges, return forecasts or suggested settings.

Identify the payment and its calculation base

In Bybit's documented model, funding passes between long and short position holders. Positive funding means longs pay shorts; a negative rate reverses that direction. For linear USDT contracts, the fee equals position value multiplied by the funding rate, with value based on quantity multiplied by mark price. See the official funding calculation documentation.

Other contract types can use a different value formula or settlement currency. Record the full instrument name and contract type first. The word “futures” alone does not establish whether funding applies or how it should enter your calculation.

A single-settlement example

Assume a fictional long position contains 20 units of a linear contract, the mark price at settlement is 100 USDT and the final funding rate is +0.01%:

  • Position value: 20 × 100 = 2,000 USDT.

  • Rate as a decimal: 0.01% = 0.0001.

  • Funding payment: 2,000 × 0.0001 = 0.20 USDT.

The calculation uses position value, not an arbitrarily selected collateral amount. Multiplying by 0.01 rather than 0.0001 creates a hundredfold error. Preserve the percentage sign and the original reported value alongside any converted number.

Now suppose a closed trade produced 5 USDT from actual execution prices before trading fees and funding. Trading fees totalled 0.80 USDT, and its only funding event was the 0.20 USDT payment above. The result after those costs is 5 − 0.80 − 0.20 = 4 USDT. Software and infrastructure costs are outside this example.

Why the latest rate cannot describe the whole holding period

A displayed rate can change before settlement. Intervals and limits depend on the contract; eight hours is not a universal schedule. Bybit explains these changing inputs in its funding-rate documentation. For a completed period, use settled records rather than the current figure on a trading screen.

In a separate two-settlement scenario, the position remains open after the first payment. Before the next settlement, the long has been reduced to 10 units. The mark price is now 102 USDT and the final rate is −0.02%. Position value is 1,020 USDT, so the received payment is 1,020 × 0.0002 = 0.204 USDT. Across both events, the funding cash flow is −0.20 + 0.204 = +0.004 USDT before any venue-specific rounding.

In this independent ledger, a positive number means money received and a negative number means money paid. That is an explicit accounting convention, not a claim about the signs in an exchange export. Establish the meaning of each source field before normalising the records.

Build a ledger that can be checked

  1. Define the scope. Record the start and end dates, time zone, account, instrument and settlement currency. Do not merge several accounts without identifiers.

  2. Isolate funding events. Preserve each timestamp, amount, currency and available unique identifier. Explicitly label the item as paid or received.

  3. Reconstruct the position. Account for additions, partial closures and complete exits before each event. The position's current size is not its historical size.

  4. Match the calculation. Use the rate and calculation base belonging to that event. If values disagree, inspect units, rounding and the definition of the settlement price.

  5. Reconcile the result. Combine execution P&L, trading fees and funding only after determining which components the exported P&L already includes.

A useful ledger can explain a discrepancy with a specific reason: a different period, currency, omitted event, position change or rounding rule. If the reason remains unknown, retain the original record and mark the amount as unreconciled. Do not manufacture an extra “fee” merely to force agreement with an expected outcome.

Avoid subtracting the same cost twice

A field labelled P&L is not a complete definition. For example, Bybit's USDT-contract P&L documentation distinguishes the components of unrealised and closed results. If an export already includes funding, subtracting it again understates the result. Likewise, P&L calculated from actual fills already reflects those prices; estimated slippage must not be charged again.

For open positions, compare balance and equity separately. Strategies with several entries also require attention to grid behaviour and accumulated exposure. Trading commissions are covered in the guide to maker and taker fees.

To discuss a particular report, use the enquiry form with anonymised entries and a description of the mismatch. An initial review needs amounts, timestamps, field definitions and contract details, rather than account access or API secrets.

Get our presentation about New Hope PRO and CRYPTO

Get our presentation about New Hope PRO and CRYPTO

Get our presentation about New Hope PRO and CRYPTO