Quantum Finance tracks your performance through two distinct layers: a live floating PnL that updates every second while a position is open, and a realized PnL that is locked in when the engine closes the trade. How that realized profit is recorded, split, and surfaced to you depends on whether you are trading in demo or real mode.Documentation Index
Fetch the complete documentation index at: https://quantumfinance.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Floating PnL while a trade is open
As soon as the engine opens a position, the Trading tab begins calculating a live floating PnL based on how far the current market price has moved from your entry price. The formula is:Floating PnL is not written to the database or the smart contract. It is calculated client-side in real time and exists only for display purposes while the engine is running.
Realized PnL on settlement
When the engine closes a trade — whether due to take profit, stop loss, momentum reversal, or scalping timeout — the position is settled. Settlement calculates the final PnL as:lot_size × trade_amount (not the full leveraged amount) as the base for the position. The 100× leverage figure applies to the floating display only. Realized PnL is grounded in the actual dollar amount traded per lot.
Anti-slippage clamping: If a trade closes via stop loss or a timeout, the engine clamps the PnL loss to the strategy’s exact stop-loss threshold. This prevents polling gaps — where the price might have moved past the stop level between updates — from over-penalizing the settlement amount.
| Strategy | SL clamp |
|---|---|
| Scalping | −0.10% |
| Aggressive | −0.20% |
| Momentum | −0.50% |
| Conservative | −0.30% |
The 50/50 profit split
When a trade produces a positive PnL, the settlement engine splits it equally:- 50% goes to you (credited to your user account and reflected in your on-chain vault balance in real mode)
- 50% goes to the Quantum treasury (a protocol fee that funds ongoing development and operations)
TREASURY_FEE_PERCENT constant on the deployed contract. The ledger update credits your balance, and the blockchain sync follows so your on-chain profit figure updates shortly after.
Demo mode PnL
In demo mode, trades are simulated against live market prices using your virtual balance. No on-chain transactions occur. Demo mode applies an artificial win rate boost: when a trade would result in a loss, the engine has an 80% chance of flipping it to a profit of the same absolute value. This makes demo sessions feel consistently positive and is intentional — it lets you explore the engine’s behavior and strategy differences without the frustration of random early losses. Your demo session PnL resets each time you start a new trading session. The cumulative total (total PnL) persists across sessions in your account.Real mode PnL and on-chain profit
In real mode, every trade that closes generates an on-chain record. TheProfitDistributed event is emitted by the TradingVault contract with the user address, user share, and treasury share. The Quantum UI polls this data every 10 seconds and displays it as on-chain profit.
Daily PnL
Daily PnL
The sum of all completed trade PnLs for the current calendar day, across both demo and real modes depending on which mode you are viewing. Resets at midnight UTC.
Total PnL
Total PnL
The cumulative sum of all completed trade PnLs since your account was created, for the current mode (demo or real). This figure persists across sessions and is sourced from your trade history in the database.
On-chain profit
On-chain profit
Only available in real mode. This is the profit balance held in your TradingVault position on BNB Chain, as reported by the contract’s
getUserInfo function. It represents your share of profits from completed real-mode trades and is the amount available for withdrawal via withdrawProfits.The UI syncs this value every 10 seconds from the contract. If you see a discrepancy between the UI figure and the contract directly, wait for the next sync cycle or refresh the page.Trade settlement state
After you press Stop, the engine does not immediately clear. Any open position must close before the session ends. During this window, the Trading tab displays a “PROTOCOL SETTLING…” status. This is normal — the engine is waiting for the current position to hit its take-profit or stop-loss before marking the session as complete.Do not close the browser tab while the engine is in the settling state. If the page is closed mid-settlement, the position may remain as “Running” in the database until the next sync cycle resolves it.