Clearinghouse
Once two orders match, the trade still has to become a valid financial result. The clearinghouse performs that settlement for every Novrinex market.
It records who owns collateral, how positions changed, where fees went, and which account paid or received realized profit and loss. A fill becomes final only when the complete accounting entry succeeds.
A balanced ledger
Section titled “A balanced ledger”Every movement is written as a journal entry with an explicit debit and credit. Each asset balances independently inside the entry.
Trading fees move to the market’s fee collector. Realized profit and loss settles through its PnL pool. Funding moves value between long and short accounts. Insurance and liquidation use the accounts assigned to the relevant risk domain.
The ledger therefore explains every change in supply and ownership. There is no separate margin balance or unrecorded settlement path outside it.
How positions change
Section titled “How positions change”A position records a signed quantity and an average entry price. Positive quantity is long; negative quantity is short.
Increasing in the same direction produces a new weighted average entry. Reducing a position keeps the entry price for the remaining quantity and realizes profit or loss on the part that closed.
If a trade crosses through zero, the clearinghouse first closes the old position. Any quantity beyond zero opens a new position in the opposite direction at the fill price.
Realized profit and loss
Section titled “Realized profit and loss”For a long position:
realized PnL = (exit price - entry price) × closed quantityFor a short position:
realized PnL = (entry price - exit price) × closed quantityThe market’s price and quantity scales convert the result into settlement-asset units. A positive result credits the trader; a negative result debits the trader.
Unrealized PnL is an estimate of the open position at the mark price. It affects account health but does not become a final ledger transfer until the position closes or another protocol action realizes it.
Maker and taker fees are calculated for each side of a fill according to the market’s schedule. A resting order is the maker and the incoming order is the taker.
The fee and the fill settle together. The final record identifies the role, rate, notional, and amount charged.
Deposits and withdrawals
Section titled “Deposits and withdrawals”A deposit transfers an asset into network custody and credits a selected subaccount. A withdrawal debits available collateral and transfers the corresponding asset out.
Custody and the internal ledger update atomically. A deposit cannot credit trading collateral without receiving the asset, and a withdrawal cannot spend collateral locked behind an order or position.
When settlement fails
Section titled “When settlement fails”The clearinghouse calculates the candidate positions, fees, profit and loss, and journal entries before changing state.
If an account lacks funds, a number exceeds its permitted range, a fill has already been settled, or the journal does not balance, the entire candidate is discarded. Neither side receives a partial update.