Linear P&L, fees and funding
Short price P&L = quantity × (entry price − closing mark)
Opening fee = quantity × entry price × decimal opening fee rate
Closing fee = quantity × actual closing mark × decimal closing fee rate
Funding per settlement = quantity × scenario mark × decimal interval rate × direction sign
Funding direction sign: long = −1; short = +1
Net P&L = price P&L + signed funding − opening fee − closing fee
Return on allocated collateral = net P&L ÷ allocated collateral × 100%
Quantity is in BTC or ETH, with multiplier 1. Prices are settlement currency per underlying unit; P&L, fees, funding and collateral are in that settlement currency. Enter percentages directly: 0.01 means 0.01%, or 0.0001 as a decimal. Positive funding means longs pay and shorts receive; negative funding reverses the flows.
Fees use the respective opening and actual closing notionals. This version uses custom fees with zero spread and slippage. Those execution effects and other possible exchange costs are excluded.
A constant mark from hour zero
Entry requirements are checked at the entry price. The mark then moves to your scenario price at the start and stays there during the holding period. Funding uses that constant mark and a constant rate. This is not a simulated path from entry to exit.
At each modeled event, the engine applies the mark, checks isolated margin, settles any due funding for an open position, then checks margin again. Surviving positions close at the horizon.
The first payment is one complete interval after opening. A payment exactly at the horizon is included; incomplete intervals have no payment. The schedule is opening-relative, with no real exchange-clock alignment, compounding or reinvestment.
Worked example
A 1 BTC long enters at 50,000 USDT with 10,000 USDT allocated collateral and 10× configured leverage. The mark becomes 55,000 USDT at hour zero. Maintenance is 0.5%; opening and closing fees are each 0.04%. Funding is +0.01% every 8 hours for 24 hours.
The shared engine gives 5,000.00 USDT price P&L, an opening fee of 20.00 USDT and a closing fee of 22.00 USDT. There are 3 payments at hours 8, 16, 24, each -5.50 USDT, for total signed funding of -16.50 USDT.
Net modeled P&L is 4,941.50 USDT. Initial margin is 5,000.00 USDT and return on allocated collateral is 49.415%. The position survives the modeled checkpoints.
Leverage, collateral and early closure
Configured leverage determines initial margin: entry notional divided by leverage. Allocated collateral is the amount actually assigned to this isolated position. Changing leverage does not resize quantity or independently multiply price P&L or funding. Return uses allocated collateral, not initial margin or notional.
Opening fees come out of collateral. Entry equity after those costs must cover initial margin and strictly exceed entry maintenance plus the closing-fee reserve. A rejected position has no reported trade P&L or return.
Liquidation is modeled at the first checkpoint where equity is no greater than mark-based maintenance plus the closing-fee reserve. Results use that actual closing time and mark, and subsequent funding stops. Retained balances include closing fees and can be negative; losses are not capped at collateral.
This is a simplified isolated-margin model, not an exchange-specific liquidation rule. Surviving the constant-mark checkpoints does not prove safety along an unmodeled price path.
Choose your next question
For a worked explanation of the contract, read how perpetual futures work, including fees and funding.
For the analytical trigger mark under zero-funding isolated-margin assumptions, use the Liquidation Price Calculator.
For isolated payment estimates, use the Funding Rate Calculator.
For price paths, execution assumptions and combined strategies, open the full Workbench. Inputs are not transferred automatically.
For all model conventions, read the methodology, or browse all tools.