Crypto futures profit formula
ProfitCalc estimates a linear, USD-denominated trade from an initial margin amount, leverage and two execution prices. The quantity stays fixed between entry and exit. The result is a scenario calculation, not a prediction or an exchange settlement quote.
Inputs and units
Use I for investment (initial margin in USD), L for leverage, E for entry price in USD per unit, T for target exit price, and f for the entered fee percentage divided by 100. For example, entering 0.075 means f = 0.00075, not 0.075. Investment is your starting capital, not the leveraged notional.
From margin to position quantity
The active Calculator.tsx callback computes investmentValue = I × L, units = investmentValue / E, and closingValue = units × T. With I = $1,000, L = 10 and E = $50,000, position value is $10,000 and quantity is 0.2 units. An exit at $55,000 produces closing value $11,000. Quantity is not recomputed at the exit.
Directional gross PnL
For long positions, grossPnl = closingValue − investmentValue. For short positions, grossPnl = investmentValue − closingValue. The example long therefore earns $1,000 before fees. Gross PnL does not include the return of initial capital, so it must not be confused with final equity.
From gross PnL to final equity
entryFee = investmentValue × f and exitFee = closingValue × f. grossFees is their sum. If referral payback is enabled, paybackAmount = grossFees × (entered payback percentage / 100); otherwise it is zero. totalFees = grossFees − paybackAmount. netPnl = grossPnl − totalFees; roi = netPnl / I × 100; totalValue = I + netPnl.
Worked long example
At the prices above with a 0.075% fee and no payback, entry fee is $7.50 and exit fee $8.25. Gross fees and total fees are $15.75. Net PnL is $984.25, ROI is 98.425% (displayed as 98.43%), and final equity is $1,984.25. With 20% payback, the hypothetical rebate is $3.15, net fees are $12.60 and net PnL is $987.40.
Interpreting the estimate
The gross minus fees equals net flow in the calculator uses these same computed values. Currency display rounds for readability, while intermediate arithmetic uses JavaScript numbers without currency rounding. A flat-price exit still incurs both trading fees. A negative final equity remains possible in this model because no exchange-specific loss cap is imposed.
Validation and precision
Entry and target prices, investment and leverage must be finite and positive; fee must be finite and nonnegative. Enabled payback must be between 0% and 100%. All derived arithmetic must remain finite. Both prices start blank; once either is filled, required-field validation applies. Display values are rounded, without intermediate currency rounding.
Model limitations
The calculation assumes a linear USD-denominated contract, fixed quantity and exact entry and exit prices. Funding, slippage, taxes, inverse contracts, maintenance margin and exchange-specific rules are excluded. Payback is hypothetical, not guaranteed. Results may show negative final equity. This is information, not financial advice.
Implementation basis
These statements follow the calculation callback, resetFields and preset handlers in components/Calculator.tsx. Numeric cases are checked by scripts/smoke-calculator.mjs. No external exchange fee, product availability or performance claim is made.