> ## Content Index
> Fetch the complete content index at: https://blog.algorover.ai/llms.txt
> Use this file to discover other available public pages before exploring further.

# One losing trade, two P&L figures. Where did the difference come from?
- URL: https://blog.algorover.ai/exchange-pnl-reconciliation-chat-en/
- Published: 2026-11-10T15:57:10.000Z
- Updated: 2026-11-16T08:58:41.000Z
- Description: Match the fills before comparing profit figures. In this OKX case, opening and closing fees explain most of a roughly 2 USDT difference between the exchange and workbench.
- Author: AlgoRover Team
- Tags: Trading Costs, #en

The same trade shows a loss of about 112.86 USDT on one screen and 114.87 USDT on another. Match the underlying fills first, then check whether each figure includes trading fees and funding. In this OKX case, two fee entries explain most of the roughly 2 USDT difference.

A trading bot, an exchange and a strategy workbench can use different definitions for realized P&L and net P&L. When comparing AlgoRover records with the exchange, match the contract, fill identifiers and reporting period before separating price P&L, costs and any remaining difference.

## Which fills belong to each P&L figure?

User · simulated conversation

OKX shows a loss of about 112.86 USDT. The workbench shows about 114.87 USDT. Why the difference?

AI

Check that both figures cover the same contract and opening-to-closing cycle. Look for other fills, funding entries or a position that is only partly closed. Match records using the exchange's fill identifiers.

One order can generate several fills. Recalculate using each fill's actual price, quantity and contract unit, keeping the original precision.

**Match the transactions before explaining the gap**

Two pages labeled profit can include different accounting items. Once the fill set matches, the difference can be broken down. In the source case, fill-by-fill price P&L was approximately −112.8504 USDT.

## How do opening and closing fees change net P&L?

User

The price calculation gives about −112.8504 USDT. What next?

AI

Add the fees for opening and closing that position. In this case, the two charges total about 2.02308 USDT. Deducting them gives −112.8504 − 2.02308 = −114.87348 USDT.

That is close to the workbench's displayed −114.87 USDT. These fees explain most of the roughly 2 USDT difference.

| Item                        | Amount in this case   |
| --------------------------- | --------------------- |
| Price P&L from actual fills | About −112.8504 USDT  |
| Combined trading fees       | About 2.02308 USDT    |
| After those fees            | About −114.87348 USDT |
| Workbench display           | About −114.87 USDT    |

**Attach each part of the difference to an account entry**

Check the opening and closing fee records separately. Look up funding independently and compare whether each page includes it. For another trade, use that trade's actual charges.

![P&L waterfall: −112.8504 USDT of price P&L, less 2.02308 USDT of fees, gives −114.87348 USDT.](https://storage.ghost.io/c/6d/bb/6dbbb7cc-1f93-4cd3-8d75-e3c2cfce055f/content/images/2026/11/pnl-receipt-explain-en.png)

Case breakdown: the small green fee segment takes price P&L down to the net result shown here.

## What if a small difference remains after reconciliation?

User

The exchange displays −112.86, but the calculation is −112.8504\. Can I ignore the remaining amount?

AI

Keep it as a separate unresolved difference. Its cause was not established in this source record. Check exported precision, transaction scope, contract conversion and aggregation rules.

A two-decimal display can affect comparisons, but you need the actual rule and complete records before attributing this specific difference to rounding.

User

So the main gap is explained, and the small residual stays on its own line?

AI

Yes. Separating explained items from the residual lets you continue when another record becomes available.

**Keep full precision through the calculation**

Rounding every intermediate value makes the final difference harder to trace. Keep source precision until the final display step.

## Ask AI to reconcile fills, fees and funding

User

Ask AI with this promptCopy

Reconcile this opening-to-closing cycle by fill ID. List each actual fill price, quantity, contract unit, fee and fee currency. Calculate price P&L and net P&L after fees, then check funding and the items included on each page. Preserve full precision and list any unexplained residual separately.

AI

The resulting ledger can be compared line by line with the exchange statement. Keep the matching fill identifiers with any unresolved item.

**Give each figure its own ledger**

Scope, fills, costs and precision provide four concrete places to investigate the next mismatch.

## Trading profit, fees and reconciliation: common questions

### Does trading bot profit always include fees?

Read the page's definition. A figure may show price P&L alone or include opening fees, closing fees and funding. List the accounting items on both sides before comparing.

### Can I compare realized P&L directly with net P&L?

Match completed fills and check each page's fee and funding treatment. Keep unrealized position P&L, realized price P&L and the result after costs separate.

### Should I deduct slippage after using actual fill prices?

Slippage is the difference between expected and actual execution prices. Actual fill prices already reflect that price effect. Deducting an additional estimated slippage amount would count it twice; actual fees and funding remain separate entries.

### What records do I need to reconcile OKX closed-position P&L?

Use the same contract and period, with fill IDs, actual prices, quantities, contract units, fees and fee currencies. Match those with the workbench records, preserve precision and keep any unresolved residual visible.

## Read next

[How trading fees affect profit](https://blog.algorover.ai/how-trading-fees-eat-profit/)

[Why costs can erase a backtest's profit](https://blog.algorover.ai/why-trading-costs-wipe-out-backtest-profits/)

[Explore AlgoRover Live](https://www.algorover.ai/en/live/?utm%5Fsource=algorover%5Fblog&utm%5Fmedium=article%5Fcta&utm%5Fcampaign=exchange-pnl-reconciliation-chat-en&utm%5Fcontent=article%5Fbody%5Ftool)

### Sources

[OKX: trading fee rules](https://www.okx.com/help/trading-fee-rules-faq?ref=blog.algorover.ai)

[QuantConnect: expected prices, fills and slippage](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/slippage/key-concepts?ref=blog.algorover.ai)